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
verfies that userprovided date exists
public static boolean isValidDate(String date) { DateTimeFormatter f = DateTimeFormatter.ofPattern( "uuuu-MM-dd" ); try { LocalDate localDateBad = LocalDate.parse( (CharSequence) date , f ); } catch ( DateTimeParseException e ) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasDate();", "boolean isSetFoundingDate();", "boolean isSetDate();", "boolean hasStartDate();", "public boolean hasDate() {\n return true;\n }", "private boolean dateExists(){\n SimpleDateFormat dateFormat = getDateFormat();\n String toParse = wheels.getDateTimeString();\n try {\n dateFormat.setLenient(false); // disallow parsing invalid dates\n dateFormat.parse(toParse);\n return true;\n } catch (ParseException e) {\n return false;\n }\n }", "public boolean checkDate() {\n\t\tboolean cd = checkDate(this.year, this.month, this.day, this.hour);\n\t\treturn cd;\n\t}", "public DateAvailableVO checkDateAvailable(String date) {\n\t\treturn null;\n\t}", "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 }", "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 }", "boolean isValidFor (@Nonnull DATATYPE aDate);", "boolean hasFromDay();", "boolean hasEndDate();", "boolean hasDateTime();", "boolean hasAcquireDate();", "public void verifyDate(){\n\n // currentDateandTime dataSingleton.getDay().getDate();\n\n }", "public void checkDate() throws InvalidDateException {\n Date todayDate = new Date();\n if (!todayDate.after(date)) {\n throw new InvalidDateException(\"Date is from the future!\");\n }\n }", "boolean hasOrderDate();", "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}", "boolean hasTradeDate();", "public boolean checkDate(){\n Calendar c = Calendar.getInstance();\n Date currentDate = new Date(c.get(Calendar.DAY_OF_MONTH),c.get(Calendar.MONTH)+1, c.get(Calendar.YEAR));\n return (isEqualOther(currentDate) || !isEarlyThanOther(currentDate));\n\n }", "boolean hasBeginDate();", "String isOoseChangeDateAllowed(Record inputRecord);", "@Test\n public void testDateRangeNoDate() throws Exception {\n Map<String, String> fields = new HashMap<String, String>();\n this.addSingleDayDateRange.invoke(this.lockService, fields);\n \n Assert.assertNull(\"should not contain a time \" + fields.get(\"generatedTimestamp\"), fields.get(\"generatedTimestamp\"));\n }", "@Override\n\tpublic boolean create(Dates obj) {\n\t\treturn false;\n\t}", "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 }", "abstract void birthDateValidity();", "boolean hasSettlementDate();", "private static boolean isDate(final Object obj) {\n return dateClass != null && dateClass.isAssignableFrom(obj.getClass());\n }", "@Override\n public boolean isDateAllowed(LocalDate date) {\n \n return startDates.contains(date) || endDates.contains(date);\n }", "boolean isValidForDate(LocalDate date);", "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 }", "@Test\n public void testDateRangeValidDate() throws Exception {\n Map<String, String> fields = new HashMap<String, String>();\n fields.put(\"generatedTimestamp\", \"12/31/1981\");\n \n this.addSingleDayDateRange.invoke(this.lockService, fields);\n \n Assert.assertEquals(\"does not contain valid date range \" + fields.get(\"generatedTimestamp\"),\n \"12/31/1981..01/01/1982\", fields.get(\"generatedTimestamp\"));\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 }", "boolean hasExpirationDate();", "void checkForValidDate(String dateTime) {\n\n int daysOfMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};\n\n Timestamp now = new Timestamp(new java.util.Date().getTime());\n Timestamp date = Timestamp.valueOf(startDateTime);\n if (date.after(now)) {\n outputError(lineCount + \" - Fatal - \" +\n \"Date / Time later than today's date : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (date.after(now))\n\n StringTokenizer t = new StringTokenizer(dateTime, \"- :.\");\n int year = Integer.parseInt(t.nextToken());\n int month = Integer.parseInt(t.nextToken());\n int day = Integer.parseInt(t.nextToken());\n int hour = Integer.parseInt(t.nextToken());\n int minute = Integer.parseInt(t.nextToken());\n boolean isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));\n if (isLeapYear) daysOfMonth[1] += 1;\n if (year < 1850) {\n outputError(lineCount + \" - Fatal - \" +\n \"Year before 1850 : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (year < 1850)\n\n if (month > 12) {\n outputError(lineCount + \" - Fatal - \" +\n \"Month invalid ( > 12) : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (month > 12)\n\n if (day > daysOfMonth[month-1]) {\n outputError(lineCount + \" - Fatal - \" +\n \"Day invalid ( > no of days in month) : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (day > (daysOfMonth[month-1])\n\n if (hour > 23) {\n outputError(lineCount + \" - Fatal - \" +\n \"Hour invalid ( > 23) : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (hour > 23)\n\n if (minute > 59) {\n outputError(lineCount + \" - Fatal - \" +\n \"Minute invalid ( > 59) : \" +\n startDateTime + \" : \" + station.getStationId(\"\"));\n } // if (minute > 59)\n\n }", "boolean isFilterByDate();", "public boolean selectDate(String dateString);", "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}", "boolean hasExpireDate();", "@Test\n public void testGetDailyListingFromFileSystemInvalidDate() {\n ListingFileHelper instance = new ListingFileHelper();\n\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n GregorianCalendar calendar = new GregorianCalendar(2009, 0, 1);\n List<Listing> result = instance.getDailyListingFromFileSystem(new Date(calendar.getTimeInMillis()));\n \n assertTrue(result.isEmpty());\n }", "private boolean checkDate(String date) {\n return date.matches(regexDate);\n }", "public boolean checkPastDate(boolean said)\n {\n try\n {\n if( date==null ){\n if(this.getDateString()!=null) date = DateHelper.stringToDate(this.getDateString());\n if(super.isMandatory() && date==null)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n } }\n\n }\n catch (Exception e)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n if(date==null)\n {\n if(said)\n {\n super.setMessage(\"Date is no correct\");\n }\n return false;\n }\n if(!date.before(currentDate))\n {\n if(said)\n {\n super.setMessage(\"Date is no correct\");\n }\n return false;\n\n }\n else\n {\n return true;\n }\n }", "public boolean isDate() {\n return false;\n }", "boolean hasDay();", "boolean hasDay();", "boolean hasToDay();", "public boolean hasDate() {\n return fieldSetFlags()[5];\n }", "@Test\n public void testDateRangeInvalidDate() throws Exception {\n Map<String, String> fields = new HashMap<String, String>();\n fields.put(\"generatedTimestamp\", \"foo\");\n \n this.addSingleDayDateRange.invoke(this.lockService, fields);\n \n Assert.assertEquals(\"should not have changed time field \" + fields.get(\"generatedTimestamp\"),\n \"foo\", fields.get(\"generatedTimestamp\"));\n }", "public Boolean validarFecha(LocalDate fechaIngresada);", "@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 boolean checkFutureOrCurrentDate()\n {\n boolean valid = this.check();\n try{\n\n date = DateHelper.stringToDate(this.getDateString());\n if(super.isMandatory() && date==null)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n }\n catch (Exception e)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n if (date != null\n &&\n (date.before(currentDate)))\n {\n super.clearMessage();\n super.setMessage(\"Date should be in future or in present date!\");\n\n return valid && false;\n }\n return valid;\n\n }", "public boolean isDate() {\n if ( expiryDate==null) return false;\n else return expiryDate.isSIPDate();\n }", "private boolean checkdates(java.util.Date date,java.util.Date date2)\n\t{\n\t\tif (date==null||date2==null) return true;\n\t\tif (!date.after(date2)&&!date.before(date2))return true;\n\t\treturn date.before(date2);\n\t}", "public boolean isSetDate() {\n return EncodingUtils.testBit(__isset_bitfield, __DATE_ISSET_ID);\n }", "public Date getValidFrom();", "public void setValidFrom(Date validFrom);", "public boolean isExist(Date date) {\n return mysqlDao.isExist(date);\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 }", "private boolean checkDate(PoliceObject po, LocalDate start, LocalDate end) {\n LocalDate formattedEvent = LocalDate.parse(po.getDate());\n boolean isAfter = formattedEvent.isAfter(start) || formattedEvent.isEqual(start);\n boolean isBefore = formattedEvent.isBefore(end) || formattedEvent.isEqual(end);\n return (isAfter && isBefore);\n }", "void validateDates(ComponentSystemEvent event);", "public static boolean isValidCreationTime(Date date) {\r\n \treturn \t(date!=null) &&\r\n \t\t\t(date.getTime()<=System.currentTimeMillis());\r\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}", "private boolean hasDateThreshold() {\r\n if (entity.getExpirationDate() == null) {\r\n return false;\r\n }\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.add(Calendar.MONTH, 1);\r\n if (entity.getExpirationDate().before(calendar.getTime())) {\r\n return true;\r\n }\r\n return false;\r\n }", "boolean isSetAppliesDateTime();", "private static void checkForParsableDate(AnalysisResults.Builder analysisBuilder) {\n Stream<String> dates =\n getTokensFromRawText(analysisBuilder.getRawText().get()).filter(ReceiptAnalysis::isDate);\n // Assume that the first date on the receipt is the transaction date.\n Optional<String> firstDate = dates.findFirst();\n\n firstDate.ifPresent(date -> ReceiptAnalysis.addDateIfValid(analysisBuilder, date));\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}", "public boolean isValidDate() {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(mDate.getDate());\n int yearNow = cal.get(Calendar.YEAR);\n int monthNow = cal.get(Calendar.MONTH);\n int dayNow = cal.get(Calendar.DAY_OF_MONTH);\n cal.setTimeInMillis(selectedDate.getTimeInMillis());\n int yearSelected = cal.get(Calendar.YEAR);\n int monthSelected = cal.get(Calendar.MONTH);\n int daySelected = cal.get(Calendar.DAY_OF_MONTH);\n if (yearSelected <= yearNow) {\n if (monthSelected <= monthNow) {\n return daySelected >= dayNow;\n }\n }\n return true;\n }", "public boolean checkDate(int year, int month, int day) {\n\t\tboolean cd = checkDate(year, month, day, 0.0);\n\t\treturn cd;\n\t}", "public void setValidUntil(Date validUntil);", "public final void testNoDate() {\n testTransaction1.setDate(null);\n assertFalse(testTransaction1.isValidTransaction());\n }", "@Override\n public boolean isValid() {\n return dateFrom != null && dateTo != null;\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}", "public boolean checkCurrentDate()\n {\n boolean valid = this.check();\n if(!valid) return valid;\n\n try{\n\n date = DateHelper.stringToDate(this.getDateString());\n if(super.isMandatory() && date==null)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n }\n catch (Exception e)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n\n if (date != null\n &&\n (date.after(currentDate) || date.equals(currentDate)))\n {\n super.clearMessage();\n super.setMessage(FacesHelper.getBundleMessage(\"date_after_current\"));\n\n return valid && false;\n }\n return valid;\n }", "public boolean isDate(Date date){\r\n if((new Date()).getTime() < date.getTime()) return false;\r\n return true;\r\n }", "public boolean validateDate(TradeModel tradeModel)\n {\n int i = tradeModel.getMaturityDate().compareTo(LocalDate.now());\n if (i<0)\n return false;\n else\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 }", "public boolean verificarFechaEspecifica(Date fecha){\n if(fecha==null|| fecha.equals(\"\")){\n return false;\n }else{\n return true;\n }\n }", "public interface DateValidator {\n\n boolean isDateValid(String date);\n}", "private void givenExchangeRateExistsForABaseAndDate() {\n }", "public boolean isSetCreateDate() {\n return this.createDate != null;\n }", "public boolean isSetCreateDate() {\n return this.createDate != null;\n }", "protected Date findFirstGenDate(GenCtx ctx)\n\t{\n\t\treturn EX.assertn(ctx.get(Date.class));\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 }", "@Test\n public void testV4HeaderDateValidationSuccess()\n throws MalformedResourceException {\n LocalDate now = LocalDate.now();\n String dateStr = DATE_FORMATTER.format(now);\n testRequestWithSpecificDate(dateStr);\n\n // Case 2: Valid date with in range.\n dateStr = DATE_FORMATTER.format(now.plus(1, DAYS));\n testRequestWithSpecificDate(dateStr);\n\n // Case 3: Valid date with in range.\n dateStr = DATE_FORMATTER.format(now.minus(1, DAYS));\n testRequestWithSpecificDate(dateStr);\n }", "private boolean CheckAvailableDate(TimePeriod tp)\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query = \"SELECT * FROM Available WHERE available_hid = '\"+hid+\"' AND \"+\n\t\t\t\t\t\t\t\"startDate = '\"+tp.stringStart+\"' AND endDate = '\"+tp.stringEnd+\"'\"; \n\t\t\t\n\t\t\tResultSet rs = con.stmt.executeQuery(query); \n\t\t\t\n\t\t\tcon.closeConnection();\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\treturn true; \n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "private static void addDateIfValid(AnalysisResults.Builder analysisBuilder, String date) {\n String separator = date.contains(\"-\") ? \"-\" : \"/\";\n String formatterPattern = \"M\" + separator + \"d\" + separator;\n\n // Determine if the date has 2 or 4 digits for the year\n if (date.lastIndexOf(separator) + 3 == date.length()) {\n formatterPattern += \"yy\";\n } else {\n formatterPattern += \"yyyy\";\n }\n\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(formatterPattern);\n\n try {\n ZonedDateTime dateAndTime = LocalDate.parse(date, formatter).atStartOfDay(ZoneOffset.UTC);\n dateAndTime = fixYearIfInFuture(dateAndTime);\n\n long timestamp = dateAndTime.toInstant().toEpochMilli();\n analysisBuilder.setTransactionTimestamp(timestamp);\n } catch (DateTimeParseException e) {\n // Invalid month or day\n return;\n }\n }", "private boolean checkValidDay() {\n return numDays >= 0 && numDays <= 7;\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 static boolean checkExpDate(String cS_exp_date) {\n\t\t\n\t\t\n\t\treturn true;\n\t}", "public boolean validateDate(String date) {\n\n\t\tDate enteredDate = null;\n\t\ttry {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\tenteredDate = format.parse(date);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDate currentDate = new Date();\n\t\treturn enteredDate.before(currentDate);\n\t}", "public static boolean isValidDOB(String userInput) {\n \n return Pattern.matches(Constants.DATE_VALIDATION, userInput);\n }", "public boolean checkFutureDate(String message)\n {\n boolean valid = this.check();\n if(!valid) return valid;\n try{\n\n date = DateHelper.stringToDate(this.getDateString());\n if(super.isMandatory() && date==null)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n }\n catch (Exception e)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n if (date != null\n &&\n (date.before(currentDate)|| date.equals(currentDate)))\n {\n super.clearMessage();\n super.setMessage(\"Date should be in future!\");\n\n return valid && false;\n }\n return valid;\n }", "public boolean checkReservationDateFromToday(String resMonth, String resDay, String resYear){\n int daysDiff,monthDiff,yearDiff; //date difference\n int monthToday,dayToday,yearToday; //date today\n int monthReserved,dayReserved,yearReserved; //date of reservation\n \n //date of reservation\n String sMonth,sDay,sYear;\n sMonth = resMonth;\n sDay = resDay;\n sYear = resYear;\n \n getCurrentDate(); //call to get current date\n \n boolean dateValid = false;\n sMonth = convertMonthToDigit(sMonth); //convert string month to string number\n \n monthToday = parseInt(month);\n dayToday = parseInt(day);\n yearToday = parseInt(year);\n \n //convert to integer\n monthReserved = parseInt(sMonth);\n dayReserved = parseInt(sDay);\n yearReserved = parseInt(sYear);\n \n //get the difference\n monthDiff = monthReserved - monthToday;\n daysDiff = dayReserved - dayToday;\n yearDiff = yearReserved - yearToday;\n \n System.out.println(\"startMonth: \"+ sMonth);\n System.out.println(\"yearDiff: \" + yearDiff);\n System.out.println(\"daysDiff: \" + daysDiff);\n System.out.println(\"monthDiff: \" + monthDiff);\n \n if(yearDiff > 0){ //next year\n return true;\n }\n \n if(yearDiff == 0){ //this year\n if(monthDiff >= 0){\n if(monthDiff == 0 && daysDiff == 0){ //cannot reserve room on the day\n //invalid day, the date is today\n dateValid = false;\n System.out.println(\"reservation day must not today.\");\n }else if(monthDiff==0 && daysDiff < 0){ // same month today, invalid day diff\n dateValid = false; \n System.out.println(\"reservation day must not in the past\");\n }else if(monthDiff>0 && daysDiff < 0){ //not the same month today, accept negative day diff\n dateValid = true;\n }else{ //the same month and valid future day\n dateValid = true;\n }\n }else{\n //invalid month\n System.out.println(\"reservation month must not in the past.\");\n }\n }else{\n //invalid year\n System.out.println(\"reservation year must not in the past.\");\n }\n \n return dateValid;\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 }", "boolean doesFileExist(String date)\n throws FlooringMasteryPersistenceException;", "public static void valDate() {\n Scanner input = new Scanner(System.in);\n try {\n LocalDate dateObj = LocalDate.parse(date);\n } catch (DateTimeParseException ex) {\n System.err.println(\"Invalid date, please insert a valid date with pattern yyyy-MM-dd\");\n date = input.next();\n valDate();\n }\n }", "abstract public Date getServiceAppointment();", "private void checkCorrectDateFormat(String date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.getDefault());\n sdf.setLenient(false);\n try {\n sdf.parse(date);\n } catch (ParseException e) {\n throw new IllegalArgumentException(\n \"Google Calendar Event Date must follow\" + \" the format: \\\"yyyy-MM-dd'T'HH:mm:ss\\\"\");\n }\n }", "public boolean containsDomainValue(Date date) { return true; }", "@Test(expected = IllegalDateException.class)\n\tpublic void testBookStartDateInPast() throws Exception {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.HOUR, -2);\n\t\t// start is current date - 2\n\t\tDate invalidStartDate = cal.getTime();\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), invalidStartDate, validEndDate);\n\t}" ]
[ "0.7475941", "0.73652434", "0.70762944", "0.69757175", "0.6805621", "0.6766508", "0.67614", "0.6754595", "0.6679524", "0.66694903", "0.6582997", "0.6582038", "0.6491525", "0.6431794", "0.6403202", "0.63824856", "0.6344069", "0.63314456", "0.63260436", "0.63015425", "0.6277517", "0.6227825", "0.6213158", "0.6211816", "0.62081194", "0.62078273", "0.61927915", "0.61915386", "0.6186345", "0.61824286", "0.6175773", "0.6175429", "0.6159756", "0.614736", "0.614382", "0.61422175", "0.61231047", "0.6123001", "0.6122941", "0.6120268", "0.61035407", "0.6103221", "0.609064", "0.608873", "0.6083931", "0.6083931", "0.6082719", "0.6072681", "0.6067446", "0.60657465", "0.6062552", "0.60429424", "0.6040716", "0.6038337", "0.6026597", "0.60134214", "0.60115844", "0.5991427", "0.5979832", "0.59661555", "0.59626704", "0.5957076", "0.5953831", "0.5947881", "0.59423876", "0.5942304", "0.5936745", "0.5932106", "0.59267694", "0.5918219", "0.59142363", "0.5906921", "0.5903439", "0.5895537", "0.5889099", "0.58876824", "0.58592427", "0.5856599", "0.5854527", "0.5849854", "0.584625", "0.584625", "0.5845063", "0.58426267", "0.5842307", "0.5840137", "0.5831762", "0.5825955", "0.58199084", "0.5817412", "0.58050114", "0.5801509", "0.5799069", "0.5794758", "0.579433", "0.5788984", "0.5786115", "0.57820237", "0.57636535", "0.57628185", "0.5761265" ]
0.0
-1
Function to find minimum adjacent difference arr[]: input array n: size of array
public static int minAdjDiff(int arr[], int n) { // Your code here int min = Math.abs(arr[0] - arr[1]); for(int i =1;i<n-1;i++){ min = Math.min(min, Math.abs(arr[i]-arr[i+1])); } min = Math.min(min, Math.abs(arr[n-1]-arr[0])); return min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<List<Integer>> minimumAbsDifference(int[] arr) {\n\n int minNum = 10000000;\n int maxNum = -10000000;\n for (int num : arr) {\n if (num < minNum)\n minNum = num;\n\n if (maxNum < num)\n maxNum = num;\n }\n int[] cnt = new int[maxNum - minNum + 1];\n for (int num : arr)\n cnt[num - minNum] += 1;\n\n int ind = 0;\n for (int i = 0; i < maxNum - minNum + 1; i++) {\n for (int j = 0; j < cnt[i]; j++) {\n arr[ind] = i + minNum;\n ind += 1;\n }\n }\n\n List<List<Integer>> ret = new ArrayList<>();\n\n int minDiff = 10000000;\n for (int i = 0; i < arr.length - 1; i++) {\n int diff = arr[i + 1] - arr[i];\n if (minDiff > diff)\n minDiff = diff;\n }\n\n for (int i = 0; i < arr.length - 1; i++) {\n int diff = arr[i + 1] - arr[i];\n if (diff == minDiff)\n addPair(ret, arr[i], arr[i + 1]);\n }\n\n return ret;\n }", "static int findMinDiff(int arr[], int n, int m) {\n\t\tif (m == 0 || n == 0)\r\n\t\t\treturn 0;\r\n\r\n\t\t// Sort the given packets\r\n\t\tArrays.sort(arr);\r\n\r\n\t\t// Number of students cannot be more than\r\n\t\t// number of packets\r\n\t\tif (n < m)\r\n\t\t\treturn -1;\r\n\r\n\t\t// Largest number of chocolates\r\n\t\tint min_diff = Integer.MAX_VALUE;\r\n\r\n\t\t// Find the subarray of size m such that\r\n\t\t// difference between last (maximum in case\r\n\t\t// of sorted) and first (minimum in case of\r\n\t\t// sorted) elements of subarray is minimum.\r\n\t\tint first = 0, last = 0;\r\n\t\tfor (int i = 0; i + m - 1 < n; i++) {\r\n\t\t\tint diff = arr[i + m - 1] - arr[i];\r\n\t\t\tif (diff < min_diff) {\r\n\t\t\t\tmin_diff = diff;\r\n\t\t\t\tfirst = i;\r\n\t\t\t\tlast = i + m - 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (arr[last] - arr[first]);\r\n\t}", "public int minDifference(int[] nums) {\n int n = nums.length;\n // if we have less than or equal to 4 elements in the array, we can always get 0 min diff\n if (n <= 4) return 0;\n int res = Integer.MAX_VALUE;\n // the array must be sorted beforehand\n Arrays.sort(nums);\n // enumerate all 4 options\n for (int i = 0; i <= 3; i++) {\n // get the min difference from new smallest and largest\n // after removing i elements from the front and (3 - i) elements from the end\n res = Math.min(res, nums[n - 1 - (3 - i)] - nums[i]);\n }\n return res;\n }", "static int minimumAbsoluteDifferenceSlower(int[] arr) {\n int smallest = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n int current = Math.abs(arr[i] - arr[j]);\n if (i == 0) {\n smallest = current;\n } else if (smallest > current) {\n smallest = current;\n }\n }\n }\n\n return smallest;\n }", "public int minDifference2(int[] array) {\n\t\tint sum = sum(array);\n\t\tboolean[][] matrix = new boolean[array.length][sum + 1];\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j <= sum; j++) {\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tmatrix[i][j] = (j == 0) || (array[i] == j);\n\t\t\t\t} else {\n\t\t\t\t\tmatrix[i][j] = matrix[i - 1][j] || (j - array[i] >= 0 && matrix[i - 1][j - array[i]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// post processing\n\t\tint offset = 0, index = sum / 2;\n\t\twhile (!matrix[array.length - 1][index + offset] && !matrix[array.length - 1][index - offset]) {\n\t\t\toffset++;\n\t\t}\n\t\treturn Math.min(\n\t\t\t\t(matrix[array.length - 1][index - offset]) ? Integer.MAX_VALUE : Math.abs(sum - 2 * (index - offset)),\n\t\t\t\t(matrix[array.length - 1][index + offset]) ? Integer.MAX_VALUE : Math.abs(sum - 2 * (index + offset)));\n\t}", "public static int minimumAbsoluteDifference(int[] arr) {\n Arrays.sort(arr);\n int smallest = Math.abs(arr[0] - arr[arr.length - 1]);\n\n for (int i = 0; i < arr.length; i++) {\n if (i + 1 < arr.length) {\n int current = Math.abs(arr[i + 1] - arr[i]);\n if (smallest > current) {\n smallest = current;\n }\n }\n }\n\n return smallest;\n }", "static int[] closestNumbers(int[] arr) {\n\t\t\n \tList<Integer> res = new ArrayList<Integer>();\n \tArrays.sort(arr);\n \tint min=arr[1]-arr[0];\n \tres.add(arr[0]);\n \tres.add(arr[1]);\n \tfor(int i=2;i<arr.length;i++) {\n \t\tint nMin = arr[i]-arr[i-1];\n \t\tif(nMin<min) {\n \t\t\tres.clear();\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t\tmin=nMin;\n \t\t}else if(nMin==min) {\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t}\n \t}\n \tint res_f [] = new int[res.size()];\n \tfor(int j=0; j<res_f.length; j++) {\n \t\tres_f[j]=res.get(j);\n \t} \n \treturn res_f;\n }", "static int minJumps(int[] arr){\n int n = arr.length;\n int[] dp = new int[n];\n for(int i = 0; i < n; i++) dp[i] = Integer.MAX_VALUE;\n dp[0] = 0;\n for(int i = 1; i < n; i++){\n //checking from 0 to index i that if there is a shorter path for \n //current position to reach from any of the previous indexes\n //also previous index should not be MAX_VALUE as this will show that\n //we were not able to reach this particular index\n for(int j = 0; j < i; j++){\n if(dp[j] != Integer.MAX_VALUE && arr[j] + j >= i){\n if(dp[j] + 1 < dp[i]){\n dp[i] = dp[j] + 1;\n }\n }\n }\n }\n \n if(dp[n - 1] != Integer.MAX_VALUE){\n return dp[n - 1];\n }\n \n return -1;\n }", "public static int minValueToBalance(int a[], int n) {\n int sum1 = 0;\n for (int i = 0; i < n / 2; i++)\n sum1 += a[i];\n\n // Calculating sum of other half\n // elements of an array\n int sum2 = 0;\n for (int i = n / 2; i < n; i++)\n sum2 += a[i];\n\n // calculating difference\n return Math.abs(sum1 - sum2);\n }", "static int minimumDistances(int[] a) {\n int l = a.length;\n Map<Integer, List<Integer>> map = new HashMap<>();\n for (int i = 0; i <l ; i++) {\n List<Integer> val = map.get(a[i]);\n if(val == null){\n val = new ArrayList<>();\n }\n val.add(i);\n map.put(a[i], val);\n }\n int min = Integer.MAX_VALUE;\n for (List<Integer> value:\n map.values()) {\n int c = value.size();\n if(c>1){\n for (int i = 0; i < c-1 ; i++) {\n min = Math.min(min, value.get(i+1)- value.get(i));\n }\n }\n }\n if(min == Integer.MAX_VALUE) min = -1;\n return min;\n\n\n }", "@Test\n public void minDifferenceTest() {\n assertEquals(0, minDifference(new int[]{5, 3, 2, 4}));\n /**\n * Example 2:\n * Input: nums = [1,5,0,10,14]\n * Output: 1\n * Explanation: Change the array [1,5,0,10,14] to [1,1,0,1,1].\n * The difference between the maximum and minimum is 1-0 = 1.\n */\n assertEquals(1, minDifference(new int[]{1, 5, 0, 10, 14}));\n /**\n * Example 3:\n * Input: nums = [6,6,0,1,1,4,6]\n * Output: 2\n */\n assertEquals(2, minDifference(new int[]{6, 6, 0, 1, 1, 4, 6}));\n /**\n * Example 4:\n * Input: nums = [1,5,6,14,15]\n * Output: 1\n */\n assertEquals(1, minDifference(new int[]{1, 5, 6, 14, 15}));\n /**\n * Example 5:\n * Input: nums = [82,81,95,75,20]\n * Output: 1\n */\n assertEquals(1, minDifference(new int[]{82, 81, 95, 75, 20}));\n }", "private static int MinJumps(int array[], int n)\n\t{\n\t int[] jumps_array = new int[n];\n\t if (n == 0 || array[0] == 0)\n\t {\n\t return Integer.MAX_VALUE;\n\t }\n\t jumps_array[0] = 0;//initializing jumps_array\n\t for (int i = 1; i < n; ++i)\n\t {\n\t jumps_array[i] = Integer.MAX_VALUE;\n\t }\n\t for (int i = 1; i < n; i++)\n\t {\n\t for (int j = 0; j < i; j++)\n\t {\n\t if (i <= j + array[j] && jumps_array[j] != Integer.MAX_VALUE)//minimum number jumps to reach i \n\t {\n\t jumps_array[i] = min(jumps_array[i], jumps_array[j] + 1);//by comparing with previous points\n\t break;\n\t }\n\t }\n\t }\n\t return jumps_array[n-1];\n\t}", "int maxIndexDiff(int arr[], int n)\n {\n int maxDiff;\n int i, j;\n\n int rightMax[] = new int[n];\n int leftMin[] = new int[n];\n\n /* Construct leftMin[] such that leftMin[i] stores the minimum value\n from (arr[0], arr[1], ... arr[i]) */\n leftMin[0] = arr[0];\n for (i = 1; i < n; ++i) {\n leftMin[i] = min(arr[i], leftMin[i - 1]);\n }\n\n\n /* Construct rightMax[] such that rightMax[j] stores the maximum value from (arr[j], arr[j+1], ..arr[n-1]) */\n rightMax[n - 1] = arr[n - 1];\n for (j = n - 2; j >= 0; --j) {\n rightMax[j] = max(arr[j], rightMax[j + 1]);\n }\n\n\n /* Traverse both arrays from left to right to find optimum j - i This process is similar to merge() of MergeSort */\n i = 0; j = 0; maxDiff = 0;\n while (j < n && i < n) {\n if (leftMin[i] < rightMax[j]) {\n maxDiff = max(maxDiff, j - i);\n j = j + 1;\n } else {\n i = i + 1;\n }\n\n }\n\n return maxDiff;\n }", "static int minimumSwaps(int[] arr) {\n int arrLen = arr.length;\n int minSwaps = 0;\n boolean visited[] = new boolean[arrLen];\n for ( int i = 0; i < arrLen ; i++){\n if ( arr[i] == i+1){\n visited[i] = true;\n continue;\n }\n else if ( !visited[arr[i] - 1]){\n visited[i] = true;\n int temp = arr[i];\n int hops = 1;\n while ( temp != i+1 ){\n visited[temp - 1] = true;\n temp = arr[temp -1];\n hops++;\n }\n minSwaps += hops - 1;\n }\n }\n return minSwaps;\n }", "public int findMinII(int[] nums) {\n int n = nums.length;\n int l = 0;\n int r = n - 1;\n int m;\n while (l + 1 < r) {\n while (r > 0 && nums[r] == nums[r-1]) r --;\n while (l < n-1 && nums[l] == nums[l+1]) l ++;\n m = (l + r) / 2;\n if (nums[m] > nums[l]) {\n l = m;\n }\n else if (nums[m] < nums[r]) {\n r = m;\n }\n }\n return Math.min(nums[0], Math.min(nums[l], nums[r]));\n }", "static int minimumSwaps2(int[] arr) {\n Map<Integer, Integer> backward = new HashMap<>();\n Map<Integer, Integer> forward = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n int move = i + 1 - arr[i];\n if (move > 0)\n forward.put(arr[i], move);\n else if (move < 0)\n backward.put(arr[i], move);\n }\n\n //count swap in pairs\n int pairs = 0;\n for (Integer bk : backward.keySet()) {\n for (Integer fk : forward.keySet()) {\n if (backward.get(bk) * (-1) == forward.get(fk)) {\n pairs = pairs + 1;\n continue;\n }\n }\n }\n //count swap others\n int swapCount = forward.size() + backward.size() - (2 * pairs);\n if (swapCount > 0) swapCount = swapCount - 1;\n\n System.out.println(String.format(\n \"forward(%d):%s\\nbackeward(%d):%s\\neach: %d, swap: %d\"\n , forward.size(), forward, backward.size(), backward,\n pairs, swapCount\n ));\n\n return swapCount + pairs;\n }", "public static void minMaxDifference() {\n //int arr[] = {4,3,5,6,7,1,2};\n int arr[] = {6, 1, 7, -1, 3, 5, 9};\n int min_number = Integer.MAX_VALUE;\n int max_diff = Integer.MIN_VALUE;\n int current_difference;\n for (int i = 0; i < arr.length; i++) {\n if (arr[i] < min_number)\n min_number = arr[i];\n current_difference = arr[i] - min_number;\n if (current_difference > max_diff)\n max_diff = current_difference;\n }\n System.out.println(\"Max diff : \" + max_diff);\n }", "public static int minimumAbsoluteDifference(Integer[] input){\n List<Integer> sortedList = Arrays.asList(input);\n Collections.sort(sortedList);\n\n int minimumAbsoluteDifference = Integer.MAX_VALUE;\n\n for(int i = 0; i < sortedList.size() - 1; i ++){\n int currentAbsoluteDifference = Math.abs(sortedList.get(i) - sortedList.get(i + 1));\n\n if(currentAbsoluteDifference < minimumAbsoluteDifference){\n minimumAbsoluteDifference = currentAbsoluteDifference;\n }\n }\n\n return minimumAbsoluteDifference;\n }", "static int minimumSwaps(int[] arr) {\r\n int result = 0;\r\n \r\n // Gets the length of the input array\r\n int size = arr.length;\r\n \r\n // Cycles through the input array\r\n for (int i = 0; i < size; i++) {\r\n // Checks if the element is in the right position\r\n if (arr[i] != i+1) {\r\n result += 1; // The element ISN'T in the right position. A new swap is needed!\r\n \r\n // Cycles through the remaining input array\r\n for (int j = i+1; j < size; j++) {\r\n if (arr[j] == i+1) { // Gets the element that should be in the place of arr[i] and swaps it!\r\n int swap = arr[j];\r\n arr[j] = arr[i];\r\n arr[i] = swap;\r\n break;\r\n }\r\n } \r\n }\r\n }\r\n \r\n return result;\r\n}", "public static int frog(int n, int [] h){\n\n int dp[] = new int [n];\n\n dp[0] = 0;\n dp[1] = Math.abs(h[1] - h[0]);\n\n for(int i = 2; i < n ; i ++){\n\n dp[i] = Math.min(dp [i - 2] + Math.abs(h[i] - h[i - 2]), dp[i - 1] + Math.abs(h[i] - h[i - 1]));\n\n\n\n }\n //print(dp);\n return dp[n - 1];\n }", "static int maxIndexDiff(int arr[], int n) { \n int max = 0;\n int i = 0;\n int j = n - 1;\n while (i <= j) {\n if (arr[i] <= arr[j]) {\n if (j - i > max) {\n max = j - i;\n }\n i += 1;\n j = n - 1;\n }\n else {\n j -= 1;\n }\n }\n return max;\n // Your code here\n \n }", "static int minSwap (int arr[], int n, int k) {\n int c=0;\n for(int i=0;i<n;i++)\n {\n if(arr[i]<=k)\n ++c;\n }\n int c1=0;\n int start=0,end=c;\n for(int j=0;j<end;j++)\n {\n if(arr[j]>k)\n ++c1;\n }\n int minans=c1;\n while(end<n)\n {\n if(arr[start]>k)\n --c1;\n if(arr[end]>k){\n ++c1;\n }\n minans=Math.min(minans,c1);\n start++;\n end++;\n }\n return minans;\n //Complete the function\n }", "public int minPatches(int[] nums, int n) {\n\t\tint index = 0;\n\t\tint ans = 0;\n\t\tlong currentRange = 0; // 当前能覆盖到的最大范围,必须从0开始\n\n\t\twhile (currentRange < n) {\n\t\t\tif (index < nums.length && nums[index] <= currentRange + 1) {\n\t\t\t\tcurrentRange = currentRange + nums[index];\n\t\t\t\tindex++;\n\t\t\t} else {\n\t\t\t\tans++;\n\t\t\t\tcurrentRange = currentRange * 2 + 1; // 增添currentRange+1可以让currentRange增长的最快同时保证中间不出现裂口\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ans;\n\t}", "private static int maxDifference(int[] arr) {\n\t\tint maxDiff = arr[1] - arr[0];\n\t\tint minElement = arr[0];\n\t\t\n\t\tfor(int i = 1 ; i < arr.length; i++)\n\t\t{\n\t\t\tif(arr[i] - minElement > maxDiff)\n\t\t\t{\n\t\t\t\tmaxDiff = arr[i] - minElement;\n\t\t\t}\n\t\t\tif(arr[i] < minElement)\n\t\t\t{\n\t\t\t\tminElement = arr[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn maxDiff;\n\t}", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "void findLeadrsInArray1(int[] a){\n\t\tint n = a.length;\n\t\tboolean flag = true;\n\t\tfor(int i =0;i<n;i++){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(a[i] < a[j]){\n\t\t\t\t\tflag = false; \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(flag != false){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int noOfElements = sc.nextInt();\n int[] arr = new int[noOfElements];\n int[] arr1 = new int[noOfElements];\n int diff = Integer.MAX_VALUE;\n int sIndex = 0;\n int j = 0;\n for (int i = 0; i < noOfElements; i++) {\n arr[i] = sc.nextInt();\n }\n for (int j1 = 1; j1 < noOfElements; j1++) {\n int i = j1 - 1;\n int key = arr[j1];\n while (i >= 0 && key < arr[i]) { // 1 2 3\n arr[i + 1] = arr[i];\n i--;\n }\n arr[i + 1] = key;\n }\n //Arrays.sort(arr);\n for (int i = 0; i < noOfElements - 1; i++) {\n int temp = Math.abs(arr[i] - arr[i + 1]);\n if (temp <= diff) {\n diff=temp;\n }\n\n }\n\n for (int i = 0; i < noOfElements - 1; i++) {\n if (Math.abs(arr[i] - arr[i+1]) == diff) {\n System.out.print(arr[i] + \" \" + arr[i+1] + \" \");\n }\n }\n// for (int a = 0; a < j; a++) {\n//\n// System.out.print(arr[arr1[a]] + \" \" + arr[arr1[a]+1] + \" \");\n// }\n\n }", "static int minimumSwaps(int[] arr) {\n int length = arr.length;\n int swaps = 0;\n int ind = 0;\n int temp = 0;\n int count = 0;\n for(int i=0;i<length;i++)\n {\n if(i+1 != arr[i])\n {\n count++;\n ind = index(arr,i+1,i);\n if(ind != -1){\n temp = arr[i];\n arr[i] = arr[ind];\n arr[ind] = temp;\n }\n }\n }\n\n return count;\n }", "public static int firstRepeated(int[] arr, int n) {\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n - 1; i++) {\n int index = LinearSearch.iterative(arr, i + 1, n - 1, arr[i]);\n if (index != -1) {\n if (i < min) {\n min = i;\n }\n }\n }\n if (min == Integer.MAX_VALUE) {\n return -1;\n } else {\n return min + 1;\n }\n }", "public int minimumSwaps(int[] arr){\n\t\t/*\n\t\t * for each element check it's ideal position then swap with ideal position, if swap needed swap and increment swap count.\n\t\t */\n\t\tint swapCount = 0;\n\t\tif(arr==null || arr.length <2){\n\t\t\treturn swapCount;\n\t\t}\n\t\tfor(int i=0; i<arr.length; i++){\n\t\t\tint element = arr[i];\n\t\t\tint idealIndex = element-1;\n\t\t\tif(i!=idealIndex) {\n\t\t\t\tint temp = arr[i];\n\t\t\t\tarr[i] = arr[idealIndex];\n\t\t\t\tarr[idealIndex] = temp;\n\t\t\t\tswapCount++;\n\t\t\t}\n\t\t}\n\t\treturn swapCount;\n\t}", "public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }", "public static void main(String[] args) {\n int [] array1 = {30,12,5,9,2,20,33,1};\n int [] array2 = {18,25,41,47,17,36,14,19};\n int a=array1.length;\n int b=array2.length;\n System.out.println(\"The lowest differenc between two array is :\"+findLowestDiff(array1,array2,a,b));\n\n\n\n\n }", "public int findMin(int[] nums) {\n int n = nums.length;\n int l = 0;\n int r = n - 1;\n int m;\n while (l + 1 < r) {\n m = (l + r) / 2;\n if (nums[m] > nums[l]) {\n l = m;\n }\n else if (nums[m] < nums[r]) {\n r = m;\n }\n }\n \n return Math.min(nums[0], Math.min(nums[l], nums[r]));\n }", "public double minDifference()\n {\n double minD = 1000.0; // setting unreasonably high\n double testD = 0.0;\n \n for (int i=0; i < data.length -1; i++) // stopping 1 early because reading ahead\n {\n testD = Math.abs(data[i]-data[i+1]);\n if (testD < minD)\n {\n minD = testD;\n }\n }\n \n \n return minD;\n }", "int arrayMaximalAdjacentDifference(int[] inputArray) {\n\n\t int maximum = Math.abs(inputArray[1]- inputArray[0]);\n\t int result = 0;\n\t for(int i =1; i<inputArray.length-1; i++){\n\t result =Math.abs(inputArray[i+1]- inputArray[i]);\n\t if(result>=maximum){\n\t maximum = result;\n\t }\n\t }\n\t \n\t return maximum;\n\t}", "private static int maxDifferenceBetweenNumbers(int[] arr, int size) {\n\t\tint maximumDifference = 0;\n\t\t// minimum number seen is first element\n\t\tint minimumNumberSeen = arr[0];\n\t\t// Iterate over all the elements in the list\n\t\tfor (int index = 1; index < size; index++) {\n\t\t\t// Calculate the maximum difference and update\n\t\t\tmaximumDifference = Math.max(maximumDifference, arr[index] - minimumNumberSeen);\n\t\t\t// Check and update if number seen is less than minimum see sofar\n\t\t\tminimumNumberSeen = Math.min(minimumNumberSeen, arr[index]);\n\t\t}\n\t\treturn maximumDifference;\n\t}", "long smallestpositive(long[] arr, int n){\n\nArrays.sort(arr);\n\nlong res =1;\n\nfor (int i = 0; i < n && arr[i] <= res; i++)\nres = res + arr[i];\n\nreturn res;\n}", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "public static int firstMissingEffective(int[] x){\n int i = 0;\n while(i<x.length){\n // first two conditions check that element can correspond to index of array\n // third condition checks that they are not in their required position\n // fourth condition checks that there is no duplicate already at their position\n if( x[i]>0 && x[i]<x.length && x[i]-1!=i && x[x[i]-1]!=x[i]) exch(x,i,x[i]-1);\n else i++;\n }\n\n // second pass\n for(int j=0; j < x.length; j++){\n if( x[j]-1!=j) return j+1;\n }\n return x.length+1;\n\n }", "public int minimumCost(int N, int[][] connections) {\n int[] parent = new int[N + 1];\n Arrays.fill(parent, -1);\n Arrays.sort(connections, (a,b) -> (a[2]-b[2]));\n int cnt = 0;\n int minCost = 0;\n \n for(int[] edge: connections){\n int src = edge[0];\n int dst = edge[1];\n int cost = edge[2];\n \n int srcSubsetId = find(parent, src);\n int dstSubsetId = find(parent, dst);\n \n if(srcSubsetId == dstSubsetId) {\n // Including this edge will cause cycles, then ignore it\n continue;\n }\n cnt += 1;\n minCost += cost;\n union(parent, src, dst);\n }\n return cnt==N-1? minCost : -1;\n}", "static int maximumDifferenceSum(int arr[], int N)\n {\n int dp[][] = new int [N][2];\n\n for (int i = 0; i < N; i++)\n dp[i][0] = dp[i][1] = 0;\n\n for (int i = 0; i< (N - 1); i++)\n {\n /* for [i+1][0] (i.e. current modified\n value is 1), choose maximum from\n dp[i][0] + abs(1 - 1) = dp[i][0] and\n dp[i][1] + abs(1 - arr[i]) */\n dp[i + 1][0] = Math.max(dp[i][0],\n dp[i][1] + Math.abs(1 - arr[i]));\n\n /* for [i+1][1] (i.e. current modified value\n is arr[i+1]), choose maximum from\n dp[i][0] + abs(arr[i+1] - 1) and\n dp[i][1] + abs(arr[i+1] - arr[i])*/\n dp[i + 1][1] = Math.max(dp[i][0] +\n Math.abs(arr[i + 1] - 1),\n dp[i][1] + Math.abs(arr[i + 1]\n - arr[i]));\n }\n\n return Math.max(dp[N - 1][0], dp[N - 1][1]);\n }", "public static int minJumpsWithDPInBigOOFN(int arr[], int n) {\r\n\r\n\t\t// The number of jumps needed to reach the starting index is 0\r\n\t\tif (n <= 1)\r\n\t\t\treturn 0;\r\n\r\n\t\t// Return -1 if not possible to jump\r\n\t\tif (arr[0] == 0)\r\n\t\t\treturn -1;\r\n\r\n\t\t// initialization\r\n\t\tint maxReach = arr[0]; // stores all time the maximal reachable index in the array.\r\n\t\tint step = arr[0]; // stores the amount of steps we can still take\r\n\t\tint jump = 1;// stores the amount of jumps necessary to reach that maximal reachable\r\n\t\t\t\t\t\t// position.\r\n\r\n\t\t// Start traversing array\r\n\t\tint i = 1;\r\n\t\tfor (i = 1; i < n; i++) {\r\n\t\t\t// Check if we have reached the end of the array\r\n\t\t\tif (i == n - 1)\r\n\t\t\t\treturn jump;\r\n\r\n\t\t\t// updating maxReach\r\n\t\t\tmaxReach = Integer.max(maxReach, i + arr[i]);\r\n\r\n\t\t\t// we use a step to get to the current index\r\n\t\t\tstep--;\r\n\r\n\t\t\t// If no further steps left\r\n\t\t\tif (step == 0) {\r\n\t\t\t\t// we must have used a jump\r\n\t\t\t\tjump++;\r\n\r\n\t\t\t\t// Check if the current index/position or lesser index\r\n\t\t\t\t// is the maximum reach point from the previous indexes\r\n\t\t\t\tif (i >= maxReach)\r\n\t\t\t\t\treturn -1;\r\n\r\n\t\t\t\t// re-initialize the steps to the amount\r\n\t\t\t\t// of steps to reach maxReach from position i.\r\n\t\t\t\tstep = maxReach - i;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn -1;\r\n\t}", "private int minJumps(int[] arr) {\n int n = arr.length;\n if (n == 1) {\n return 0;\n }\n\n //map to hold the values in the array and the indexes where they are located in\n Map<Integer, List<Integer>> map = new HashMap<>();\n\n for (int i = 0; i < arr.length; i++) {\n /*\n method checks if arr[i] exists in the map, if so, we add the current index to the list of indexes where\n arr[i] is present, otherwise we make a new entry for arr[i]\n */\n map.computeIfAbsent(arr[i], v -> new ArrayList<>()).add(i);\n }\n\n //Queue to hold the indexes j we can jump to starting from 0\n Queue<Integer> queue = new LinkedList<>();\n queue.add(0); //add the first index into the queue\n int steps = 0;\n\n while (!queue.isEmpty()) {\n steps++;\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n int j = queue.remove(); //the current index\n\n //jump to j + 1\n if (j + 1 < n && map.containsKey(arr[j + 1])) {\n if (j + 1 == n - 1) {\n return steps;\n }\n queue.add(j + 1);\n }\n\n //jump to j - 1\n if (j - 1 >= 0 && map.containsKey(arr[j - 1])) {\n queue.add(j - 1);\n }\n\n //jump to index k --> arr[j] == arr[k]\n if (map.containsKey(arr[j])) {\n //search through the list of indexes where arr[j] is present\n for (int k : map.get(arr[j])) {\n if (k != j) {\n //if one of the indexes is the last index, we've gotten to the end, otherwise we add the index to the queue\n if (k == n - 1) {\n return steps;\n }\n queue.add(k);\n }\n }\n }\n //remove the value of arr[j] from the map to avoid overlap\n map.remove(arr[j]);\n }\n }\n return steps;\n }", "public int findLHSOrigin(int[] nums) {\n if (nums.length < 2)\n return 0;\n\n Map<Double, Integer> map = new HashMap<>();\n Set<Integer> set = new HashSet<>();\n for (int i = 0; i < nums.length; i++) {\n map.put(nums[i] - 0.5, map.getOrDefault(nums[i] - 0.5, 0) + 1);\n map.put(nums[i] + 0.5, map.getOrDefault(nums[i] + 0.5, 0) + 1);\n set.add(nums[i]);\n }\n\n int ans = 0;\n for (Double d : map.keySet()) {\n// System.out.println(d +\" \"+ map.get(d));\n if (set.contains((int) (d - 0.5)) && set.contains((int) (d + 0.5))) {\n ans = ans < map.get(d) ? map.get(d) : ans;\n }\n }\n return ans;\n }", "public static int minJumps(int[] arr) {\n Map<Integer, List<Integer>> map = new HashMap<>();\n int n = arr.length;\n int step = 0;\n\n for (int i = 0; i < n; i++) {\n if (!map.containsKey(arr[i])) {\n map.put(arr[i], new ArrayList<>());\n }\n\n map.get(arr[i]).add(i);\n }\n\n Queue<Integer> queue = new LinkedList<>();\n boolean[] visited = new boolean[n];\n queue.offer(0);\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n int pos = queue.poll();\n\n if (pos == n - 1) {\n return step;\n }\n\n if (pos - 1 >= 0 && !visited[pos - 1]) {\n queue.offer(pos - 1);\n visited[pos - 1] = true;\n }\n\n if (pos + 1 < n && !visited[pos + 1]) {\n queue.offer(pos + 1);\n visited[pos + 1] = true;\n }\n\n for (int next: map.get(arr[pos])) {\n if (!visited[next]) {\n queue.offer(next);\n }\n }\n\n // 优化,对于 [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,11] 避免重复将7加入queue\n map.get(arr[pos]).clear();\n }\n step++;\n }\n\n return 0;\n }", "public static int diagonalDifference(List<List<Integer>> arr) {\n int pDia = 0;\n int sDia = 0;\n int counter = arr.size();\n for (int i = 0; i < arr.size(); i++) {\n List<Integer> row = arr.get(i);\n\n pDia = pDia + row.get(i);\n counter = counter-1;\n sDia = sDia + row.get(counter);\n }\n return Math.abs(pDia-sDia) ;\n }", "public static int findMin(int[] nums) {\n\n int lo =0;\n int n = nums.length;\n int hi = n-1;\n int min = nums[lo];\n while(lo<hi){\n while(lo <hi && lo <n-2 && nums[lo]==nums[lo+1] ){\n lo = lo+1;\n }\n while(lo<hi && hi >=1 && nums[hi]== nums[hi-1]){\n hi = hi-1;\n }\n int mid = lo +(hi-lo)/2;\n if(mid-1>=0 && mid+1<=n-1 && nums[mid]<nums[mid-1]&& nums[mid]>nums[mid+1]){\n return nums[mid];\n }\n if(nums[mid]<nums[hi]){\n hi = mid;\n } else {\n lo = mid+1;\n }\n\n\n }\n return nums[lo];\n }", "public int findMin(int[] nums) {\n\t\t// corner\n\t\tif (nums.length == 1) {\n\t\t\treturn nums[0];\n\t\t}\n\t\t// Not rotated.\n\t\tif (nums[0] < nums[nums.length - 1]) {\n\t\t\treturn nums[0];\n\t\t}\n\n\t\t// Binary Search.\n\t\tint left = 0;\n\t\tint right = nums.length - 1;\n\t\t// int right = nums.length; // NG! (R = M version)\n\t\twhile (left <= right) {\n\t\t\t// while (left < right) { // NG! (R = M version)\n\t\t\tint mid = left + (right - left) / 2;\n\n\t\t\t// Find the valley.\n\t\t\t// nums[mid + 1] could cause array index out of bound when nums[mid] is the last\n\t\t\t// element.\n\t\t\t// However, for this problem, when nums[mid] is the second to the last, it\n\t\t\t// returns and\n\t\t\t// nums[mid] never reaches to the last element.\n\t\t\t// R = M version is NG because nums[mid] skips the second to the last and hits\n\t\t\t// the last\n\t\t\t// element depending on the case, in which case, nums[mid + 1] causes array\n\t\t\t// index out of bound.\n\t\t\tif (nums[mid] > nums[mid + 1]) {\n\t\t\t\treturn nums[mid + 1];\n\t\t\t}\n\t\t\t// Assert nums[mid] < nums[mid + 1] (no duplicates)\n\n\t\t\t// nums[mid - 1] could cause array index out of bound when the target is the\n\t\t\t// first element or\n\t\t\t// the second element.\n\t\t\t// However, for this problem, the code above returns when mid is equal to 0.\n\t\t\t// To be exact, when you use R = M - 1 version, mid is approaching index 0 as\n\t\t\t// the following:\n\t\t\t// 1. 2 -> 0 -> 1\n\t\t\t// 2. 3 -> 1 -> 0\n\t\t\t// ex) 1. [ 5, 1, 2, 3, 4 ], 2. [ 6, 1, 2, 3, 4, 5]\n\t\t\t// For case 1, the code above returns when mid is equal to 0, and nums[-1] never\n\t\t\t// occurs.\n\t\t\t// For case 2, the code below returns when mid is equal to 1, and nums[-1] never\n\t\t\t// occurs.\n\t\t\t//\n\t\t\t// Be careful!\n\t\t\t// Not rotated array can cause nums[-1] here for both of the two cases above\n\t\t\t// because\n\t\t\t// the code above does not return when mid is equal to 0, which causes index out\n\t\t\t// of bound here.\n\t\t\t// So, eliminate this case in advance.\n\t\t\tif (nums[mid - 1] > nums[mid]) {\n\t\t\t\treturn nums[mid];\n\t\t\t}\n\n\t\t\t// If the mid does not hit the valley, then keep searching.\n\t\t\t// I don't know why nums[mid] > nums[0] is ok in the LeetCode solution yet.\n\t\t\t// (No need to explore any further)\n\t\t\tif (nums[mid] > nums[left]) {\n\t\t\t\t// The min is in the right subarray.\n\t\t\t\tleft = mid + 1;\n\t\t\t} else {\n\t\t\t\t// The min is in the left subarray.\n\t\t\t\tright = mid - 1;\n\t\t\t\t// right = mid; // NG! (R = M version)\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public int minSwaps(int[] data) {\n int n = 0;\n for (int i : data) {\n \tif (i == 1) n++;\n }\n if (n == 1) return 0;\n int zeroCount = 0;\n for (int i = 0; i < n; i++) {\n \tif (data[i] == 0) zeroCount++;\n }\n int result = zeroCount;\n for (int i = n; i < data.length; i++) {\n \tif (data[i] == 0) zeroCount++;\n \tif (data[i - n] == 0) zeroCount--;\n \tresult = Math.min(result, zeroCount);\n }\n return result;\n }", "public static int firstMissingPositiveChain(int[] nums) {\n int n = nums.length;\n for(int i=0;i<n;i++){\n int cur = nums[i];\n while(cur>0 && cur <= n && nums[cur-1]!=cur){\n int next = nums[cur-1];\n nums[cur-1] = cur;\n cur = next;\n }\n }\n for(int i=0;i<n;i++){\n if(i+1!=nums[i])\n return i+1;\n }\n return n+1;\n }", "protected final double getMinDifference() {\r\n \r\n double difference = 0;\r\n \r\n for(int i = 0; i < this.D; i++) {\r\n difference += Math.pow(this.f.max(i)-this.f.min(i), 2)*0.001;\r\n }\r\n \r\n return difference;\r\n \r\n }", "private int getDiff(int[] rows, int pos, int n) {\n int diff = 0;\n unmakeMove(pos);\n boolean[] union = getUnion3();\n makeMove(pos);\n int row = rows[pos];\n if (row == DNU) {\n return -1;\n }\n boolean[] set = input[row];\n for (int i = 0; i < set.length; i++) {\n int incr = (set[i] && !union[i]) ? 1 : 0;\n diff += incr;\n }\n return diff;\n }", "public int minPatches2(int[] nums, int n) {\n\t\tlong sumRange = 0;\n\t\tint index = 0;\n\t\tint ans = 0;\n\t\t\n\t\tif(nums.length > 0 && nums[0] == 1){\n\t\t\tsumRange = 1;\n\t\t\tindex = 1;\n\t\t}\n\t\t\n\t\twhile(sumRange < n){\n\t\t\twhile(index < nums.length && nums[index] <= sumRange){\n\t\t\t\tsumRange += nums[index];\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\tif(sumRange < n){\n\t\t\t\tif(index < nums.length && nums[index] == sumRange + 1){\n\t\t\t\t\tindex++;\n\t\t\t\t} else {\n\t\t\t\t\tans++;\n\t\t\t\t}\n\t\t\t\tsumRange = sumRange * 2 + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ans;\n\t}", "private static int coinChange(int[] arr,int n, int sum) {\n\t\tint[][] dp = new int[n+1][sum+1];\n\t\tfor(int i=0;i<n+1;i++) {\n\t\t\tdp[i][0]=1;\n\t\t}\n\t\tfor(int i=0;i<sum+1;i++) {\n\t\t\t\n\t\t\tif(i%arr[0]==0)\n\t\t\tdp[0][i]=i/arr[0];\n\t\t\telse\n\t\t\t\tdp[0][i]=0;\n\t\t}\n\t\t\n\t\tfor(int i=1;i<n+1;i++) {\n\t\t\tfor(int j=1;j<sum+1;j++) {\n\t\t\t\tif(arr[i-1]>j)\n\t\t\t\t\tdp[i][j]=dp[i-1][j];\n\t\t\t\telse\n\t\t\t\t\tdp[i][j]=Math.min(dp[i-1][j], dp[i][j-arr[i-1]]+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn dp[n][sum];\n\t}", "public static int equilibriumPoint(long arr[], int n) {\n long sum=0;\n for(int i=0;i<n;++i){\n sum+=arr[i];\n }\n long right=0;\n for(int i=n-1;i>=0;i--){\n if(right==sum-(arr[i]+right))\n return i+1;\n right+=arr[i];\n }\n return -1;\n }", "static int minimumTime(int[] x) {\n Arrays.sort(x);\n int l = x.length;\n int s = 0;\n int n = l - 1;\n for (int i = 0; i < n; ++i) {\n s += x[i + 1] - x[i];\n }\n return s;\n }", "private static int[] p1(int[] ar, int n) {\n int[] p1 = new int[n];\n Arrays.fill(p1, -1);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] <= ar[st.peek()]) {\n st.pop();\n }\n if (st.size() != 0) {\n p1[i] = st.peek();\n }\n st.push(i);\n }\n return p1;\n }", "private static int matrixMulNaive(int[] arr, int i, int n) {\n\t\t\n\t\tif(i == n) return 0;\n\t\t\n\t\tint min = Integer.MAX_VALUE;\n\t\tint count =0;\n\t\tfor(int k =i; k<n; k++)\n\t\t{\n\t\t\tcount = matrixMulNaive(arr,i,k)+matrixMulNaive(arr,k+1,n)\n\t\t\t+arr[i-1]*arr[k]*arr[n];\n\t\t}\n\t\tif(count < min) min = count;\n\t\t\n\t\treturn min;\n\t}", "static int findMissing(int arr[], int size)\n {\n \n //0 -10 1 3 -20\n int p1 = 0;\n int p2 = size-1;\n while (p1<p2) {\n if (arr[p1] > 0) {\n p1++;\n } else {\n int temp = arr[p2];\n arr[p2] = arr[p1];\n arr[p1] = temp;\n p2--;\n }\n }\n //1 3 0 -10 -20\n for (int i=0; i<=p1; i++) {\n int x = Math.abs(arr[i])-1;\n int y = arr[x];\n if (y>0 && y <= size) {\n arr[x] = y*-1;\n }\n }\n for (int i=0; i<size; i++) {\n if (arr[i] > 0) {\n return i+1;\n }\n }\n \n return p1+2;\n }", "static long findNumberOfTriangles(int arr[], int n)\n {\n\n long count=0;\n\n for(int i=0;i<n;i++){\n for(int j=i;j<n;j++){\n if(arr[i]>arr[j]){\n int temp=arr[j];\n arr[j]=arr[i];\n arr[i]=temp;\n }\n }\n }\n\n int k =n-1;\n for(int i=n-2;i>=0;i--){\n for(int j=i-1;j>=0;j--){\n if(arr[k]<arr[j]+arr[i]){\n count++;\n }\n }\n k--;\n }\n\n return count;\n }", "public static void main(String args[])\n {\n int n,min= Integer.MAX_VALUE;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n \n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i] = sc.nextInt();\n }\n \n for(int i=0;i<n-1;i++){\n min = i;\n for(int j=i+1;j<n;j++){\n \tif(a[j]<a[min]){\n min=j;\n \n }\n \n }\n if(i!=min){\n int tt = a[i];\n a[i] = a[min];\n a[min] = tt;\n }\n }\n \n for(int i=0;i<n;i++)\n System.out.print(a[i] + \" \");\n }", "private static int getMissingNum(int[] nums) {\n int diff1 = Integer.MAX_VALUE;\n int diff2 = Integer.MAX_VALUE;\n int diff1Count = 0;\n int diff2Count = 0;\n int firstDiff1Value = Integer.MAX_VALUE;\n int firstDiff2Value = Integer.MAX_VALUE;\n for (int i = 1; i < nums.length; i++) {\n int diff = nums[i] - nums[i - 1];\n if (diff1Count + diff2Count > 2) {\n\n } else if (diff1Count == 0 || diff == diff1) {\n if (diff1Count == 0) { firstDiff1Value = nums[i -1]; }\n diff1Count++;\n diff1 = diff;\n } else if (diff2Count == 0 || diff == diff2) {\n if (diff2Count == 0) { firstDiff2Value = nums[i -1]; }\n diff2Count++;\n diff2 = diff;\n }\n }\n boolean isDiff1Larger = diff1Count > diff2Count;\n if (isDiff1Larger) {\n return firstDiff2Value + diff1;\n } else {\n return firstDiff1Value + diff2;\n }\n }", "static int minimumInRange(int a[], int from, int to){ //\"O(to-from+1)\" O(m)\n int min = from;\n for(int i = from+1; i<= to; i++){ //n times\n if(a[i]<a[min]){\n min = i;\n }\n }\n return min;\n }", "public int minScore(int n, int[][] roads) {\n\n int[] parent = new int[n+1];\n int[] rank = new int[n+1];\n for (int i = 0; i < parent.length; i++) {\n parent[i] = i;\n }\n\n for (int[] road : roads) {\n union(road[0], road[1], parent, rank);\n }\n\n //identify the graph which has both first and last node\n int root = find(1, parent);\n\n //find minimum distance in the graph\n int answer = Integer.MAX_VALUE;\n for (int[] road : roads) {\n if (find(road[0], parent) == root) {\n answer = Math.min(answer, road[2]);\n }\n }\n return answer;\n }", "private static int arrayDpHopper(int[] array) {\n\t\tint[] jumps = new int[array.length];\n\t\tif(array[0]==0||array.length==0){\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t\tjumps[0]=0;\n\t\tfor(int i=1;i<array.length;i++){\n\t\t\tjumps[i]=Integer.MAX_VALUE;\n\t\t\tfor(int j=0;j<i;j++){\n\t\t\t\tif(i<=j + array[j] && jumps[j]!=Integer.MAX_VALUE){\n\t\t\t\t\tjumps[i] = arrayHopper.getMin(jumps[i],jumps[j]+1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn jumps[array.length-1];\n\t}", "public static void main(String[] args) throws Exception {\n \n Scanner scn=new Scanner(System.in);\n int n1=scn.nextInt();\n \n int[] a1=new int[n1];\n for(int i=0;i<a1.length;i++){\n a1[i]=scn.nextInt();\n }\n \n int n2=scn.nextInt();\n int[] a2=new int[n2];\n for(int i=0;i<a2.length;i++){\n a2[i]=scn.nextInt();\n }\n \n int[] diff=new int[n2];\n int c=0;\n \n int i=a1.length-1;\n int j=a2.length-1;\n int k=diff.length-1;\n \n while(k >= 0){\n int d=0;\n int a1v= i >= 0? a1[i]: 0;\n \n if(a2[j] +c >= a1v){\n d= a2[j] + c -a1v;\n c=0;\n }else{\n d= a2[j] + c + 10 -a1v;\n c=-1;\n }\n \n diff[k] = d;\n \n i--;\n j--;\n k--;\n }\n \n int idx = 0;\n while(idx < diff.length){\n if(diff[idx] == 0){\n idx++;\n }else{\n break;\n }\n }\n \n while(idx < diff.length){\n System.out.println(diff[idx]);\n idx++;\n }\n \n\n \n \n}", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public int minMoves(int[] nums) {\n int min = nums[0], sum = 0;\n for (int num : nums) {\n min = Math.min(min, num);\n }\n for (int num : nums) {\n sum += num - min;\n }\n return sum;\n }", "public int findMin(int[] nums) {\n if (nums == null || nums.length == 0) {\n return 0;\n }\n if (nums.length == 1) {\n return nums[0];\n }\n int l = 0;\n int r = nums.length - 1;\n while (l < r) {\n int m = (l + r) / 2;\n if (m > 0 && nums[m] < nums[m - 1]) {\n return nums[m];\n }\n if (nums[l] <= nums[m] && nums[m] > nums[r]) {\n l = m + 1;\n } else {\n r = m - 1;\n }\n }\n return nums[l];\n }", "public int FindMinRotatedArray(int[] ar){\n\n int n = ar.length;\n int lo = 0;\n int hi = n - 1;\n while(lo <= hi){\n\n if(ar[lo] <= ar[hi]) // (sub) array is already sorted, yay!\n return ar[lo];\n\n int mid = lo + (hi - lo)/2; //prevent int overflow, assumes all are positive\n int next = (mid + 1) % n; //modulus is needed if mid is the start/end of the array\n int prev = (mid + n - 1) % n;\n\n //check if mid is the min. Both it's previous and next are higher\n if((ar[mid] <=ar[prev])&&(ar[mid] <=ar[next]))\n return ar[mid];\n\n //figure out where is the dip\n if(ar[mid] <= ar[lo])\n hi = mid - 1; //the dip is in the half left side\n else\n lo = mid + 1;\n }\n\n return -1;\n }", "private static int distClosestNumbers(int[] numbers) {\n // try to implement it!\n if (numbers.length < 2) {\n return 0;\n }\n // O(n log(n))\n Arrays.sort(numbers);\n var preLastEl = numbers[numbers.length - 2];\n var lastEl = numbers[numbers.length - 1];\n return lastEl - preLastEl;\n }", "public static int minMoves(int[] nums) {\n if(nums.length==0) return 0;\n int res=0, len=nums.length,min=Integer.MAX_VALUE;\n for(int i:nums) min=Math.min(min,i);\n for(int i:nums) res+=i-min;\n return res;\n }", "private static int climbStairsWithMinimumMoves(int index, int cost, int n, int[] arr){\n //Base Case\n if(index == n) return cost;\n else if(index > n) return Integer.MAX_VALUE;\n\n //faith\n int limit = arr[index];\n int min = Integer.MAX_VALUE;\n for(int i = 1; i <= limit; i++){\n int minCost = climbStairsWithMinimumMoves(index + i, cost + 1, n, arr);\n //faith * expectation\n if(minCost < min) min = minCost;\n }\n return min;\n }", "static int findMissingUsingSummation(int[] arr) {\n\t\tint expectedSum = (arr.length + 1) * (arr.length + 1 + 1) / 2;\n\t\tint actualSum = 0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tactualSum = actualSum + arr[i];\n\t\t}\n\n\t\treturn expectedSum - actualSum;\n\t}", "public int minCostClimbingStairs(int[] cost) {\n // We initialize an array of size = cost, and it means the minimun cost of reaching n^th stair\n int[] dp = new int[cost.length];\n // We assign values to the first 2 numbers in the array because it can´t be smaller than 3\n dp[0] = cost[0];\n dp[1] = cost[1];\n // We iterate from n=2 to n-1, and in each position we save the min\n // value to reach the stair, the MIN is (dp[i-1] + cost[i] , dp[i-2] + cost[i]\n // that is so that the min way of reaching that stair is either using the n-1 or n-2\n for (int i = 2; i < cost.length; i++) {\n dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);\n }\n\n // We return the min value of the last 2 stairs because both can reach the end\n return Math.min(dp[cost.length - 1], dp[cost.length - 2]);\n\n\t\t /*\n\t\t\t cost[1,100,1,1,1,100,1,1,100,1]\n\t\t 1.- Imagine this is the array\n\t\t\t dp[]\n\t\t 2.- We add the first two values\n\t\t\t dp[1,100]\n\t\t 3.- Iterate form 2 to n\n\t\t\t This is a representation of the first one\n\t\t dp[2] = Math.min(1+1, 100+1)\n\t\t dp[2] = Math.min(2,101)\n\t\t dp[2] = 2\n\t\t dp[1,100,2]\n\t\t\t After the for, this is how it should look\n\t\t dp[1,100,2,3,3,103,4,5,105,6]\n\t\t 4.- Select the min between last 2 because both can reach last step\n\t\t\treturn min (105,6)\n\t\t\treturn 6\n\n\t\t\tIt should have a space complexity of O(n) becuase we´re using an array of n size\n\t\t\tThe time complexity should also be O(n) because we have to iterate through all the array once\n\n\t\t */\n }", "int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }", "public int[] smallestRange(int[][] arrays) {\n \n int[] pointer = new int[arrays.length];\n int max = Integer.MIN_VALUE;\n int minY = Integer.MAX_VALUE;\n int minX = 0;\n boolean flag = true;\n \n // PriorityQueue<Integer> queue = new PriorityQueue<>((i,j)-> arrays[i][pointer[i]] - arrays[j][pointer[j]]);\n \n PriorityQueue<Integer> queue = new PriorityQueue<>(new Comparator<Integer>(){\n public int compare(Integer i, Integer j){\n return arrays[i][pointer[i]] - arrays[j][pointer[j]];\n }\n });\n \n for(int i = 0; i < arrays.length; i++){\n queue.offer(i);\n max = Math.max(max, arrays[i][0]);\n }\n \n for(int i = 0; i < arrays.length && flag; i ++){\n for(int j = 0; j < arrays[i].length && flag; j++){\n int minTemp = queue.poll();\n if(minY - minX > max - arrays[minTemp][pointer[minTemp]]){\n minX = arrays[minTemp][pointer[minTemp]];\n minY = max;\n }\n pointer[minTemp]++;\n if(pointer[minTemp] == arrays[minTemp].length){\n flag = false;\n break;\n }\n queue.offer(minTemp);\n max = Math.max(max, arrays[minTemp][pointer[minTemp]]);\n }\n }\n return new int[]{minX, minY};\n }", "static int maxMin(int k, int[] arr) {\n Arrays.sort(arr);\n return IntStream.range(0, arr.length - k + 1).map(i -> arr[i + k - 1] - arr[i]).min().getAsInt();\n }", "static int diagonalDifference(int[][] arr) {\n return Math.abs(leftDiagonalSum(arr) - rightDiagonalSum(arr));\n }", "private static void sort(int[] arr, int n) {\n for(int i=0;i<n;i++) {\n int min = arr[i];\n int idx = i;\n for(int j = i+1; j<n;j++) {\n if(arr[j] < min) {\n min = arr[j];\n idx = j;\n }\n }\n swap(arr, i,idx);\n }\n }", "public static double closestPair(Point[] sortedX) {\n if (sortedX.length <= 1) {\n return Double.MAX_VALUE;\n }\n double mid = sortedX[(sortedX.length) / 2].getX();\n double firstHalf = closestPair(Arrays.copyOfRange(sortedX, 0, (sortedX.length) / 2));\n double secondHalf = closestPair(Arrays.copyOfRange(sortedX, (sortedX.length) / 2, sortedX.length));\n double min = Math.min(firstHalf, secondHalf);\n ArrayList<Point> close = new ArrayList<Point>();\n for (int i = 0; i < sortedX.length; i++) {\n double dis = Math.abs(sortedX[i].getX() - mid);\n if (dis < min) {\n close.add(sortedX[i]);\n }\n }\n // sort by Y coordinates\n Collections.sort(close, new Comparator<Point>() {\n public int compare(Point obj1, Point obj2) {\n return (int) (obj1.getY() - obj2.getY());\n }\n });\n Point[] near = close.toArray(new Point[close.size()]);\n\n for (int i = 0; i < near.length; i++) {\n int k = 1;\n while (i + k < near.length && near[i + k].getY() < near[i].getY() + min) {\n if (min > near[i].distance(near[i + k])) {\n min = near[i].distance(near[i + k]);\n System.out.println(\"near \" + near[i].distance(near[i + k]));\n System.out.println(\"best \" + best);\n\n if (near[i].distance(near[i + k]) < best) {\n best = near[i].distance(near[i + k]);\n arr[0] = near[i];\n arr[1] = near[i + k];\n // System.out.println(arr[0].getX());\n // System.out.println(arr[1].getX());\n\n }\n }\n k++;\n }\n }\n return min;\n }", "public int findLatestStep(int[] arr, int m) {\n int last = -1 ;\n Set<Integer> list = new HashSet<>();\n int n = arr.length;\n int num = 1;\n for (int i = 0; i < n; i++) {\n num <<= 1;\n }\n for (int i = 0; i < arr.length; i++) {\n int tmp = arr[i];\n\n int con = move(tmp);\n num = num|con;\n\n int copy = num;\n\n list = check(copy,n);\n\n for (int x :\n list) {\n if (x == m)\n last = i+1;\n }\n\n\n }\n return last;\n\n }", "public int [] smallestRange(int [][] nums){\n\t\tint minx = 0, miny = Integer.MAX_VALUE, max = Integer.MIN_VALUE;\n\t\t\n\t\tint [] next = new int [nums.length];\n\t\tboolean flag = true;\n\t\t\n\t\tPriorityQueue<Integer> minQ = new PriorityQueue<Integer>((i, j)->nums[i][next[i]]-nums[j][next[j]]);\n\t\tfor(int i = 0 ; i < nums.length; i ++){\n\t\t\tminQ.offer(i);\n\t\t\tmax = Math.max(max, nums[i][0]);\n\t\t}\n\t\t\n\t\tfor(int i = 0 ; i < nums.length && flag; i++){\n\t\t\tfor(int j = 0 ; j < nums[i].length&& flag; j++){\n\t\t\t\tint minI = minQ.poll();\n\t\t\t\tif(miny-minx > max-nums[minI][next[minI]]){\n\t\t\t\t\tminx = nums[minI][next[minI]];\n\t\t\t\t\tminy = max;\n\t\t\t\t}\n\t\t\t\tnext[minI]++;\n\t\t\t\tif(next[minI] == nums[minI].length){\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tminQ.offer(minI);\n\t\t\t\tmax = Math.max(max, nums[minI][next[minI]]);\n\t\t\t}\n\t\t}\n\t\treturn new int [] {minx, miny};\n\t}", "public int[] nge(int[] arr) {\r\n\t\tint[] k = new int[arr.length];\r\n\t\tStack<Integer> stack = new Stack<>(); // Store the indexes.\r\n\t\tstack.push(0);\r\n\t\tint i = 1;\r\n\t\twhile(i < k.length) {\r\n\t\t\twhile(!stack.isEmpty() && arr[stack.peek()] < arr[i]) {\r\n\t\t\t\t// Then we have found the answer for the element at stack.peek() position.\r\n\t\t\t\tk[stack.peek()] = i;\r\n\t\t\t\tstack.pop();\r\n\t\t\t}\r\n\t\t\tstack.push(i);\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tutil.Util.print(arr);\r\n\t\twhile(!stack.isEmpty())\r\n\t\t\tk[stack.pop()] = -1; // No next greater element exist for these indexes.\r\n\t\tutil.Util.print(k);\r\n\t\treturn k;\r\n\t}", "public int dp_os(int[] arr) {\n\n\t\tint[][] dp = new int[arr.length][arr.length];\n\t\t\n\t\tfor (int gap=0; gap<arr.length; gap++) {\n\t\t\n\t\t\tfor (int i=0,j=gap; j<arr.length; i++, j++) {\n\t\t\t\n\t\t\t\tint x = (i+2 <= j) ? dp[i+2][j] : 0;\n\t\t\t\tint y = (i+1 <= j-1) ? dp[i+1][j-1] : 0;\n\t\t\t\tint z = (i <= j-2) ? dp[i][j-2] : 0;\n\n\t\t\t\tdp[i][j] = Math.max(arr[i] + Math.min(x,y), arr[j] + Math.min(y,z));\n\t\t\t}\n\t\t}\n\n\t\treturn dp[0][arr.length-1];\n\t}", "public static int partitionDisjoint_opt(int[] nums) {\n int len = nums.length;\n\n int[] leftMax = new int[len];\n leftMax[0] = nums[0];\n for (int i = 1; i < len; i++) {\n leftMax[i] = Math.max(leftMax[i - 1], nums[i]);\n }\n\n int[] rightMin = new int[len];\n rightMin[len - 1] = nums[len - 1];\n for (int i = len - 2; i >= 0; i--) {\n rightMin[i] = Math.min(rightMin[i + 1], nums[i]);\n }\n\n for (int i = 0; i < len - 1; i++) {\n if (leftMax[i] <= rightMin[i + 1]) {\n return i + 1;\n }\n }\n\n return 0;\n }", "void ascendingSelectionSort(int[] arr,int n){\n for(int i=0;i<n-1;i++){\n int min_index = i;\n for(int j=i+1;j<n;j++){\n if(arr[j]<arr[min_index]){\n min_index = j;\n }\n }\n if(i != min_index){\n int temp = arr[i];\n arr[i] = arr[min_index];\n arr[min_index]= temp;\n }\n }\n }", "protected int findMinIndex(int[] arr)\n\t{\n\t\tint minIndex = arr.length;\n\t\tSet<Integer> set = new HashSet<>();\n\n\t\tfor (int i = arr.length - 1; i >= 0; i--) {\n\t\t\tif (set.contains(arr[i])) {\n\t\t\t\tminIndex = i;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tset.add(arr[i]);\n\t\t\t}\n\t\t}\n\t\treturn minIndex;\n\t}", "public static int minCostOfRoad(int n, ArrayList<ArrayList<Integer>> edges){\n Collections.sort(edges, new Comparator<ArrayList<Integer>>() { \n @Override\n public int compare(ArrayList<Integer> o1, ArrayList<Integer> o2) {\n return o1.get(2).compareTo(o2.get(2));\n } \n });\n //create a parent array and fill it with the self value\n int []parent = new int[n + 1];\n for(int i = 0;i <= n;i++){\n parent[i] = i;\n }\n\n ArrayList<ArrayList<Integer>> mst = new ArrayList<>();\n int minCost = 0;\n int i = 0;\n int countEdges = 0;\n //Pick the smallest edge. Check if it forms a cycle with the spanning tree formed so far. \n //If cycle is not formed, include this edge. Else, discard it.\n while(countEdges != n - 1){\n ArrayList<Integer>edge = edges.get(i);\n int source = edge.get(0);\n int dest = edge.get(1);\n int weight = edge.get(2);\n int sourceParent = findParent(source, parent);\n int destParent = findParent(dest, parent);\n if(sourceParent != destParent){\n mst.add(edge);\n countEdges++;\n minCost += weight;\n parent[sourceParent] = destParent;\n }\n i++;\n }\n return minCost;\n }", "private static int findMinInArr(int[] arr) {\n\t\tint min = arr[0];\n\t\tfor (int elem : arr) {\n\t\t\tif (elem < min) {\n\t\t\t\tmin = elem;\n\t\t\t}\n\t\t}\n\n\t\treturn min;\n\t}", "public void minimum(int[] arr){\n int min = arr[0];\n for(int i = 1; i< arr.length-1; i++){ //why i = 1 means because we have already taken the arr[0] as minimum\n if(arr[i] < min){\n min = arr[i];\n }\n } \n System.out.println(\"The minimum Element in the array is : \"+min);\n }", "static long closer(int arr[], int n, long x)\n {\n int index = binarySearch(arr,0,n-1,(int)x); \n return (long) index;\n }", "public static int partitionDisjoint_opt_2(int[] nums) {\n int len = nums.length;\n int leftMax = nums[0];\n\n int[] rightMin = new int[len];\n rightMin[len - 1] = nums[len - 1];\n for (int i = len - 2; i >= 0; i--) {\n rightMin[i] = Math.min(rightMin[i + 1], nums[i]);\n }\n\n for (int i = 0; i < len - 1; i++) {\n leftMax = Math.max(leftMax, nums[i]);\n\n if (leftMax <= rightMin[i + 1]) {\n return i + 1;\n }\n }\n\n return 0;\n }", "public int minMoves2(int[] nums) {\n int median = quickSelect(nums, nums.length/2 + 1, 0, nums.length-1);\n int minMoves = 0;\n for(int i : nums){\n minMoves += Math.abs(i-median);\n }\n return minMoves;\n }", "void findLeadrsInArray2(int[] a){\n\t\tint n = a.length;\n\t\tSystem.out.println(a[n-1]);\n\t\tint max = a[n-1];\n\t\tfor(int i = n-2; i>=0 ; i--){\n\t\t\tif(a[i] < max){\n\t\t\t\tmax = a[i];\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public int findMinOptimization(int[] nums) {\n // write your code here\n if (nums == null || nums.length == 0) return -1;\n int start = 0, end = nums.length - 1;\n int target = nums[end];\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (nums[mid] <= target) {\n end = mid;\n }\n else {\n start = mid;\n }\n }\n if (nums[start] <= nums[end]) return nums[start];\n return nums[end];\n }", "public List<Integer> findClosestElements2(int[] arr, int k, int x) {\r\n List<Integer> res = new LinkedList<>();\r\n int i=0, j=arr.length-k;\r\n while (i<j){\r\n int m = i + (j-i)/2;\r\n if (x-arr[m]>arr[m+k]-x){\r\n i=m+1;\r\n }\r\n else j=m;\r\n }\r\n // System.out.println(i);\r\n while (k>0){\r\n res.add(arr[i++]);\r\n k--;\r\n }\r\n return res;\r\n }", "static double minimalDistance(int[] x, int y[]) {\n Point[] points = new Point[x.length];\n for (int i = 0; i < x.length; i++) {\n points[i] = new Point(x[i], y[i]);\n }\n\n Arrays.sort(points, (a, b) -> a.x == b.x ? Long.signum(a.y - b.y) : Long.signum(a.y - b.y));\n\n PairPoint minPointsDistance = getMinPointsDistance(points, 0, x.length);\n return minPointsDistance == null ? -1 : minPointsDistance.distance;\n }", "static int diagonalDifference(int[][] arr) {\n int leftDiag=0;\n int rigthDiag=0;\n for(int i =0;i<arr.length;i++){\n for(int j=0;j<arr.length;j++){\n if(i==j){\n leftDiag+=arr[i][j];\n }\n if(i+j==arr.length-1){\n rigthDiag+=arr[i][j];\n }\n }\n }\n return Math.abs(leftDiag-rigthDiag);\n }" ]
[ "0.7004706", "0.6957959", "0.690075", "0.6702543", "0.6622652", "0.65230197", "0.650036", "0.6495584", "0.6439413", "0.6417126", "0.63603115", "0.6354568", "0.6292341", "0.62789017", "0.6210164", "0.6179139", "0.61233556", "0.61160773", "0.6055306", "0.6046214", "0.60265124", "0.6026166", "0.6016066", "0.60158384", "0.60152423", "0.60120094", "0.6008902", "0.6008785", "0.597518", "0.5969465", "0.5967109", "0.5950922", "0.5949513", "0.59441197", "0.5899016", "0.58969283", "0.58790284", "0.5876977", "0.58719367", "0.584734", "0.5837575", "0.5783612", "0.57807535", "0.5775293", "0.5756822", "0.5749066", "0.57480705", "0.57374924", "0.57340795", "0.57192373", "0.5709305", "0.57016736", "0.56957906", "0.5685861", "0.5681437", "0.5678158", "0.5651865", "0.56466717", "0.5645924", "0.5639293", "0.56347436", "0.56303275", "0.5628434", "0.5623022", "0.56222254", "0.5620967", "0.5616232", "0.56162274", "0.561494", "0.5601782", "0.55980754", "0.558929", "0.55812085", "0.5573467", "0.5570337", "0.5559843", "0.5558395", "0.55474555", "0.55414814", "0.5541253", "0.55388683", "0.5534335", "0.55343133", "0.5523859", "0.55221313", "0.5515913", "0.5510414", "0.5508826", "0.5494346", "0.54882044", "0.54794705", "0.5477795", "0.54771674", "0.547579", "0.5469808", "0.5462621", "0.54569966", "0.54547817", "0.545081", "0.5450786" ]
0.8210796
0
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
int deleteByPrimaryKey(Integer r_p_i);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "PicInfo selectByPrimaryKey(Integer r_p_i);", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "int updateByPrimaryKey(PicInfo record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private int getPictureType()\n {\n return pictureType;\n }", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "Receta getByIdWithImages(long id);", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public Integer getPicType() {\n return picType;\n }", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "String getItemImage();", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6227567", "0.60861313", "0.6002314", "0.5780564", "0.5670781", "0.56137055", "0.56115085", "0.5575638", "0.5550091", "0.55008566", "0.54926556", "0.54190826", "0.53493005", "0.5332465", "0.5307597", "0.52956295", "0.520774", "0.52019686", "0.5161683", "0.5135673", "0.51352394", "0.51213574", "0.50985485", "0.5095381", "0.5095127", "0.5076564", "0.5076564", "0.506997", "0.5067706", "0.50534064", "0.5035164", "0.50341815", "0.50323856", "0.5026501", "0.5025743", "0.5020013", "0.50009644", "0.49964872", "0.49924636", "0.49905974", "0.49879766", "0.49819311", "0.4969557", "0.49625346", "0.4943859", "0.49395984", "0.4934344", "0.49283555", "0.491429", "0.4905278", "0.49044284", "0.49016225", "0.48951176", "0.48924536", "0.4875517", "0.48752695", "0.48701587", "0.48639894", "0.48601815", "0.48589152", "0.4851352", "0.48498955", "0.484885", "0.4848607", "0.48483086", "0.4841351", "0.48357457", "0.48345807", "0.483434", "0.483434", "0.483434", "0.483368", "0.4823289", "0.48173872", "0.4811137", "0.48097947", "0.48072475", "0.47907284", "0.478921", "0.47825575", "0.47800693", "0.4779474", "0.4765411", "0.47649828", "0.47607478", "0.4760514", "0.4757124", "0.47540566", "0.4746862", "0.47402164", "0.47289637", "0.47278425", "0.47229892", "0.47225726", "0.47184438", "0.47176492", "0.47175756", "0.47161436", "0.47152025", "0.4713722", "0.47135323" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
int insert(PicInfo record);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "PicInfo selectByPrimaryKey(Integer r_p_i);", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "int updateByPrimaryKey(PicInfo record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "private int getPictureType()\n {\n return pictureType;\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "Receta getByIdWithImages(long id);", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public Integer getPicType() {\n return picType;\n }", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "String getItemImage();", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6226258", "0.6088974", "0.6001063", "0.5779212", "0.5669009", "0.5611659", "0.56111395", "0.5576598", "0.5549238", "0.54988503", "0.54916227", "0.5421782", "0.53472024", "0.5332515", "0.5306093", "0.52947956", "0.5206095", "0.5200435", "0.5159608", "0.51350516", "0.51340693", "0.5118486", "0.5097676", "0.5095321", "0.50940627", "0.5075908", "0.5075908", "0.5069445", "0.5066667", "0.5052108", "0.5034999", "0.50333244", "0.5031393", "0.50270677", "0.50256515", "0.50203204", "0.5000448", "0.49959943", "0.49923015", "0.49901214", "0.49884757", "0.49810147", "0.49687818", "0.49598727", "0.49428535", "0.49392432", "0.49325904", "0.49267972", "0.49139082", "0.49068", "0.49038923", "0.49004188", "0.48944184", "0.4892529", "0.48749214", "0.48731664", "0.48695415", "0.48631015", "0.48597977", "0.48588875", "0.4851223", "0.48482797", "0.48481792", "0.4847665", "0.48476297", "0.48410937", "0.4834393", "0.4834393", "0.4834393", "0.48338342", "0.48329908", "0.48328584", "0.48227787", "0.48169106", "0.48097047", "0.4808031", "0.48076743", "0.47900614", "0.47863507", "0.47806317", "0.4778584", "0.47774956", "0.47645378", "0.4763426", "0.47634128", "0.4760223", "0.47553986", "0.47544697", "0.4746927", "0.4741086", "0.47280282", "0.47267836", "0.47215453", "0.47203", "0.47192684", "0.47190565", "0.47173375", "0.47154596", "0.47147897", "0.47142908", "0.47120312" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
int insertSelective(PicInfo record);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "PicInfo selectByPrimaryKey(Integer r_p_i);", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "int updateByPrimaryKey(PicInfo record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "private int getPictureType()\n {\n return pictureType;\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "Receta getByIdWithImages(long id);", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public Integer getPicType() {\n return picType;\n }", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "String getItemImage();", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6226355", "0.60860795", "0.600119", "0.5779786", "0.56691056", "0.5612078", "0.5610757", "0.55753225", "0.55488944", "0.5499441", "0.5491881", "0.54194486", "0.5347817", "0.53316385", "0.530762", "0.5295229", "0.5205654", "0.5199045", "0.5161192", "0.5135243", "0.5135105", "0.51193845", "0.5097267", "0.5095729", "0.5093463", "0.5075273", "0.5075273", "0.5068469", "0.5065041", "0.505249", "0.5034437", "0.5032308", "0.5031621", "0.50273037", "0.50251037", "0.5019024", "0.49993467", "0.49956456", "0.49920577", "0.498991", "0.4986642", "0.49814788", "0.49678293", "0.49613604", "0.4943555", "0.49399674", "0.49323976", "0.4929228", "0.4914506", "0.49045038", "0.4904129", "0.49010175", "0.4894439", "0.48918685", "0.48738524", "0.48731914", "0.48687056", "0.4864305", "0.48583928", "0.48581493", "0.48502594", "0.48481518", "0.4847904", "0.48475826", "0.4847169", "0.48417115", "0.4834738", "0.4834738", "0.4834738", "0.48337647", "0.4832697", "0.48317775", "0.482377", "0.48168835", "0.48097366", "0.4808025", "0.48059314", "0.47908455", "0.47870854", "0.47810188", "0.4778866", "0.47772902", "0.47644034", "0.47628614", "0.47607386", "0.47595373", "0.47562146", "0.4753879", "0.47460404", "0.47405487", "0.47281632", "0.47272754", "0.47209886", "0.47206292", "0.4718365", "0.471737", "0.47168627", "0.47160324", "0.47141612", "0.47140855", "0.47119328" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
PicInfo selectByPrimaryKey(Integer r_p_i);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "int updateByPrimaryKey(PicInfo record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "private int getPictureType()\n {\n return pictureType;\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "Receta getByIdWithImages(long id);", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "public Integer getPicType() {\n return picType;\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "String getItemImage();", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6227411", "0.6086806", "0.57807857", "0.5669839", "0.5612249", "0.56110543", "0.5578116", "0.55503744", "0.5500835", "0.5491491", "0.5420619", "0.53485346", "0.5333855", "0.5308208", "0.5296143", "0.52060455", "0.5200744", "0.5162316", "0.51363516", "0.5135146", "0.5119349", "0.50975436", "0.509674", "0.5094449", "0.50751525", "0.50751525", "0.5069666", "0.5066243", "0.50537866", "0.50346386", "0.50345504", "0.5033345", "0.502888", "0.50258297", "0.50211746", "0.50019985", "0.4997223", "0.4992275", "0.4989979", "0.49878496", "0.49819562", "0.4968451", "0.4961837", "0.49439746", "0.49400097", "0.4933847", "0.49290472", "0.49150035", "0.49056318", "0.49044448", "0.49023217", "0.48959783", "0.4892531", "0.48750117", "0.48746166", "0.48695418", "0.48647884", "0.48601568", "0.4858611", "0.48510826", "0.48500603", "0.4848195", "0.48481598", "0.48477072", "0.48429054", "0.48355767", "0.48355767", "0.48355767", "0.48348737", "0.48343602", "0.4833596", "0.48240927", "0.48166403", "0.48102003", "0.4809726", "0.48080876", "0.47907898", "0.47864076", "0.4782589", "0.47782168", "0.47771186", "0.4765342", "0.47641182", "0.47622108", "0.47608405", "0.475642", "0.4754274", "0.47480607", "0.4742491", "0.47289896", "0.47283444", "0.4722091", "0.47218782", "0.47197342", "0.47192642", "0.47187793", "0.47175053", "0.4715846", "0.47138622", "0.4713485" ]
0.6002151
2
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
int updateByPrimaryKeySelective(PicInfo record);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "PicInfo selectByPrimaryKey(Integer r_p_i);", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "int updateByPrimaryKey(PicInfo record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private int getPictureType()\n {\n return pictureType;\n }", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "Receta getByIdWithImages(long id);", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public Integer getPicType() {\n return picType;\n }", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "String getItemImage();", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6227567", "0.60861313", "0.6002314", "0.5780564", "0.5670781", "0.56137055", "0.56115085", "0.5575638", "0.5550091", "0.55008566", "0.54926556", "0.54190826", "0.53493005", "0.5332465", "0.5307597", "0.52956295", "0.520774", "0.52019686", "0.5161683", "0.5135673", "0.51352394", "0.51213574", "0.50985485", "0.5095381", "0.5095127", "0.5076564", "0.5076564", "0.506997", "0.5067706", "0.50534064", "0.5035164", "0.50341815", "0.50323856", "0.5026501", "0.5025743", "0.5020013", "0.50009644", "0.49964872", "0.49924636", "0.49905974", "0.49879766", "0.49819311", "0.4969557", "0.49625346", "0.4943859", "0.49395984", "0.4934344", "0.49283555", "0.491429", "0.4905278", "0.49044284", "0.49016225", "0.48951176", "0.48924536", "0.4875517", "0.48752695", "0.48701587", "0.48639894", "0.48601815", "0.48589152", "0.4851352", "0.48498955", "0.484885", "0.4848607", "0.48483086", "0.4841351", "0.48357457", "0.48345807", "0.483434", "0.483434", "0.483434", "0.483368", "0.4823289", "0.48173872", "0.4811137", "0.48097947", "0.48072475", "0.47907284", "0.478921", "0.47825575", "0.47800693", "0.4779474", "0.4765411", "0.47649828", "0.47607478", "0.4760514", "0.4757124", "0.47540566", "0.4746862", "0.47402164", "0.47289637", "0.47278425", "0.47229892", "0.47225726", "0.47184438", "0.47176492", "0.47175756", "0.47161436", "0.47152025", "0.4713722", "0.47135323" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table en_room_pic_info
int updateByPrimaryKey(PicInfo record);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SysPic selectByPrimaryKey(Integer id);", "@Override\n\tpublic List<String> getImg(int room_id, String type_img) {\n\t\treturn roomDao.getImg(room_id, type_img);\n\t}", "PicInfo selectByPrimaryKey(Integer r_p_i);", "EnterprisePicture selectByPrimaryKey(Integer id);", "SportAlbumPicture selectByPrimaryKey(String id);", "@Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);", "@Override\n public String getPicPhoto() {\n return pic_filekey;\n }", "public HashMap<String, Object> DetailEtcImage(HashMap<String, Object> param) {\n\t\treturn sqlSession.selectOne(\"main.DetailEtcImage\",param);\r\n\t}", "public interface RoundImgDao {\n public int insertRoundImg(RoundImg roundImg);\n public int updateRoundImg(RoundImg roundImg);\n public RoundImg selectRoundImg(String imgId);\n public List<RoundImg> selectRoundImgs(Page page);\n public Integer selectRow();\n}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public String getSqPic() { return sqPic; }", "@Override\n\tpublic int addImgRoom(int room_id, String name_img, String type_img) {\n\t\treturn roomDao.addImgRoom(room_id, name_img, type_img);\n\t}", "public interface PicManagerMapper {\n\n List<PicVo> getPicVoList(@Param(value= \"seqNo\") String seqNo);\n\n PicVo getPicVo(@Param(value= \"name\") String name ,@Param(value= \"type\") Integer type);\n\n int insertPicVo(PicVo picVo);\n}", "public void showimg()\n {\n try{\n String s1=VoterSignUpForm.id;\n System.out.println(s1);\n Class.forName(\"com.mysql.jdbc.Driver\");//.newInstance();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/votingsystem\", \"root\", \"\" );\n Statement st=conn.createStatement();\n ResultSet rs=st.executeQuery(\"select image from voterimg where id='\"+s1+\"'\");\n byte[] bytes = null;\n if(rs.next()){\n //String name=rs.getString(\"name\");\n //text1.setText(name);\n //String address=rs.getString(\"address\");\n //text2.setText(address);\n // name.setText(rs.getString(\"name\"));\n bytes = rs.getBytes(\"image\");\n Image image = img.getToolkit().createImage(bytes);\n ImageIcon icon=new ImageIcon(image);\n img.setIcon(icon);\n }\n }catch(Exception e)\n {}\n }", "@Mapper\npublic interface WeChatInfoDao {\n\n\n /**\n * 插入微信信息\n * @param wechatInfo\n * @return\n */\n @Insert(\"INSERT INTO wechat_info(parentid,unionid,openid,nickname,sex,province,city,country,headImgUrl,\" +\n \"status,ticket_url,ticket,is_guide,reward) VALUES(#{parentid},#{unionid},#{openid},#{nickname},#{sex},#{province}\" +\n \",#{city},#{country},#{headImgUrl},#{status},#{ticketUrl},#{ticket},#{isGuide},#{reward})\")\n @Options(useGeneratedKeys=true, keyProperty=\"id\")\n int insert(WeChatInfoEntity wechatInfo);\n\n /**\n * 根据openID 查找用户信息\n * @param openid\n * @return\n */\n @Select(\"SELECT * FROM wechat_info WHERE openid = #{openid}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"nickname\", property = \"nickname\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity findByOpenID(@Param(\"openid\") String openid);\n\n /**\n * 根据openID 修改二维码信息\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET ticket_url=#{ticketUrl},ticket=#{ticket} WHERE openid=#{openid}\")\n void updateTicketUrlByOpenID(WeChatInfoEntity wechatInfo);\n\n /**\n * 取消关注\n * @param wechatInfo\n */\n @Update(\"UPDATE wechat_info SET status=1 WHERE openid=#{openid}\")\n void updateStatusByOpenID(WeChatInfoEntity wechatInfo);\n\n\n /**\n * 更改status 状态\n * @param wechatInfo\n */\n @SelectProvider(type=WeChatInfoSqlProvider.class, method=\"updateByOpenIdSql\")\n void updateStatus(@Param(\"wechatInfo\") WeChatInfoEntity wechatInfo);\n\n @Select(\"SELECT * FROM wechat_info WHERE id = #{ID}\")\n @Results(\n {\n @Result(id = true, column = \"id\", property = \"ID\"),\n @Result(column = \"unionid\", property = \"unionid\"),\n @Result(column = \"parentid\", property = \"parentid\"),\n @Result(column = \"openid\", property = \"openid\"),\n @Result(column = \"ticket_url\", property = \"ticketUrl\"),\n @Result(column = \"ticket\", property = \"ticket\"),\n @Result(column = \"is_guide\", property = \"isGuide\"),\n @Result(column = \"reward\", property = \"reward\")\n })\n WeChatInfoEntity selectWecahtUserByID(@Param(\"ID\")String ID);\n}", "private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }", "@Override\n\tpublic List<Map> getPicListCount(Map<String, Object> param) {\n\t\tStringBuffer hql = new StringBuffer(\"select count(*) as total from picupload t where 1=1 \");\n\t\tMap<String, Object> params = new HashMap<String, Object>();\n\t\tif (params.get(\"houseieee\") != null) {\n\t\t\thql.append(\"and t.houseieee = :houseieee \");\n\t\t\tparam.put(\"houseieee\", params.get(\"houseieee\"));\n\t\t}\n\t\tif(params.get(\"camuuid\") != null) {\n\t\t\thql.append(\"and t.camuuid = :camuuid \");\n\t\t\tparam.put(\"camuuid\", params.get(\"camuuid\"));\n\t\t}\n\t\tif(StringUtils.isNotBlank((String) param.get(\"starttime\"))) {\n\t\t\thql.append(\"and t.taketime between '\").append(param.get(\"starttime\").toString()).append(\"' and '\").append(param.get(\"endtime\").toString()).append(\"'\");\n\t\t}\n\t\tList<Map> list = mapDao.executeSql(hql.toString(), params);\n\t\treturn list;\n\t}", "List<AlbumImage> selectByAlbum(Integer albumId);", "public interface UserDao extends GenericDao<User, Long> {\n\n /**\n * Loads user by his username and also fetches his profile photo.\n * @param username Username.\n * @return User with his profile photo or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsernameFetchProfilePhoto(@Param(\"username\") String username);\n\n /**\n * Loads user by his username.\n * @param username Username.\n * @return User or null if no user is found.\n */\n @Query(\"SELECT u FROM User u LEFT JOIN FETCH u.profilePhoto WHERE u.username = :username\")\n User findByUsername(@Param(\"username\") String username);\n\n /**\n * Returns true if user with this username already exists in database.\n * @param username Username.\n * @return True if user with this username already exists in database.\n */\n boolean existsByUsername(String username);\n\n /**\n * Returns the number of users which are using the same profile photo.\n * @param profilePhoto Profile photo.\n * @return Number of users with same profile photo.\n */\n long countUsersByProfilePhoto(KivbookImage profilePhoto);\n}", "public void setImageName(String name) {\n imageToInsert = name;\n}", "@Dao\npublic interface ScenicPicDao {\n @Insert\n void insertScenicPic(ScenicPic scenicPic);\n\n @Query(\"DELETE from ScenicPic where scenic_id=:scenicId\")\n void deleteAllScenicPic(int scenicId);\n\n //return live data when data be changed, list update automatically\n @Query(\"select * from ScenicPic where scenic_id=:scenicId\")\n List<ScenicPic> getScenicPicById(int scenicId);\n}", "@Override\n public IPictureDto getPictureById(int pictureId) {\n return null;\n }", "protected void setPic() {\n }", "@Override\n public Image getColumnImage(Object element, int columnIndex) {\n return null;\n }", "public interface GoodsDao {\n\n @Select(\"SELECT g.id, g.NAME, g.caption, g.image, g.price FROM xx_goods g LEFT JOIN \" +\n \" xx_product_category p on g.product_category = p.id LEFT JOIN xx_goods_tag t on g.id=t.goods \" +\n \" where p.tree_path LIKE ',${categoryId},%' AND t.tags = #{tagId} and g.is_marketable=1 order by g.id LIMIT #{limit}\")\n List<Goods> findHotGoods(@Param(value = \"categoryId\") Integer categoryId,\n @Param(value = \"tagId\")Integer tagId, @Param(value = \"limit\")Integer limit);\n}", "public String getPic() {\n return pic;\n }", "public String getPic() {\n return pic;\n }", "public List<PropertyImages> findAll() throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" ORDER BY ID\", this);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public void initLoadTable(){\n movies.clear();\n try {\n Connection conn = ConnectionFactory.getConnection();\n try (Statement stmt = conn.createStatement()) {\n String str=\"select title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,img from movies \";\n ResultSet rs= stmt.executeQuery(str);\n while(rs.next()){\n String title=rs.getString(\"title\");\n String director=rs.getString(\"director\");\n int prodYear=rs.getInt(\"prodYear\");\n boolean lent=rs.getBoolean(\"lent\"); \n int lentCount=rs.getInt(\"lentCount\");\n boolean original=rs.getBoolean(\"original\");\n String storageType=rs.getString(\"storageType\");\n int movieLength=rs.getInt(\"movieLength\");\n String mainCast=rs.getString(\"mainCast\");\n Blob blob = rs.getBlob(\"img\");\n InputStream inputStream = blob.getBinaryStream();\n OutputStream outputStream = new FileOutputStream(\"resources/\"+title+director+\".jpg\");\n int bytesRead = -1;\n byte[] buffer = new byte[1];\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n outputStream.write(buffer, 0, bytesRead);\n }\n inputStream.close();\n outputStream.close();\n System.out.println(\"File saved\"); \n File image = new File(\"resources/\"+title+director+\".jpg\");\n \n movies.add(new Movie(title,director,prodYear,lent,lentCount,original,storageType,movieLength,mainCast,image));\n }\n rs.close();\n stmt.close(); \n }\n conn.close();\n } catch (Exception ex) {\n System.err.println(ex.toString());\n } \n \n fireTableDataChanged();\n }", "public String getPicture() {\r\n return picture;\r\n }", "public List<HashMap<String, Object>> imgListSel() {\n\t\treturn sql.selectList(\"imageMapper.imgListSel\", null);\n\t}", "@Override\r\n\tpublic Map<String, Object> select_file_info(Map<String, Object> map) throws Exception {\n\t\treturn sql.selectOne(\"cms_board.select_file_info\", map);\r\n\t}", "@Override\r\n public String getInfo() {\r\n return \"Photo name: \"+this.info;\r\n }", "public Long getImgId() {\r\n return imgId;\r\n }", "@Override\r\n\tpublic Album getMyImage(int id) throws SQLException {\n\t\treturn dao.getMyImage(id);\r\n\t}", "public BufferedImage readImage(String id) {\n BufferedImage bufImg = null;\n try {\n PreparedStatement pstmt = conn.prepareStatement(\n \"SELECT photo FROM vehicles WHERE veh_reg_no = ?\");\n pstmt.setString(1, id);\n System.out.println(pstmt); // for debugging\n ResultSet rset = pstmt.executeQuery();\n // Only one result expected\n rset.next();\n // Read image via InputStream\n InputStream in = rset.getBinaryStream(\"photo\"); \n // Decode the inputstream as BufferedImage\n bufImg = ImageIO.read(in); \n } catch(Exception ex) {\n ex.printStackTrace();\n }\n return bufImg;\n }", "@Generated(hash = 1379637793)\npublic List<ImagemOcorrencia> getImagemOcorrencias() {\n if (imagemOcorrencias == null) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n ImagemOcorrenciaDao targetDao = daoSession.getImagemOcorrenciaDao();\n List<ImagemOcorrencia> imagemOcorrenciasNew = targetDao\n ._queryOcorrenciaDocumento_ImagemOcorrencias(id);\n synchronized (this) {\n if (imagemOcorrencias == null) {\n imagemOcorrencias = imagemOcorrenciasNew;\n }\n }\n }\n return imagemOcorrencias;\n}", "public void setImage(int imageId) {\n this.imageId=imageId;\n\t}", "public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }", "@Override\n\tpublic List<String> getAllImages() {\n\t\t\n\t\treturn jdbcTemplate.query(\"select * from news\", new BeanPropertyRowMapper<News>());\n\t}", "public interface IndexMapper extends SqlMapper{\n /**\n * 首页四张图片的查询\n * @return\n */\n List<IndexBO> getBanner();\n\n}", "public Image getPic() {\n return pic;\n }", "public interface RecommendCardMapper extends BaseDao {\n\n //推荐卡列表\n @Select(\"select cr.icr_id cardId,cr.cr_pic_url picURL,cr.cr_action_url actionURL ,cr.cr_card_name cardName\" +\n \" from tb_card_recommend cr where cr.is_del=0 and cr.is_hidden=0 and \" +\n \" cr.cr_type = #{key,jdbcType=VARCHAR} and(cr.city_code='all' or instr(cr.city_code,#{adcode,jdbcType=VARCHAR})>0 ) \" +\n \" order by cr.cr_card_order desc\")\n Page<RecommendCardDto> getRecommendCardsByCityCode(RecommendCardBean bean);\n\n @Select(\"select * from (select cr.cr_card_id cardId,cr.cr_card_name cardName,cr.cr_prc_url picURL,\" +\n \"cr.city_code cityCode,cr.cr_card_order orderNum from tb_card_recommend cr where \" +\n \"cr.cr_card_id=#{cardId,jdbcType=VARCHAR} order by cr.cr_card_order desc) card where rownum=1\")\n RecommendCardDto getRecommendCardDetailById(@Param(\"cardId\") String cardId);\n //推荐卡点击量\n @Update(\"update tb_card_recommend set cr_click_count=cr_click_count+1 where icr_id=#{cardId,jdbcType=INTEGER}\")\n int updatePicClickCount(@Param(\"cardId\") int cardId);\n\n}", "int updateByPrimaryKeyWithBLOBs(SysPic record);", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "@MyBatisDao\npublic interface UserProfileMapper {\n UserProfile selectByPrimaryKey(long id);\n\n UserProfile selectByUserId(long userId);\n\n UserProfile selectByEmail(String email);\n\n int deleteByPrimaryKey(long id);\n\n int insert(UserProfile userProfile);\n\n int update(UserProfile userProfile);\n\n int updateAvatar(UserProfile userProfile);\n}", "int updateByPrimaryKey(SysPic record);", "private void displayFloorImage() {\n SitumSdk.communicationManager().fetchFloorsFromBuilding(selectedBuilding, new Handler<Collection<Floor>>() {\n @Override\n public void onSuccess(Collection<Floor> floors) {\n Log.i(TAG, \"onSuccess: received levels: \" + floors.size());\n Floor floor = new ArrayList<>(floors).get(0);\n //Get the floor image bitmap\n SitumSdk.communicationManager().fetchMapFromFloor(floor, new Handler<Bitmap>() {\n @Override\n public void onSuccess(Bitmap bitmap) {\n imageViewLevel.setImageBitmap(bitmap);\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floor map: \" + error);\n }\n });\n }\n\n @Override\n public void onFailure(Error error) {\n Log.e(TAG, \"onFailure: fetching floors: \" + error);\n }\n });\n }", "private int getPictureType()\n {\n return pictureType;\n }", "public interface KivbookImageDao extends GenericDao<KivbookImage, Long> {\n\n /**\n * Returns the min id in the table.\n * @return Min id.\n */\n @Query(\"SELECT MIN(id) FROM KivbookImage \")\n Long getMinId();\n}", "@Repository\npublic interface ImaginationDao {\n void saveIma(Imagination imagination);\n List<Imagination> findAll();\n Imagination findOne();\n\n\n}", "public String getImgId() {\n return imgId;\n }", "public List<Upfile> findLinerPic(Long itickettypeid);", "private PhotoDTO setPhotoDto(ResultSet rs) {\r\n\r\n PhotoDTO photoDto = photoFactory.getPhotoDTO();\r\n try {\r\n photoDto.setPhotoId(rs.getInt(\"photo_id\"));\r\n photoDto.setPhoto(rs.getString(\"photo\"));\r\n photoDto.setFurniture(rs.getInt(\"furniture\"));\r\n } catch (SQLException e) {\r\n throw new FatalException(e.getMessage());\r\n }\r\n return photoDto;\r\n\r\n }", "private void setPic() {\n int targetW =20;// mImageView.getWidth();\n int targetH =20;// mImageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;//设置仅加载位图边界信息(相当于位图的信息,但没有加载位图)\n\n //返回为NULL,即不会返回bitmap,但可以返回bitmap的横像素和纵像素还有图片类型\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n mImageView.setImageBitmap(bitmap);\n }", "@MyBatisDao\n@Repository\npublic interface DeviceDao {\n\n void addDevice(DeviceDTO deviceDTO);\n\n void updateDevice(DeviceDTO deviceDTO);\n\n void delDevice(Integer id);\n\n List<String> selectAllType();\n\n List getDeviceByInfo(DeviceDTO deviceDTO);\n\n int getDeviceNum(String type);\n\n int deviceBindNum(String type);\n}", "public List<Image> getAllImage()\n {\n GetAllImageQuery getAllImageQuery = new GetAllImageQuery();\n return super.queryResult(getAllImageQuery);\n }", "public String getPicture(String name){\r\n return theContacts.get(name).getPicture();\r\n }", "@Override\n public GardenPictureBO getGardenPictureByIdFetchImage(Long pIdProductPictureBO) {\n GardenPictureBO gardenPictureBO = get(pIdProductPictureBO);\n //We manually call the image to load \n gardenPictureBO.getPicture();\n return gardenPictureBO;\n }", "public String getPhotoFileName() {\n return \"IMG_\" + getId().toString() + \".jpg\";\n }", "public ImageDAO() {\r\n super();\r\n con = MySQLConnection.getMyOracleConnection();\r\n }", "ProductPricelistEntityWithBLOBs selectByPrimaryKey(Integer id);", "public static ArrayList<Product> selectAllPhotos() throws SQLException{\r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n }\r\n catch(ClassNotFoundException ex) {\r\n \r\n System.exit(1);\r\n }\r\n String URL = \"jdbc:mysql://localhost/phototest\";\r\n String USER = \"root\";\r\n String PASS = \"\";\r\n Connection connection = DriverManager.getConnection(URL, USER, PASS);\r\n PreparedStatement ps = null;\r\n ResultSet rs = null;\r\n \r\n String query = \"SELECT id,artistEmail,url,name,price,about FROM photos\";\r\n \r\n try{\r\n ps = connection.prepareStatement(query);\r\n \r\n ArrayList<Product> products = new ArrayList<Product>();\r\n rs = ps.executeQuery();\r\n while(rs.next())\r\n {\r\n Product p = new Product();\r\n p.setCode(rs.getString(\"id\"));\r\n p.setArtistEmail(rs.getString(\"artistEmail\"));\r\n p.setName(rs.getString(\"name\"));\r\n p.setImageURL(rs.getString(\"url\"));\r\n p.setPrice(rs.getDouble(\"price\"));\r\n p.setDescription(rs.getString(\"about\"));\r\n \r\n products.add(p);\r\n }\r\n return products;\r\n }\r\n catch(SQLException e){\r\n e.printStackTrace();\r\n return null;\r\n }\r\n finally\r\n {\r\n DBUtil.closeResultSet(rs);\r\n DBUtil.closePreparedStatement(ps);\r\n //pool.freeConnection(connection);\r\n }\r\n }", "public void writeImage(File file, String id) {\n try {\n FileInputStream in = new FileInputStream(file);\n PreparedStatement pstmt = conn.prepareStatement(\n \"UPDATE vehicles vehicles SET photo=? WHERE veh_reg_no = ?\");\n pstmt.setBinaryStream(1, (InputStream)in, (int)file.length());\n pstmt.setString(2, id);\n System.out.println(pstmt); // for debugging\n int returnCode = pstmt.executeUpdate();\n System.out.println(returnCode + \" record updated\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n return null;\r\n }", "Receta getByIdWithImages(long id);", "public interface ProductImageRepository extends JpaRepository<ProductImage,Integer> {\n\n ProductImage findProductImageById(Integer id);\n\n List<ProductImage> findProductImagesByProduct(Product product);\n\n @Query(value = \"select * from product_image where product_id = :productId and type LIKE 'PROFIL'\", nativeQuery = true)\n ProductImage findProfilByProduct(@Param(\"productId\") Integer productId);\n\n}", "public void listarImg(int id, HttpServletResponse response) {\n\n String sql = \"select foto from producto where idProducto=?;\";\n\n InputStream inputStream = null;\n OutputStream outputStream = null;\n BufferedInputStream bufferedInputStream = null;\n BufferedOutputStream bufferedOutputStream = null;\n response.setContentType(\"image/*\"); //que hace esto?? uu\n\n try (Connection conn = getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql);) {\n outputStream = response.getOutputStream();\n\n pstmt.setInt(1, id);\n\n try (ResultSet rs = pstmt.executeQuery()) {\n if (rs.next()) {\n inputStream = rs.getBinaryStream(\"foto\");\n }\n }\n bufferedInputStream = new BufferedInputStream(inputStream);\n bufferedOutputStream = new BufferedOutputStream(outputStream);\n\n int i = 0;\n while ((i = bufferedInputStream.read()) != -1) {\n bufferedOutputStream.write(i);\n }\n bufferedOutputStream.flush();\n\n } catch (SQLException | IOException e) {\n e.printStackTrace();\n }\n }", "int updateByPrimaryKey(EnterprisePicture record);", "com.google.protobuf.ByteString getPicture();", "public Integer getPicType() {\n return picType;\n }", "public ImageDAO(Connection con) {\r\n super();\r\n this.con = con;\r\n }", "@Override\r\n\tpublic ArrayList<theaterImageVo> selectImage() {\n\t\treturn theaterRentalDaoImpl.selectImage();\r\n\t}", "int updateByPrimaryKey(SportAlbumPicture record);", "public void setPicType(Integer picType) {\n this.picType = picType;\n }", "public boolean GetImgPagina(int cod, String filePathName) throws SQLException {\n try {\n\n Connection con = model.connectionDataBase.ConnectionDB.Connect();\n\n \n PreparedStatement stmt = con.prepareStatement(\"SELECT `immagine_pagina` FROM `pagine_opera` WHERE cod_pagina = ?\");\n\n stmt.setInt(1, cod);\n ResultSet rs = stmt.executeQuery();\n\n\n while (rs.next()) {\n InputStream in = rs.getBinaryStream(1);\n OutputStream f = new FileOutputStream(new File(filePathName));\n \n int n = 0;\n while ((n = in.read()) > -1) {\n f.write(n);\n }\n f.close();\n in.close();\n\n return true;\n }\n } catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n return false;\n }", "public void setPicture(String picture) {\n this.picture = picture;\n }", "public getPicPath(HashMap< String, String> picPath) {\n\t// TODO Auto-generated constructor stub\n\tthis.picPathMap = picPath;\n\t//hotPicPathMap = new HashMap<String, String>();\n}", "@Override\r\n public Image getColumnImage(Object element, int columnIndex) {\r\n\r\n Model item = (Model) element;\r\n\r\n if (columnIndex == 0) {\r\n int itemId = item.getId();\r\n\r\n if (itemId == 1 || itemId == 7 || itemId == 13 || itemId == 19) {\r\n return testImage;\r\n }\r\n else if (itemId == 3 || itemId == 9 || itemId == 15) {\r\n return test2Image;\r\n }\r\n else if (itemId == 5 || itemId == 11 || itemId == 17) {\r\n return test3Image;\r\n }\r\n }\r\n\r\n return null;\r\n }", "List<EnterprisePicture> selectByExample(EnterprisePictureExample example);", "@Override\n\tpublic Map<String, Object> getRoomInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteHouseInfoExample voteHouseInfoExample = new VoteHouseInfoExample();\n\t\ttry {\n\t\t\tcom.indihx.elecvote.entity.VoteHouseInfoExample.Criteria criteria = voteHouseInfoExample.createCriteria();\n\t\t\tcriteria.andSectNameEqualTo((String)requestMap.get(\"sectName\"));\n\t\t\tcriteria.andBuildCodeEqualTo((String)requestMap.get(\"buildCode\"));\n\t\t\tcriteria.andUnitCodeEqualTo((String)requestMap.get(\"unitCode\"));\n\t\t\tcriteria.andFloorCodeEqualTo((String)requestMap.get(\"floorCode\"));\n\t\t\tvoteHouseInfoExample.setOrderByClause(\"build_code asc\");\n\t\t\tvoteHouseInfoExample.setDistinct(true);\n\t\t\tList<VoteHouseInfo> list = voteHouseInfoMapper.selectDistinctRoom(voteHouseInfoExample);\n\t\t\tresponseMap.put(\"listInfo\", list);\n\t\t\tresponseMap.put(\"status\", true);\n\t\t\treturn responseMap;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tlogger.error(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t\tthrow new BusinessException(\"加载文件数据错误:\"+ExceptionUtil.getErrorMsg(e));\n\t\t}\n\t}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "void savePicturePath(String userName, String picturePath) throws DatabaseException;", "public int getRightImageId() {\n return rightImageId;\n }", "List<Info> getBookInfoById(Long infoId) throws Exception;", "public Image getColumnImage(Object arg0, int arg1) {\n\t\t\t\treturn null;\r\n\t\t\t\t\r\n\t\t\t}", "public int getImageId(){\n \t\treturn imageId;\n \t}", "public interface CrmDmDbsBmsMapper {\n public static String TABLENAME = \"crm_dm_bds_bms\";\n @Select(\"select * from \"+TABLENAME+\" WHERE staff_city_id=#{cityId, jdbcType=BIGINT} limit 10 \")\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType= JdbcType.BIGINT, id=true),\n @Result(column=\"Saler_id\", property=\"salerId\", jdbcType= JdbcType.BIGINT),\n @Result(column=\"Saler_name\", property=\"salerName\", jdbcType= JdbcType.BIGINT)\n })\n public List<CrmDmBdsBms> findSalerListByCityId(@Param(\"cityId\") Long cityId);\n}", "public interface HousePictureRepository extends CrudRepository<HousePicture, Long> {\n\n List<HousePicture> findAllByHouseId(Long id);\n}", "private void queryAndSetPicture() {\n StorageReference storageRef = mStorage.getReference().child(user.getId());\n final long ONE_MEGABYTE = 1024 * 1024;\n storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n // Data for \"images/island.jpg\" is returns, use this as needed\n mImageByteArray = bytes;\n mImageBitmap = BitmapFactory.decodeByteArray(mImageByteArray, 0, mImageByteArray.length);\n mUserimage.setImageBitmap(mImageBitmap);\n mUserimage.setBackgroundColor(80000000);\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle any errors\n// mUserimage.setBackgroundColor(80000000);\n }\n });\n\n }", "String getItemImage();", "@Transactional(readOnly = true)\n\t@Override\n\tpublic String getImage() {\n\t\tUserProfile userProfile = userProfileRepository.getOne(UserProfileUtils.getUsername());\n\t\treturn userProfile.getImage();\n\t}", "public interface CollectionImageDAO extends GenericDAO<CollectionImage> {\n\n /**\n * Returns CollectionImage by filter collection owner id and image id.\n * @param ownerId\n * @param imageId\n */\n CollectionImage findBy(Long ownerId, Long imageId);\n}", "public void edit_item_info(Item i,String pic) {\n i.setItemPicPath(\"images/\"+pic);\n// i.setItemTag(itemTag);\n// i.setItemSaleNum(itemSaleNum); \n em.merge(i);\n em.flush();\n\n }", "private void populateMap() {\n DatabaseHelper database = new DatabaseHelper(this);\n Cursor cursor = database.getAllDataForScavengerHunt();\n\n //database.updateLatLng(\"Gym\", 34.181243783767364, -117.31866795569658);\n\n while (cursor.moveToNext()) {\n double lat = cursor.getDouble(cursor.getColumnIndex(database.COL_LAT));\n double lng = cursor.getDouble(cursor.getColumnIndex(database.COL_LONG));\n int image = database.getImage(cursor.getString(cursor.getColumnIndex(database.COL_LOC)));\n\n //Log.i(\"ROW\", R.drawable.library + \"\");\n LatLng coords = new LatLng(lat, lng);\n\n GroundOverlayOptions overlayOptions = new GroundOverlayOptions()\n .image(BitmapDescriptorFactory.fromResource(image))\n .position(coords, 30f, 30f);\n\n mMap.addGroundOverlay(overlayOptions);\n }\n }", "@Override\n public List<ImageLinkVO> getScene7ImageLinks(String orinNum) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, orinNum); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n if(!StringUtils.isEmpty(imageLinkVO.getImageURL())\n \t\t|| !StringUtils.isEmpty(imageLinkVO.getSwatchURL())\n \t\t\t\t|| !StringUtils.isEmpty(imageLinkVO.getViewURL()))\n {\n \timageLinkVOList.add(imageLinkVO);\n }\n }\n }\n }\n catch(final Exception exception){\n LOGGER.error(\"Exception in getScene7ImageLinks() method DAO layer. -- \" + exception.getMessage());\n throw new PEPPersistencyException(exception);\n }\n finally {\n session.flush(); \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "public List<PetsFound> getWorkListDisplayData(String orinNo) throws SQLException, ParseException {\n LOGGER.info(\"This is from getWorkListDisplayData..Start\" );\n List<PetsFound> petList = new ArrayList<PetsFound>();\n PetsFound pet=null;\n XqueryConstants xqueryConstants= new XqueryConstants();\n Session session = null;\n Transaction tx = null;\n \n try{\n Properties prop =PropertyLoader.getPropertyLoader(ImageConstants.LOAD_IMAGE_PROPERTY_FILE);\n session = sessionFactory.openSession();\n tx = session.beginTransaction(); \n //Hibernate provides a createSQLQuery method to let you call your native SQL statement directly. \n Query query = session.createSQLQuery(xqueryConstants.getImageManagementDetails()); \n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(100);\n \n // execute delete SQL statement\n List<Object[]> rows = query.list();\n if (rows != null) {\n \n for(Object[] row : rows){ \n \n String parentStyleORIN = row[0]!=null?row[0].toString():null;\n \n String orinNumber=row[1]!=null?row[1].toString():null;\n String entryType= row[2]!=null?row[2].toString():null;\n String vendorStyle=row[3]!=null?row[3].toString():null;\n String vendorColor=row[4]!=null?row[4].toString():null;\n String vendorColorDesc=row[5]!=null?row[5].toString():null;\n String imageStateCode=row[6] == null? \"\" : row[6].toString();\n String imageStateDesc = prop.getProperty(\"Image\"+imageStateCode);\n String imageState = imageStateDesc != null ? imageStateDesc.toString() : null;\n \n String completionDate=row[7]!=null?row[7].toString():null;\n String supplierId=row[8]!=null?row[8].toString():null;\n \n\n String petStateCode=row[9] == null? \"\" : row[9].toString();\n String petStateDesc = prop.getProperty(petStateCode);\n String petState = petStateDesc != null ? petStateDesc.toString() : null;\n \n String returnCarsFlag = row[10] == null? \"\" : row[10].toString();;\n \n pet = mapAdseDbPetsToPortal(parentStyleORIN,orinNumber,entryType,vendorColor,vendorColorDesc,imageState,completionDate,vendorStyle,pet,supplierId,returnCarsFlag); \n petList.add(pet);\n }\n } \n \n \n }catch(Exception e){\n e.printStackTrace();\n \n }\n finally\n {\n LOGGER.info(\"recordsFetched. worklistdisplayDAOimpl finally block..\" );\n session.flush();\n tx.commit();\n session.close();\n \n }\n\n LOGGER.info(\"This is from getWorkListDisplayData..End\" );\n return petList;\n\n \n }" ]
[ "0.6226258", "0.6088974", "0.6001063", "0.5779212", "0.5669009", "0.5611659", "0.56111395", "0.5576598", "0.5549238", "0.54988503", "0.54916227", "0.5421782", "0.53472024", "0.5332515", "0.5306093", "0.52947956", "0.5206095", "0.5200435", "0.5159608", "0.51350516", "0.51340693", "0.5118486", "0.5097676", "0.5095321", "0.50940627", "0.5075908", "0.5075908", "0.5069445", "0.5066667", "0.5052108", "0.5034999", "0.50333244", "0.5031393", "0.50270677", "0.50256515", "0.50203204", "0.5000448", "0.49959943", "0.49923015", "0.49901214", "0.49884757", "0.49810147", "0.49687818", "0.49598727", "0.49428535", "0.49325904", "0.49267972", "0.49139082", "0.49068", "0.49038923", "0.49004188", "0.48944184", "0.4892529", "0.48749214", "0.48731664", "0.48695415", "0.48631015", "0.48597977", "0.48588875", "0.4851223", "0.48482797", "0.48481792", "0.4847665", "0.48476297", "0.48410937", "0.4834393", "0.4834393", "0.4834393", "0.48338342", "0.48329908", "0.48328584", "0.48227787", "0.48169106", "0.48097047", "0.4808031", "0.48076743", "0.47900614", "0.47863507", "0.47806317", "0.4778584", "0.47774956", "0.47645378", "0.4763426", "0.47634128", "0.4760223", "0.47553986", "0.47544697", "0.4746927", "0.4741086", "0.47280282", "0.47267836", "0.47215453", "0.47203", "0.47192684", "0.47190565", "0.47173375", "0.47154596", "0.47147897", "0.47142908", "0.47120312" ]
0.49392432
45
Resta las pastillas que hay en el laberinto a medida que el pacman se las va comiendo.
public int restarCantidadPastillas(){ return cantidadPastillas--; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moverPlataformas(){\n\t\tfor ( int x=0 ; x < 2; x++){\n\t\t\tquitarPoder(x);\n\t\t\tgame.moverPersonaje(x);\n\t\t}\n\t}", "public void trancribirPistas() {\r\n\t\t\r\n\t\tfor (int x = 0; x<manejadorArchivos.getPistas().size();x++) {\r\n\t\t\t\r\n\t\t\tpistas.add(manejadorArchivos.getPistas().get(x));\t\r\n\t\t}\r\n\t}", "public void transcribir() \r\n\t{\r\n\t\tpalabras = new ArrayList<List<CruciCasillas>>();\r\n\t\tmanejadorArchivos = new CruciSerializacion();\r\n\t\tint contador = 0;\r\n\t\t\r\n\t\tmanejadorArchivos.leer(\"src/Archivos/crucigrama.txt\");\r\n\t\t\r\n\t\tfor(int x = 0;x<manejadorArchivos.getPalabras().size();x++){\r\n\t\t\t\r\n\t\t\tcontador++;\r\n\t\t\t\r\n\t\t\tif (contador == 4) {\r\n\t\t\t\r\n\t\t\t\tList<CruciCasillas> generico = new ArrayList<CruciCasillas>();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 0; y < manejadorArchivos.getPalabras().get(x).length();y++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tgenerico.add(new CruciCasillas(manejadorArchivos.getPalabras().get(x).charAt(y)));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (y == (manejadorArchivos.getPalabras().get(x).length() - 1)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpalabras.add(generico);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcontador = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}", "private static void grabarYllerPaciente() {\r\n\t\tPaciente paciente = new Paciente(\"Juan\", \"Garcia\", \"65\", \"casa\", \"2\", \"1998\");\r\n\t\tPaciente pacienteDos = new Paciente(\"MArta\", \"Garcia\", \"65\", \"casa\", \"3\", \"1998\");\r\n\t\tPaciente pacienteTres = new Paciente(\"MAria\", \"Garcia\", \"65\", \"casa\", \"4\", \"1998\");\r\n\t\tString ruta = paciente.getIdUnico();\r\n\t\tString rutaDos = pacienteDos.getIdUnico();\r\n\t\tString rutaTres = pacienteTres.getIdUnico();\r\n\t\tDTO<Paciente> dtoPacienteDos = new DTO<>(\"src/Almacen/\" + rutaDos + \".dat\");\r\n\t\tDTO<Paciente> dtoPaciente = new DTO<>(\"src/Almacen/\" + ruta + \".dat\");\r\n\t\tDTO<Paciente> dtoPacienteTres = new DTO<>(\"src/Almacen/\" + rutaTres + \".dat\");\r\n\t\tif (dtoPaciente.grabar(paciente) == true) {\r\n\r\n\t\t\tSystem.out.println(paciente.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tif (dtoPacienteDos.grabar(pacienteDos) == true) {\r\n\r\n\t\t\tSystem.out.println(pacienteDos.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tif (dtoPacienteTres.grabar(pacienteTres) == true) {\r\n\t\t\tSystem.out.println(pacienteTres.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tPaciente pacienteLeer = dtoPaciente.leer();\r\n\t\tSystem.out.println(pacienteLeer);\r\n\t\tSystem.out.println(pacienteLeer.getNombre());\r\n\t}", "public void limpiarPaneles(){\n vistaInicial.jpCentralGeneral.removeAll();\n vistaInicial.jpDerecha.removeAll();\n vistaInicial.jpCentral.removeAll();\n }", "public void procesarCajas() {\n\t\tCollections.sort(destinos, Collections.reverseOrder());\n\t\t// si tengo mas o igual vias que periodos el problema se acaba aca\n\t\tif (this.destinos.size() > 1) {\n\t\t\tasignarDestinosAScannersHijos();\n\t\t\tactualizarNumeroProcesamientoDestinos();\n\t\t}\n\t\tsetearEnQuePasadaSeMataronLosDestinos();\n\t\tprocesarScannerHijos();\n\t}", "private void dibujarPuntos() {\r\n for (int x = 0; x < 6; x++) {\r\n for (int y = 0; y < 6; y++) {\r\n panelTablero[x][y].add(obtenerIcono(partida.getTablero()\r\n .getTablero()[x][y].getColor()));\r\n }\r\n }\r\n }", "public void armarPreguntas(){\n preguntas = file.listaPreguntas(\"Preguntas.txt\");\n }", "private void compruebaColisiones()\n {\n // Comprobamos las colisiones con los Ufo\n for (Ufo ufo : ufos) {\n // Las naves Ufo chocan con la nave Guardian\n if (ufo.colisionaCon(guardian) && ufo.getVisible()) {\n mensajeDialogo(0);\n juego = false;\n }\n // Las naves Ufo llegan abajo de la pantalla\n if ((ufo.getPosicionY() - ufo.getAlto() > altoVentana)) {\n mensajeDialogo(0);\n juego = false;\n }\n // El disparo de la nave Guardian mata a una nave Ufo\n if (ufo.colisionaCon(disparoGuardian) && ufo.getVisible()) {\n ufo.setVisible(false);\n disparoGuardian.setVisible(false);\n disparoGuardian.setPosicion(0, 0);\n ufosMuertos++;\n }\n }\n\n // El disparo de las naves Ufo mata a la nave Guardian\n if (guardian.colisionaCon(disparoUfo)) {\n disparoUfo.setVisible(false);\n mensajeDialogo(0);\n juego = false;\n }\n\n // Si el disparo Guardian colisiona con el disparo de los Ufo, se\n // eliminan ambos\n if (disparoGuardian.colisionaCon(disparoUfo)) {\n disparoGuardian.setVisible(false);\n disparoGuardian.setPosicion(0, 0);\n disparoUfo.setVisible(false);\n }\n }", "private void asignarDestinosAScannersHijos() {\n\t\tPasadaPorScanner pasadaPorScannerHija = crearPasadaPorScannerHija();\n\t\tthis.pasadasPorScannerHijas.add(pasadaPorScannerHija);\n\n\t\tfor (Destino destinoAAsignar : this.destinos) {\n\t\t\tPasadaPorScanner ultimaPasadaPorScanner = this.pasadasPorScannerHijas\n\t\t\t\t\t.get(this.pasadasPorScannerHijas.size() - 1);\n\t\t\tif (!this.estaLlenoElScanner(ultimaPasadaPorScanner, destinoAAsignar) || esElUltimoScanner()) {\n\t\t\t\tultimaPasadaPorScanner.agregarDestinoAProcesar(destinoAAsignar);\n\t\t\t\tdestinoAAsignar.agregarNodoPorDondePaso(ultimaPasadaPorScanner.getId());\n\t\t\t} else {\n\t\t\t\tPasadaPorScanner nuevaPasadaPorScanner = crearPasadaPorScannerHija();\n\t\t\t\tnuevaPasadaPorScanner.agregarDestinoAProcesar(destinoAAsignar);\n\t\t\t\tthis.pasadasPorScannerHijas.add(nuevaPasadaPorScanner);\n\t\t\t\tdestinoAAsignar.agregarNodoPorDondePaso(nuevaPasadaPorScanner.getId());\n\t\t\t}\n\t\t}\n\t}", "public void comprobarMov() {\r\n for (int i = 1; i < movimientos.length; i++) {\r\n if (movimientos[i]) {\r\n movimientos[i] = sePuedeMover(i);\r\n }\r\n }\r\n }", "private void cargarMallas() {\n\tmallas.clear();\n\ttry {\n\t mallas = registroServicio.obtenerMallaCurricular(infoCarreraDto);\n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t return;\n\t}\n }", "private void copiaTabuleiro () {\n\t\tTabuleiro tab = Tabuleiro.getTabuleiro ();\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tfor (int j = 0; j < 8; j++)\n\t\t\t\tCasa.copia (casa[i][j], tab.getCasa (i, j));\n\t\t}\n\t}", "public void retournerLesPilesParcelles() {\n int compteur = 0;\n //pour chacune des 4 piles , retourner la parcelle au sommet de la pile\n for (JLabel jLabel : pileParcellesGUI) {\n JLabel thumb = jLabel;\n retournerParcelles(thumb, compteur);\n compteur++;\n }\n }", "public void comenzarDiaLaboral() {\n\t\tSystem.out.println(\"AEROPUERTO: Inicio del dia laboral, se abren los puestos de informe, atención y freeshops al público, el conductor del tren llega a tiempo como siempre\");\n\t\tthis.turnoPuestoDeInforme.release();\n\t\t}", "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\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//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\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\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void moverArriba()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThread.sleep(VentanaJuego.RapidezMovimientoJefe);\n\t\t\t\tJefe.setLocation(Jefe.getX(), Jefe.getY() - 5);\n\t\t\t\tif (Jefe.getY() < -5)\n\t\t\t\t{\n\t\t\t\t\tmoverAbajo();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\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}", "public void limparTextoCamadas() {\n Platform.runLater(() -> {\n camadaAplicacao.limpar();\n camadaEnlace.limpar();\n camadaFisica.limpar();\n });\n }", "@Override\n\tpublic void llenarArreglo(){\n\n\t\tString[] textoSeparado = texto.toLowerCase().split(\"\\\\W+\"); //pasa todo a minusculas y despues busca todas las no palabras con W y con + junta los que estan seguidos para separador, ver http://regexr.com/3dcpk\n\n\t\tif (palabras==null) {\n\t\t\t//agregar el primer elemento manualmente\n\t\t\tLabel etiqueta = new Label(textoSeparado[0]);\n\t\t\tpalabras = new Palabra[1];\n\t\t\tpalabras[0] = new Palabra(textoSeparado[0], etiqueta);\n\t\t}\n\n\t\t\tfor (int i=1; i<textoSeparado.length; i++) { //importante el uno para no contar la primera palabra dos veces\n\t\t\t\tString buscar= textoSeparado[i];\n\t\t\t\tif (!checarListaNegra(buscar)) { //solo se hace la operacion por cada palabra si no esta en la lista negra\n\t\t\t\t\tboolean yaExiste = false;\n\t\t\t\t\tfor (Palabra palabraActual : palabras) {\n\t\t\t\t\t\tif (palabraActual.getContenido().equals(buscar)) {\n\t\t\t\t\t\t\tyaExiste = true;\n\t\t\t\t\t\t\tpalabraActual.actualizarFrecuencia();\n\t\t\t\t\t\t//\tSystem.out.println(\"se actualizo\"+ palabraActual.getContenido());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!yaExiste) {\n\t\t\t\t\t\t//no se encontro la palabra (String buscar) en el gran arreglo de palabras entonces hay que crearla\n\t\t\t\t\t\tagregarPalabra(buscar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "public List<List<CruciCasillas>> cargar(){\r\n\t\t\r\n\t\tList<List<CruciCasillas>> palabras = new ArrayList<List<CruciCasillas>>(manejadorArchivos.cargar());\r\n\t\t\r\n\t\treturn palabras;\r\n\t}", "public static void cargarPacientes() {\n pacientes = new LinkedList<>();\n lpriorPacientes = new PriorityQueue<>((Paciente p1, Paciente p2) -> p1.getSintoma().getPrioridad() - p2.getSintoma().getPrioridad());\n File f = new File(\"pacientes.txt\");\n try {\n Scanner sc = new Scanner(f);\n while (sc.hasNextLine()) {\n String linea = sc.nextLine();\n String[] texto = linea.split(\",\");\n Paciente p = new Paciente(texto[0], texto[1], texto[2], texto[3], Integer.parseInt(texto[4]), sintomaPorNombre(texto[5]));\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Paciente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void limpiarPuntos() {\n \tpuntos.clear();\n }", "private void Mueve() {\n\t\tpaleta1.Mueve_paletas();\n\t\tpaleta2.Mueve_paletas();\n\t\tpelota.Mueve_pelota();\n\t}", "public void ReiniciarPalabra() {\n\t\t\n\t\t/*limpiarCasillero();*/\n\t\t\t\t\n\t\tString palabra = palabras[(int)(Math.random()*5)];\n\t\t\n\t\tSystem.out.println(\" \"+palabra+\" \"+palabra.length());\n\t\t\n\t\tMostrarCasillero(palabra);\n\t\t\n\t\t\n\t}", "public void cargarOfertas() {\r\n\t\tcoi.clearOfertas();\r\n\t\tController c = gui.getController();\r\n\t\tList<Integer> ofertas = c.ofertanteGetMisOfertas();\r\n\t\tfor (Integer id : ofertas) {\r\n\t\t\tString estado = c.ofertaGetEstado(id);\r\n\t\t\tif (estado.equals(GuiConstants.ESTADO_ACEPTADA) || estado.equals(GuiConstants.ESTADO_CONTRATADA)\r\n\t\t\t\t\t|| estado.equals(GuiConstants.ESTADO_RESERVADA)) {\r\n\t\t\t\tPanelOferta oferta = new PanelOferta(gui, id);\r\n\t\t\t\tcoi.addActiva(oferta);\r\n\t\t\t} else if (estado.equals(GuiConstants.ESTADO_PENDIENTE) || estado.equals(GuiConstants.ESTADO_PENDIENTE)) {\r\n\t\t\t\tPanelOferta oferta = new PanelOfertaEditable(gui, id);\r\n\t\t\t\tcoi.addPendiente(oferta);\r\n\t\t\t} else if (estado.equals(GuiConstants.ESTADO_RETIRADA)) {\r\n\t\t\t\tPanelOferta oferta = new PanelOferta(gui, id);\r\n\t\t\t\tcoi.addRechazada(oferta);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcoi.repaint();\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tscrollPane.getHorizontalScrollBar().setValue(0);\r\n\t\t\t\tscrollPane.getVerticalScrollBar().setValue(0);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void moverAbajo()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThread.sleep(VentanaJuego.RapidezMovimientoJefe);\n\t\t\t\tJefe.setLocation(Jefe.getX(), Jefe.getY() + 5);\n\t\t\t\tif (Jefe.getY() > 275)\n\t\t\t\t{\n\t\t\t\t\tmoverArriba();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\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}", "private void mueveObjetos()\n {\n // Mueve las naves Ufo\n for (Ufo ufo : ufos) {\n ufo.moverUfo();\n }\n \n // Cambia el movimiento de los Ufos\n if (cambiaUfos) {\n for (Ufo ufo : ufos) {\n ufo.cambiaMoverUfo();\n }\n cambiaUfos = false;\n }\n\n // Mueve los disparos y los elimina los disparos de la nave Guardian\n if (disparoGuardian.getVisible()) {\n disparoGuardian.moverArriba();\n if (disparoGuardian.getPosicionY() <= 0) {\n disparoGuardian.setVisible(false);\n }\n }\n\n // Dispara, mueve y elimina los disparos de las naves Ufo\n disparaUfo();\n if (disparoUfo.getVisible()) {\n disparoUfo.moverAbajo();\n if (disparoUfo.getPosicionY() >= altoVentana) {\n disparoUfo.setVisible(false);\n }\n }\n\n // Mueve la nave Guardian hacia la izquierda\n if (moverIzquierda) {\n guardian.moverIzquierda();\n }\n // Mueve la nave Guardian hacia la derecha\n if (moverDerecha) {\n guardian.moverDerecha();\n }\n // Hace que la nave Guardian dispare\n if (disparar) {\n disparaGuardian();\n }\n }", "public static String cargarPreguntas(String fileName){\n String line = null; \n try {\n //Para lectura del archivo\n FileReader fileReader =\n new FileReader(fileName); \n \n //BufferedReader para optimización de recursos\n BufferedReader bufferedReader =\n new BufferedReader(fileReader);\n \n// Lee línea por línea, verifica que tengan algo de texto\n while(((line = bufferedReader.readLine()) != null)) {\n if ((line.length() > 0) && !(line.startsWith(\"//\"))){\n// Para ignorar las líneas de comentario en el archivo de texto\n //if (!(line.startsWith(\"//\"))){\n// Crea una lista de Strings para cada línea a evaluar\n List<String> listaLinea = new ArrayList<>(Arrays.asList(line.split(\";\")));\n// Impresión de prueba del ArrayList(descomentar)\n// System.out.println(listaLinea);\n \n //Obtiene lista de Respuestas, en tipo String\n List <String >resp = listaLinea.subList(1,listaLinea.size());\n //Creación de Respuestas (bajo el debido constructor) en un HashSet\n HashSet<Respuesta> respuestas = new HashSet(); \n for (int i = 0; i < resp.size();i++){\n if (i == 0){\n //Identifica la respuesta correcta\n respuestas.add(new Respuesta(resp.get(i), true));\n }\n else{\n //Identifica las respuestas incorrectas\n respuestas.add(new Respuesta(resp.get(i), false));\n } \n }\n //System.out.println(resp); Impresión de prueba (descomentar)\n \n //Agrega Preguntas y Respuestas a nuestro HashSet y HashMap\n Almacenamiento.getPreguntas().add(new Pregunta(listaLinea.get(0)));\n Almacenamiento.getMapaPR().put(new Pregunta(listaLinea.get(0)), respuestas); \n //}\n }\n }\n //Impresiones de prueba, descomentar.\n// for(Pregunta p: Almacenamiento.getPreguntas()){\n// System.out.println(p.toString()); \n// } \n// Almacenamiento.getMapaPR().forEach((k,v)-> System.out.println(k+\", \"+v));\n \n // Siempre cerrar archivo, para optimizar recursos\n bufferedReader.close(); \n }\n //Detalle de exception impreso en consola\n catch(FileNotFoundException ex) {\n System.out.println(\n \"No se pudo abrir archivo '\" +\n fileName + \"'\"); \n }\n //Detalle de exception impreso en consola\n catch(IOException ex) {\n System.out.println(\n \"Error leyendo archivo '\"\n + fileName + \"'\"); \n }\n return null;\n }", "private void moverCamionetas() {\n for (Camioneta cam : arrEnemigosCamioneta) {\n cam.render(batch);\n\n cam.moverIzquierda();\n }\n }", "private void esvaziaMensageiro() {\n\t\tMensageiro.arquivo=null;\n\t\tMensageiro.lingua = linguas.indexOf(lingua);\n\t\tMensageiro.linguas=linguas;\n\t\tMensageiro.nomeArquivo=null;\n\t}", "public void actualizarNombrePoder(){\n\t\tString name = ( game.getCurrentSorpresa() == null )?\"No hay sorpresa\":game.getCurrentSorpresa().getClass().getName();\n\t\tn2.setText(name.replace(\"aplicacion.\",\"\"));\n\t}", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "public void moverAPacman(Direccion direccion) {\n // TODO implement here\n }", "private void cargarJugadoresRetirados() {\n\n\t\tString nombreFichero = \"jugadoresRetirados.csv\";\n\n\t\tListaJugadores.jugadoresRetirados = GestionCSV.obtenerJugadores(nombreFichero);\n\n\t}", "public void prepareSorpresas(){\n\t\tfor( int x= 0 ; x < game.getAmountSorpresas();x++){\n\t\t\tSorpresa s = game.getSorpresa(x);\n\t\t\timage = s.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(s.getAncho(), s.getAlto(), Image.SCALE_SMOOTH);\n\t\t\ts.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "private void cargarNotasEnfermeria() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"admision_seleccionada\", admision_seleccionada);\r\n\t\tparametros.put(\"rol_medico\", \"S\");\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\"/pages/notas_enfermeria.zul\", \"NOTAS DE ENFERMERIA\",\r\n\t\t\t\tparametros);\r\n\t}", "public void listarCarpetas() {\n\t\tFile ruta = new File(\"C:\" + File.separator + \"Users\" + File.separator + \"ram\" + File.separator + \"Desktop\" + File.separator+\"leyendo_creando\");\n\t\t\n\t\t\n\t\tSystem.out.println(ruta.getAbsolutePath());\n\t\t\n\t\tString[] nombre_archivos = ruta.list();\n\t\t\n\t\tfor (int i=0; i<nombre_archivos.length;i++) {\n\t\t\t\n\t\t\tSystem.out.println(nombre_archivos[i]);\n\t\t\t\n\t\t\tFile f = new File (ruta.getAbsoluteFile(), nombre_archivos[i]);//SE ALMACENA LA RUTA ABSOLUTA DE LOS ARCHIVOS QUE HAY DENTRO DE LA CARPTEA\n\t\t\t\n\t\t\tif(f.isDirectory()) {\n\t\t\t\tString[] archivos_subcarpeta = f.list();\n\t\t\t\tfor (int j=0; j<archivos_subcarpeta.length;j++) {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(archivos_subcarpeta[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void cargarRemisiones() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_REMISIONES, \"REMISIONES\", parametros);\r\n\t}", "public void repartirGanancias() {\n\t\t \n\t\t System.out.println(\"JUGADORES EN GANANCIAS:\");\n\t\t for(int i = 0; i < idJugadores.length;i++) {\n\t\t\t System.out.println(\"idJugador [\"+i+\"] : \"+idJugadores[i]);\n\t\t }\n\t\t System.out.println(\"GANADORES EN GANANCIA\");\n\t\t for(int i = 0; i < ganador.size();i++) {\n\t\t\t System.out.println(\"Ganador [\"+i+\"] : \"+ganador.get(i));\n\t\t }\n\t\t if(ganador.size() >= 1) {\n\t\t\t for(int i = 0; i < idJugadores.length; i++) {\n\n\t\t\t\t if(contieneJugador(ganador, idJugadores[i])) {\n\t\t\t\t\t System.out.println(\"Entra ganador \"+idJugadores[i]);\n\t\t\t\t\t if(verificarJugadaBJ(manosJugadores.get(i))) {\n\t\t\t\t\t\t System.out.println(\"Pareja nombre agregado: \"+idJugadores[i]);\n\t\t\t\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(idJugadores[i],25));\n\t\t\t\t\t }else {\n\t\t\t\t\t\t System.out.println(\"Pareja nombre agregado --> \"+idJugadores[i]);\n\t\t\t\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(idJugadores[i],20));\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t } \n\t\t }else {\n\t\t\t System.out.println(\"no ganó nadie\");\n\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(\"null\",0));\n\t\t }\n\t }", "private static void grabarYleerPaciente(Paciente paciente) {\r\n\t\tString ruta = paciente.getIdUnico();\r\n\t\tDTO<Paciente> dtoPaciente = new DTO<>(\"src/Almacen/\" + ruta + \".dat\");\r\n\t\tif (dtoPaciente.grabar(paciente) == true) {\r\n\t\t\tSystem.out.println(paciente.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tPaciente pacienteLeer = dtoPaciente.leer();\r\n\t\tSystem.out.println(pacienteLeer);\r\n\t\tSystem.out.println(pacienteLeer.getNombre());\r\n\t\tSystem.out.println(pacienteLeer.getApellidos());\r\n\t\tSystem.out.println(pacienteLeer.getDireccion());\r\n\t\tSystem.out.println(pacienteLeer.getFechaDeNacimiento());\r\n\t\tSystem.out.println(pacienteLeer.getIdUnico());\r\n\t\tSystem.out.println(pacienteLeer.getTelefono());\r\n\t\tSystem.out.println(pacienteLeer.getTratamientos());\r\n\t}", "public static void main(String[] args) {\n \n String palabaras[], palabraSelected=\"\";\n char juego[];\n char letra; \n char seguir; \n \n \n //puede volver a jugar.\n //con las palabras que no ha salido. Gastando palabras\n //en caso de no existir palabra terminar el juego e indicar el mensaje respectivo.\n\n\n do {\n aciertos=0; errores=0;\n bandera=false;\n\n palabaras= leerArchivo();\n \n if(palabaras.length==0){\n System.out.println(\"No se puede jugar porque no hay palabras\");\n break; \n }\n\n \n \n String nombre= palabaras[0].substring(0,18).trim().toUpperCase();\n\n String pa= String.format(\"%1$-20s\", \"walter\");\n System.out.println(pa.length());\n\n // escribirLineaArchivo(palabaras);\n \n //obtenerPalabra\n //random para obtener la palabara\n \n palabraSelected= obtenerPalabra(palabaras);\n //palabraSelected= palabraSelected.toUpperCase();\n \n //obtnerVectorJuego\n //instacia del venctor juego con el tamaño de la palabra seleccionada\n juego= obtenerVectorJuego(palabraSelected);\n \n /*//1 manera apata de llenar el vector juego con la palabra seleccinada\n for(int i=0; i<palabraSelected.length(); i++){\n \n juego[i]=palabraSelected.charAt(i);\n \n }\n */\n \n //segunda manera\n\n /* if(!palabraSelected.equals(\"fdd\")){\n\n\n }*/\n \n System.out.println(\"BIENVENIDO AL JUEGO DEL AHORCADO..\"); \n \n do {\n \n bandera=false;\n //imprimirJuego\n imprimirJuego(palabraSelected, juego);\n \n letra = solicitarLetra();\n \n //validarLetra\n validarLetra(letra, juego);\n \n //imprimirResultado\n imprimirResultado();\n \n \n } while (aciertos!=juego.length && errores!=7);\n \n \n //imprimirResultadoFinal\n imprimirResultadoFinal(juego, palabraSelected);\n\n\n\n System.out.println(\"Desea volver a jugar(S/N)? \"); \n seguir= scan.next().toUpperCase().charAt(0);\n \n eliminarPalabraArchivo(palabraSelected, palabaras);\n \n\n\n\n\n } while (seguir=='S');\n }", "public static void main(String[] args) {\n String asNombres[]=new String[TAMA];\r\n //CAPTURAR 5 NNOMBRES \r\n Scanner sCaptu = new Scanner (System.in);\r\n for (int i = 0; i < TAMA; i++) {\r\n System.out.println(\"Tu nombre :\");\r\n asNombres[i]=sCaptu.nextLine();\r\n }\r\n for (String asNombre : asNombres) {\r\n System.out.println(\"Nombre: \" + asNombre);\r\n \r\n }\r\n //CREAR UNA COPIA DEL ARREGLO\r\n /*String asCopia[]=asNombre;//Esto no funciona\r\n asNombre[0]=\"HOLA MUNDO\";\r\n System.out.println(asCopia[0]);*/\r\n \r\n String asCopia[]=new String[TAMA];\r\n for (int i = 0; i < TAMA; i++) {\r\n asCopia[i]=asNombres[i];\r\n \r\n }\r\n asNombres[0]=\"HOLA MUNDO\";\r\n System.out.println(\"Nombre = \" + asNombres[0]);\r\n System.out.println(\"Copia = \" + asCopia[0]);\r\n }", "public void AktualizacjaPopulacjiKlas() {\n\t\tSystem.out.println(\"AktualizacjaPopulacjiKlas\");\n\t\tif(Plansza.getNiewolnikNaPLanszy().getJedzenie() >= Plansza.getNiewolnikNaPLanszy().getUbrania()) {\n\t\t\tPlansza.getNiewolnikNaPLanszy().setPopulacja(Plansza.getNiewolnikNaPLanszy().getUbrania());\n\t\t}\n\t\telse {\n\t\t\tPlansza.getNiewolnikNaPLanszy().setPopulacja(Plansza.getNiewolnikNaPLanszy().getJedzenie());\n\t\t}\n\t\t\n\t\tif(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= Plansza.getRzemieslnikNaPlanszy().getMaterialy()) {\n\t\t\tPlansza.getRzemieslnikNaPlanszy().setPopulacja(Plansza.getRzemieslnikNaPlanszy().getMaterialy());\n\t\t}\n\t\telse {\n\t\t\tPlansza.getRzemieslnikNaPlanszy().setPopulacja(Plansza.getRzemieslnikNaPlanszy().getNarzedzia());\n\t\t}\n\t\t\n\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= Plansza.getArystokrataNaPlanszy().getZloto()) {\n\t\t\tPlansza.getArystokrataNaPlanszy().setPopulacja(Plansza.getArystokrataNaPlanszy().getZloto());\n\t\t}\n\t\telse {\n\t\t\tPlansza.getArystokrataNaPlanszy().setPopulacja(Plansza.getArystokrataNaPlanszy().getTowary());\n\t\t}\n\t}", "public List<String> obtenerHiperenlaces() throws IOException {\r\n // Los hiperenlaces debemos guardarlos en un arrayList\r\n ArrayList<String> hipenlaces = new ArrayList<>();\r\n File doc = new File(\"Jsoup_Link.txt\");\r\n doc.delete();\r\n File newdoc = new File(\"Jsoup_Link.txt\");\r\n //nuevo documento donde se escribiran los enlaces\r\n FileWriter fw = new FileWriter(newdoc, false);\r\n Elements links;\r\n links = doc.select(\"a[href]\");\r\n //Con este bucle for conseguimos introducir los links \r\n //en el array y escribirlos en el doc.\r\n for (Element link : links) {\r\n\r\n hipenlaces.add(link.attr(\"href\"));\r\n fw.write(link.attr(\"href\") + nextline);\r\n }\r\n \r\n //Borra los elementos nulos del ArrayList\r\n hipenlaces.removeAll(Arrays.asList(null, \"\"));\r\n\r\n fw.close();\r\n \r\n //devuelve el arraylist\r\n return hipenlaces;\r\n }", "public void borrarListas() {\n\n\t\tthis.jugadoresEnMesa = new ArrayList<Jugador>();\n\t\tListaJugadores.jugadoresRetirados = new ArrayList<Jugador>();\n\n\t}", "protected void cargarOfertas(List<ViajeCabecera> listaViajes){\n\n\t\tpanelOfertas.removeAll();\n\t\t\n\t\tint i = 0;\n\t\t\n\t\tfor (ViajeCabecera viaje : listaViajes) {\t\t\n\t\t\tagregarPanelOferta(viaje, i);\n\t\t\ti++;\n\t\t}\n\t\t\n\t}", "public void resolver(){\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras(); j++){\n\t\t\t\tif(tablero.getTablero()[i].contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tE\");\n\t\t\t\t} else if (tablero.getTablero()[i].contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tO\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Busca sentido Norte y Sur\n\t\tString aux = \"\";\n\t\tfor(int i = 0 ; i < tablero.getTamanio(); i++){\n\t\t\tfor(int j = 0 ; j < tablero.getTamanio(); j++){\n\t\t\t\taux += tablero.getTablero()[j].charAt(i);\n\t\t\t}\n\t\t\tfor(int j = 0 ; j < diccionario.getCantPalabras() ; j++){\n\t\t\t\tif(aux.contains(diccionario.getPalabra()[j].getPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tS\");\n\t\t\t\t} else if(aux.contains(diccionario.getPalabra()[j].invertirPalabra()) && !diccionario.getPalabra()[j].isEncontrada()){\n\t\t\t\t\tdiccionario.getPalabra()[j].setEncontrada(true);\n\t\t\t\t\trespuesta.add(Integer.toString(j+1) + \"\\tN\");\n\t\t\t\t}\n\t\t\t}\n\t\t\taux = \"\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tPrintWriter pw = new PrintWriter(new File(\"Rapigrama1.out\"));\n\t\t\tfor(int i = 0 ; i < respuesta.size(); i++){\n\t\t\t\tpw.println(respuesta.get(i));\n\t\t\t}\n\t\t\tpw.close();\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void schritt() {\r\n\t\tfor (int i = 0; i < anzahlRennautos; i++) {\r\n\t\t\tlisteRennautos[i].fahren(streckenlaenge);\r\n\t\t}\r\n\t}", "private void cargarJugadoresEnMesa() {\n\n\t\tString nombreFichero = String.format(\"jugadoresEnMesa%d.csv\", id);\n\n\t\tthis.jugadoresEnMesa = GestionCSV.obtenerJugadores(nombreFichero);\n\n\t}", "public void borrarPiezasAmenazadoras(){\n this.piezasAmenazadoras.clear();\n }", "private void capturarControles() {\n \t\n \ttxtNombre = (TextView)findViewById(R.id.txtNombre);\n \timagenDestacada = (ImageView)findViewById(R.id.imagenDestacada);\n\t\ttxtDescripcion = (TextView)findViewById(R.id.txtDescripcion);\n\t\tlblTitulo = (TextView)findViewById(R.id.lblTitulo);\n\t\tbtnVolver = (Button)findViewById(R.id.btnVolver);\n\t\tbtnHome = (Button)findViewById(R.id.btnHome);\n\t\tpanelCargando = (RelativeLayout)findViewById(R.id.panelCargando);\n\t}", "private void cargarNotasAclaratorias() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(\"tipo\", INotas.NOTAS_ACLARATORIAS);\r\n\t\ttabboxContendor\r\n\t\t\t\t.abrirPaginaTabDemanda(false, \"/pages/nota_aclaratoria.zul\",\r\n\t\t\t\t\t\t\"NOTAS ACLARATORIAS\", parametros);\r\n\t}", "public void PedirSintomas() {\n\t\t\r\n\t\tSystem.out.println(\"pedir sintomas del paciente para relizar el diagnosticoa\");\r\n\t}", "public static void main(String args[]) throws Exception{\n Pattern patron = Pattern.compile(\"\\\\s+\");\n\n //leer todas las lineas del archivo\n Stream<String> lineas = Files.lines(Paths.get(\"./data/alicia.txt\"),StandardCharsets.ISO_8859_1);\n\n //eliminamos signos de puntuacion\n Stream<String> lineasProcesadas = lineas.map(linea -> linea.replaceAll(\"(?!')\\\\p{Punct}\", \"\"));\n\n //trocear las lineas para tratar con palabras\n\n Stream<String> palabras = lineasProcesadas.flatMap(linea -> patron.splitAsStream(linea));\n\n //filtrar palabras vacias\n\n Stream<String> sinVacias = palabras.filter(palabra -> !palabra.isEmpty());\n\n // generar un diccionario con entradas tipo <palabra, numero de ocurrencias>\n // queremos que el diccionario sea tipo TreeMap\n\n TreeMap<String,Long> mapa = sinVacias.collect(Collectors.groupingBy(String::toLowerCase, TreeMap::new,Collectors.counting()));\n\n\n //Ahora todo compactado\n\n TreeMap<String,Long> mapa2 = Files.lines(Paths.get(\"./data/alicia.txt\"),StandardCharsets.ISO_8859_1).\n map(linea -> linea.replaceAll(\"(?!')\\\\p{Punct}\", \"\")).\n flatMap(linea -> patron.splitAsStream(linea)).\n filter(palabra -> !palabra.isEmpty()).\n collect(Collectors.groupingBy(String::toLowerCase, TreeMap::new,Collectors.counting()));\n\n\n mapa2.forEach(\n (palabra, numero) -> System.out.println(palabra + \" : \" + numero)\n );\n\n //Con esto pedo crear un stream\n //mapa2.entrySet().stream().forEach();\n\n\n //agrupamiento por inicales, todas las palabras con dicha inicial y contadores\n\n TreeMap<Character, List<Map.Entry<String,Long>>> mapa3 = mapa2.\n entrySet().\n stream().\n collect(Collectors.groupingBy(entrada -> entrada.getKey().charAt(0),TreeMap::new,Collectors.toList()));\n\n mapa3.forEach((inicial,listaPalabras) -> {\n System.out.printf(\"%n%c%n\", inicial);\n listaPalabras.stream().forEach( entrada -> {\n System.out.printf(\"%13s: %d%n\", entrada.getKey(), entrada.getValue());\n });\n });\n\n\n\n\n }", "private void dibujarArregloCamionetas() {\n\n timerCrearEnemigo += Gdx.graphics.getDeltaTime();\n if (timerCrearEnemigo>=TIEMPO_CREA_ENEMIGO) {\n timerCrearEnemigo = 0;\n TIEMPO_CREA_ENEMIGO = tiempoBase + MathUtils.random()*2;\n if (tiempoBase>0) {\n tiempoBase -= 0.01f;\n }\n\n camioneta= new Camioneta(texturaCamioneta,ANCHO,60f);\n arrEnemigosCamioneta.add(camioneta);\n\n\n }\n\n //Si el vehiculo se paso de la pantalla, lo borra\n for (int i = arrEnemigosCamioneta.size-1; i >= 0; i--) {\n Camioneta camioneta1 = arrEnemigosCamioneta.get(i);\n if (camioneta1.sprite.getX() < 0- camioneta1.sprite.getWidth()) {\n arrEnemigosCamioneta.removeIndex(i);\n\n }\n }\n }", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public static List<Command> sacarABalonParado(GameSituations gs) {\n\t\tLinkedList<Command> comandos = new LinkedList<Command>();\n\t\t\n\t\tint rematan[] = gs.canKick();\n\t\tif(rematan.length > 0) {\n\t\t\t// para el saque de puerta, saca al centro del campo, con un angulo d 45� para evitar rivales\n\t\t\tif(gs.ballPosition().equals(HBConstants.POSICION_SAQUE_PUERTA_IZDA) || gs.ballPosition().equals(HBConstants.POSICION_SAQUE_PUERTA_DCHA)) {\n\t\t\t\tcomandos.add(new CommandHitBall(rematan[0], Constants.centroCampoJuego, HBConstants.FUERZA_GOLPEO_MAXIMA, HBConstants.ANGULO_GOLPEO_DESPEJE));\n\t\t\t}\n\t\t\t// para el saque de centro, saca al centro del campo propio\n\t\t\telse if(gs.ballPosition().equals(Constants.centroCampoJuego)) { \n\t\t\t\tcomandos.add(new CommandHitBall(rematan[0], HBConstants.POSICION_CENTRO_CAMPO_PROPIO, HBConstants.FUERZA_GOLPEO_MEDIA, HBConstants.ANGULO_GOLPEO_PASE));\n\t\t\t}\n\t\t\t// para el saque de corner, saca al punto de penalty\n\t\t\telse if(gs.ballPosition().equals(Constants.cornerSupIzq) || gs.ballPosition().equals(Constants.cornerSupDer)) { \n\t\t\t\tcomandos.add(new CommandHitBall(rematan[0], Constants.penalSup, HBConstants.FUERZA_GOLPEO_MAXIMA, HBConstants.ANGULO_GOLPEO_CUELGUE));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tList<Command> comandosDePase = PaseAlHuecoSimulado.pasar(gs, rematan[0]);\n\t\t\t\tif(comandosDePase != null)\n\t\t\t\t\tcomandos.addAll(comandosDePase);\n\t\t\t\telse\n\t\t\t\t\tcomandos.add(new CommandHitBall(rematan[0], Constants.penalSup, HBConstants.FUERZA_GOLPEO_MAXIMA, false));\n\t\t\t}\n\t\t}\n\t\treturn comandos;\n\t}", "public void pintarCasilleros(Set<PosicionAjedrez> movimientosPosibles){\n\t\tfor(PosicionAjedrez pos: movimientosPosibles){\n\t\t\tpintarCasilleros(transformar(pos));\n\t\t}\n\t}", "public void actualiza(){\r\n //pregunto si se presiono una tecla de dirección\r\n if(bTecla) {\r\n int iX = basPrincipal.getX();\r\n int iY = basPrincipal.getY();\r\n if(iDir == 1) {\r\n iY -= getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 2) {\r\n iX += getWidth() / iMAXANCHO;\r\n }\r\n if(iDir == 3) {\r\n iY += getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 4) {\r\n iX -= getWidth() / iMAXANCHO;\r\n }\r\n //limpio la bandera\r\n bTecla = false;\r\n \r\n //asigno posiciones en caso de no salirme\r\n if(iX >= 0 && iY >= 0 && iX + basPrincipal.getAncho() <= getWidth()\r\n && iY + basPrincipal.getAlto() <= getHeight()) {\r\n basPrincipal.setX(iX);\r\n basPrincipal.setY(iY);\r\n } \r\n }\r\n \r\n //Muevo los chimpys\r\n for(Base basChimpy : lklChimpys) {\r\n basChimpy.setX(basChimpy.getX() - iAceleracion);\r\n }\r\n \r\n //Muevo los diddys\r\n for(Base basDiddy : lklDiddys) {\r\n basDiddy.setX(basDiddy.getX() + iAceleracion);\r\n }\r\n\r\n }", "private void cargarFichaLepra_control() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\r\n\t\tficha_inicio_lepraService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean ficha_inicio = ficha_inicio_lepraService\r\n\t\t\t\t.existe_paciente_lepra(parameters);\r\n\t\t// log.info(\"ficha_inicio>>>>\" + ficha_inicio);\r\n\r\n\t\tif (ficha_inicio) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "public void limpiar(){\n\t\tfCargaI=new Date();\n\t\tfCargaF=new Date();\n\t\tlistaMarcacion=null;\n\t\tlistaMarcacionPDF=null;\n\t}", "public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}", "public static void main( String [] args){\n String [] cadenas = {\"Rojo\", \"Naranja\", \"Amarillo\", \"Verde\" , \"azul\", \"indigo\", \"Violeta\"};\n\n // Se muestra las cadenas almacenadas\n System.out.printf(\"Cadenas originales: %s%n\", Arrays.asList(cadenas));\n\n /**************** E1 *****************/\n // upperCase\n System.out.printf(\"Cadenas en mayuscula: %s%n\", Arrays.stream(cadenas)\n .map(String::toUpperCase)\n .collect(Collectors.toList()));\n\n /**************** E2 *****************/\n // las cadenas mayores que \"m\" (sin tener en cuenta mayuscula o minusculas) se ordenan de forma ascendente\n System.out.printf(\"Cadenas filtradas y ordenadas (orden asc): %s%n\", Arrays.stream(cadenas)\n // ordenacion lexicografica detras de la m, osea las palabras que quedan detras de la m\n .filter(s -> s.compareToIgnoreCase(\"m\") > 0)\n .sorted(String.CASE_INSENSITIVE_ORDER)\n .collect(Collectors.toList()));\n\n /**************** E2 *****************/\n // las cadenas mayores que \"m\" (sin tener en cuenta mayuscula o minusculas) se ordenan de forma ascendente\n System.out.printf(\"Cadenas filtradas y ordenadas (orden desc): %s%n\", Arrays.stream(cadenas)\n .filter(s -> s.compareToIgnoreCase(\"m\") > 0)\n .sorted(String.CASE_INSENSITIVE_ORDER.reversed())\n .collect(Collectors.toList()));\n }", "private void poetries() {\n\n\t}", "public void limpiarCamposCita() {\r\n try {\r\n visitaRealizada = false;\r\n fechaNueva = null;\r\n observacionReasignaCita = \"\";\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".limpiarCamposCita()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "private void cargarFichaLepra_discapacidades() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\t\tparameters.put(\"fecha_actual\", new Date());\r\n\r\n\t\t// log.info(\"parameters\" + parameters);\r\n\t\tseguimiento_control_pqtService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean fecha_tratamiento = seguimiento_control_pqtService\r\n\t\t\t\t.existe_fecha_fin_tratamiento(parameters);\r\n\t\t// log.info(\"fecha_tratamiento>>>>\" + fecha_tratamiento);\r\n\r\n\t\tif (fecha_tratamiento) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_VALORACION_DISCAPACIDADES_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_VALORACION_DISCAPACIDADES_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "public void revisaColisionMapa() {\n\t\tactualCol = (int)x / tamTile;\n\t\tactualRen = (int)y / tamTile;\n\t\t\n\t\txdest = x + dx;\n\t\tydest = y + dy;\n\t\t\n\t\txtemp = x;\n\t\tytemp = y;\n\t\t\n\t\tcalcularEsquinas(x, ydest);\n\t\tif(dy < 0) {\n\t\t\tif(arribaIzq || arribaDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tytemp = actualRen * tamTile + claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\tif(dy > 0) {\n\t\t\tif(abajoIzq || abajoDer) {\n\t\t\t\tdy = 0;\n\t\t\t\tcayendo = false;\n\t\t\t\tytemp = (actualRen + 1) * tamTile - claltura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tytemp += dy;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcalcularEsquinas(xdest, y);\n\t\tif(dx < 0) {\n\t\t\tif(arribaIzq || abajoIzq) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = actualCol * tamTile + clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\tif(dx > 0) {\n\t\t\tif(arribaDer || abajoDer) {\n\t\t\t\tdx = 0;\n\t\t\t\txtemp = (actualCol + 1) * tamTile - clanchura / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\txtemp += dx;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!cayendo) {\n\t\t\tcalcularEsquinas(x, ydest + 1);\n\t\t\tif(!abajoIzq && !abajoDer) {\n\t\t\t\tcayendo = true;\n\t\t\t}\n\t\t}\n\t}", "public void prepararDados() {\n\t\tatribuiPrimeiroAnoCasoAnoEstejaNulo();\n\t\t\n\t\tsalvarOuAtualizar(alunosMilitarPraca);\n\t\tsalvarOuAtualizar(alunosMilitarOficial);\n\t\t\n\t\tinit();\n\t\thabilitaBotao=false;\n\t}", "public void jugarMaquinaSola(int turno) {\n if (suspenderJuego) {\n return;\n }\n CuadroPieza cuadroActual;\n CuadroPieza cuadroDestino;\n CuadroPieza MovDestino = null;\n CuadroPieza MovActual = null;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n cuadroActual = tablero[x][y];\n if (cuadroActual.getPieza() != null) {\n if (cuadroActual.getPieza().getColor() == turno) {\n for (int x1 = 0; x1 < 8; x1++) {\n for (int y1 = 0; y1 < 8; y1++) {\n cuadroDestino = tablero[x1][y1];\n if (cuadroDestino.getPieza() != null) {\n if (cuadroActual.getPieza().validarMovimiento(cuadroDestino, this)) {\n if (MovDestino == null) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n } else {\n if (cuadroDestino.getPieza().getPeso() > MovDestino.getPieza().getPeso()) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n if (cuadroDestino.getPieza().getPeso() == MovDestino.getPieza().getPeso()) {\n //Si es el mismo, elijo al azar si moverlo o no\n if (((int) (Math.random() * 3) == 1)) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n }\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n if (MovActual == null) {\n boolean b = true;\n do {//Si no hay mov recomendado, entonces genero uno al azar\n int x = (int) (Math.random() * 8);\n int y = (int) (Math.random() * 8);\n tablero[x][y].getPieza();\n int x1 = (int) (Math.random() * 8);\n int y1 = (int) (Math.random() * 8);\n\n MovActual = tablero[x][y];\n MovDestino = tablero[x1][y1];\n if (MovActual.getPieza() != null) {\n if (MovActual.getPieza().getColor() == turno) {\n b = !MovActual.getPieza().validarMovimiento(MovDestino, this);\n //Si mueve la pieza, sale del while.\n }\n }\n } while (b);\n }\n if (MovActual.getPieza().MoverPieza(MovDestino, this)) {\n this.setTurno(this.getTurno() * -1);\n if (getRey(this.getTurno()).isInJacke(this)) {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!! - te lo dije xD\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n } else {\n JOptionPane.showMessageDialog(null, \"Rey en Hacke - ya t kgste\");\n }\n } else {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Solo por que te ahogaste...!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n }\n }\n if (this.getTurno() == turnoComputadora) {\n jugarMaquinaSola(this.getTurno());\n }\n }", "private void BajarPiezaAlInstante() {\n int newY = posicionY;\r\n while (newY > 0) {\r\n if (!Mover(piezaActual, posicionX, newY - 1)) {\r\n break;\r\n }\r\n --newY;\r\n }\r\n BajarPieza1posicion();\r\n }", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela Paciente\\n\");\n\t\tpaciente = new Paciente();\n\t\tlistaPaciente = pacienteService.buscarTodos();\n\t\t\n\t}", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "private void cargarFichaLepra_inicio() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_INICIO_TRATAMIENTO_LEPRA,\r\n\t\t\t\tIRutas_historia.LABEL_INICIO_TRATAMIENTO_LEPRA, parametros);\r\n\t}", "public static void establecerMano(Monton todas,Mano[] jugadores){\n int pos;\n Pieza pieza;\n for (int i = 0; i < jugadores.length; i++) {\n for (int j = 0; j < Ajustes.PIEZAS_MANO; j++) {\n if(todas.getNPiezasMonton()>0){\n pos=(int) (Math.random()*todas.getNPiezasMonton());\n pieza=todas.getUnaPieza(pos);\n jugadores[i].setUnaPieza(pieza);\n todas.eliminarPiezaMonton(pieza); \n }\n \n }\n }\n System.out.println(\"\\nCada jugador tiene \"+jugadores[0].getNPiezas()+\" piezas.\");\n if(todas.getNPiezasMonton()!=0)\n System.out.println(\"Y en el monton quedan \"+todas.getNPiezasMonton());\n else\n System.out.println(\"No quedan piezas en el monton\");\n }", "private void populaAula()\n {\n Aula aula = new Aula(\"Abdominal\", \"Aula que tem como objetivo o aumento da força e resistência muscular abdominal,\"\n + \" melhora da postura e diminuição das dores lombares, através de exercícios de resistência \"\n + \"muscular. Indicada para todos os níveis de condicionamento para iniciantes, intermediários e \"\n + \"avançados. DURAÇÃO 30'\", \"ab.jpg\");\n aulaDAO.insert(aula);\n\n aula = new Aula(\"Boxe\", \"Aula de condicionamento físico que utiliza a técnica e exercícios do boxe. Indicada para todos os níveis \"\n + \"de condicionamento para iniciantes, intermediários e avançados. DURAÇÃO 60'\", \"boxe.gif\");\n aulaDAO.insert(aula);\n\n aula = new Aula(\"Jiu Jitsu\", \"Aula com treinamento específico da modalidade\", \"jiujitsu.gif\");\n aulaDAO.insert(aula);\n\n aula = new Aula(\"Bike\", \"Aula que tem como objetivo o condicionamento cardiovascular, através de uma \"\n + \"periodização de treinamento específica da modalidade. Indicada para todos os níveis de condicionamento para \"\n + \"iniciantes, intermediários e avançados. DURAÇÃO 30', 45' E 60'\", \"bike.gif\");\n aulaDAO.insert(aula);\n }", "private void carregarPacienteAtivoList() {\n\t\tthis.setPacienteList(new ArrayList<Paciente>());\n\t\tthis.getPacienteList().addAll(this.getPacienteDAO().getPacienteAtivoList());\n\t}", "public void cambiarNombreDepartamento(String NombreAntiguo, String NombreNuevo) {\r\n\t\t// TODO Auto-generated method stub\r\n//se modifica el nombre del Dpto. en las 3 tablas de Departamentos\r\n\t\t\r\n//\t\tthis.controlador.cambiaNombreDpto(NombreAntiguo, NombreNuevo);\r\n//\t\t//this.controlador.cambiaNombreDepartamentoUsuario(NombreAntiguo, NombreNuevo);\r\n//\t\t//this.controlador.cambiaNombreNumerosDEPARTAMENTOs(NombreAntiguo, NombreNuevo);\r\n\t\tboolean esta=false;\r\n\t\tArrayList <String> aux=new ArrayList<String>();//Aqui meto los dos nombres que necesito, de esta forma no hace falta \r\n\t\taux.add(NombreAntiguo);\r\n\t\taux.add(NombreNuevo);\r\n\t\tint i=0;\r\n\t\twhile (i<departamentosJefe.size() && !esta){\r\n\t\t\tif (departamentosJefe.get(i).getNombreDepartamento().equals(NombreAntiguo)){\r\n\t\t\t\tdepartamentosJefe.get(i).setNombreDepartamento(NombreNuevo);\r\n\t\t\t\tmodifyCache(aux,\"NombreDepartamento\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tif (getEmpleadoActual().getRango() == 0){\r\n\t\t\tcontrolador.cambiaNombreDpto(NombreAntiguo, NombreNuevo);\r\n\t\t}\r\n\t}", "public void preparePersonajes(){\n\t\tfor( int x= 0 ; x < game.getAmountPersonajes();x++){\n\t\t\tPersonaje p = game.getPersonaje(x);\n\t\t\timage = p.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(p.getAncho(), p.getAlto(), Image.SCALE_SMOOTH);\n\t\t\tp.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "private void dibujarCasillas() {\r\n for (int x = 0; x < 6; x++) {\r\n for (int y = 0; y < 6; y++) {\r\n panelTablero[x][y] = new CoordPanel();\r\n panelTablero[x][y].addMouseListener(this);\r\n panelTablero[x][y].setCoordenadas(x, y);\r\n pnlMain.add(panelTablero[x][y]);\r\n }\r\n }\r\n }", "public void recolheMao() {\n\t\tcartas[0].visible = false;\n\t\tfor (int i = 4; i <= 15; i++) {\n\t\t\tCartaVisual c = cartas[i];\n\t\t\tif ((c.top != topBaralho) || (c.left != leftBaralho)) {\n\t\t\t\tc.movePara(leftBaralho, topBaralho, 100);\n\t\t\t\tc.setCarta(null);\n\t\t\t\tc.descartada = false;\n\t\t\t\tcartasJogadas.remove(c);\n\t\t\t}\n\t\t}\n\t}", "public void obtenerMercadosSeleccionados() {\n\t\tlistaMercadosSeleccionado = new ArrayList<>();\n\t\tfor (String origen : this.mercadosSeleccionados) {\n\t\t\tCatalogoBean catalogo = catalogos.getCatalogoBean(\n\t\t\t\t\tCatalogoEnum.TP_MERCADOS_ORG, origen);\n\t\t\tlistaMercadosSeleccionado.add(origen + \" - \"\n\t\t\t\t\t+ catalogo.getDescripcionL());\n\t\t}\n\t}", "private void gerarLaudosProcedimentosMateriais(\r\n\t\t\tMpmPrescricaoMedica prescricao, List<MpmLaudo> laudoList) throws ApplicationBusinessException {\r\n\r\n\t\tMap<MpmPrescricaoProcedimento, FatProcedHospInternos> procedimentosMap = this\r\n\t\t\t\t.getConfirmarPrescricaoMedicaRN()\r\n\t\t\t\t.listarProcedimentosGeracaoLaudos(prescricao);\r\n\r\n\t\tMpmLaudo laudo = null;\r\n\r\n\t\tfor (MpmPrescricaoProcedimento procedimento : procedimentosMap.keySet()) {\r\n\t\t\tlaudo = new MpmLaudo();\r\n\t\t\tlaudo.setDthrInicioValidade(prescricao.getDthrInicio());\r\n\r\n\t\t\tDate dataFimValidade = prescricao.getDthrInicio();\r\n\t\t\tif (procedimento.getDuracaoTratamentoSolicitado() != null) {\r\n\t\t\t\tdataFimValidade = DateUtil.adicionaDias(dataFimValidade,\r\n\t\t\t\t\t\tprocedimento.getDuracaoTratamentoSolicitado()\r\n\t\t\t\t\t\t\t\t.intValue() - 1);\r\n\t\t\t}\r\n\t\t\tlaudo.setDthrFimValidade(dataFimValidade);\r\n\t\t\tlaudo.setDthrFimPrevisao(dataFimValidade);\r\n\r\n\t\t\tlaudo.setJustificativa(procedimento.getJustificativa());\r\n\t\t\tlaudo.setContaDesdobrada(false);\r\n\t\t\tlaudo.setImpresso(false);\r\n\t\t\tlaudo.setDuracaoTratSolicitado(procedimento\r\n\t\t\t\t\t.getDuracaoTratamentoSolicitado());\r\n\t\t\tlaudo.setLaudoManual(false);\r\n\t\t\tlaudo.setAtendimento(prescricao.getAtendimento());\r\n\t\t\tlaudo.setPrescricaoProcedimento(procedimento);\r\n\t\t\tlaudo.setProcedimentoHospitalarInterno(procedimentosMap\r\n\t\t\t\t\t.get(procedimento));\r\n\r\n\t\t\tthis.adicionarLaudoLista(laudoList, laudo);\r\n\r\n\t\t}\r\n\r\n\t}", "void rezervasyonYap(String name, String surname, String islem);", "public static void main(String[] args) {\n Perro perro = new Perro(1, \"Juanito\", \"Frespuder\", 'M');\n Gato gato = new Gato(2, \"Catya\", \"Egipcio\", 'F', true);\n Tortuga paquita = new Tortuga(3, \"Pquita\", \"Terracota\", 'F', 12345857);\n\n SetJuego equipo = new SetJuego(4, \"Gato equipo\", 199900, \"Variado\", \"16*16*60\", 15, \"Gatos\");\n PelotaMorder pelotita = new PelotaMorder(1, \"bola loca\", 15000, \"Azul\", \"60 diam\");\n\n System.out.println(perro.toString());//ToString original de \"mascotas\"\n System.out.println(gato.toString());//ToString sobrescrito\n System.out.println(paquita.toString());\n\n System.out.println(equipo);//ToString sobrescrito (tambien se ejecuta sin especificarlo)\n System.out.println(pelotita.toString());//Original de \"Juguetes\"\n\n //metodos clase mascota\n perro.darCredito();//aplicado de la interface darcredito\n paquita.darDeAlta(\"Terracota\",\"Paquita\");\n equipo.devolucion(4,\"Gato Equipo\");\n\n //vamos a crear un arraylist\n ArrayList<String> servicios = new ArrayList<String>();\n servicios.add(\"Inyectologia\");\n servicios.add(\"Peluqueria\");\n servicios.add(\"Baño\");\n servicios.add(\"Desparacitacion\");\n servicios.add(\"Castracion\");\n\n System.out.println(\"Lista de servicios: \" + servicios + \", con un total de \" + servicios.size());\n\n servicios.remove(3);//removemos el indice 3 \"Desparacitacion\"\n\n System.out.println(\"Se ha removido un servicio..................\");\n System.out.println(\"Lista de servicios: \" + servicios + \", con un total de \" + servicios.size());\n\n\n //creamos un vector\n Vector<String> promociones = new Vector<String>();\n\n promociones.addElement(\"Dia perruno\");\n promociones.addElement(\"Gatutodo\");\n promociones.addElement(\"10% Descuento disfraz de perro\");\n promociones.addElement(\"Jornada de vacunacion\");\n promociones.addElement(\"Serpiente-Promo\");\n\n System.out.println(\"Lista de promos: \" + promociones);\n System.out.println(\"Total de promos: \" + promociones.size());\n\n promociones.remove(4);//removemos 4 \"Serpiente-Promo\"\n System.out.println(\"Se ha removido una promocion..................\");\n\n System.out.println(\"Lista de promos: \" + promociones);\n System.out.println(\"Total de promos: \" + promociones.size());\n\n String[] dias_Semana = {\"Lunes\",\"Martes\",\"Miercoles\",\"Jueves\",\"Viernes\", \"Sabado\",\"Domingo\"};\n\n try{\n System.out.println(\"Elemento 6 de servicios: \" + dias_Semana[8]);\n } catch (ArrayIndexOutOfBoundsException e){\n System.out.println(\"Ey te pasaste del indice, solo hay 5 elementos\");\n } catch (Exception e){\n System.out.println(\"Algo paso, el problema es que no se que...\");\n System.out.println(\"La siguiente linea ayudara a ver el error\");\n e.printStackTrace();//solo para desarrolladores\n }finally {\n System.out.println(\"------------------------El curso termino! Pero sigue el de Intro a Android!!!!--------------------------\");\n }\n\n }", "private void limpiarDatos() {\n\t\t\n\t}", "public void copyFinals(Automata aut) {\n\t\tthis._acept.addAll(aut._acept);\n\t}", "public void copiar() {\n for (int i = 0; i < F; i++) {\n for (int j = 0; j < C; j++) {\n old[i][j]=nou[i][j];\n }\n }\n }", "public void busqueda_Aestrella(Estado estado_inicial, Estado estado_final) {\r\n\t\tabiertos.add(estado_inicial); // Añado como nodo abierto el punto de partida del laberinto\r\n\t\tEstado actual = abiertos.get(0); // Selecciono como punto actual el primero de los nodos abiertos (el punto de partida)\r\n\t\ttrata_repe = 1; // Variable para indicar al switch como tiene que tratar los repetidos en el switch del metodo tratar_repetidos\r\n\t\twhile (actual != estado_final && !abiertos.isEmpty()) { // Mientras que actual no sea el punto final y haya nodos abiertos\r\n\t\t\titeraciones++; // Contador de iteraciones del bucle while\r\n\t\t\tabiertos.remove(0); // Elimino el nodo actual de la lista de abiertos\r\n\t\t\tcerrados.add(actual); // Y lo añado a nodos cerrados\t\t\t\r\n\t\t\testados_cerrados = cerrados.size(); // Contador para estados cerrados\r\n\r\n\t\t\thijos = generar_sucesores(actual); // Genero los hijos del punto actual (Limpio de muros o punto de inicio)\r\n\t\t\thijos = tratar_repetidos(cerrados, abiertos, hijos); // Trato los repetidos\r\n\t\t\tinsertar(hijos); // Acolo los hijos en la lista de abiertos\r\n\t\t\testados_visitados += hijos.size(); // Contador para estados visitados\r\n\r\n\t\t\tCollections.sort(abiertos, getCompHeuristicaMasProf()); // Ordeno por heuristica Manhattan + Profundidad la cola de abiertos\r\n\r\n\t\t\tactual = abiertos.get(0); // Selecciono como actual el primero en la cola de abiertos\r\n\r\n\t\t\tif (actual.equals(estado_final)) { //Compruebo si estamos en el estado final\r\n\t\t\t\tmostrarcamino(actual, estado_final); // Muestro el camino solucion\r\n\t\t\t\tbreak; //Salgo del bucle while\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void turnos() {\n\t\tfor(int i=0; i<JuegoListener.elementos.size(); i++){\n\t\t\tElemento elemento = JuegoListener.elementos.get(i);\n\t\t\t\n\t\t\telemento.jugar();\n\t\t}\n\t}", "protected List<Receptor> getDestinos() {\r\n\t\tfinal List<PataBidireccional> allPatas = getPatas();\r\n\t\tfinal ArrayList<Receptor> destinos = new ArrayList<Receptor>(allPatas.size());\r\n\t\tfor (final PataBidireccional pata : allPatas) {\r\n\t\t\tfinal Receptor destino = pata.getNodoRemoto();\r\n\t\t\tdestinos.add(destino);\r\n\t\t}\r\n\t\treturn destinos;\r\n\t}", "public String listarSensores(){\r\n String str = \"\";\r\n for(PacienteNuvem x:pacientes){//Para cada paciente do sistema ele armazena uma string com os padroes do protocolo de comunicação\r\n str += x.getNick()+\"-\"+x.getNome()+\"#\";\r\n }\r\n return str;\r\n }", "public void pararPersonaje(char letra) {\n switch (letra) {\n case 'd':\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[1][0];\n animation = new Animation((float) 0.2, regions);\n tiempo = 0f;\n jugadorVista = \"Derecha\";//Guarda en la variable jugadorVista hacia donde miramos\n }\n break;\n case 's':\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[0][0];\n animation = new Animation((float) 0.2, regions);\n tiempo = 0f;\n jugadorVista = \"Abajo\";\n }\n break;\n case 'a':\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[3][0];\n animation = new Animation((float) 0.2, regions);\n tiempo = 0f;\n jugadorVista = \"Izquierda\";\n }\n break;\n case 'w':\n for (int b = 0; b < regions.length; b++) {\n regions[b] = tmp[2][0];\n animation = new Animation((float) 0.2, regions);\n tiempo = 0f;\n jugadorVista = \"Arriba\";\n }\n break;\n }\n\n }", "public static void main(String args[]){\n int x = 10;\r\n List<Perro> perros = new ArrayList();\r\n \r\n Perro perro=new Perro();\r\n \r\n Persona persona = new Persona();\r\n persona.setAltura(5.5);\r\n persona.setColorPiel(\"Blanca\");\r\n persona.setEdad(16);\r\n persona.setGenero('f');\r\n persona.setNacionalidad(\"Japonesa\");\r\n persona.setPeso(130);\r\n persona.setTipoDePelo(\"Lacio\"); \r\n persona.setOcupacion(\"Dinero\");\r\n \r\n //Se dan todas las características\r\n perro.setNombre(\"Manuel\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Golden\");\r\n perro.setTipoDePelo(\"Crespo\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);//Se añade a la instancia\r\n \r\n perro = new Perro();//Se limpia y se vuelve a llamar la instancia\r\n perro.setNombre(\"Igor\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Golden\");\r\n perro.setTipoDePelo(\"Lacio\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);\r\n \r\n perro = new Perro();\r\n perro.setNombre(\"Luli\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Siberiano\");\r\n perro.setTipoDePelo(\"Crespo\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);\r\n //****************CUANDO EJECUTES ESTO VE COMENTADO LOS BLOQUES QUE NO QUIERES QUE SE USEN*************\r\n //foreach y for hace la misma funcion\r\n //Uso de for\r\n for (Perro perro1:perros){\r\n System.out.println(perro1.getNombre());\r\n System.out.println(perro1.getColor());\r\n System.out.println(perro1.getTamano());\r\n System.out.println(perro1.getRaza());\r\n System.out.println(perro1.getTipoDePelo());\r\n }\r\n \r\n //Formas de uso del for each\r\n perros.forEach(perro1->\r\n System.out.println(perro1.getNombre()));\r\n \r\n perros.forEach(perro1 ->{//Se define una variable que es perro1 y esta recorrera toda la lista\r\n System.out.println(perro1.getNombre());\r\n System.out.println(perro1.getColor());\r\n System.out.println(perro1.getTamano());\r\n System.out.println(perro1.getRaza());\r\n System.out.println(perro1.getTipoDePelo()); \r\n System.out.println();\r\n \r\n });\r\n \r\n \r\n System.out.println(\"Blanco\".equals(perro.color)? \"Si es blanco\":\"No es blanco\");\r\n \r\n //Uso del if\r\n if (((4/2==0)&&(10/5 !=0))||(100/20==0)){\r\n System.out.println(\"Es bisiesto\");\r\n }else{\r\n System.out.println(\"No es bisiesto\");\r\n }\r\n \r\n //Uso del switcH\r\n switch(x){\r\n case 6:\r\n System.out.println(\"Es verdadero\");\r\n break;\r\n case 2:\r\n System.out.println(\"Es falso\");\r\n break;\r\n default:\r\n System.out.println(\"No es ninguna\");\r\n \r\n //Uso de la lista de un item en especifico \r\n System.out.println(\"Nombre: \" + perros.get(2).getNombre());//El número del get\r\n System.out.println(\"Color: \"+perros.get(2).getColor());//define que item es que tomará\r\n System.out.println(\"Raza: \"+perros.get(2).getRaza());\r\n \r\n \r\n //Demostración del uso de getters\r\n System.out.println(\"Nombre: \");\r\n System.out.println(\"Altura: \" + persona.getAltura());\r\n System.out.println(\"Color: \" + persona.getColorPiel());\r\n System.out.println(\"Edad: \"+persona.getEdad());\r\n System.out.println(\"Genero: \"+persona.getGenero());\r\n System.out.println(\"Nacionalidad: \"+persona.getNacionalidad());\r\n System.out.println(\"Peso: \"+persona.getPeso());\r\n System.out.println(\"Tipo de Pelo: \"+persona.getTipoDePelo());\r\n \r\n }\r\n \r\n}", "public void limpiar() {\n\t\taut_empleado.limpiar();\n\t\tutilitario.addUpdate(\"aut_empleado\");// limpia y refresca el autocompletar\n\n\n\t}", "public void actualizarAristas(Arista movimiento){\n \n //Actualizamos la ubicacion de la hormiga\n for (int i = 0; i < matriz.length; i++) {\n if (movimiento.getFin().equals(matriz[0][i].getFin())) {\n ubicacion = i; \n }\n }\n \n //Actualizamos la lista de aristas a la cual se puede viajar desde la ubicacion actual\n aristas.clear();\n \n for (int i = 0; i < matriz.length; i++) { \n if (i != ubicacion) {\n aristas.add(matriz[ubicacion][i]);\n } \n }\n \n //Actualizamos las ciudades que ha visitado la hormiga\n visitados.add(aristas.get(0).getInicio());\n \n //A la lista de aristas, le borramos las aristas que conducen a ciudades que ya ha visitado la hormiga\n for (int k = 0; k < visitados.size(); k++) {\n for (int i = 0; i < aristas.size(); i++) {\n for (int j = 0; j < visitados.size(); j++) {\n if (aristas.get(i).getFin().equals(visitados.get(j))) { \n aristas.remove(i);\n i = 20;\n j = 20;\n }\n }\n }\n }\n \n //Continuamos actualizando la historia del recorrido de la hormiga\n recorrido = recorrido + \" \" + String.valueOf(movimiento.getDistancia()) + \" unidades hasta \" + movimiento.getFin() + \",\";\n \n }", "public PregledPoruka() {\n preuzmiMape();\n preuzmiPoruke();\n }", "private void reposicionarPersonajes() {\n // TODO implement here\n }", "public List<Listas_de_las_Solicitudes> Mostrar_las_peticiones_que_han_llegado_al_Usuario_Administrador(int cedula) {\n\t\t//paso3: Obtener el listado de peticiones realizadas por el usuario\n\t\tEntityManagerFactory entitymanagerfactory = Persistence.createEntityManagerFactory(\"LeyTransparencia\");\n\t\tEntityManager entitymanager = entitymanagerfactory.createEntityManager();\n\t\tentitymanager.getEntityManagerFactory().getCache().evictAll();\n\t\tQuery consulta4=entitymanager.createQuery(\"SELECT g FROM Gestionador g WHERE g.cedulaGestionador =\"+cedula);\n\t\tGestionador Gestionador=(Gestionador) consulta4.getSingleResult();\n\t\t//paso4: Obtener por peticion la id, fecha y el estado\n\t\tList<Peticion> peticion=Gestionador.getEmpresa().getPeticions();\n\t\tList<Listas_de_las_Solicitudes> peticion2 = new ArrayList();\n\t\t//paso5: buscar el area de cada peticion\n\t\tfor(int i=0;i<peticion.size();i++){\n\t\t\tString almcena=\"\";\n\t\t\tString sarea=\"no posee\";\n\t\t\tBufferedReader in;\n\t\t\ttry{\n\t\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(\"C:/area/area\"+String.valueOf(peticion.get(i).getIdPeticion())+\".txt\"), \"utf-8\"));\n\t\t\t\ttry {\n\t\t\t\t\twhile((sarea=in.readLine())!=null){\n\t\t\t\t\t\tint s=0;\n\t\t\t\t\t\talmcena=sarea;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\tSystem.out.println(almcena);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//paso6: Mostrar un listado de peticiones observando el id, la fecha de realizacion de la peticion, hora de realizacion de la peticion, y el estado actual de la peticion\n\t\t\tListas_de_las_Solicitudes agregar=new Listas_de_las_Solicitudes();\n\t\t\tagregar.setId(String.valueOf(peticion.get(i).getIdPeticion()));\n\t\t\tagregar.setFechaPeticion(peticion.get(i).getFechaPeticion());\n\t\t\tagregar.setNombreestado(peticion.get(i).getEstado().getTipoEstado());\n\t\t\tagregar.setArea(almcena);\n\t\t\tpeticion2.add(agregar);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"el usuario existe\");\n\t\treturn peticion2;\n\t\t//aun no se\n\t}", "public void movR(){\r\n\t\t\r\n\t\tint aux1[][]= new int [3][1];\r\n\t\tint aux2[][]= new int [3][1];\r\n\t\tint aux3[][]= new int [3][1];\r\n\t\tint aux4[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux5[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux6[][]= new int [3][1];\r\n\t\t\r\n\t\tint aux7[][]= new int [3][1];\r\n\t\t\r\n\t\taux1=cloneC(5,2);\r\n\t\taux2=cloneC(1,2);\r\n\t\taux3=cloneC(4,2);\r\n\t\taux4=cloneC(3,0);\r\n\t\t\r\n\t\taux5=cloneF(2,0);\r\n\t\taux6=cloneF(2,1);\r\n\t\taux7=cloneF(2,2);\r\n\t\t\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaColumna(aux1, 1, 2);\r\n\t\tthis.copiaEnColumnaUnaColumna(aux2, 4, 2);\r\n\t\tthis.copiaEnColumnaUnaColumnaReves(aux3, 3, 0);\r\n\t\tthis.copiaEnColumnaUnaColumnaReves(aux4, 5, 2);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux5, 2, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux6, 2, 1);\r\n\t\tthis.copiaEnColumnaUnaFila(aux7, 2, 0);\r\n\t\t\r\n\t}" ]
[ "0.58642364", "0.57797956", "0.5741471", "0.5735337", "0.5720995", "0.57150733", "0.56755424", "0.56500685", "0.56310964", "0.5620933", "0.5610434", "0.56056505", "0.55899733", "0.55803823", "0.55090326", "0.54928946", "0.54776204", "0.54688984", "0.5462846", "0.54493874", "0.54343235", "0.5404036", "0.5395709", "0.5394693", "0.5394587", "0.5385126", "0.53809965", "0.53808975", "0.5370272", "0.5356945", "0.5350771", "0.53454465", "0.53450924", "0.5338799", "0.5329403", "0.5329192", "0.5323532", "0.5313515", "0.5308909", "0.53082407", "0.52967805", "0.5277618", "0.52747655", "0.5259235", "0.5238753", "0.5232139", "0.5226519", "0.5224642", "0.52102447", "0.5190194", "0.51892185", "0.5188558", "0.5183302", "0.51809675", "0.51692176", "0.51653", "0.51633686", "0.5161536", "0.5148718", "0.51436883", "0.5142315", "0.51372916", "0.51355195", "0.5125691", "0.5118992", "0.5112865", "0.5110744", "0.51091343", "0.510723", "0.5105093", "0.5092925", "0.50906533", "0.5084881", "0.50810766", "0.50795156", "0.50736654", "0.50716925", "0.50666183", "0.50663644", "0.5064654", "0.50552356", "0.505038", "0.50489426", "0.5044748", "0.50436133", "0.5039615", "0.5039024", "0.50353765", "0.5032796", "0.503043", "0.5022617", "0.5017077", "0.5016191", "0.50128245", "0.5002772", "0.49966472", "0.49906", "0.49904895", "0.4986388", "0.49803945", "0.49788627" ]
0.0
-1
Agrega una fruta en el laberinto, se usa luego de determinada cantidad de tiempo.
public void agregarFruta(){ contenidos[14][17] = new Fruta(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void temporizadorTiempo() {\n Timer timer = new Timer();\n tareaRestar = new TimerTask() {\n @Override\n public void run() {\n tiempoRonda--;\n }\n };\n timer.schedule(tareaRestar, 1,1000);\n }", "public void liquidarEmpleado(Fecha fechaLiquidacion) {\n //COMPLETE\n double prima=0; \n boolean antiguo=false;\n double aniosEnServicio=fechaLiquidacion.getAnio()-this.fechaIngreso.getAnio();\n if(aniosEnServicio>0&&\n fechaLiquidacion.getMes()>this.fechaIngreso.getMes())\n aniosEnServicio--; \n \n //System.out.println(\"A:\"+aniosEnServicio+\":\"+esEmpleadoLiquidable(fechaLiquidacion));\n if(esEmpleadoLiquidable(fechaLiquidacion)){\n this.descuentoSalud=salarioBase*0.04;\n this.descuentoPension=salarioBase*0.04;\n this.provisionCesantias=salarioBase/12;\n if(fechaLiquidacion.getMes()==12||fechaLiquidacion.getMes()==6)\n prima+=this.salarioBase*0.5; \n if(aniosEnServicio<6&&\n fechaLiquidacion.getMes()==this.fechaIngreso.getMes())prima+=((aniosEnServicio*5)/100)*this.salarioBase;\n if(aniosEnServicio>=6&&fechaLiquidacion.getMes()==this.fechaIngreso.getMes()) prima+=this.salarioBase*0.3;\n\n this.prima=prima;\n this.setIngresos(this.salarioBase+prima);\n \n this.setDescuentos(this.descuentoSalud+this.descuentoPension);\n this.setTotalAPagar(this.getIngresos()-this.getDescuentos());\n }\n\n }", "private void temporizadorRonda(int t) {\n Timer timer = new Timer();\n TimerTask tarea = new TimerTask() {\n @Override\n public void run() {\n if (!dead) {\n vida = vidaEstandar;\n atacar();\n rondas ++;\n tiempoRonda = tiempo;\n incrementarTiempo();\n reiniciarVentana();\n if(rondas == 4){\n matar();\n }\n temporizadorRonda(tiempo);\n }\n }\n };\n timer.schedule(tarea, t * 1000);\n }", "@Override\n\tpublic void acelerar() {\n\t\t// TODO Auto-generated method stub\n\t\t\t\tvelocidadActual += 40;\n\t\t\t\tif(velocidadActual>250) {\n\t\t\t\t\tvelocidadActual = 250;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdepositoActual -= 10;\n\t\t\t\tSystem.out.println(\"Velocidad del ferrari: \"+velocidadActual);\n\t}", "public void ponerMaximoTiempo() {\n this.timeFi = Long.parseLong(\"2000000000000\");\n }", "public void indicarTiempoMaximo(Long timeFi) {\n this.timeFi = (timeFi*1000);\n }", "public void llenarCafetera() {\n\t\tthis.setCantidadActual(this.get_capacidadMaxima());\n\t}", "@Override\n\tpublic void frenar() {\n\t\tvelocidadActual = 0;\n\t}", "private void agregarFantasma(Fantasma fantasma) {\n // TODO implement here\n }", "public void actualiser(){\n try{\n \t\n /* Memo des variables : horaireDepart tableau de string contenant l'heure de depart entree par l'user\n * heure = heure saisie castee en int, minutes = minutes saisie castee en Integer\n * tpsRest = tableau de string contenant la duree du cours en heure entree par l'user\n * minutage = format minutes horaire = format heure, ils servent a formater les deux variables currentTime qui recuperent l'heure en ms\n * tempsrestant = variable calculant le temps restant en minutes, heurerestante = variable calculant le nombre d'heure restantes\n * heureDuree = duree du cours totale en int minutesDuree = duree totale du cours en minute\n * tempsfinal = temps restant reel en prenant en compte la duree du cours\n * angle = temps radian engleu = temps en toDegrees\n */\n String[] horaireDepart = Reader.read(saisie.getText(), this.p, \"\\\\ \");\n \n //on check si le pattern est bon et si l'utilisateur n'est pas un tard\n if(Reader.isHour(horaireDepart)){\n \t\n int heure = Integer.parseInt(horaireDepart[0]);\n int minutes = Integer.parseInt(horaireDepart[2]);\n minutes += (heure*60);\n String[] tpsrest = Reader.read(format.getText(), this.p, \"\\\\ \");\n \n //conversion de la saisie en SimpleDateFormat pour les calculs\n SimpleDateFormat minutage = new SimpleDateFormat (\"mm\");\n SimpleDateFormat Horaire = new SimpleDateFormat (\"HH\");\n \n //recupere l'heure en ms\n Date currentTime_1 = new Date(System.currentTimeMillis());\n Date currentTime_2 = new Date(System.currentTimeMillis());\n \n //cast en int pour les calculs\n int tempsrestant = Integer.parseInt(minutage.format(currentTime_1));\n int heurerestante = Integer.parseInt(Horaire.format(currentTime_2))*60;\n tempsrestant += heurerestante;\n \n //pareil mais pour la duree\n if(Reader.isHour(tpsrest)){\n int heureDuree = Integer.parseInt(tpsrest[0]);\n int minutesDuree = Integer.parseInt(tpsrest[2]);\n minutesDuree += (heureDuree*60);\n tempsrestant -= minutes;\n int tempsfinal = minutesDuree - tempsrestant;\n \n //conversion du temps en angle pour l'afficher \n double angle = ((double)tempsfinal*2/(double)minutesDuree)*Math.PI;\n int engleu = 360 - (int)Math.toDegrees(angle);\n for(int i = 0; i < engleu; i++){\n this.panne.dessineLine(getGraphics(), i);\n }\n \n //conversion du temps en pi radiant pour l'affichage\n if(tempsfinal < minutesDuree){\n tempsfinal *= 2;\n for(int i = minutesDuree; i > 1; i--){\n if(tempsfinal % i == 0 && minutesDuree % i == 0){\n tempsfinal /= i;\n minutesDuree /= i;\n }\n }\n }\n \n //update l'affichage\n this.resultat.setText(tempsfinal + \"/\" + minutesDuree + \"π radiant\");\n this.resultat.update(this.resultat.getGraphics());\n }\n }\n }catch(FormatSaisieException fse){\n this.resultat.setText(fse.errMsg(this.p.toString()));\n }\n }", "public void setFlores(int avenida, int calle, int cant);", "public finestrabenvinguda() {\n //inciem componets misatge ,la seva localitzacio, i diem que sigui un misatge que ens apareixi de manera temporal\n initComponents();\n this.setLocationRelativeTo(null);\n ac = new ActionListener() {\n\n @Override\n /**\n * Controlem la barra de carregue la cual li diem el que socceix una vegada\n * tenim el temps establert en el qual volem carreguar el nostre projecte,es a di,\n * que fara una vegada tenim carreguada completament la carregua de la taula\n */\n public void actionPerformed(ActionEvent e) {\n x = x + 1;\n jProgressBar1.setValue(x);\n if (jProgressBar1.getValue() == 100) {\n dispose();\n t.stop();\n }\n }\n };\n // seleccionem el temps que tardara aquesta barra en carregar completament\n t = new Timer(50, ac);\n t.start();\n }", "public void generarNumeroFacura(){\n try{\n FacturaDao facturaDao = new FacturaDaoImp();\n //Comprobamos si hay registros en la tabla Factura de la BD\n this.numeroFactura = facturaDao.numeroRegistrosFactura();\n \n //Si no hay registros hacemos el numero de factura igual a 1\n if(numeroFactura <= 0 || numeroFactura == null){\n numeroFactura = Long.valueOf(\"1\");\n this.factura.setNumeroFactura(this.numeroFactura.intValue());\n this.factura.setTotalVenta(new BigDecimal(0));\n }else{\n //Recuperamos el ultimo registro que existe en la tabla Factura\n Factura factura = facturaDao.getMaxNumeroFactura();\n //Le pasamos a la variable local el numero de factura incrementado en 1\n this.numeroFactura = Long.valueOf(factura.getNumeroFactura() + 1);\n this.factura.setNumeroFactura(this.numeroFactura.intValue());\n this.factura.setTotalVenta(new BigDecimal(0));\n }\n \n \n }catch(Exception e){\n e.printStackTrace();\n }\n \n }", "@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }", "private void actualizaPuntuacion() {\n if(cambiosFondo <= 10){\n puntos+= 1*0.03f;\n }\n if(cambiosFondo > 10 && cambiosFondo <= 20){\n puntos+= 1*0.04f;\n }\n if(cambiosFondo > 20 && cambiosFondo <= 30){\n puntos+= 1*0.05f;\n }\n if(cambiosFondo > 30 && cambiosFondo <= 40){\n puntos+= 1*0.07f;\n }\n if(cambiosFondo > 40 && cambiosFondo <= 50){\n puntos+= 1*0.1f;\n }\n if(cambiosFondo > 50) {\n puntos += 1 * 0.25f;\n }\n }", "private void dibujarArregloCamionetas() {\n\n timerCrearEnemigo += Gdx.graphics.getDeltaTime();\n if (timerCrearEnemigo>=TIEMPO_CREA_ENEMIGO) {\n timerCrearEnemigo = 0;\n TIEMPO_CREA_ENEMIGO = tiempoBase + MathUtils.random()*2;\n if (tiempoBase>0) {\n tiempoBase -= 0.01f;\n }\n\n camioneta= new Camioneta(texturaCamioneta,ANCHO,60f);\n arrEnemigosCamioneta.add(camioneta);\n\n\n }\n\n //Si el vehiculo se paso de la pantalla, lo borra\n for (int i = arrEnemigosCamioneta.size-1; i >= 0; i--) {\n Camioneta camioneta1 = arrEnemigosCamioneta.get(i);\n if (camioneta1.sprite.getX() < 0- camioneta1.sprite.getWidth()) {\n arrEnemigosCamioneta.removeIndex(i);\n\n }\n }\n }", "public int asignacionMemoriaFlotante(float value){\n memoriaFlotante[flotanteActual] = value;\n flotanteActual++;\n return inicioMem + tamMem + flotanteActual - 1;\n }", "private void comerFantasma(Fantasma fantasma) {\n // TODO implement here\n }", "public void ponerDinero(double platita){\r\n if (platita > 0)\r\n setMonto(getMonto() + platita);\r\n }", "private void actualizarFondo() {\n actualizaEstadoMapa();\n if (modificacionFondoBase == true && estadoJuego != EstadoJuego.PAUSADO && estadoJuego != EstadoJuego.PIERDE){\n moverFondo();\n } else if (modificacionFondoBase == false && estadoJuego != EstadoJuego.PAUSADO && estadoJuego != EstadoJuego.PIERDE ){\n texturaFondoBase= texturaFondo1_1;\n texturaFondoApoyo= texturaFondo1_2;\n moverFondo();\n }\n }", "private void almacenarFallos() {\n BaseDatos bd = new BaseDatos(this);\n// Log.i(\"FALLOS\",\"Nmero de fallos final: \"+fallos);\n bd.updatePalabra(palabraActual.getId(),fallos);\n\n bd.close();\n }", "void establecerPuntoFM(int pos){\n this.emisoraFMActual = pos;\n }", "@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }", "public void run() {\n\n\t// DecimalFormat df = new DecimalFormat(\"#.###\");\n\tint frecuencia = 0;\n\n\twhile (true) {\n\n\t if (rearmarAne) {\n\t\tlogger.warn(\"Termino el hilo de Anemometro porque se ha rearmado Irrisoft\");\n\t\treturn;\n\t }\n\t tiempoini = (System.nanoTime());\n\t // Cojo los datos a enviar por el puerto serie.\n\t churro = datosInicio();\n\n\t // Duermo el tiempo requerido\n\t logger.info(\"La freceuncia de lectura de Anemometro es: \"\n\t\t + sens.getFrec_lect());\n\n\t // Duermo el sensor el un tiempo, para recibir otra lectura.\n\t dormirSensor();\n\n\t try {\n\t\tserialcon.cogesemaforo(sens.getNum_placa());\n\t\t// Purgo el puerto\n\t\tserialcon.serialPort.purgePort(SerialPort.PURGE_RXCLEAR\n\t\t\t| SerialPort.PURGE_TXCLEAR);\n\n\t\tif (serialcon.serialPort.writeBytes(churro)) {\n\n\t\t if (logger.isInfoEnabled()) {\n\t\t\tlogger.info(\"Comando mandado al puerto serie !\"\n\t\t\t\t+ Arrays.toString(churro));\n\t\t }\n\t\t} else {\n\t\t if (logger.isErrorEnabled()) {\n\t\t\tlogger.error(\"Fallo en mandar comando al puerto serie! \"\n\t\t\t\t+ Arrays.toString(churro));\n\t\t }\n\t\t // RECONECTO\n\t\t // serialcon.purga_puerto(sens.getNum_placa(),\n\t\t // serialcon.serialPort.getPortName());\n\t\t}\n\n\t\t// Leo la respuesta\n\t\tbufferResp = serialcon.serialPort.readBytes(6, 4000);\n\t\t//Trato las lecturas para tener el dato.\n\t\tlectura = sacarLecturas(bufferResp);\n\t\t\n\t\t// Escribo en el panel la lectura\n\t\t// ponelecturas(sens);\n\n\t\t// Irrisoft.window.panelecturasens.getLblectane().setText(medicion+\" pulsos , velocidad \"+velocidad+\n\t\t// \" m/s\");\n\t\tfrecuencia = (int) (frecuencia + ((System.nanoTime() - tiempoini) / Math\n\t\t\t.pow(10, 9)));\n\t\tif (logger.isWarnEnabled()) {\n\t\t logger.warn(\"Tiempo pasado bucle hiloAnemometro: \"\n\t\t\t + frecuencia);\n\t\t}\n\n\t\t// Insertar registro en la pasarela\n\t\tif (frecuencia >= sens.getFrec_env()) {\n\t\t // Creo la lectura para enviar a GIS.\n\t\t LecturasSensor lecturaFinal = cogerLectura(lectura);\n\t\t // Envio la lectura a GIS.\n\t\t enviarLecturasGIS(lecturaFinal);\n\n\t\t frecuencia = 0;\n\t\t}\n\n\t } catch (SerialPortTimeoutException | SerialPortException e) {\n\t\tif (logger.isErrorEnabled()) {\n\t\t if (e instanceof SerialPortTimeoutException)\n\t\t\tlogger.error(\"TIMEOUUUUUT en la lectura del buffer serie: \"\n\t\t\t\t+ e.getMessage());\n\t\t else if (e instanceof SerialPortException)\n\t\t\tlogger.error(e.getMessage());\n\t\t}\n\t\tserialcon.sueltasemaforo(sens.getNum_placa());\n\t }\n\t serialcon.sueltasemaforo(sens.getNum_placa());\n\t}\n\n }", "public void recarga(){\n \tthis.fuerza *= 1.1;\n \tthis.vitalidad *= 1.1; \n }", "public float calcular(float dinero, float precio) {\n // Cálculo del cambio en céntimos de euros \n cambio = Math.round(100 * dinero) - Math.round(100 * precio);\n // Se inicializan las variables de cambio a cero\n cambio1 = 0;\n cambio50 = 0;\n cambio100 = 0;\n // Se guardan los valores iniciales para restaurarlos en caso de no \n // haber cambio suficiente\n int de1Inicial = de1;\n int de50Inicial = de50;\n int de100Inicial = de100;\n \n // Mientras quede cambio por devolver y monedas en la máquina \n // se va devolviendo cambio\n while(cambio > 0) {\n // Hay que devolver 1 euro o más y hay monedas de 1 euro\n if(cambio >= 100 && de100 > 0) {\n devolver100();\n // Hay que devolver 50 céntimos o más y hay monedas de 50 céntimos\n } else if(cambio >= 50 && de50 > 0) {\n devolver50();\n // Hay que devolver 1 céntimo o más y hay monedas de 1 céntimo\n } else if (de1 > 0){\n devolver1();\n // No hay monedas suficientes para devolver el cambio\n } else {\n cambio = -1;\n }\n }\n \n // Si no hay cambio suficiente no se devuelve nada por lo que se\n // restauran los valores iniciales\n if(cambio == -1) {\n de1 = de1Inicial;\n de50 = de50Inicial;\n de100 = de100Inicial;\n return -1;\n } else {\n return dinero - precio;\n }\n }", "public void actualizacionMemoriaFlotante(float value, int direccion){\n memoriaFlotante[direccion-inicioMem-tamMem] = value;\n }", "public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }", "private void limpaTela() {\n txfNomeGrupo.setText(\"\");\n ftfValorViagem.setText(\"0\");\n ftfDataSaida.setText(\"\");\n ftfHoraSaida.setText(\"\");\n ftfDataRetorno.setText(\"\");\n ftfHoraRetorno.setText(\"\");\n\n txfNumPessoas.setText(\"\");\n txfIntegrante.setText(\"\");\n\n txfNomeGrupo.setBackground(null);\n ftfValorViagem.setBackground(Color.white);\n ftfDataSaida.setBackground(Color.white);\n ftfHoraSaida.setBackground(Color.white);\n ftfDataRetorno.setBackground(Color.white);\n ftfHoraRetorno.setBackground(Color.white);\n txfNumPessoas.setBackground(null);\n txfIntegrante.setBackground(Color.white);\n\n }", "public void avvio_gioco(){\n\n punti = 3;\n //Posizione iniziale della x\n for (short i = 0; i < punti; i++) {\n x[i] = 150 - i*10;\n y[i] = 150;\n }\n posiziona_bersaglio();\n\n //Attivazione del timer\n timer = new Timer(RITARDO, this);\n timer.start();\n }", "public void llenarTabla(int inicio, int limite) {\n DefaultTableModel dtm = (DefaultTableModel) jTableVerRondas.getModel();//se usa DefaultTableModel para manipular facilmente el Tablemodel\n dtm.setRowCount(0);//eliminando la s filas que ya hay. para agregar desde el principio.\n //los datos se agregan la defaultTableModel.\n ArrayList<Partido> llenar = miOpenAustralia.getPartidos();//sacando al informacion a agregar en la tabla.\n\n //como se va a llenar una tabla de 5 columnas, se crea un vector de 3 elementos.\n //se usa un arreglo de Object para poder agregar a la tabla cualquier tipo de datos.\n Object[] datos = new Object[5];\n for (int i = inicio; i < limite; i++) {\n\n Partido parti = llenar.get(i);\n //Se agrega este if para evitar que el extraiga datos en un campo null\n if (parti != null) {\n\n datos[0] = parti.getId();\n datos[1] = parti.getFechaHora();//el primer elemetno del arreglo va a ser el id,la primera col en la Tabla.\n datos[2] = parti.getJugador1().getNombre();\n datos[3] = parti.getJugador2().getNombre();\n datos[4] = parti.getPista().getNombre();\n\n //agrego al TableModleo ese arreglo\n dtm.addRow(datos);\n }\n }\n }", "@Override\n public void cantidad_Defensa(){\n defensa=2+nivel+aumentoD;\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "@Override\n\tpublic String frenar(int velocidad) {\n\t\tthis.velocidad-=velocidad;\n\t\tif (this.velocidad<0) {\n\t\t\tthis.velocidad=0;\n\t\t}\n\t\t\n\t\tString mensaje = \"Moto con velocidad actual de \"+this.velocidad;\n\t\tif (this.velocidad > VELOCIDAD_MAXIMA) {\n\t\t\tmensaje += \" y sigues superando la velocidad maxima\";\n\t\t}\n\t\treturn mensaje;\n\t}", "public void recomendarTempos() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXCH = CFusionar.arregloPPTX1;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXCH = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXDB = CFusionar.arregloPPTX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXDB = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYCH = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYCH = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYDB = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYDB = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZCH = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZCH = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZDB = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZDB = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(paTZDB.get(iposision).toString());\n }\n\n }", "private void restaApostado() {\n\t\tif(apostado.get() >= 1.0) apostado.set(apostado.get() -1.0);\n\t\t\tdiruField.setText(String.format(\"%.2f\", apostado.get()));\n\t\t\tactualizaPremio();\n\t\t\t\n\t}", "public void initTempsPassage() {\r\n\t\tlong dureeTotale = heureDepart.getTime();\r\n\t\ttempsPassage = new Date[getItineraire().size()][2];\r\n\r\n\t\tfor (int i = 0; i < getItineraire().size(); i++) {\r\n\t\t\tfor (int j = 0; j < getItineraire().get(i).getTroncons().size(); j++) {\r\n\t\t\t\tdureeTotale += getItineraire().get(i).getTroncons().get(j).getLongueur() * 1000 / VITESSE;// Duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// des\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// trajets\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// seconde\r\n\r\n\t\t\t}\r\n\t\t\tif (i < listeLivraisons.size()) {\r\n\t\t\t\tif (listeLivraisons.get(i).getDebutPlageHoraire() != null\r\n\t\t\t\t\t\t&& listeLivraisons.get(i).getDebutPlageHoraire().getTime() > dureeTotale) {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t\ttempsPassage[i][1] = new Date(listeLivraisons.get(i).getDebutPlageHoraire().getTime());\r\n\t\t\t\t\tdureeTotale = listeLivraisons.get(i).getDebutPlageHoraire().getTime();\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t}\r\n\t\t\t\tdureeTotale += listeLivraisons.get(i).getDuree() * 1000; // duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// de\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// livraison\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ms\r\n\t\t\t} else {\r\n\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theureArrivee = new Date(dureeTotale);\r\n\t}", "public Moto(float cilindrada,String _patente, int _cantRuedas)\n {\n super(_patente, _cantRuedas, eMarca.ZANELLA);\n this._cilindrada=cilindrada;\n }", "public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }", "public void minutoStamina(int minutoStamina){\n tiempoReal = (minutoStamina * 6)+10;\n }", "public void FaltaJugador(Falta Fa,Jugador Player,int Cometida,int Tarjeta, Chronometer Cronometro){\n Faltas.add(new FaltaPartido(Fa,Player.getIdJugador(),Cometida,Tarjeta,Cronometro.getTime()));\n PartidoCanchaActivity.ACCION_PRINCIPAL = null;\n PartidoCanchaActivity.ENVIA_PASE = null;\n }", "public void faiLavoro(){\n System.out.println(\"Scrivere 1 per Consegna lunga\\nSeleziona 2 per Consegna corta\\nSeleziona 3 per Consegna normale\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n soldiTam += 500;\n puntiVita -= 40;\n puntiFame -= 40;\n puntiFelicita -= 40;\n }\n case 2 -> {\n soldiTam += 300;\n puntiVita -= 20;\n puntiFame -= 20;\n puntiFelicita -= 20;\n }\n case 3 -> {\n soldiTam += 100;\n puntiVita -= 10;\n puntiFame -= 10;\n puntiFelicita -= 10;\n }\n }\n checkStato();\n }", "public void zeraEmpates() {\r\n contaEmpates = 0;\r\n }", "public Repartidor(String nombre, String apellido, String direccion, String telefono, String cedula) {\n super(nombre, apellido, direccion, telefono, cedula);\n this.disponible = true; //empieza siendo disponible luego cuando lo utilicemos pasara a no estarlo y asi...\n this.salario = 50; //establecemos un salario inicial de 50 al que luego le adicionaremos segun la cantidad de envios que haya realizado con exito \n }", "@Override\n public void crearReloj() {\n Manecilla seg;\n seg = new Manecilla(40,60,0,1,null);\n cronometro = new Reloj(seg);\n }", "public void limpiarcarrito() {\r\n setTotal(0);//C.P.M limpiamos el total\r\n vista.jTtotal.setText(\"0.00\");//C.P.M limpiamos la caja de texto con el formato adecuado\r\n int x = vista.Tlista.getRowCount() - 1;//C.P.M inicializamos una variable con el numero de columnas\r\n {\r\n try {\r\n DefaultTableModel temp = (DefaultTableModel) vista.Tlista.getModel();//C.P.M obtenemos el modelo actual de la tabla\r\n while (x >= 0) {//C.P.M la recorremos\r\n temp.removeRow(x);//C.P.M vamos removiendo las filas de la tabla\r\n x--;//C.P.M y segimos disminuyendo para eliminar la siguiente \r\n }\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n JOptionPane.showMessageDialog(null, \"Ocurrio un error al limpiar la venta\");\r\n }\r\n }\r\n }", "public void limpiar(){\n\t\tfCargaI=new Date();\n\t\tfCargaF=new Date();\n\t\tlistaMarcacion=null;\n\t\tlistaMarcacionPDF=null;\n\t}", "public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}", "public Tienda(String direccion,float dinero){\n\t\tthis.direccion = direccion;\n\t\tthis.dinero = dinero;\n\t\tnumeroTiendas++;\n\t\ttotalDinero+=dinero;\n\t}", "public void hallarPerimetroEscaleno() {\r\n this.perimetro = this.ladoA+this.ladoB+this.ladoC;\r\n }", "public void formatoTiempo() {\n String segundos, minutos, hora;\n\n hora = hrs < 10 ? String.valueOf(\"0\" + hrs) : String.valueOf(hrs);\n\n minutos = min < 10 ? String.valueOf(\"0\" + min) : String.valueOf(min);\n\n jLabel3.setText(hora + \" : \" + minutos + \" \" + tarde);\n }", "public void cartgarTareasConRepeticionDespuesDe(TareaModel model,int unid_medi,String cant_tiempo,String tomas)\n {\n Date fecha = convertirStringEnFecha(model.getFecha_aviso(),model.getHora_aviso());\n Calendar calendar = Calendar.getInstance();\n\n if(fecha != null)\n {\n calendar.setTime(fecha);\n calcularCantidadDeRepeticionesHorasMin(unid_medi,calendar,cant_tiempo,tomas,model);\n }\n }", "private void moverFondo() {\n ActualizaPosicionesFondos();\n noAleatorio = MathUtils.random(1, 5); // crea los numeros para cambiar los mapas de manera aleatoria\n if (xFondo == -texturaFondoBase.getWidth()){\n //Cambio de fondo base\n texturaFondoBase= mapaAleatorio(noAleatorio);\n modificacionFondoBase= true; //Avisa que ya se modifico los fondos de inicio.\n }\n if (xFondo == -(texturaFondoApoyo.getWidth()+texturaFondoBase.getWidth())){\n //Cambio fondo de apoyo\n texturaFondoApoyo= mapaAleatorio(noAleatorio);\n xFondo= 0; //al pasar el segundo fondo regresa el puntero al primer fondo.\n modificacionFondoBase= true; //Avisa que ya se modifico los fondos de inicio.\n }\n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public void VaciarPila()\n {\n this.tope = 0;\n }", "public Queue mejoresPromediosMes(int TamañoArreglo, int mes )\n\t{\n\t\tQueue Respuesta = null;\n\n\t\t//Pasa los arreglos de queue mes a un arreglo temporal \n\t\tQueue f = queueMonthly;\n\t\tQueue pre = null;\n\t\tfor(int i = 0; i< (queueMonthly.darNumeroElementos()-1); i++)\n\t\t{\n\t\t\tdouble[] dato= (double[]) queueMonthly.dequeue();\n\t\t\tUBERTrip datof = new UBERTrip((short)dato[0],(short)dato[1], (short)dato[2],(float) dato[3],(float) dato[4], (float)dato[5],(float) dato[6]);\n\t\t\t\n\t\t\tpre.enqueue(datof);\n\t\t}\n\n\t\tUBERTrip[] arreglo = new UBERTrip[pre.darNumeroElementos()]; \n\n\t\tfor(int z= 0; z< pre.darNumeroElementos(); z ++)\n\t\t{\n\t\t\tUBERTrip y = (UBERTrip) pre.dequeue();\n\t\t\tarreglo[z] = y;\n\t\t}\n\n\t\t//Separo el arreglo por los datos del mes solicitado \n\t\tUBERTrip[] arregloMes= new UBERTrip[pre.darNumeroElementos()];\n\n\t\tint posicion = 0;\n\n\t\tfor(int j = 0; j< arreglo.length; j++)\n\t\t{\n\t\t\tdouble[] x = arreglo[j].darDatosViaje();\n\n\t\t\tif(x[2] == mes)\n\t\t\t{\n\t\t\t\tarregloMes[posicion] = arreglo[j]; \n\t\t\t\tposicion ++;\n\t\t\t}\n\t\t}\n\n\t\t// Ordenamiento por insercion\n\t\tfor (int i=1; i < arregloMes.length; i++) \n\t\t{\n\t\t\tUBERTrip aux = arregloMes[i];\n\n\t\t\tint j = 0;\n\n\t\t\tdouble datosArreglomes[] = arregloMes[j].darDatosViaje();\n\t\t\tdouble datosAux[] = aux.darDatosViaje();\n\n\t\t\tfor (j=i-1; j >= 0 && datosArreglomes[3] > datosAux[3]; j--)\n\t\t\t{\n\t\t\t\tarregloMes[j+1] = arregloMes[j];\n\t\t\t}\n\t\t\tarregloMes[j+1] = aux;\n\t\t}\n\n\t\t// Retorna los N elementos \n\t\tfor(int i =0; i< TamañoArreglo; i++)\n\t\t{\n\t\t\tRespuesta.enqueue(arregloMes[i]);\n\t\t}\n\n\t\treturn Respuesta;\n\t}", "private void atualizarTela() {\n\t\tif(this.primeiraJogada == true) {//SE FOR A PRIMEIRA JOGADA ELE MONTA O LABEL DOS NUMEROS APOS ESCOLHER A POSICAO PELA PRIMEIRA VEZ\r\n\t\t\tthis.primeiraJogada = false;\r\n\t\t\tthis.montarLabelNumeros();\r\n\t\t}\r\n\r\n\t\tthis.esconderBotao();\r\n\t\t\r\n\t\tthis.acabarJogo();\r\n\t}", "public void calculoPersonal(){\n ayudantes = getAyudantesNecesarios();\n responsables = getResponsablesNecesarios();\n \n //Calculo atencion al cliente (30% total trabajadores) y RRPP (10% total trabajadores):\n \n int total = ayudantes + responsables;\n \n atencion_al_cliente = (total * 30) / 100;\n \n RRPP = (total * 10) / 100;\n \n //Creamos los trabajadores\n \n gestor_trabajadores.crearTrabajadores(RRPP, ayudantes,responsables,atencion_al_cliente);\n \n }", "private void ActualizaPosicionesFondos() {\n xFondo-=10; //Es el cursor de la posición\n xFondoBase-=10; //Aqui se puede implementar metodo de modificacion de velocidad de fondo.\n xFondoApoyo-=10;\n if (xFondo == -texturaFondoBase.getWidth()){\n xFondoBase = xFondoApoyo+texturaFondoApoyo.getWidth();\n cambiosFondo++;\n }\n if (xFondo == -(texturaFondoApoyo.getWidth()+texturaFondoBase.getWidth())) {\n xFondoApoyo = xFondoBase+texturaFondoBase.getWidth();\n cambiosFondo++;\n }\n }", "public void datos(Temperatura t1){\n //Pizarra x = new Pizarra();\n //Dialog d = new Dialog();\n String v;\n float numero;\n //char n; \n //x.setVisible(true);\n //n = r.charAt(0);\n \n switch(opc){\n case 1:\n do\n v = d.readString(\"Ingresa la temperatura en grados Farenheit\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setFaren(numero);\n break;\n case 2:\n do\n v = d.readString(\"Ingresa la temperatura en grados Celsius\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setCelsius(numero);\n break;\n }\n }", "private void Limpiar() {\n txtEnunciado.setText(\"\");\n txtOpcionNumerica.setText(\"\");\n txtOpcionNominal.setText(\"\");\n controladorAgrePreguntas.limpiarArray();\n x = 0;\n }", "public void limpiar() {\n\t//txtBuscar.setText(\"\");\n\n\t// codTemporal.setText(\"\");\n\thabilita(true, false, false, false, false, true, false, true, true);\n }", "private void matar() {\n dead = true;\n tareaRestar.cancel();\n ventana.matar();\n\n juego.getFabricaE().seguir();\n\n ventana.dispose();\n }", "public double getEntreLlegadas() {\r\n return 60.0 / frecuencia;\r\n }", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "public static void horoscopo() {\n\n ArrayList<String> frases = new ArrayList<>();\n\n frases.add(\"Todo lo que seas capaz de creer, eres capaz de conseguir.\");\n frases.add(\"Serás más poderoso cuando tengas control total sobre ti mismo.\");\n frases.add(\"La sabiduría y la casualidad no van unidas de la mano.\");\n frases.add(\"Lo que hay en el ayer o en el mañana no es nada comparado con lo que hay en nuestro interior.\");\n frases.add(\"Cáete siete veces y levántate ocho.\");\n frases.add(\"Nunca es tarde para comenzar un nuevo proyecto, para ser quien siempre has deseado ser.\");\n frases.add(\"Con pensamientos positivos y perseverancia, solo es cuestión de tiempo que superes las adversidades y te propongas nuevos retos.\");\n frases.add(\"La vida es un 10% lo que nos ocurre, y un 90% cómo reaccionamos a ello.\");\n frases.add(\"No es más rico quien más tiene, sino quien menos necesita.\");\n frases.add(\"Intenta y falla, pero nunca falles en intentarlo.\");\n frases.add(\"Solo los hombres más sabios son capaces de saborear los momentos más simples.\");\n frases.add(\"cada segundo que goces, será segundo aprovechado.\");\n\n double numero = Math.round(Math.random() * 11);\n int numeroAleatorio = (int) numero;\n\n //Random r = new Random(); \n // int randomNumber = r.nextInt(frases.size());\n System.out.println(\"Frase horóscopo: \" + frases.get(numeroAleatorio));\n\n }", "private void forestIncomeTimerStart(){\n forestIncomeTimer.schedule(new TimerTask() {\n\n @Override\n public void run() {\n\n\n forestModel.setWood(forestModel.getWood()\n .add(forestModel.getElfIncome())\n .add(forestModel.getLumberjackIncome())\n .add(forestModel.getWoodcutterIncome()));\n setWoodLabel();\n setWoodIncomeLabel();\n\n\n\n\n\n }\n\n }, 1, 1000);\n }", "public void actualizarPantallaJuego(float delta)\r\n {\r\n //recuadroInfoJuego.actualizarTiempo(delta); // Con esto actualizamos el tiempo del HUD\r\n\r\n // Con el siguiente ciclo actualizamos el movimiento o posicion de los monstruos\r\n for (int i=0; i < enemigos.size(); i++)\r\n {\r\n // Metodo encargado de renovar las posiciones dado un diferencial de tiempo\r\n enemigos.get(i).actualizarPosicion(delta);\r\n\r\n // En caso que el enemigo haya muerto entonces\r\n if (enemigos.get(i).haMuerto())\r\n {\r\n // Se lo pasamos al jugador contrario de modo que\r\n try\r\n {\r\n // Le enviamos un mensaje sobre que tipo de enemigo debe generar de manera aleatoria\r\n String aux = \"Transferir enemigo: \" + enemigos.get(i).getTipo() + \"\\n\";\r\n socketCliente.getOutputStream().write(aux.getBytes());\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n // Se suma su valor en puntaje al puntaje general obtenido por el usuario\r\n recuadroInfoJuego.agregarPuntaje(enemigos.get(i).getPuntaje());\r\n\r\n // Luego, se suma uno al numero total de enemigos eliminados por el jugador\r\n recuadroInfoJuego.anotarEnemigo();\r\n\r\n // Y se elimina el monstruo de la lista de enemigos\r\n enemigos.remove(i);\r\n i = i - 1;\r\n }\r\n }\r\n\r\n // Si ya se cumplio el tiempo para generar otro monstruo entonces\r\n if (contaTiempo >= tiempoParaGeneracion)\r\n {\r\n // Agregamos un nuevo enemigo aleatorio en coordenas generadas tambien de manera aleatoria\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), MathUtils.random(1,5), true));\r\n\r\n // Y reseteamos el contador de tiempo\r\n contaTiempo = 0;\r\n }\r\n\r\n // O si se detecto que me pasaron un monstruo entonces\r\n if (enemigoTransferido != -1)\r\n {\r\n // Genero el tipo de monstruo especificado en coordenadas aleatorias\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), enemigoTransferido, true));\r\n\r\n // Y reinicio el dectector de monstruos tranferidos\r\n enemigoTransferido = -1;\r\n }\r\n\r\n contaTiempo = contaTiempo + delta; // Por ultimo se cuenta el tiempo\r\n }", "public int getTempoPatrulha() {\n return tempoPatrulha;\n }", "@Override\n public void jornadaTrabalho(int x) {\n DateTimeFormatter formatoData = DateTimeFormatter.ofPattern(\"HH:mm\");\n \n if (x == 40) {\n // Jornada de Trabalho PADRÃO 40h\n entrada1 = LocalTime.of(8, 0);\n saida1 = LocalTime.of(12, 0);\n entrada2 = LocalTime.of(14, 0);\n saida2 = LocalTime.of(18, 0);\n cbxJornada.setSelectedIndex(1);\n jornada = 40;\n } else if (x == 44) {\n // Jornada de Trabalho PADRÃO 44h\n entrada1 = LocalTime.of(7, 0, 0);\n saida1 = LocalTime.of(12, 0, 0);\n entrada2 = LocalTime.of(14, 0, 0);\n saida2 = LocalTime.of(18, 0, 0);\n cbxJornada.setSelectedIndex(2);\n jornada = 44;\n }\n //Popula os campos de horas\n txtEntrada1.setText(entrada1.format(formatoData));\n txtSaida1.setText(saida1.format(formatoData));\n txtEntrada2.setText(entrada2.format(formatoData));\n txtSaida2.setText(saida2.format(formatoData));\n }", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public void calcularSalario(){\n // 1% do lucro mensal\n double percentagemLucro = 0.01 * lucroMensal;\n // valor fixo igual ao dobro do dos empregados sem especialização, acrescido\n //de um prémio que corresponde a 1% do lucro mensal nas lojas da região.\n setSalario(1600 + percentagemLucro);\n\n }", "@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }", "public String dimeTuTiempo()\n {\n String cadResultado=\"\";\n if (horas<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+horas;\n cadResultado=cadResultado+\":\";\n if(minutos<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+minutos;\n \n return cadResultado;\n }", "@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}", "@Override\n public void setExperiencia(){\n experiencia1=Math.random()*50*nivel;\n experiencia=experiencia+experiencia1;\n subida();\n }", "@Override\r\n public void hallarPerimetro() {\r\n this.perimetro = this.ladoA*3;\r\n }", "public void prepararPago(){\n pago = (float) 0.00;\n nuevoSaldo = (float) 0.00;\n intereses = (float) 0.00;\n mora = (float) 0.00;\n pagoValido = false;\n }", "public void comenzarDiaLaboral() {\n\t\tSystem.out.println(\"AEROPUERTO: Inicio del dia laboral, se abren los puestos de informe, atención y freeshops al público, el conductor del tren llega a tiempo como siempre\");\n\t\tthis.turnoPuestoDeInforme.release();\n\t\t}", "private void cargarFichaLepra_inicio() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_INICIO_TRATAMIENTO_LEPRA,\r\n\t\t\t\tIRutas_historia.LABEL_INICIO_TRATAMIENTO_LEPRA, parametros);\r\n\t}", "public void actualiza() {\n //Determina el tiempo que ha transcurrido desde que el Applet inicio su ejecución\n long tiempoTranscurrido = System.currentTimeMillis() - tiempoActual;\n \n //Guarda el tiempo actual\n \t tiempoActual += tiempoTranscurrido;\n \n //Actualiza la animación con base en el tiempo transcurrido\n if (direccion != 0) {\n barril.actualiza(tiempoTranscurrido);\n }\n \n \n //Actualiza la animación con base en el tiempo transcurrido para cada malo\n if (click) {\n banana.actualiza(tiempoTranscurrido);\n }\n \n \n \n \n //Actualiza la posición de cada malo con base en su velocidad\n //banana.setPosY(banana.getPosY() + banana.getVel());\n \n \n \n if (banana.getPosX() != 50 || banana.getPosY() != getHeight() - 100) {\n semueve = false;\n }\n \n if (click) { // si click es true hara movimiento parabolico\n banana.setPosX(banana.getPosX() + banana.getVelX());\n banana.setPosY(banana.getPosY() - banana.getVelY());\n banana.setVelY(banana.getVelY() - gravity);\n }\n \n if (direccion == 1) { // velocidad de las barrils entre menos vidas menor el movimiento\n barril.setPosX(barril.getPosX() - vidas - 2);\n }\n \n else if (direccion == 2) {\n barril.setPosX(barril.getPosX() + vidas + 2);\n }\n }", "public void agregarCantidad() {\r\n\t\tif (cantidad > 0) {\r\n\t\t\tif (cantidad <= inventarioProductoComprar.getCantidad()) {\r\n\t\t\t\tdetalleAgregar.setCantidad(cantidad);\r\n\t\t\t\tdetalleAgregar.setSubtotal(detalleAgregar.getProducto().getValorProducto() * cantidad);\r\n\t\t\t\tinventarioProductoComprar.setCantidad(inventarioProductoComprar.getCantidad() - cantidad);\r\n\t\t\t\tsumarTotalVenta(cantidad, detalleAgregar.getProducto().getValorProducto());\r\n\t\t\t\tproductosCompra.add(detalleAgregar);\r\n\t\t\t\tinventariosEditar.add(inventarioProductoComprar);\r\n\t\t\t\tdetalleAgregar = null;\r\n\t\t\t\treload();\r\n\r\n\t\t\t} else {\r\n\t\t\t\tMessages.addFlashGlobalError(\"No existe esta cantidad en el inventario\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tMessages.addFlashGlobalError(\"La cantidad debe ser mayor a 0\");\r\n\t\t}\r\n\t}", "private void adicionarFaltas(final String matricula) {\n firebase.child(\"Alunos/\" + matricula + \"/faltas\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n long qtdAtual = (long) dataSnapshot.getValue();\n firebase.child(\"Alunos/\" + matricula + \"/faltas\").setValue(qtdAtual + 1);\n Toast.makeText(getContext(), \"Falta adicionada com sucesso.\", Toast.LENGTH_SHORT).show();\n\n if (alunoEncontrado == null) {\n Log log = new Log(matricula, 0);\n log.faltas(\"Adicionar\");\n } else {\n Log log = new Log(alunoEncontrado, 0);\n log.faltas(\"Adicionar\");\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }", "public void crearDepartamento(String nombredep, String num, int nvJefe, int horIn, int minIn, int horCi, int minCi) {\r\n\t\t// TODO Auto-generated method stub by carlos Sánchez\r\n\t\t//Agustin deberia devolverme algo q me indique si hay un fallo alcrearlo cual es\r\n\t\t//hazlo como mas facil te sea.Yo no se cuantos distintos puede haber.\r\n\t\r\n\t//para añadir el Dpto en la BBDD no se necesita el Nombre del Jefe\r\n\t//pero si su numero de vendedor (por eso lo he puesto como int) que forma parte de la PK \r\n\t\t\r\n\t\tint n= Integer.parseInt(num);\r\n\t\tString horaapertura=aplicacion.utilidades.Util.horaminutosAString(horIn, minIn);\r\n\t\tString horacierre=aplicacion.utilidades.Util.horaminutosAString(horCi, minCi);\r\n\t\tTime thI= Time.valueOf(horaapertura);\r\n\t\tTime thC=Time.valueOf(horacierre);\r\n\t\tthis.controlador.insertDepartamentoPruebas(nombredep, nvJefe,thI,thC); //tabla DEPARTAMENTO\r\n\t\tthis.controlador.insertNumerosDepartamento(n, nombredep); //tabla NumerosDEPARTAMENTOs\r\n\t\tthis.controlador.insertDepartamentoUsuario(nvJefe, nombredep); //tabla DepartamentoUsuario\r\n\r\n\t\t//insertamos en la cache\r\n\t\t//Departamento d=new Departamento(nombredep,Integer.parseInt(num),getEmpleado(nvJefe),null,null);\r\n\t\t//departamentosJefe.add(d);\r\n\t\t/*ArrayList<Object> aux=new ArrayList<Object>();\r\n\t\taux.add(nombredep);\r\n\t\taux.add(n);\r\n\t\taux.add(nvJefe);\r\n\t\tinsertCache(aux,\"crearDepartamento\");*///no quitar el parseInt\r\n\t}", "public void meter (Arma nuevaArma) {\n\t\tthis.add(nuevaArma);\n\t}", "public void recomendarTemposEM() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH2.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXCH = CFusionarEM.arregloPPTX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH2.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXCH = CFusionarEM.arregloPATX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH2.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXDB = CFusionarEM.arregloPPTX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXDB = CFusionarEM.arregloPATX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB2.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH2.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYCH = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYCH = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB2.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYDB = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYDB = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH2.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZCH = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZCH = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB2.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZDB = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZDB = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(paTZDB.get(iposision).toString());\n }\n\n }", "public static void atacar(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int ataqueJugador;\n //acciones de la funcion atacar sobre vida del enemigo\n aleatorio = (numeroAleatorio.nextInt(20-10+1)+10);\n ataqueJugador= ((nivel+1)*10)+aleatorio;\n puntosDeVidaEnemigo= puntosDeVidaEnemigo-ataqueJugador;\n \n }", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela PressaoArterial\\n\");\n\t\tpressaoArterial = new PressaoArterial();\n\t\tlistaPressaoArterial = pressaoArterialService.buscarTodos();\n\n\t}", "@Override\n\tpublic String acelerar(int velocidad) {\n\t\tthis.velocidad+=velocidad;\n\t\tString mensaje = \"Moto con velocidad actual de \"+this.velocidad;\n\t\tif (this.velocidad>VELOCIDAD_MAXIMA) {\n\t\t\tmensaje += \" y has superado la velocidad maxima\";\n\t\t}\n\t\treturn mensaje;\n\t}", "public void makeFactura() {\n Usuario userCurrent = (Usuario) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"current\");\n if (userCurrent != null) {\n Calendar c = Calendar.getInstance();\n factura.setIdfactura(facturaFacade.findAll().size() + 1);\n factura.setFechaVenta(c.getTime());\n factura.setUsuarioIdusuario(userCurrent);\n factura.setHabilitada(true);\n try {\n facturaFacade.create(factura);\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Factura creada exitosamente\", null));\n factura = new Factura();\n articulosFacturas = new ArrayList<>();\n total = 0;\n } catch (Exception e) {\n System.err.println(\"Error en la creacion de la factura: \" + e.getMessage());\n FacesContext.getCurrentInstance().addMessage(\"messages\", new FacesMessage(FacesMessage.SEVERITY_FATAL, e.getMessage(), null));\n }\n }\n getAllFacturas();\n }", "public void cambiarNombreDepartamento(String NombreAntiguo, String NombreNuevo) {\r\n\t\t// TODO Auto-generated method stub\r\n//se modifica el nombre del Dpto. en las 3 tablas de Departamentos\r\n\t\t\r\n//\t\tthis.controlador.cambiaNombreDpto(NombreAntiguo, NombreNuevo);\r\n//\t\t//this.controlador.cambiaNombreDepartamentoUsuario(NombreAntiguo, NombreNuevo);\r\n//\t\t//this.controlador.cambiaNombreNumerosDEPARTAMENTOs(NombreAntiguo, NombreNuevo);\r\n\t\tboolean esta=false;\r\n\t\tArrayList <String> aux=new ArrayList<String>();//Aqui meto los dos nombres que necesito, de esta forma no hace falta \r\n\t\taux.add(NombreAntiguo);\r\n\t\taux.add(NombreNuevo);\r\n\t\tint i=0;\r\n\t\twhile (i<departamentosJefe.size() && !esta){\r\n\t\t\tif (departamentosJefe.get(i).getNombreDepartamento().equals(NombreAntiguo)){\r\n\t\t\t\tdepartamentosJefe.get(i).setNombreDepartamento(NombreNuevo);\r\n\t\t\t\tmodifyCache(aux,\"NombreDepartamento\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tif (getEmpleadoActual().getRango() == 0){\r\n\t\t\tcontrolador.cambiaNombreDpto(NombreAntiguo, NombreNuevo);\r\n\t\t}\r\n\t}", "public Long consultarTiempoMaximo() {\n return timeFi;\n }", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "private static void estadisticaClase() {\n int numeroAlumnos;\n int aprobados = 0, suspensos = 0; // definición e instanciación de varias a la vez\n int suficentes = 0, bienes = 0, notables = 0, sobresalientes = 0;\n float totalNotas = 0;\n float media;\n Scanner in = new Scanner(System.in);\n\n // Salismos del bucle sólo si nos introduce un número positivo\n do {\n System.out.println(\"Introduzca el número de alumnos/as: \");\n numeroAlumnos = in.nextInt();\n } while (numeroAlumnos <= 0);\n\n // Como sabemos el número de alumnos es un bucle definido\n for (int i = 1; i <= numeroAlumnos; i++) {\n float nota = 0;\n\n // nota solo existe dentro de este for, por eso la definimos aquí.\n do {\n System.out.println(\"Nota del alumno \" + i + \" [0-10]: \");\n nota = in.nextFloat();\n } while (nota < 0 || nota > 10);\n\n // Sumamos el total de notas\n totalNotas += nota;\n\n if (nota < 5) {\n suspensos++;\n } else if (nota >= 5 && nota < 6) {\n aprobados++;\n suficentes++;\n } else if (nota >= 6 && nota < 7) {\n aprobados++;\n bienes++;\n } else if (nota >= 7 && nota < 9) {\n aprobados++;\n notables++;\n } else if (nota >= 9) {\n aprobados++;\n sobresalientes++;\n }\n }\n // De esta manera redondeo a dos decimales. Tengo que hacer un casting porque de Double quiero float\n // Si no debería trabajar con double siempre.\n media = (float) (Math.round((totalNotas / numeroAlumnos) * 100.0) / 100.0);\n\n // Sacamos las estadísticas\n System.out.println(\"Número de alumnos/as: \" + numeroAlumnos);\n System.out.println(\"Número de aprobados/as: \" + aprobados);\n System.out.println(\"Número de suspensos: \" + suspensos);\n System.out.println(\"Nota media: \" + media);\n System.out.println(\"Nº Suficientes: \" + suficentes);\n System.out.println(\"Nº Bienes: \" + bienes);\n System.out.println(\"Nº Notables: \" + notables);\n System.out.println(\"Nº Sobresalientes: \" + sobresalientes);\n\n\n }", "public int getFlores(int avenida, int calle);", "public void adjust_FineFuelMoisture(){\r\n\t// If FFM is one or less we set it to one\t\t\r\n\tif ((FFM-1)<=0){\r\n\t\tFFM=1;\r\n\t}else{\r\n\t\t//add 5 percent FFM for each Herb stage greater than one\r\n\t\tFFM=FFM+(iherb-1)*5;\r\n\t}\r\n}", "public void agregar_Alinicio(int elemento){\n inicio=new Nodo(elemento, inicio);// creando un nodo para que se inserte otro elemnto en la lista\r\n if (fin==null){ // si fin esta vacia entonces vuelve al inicio \r\n fin=inicio; // esto me sirve al agregar otro elemento al final del nodo se recorre al inicio y asi sucesivamnete\r\n \r\n }\r\n \r\n }", "void parralellFakto(){\n\t\tlong tall=maxtall;\r\n\t\ttall=tall*tall;\t//tallene som skal faktoriseres\r\n\r\n\t\t//lagrer faktoriseringen\r\n\t\tArrayList<Long> fakro = new ArrayList<>();\r\n\r\n\t\tlong ti = System.nanoTime();\r\n\t\tlong k=1;\r\n\t\tfor(long i=tall-100; i<tall; i++){\r\n\t\t// long i=3999999999999999991L;\r\n\t\t// System.out.println(\"i \" + i);\r\n\t\t\t\tk = traadfaktorisering(i);\r\n\t\t\t\tfakro.add(k);\r\n\t\t\t\t// System.out.println(\"k\" + k);\r\n\t\t\t\tlong temp=i/k;\r\n\t\t\t\t// System.out.println(\"temp\" + temp);\r\n\t\t\twhile(temp!=1 ) {\r\n\t\t\t\tif(temp<maxtall && isPrime((int)temp)){\r\n\t\t\t\t\tfakro.add(temp);\r\n\t\t\t\t\t// System.out.println(\"is prime\" + temp);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tk = traadfaktorisering(temp);\r\n\t\t\t\t// System.out.println(\"k\" + k);\r\n\t\t\t\tfakro.add(k);\r\n\t\t\t\ttemp=temp/k;\r\n\t\t\t\t// System.out.println(\"temp\" + temp);\r\n\r\n\t\t\t}\r\n\t\t\tSystem.out.print(i + \" = \");\r\n\t\t\tSystem.out.print(fakro.get(0));\r\n\t\t\tfor(int e=1; e<fakro.size(); e++){\r\n\t\t\t\tSystem.out.print(\" * \");\r\n\t\t\t\tSystem.out.print(fakro.get(e));\r\n\t\t\t}\r\n\t\t\tfakro.clear();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\tlong tid = System.nanoTime();\r\n\t\tSystem.out.println(\"tid pa parralellFakto: \" + ((tid-ti)/1000000.0) + \" ms\");\r\n\t\ttider.put(\"parralellFakto\", ((tid-ti)/1000000.0));\r\n\r\n\r\n\r\n\t}", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela Paciente\\n\");\n\t\tpaciente = new Paciente();\n\t\tlistaPaciente = pacienteService.buscarTodos();\n\t\t\n\t}", "public void setTaille(float value) {\r\n this.taille = value;\r\n }" ]
[ "0.6257406", "0.5903193", "0.5860495", "0.58569586", "0.58196783", "0.5794102", "0.5716241", "0.5652363", "0.56401265", "0.5594211", "0.55875516", "0.5587106", "0.5572604", "0.5545295", "0.55388236", "0.5516131", "0.55055046", "0.54573005", "0.54558516", "0.54177773", "0.5416064", "0.5405214", "0.5402313", "0.5396025", "0.5390003", "0.53797346", "0.5377815", "0.5375576", "0.5372464", "0.5363125", "0.53611434", "0.5356508", "0.5344381", "0.5327357", "0.5327286", "0.5314132", "0.53129107", "0.5312365", "0.5309253", "0.52888066", "0.52868384", "0.52792394", "0.5272697", "0.52677476", "0.525877", "0.5248975", "0.52463335", "0.5233097", "0.5230863", "0.52203435", "0.5219033", "0.5213171", "0.52088714", "0.52086407", "0.52040905", "0.5203065", "0.5197401", "0.51948535", "0.5192911", "0.51836574", "0.51776755", "0.51776713", "0.51766044", "0.5175523", "0.5174793", "0.5165933", "0.51513535", "0.5150869", "0.51485425", "0.5141709", "0.51414174", "0.5139802", "0.5134404", "0.5130119", "0.51273954", "0.5126847", "0.5122459", "0.51075935", "0.51034313", "0.510103", "0.5100672", "0.51004136", "0.50977004", "0.5097686", "0.50935143", "0.50839627", "0.50825965", "0.5080084", "0.50771886", "0.5076063", "0.5067142", "0.5066699", "0.50664365", "0.50656104", "0.5061235", "0.50599784", "0.5059089", "0.5058478", "0.5057109", "0.5055702" ]
0.5832598
4
Starts a new game with the given FEN.
static Game newGame(Player player1, Player player2, String fen) { return new GameImpl(player1, player2, fen); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void startGame()\r\n\t{\r\n\t\tnew ModeFrame();\r\n\t}", "public void startNewGame() {\n\t\tif (this.currentPlayer != -1) {\n\t\t\tthrow new RuntimeException(\"The game has already started.\");\n\t\t}\n\n\t\tif (this.players.size() == 0) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"The game cannot be started with a single player\");\n\t\t}\n\n\t\tthis.currentPlayer = 0;\n\n\t\tstartTurn();\n\t}", "private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}", "public void startGame() {\r\n this.setupGame();\r\n }", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "public void start (Frogger f, final int GameLevel) {\n\t\t\n\t\tif (!isHot && timeMs > PERIOD) {\t\t\n\t\t\tif (r.nextInt(100) < GameLevel*10) {\n\t\t\t\tdurationMs = 1;\n\t\t\t\tisHot = true;\n\t\t\t\tf.hw_hasMoved = false;\n\t\t\t\tAudioEfx.heat.play(0.2);\n\t\t\t}\t\t\n\t\t\ttimeMs = 0;\n\t\t}\n\t}", "public void startGame() throws JSONException {\n\t\tJSONObject json = new JSONObject();\n\t\tJSONObject json2 = new JSONObject();\n\t\tjson.put(\"Spiel starten\", json2);\n\n\t\tclient.send(json);\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tGameGrafic game = null;\r\n\t\t\t\tGameState state = new GameState();\r\n\t\t\t\t// if (opt == 2) {\r\n\t\t\t\t// game = SaveGameOptions.load();\r\n\t\t\t\t// } else {\r\n\t\t\t\tgame = new GameGrafic(state);\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tif (game != null) {\r\n\t\t\t\t\tgame.start();\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "public void startGame(){\n\t\tSystem.out.println(\"UNI: nas2180\\n\" +\n\t\t\t\t\"Hello, lets play Rock Paper Scissors Lizard Spock!\\n\");\n\t\tSystem.out.println(\"Rules:\\n Scissors cuts Paper\\n \" +\n\t\t\t\t\"Paper covers Rock\\n \" +\n\t\t\t\t\"Rock crushes Lizard\\n \" +\n\t\t\t\t\"Lizard poisons Spock\\n \" +\n\t\t\t\t\"Spock smashes Scissors\\n \" +\n\t\t\t\t\"Scissors decapitates Lizard\\n \" +\n\t\t\t\t\"Lizard eats Paper\\n \" +\n\t\t\t\t\"Paper disproves Spock\\n \" +\n\t\t\t\t\"Spock vaporizes Rock\\n \" +\n\t\t\t\t\"(and as it always has) Rock crushes Scissors\\n\");\n\t\tthisGame = new GameResult();\n\t\tplayRound();\n\t}", "public void startNewGame();", "private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}", "public void startGame() {\n running = true;\n\n Thread t = new Thread(animator);\n t.start();\n\n }", "public void startGame() \n\t{\n\t\tgamePanel.startGame();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }", "public void newGame() {\n init();\n updateScoreBoard();\n Toast.makeText(getContext(), \"New Game started\", Toast.LENGTH_LONG).show();\n }", "public void startGame() {\n\t\tfor(Chess.RowConfiguration rowConfiguration : Chess.getRowConfigurations()) {\n\t\t\tint row = rowConfiguration.row;\n\t\t\tClass[] pieceClasses = rowConfiguration.pieces;\n\t\t\tChess.Color sideColor = rowConfiguration.sideColor;\n\n\t\t\tfor(int col = 0; col < Chess.NUM_COLS; col++) {\n\t\t\t\taddPiece(pieceClasses[col], sideColor, board.getSpot(row, col));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.inPlay = true;\n\t\t\n\t\tstartNewTurn();\n\t\t\n\t\tif(eventListener != null) {\n\t\t\teventListener.onGameStarted();\n\t\t}\n\t}", "public Game startGame(Game game);", "public void newGame()\n\t{\n\t\tplanet.setLevel(0);\n\t\tship.resetScore();\n\t\tstopThreads();\n\t\tplanet = new Planet(750,600);\n\t\tship = new Ship(20.0,750,600,planet);\n\t\tbuttonPanel.update(ship,planet);\n\t\tgamePanel.update(ship,planet);\n\n\t\trestartThreads();\n\t}", "public void startGame() {\n\t\t//Start the rendering first\n\t\tgetRenderer().startRendering();\n\t\t\n\t\t//Start the game thread after that.\n\t\tgetGameThread().start();\n\t}", "void startNewGame(String playerName, String gameType) throws GameServiceException;", "private void startNewGame() {\n final GameSettingsPanel settings = new GameSettingsPanel();\n settings.addPropertyChangeListener(this);\n final int result = JOptionPane.showOptionDialog(null, settings, \"New Game Settings\",\n JOptionPane.DEFAULT_OPTION,\n JOptionPane.PLAIN_MESSAGE, null, null,\n null);\n\n if (result == 0) {\n settings.applyChanges();\n myWelcome = false;\n setPreferredSize(new Dimension(myWidth, myHeight));\n\n myBoardString = myBoard.toString();\n myGameOver = false;\n myTimer = new Timer(INITIAL_TIMER_DELAY, new TimerListener());\n\n myBoard.addObserver(this);\n firePropertyChange(\"new game\", null, myBoard);\n\n myTimer.start();\n myBoard.newGame();\n enableGamePlayKeys();\n\n }\n }", "public static void spielstart() {\n\n\t\tThread thread = new Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tgameboard = new GameFrame();\n\n\t\t\t}\n\t\t};\n\n\t\tthread.start();\n\n\t}", "public void newGame() {\n // this.dungeonGenerator = new TowerDungeonGenerator();\n this.dungeonGenerator = cfg.getGenerator();\n\n Dungeon d = dungeonGenerator.generateDungeon(cfg.getDepth());\n Room[] rooms = d.getRooms();\n\n String playername = JOptionPane.showInputDialog(null, \"What's your name ?\");\n if (playername == null) playername = \"anon\";\n System.out.println(playername);\n\n this.player = new Player(playername, rooms[0], 0, 0);\n player.getCurrentCell().setVisible(true);\n rooms[0].getCell(0, 0).setEntity(player);\n\n frame.showGame();\n frame.refresh(player.getCurrentRoom().toString());\n frame.setHUD(player.getGold(), player.getStrength(), player.getCurrentRoom().getLevel());\n }", "void startGame(int gameId) {\n game = new Game(gameId);\n }", "void newGame() {\n logger.log(\"New game starting.\");\n logger.log(divider);\n\n\n // Create the deck.\n createDeck();\n logger.log(\"Deck loaded: \" + deck.toString());\n\t logger.log(divider);\n\n\n // Shuffle the deck.\n shuffleDeck();\n logger.log(\"Deck shuffled: \" + deck.toString());\n logger.log(divider);\n\n // Create the players.\n createPlayers();\n setGameState(GameState.PLAYERS_SPAWNED);\n\n // Deal cards to players' decks.\n deal();\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n \n\n // Randomly select the active player for the first round.\n selectRandomPlayer();\n\n setGameState(GameState.NEW_GAME_INITIALISED);\n }", "private void newGame()\r\n {\r\n //close the current screen\r\n screen.dispose();\r\n //start back at the set up menu\r\n SetupView screen = new SetupView();\r\n SetupController controller = new SetupController(screen);\r\n screen.registerObserver(controller);\r\n }", "public void newGame() {\r\n\r\n gameObjects.newGame();\r\n\r\n // Reset the mScore\r\n playState.mScore = 0;\r\n\r\n // Setup mNextFrameTime so an update can triggered\r\n mNextFrameTime = System.currentTimeMillis();\r\n }", "public void startGame() {\n\t\timages = new ImageContainer();\n\t\ttimer = new Timer(15, this);\n\t\ttimer.setRepeats(true);\n\t\tlevelStartTimer = new Timer(2000, this);\n\t\thighScore = new HighScore();\n\t\tpacmanAnimation = new PacmanAnimation(images.pacman, new int[] { 3, 2,\n\t\t\t\t0, 1, 2 });\n\t\tactualLevel = 1;\n\t\tinitNewLevel();\n\t}", "public void startGame() {\n\t\tgameStart = true;\n\t\tfor(int i = 0; i < 5; i++) {\n\t\t\tenemys[i] = new Enemy(1 + (-i * 164), 192, pacman, 64, 64, 2.5, 0.0, 50);\n\t\t}\n\t\tfor(int i = 2; i < 10; i++) {\n\t\t\tenemys[i] = new Enemy(-100 + (-i * 164), 192, msPacman, 64, 64, 2.5, 0.0, 75);\n\t\t}\n\t\t\n\t\trepaint();\n\t}", "public void startNewGame()\n {\n // Display the Banner Page.\n \n System.out.println(\"\\nWelcome to the city of Aaron.\");\n \n // Prompt for and get the user’s name.\n String name;\n System.out.println(\"\\nPlease type in your first name: \");\n name = keyboard.next();\n\n // Call the createNewGame() method in the GameControl class\n \n GameControl.createNewGame(name);\n\n // Display a welcome message\n System.out.println(\"Welcome \" + name + \" have fun!!!\");\n \n //Call the GameMenuView\n GameMenuView gmv = new GameMenuView();\n gmv.displayMenu();\n }", "void startGame();", "void startGame();", "void startGame();", "private void startGame() {\r\n\t\tlog(mName + \": print an opening message (something useful, it is up to you)\");\r\n\t\tnew Thread(new Host(mRightPercent)).start();\r\n\r\n\t\tfor (Contestant c : Contestant.mGame.getContestants()) {\r\n\t\t\tlog(mName + \": Welcome \" + c.getName() + \" to the game.\");\r\n\t\t\tsynchronized (c.mConvey) {\r\n\t\t\t\tc.mConvey.notify();\r\n\t\t\t}\r\n\r\n\t\t\tsynchronized (intro) {\r\n\t\t\t\twaitForSignal(intro, null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsynchronized (Contestant.mGame) {\r\n\t\t\tContestant.mGame.setGameStarted(true);\r\n\t\t\tContestant.mGame.notify();\r\n\t\t}\r\n\t}", "protected void newGameClicked(ActionEvent e) {\n startNewGame();\n }", "private void startNewGame( ){\n\n mGame.clearBoard();\n mGameOver = false;\n\n // Reset all buttons\n for (int i = 0; i < mBoardButtons.length; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n mBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n }\n // Human goes first\n mDiffTextView.setText(mGame.dificult);\n mInfoTextView.setText(\"You go first.\");\n\n }", "public void run() {\n gf = addGameFrame(\"Pacman\", displayW, displayH);\n }", "private void changeGame() {\n switch (input) {\n case \"1\":\n new Lotto().generate();\n break;\n case \"2\":\n new SmallLotto().generate();\n break;\n case \"3\":\n System.out.println(\"Good bye\");\n System.exit(0);\n break;\n default:\n startGame();\n }\n continueGame();\n }", "public static Board fromFen(String fen) {\r\n List<Piece> pieces = new ArrayList<>();\r\n\r\n Matcher matcher = FEN_PATTERN.matcher(fen);\r\n while (matcher.find()) {\r\n PlayerColor playerColor = PlayerColor.fromColorChar(matcher.group(\"color\").charAt(0));\r\n String[] playerPieces = matcher.group(\"pieces\").split(FEN_PIECE_DELIMITER);\r\n for (String piece : playerPieces) {\r\n if (piece.charAt(0) == 'K') {\r\n pieces.add(new Piece(playerColor, Integer.parseInt(piece.substring(1)), true));\r\n } else {\r\n pieces.add(new Piece(playerColor, Integer.parseInt(piece), false));\r\n }\r\n }\r\n }\r\n return new Board(pieces);\r\n }", "public void startGame(){\n\t\tsc = new Scanner(System.in);\n\t\tgui.setScreenID(screenNumber);\n\t\tgui.start();\n\t}", "public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}", "@Override\n public void newGame() {\n //TODO Implement this method\n }", "private void startNewGame(Graphics g){\n\t\tclearBoard(g);\n\t\tb.init();\n\t\tgameStarted = true;\n\t\tgameOver = false;\n\t}", "public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }", "public void newGame()\n\t{\n\t\tthis.setVisible(false);\n\t\tthis.playingField = null;\n\t\t\n\t\tthis.playingField = new PlayingField(this);\n\t\tthis.setSize(new Dimension((int)playingField.getSize().getWidth()+7, (int)playingField.getSize().getHeight() +51));\n\t\tthis.setLocation(new Point(200,20));\n\t\tthis.setContentPane(playingField);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "public void playGame() {\n\t\tint generations = 1;\n\t\treadFromFile();\n\t\twhile (generations <= numGens) {\n\t\t\tgetNeighbors();\n\t\t\tsetNextGeneration();\n\t\t\tgenerations += 1;\n\t\t}\n\t\toutputToFile();\n\t}", "void newGame() {\n\t\tstate = new model.State () ; \n\t\tif(host != null ) host.show(state) ; \n\t}", "private void launchCreateGame() {\n\t\tString name = nameText.getText().toString();\n\t\tString cycle = cycleText.getText().toString();\n\t\tString scent = scentText.getText().toString();\n\t\tString kill = killText.getText().toString();\n\t\t\n\t\tif (name.equals(\"\")){\n\t\t\tname = defaultName;\n\t\t} \n\t\tif (cycle.equals(\"\")) {\n\t\t\tcycle = \"720\";\n\t\t} \n\t\tif (scent.equals(\"\")) {\n\t\t\tscent = \"1.0\";\n\t\t}\n\t\tif (kill.equals(\"\")) {\n\t\t\tkill = \".5\";\n\t\t}\n\t\t\n\t\t\t\n\t\tAsyncJSONParser pewpew = new AsyncJSONParser(this);\n\t\tpewpew.addParameter(\"name\", name);\n\t\tpewpew.addParameter(\"cycle_length\", cycle);\n\t\tpewpew.addParameter(\"scent_range\", scent);\n\t\tpewpew.addParameter(\"kill_range\", kill);\n\t\tpewpew.execute(WerewolfUrls.CREATE_GAME);\n\t\t\n\t\tsetProgressBarEnabled(true);\n\t\tsetErrorMessage(\"\");\n\t}", "@Override\n public void startNewGame() {\n reset();\n winnerDialogShown_ = false;\n sendGameChangedEvent(null); // get the info panel to refresh with 1st players name\n Player firstPlayer = controller.getPlayers().getFirstPlayer();\n\n if (firstPlayer.isSurrogate()) {\n doSurrogateMove((SurrogateMultiPlayer) firstPlayer);\n }\n else if (!firstPlayer.isHuman()) {\n controller.computerMovesFirst();\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}", "protected void newGame() {\r\n playSound( RESET );\r\n\r\n timeTitle.setText( Msgs.str( \"Time\" ) );\r\n timeMesg.setText( Msgs.str( \"zeroTime\" ) );\r\n infoMesg.setText( Msgs.str( \"Ready\" ) );\r\n scoreTitle.setText( Msgs.str( \"Score\" ) );\r\n\r\n adjustScore();\r\n currentScore = 0;\r\n scoreMesg.setText( \"0\" );\r\n\r\n mineField.newGame();\r\n minesTitle.setText( Msgs.str( \"mines.left\" ) );\r\n setMinesMesg( mineField.getNumHiddenMines() );\r\n\r\n pane.repaint();\r\n }", "public void newGameJBJ() {\n newGame();\n min = 0; max = 1000;\n myctr.setMinMaxLabel();\n myctr.setLabels();\n }", "public void startGame(String path) throws FileNotFoundException, IOException, BowlingGameException;", "public void startGame() {\n\t\ttank1.create(20, 530, 0, 0);\n\t\ttank1.setDefaults();\n\t\ttank2.create(960, 530, 0, 0);\n\t\ttank2.setDefaults();\n\t\tobjects.add(tank1);\n\t\tobjects.add(tank2);\n\t\tground = new Groundmod2((int) (Math.random() * 4));\n\t\tturn = Turn.PLAYER1;\n\t\tgrabFocus();\n\t}", "public void startGame() {\n\t\tif (chordImpl.getPredecessorID().compareTo(chordImpl.getID()) > 0) {\n\t\t\tGUIMessageQueue.getInstance().addMessage(\"I Start!\");\n\t\t\tshoot();\n\t\t}\n\t}", "@Override\n\tpublic void show() {\n\t\tsetUpGame();\n\t}", "public void startFight() {\r\n\t\tmenu.setVisible(false);\r\n\t\tmenu.setThreadSuspended(true);\r\n\t\tadd(new Fight(WIDTH, HEIGHT, gfh.loadBackground(\"london_nationalgallery.jpg\")));\r\n\t\tsetVisible(false);\r\n\t\tsetVisible(true);\r\n\t}", "@Override\n\tpublic void startCreateNewGame() \n\t{\t\n\t\tgetNewGameView().setTitle(\"\");\n\t\tgetNewGameView().setRandomlyPlaceHexes(false);\n\t\tgetNewGameView().setRandomlyPlaceNumbers(false);\n\t\tgetNewGameView().setUseRandomPorts(false);\n\t\tif(!getNewGameView().isModalShowing())\n\t\t{\n\t\t\tgetNewGameView().showModal();\n\t\t}\n\t}", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "private void startGame() {\n minesweeper ms;\n int timeout; // game timer, in minutes\n\n switch (this.gameLevel) {\n\n case INTERMEDIATE:\n ms = new minesweeper(16, 16);\n timeout = 10;\n break;\n case EXPERT:\n ms = new minesweeper(24, 24);\n timeout = 15;\n break;\n default:\n ms = new minesweeper(9, 9);\n timeout = 5;\n }\n\n MinesweeperFX msFx = new MinesweeperFX(ms, timeout);\n Parent gameUI = msFx.getGameUI();\n\n int children = this.root.getChildren().size();\n // check child count. if greater than '1'\n // then MinesweeperFX parent has been added previously.\n if (children > 1) {\n this.root.getChildren().set(1, gameUI);\n } else {\n this.root.getChildren().add(gameUI);\n }\n }", "public void newGame (){\r\n\t\tcounter = 1;\r\n\t\tcode = \"\";\r\n\t\tscore = 0;\r\n\t\tcodeguess = \"\";\r\n\t\tSystem.out.println(\"counter = \" + counter);\r\n\t\tdelay (1000);\r\n\t\tlevelup.play();\r\n\t\tdelay (1000);\r\n\t\tdisplay = true;\r\n\t\tgenerateCode(10);\r\n\t}", "private void startNewGame()\n {\n \n \t//this.mIsSinglePlayer = isSingle;\n \n \tmGame.clearBoard();\n \n \tfor (int i = 0; i < mBoardButtons.length; i++)\n \t{\n \t\tmBoardButtons[i].setText(\"\");\n \t\tmBoardButtons[i].setEnabled(true);\n \t\tmBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n \t\t//mBoardButtons[i].setBackgroundDrawable(getResources().getDrawable(R.drawable.blank));\n \t}\n \n \t\tmPlayerOneText.setText(\"Player One:\"); \n \t\tmPlayerTwoText.setText(\"Player Two:\"); \n \n \t\tif (mPlayerOneFirst) \n \t{\n \t\t\tmInfoTextView.setText(R.string.turn_player_one); \n \t\tmPlayerOneFirst = false;\n \t}\n \telse\n \t{\n \t\tmInfoTextView.setText(R.string.turn_player_two); \n \t\tmPlayerOneFirst = true;\n \t}\n \t\n \n \tmGameOver = false;\n }", "public void handleNewGameEvent(ActionEvent event) {\n\t\tgame.startNewGame();\n\t}", "private void startGame() {\r\n gameRunning = true;\r\n gameWindow.getStartButton().setText(\"Stop\");\r\n gameThread = new Thread(new GameLoopThread());\r\n gameThread.start();\r\n }", "public void runGame()\r\n\t{\r\n\t\tmainFrame.runGame();\r\n\t}", "public void startNewGame(View view)\n {\n // Set the intent to the RoundActivity class.\n Intent intent = new Intent(this, RoundActivity.class);\n\n // Set the newround flag to true.\n intent.putExtra(EXTRA_NEWROUND, true);\n\n // Start the activity.\n startActivity(intent);\n }", "public void newGame(){\n\t\tsoundMan.BackgroundMusic1();\n\n\t\tstatus.setGameStarting(true);\n\n\t\t// init game variables\n\t\tbullets = new ArrayList<Bullet>();\n\n\t\tstatus.setShipsLeft(8);\n\t\tstatus.setGameOver(false);\n\n\t\tif (!status.getNewLevel()) {\n\t\t\tstatus.setAsteroidsDestroyed(0);\n\t\t}\n\n\t\tstatus.setNewAsteroid(false);\n\n\t\t// init the ship and the asteroid\n\t\tnewShip(gameScreen);\n\t\tnewAsteroid(gameScreen);\n\n\t\t// prepare game screen\n\t\tgameScreen.doNewGame();\n\t\tsoundMan.StopMusic2();\n\t\tsoundMan.StopMusic3();\n\t\tsoundMan.StopMusic4();\n\t\tsoundMan.StopMusic5();\n\t\tsoundMan.StopMusic6();\n\t\t// delay to display \"Get Ready\" message for 1.5 seconds\n\t\tTimer timer = new Timer(1500, new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstatus.setGameStarting(false);\n\t\t\t\tstatus.setGameStarted(true);\t\n\n\t\t\t\tstatus.setLevel(1);\n\t\t\t\tstatus.setNumLevel(1);\n\t\t\t\tstatus.setScore(0);\n\t\t\t\tstatus.setYouWin(false);\n\t\t\t\tstatus.setBossLife(0);\n\t\t\t}\n\t\t});\n\t\ttimer.setRepeats(false);\n\t\ttimer.start();\n\t}", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "@Override\n\tpublic void newGame(String level) {\n\t\tmanager.newGame(level);\n\t}", "public void startGame() {\n \t\ttimeGameStarted = System.nanoTime();\n \t\tisStarted = true;\n \n \t}", "private void startGame() {\r\n\t\tthis.lobbyTimerActive = false;\r\n\t\tthis.gameStarted = true;\r\n\t\tthis.queueMessage(\"% START\");\r\n\t\tthis.dealer = new Dealer(this, this.players);\r\n\r\n\t\t// Start the dealer thread\r\n\t\tThread dealerThread = new Thread(dealer);\r\n\t\tdealerThread.start();\r\n\t}", "private void newGame() {\n try {\n toServer.writeInt(READY);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void InitGame(){\n System.out.format(\"New game initiated ...\");\n Game game = new Game(client_List);\n SetGame(game);\n }", "public void startGame(){\n\n\t\tGame.updatePlayer(players.get(curr));\n\t\tGameBoard gb = new GameBoard();\n\t\tthis.registerObserver(gb);\n\t\tgb.update(this, board);\n\n\t}", "public void startGame(int map) {\r\n if (!state[0]) {\r\n menu.setVisible(false);\r\n if (game == null) {\r\n game = new Game();\r\n game.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT));\r\n }\r\n game.map = map;\r\n frame.add(game, BorderLayout.CENTER);\r\n state[0] = true;\r\n game.setVisible(true);\r\n frame.pack();\r\n game.init();\r\n game.start();\r\n }\r\n }", "public void newGame()\n\t{\n\t\tmap = new World(3, viewSize, playerFactions);\n\t\tview = new WorldView(map, viewSize, this);\n\t\tbar = new Sidebar(map, barSize);\n\t}", "public void startGame() {\n \t\tcontroller = new GameController(gameConfig, players);\n \t\tcontroller.LOG = controller.LOG + \"#MPClient\";\n \n controller.setCurrentPlayer(firstTurnPid);\n \n \t\tsendStartGame();\n \t}", "public void startGame() {\n loadPlayersIntoQueueOfTurns();\n nextPlayerInTurn();\n eventListener.addEventObject(new RoundEvent(EventNamesConstants.GameStarted));\n }", "public void newGame();", "public void newGame();", "public void newGame();", "void startGame() {\n if (getHealth() <= 0) {\n startAgain();\n }\n int level = getLevel();\n if (level == 1) {\n Intent intent = new Intent(this, Level1Activity.class);\n intent.putExtra(sendPlayer, currPlayer);\n startActivity(intent);\n } else if (level == 2) {\n Intent intent = new Intent(this, Level2Activity.class);\n intent.putExtra(sendPlayer, currPlayer);\n startActivity(intent);\n } else if (level == 3) {\n Intent intent = new Intent(this, Level3Activity.class);\n intent.putExtra(sendPlayer, currPlayer);\n startActivity(intent);\n }\n }", "public void startGame() {\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.println(\"* Medieval Warriors *\\n* the adventure *\");\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.print(\"Enter your name: \");\n\n\t\tthis.playern = new Player(sc.nextLine());\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.println(\"Welcome \" + playern.getName() + \" The Warrior\\n\");\n\t\t\n\t\tint input = -1;\n\t\twhile (!wonGame && !lostGame) {\n\t\t\tprintMainMenu();\n\t\t\tSystem.out.print(\"> \");\n\t\t\tinput = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tswitch(input) {\n\t\t\t\tcase 1:\n\t\t\t\t\tgoAdventure();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tgoToTavern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tgoCharacter();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"Bye!\");\n\t\t\t\t\tlostGame = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (wonGame) {\n\t\t\tSystem.out.println(\"Congratulations! You won The Game!\");\n\t\t}\n\n\t}", "private void enterSinglePlayerMode(Game game) {\n if (!game.isStarted() && !game.isGameOver()) {\n game.startGame();\n initSubSystems(game);\n stateSession.initialGame = new Game(game);\n }\n }", "void startGame() {\n System.out.println(\"What game do you want to play?\\n\" + \"1. Lotto\\n\" + \"2. Small Lotto\\n\" + \"3. Quit\");\n input = scanner.next();\n changeGame();\n }", "public static void StartNewRound () {\n System.out.println(\"The game \" + (rounds == 0 ? \"begins!\" : \"continues...\"));\r\n System.out.println(\"===============================================\");\r\n\r\n // GENERATE A NEW NUMBER\r\n SetNewNumber();\r\n\r\n // RESET PICKED ARRAY\r\n ResetPickedNumbers();\r\n }", "public void newGame() {\n\n //reset game board before initializing newgame\n clearGame();\n \n whiteplayer = new Player(\"white\", chessboard, this);\n blackplayer = new Player(\"black\", chessboard, this);\n colorsTurn = \"white\";\n gamelog.logCurrentTurn(colorsTurn);\n\n }", "public synchronized void start(){\n\t\tthis.running = true;\n\t\tthis.thread = new Thread(this,\"Game\");\n\t\tthread.start();\n\n\t}", "public static void setupNewGamePlay() {\r\n\t\tSTATUS = Gamestatus.PREPARED;\r\n\t\tGameplay.getInstance().start();\r\n\t\tgui.setMenu(new GameplayMenu(), true);\r\n\t}", "public void startGame(GameMode gameMode, PlayerType startPlayer) {\n\t\tif (gameMode.equals(GameMode.SINGLEPLAYER)) {\n\t\t\tplayer1 = new Player(PlayerType.HUMAN, BLACK);\n\t\t\tplayer2 = new Player(PlayerType.AI, WHITE);\n\t\t\tplayer2.ai.setReversi(this);\n\n\t\t\tplayer1.setTurn(true);\n\t\t\tplayer1.setName(\"You\"); // Default name for single player\n\t\t} else { // The start player must be black\n\t\t\tif (startPlayer.equals(PlayerType.SERVER)) {\n\t\t\t\tplayer1 = new Player(PlayerType.AI, WHITE);\n\t\t\t\tplayer2 = new Player(PlayerType.SERVER, BLACK); // Start player\n\n\t\t\t\tplayer2.setTurn(true);\n\t\t\t} else {\n\t\t\t\tplayer1 = new Player(PlayerType.AI, BLACK); // Start player\n\t\t\t\tplayer2 = new Player(PlayerType.SERVER, WHITE);\n\n\t\t\t\tplayer1.setTurn(true);\n\t\t\t}\n\n\t\t\tplayer1.ai.setReversi(this);\n\t\t}\n\n\t\t// Set the scores\n\t\tplayer1.setScore(2);\n\t\tplayer2.setScore(2);\n\t}", "public synchronized void startGame() {\n PreGameState preGameState = new PreGameState();\n pickTeamState = preGameState.startGame(players);\n state = State.PICK_TEAM;\n teamSelection = new HashSet<>();\n }", "public static void startNewGame(int startingFunds) {\n DieGame game = new DieGame(startingFunds);\n while (game.funds >= 0) {\n int firstRoll = game.getNextRoll();\n int secondRoll = game.getNextRoll();\n game.onRoll(firstRoll, secondRoll);\n }\n game.displayGameOver();\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 StartGame() {\n\t\tmessageType = CabalWireformatType.GAME_START;\n\t\tscenario = location = timePeriod = NULL; \n\t\tturn = maxTurn = 0;\n\t\t// startingFaction is null!!\n\t\tallMissions = new LinkedList<MissionConceptDTO>();\n\t}", "public static void startGame() {\r\n\t\tfor (MovingUnit mu : _players) {\r\n\t\t\t((WinningInterface) mu).startUnit();\r\n\t\t}\r\n\t}", "public void actionPerformed(ActionEvent e){\n\t\t\tstartGame();\n\t\t}", "public void startGame(){\n System.out.println(\"[SERVER]: Starting a new game\");\n mainPage = new MainPage();\n mainPage.setMatch(match);\n mainPage.setRemoteController(senderRemoteController);\n\n Platform.runLater( () -> {\n try {\n firstPage.closePrimaryStage();\n if(chooseMap != null)\n chooseMap.closePrimaryStage();\n mainPage.start(new Stage());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }", "@Override\n\tpublic void startGame(){\n\t\tsuper.currentPlayer = 1;\n\t}", "private void newGame ()\n {\n this.game.abort ();\n try\n {\n Thread.sleep(50);\n }catch (InterruptedException e)\n { \n Logger.getLogger(AsteroidsFrame.class.getName()).log(Level.SEVERE, \"Could not sleep before initialing a new game.\");\n }\n this.game.initGameData ();\n }" ]
[ "0.6568866", "0.633762", "0.6145673", "0.59719914", "0.59563506", "0.5940403", "0.5916812", "0.5886026", "0.58852774", "0.5854438", "0.58521783", "0.5849148", "0.5844627", "0.58412486", "0.58192825", "0.5810372", "0.57925814", "0.57764786", "0.5776244", "0.5769681", "0.5755935", "0.57074124", "0.56757593", "0.5663706", "0.5656851", "0.5631803", "0.56133384", "0.5609223", "0.5593837", "0.559302", "0.5588191", "0.55826634", "0.55826634", "0.55826634", "0.558214", "0.5580773", "0.55800104", "0.55755943", "0.5567871", "0.55670875", "0.55458933", "0.55449796", "0.5532411", "0.5529515", "0.5515006", "0.5514502", "0.55122626", "0.55005777", "0.5493991", "0.54900026", "0.5479688", "0.5479383", "0.5476664", "0.5467769", "0.546493", "0.5447607", "0.54421926", "0.5432533", "0.5427547", "0.5421167", "0.5419466", "0.54136705", "0.5407736", "0.54059386", "0.5405813", "0.54043424", "0.54036945", "0.5400278", "0.53949165", "0.5392636", "0.53908104", "0.5375339", "0.53743684", "0.53660405", "0.535807", "0.53517014", "0.53495747", "0.53430766", "0.53407407", "0.53402054", "0.53402054", "0.53402054", "0.5339088", "0.5332077", "0.5321997", "0.5319761", "0.5309384", "0.5307887", "0.53054464", "0.5297571", "0.528707", "0.5285717", "0.5281536", "0.5279788", "0.52773976", "0.5276913", "0.52693146", "0.52660745", "0.5265864", "0.526349" ]
0.6273424
2
Starts a new game.
static Game newGame(Player player1, Player player2) { return new GameImpl(player1, player2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void startGame() {\n\t\tmain.next_module = new Game(main, inputs, gameSelectionData);\n\t}", "public void startGame() {\r\n this.setupGame();\r\n }", "public void startNewGame() {\n\t\tif (this.currentPlayer != -1) {\n\t\t\tthrow new RuntimeException(\"The game has already started.\");\n\t\t}\n\n\t\tif (this.players.size() == 0) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"The game cannot be started with a single player\");\n\t\t}\n\n\t\tthis.currentPlayer = 0;\n\n\t\tstartTurn();\n\t}", "void startGame(int gameId) {\n game = new Game(gameId);\n }", "private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}", "public void startNewGame()\n {\n // Display the Banner Page.\n \n System.out.println(\"\\nWelcome to the city of Aaron.\");\n \n // Prompt for and get the user’s name.\n String name;\n System.out.println(\"\\nPlease type in your first name: \");\n name = keyboard.next();\n\n // Call the createNewGame() method in the GameControl class\n \n GameControl.createNewGame(name);\n\n // Display a welcome message\n System.out.println(\"Welcome \" + name + \" have fun!!!\");\n \n //Call the GameMenuView\n GameMenuView gmv = new GameMenuView();\n gmv.displayMenu();\n }", "public void startGame() \n\t{\n\t\tgamePanel.startGame();\n\t}", "public void startGame() {\n\t\t//Start the rendering first\n\t\tgetRenderer().startRendering();\n\t\t\n\t\t//Start the game thread after that.\n\t\tgetGameThread().start();\n\t}", "public void startNewGame();", "public static void startGame()\r\n\t{\r\n\t\tnew ModeFrame();\r\n\t}", "void startNewGame(String playerName, String gameType) throws GameServiceException;", "public void startGame(){\n\t\tSystem.out.println(\"UNI: nas2180\\n\" +\n\t\t\t\t\"Hello, lets play Rock Paper Scissors Lizard Spock!\\n\");\n\t\tSystem.out.println(\"Rules:\\n Scissors cuts Paper\\n \" +\n\t\t\t\t\"Paper covers Rock\\n \" +\n\t\t\t\t\"Rock crushes Lizard\\n \" +\n\t\t\t\t\"Lizard poisons Spock\\n \" +\n\t\t\t\t\"Spock smashes Scissors\\n \" +\n\t\t\t\t\"Scissors decapitates Lizard\\n \" +\n\t\t\t\t\"Lizard eats Paper\\n \" +\n\t\t\t\t\"Paper disproves Spock\\n \" +\n\t\t\t\t\"Spock vaporizes Rock\\n \" +\n\t\t\t\t\"(and as it always has) Rock crushes Scissors\\n\");\n\t\tthisGame = new GameResult();\n\t\tplayRound();\n\t}", "public void start() {\n ArrayList<String> names = new ArrayList<>();\n game.initialize(names);\n //game.play(this.mainPkmn, this.attack);\n\n }", "void newGame() {\n logger.log(\"New game starting.\");\n logger.log(divider);\n\n\n // Create the deck.\n createDeck();\n logger.log(\"Deck loaded: \" + deck.toString());\n\t logger.log(divider);\n\n\n // Shuffle the deck.\n shuffleDeck();\n logger.log(\"Deck shuffled: \" + deck.toString());\n logger.log(divider);\n\n // Create the players.\n createPlayers();\n setGameState(GameState.PLAYERS_SPAWNED);\n\n // Deal cards to players' decks.\n deal();\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n \n\n // Randomly select the active player for the first round.\n selectRandomPlayer();\n\n setGameState(GameState.NEW_GAME_INITIALISED);\n }", "void startGame();", "void startGame();", "void startGame();", "public Game startGame(Game game);", "public void startGame() {\n \t\ttimeGameStarted = System.nanoTime();\n \t\tisStarted = true;\n \n \t}", "private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "public void startGame() {\n running = true;\n\n Thread t = new Thread(animator);\n t.start();\n\n }", "public void newGame(){\n\t\tsoundMan.BackgroundMusic1();\n\n\t\tstatus.setGameStarting(true);\n\n\t\t// init game variables\n\t\tbullets = new ArrayList<Bullet>();\n\n\t\tstatus.setShipsLeft(8);\n\t\tstatus.setGameOver(false);\n\n\t\tif (!status.getNewLevel()) {\n\t\t\tstatus.setAsteroidsDestroyed(0);\n\t\t}\n\n\t\tstatus.setNewAsteroid(false);\n\n\t\t// init the ship and the asteroid\n\t\tnewShip(gameScreen);\n\t\tnewAsteroid(gameScreen);\n\n\t\t// prepare game screen\n\t\tgameScreen.doNewGame();\n\t\tsoundMan.StopMusic2();\n\t\tsoundMan.StopMusic3();\n\t\tsoundMan.StopMusic4();\n\t\tsoundMan.StopMusic5();\n\t\tsoundMan.StopMusic6();\n\t\t// delay to display \"Get Ready\" message for 1.5 seconds\n\t\tTimer timer = new Timer(1500, new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tstatus.setGameStarting(false);\n\t\t\t\tstatus.setGameStarted(true);\t\n\n\t\t\t\tstatus.setLevel(1);\n\t\t\t\tstatus.setNumLevel(1);\n\t\t\t\tstatus.setScore(0);\n\t\t\t\tstatus.setYouWin(false);\n\t\t\t\tstatus.setBossLife(0);\n\t\t\t}\n\t\t});\n\t\ttimer.setRepeats(false);\n\t\ttimer.start();\n\t}", "public void startGame() {\n\t\ttank1.create(20, 530, 0, 0);\n\t\ttank1.setDefaults();\n\t\ttank2.create(960, 530, 0, 0);\n\t\ttank2.setDefaults();\n\t\tobjects.add(tank1);\n\t\tobjects.add(tank2);\n\t\tground = new Groundmod2((int) (Math.random() * 4));\n\t\tturn = Turn.PLAYER1;\n\t\tgrabFocus();\n\t}", "public void startGame() throws IOException\n\t{\n\t\tobjectOutputStream.writeObject(new StartGame());\n\t}", "private void startGame() {\r\n gameRunning = true;\r\n gameWindow.getStartButton().setText(\"Stop\");\r\n gameThread = new Thread(new GameLoopThread());\r\n gameThread.start();\r\n }", "public void newGame() {\n init();\n updateScoreBoard();\n Toast.makeText(getContext(), \"New Game started\", Toast.LENGTH_LONG).show();\n }", "private void startNewGame(Graphics g){\n\t\tclearBoard(g);\n\t\tb.init();\n\t\tgameStarted = true;\n\t\tgameOver = false;\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tGameGrafic game = null;\r\n\t\t\t\tGameState state = new GameState();\r\n\t\t\t\t// if (opt == 2) {\r\n\t\t\t\t// game = SaveGameOptions.load();\r\n\t\t\t\t// } else {\r\n\t\t\t\tgame = new GameGrafic(state);\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tif (game != null) {\r\n\t\t\t\t\tgame.start();\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "public void startGame() {\n\t\timages = new ImageContainer();\n\t\ttimer = new Timer(15, this);\n\t\ttimer.setRepeats(true);\n\t\tlevelStartTimer = new Timer(2000, this);\n\t\thighScore = new HighScore();\n\t\tpacmanAnimation = new PacmanAnimation(images.pacman, new int[] { 3, 2,\n\t\t\t\t0, 1, 2 });\n\t\tactualLevel = 1;\n\t\tinitNewLevel();\n\t}", "public void startGame(){\n\t\tsc = new Scanner(System.in);\n\t\tgui.setScreenID(screenNumber);\n\t\tgui.start();\n\t}", "public void startGame() {\n \t\tcontroller = new GameController(gameConfig, players);\n \t\tcontroller.LOG = controller.LOG + \"#MPClient\";\n \n controller.setCurrentPlayer(firstTurnPid);\n \n \t\tsendStartGame();\n \t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tGameLauncher gameLauncher = new GameLauncher();\n\t\t\t}", "public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "private void startGame() {\r\n\t\tthis.lobbyTimerActive = false;\r\n\t\tthis.gameStarted = true;\r\n\t\tthis.queueMessage(\"% START\");\r\n\t\tthis.dealer = new Dealer(this, this.players);\r\n\r\n\t\t// Start the dealer thread\r\n\t\tThread dealerThread = new Thread(dealer);\r\n\t\tdealerThread.start();\r\n\t}", "public static void startGamePlay() {\r\n\t\tif(!STATUS.equals(Gamestatus.PREPARED)) {\r\n\t\t\tSystem.err.println(\"Invalid Gamestatus! Cannot start unprepared gameplay\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tSTATUS = Gamestatus.RUNNING;\r\n\t\tclock = new GameClock();\r\n\t\tclock.start(GameTickExecutor.DEFAULT_GAMETICK);\r\n\t}", "private void startNewGame()\n {\n \n \t//this.mIsSinglePlayer = isSingle;\n \n \tmGame.clearBoard();\n \n \tfor (int i = 0; i < mBoardButtons.length; i++)\n \t{\n \t\tmBoardButtons[i].setText(\"\");\n \t\tmBoardButtons[i].setEnabled(true);\n \t\tmBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n \t\t//mBoardButtons[i].setBackgroundDrawable(getResources().getDrawable(R.drawable.blank));\n \t}\n \n \t\tmPlayerOneText.setText(\"Player One:\"); \n \t\tmPlayerTwoText.setText(\"Player Two:\"); \n \n \t\tif (mPlayerOneFirst) \n \t{\n \t\t\tmInfoTextView.setText(R.string.turn_player_one); \n \t\tmPlayerOneFirst = false;\n \t}\n \telse\n \t{\n \t\tmInfoTextView.setText(R.string.turn_player_two); \n \t\tmPlayerOneFirst = true;\n \t}\n \t\n \n \tmGameOver = false;\n }", "public void start() {\n\t\t// initialize stuff\n\t\tinitGL();\n\t\tinit();\n\t\t\n\t\t// main game loop\n\t\twhile (true) {\n\t\t\t// display the title screen\n\t\t\tshowTitleScreen();\n\t\t\t\n\t\t\twhile (!gameOver) {\n\t\t\t\tupdateDelta();\n\t\t\t\trender();\n\t\t\t\tpollInput();\n\t\t\t\tupdate();\n\t\t\t\tupdateDisplay();\n\t\t\t}\n\t\t\t// Game Over\n\t\t\ttry {\n\t\t\t\tThread.sleep(2500);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void spielstart() {\n\n\t\tThread thread = new Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tgameboard = new GameFrame();\n\n\t\t\t}\n\t\t};\n\n\t\tthread.start();\n\n\t}", "private void startNewGame( ){\n\n mGame.clearBoard();\n mGameOver = false;\n\n // Reset all buttons\n for (int i = 0; i < mBoardButtons.length; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n mBoardButtons[i].setOnClickListener(new ButtonClickListener(i));\n }\n // Human goes first\n mDiffTextView.setText(mGame.dificult);\n mInfoTextView.setText(\"You go first.\");\n\n }", "public void startGame() {\n loadPlayersIntoQueueOfTurns();\n nextPlayerInTurn();\n eventListener.addEventObject(new RoundEvent(EventNamesConstants.GameStarted));\n }", "public void createGame()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyState()\n clientController.startMultiPlayerGame(\"GameLobby\");\n }", "public void start() {\n\n\t\t// There will be no established screen at startup.\n\t\tif (screen != null)\n\t\t\tthrow new RuntimeException(\"Multiple instances of the game cannot be run.\");\n\n\t\t// Fire up the main menu screen.\n\t\tsetCurrentScreen(new MainMenuScreen());\n\t}", "public void startGame() throws JSONException {\n\t\tJSONObject json = new JSONObject();\n\t\tJSONObject json2 = new JSONObject();\n\t\tjson.put(\"Spiel starten\", json2);\n\n\t\tclient.send(json);\n\t}", "public static void startGame(CommandSender cs){\n if (isRunning){\n cs.sendMessage(ChatColor.RED + \"Game is already running!\");\n }\n else if (hiderSpawn == null || seekerSpawn == null){\n cs.sendMessage(ChatColor.RED + \"Make sure you set the spawn locations right!\");\n cs.sendMessage(ChatColor.RED + \"Do /setspawnlocation [seeker/hider] at the appropriate locations.\");\n }\n else if (Bukkit.getOnlinePlayers().size() < 3){\n cs.sendMessage(ChatColor.RED + \"Not enough players to start! Make sure there's at least 3 players online!\");\n }\n else{\n isRunning = true;\n if(gameThread == null){\n gameThread = new Thread(new GameManager());\n gameThread.start();\n }\n }\n }", "public void startGame() {\n\t\tfor(Chess.RowConfiguration rowConfiguration : Chess.getRowConfigurations()) {\n\t\t\tint row = rowConfiguration.row;\n\t\t\tClass[] pieceClasses = rowConfiguration.pieces;\n\t\t\tChess.Color sideColor = rowConfiguration.sideColor;\n\n\t\t\tfor(int col = 0; col < Chess.NUM_COLS; col++) {\n\t\t\t\taddPiece(pieceClasses[col], sideColor, board.getSpot(row, col));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.inPlay = true;\n\t\t\n\t\tstartNewTurn();\n\t\t\n\t\tif(eventListener != null) {\n\t\t\teventListener.onGameStarted();\n\t\t}\n\t}", "public static void main(String args[]) {\n (new Game()).start();\n }", "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 startApplication() {\n\t\tgameView = new GameGUI(this);\n\t\t\n\t\t/*\n\t\t * Create bonus GUI now.\n\t\t * TODO: Use swing worker thread to create bonus GUI\n\t\t * \t\t that way if GUI had more bells and whistles to it\n\t\t * \t\t the bonus GUI creation wouldn't take up processing time\n\t\t * \t\t on the main thread.\n\t\t */\n\t\tcreateBonusGUI();\n\t\t\n\t\t//GUI created and ready to show to the user\n\t\tgameView.allowVisibility();\n\t\tGameSounds.startBackgroundMusic();\n\t}", "public void newGame() {\r\n\r\n gameObjects.newGame();\r\n\r\n // Reset the mScore\r\n playState.mScore = 0;\r\n\r\n // Setup mNextFrameTime so an update can triggered\r\n mNextFrameTime = System.currentTimeMillis();\r\n }", "@Override\n\tpublic void startCreateNewGame() \n\t{\t\n\t\tgetNewGameView().setTitle(\"\");\n\t\tgetNewGameView().setRandomlyPlaceHexes(false);\n\t\tgetNewGameView().setRandomlyPlaceNumbers(false);\n\t\tgetNewGameView().setUseRandomPorts(false);\n\t\tif(!getNewGameView().isModalShowing())\n\t\t{\n\t\t\tgetNewGameView().showModal();\n\t\t}\n\t}", "private void newGame ()\n {\n this.game.abort ();\n try\n {\n Thread.sleep(50);\n }catch (InterruptedException e)\n { \n Logger.getLogger(AsteroidsFrame.class.getName()).log(Level.SEVERE, \"Could not sleep before initialing a new game.\");\n }\n this.game.initGameData ();\n }", "public void newGame()\n\t{\n\t\tplanet.setLevel(0);\n\t\tship.resetScore();\n\t\tstopThreads();\n\t\tplanet = new Planet(750,600);\n\t\tship = new Ship(20.0,750,600,planet);\n\t\tbuttonPanel.update(ship,planet);\n\t\tgamePanel.update(ship,planet);\n\n\t\trestartThreads();\n\t}", "public void startGame() {\n\t\t\n\t\tPlayer p1;\n\t\tPlayer p2;\n\t\t\n\t\tif(player1.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp1 = new Human(1, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player1Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp1 = new AI(1, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tif(player2.getSelectionModel().getSelectedItem().equals(_HUMAN)) {\n\t\t\tp2 = new Human(2, main);\n\t\t}\n\t\telse {\n\t\t\tString difficulty = player2Diff.getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\tint diff = difficulty.equals(_DIFFICULTY1) ? 1 : difficulty.equals(_DIFFICULTY2) ? 2 : 3;\n\t\t\t\n\t\t\tp2 = new AI(2, diff, main);\n\t\t}\n\t\t\n\t\t\n\t\tmain.startGame(p1, p2);\n\t\t\n\t}", "public void startGame(){\n System.out.println(\"[SERVER]: Starting a new game\");\n mainPage = new MainPage();\n mainPage.setMatch(match);\n mainPage.setRemoteController(senderRemoteController);\n\n Platform.runLater( () -> {\n try {\n firstPage.closePrimaryStage();\n if(chooseMap != null)\n chooseMap.closePrimaryStage();\n mainPage.start(new Stage());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }", "public void start_game() throws IOException, JAXBException {\n savetoxml();\n logger.trace(\"starting the game now...\");\n primarystage.setResizable(false);\n primarystage.setScene(game_scene);\n primarystage.show();\n\n }", "void newGame() {\n\t\tstate = new model.State () ; \n\t\tif(host != null ) host.show(state) ; \n\t}", "public void startGame() {\n status = Status.COMPLETE;\n }", "public boolean gameStart() {\r\n if (game == null) {\r\n board = new Board();\r\n if (ai) {\r\n Logging.log(\"Starting as AI\");\r\n player = new BaasAI(this, \"14ply.book\");\r\n } else {\r\n Logging.log(\"Starting as Human\");\r\n player = new HumanPlayer(this);\r\n }\r\n game = new Game(this);\r\n game.start();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public synchronized void start() {\n\t\tif(isRunning) return; //If the game is already running, exit method\n\t\tisRunning = true; //Set boolean to true to show that it is running\n\t\tthread = new Thread(this); //Create a new thread\n\t\tthread.start(); //Start the thread\n\t}", "public synchronized void start(){\n\t\tthis.running = true;\n\t\tthis.thread = new Thread(this,\"Game\");\n\t\tthread.start();\n\n\t}", "public void startGame(){\n\n\t\tGame.updatePlayer(players.get(curr));\n\t\tGameBoard gb = new GameBoard();\n\t\tthis.registerObserver(gb);\n\t\tgb.update(this, board);\n\n\t}", "public void GameStart()\n\t\t{\n\t\t\tplayers_in_game++;\n\t\t}", "public static void setupNewGamePlay() {\r\n\t\tSTATUS = Gamestatus.PREPARED;\r\n\t\tGameplay.getInstance().start();\r\n\t\tgui.setMenu(new GameplayMenu(), true);\r\n\t}", "private void newGame()\r\n {\r\n //close the current screen\r\n screen.dispose();\r\n //start back at the set up menu\r\n SetupView screen = new SetupView();\r\n SetupController controller = new SetupController(screen);\r\n screen.registerObserver(controller);\r\n }", "public void start() {\r\n\t\tString osName = System.getProperty(\"os.name\");\r\n\t\tif (osName.contains(\"Mac\")) {\r\n\t\t\tgameThread.run();\r\n\t\t} else {\r\n\t\t\tgameThread.start();\r\n\t\t}\r\n\t}", "public void startGame(String path) throws FileNotFoundException, IOException, BowlingGameException;", "public void startDummyGame()\n\t{\n\t\t//game.dummyGame();\n\t}", "protected void newGameClicked(ActionEvent e) {\n startNewGame();\n }", "public void handleNewGameEvent(ActionEvent event) {\n\t\tgame.startNewGame();\n\t}", "public void start() {\n // set player number\n playerNumber = clientTUI.getInt(\"set player number (2-4):\");\n while (true) {\n try {\n game = new Game();\n game.setPlayerNumber(playerNumber - 1);\n host = this.clientTUI.getString(\"server IP address:\");\n port = this.clientTUI.getInt(\"server port number:\");\n clientName = this.clientTUI.getString(\"your name:\");\n player = clientTUI.getBoolean(\"are you human (or AI): (true/false)\") ?\n new HumanPlayer(clientName) : new ComputerPlayer(clientName);\n game.join(player);\n // initialize the game\n game.init();\n while (clientName.indexOf(' ') >= 0) {\n clientName = this.clientTUI.getString(\"re-input your name without space:\");\n }\n this.createConnection();\n this.sendJoin(clientName);\n this.handleJoin();\n if (handshake) {\n run();\n } else {\n if (!this.clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n } catch (ServerUnavailableException e) {\n clientTUI.showMessage(\"A ServerUnavailableException error occurred: \" + e.getMessage());\n if (!clientTUI.getBoolean(\"Do you want to open a new connection?\")) {\n shutdown();\n break;\n }\n }\n }\n clientTUI.showMessage(\"Exiting...\");\n }", "public static void main(String[] args) {\n\t\tGame myGame = new Game();\n\t\tmyGame.start();\n\t}", "public void startGame(View view) {\n\t\tstartActivity(new Intent(this, Game.class));\n\t}", "public void InitGame(){\n System.out.format(\"New game initiated ...\");\n Game game = new Game(client_List);\n SetGame(game);\n }", "public void startNewGame() {\n numOfTurnsLeft = NUMBER_OF_TURNS_ALLOWED;\n decodingBoard.clearBoard();\n }", "public synchronized void startGame() {\n PreGameState preGameState = new PreGameState();\n pickTeamState = preGameState.startGame(players);\n state = State.PICK_TEAM;\n teamSelection = new HashSet<>();\n }", "public void createGame();", "public static void startGame() {\r\n\t\tfor (MovingUnit mu : _players) {\r\n\t\t\t((WinningInterface) mu).startUnit();\r\n\t\t}\r\n\t}", "StartGameStatus start(Level level);", "private void newGame() {\n\t\t// Firstly, we spawn the player.\n\t\tplayer = new AsteroidsPlayer(GameObject.ROOT, this);\n\t\tspawnPlayer();\n\n\t\t// Make sure that no other objects exist.\n\t\tasteroids.clear();\n\t\tlaserShots.clear();\n\t\totherObjects.clear();\n\n\t\t// Then we create the score text using two strings.\n\t\tAsteroidsString scoreText = new AsteroidsString(GameObject.ROOT, \"SCORE\", true, false);\n\t\tscoreText.translate(new Vector3(-cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(scoreText);\n\t\tscoreString = new AsteroidsString(GameObject.ROOT, Integer.toString(score), true, false);\n\t\tscoreString.translate(new Vector3(-cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(scoreString);\n\n\t\t// We set our starting lives to 3.\n\t\tlives = 3;\n\n\t\t//And we also create the lives text.\n\t\tAsteroidsString livesText = new AsteroidsString(GameObject.ROOT, \"LIVES\", false, true);\n\t\tlivesText.translate(new Vector3(cameraZoom, cameraZoom - 1));\n\t\totherObjects.add(livesText);\n\t\tlivesString = new AsteroidsString(GameObject.ROOT, Integer.toString(lives), false, true);\n\t\tlivesString.translate(new Vector3(cameraZoom, cameraZoom - 3));\n\t\totherObjects.add(livesString);\n\n\t\t// Then we just set the delay to the first asteroid.\n\t\ttimeToNextAsteroid = asteroidDelay;\n\t}", "@Override\n\t public void run() {\n\t \tSnakeGame game = new SnakeGame();\n\t }", "public static void main(String args[]) {\n (new Game()).play();\n }", "private void startGame()\n {\n if (heroPlayer != null && antagonistPlayer != null && location != null && currentPlayerName != \"null\")\n {\n gameStarted = true;\n }\n }", "public void runGame()\r\n\t{\r\n\t\tmainFrame.runGame();\r\n\t}", "public GameStart() {\n\t\tsuper(\"First 2D Game\");\n\t}", "public static void main(String[] args) {\n Game game = new Game(\"Programming 2 Project\",600,600);\n game.start();\n \n }", "public synchronized boolean startGame(String gameName) {\n\t\tif(!isActive()) {\n\t\t\tGameProtocolFactory game1 = GameManager.getInstance().searchGame(gameName);\n\t\t\tif (game1!=null){\n\t\t\t\tthis.currentGame = game1.create(this); //when creates called, game starts\n\t\t\t\tlogger.info(gameName + \" game starting\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlogger.info(gameName + \" DOSENT EXIST\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.info(\"A different game is already in session\");\n\t\t\treturn false;\n\t\t}\n\t}", "public void newGame();", "public void newGame();", "public void newGame();", "public void start() {\n \tthis.currentState = this.initialState;\n \tstop=false; //indica que el juego no se ha detenido\n \tnotifyObservers(new GameEvent<S, A>(EventType.Start,null,currentState,\n \t\t\t\t\tnull,\"The game started\"));\n\n }", "public void startGame() {\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.println(\"* Medieval Warriors *\\n* the adventure *\");\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.print(\"Enter your name: \");\n\n\t\tthis.playern = new Player(sc.nextLine());\n\t\tSystem.out.println(\"************************\");\n\t\tSystem.out.println(\"Welcome \" + playern.getName() + \" The Warrior\\n\");\n\t\t\n\t\tint input = -1;\n\t\twhile (!wonGame && !lostGame) {\n\t\t\tprintMainMenu();\n\t\t\tSystem.out.print(\"> \");\n\t\t\tinput = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tswitch(input) {\n\t\t\t\tcase 1:\n\t\t\t\t\tgoAdventure();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tgoToTavern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tgoCharacter();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tSystem.out.println(\"Bye!\");\n\t\t\t\t\tlostGame = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (wonGame) {\n\t\t\tSystem.out.println(\"Congratulations! You won The Game!\");\n\t\t}\n\n\t}", "public void startGame(View view) {\n Intent intent = new Intent(this, Game.class);\n startActivity(intent);\n }", "private void startGame(){\n\t\tnewGame.setVisible(false);\n\t\tcp1shipLabel.setVisible(true);\n\t\tcp2shipLabel.setVisible(true);\n\n\t\tcp1ShotCount = 0;\n\t\tcp2ShotCount = 0;\n\t\tcp1BoatsSunk = 0;\n\t\tcp2BoatsSunk = 0;\n\n\t\tcp1shipLabel.setText(\"Computer Player 1 ships sunk: \" + cp1BoatsSunk);\n\t\tcp2shipLabel.setText(\"Computer Player 2 ships sunk: \" + cp2BoatsSunk);\n\n\t\tships = new Ship[10];\n\n\t\tcp1PlaceShips();\n\t\tcp2PlaceShips();\n\n\t\tfor(int x = 0; x < cp1Attacks.length; x++){\n\t\t\tfor(int y = 0; y < cp1Attacks[x].length; y++){\n\t\t\t\tcp1Attacks[x][y] = false;\n\t\t\t\tcp2Attacks[x][y] = false;\n\t\t\t}\n\t\t}\n\t\tgameTimer.start();\n\t\trepaint();\n\t}", "public void startGame(int map) {\r\n if (!state[0]) {\r\n menu.setVisible(false);\r\n if (game == null) {\r\n game = new Game();\r\n game.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT));\r\n }\r\n game.map = map;\r\n frame.add(game, BorderLayout.CENTER);\r\n state[0] = true;\r\n game.setVisible(true);\r\n frame.pack();\r\n game.init();\r\n game.start();\r\n }\r\n }", "public void startGame(){\n\t\tIntent intent = new Intent(getApplicationContext(), AndroidLauncher.class);\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n\t\tintent.putExtra(Bluetooth.PRIMARY_BT_GAME, String.valueOf(false));\n\t\tintent.putExtra(Bluetooth.SECONDARY_BT_GAME, String.valueOf(true));\n\t\tstartActivity(intent);\n\t}", "private void startGame() {\r\n\t\tlog(mName + \": print an opening message (something useful, it is up to you)\");\r\n\t\tnew Thread(new Host(mRightPercent)).start();\r\n\r\n\t\tfor (Contestant c : Contestant.mGame.getContestants()) {\r\n\t\t\tlog(mName + \": Welcome \" + c.getName() + \" to the game.\");\r\n\t\t\tsynchronized (c.mConvey) {\r\n\t\t\t\tc.mConvey.notify();\r\n\t\t\t}\r\n\r\n\t\t\tsynchronized (intro) {\r\n\t\t\t\twaitForSignal(intro, null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsynchronized (Contestant.mGame) {\r\n\t\t\tContestant.mGame.setGameStarted(true);\r\n\t\t\tContestant.mGame.notify();\r\n\t\t}\r\n\t}", "public void startGame() {\n\t\tif (chordImpl.getPredecessorID().compareTo(chordImpl.getID()) > 0) {\n\t\t\tGUIMessageQueue.getInstance().addMessage(\"I Start!\");\n\t\t\tshoot();\n\t\t}\n\t}", "void startGame() {\n System.out.println(\"What game do you want to play?\\n\" + \"1. Lotto\\n\" + \"2. Small Lotto\\n\" + \"3. Quit\");\n input = scanner.next();\n changeGame();\n }", "@Override\n public void run() {\n serverHelper.newGame(game, player);\n }" ]
[ "0.80187374", "0.7887341", "0.77853656", "0.7733701", "0.7730518", "0.7694469", "0.7658981", "0.76371074", "0.7590808", "0.7529368", "0.7445159", "0.74088305", "0.73959553", "0.7391723", "0.7389826", "0.7389826", "0.7389826", "0.7385825", "0.73571384", "0.735665", "0.7340911", "0.7286132", "0.72708434", "0.72431445", "0.71964145", "0.7186571", "0.71738464", "0.7137265", "0.7131815", "0.7124608", "0.71239614", "0.71078604", "0.70903647", "0.70684206", "0.7065677", "0.70576423", "0.7040911", "0.6979407", "0.6961182", "0.6957052", "0.69456416", "0.69327676", "0.6915304", "0.69037175", "0.68871194", "0.68868", "0.68854535", "0.6853941", "0.6844579", "0.68414515", "0.6835851", "0.6826984", "0.68260175", "0.6825925", "0.6822542", "0.6821257", "0.6814436", "0.68043196", "0.67883635", "0.6777848", "0.6769378", "0.67682713", "0.67622054", "0.67576337", "0.6757059", "0.6756492", "0.67387676", "0.6733586", "0.67334837", "0.67152286", "0.6712751", "0.67082334", "0.67075694", "0.67016137", "0.66951346", "0.66908467", "0.6681182", "0.66808236", "0.6676387", "0.66488993", "0.66371876", "0.6635207", "0.6624027", "0.6622081", "0.6617505", "0.66164255", "0.66036355", "0.6600902", "0.65953857", "0.65953857", "0.65953857", "0.6592968", "0.6588547", "0.65867", "0.65737545", "0.65719086", "0.6570177", "0.6565413", "0.6564457", "0.6559344", "0.6553002" ]
0.0
-1
Returns the current Player.
Player getCurrentPlayer();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public ServerPlayer getCurrentPlayer() {\r\n\t\treturn this.currentPlayer;\r\n\t}", "public Player getPlayer() {\r\n return world.getPlayer();\r\n }", "public Player getCurrentPlayer()\n\t{\n\t\treturn current;\n\t}", "public User getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "public Player currentPlayer() {\n\t\treturn (currentPlayer);\n\t}", "public final Player getPlayer() {\n return player;\n }", "public Player getCurrentPlayer(){\n return this.currentPlayer;\n }", "protected Player getPlayer() {\n return getGame().getPlayers().get(0);\n }", "public String getCurrentPlayer() {\n\t\treturn _currentPlayer;\n\t}", "public Player getPlayer()\r\n\t{\r\n\t\treturn mPlayer;\r\n\t}", "public Player getPlayer() {\n\t\treturn this.player;\r\n\t}", "public Player getPlayer() {\n\t\treturn this.player;\n\t}", "public Player getPlayer() {\n\t\t\treturn player;\n\t\t}", "public Player getPlayer() {\r\n\t\treturn player;\r\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public String getCurrentPlayer() {\n return currentPlayer;\n }", "public int getCurrentPlayer() {\n\t\treturn player;\n\t}", "public int getCurrentPlayer() {\n return player;\n }", "public static EntityPlayer getPlayer() {\n\t\treturn ModLoader.getMinecraftInstance().thePlayer;\n\t}", "public Player getCurrentPlayer(){\n String playerId = getUser().get_playerId();\n\n Player player = null;\n\n try {\n player = getCurrentGame().getPlayer(playerId);\n } catch(InvalidGameException e) {\n e.printStackTrace();\n System.out.println(\"This is the real Error\");\n }\n\n return player;\n }", "public char getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "public Player getPlayer() {\n\t\treturn p;\n\t}", "public Player getActivePlayer() {\n return activePlayer;\n }", "public Player getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getActivePlayer() {\r\n return activePlayer;\r\n }", "public AbstractGameObject getPlayer() {\n return this.player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return (roomPlayer);\n }", "public String getCurrentPlayer() {\r\n return this.playerIds[this.currentPlayer];\r\n }", "public Player getClientPlayer() {\n\t\treturn players.get(0);\n\t}", "Player currentPlayer();", "public Player getPlayer() {\r\n return player;\r\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return player;\n }", "public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getPlayer() {\n return player;\n }", "public Player getPlayer() {\n return me;\n }", "public String getPlayer() {\r\n return player;\r\n }", "@Override\n public String getCurrentPlayer() {\n return godPower.getCurrentPlayer();\n }", "public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}", "public Player getPlayer()\r\n {\r\n return player;\r\n }", "public PlayerEntity getPlayer() {\n return player;\n }", "public PlayerEntity getPlayer() {\n return player;\n }", "Player getPlayer();", "public Player getActivePlayer() {\n if (getActiveColor() == Piece.COLOR.RED)\n return getRedPlayer();\n else\n return getWhitePlayer();\n }", "public Sprite getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer();", "public Player getPlayer();", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public Player getPlayer() {\n return humanPlayer;\n }", "public int getPlayer() {\r\n\t\treturn player;\r\n\t}", "public Player getPlayer() {\n return p;\n }", "@java.lang.Override\n public POGOProtos.Rpc.CombatProto.CombatPlayerProto getPlayer() {\n return player_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : player_;\n }", "public POGOProtos.Rpc.CombatProto.CombatPlayerProto getPlayer() {\n if (playerBuilder_ == null) {\n return player_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : player_;\n } else {\n return playerBuilder_.getMessage();\n }\n }", "public static Player getCurrPlayer(){\n\t\treturn players.get(curr);\n\t}", "public int getActivePlayer() {\n return activePlayer;\n }", "protected Player getPlayer() { return player; }", "public PlayerShared getPlayer(String token) throws RemoteException {\n return mainScreenProvider.getPlayer(token);\n }", "public ViewerManager2 getPlayer() {\n return this.player;\n }", "public PlayerModel getOwnerPlayer() {\r\n\t\treturn ownerPlayer;\r\n\t}", "public char getPlayer() {\n return player;\n }", "@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }", "public Strider getPlayer() {\n return player;\n }", "public Player getCurrent(){\n\t\tPlayer p;\n\t\ttry{\n\t\t\tp = this.players.get(this.currElem);\n\t\t\t\n\t\t} catch(IndexOutOfBoundsException e){\n\t\t\tSystem.out.println(\"There isn't any players.\");\n\t\t\tp = null;\n\t\t}\n\t\t\t\n\t\treturn p; \n\t}", "@Override\npublic Player<T> getCurrentPlayer() {\n\treturn currentPlayer;\n}", "public Player getPlayer() { return player; }", "public String getPlayer() {\n return p;\n }", "public Player getFromPlayer()\n {\n // RETURN the CardMessage's fromPlayer\n return this.fromPlayer;\n }", "public int activePlayer() {\n return this.activePlayer;\n }", "@Override\n\tpublic Player getBukkitPlayer() {\n\t\treturn this.bukkitPlayer;\n\t}", "@Override\n\tpublic Player getPlayer() {\n\t\treturn null;\n\t}", "public int getPlayer()\n {\n return this.player;\n }", "public Player getToPlayer()\n {\n // RETURN the CardMessage's toPlayer\n return this.toPlayer;\n }", "@Override\n\tpublic List<Player> getPlayer() {\n\t\treturn ofy().load().type(Player.class).list();\n\t}", "public Room getCurrentRoom() {\n return playerRoom;\n }", "public Player getHumanPlayer() {\n return humanPlayer;\n }", "public static synchronized Player getInstance(){\n if(Player.player == null){\n Player.player = new Player();\n }\n return Player.player;\n }", "public Player getInteractingPlayer() {\n\t\treturn interactWith;\n\t}", "public Player getPlayer() { return player;}", "public String getPlayerName() {\n return this.playerName;\n }", "public Player getPlayer(){\r\n\t\treturn acquiredBy;\r\n\t}", "Player getSelectedPlayer();", "public Player getCurrentPlayer(Match match) {\r\n LOGGER.debug(\"--> getCurrentPlayer: match=\" + match);\r\n Player currentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 1) {\r\n currentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 2) {\r\n currentPlayer = match.getPlayer2();\r\n } else if (match.getCurrentPlayer() == 0) {\r\n currentPlayer = match.getPlayer1();\r\n } else {\r\n throw new GeneralException(\"match has no defined currentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getCurrentPlayer\");\r\n return currentPlayer;\r\n }", "public PlayerView getPlayerView() {\n return playerView;\n }", "public Player getOtherPlayer() {\n if (getCurrentPlayer().getNumber() == 1) {\n return joueur2;\n } else {\n return joueur1;\n }\n }", "public Player getPlayer(String username){\n return this.players.get(username);\n }", "public Room getCurrentRoom() {\r\n return player.getCurrentRoom();\r\n }", "public Player getPlayer(){\r\n return player;\r\n }" ]
[ "0.8879135", "0.8879135", "0.8720311", "0.8684197", "0.86606616", "0.86313343", "0.86276233", "0.8585006", "0.85754025", "0.85213673", "0.84356254", "0.8413243", "0.83611214", "0.836071", "0.8358843", "0.8324906", "0.8297136", "0.8297136", "0.8297136", "0.8297136", "0.8297136", "0.8297136", "0.8297136", "0.8291035", "0.82667476", "0.826002", "0.81721103", "0.8140463", "0.8087339", "0.8083657", "0.80822694", "0.80631894", "0.80399823", "0.80141044", "0.79806226", "0.7946107", "0.79392636", "0.7930349", "0.78857034", "0.7884967", "0.78798336", "0.78798336", "0.78798336", "0.78798336", "0.78798336", "0.7865545", "0.7836921", "0.78054005", "0.77956957", "0.7764436", "0.7748514", "0.77384835", "0.7732294", "0.7732294", "0.77247614", "0.76944506", "0.7688528", "0.7688169", "0.7688169", "0.7682659", "0.7654914", "0.7637755", "0.76156586", "0.7503166", "0.7497756", "0.7485274", "0.74731034", "0.7454091", "0.74018097", "0.73962784", "0.7396082", "0.73900527", "0.7361611", "0.7354723", "0.73337543", "0.73201185", "0.73118454", "0.73108226", "0.72892946", "0.72490776", "0.7227621", "0.7214043", "0.7190655", "0.71887577", "0.71817553", "0.71181464", "0.7116314", "0.7109667", "0.7103431", "0.704954", "0.70483416", "0.7029387", "0.7018703", "0.70159763", "0.699879", "0.69942164", "0.69893193", "0.69859403", "0.69634277" ]
0.82277983
27
Returns the last Player.
Player getDormantPlayer();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Player getCurrPlayer(){\n\t\treturn players.get(curr);\n\t}", "public Cards getLastCard() {\n return playedCards.get(playedCards.size()-1);\n }", "public Player getRightPlayer() {\r\n\t\tif(getWhoseTurn() - 2 < 0) {\r\n\t\t\treturn players.get(players.size() - 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn players.get(getWhoseTurn() - 2);\r\n\t\t}\r\n\t}", "protected Player getPlayer() {\n return getGame().getPlayers().get(0);\n }", "public Player getCurrentPlayer(){\n return this.currentPlayer;\n }", "public Player getCurrentPlayer()\n\t{\n\t\treturn current;\n\t}", "public ServerPlayer getCurrentPlayer() {\r\n\t\treturn this.currentPlayer;\r\n\t}", "public Player getLeftPlayer() {\r\n\t\tif(getWhoseTurn() > players.size() - 1) {\r\n\t\t\treturn players.get(0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn players.get(getWhoseTurn());\r\n\t\t}\r\n\t}", "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public Player getCurrentPlayer() {\n return currentPlayer;\n }", "public String getCurrentPlayer() {\r\n return this.playerIds[this.currentPlayer];\r\n }", "public Player getCurrentPlayer(){\n String playerId = getUser().get_playerId();\n\n Player player = null;\n\n try {\n player = getCurrentGame().getPlayer(playerId);\n } catch(InvalidGameException e) {\n e.printStackTrace();\n System.out.println(\"This is the real Error\");\n }\n\n return player;\n }", "public Player getOtherPlayer() {\n if (getCurrentPlayer().getNumber() == 1) {\n return joueur2;\n } else {\n return joueur1;\n }\n }", "public Player getNext(){\n\t\treturn this.players.get(this.nextElem);\n\t}", "public int getCurrentPlayer() {\n return player;\n }", "public User getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "public int getCurrentPlayer() {\n\t\treturn player;\n\t}", "public int getLastPlayIndex() {\n\t\treturn lastMoveID;\n\t}", "public String getCurrentPlayer() {\n\t\treturn _currentPlayer;\n\t}", "public Player getCurrent(){\n\t\tPlayer p;\n\t\ttry{\n\t\t\tp = this.players.get(this.currElem);\n\t\t\t\n\t\t} catch(IndexOutOfBoundsException e){\n\t\t\tSystem.out.println(\"There isn't any players.\");\n\t\t\tp = null;\n\t\t}\n\t\t\t\n\t\treturn p; \n\t}", "public Player getClientPlayer() {\n\t\treturn players.get(0);\n\t}", "public Player getRightNeigbour() {\n\t\treturn players.get((players.indexOf(current)+1)%players.size());\n\t}", "public static Player getPrevPlayer(){\n\t\tif(players.get(curr).getPnum()==1)\n\t\t\treturn players.get(players.size()-1);\n\t\telse return players.get(curr-1);\n\t}", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public Player getLoser() {\n\t\treturn getLeader() == player1 ? player2 : player1;\n\t}", "public Player getPlayer() {\r\n return world.getPlayer();\r\n }", "public String getCurrentPlayer() {\n return currentPlayer;\n }", "public Piece getCurrPlayer() {\n return this.currPlayer;\n }", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "public Move getLastMove() {\n return lastMove;\n }", "public GPoint getLastPoint() {\n\t\treturn (points.size() > 0) ? points.get(points.size() - 1) : null;\n\t}", "public int getCurentPlayerNumber() {\n return players.size();\n }", "@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }", "public final Player getPlayer() {\n return player;\n }", "public Course getLastCourse() {\n return lastCourse;\n }", "public Player getPlayer()\r\n\t{\r\n\t\treturn mPlayer;\r\n\t}", "public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}", "public Object getLastObject()\n {\n\tcurrentObject = lastObject;\n\n if (lastObject == null)\n \treturn null;\n else\n \treturn AL.get(AL.size()-1);\n }", "public Player currentPlayer() {\n\t\treturn (currentPlayer);\n\t}", "public PlayerPosition getNext() {\n\n\t\tswitch (this) {\n\t\t\tcase BOTTOM:\n\t\t\t\treturn LEFT;\n\t\t\tcase LEFT:\n\t\t\t\treturn TOP;\n\t\t\tcase TOP:\n\t\t\t\treturn RIGHT;\n\t\t\tcase RIGHT:\n\t\t\t\treturn BOTTOM;\n\t\t\tdefault:\n\t\t\t\t// must not happen\n\t\t\t\treturn null;\n\t\t}\n\t}", "public Player getInactivePlayer() {\n if (redPlayer.equals(getActivePlayer()))\n return whitePlayer;\n else\n return redPlayer;\n }", "public Player getPlayer() {\n\t\treturn p;\n\t}", "public long getLastPlayed ( ) {\n\t\treturn extract ( handle -> handle.getLastPlayed ( ) );\n\t}", "public char getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "public Character getNotActivePlayer() {\n\t\tif(this.getActivePlayer().equals(this.getPlayer1())) {\n\t\t\treturn this.getPlayer2();\n\t\t} else {\n\t\t\treturn this.getPlayer1();\n\t\t}\n\t}", "public Player getFirstPlayer() {\n return firstPlayer;\n }", "public Player getPlayer() {\n\t\treturn this.player;\r\n\t}", "public Player<T> findWinner(){\n\tPlayer<T> highPlayer = this.currentPlayer;\n\tPlayer<T> tempPlayer = this.currentPlayer;\n\tfor (int i = 0; i < getNumPlayers(); i++) {\n\t\tif (tempPlayer.getPoints() > highPlayer.getPoints()) {\n\t\t\thighPlayer = getCurrentPlayer();\n\t\t}\n\t\ttempPlayer = tempPlayer.getNext();\n\t}\n\treturn tempPlayer;\n}", "public O last()\r\n {\r\n if (isEmpty()) return null;\r\n return last.getObject();\r\n }", "public Move getLastMove()\r\n\t{\r\n\t\tif (appliedMoves == null || appliedMoves.isEmpty()) return null;\r\n\t\treturn appliedMoves.get(appliedMoves.size() - 1);\r\n\t}", "@Override\n public String getCurrentPlayer() {\n return godPower.getCurrentPlayer();\n }", "public int getPlayer() {\r\n\t\treturn player;\r\n\t}", "public Player getPlayer() {\n\t\treturn this.player;\n\t}", "@Override\npublic Player<T> getCurrentPlayer() {\n\treturn currentPlayer;\n}", "public Room getLastRoom(){return this.aLastRooms.pop();}", "public Player getPlayer() {\n return p;\n }", "public Player getOppositePlayer();", "public long getLastTimePlayed()\n {\n return lastTimePlayed;\n }", "public Player getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getPlayer() {\r\n\t\treturn player;\r\n\t}", "public PlayerController getNextPlayer()\n {\n // This will return a player who is going to make a move\n int turn = this.turn;\n int NUMBER_OF_PLAYERS = GameConfiguration.NUMBER_OF_PLAYERS;\n if(turn%NUMBER_OF_PLAYERS == 0) \n {\n turn = 0;\n }\n else\n {\n turn = turn%NUMBER_OF_PLAYERS;\n }\n PlayerController player = findPlayerById(turn);\n return player;\n }", "public int getLastEnemyMove(Player player)\r\n {\r\n int lastEnemyMove = player.getLastMove();\r\n \r\n return lastEnemyMove;\r\n }", "public Room getLastRoom() // from my understanding this pops the last entry and replaces it with the one before\n { // might need a if test to prevent a null return and say there are no rooms previous.\n Room room = roomHistory.pop();\n return room;\n }", "Optional<Player> getHoldingPlayer();", "public Player getLeftNeighbor() {\n\t\tif(players.indexOf(current)==0) {\n\t\t\treturn players.get(players.size()-1);\n\t\t}\n\t\telse {\n\t\t\treturn players.get(players.indexOf(current)-1);\n\t\t}\n\t}", "public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}", "public Player getWinner() {\n \tif (!isOver())\n \t\treturn null;\n \tif (player1.getScore() > player2.getScore())\n \t\treturn player1;\n \tif (player2.getScore() > player1.getScore())\n \t\treturn player2;\n \treturn null;\n }", "public Card getNextPlayerCard()\n\t{\n\t\tDeck<Card> playerCards = board.getPlayerCardDeck();\n\t\tif (playerCards.isEmpty())\n\t\t{\n\t\t\tsystemDataInput.printMessage(\"There is no player card to play the game.\");\n\t\t\tendGame(EndGameType.noPlayerCard);\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCard topCard = playerCards.pickTopCard();\n\t\t\tif (playerCards.size() == 1)\n\t\t\t{\n\t\t\t\tsystemDataInput.printMessage(\"The last player card \" + topCard.getName() + \" has been picked up. This is the end of the game.\");\n\t\t\t\tendGame(EndGameType.noPlayerCard);\n\t\t\t}\n\t\t\t\n\t\t\treturn topCard;\n\t\t}\n\t}", "public Player getPlayer() {\n return me;\n }", "public int privousPlayer() {\n do {\n if (player != 0) {\n player --;\n } else {\n player = playersArray[playersArray.length - 1];\n }\n } while (playersArray[player] < 0);\n return player;\n }", "public Player getActivePlayer() {\n return activePlayer;\n }", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public Player getSecondPlayer() {\n return secondPlayer;\n }", "public String getPlayer() {\n return p;\n }", "public Character getOpponent() {\n Character result = null;\n if (this.enemies.getAdversaries().size() > 0) {\n Collections.shuffle(this.enemies.getAdversaries());\n result = this.enemies.getAdversaries().get(0);\n this.enemies.getAdversaries().remove(result);\n }\n return result;\n }", "public Player getActivePlayer() {\r\n return activePlayer;\r\n }", "public synchronized Player getPlayerIfNotFull() {\n if (player1 == null) {\n player1 = new Player(order, 'X');\n order++;\n nrOfPlayers++;\n return player1;\n } else if (player2 == null) {\n player2 = new Player(order, 'O');\n order = 0;\n nrOfPlayers++;\n started = true;\n return player2;\n }\n return null;\n }", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n return player;\n }", "public Player getOppositePlayer(){\n return this.oppositePlayer;\n }", "public int getPlayer()\n {\n return this.player;\n }", "Player getPlayer();", "public Player getPlayer() {\n return humanPlayer;\n }", "public int getActivePlayer() {\n return activePlayer;\n }", "public Player getPlayer()\r\n {\r\n return player;\r\n }", "public Player getPlayer() {\n\t\t\treturn player;\n\t\t}", "public HumanPlayer getHuman(){\n\t\treturn ((HumanPlayer)players.get(0));\n\t}", "public String getPlayer() {\r\n return player;\r\n }", "public Player getOwner() {\n\t\tif (owner == null && possibleOwners.size() == 1)\n\t\t\towner = possibleOwners.get(0);\n\t\t\n\t\treturn owner;\n\t}", "public AbstractGameObject getPlayer() {\n return this.player;\n }", "public Player getPlayer() {\n return (roomPlayer);\n }", "Player currentPlayer();", "public Player getPlayer() {\r\n return player;\r\n }", "public Player getPlayer();" ]
[ "0.7336195", "0.7288136", "0.71573126", "0.70590025", "0.7055823", "0.6959709", "0.69070506", "0.68976235", "0.68656015", "0.68656015", "0.68579197", "0.68414897", "0.68360573", "0.68246555", "0.6778716", "0.676869", "0.67664564", "0.67479426", "0.67323834", "0.67243624", "0.6693465", "0.66860586", "0.6684036", "0.668271", "0.66777873", "0.6676321", "0.6658141", "0.6640616", "0.6622495", "0.6622495", "0.66199654", "0.65615845", "0.6546198", "0.65436256", "0.654175", "0.6533946", "0.653142", "0.65254164", "0.6523431", "0.6519059", "0.65085566", "0.65082955", "0.64903975", "0.6485761", "0.64819694", "0.64625305", "0.6457115", "0.6453536", "0.6452473", "0.64448583", "0.64244175", "0.6415868", "0.6400701", "0.63917434", "0.6383223", "0.6381857", "0.6365568", "0.636422", "0.6361087", "0.6355053", "0.6354447", "0.63485307", "0.6347081", "0.63412964", "0.63339293", "0.6333032", "0.6319307", "0.6314582", "0.6309552", "0.63069266", "0.63064045", "0.63004506", "0.6298735", "0.62980056", "0.629789", "0.6297188", "0.62934417", "0.6291354", "0.6290377", "0.6290377", "0.6290377", "0.6290377", "0.6290377", "0.6290377", "0.6290377", "0.62873083", "0.6286766", "0.6273923", "0.6268907", "0.6267814", "0.6264231", "0.6259396", "0.6258663", "0.62559426", "0.62497467", "0.62486017", "0.62446004", "0.6242835", "0.62380505", "0.6235263", "0.62339956" ]
0.0
-1
Returns all possible moves for a player.
List<Move> getLegalMoves(Player player);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<Move> getMovesForPlayer(Player player) {\n\t\tfinal Set<Move> moveList = new HashSet<Move>();\n\t\tfor (Map.Entry<Position, Piece> entry : positionToPieceMap.entrySet()) {\n\t\t\tfinal Position positionFrom = entry.getKey();\n\t\t\tfinal Piece piece = entry.getValue();\n\t\t\tif (player == piece.getOwner()) {\n\t\t\t\tfor (char column = Position.MIN_COLUMN; column <= Position.MAX_COLUMN; column++) {\n\t\t\t\t\tfor (int row = Position.MIN_ROW; row <= Position.MAX_ROW; row++) {\n\t\t\t\t\t\tfinal Position positionTo = new Position(column, row);\n\t\t\t\t\t\tif (!positionFrom.equals(positionTo)) {\n\t\t\t\t\t\t\tfinal Piece possiblePieceOnPosition = getPieceAt(positionTo);\n\t\t\t\t\t\t\tif (possiblePieceOnPosition == null || possiblePieceOnPosition.getOwner() != player) { //can move to free position \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 //or position where enemy is placed\n\t\t\t\t\t\t\t\tif (piece instanceof Pawn) {\n\t\t\t\t\t\t\t\t\tPawn pawn = (Pawn) piece;\n\t\t\t\t\t\t\t\t\tpawn.isValidFightMove(positionFrom, positionTo);\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfinal boolean isKnight = (piece instanceof Knight); // knight can jump over sheets\n\t\t\t\t\t\t\t\tif (piece.isValidMove(positionFrom, positionTo) && !isBlocked(positionFrom, positionTo, isKnight)) {\n\t\t\t\t\t\t\t\t\tmoveList.add(new Move(positionFrom, positionTo));\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\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn moveList;\n\t}", "abstract public List<Move> getPossibleMoves();", "@Override\r\n\tpublic ArrayList<String> allPossibleMoves(boolean whoPlays) {\r\n\t\t\r\n\t\tArrayList<String> Moves = new ArrayList<String>();\r\n\t\t\r\n\t\tif(whoPlays) {\r\n\t\t\tif( (new Board2048model(this)).moveUP()) \r\n\t\t\tMoves.add(\"UP\");\r\n\t\t\tif( (new Board2048model(this)).moveDOWN()) \r\n\t\t\tMoves.add(\"DOWN\");\r\n\t\t\tif( (new Board2048model(this)).moveRIGHT()) \r\n\t\t\tMoves.add(\"RIGHT\");\r\n\t\t\tif( (new Board2048model(this)).moveLEFT()) \r\n\t\t\tMoves.add(\"LEFT\");\r\n\t\t\t}\r\n\t\telse { \r\n\t\t\tfor( int i = 0; i < rows_size ; i++) {\r\n\t\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\t\tif(isEmpty(i,j)) {\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(2)));\r\n\t\t\t\t\t\tMoves.add(new String(Integer.toString(i) + \",\" + Integer.toString(j) + \",\" + Integer.toString(4)));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t}\r\n\treturn Moves;\r\n\t}", "public PossibleMove[] getPossibleMoves(Coordinate from);", "public ArrayList<Move> getPossibleMoves() \n\t{\n\t\tArrayList<Move> possibleMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(int i = - 1; i <= 1; i += 2)\n\t\t{\n\t\t\tfor(int j = -1; j <= 1; j += 2)\n\t\t\t{\n\t\t\t\tLocation currentLoc = new Location(getLoc().getRow() + j, getLoc().getCol() + i);\n\t\t\t\t\n\t\t\t\tif(getBoard().isValid(currentLoc))\n\t\t\t\t{\n\t\t\t\t\tif(getBoard().getPiece(currentLoc) == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tArrayList<Node> move = new ArrayList<Node>();\n\t\t\t\t\t\tmove.add(getNode());\n\t\t\t\t\t\tmove.add(getBoard().getNode(currentLoc));\n\t\t\t\t\t\t\n\t\t\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(ArrayList<Node> move : getNextJumps(getLoc(), new ArrayList<Location>()))\n\t\t{\n\t\t\tif(move.size() > 1)\n\t\t\t{\n\t\t\t\tpossibleMoves.add(new CheckersMove(move, getBoard(), getLoyalty()));\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Move> jumpMoves = new ArrayList<Move>();\n\t\t\n\t\tfor(Move possibleMove : possibleMoves)\n\t\t{\n\t\t\tif(!possibleMove.getJumped().isEmpty())\n\t\t\t{\n\t\t\t\tjumpMoves.add(possibleMove);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!jumpMoves.isEmpty())\n\t\t{\n\t\t\treturn jumpMoves;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn possibleMoves;\n\t\t}\n\t}", "List<ValidMove> getValidMoves();", "public static void getMoves(Player p, GameSquare[][] board) {\n\t\t// keep track of the number of possible moves\n\t\t// and number of unique pieces you could move\n\t\tint moveCount = 0;\n\t\tint uniquePieceCount = 0;\n\n\t\tArrayList<GameSquare> playerSpotsWithPieces = p.places;\n\t\tArrayList<GameSquare> validMoves;\n\n\t\t// for each square with a piece on it\n\t\t// find out where you can move that piece\n\t\tfor (GameSquare currentSquare : playerSpotsWithPieces) {\n\t\t\tvalidMoves = new ArrayList<GameSquare>();\n\n\t\t\t// grab all valid moves from\n\t\t\tvalidMoves.addAll(currentSquare.getValidMoves(board));\n\t\t\tif (validMoves.size() > 0)\n\t\t\t\tuniquePieceCount++;\n\t\t\tfor (GameSquare move : validMoves) {\n\t\t\t\tSystem.out.printf(\"%s at <%d:%d> can move to <%d:%d>\\n\", currentSquare.pieceType(), currentSquare.x,\n\t\t\t\t\t\tcurrentSquare.y, move.x, move.y);\n\t\t\t\tmoveCount++;\n\t\t\t}\n\t\t}\n\n\t\t// print the number of possible moves and number of unique pieces that\n\t\t// can be moved\n\t\tSystem.out.printf(\"%d legal moves (%d unique pieces) for %s player\", moveCount, uniquePieceCount,\n\t\t\t\tp.color.toString().toLowerCase());\n\n\t}", "public ArrayList<PentagoGame> nextPossibleMoves() {\n ArrayList<PentagoGame> children = new ArrayList<>();\n for(int i = 0; i < 6; i++) { // for each row I can place a piece\n for(int j = 0; j < 6; j++) { // for each column\n for(int k = 0; k < 4; k++ ) { // for each board to rotate\n for(int d = 0; d < 2; d ++) {// for each direction to rotate\n boolean leftRotate = false;\n if(d == 0) {\n leftRotate = true;\n }\n Move move = new Move(i, j, k, leftRotate);\n if(validMove(whosTurn(), move)) {\n PentagoGame tempGame = new PentagoGame(this);\n tempGame.playPiece(whosTurn(), move);\n tempGame.rotateBoard(whosTurn(), move);\n tempGame.turnOver();\n move.setGameState(tempGame);\n move.setUtility(calulateUtility(move));\n // todo\n children.add(tempGame);\n }\n }\n }\n }\n }\n\n return children;\n }", "@Override\n public ArrayList<xMCTSStringGameState> getPossibleMoves(xMCTSStringGameState gameState)\n {\n\t ArrayList<xMCTSStringGameState> posMoves = new ArrayList<xMCTSStringGameState>();\n\t if (gameStatus(gameState) == xMCTSGame.status.ONGOING) {\n\t \t String activeCard = gameState.toString().substring(gameState.toString().length() - 2, gameState.toString().length());\n\t \t int gridSize = SIZE*2;\n\t for (int i = 0; i < gridSize; i += 2) {\n\t for (int j = 0; j < gridSize; j += 2) {\n\t int pos = i * SIZE + j;\n\t if (gameState.toString().charAt(pos) == '_') {\n\t String temp = gameState.toString().substring(0, pos)\n\t \t\t + activeCard\n\t + gameState.toString().substring(pos + 2,\n\t gameState.toString().length());\n\t posMoves.add(new xMCTSStringGameState(temp, 0.0, 0));\n\t }\n\t }\n\n\t }\n\t }\n\t else {\n\t \t // System.out.println(\"No moves can be made from this state\");\n\t \t// callsFromFullBoards++;\n\t \t// System.out.println(\"There have been \" + callsFromFullBoards + \"attempts to get possible moves from a full board\");\n\t }\n\t return posMoves;\n }", "private ArrayList<Move> generatePossibleMovesFor(Player player) {\n ArrayList<Point> selfStonePlacements = new ArrayList<>();\n ArrayList<Point> opponentStonePlacements = new ArrayList<>();\n for (int x = 0; x < field.length; x++)\n for (int y = 0; y < field[x].length; y++) {\n if (field[x][y] == null)\n continue;\n if (field[x][y] == this.color)\n selfStonePlacements.add(new FieldPoint(x, y));\n if (field[x][y] == opponent.getColor())\n opponentStonePlacements.add(new FieldPoint(x, y));\n }\n\n ArrayList<Move> possibleMoves = new ArrayList<>();\n\n // Check if player is in set phase or only has three stones left\n if (!player.isDoneSetting()) {\n // Every free field is a possible move\n for (Point point : pointsOfMovement) {\n if (opponentStonePlacements.contains(point) || selfStonePlacements.contains(point))\n continue;\n possibleMoves.add(new StoneMove(null, point));\n }\n } else if (player.isDoneSetting() && getCountOfStonesFor(player) > 3) {\n // Move is only possible if the neighbour field of a stone is free\n for (Point point : player == opponent ? opponentStonePlacements : selfStonePlacements) {\n for (Point neighbour : neighbourPoints.get(point)) {\n if (opponentStonePlacements.contains(neighbour) || selfStonePlacements.contains(neighbour))\n continue;\n possibleMoves.add(new StoneMove(point, neighbour));\n }\n }\n } else {\n for (Point point : player == opponent ? opponentStonePlacements : selfStonePlacements) {\n for (Point another : pointsOfMovement) {\n if (opponentStonePlacements.contains(point) || selfStonePlacements.contains(point))\n continue;\n possibleMoves.add(new StoneMove(point, another));\n }\n }\n }\n\n Collections.shuffle(possibleMoves);\n return possibleMoves;\n }", "public List<Move> getValidMoves(Player player) {\n LinkedList<Move> listOfMoves = new LinkedList<>();\n Pawn aPawn;\n int Size;\n Size = getSize();\n\n //parcours du plateau pour trouver tous les pions de player\n for (int numLine = 0; numLine < Size; numLine++) {\n for (int numCol = 0; numCol < Size; numCol++) {\n\n aPawn = field[numLine][numCol];\n if (aPawn != null) {\n if (aPawn.getPlayer().getColor() == player.getColor()) { //if the pawn belong to player\n addValidMovesAux(numCol, numLine, listOfMoves, player);\n }\n }\n }\n }\n return listOfMoves;\n }", "private Cell[] allPossibleMoves(Cell source) {\n\t\tCell[] moves = new Cell[2 * Board.BOARD_SIZE - 2]; // Вертикаль и горизонталь, которые бьет ладья\n\t\tint columnIndex = source.getColumn();\n\t\tint rowIndex = source.getRow();\n\t\tint k = 0;\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != rowIndex) {\n\t\t\t\tmoves[k++] = new Cell(columnIndex, i);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\tif (i != columnIndex) {\n\t\t\t\tmoves[k++] = new Cell(i, rowIndex);\n\t\t\t}\n\t\t}\n\t\treturn moves;\n\t}", "List<Moves> getMoveSet();", "public List<String> legalMoves() {\n List<String> result = new ArrayList<>();\n for (int col = 1; col < _board.length + 1; col += 1) {\n for (int row = 1; row < _board.length + 1; row += 1) {\n String move = row + \",\" + col;\n if (isLegal(move)) {\n result.add(move);\n }\n }\n }\n return result;\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 }", "@Override\n\tpublic ArrayList<String> getAvailableSolutions(int player) {\n\t\tArrayList<String> moves = new ArrayList<String>();\n\t\tfor (int col = 0; col < board.getCOLS(); ++col) {\n\t\t\tif(validMove(col)){\n\t\t\t\tmoves.add(\"5,\"+col); \n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn moves;\n\t}", "public ArrayList<Cell> getPseudoLegalMoves() {\n\n Cell[][] board = Board.getBoard();\n ArrayList<Cell> moves = new ArrayList<Cell>();\n\n //Possible ways to move a knight\n int[][] possibleOffsets = {{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,1},{2,-1}};\n\n for(int i=0; i<possibleOffsets.length; i++){\n int x = possibleOffsets[i][0] + getRow();\n int y = possibleOffsets[i][1] + getColumn();\n\n //Making sure we dont leave the board\n if(x >= board.length || x < 0\n || y >= board.length || y < 0)\n continue;\n\n //Making sure destination does not contain a friendly piece\n if(Board.containsPieceOfColor(x,y,this.getColor()))\n continue;\n\n moves.add(board[x][y]);\n }\n\n return moves;\n }", "private List<Coordinate> getAvailableMoves(ImmutableGameBoard gameBoard) {\n List<Coordinate> availableMoves = new ArrayList<Coordinate>();\n\n for (int x = 0; x < gameBoard.getWidth(); x++) {\n for (int y = 0; y < gameBoard.getHeight(); y++) {\n if(gameBoard.getSquare(x, y) == TicTacToeGame.EMPTY)\n availableMoves.add(new Coordinate(x, y));\n }\n }\n\n return availableMoves;\n }", "ArrayList<Move> legalMoves() {\n ArrayList<Move> result = new ArrayList<Move>();\n int f, b;\n Move m;\n for (int i = 1; i < 8; i++) {\n for (int j = 1; j < 8; j++) {\n if (get(i,j).side() == _turn) {\n f = forward(j, i);\n b = backward(j, i);\n c = _col[j];\n r = _row[i];\n m = Move.create(j, i, j - b, i - b);\n addMove(result, m);\n m = Move.create(j, i, j + b, i + b);\n addMove(result, m);\n m = Move.create(j, i, j + f, i - f);\n addMove(result, m);\n m = Move.create(j, i, j - f, i + f);\n addMove(result, m);\n m = Move.create(j, i, j + c, i);\n addMove(result, m);\n m = Move.create(j, i, j - c, i);\n addMove(result, m);\n m = Move.create(j, i, j, i + r);\n addMove(result, m);\n m = Move.create(j, i, j, i - r);\n addMove(result, m);\n } else {\n continue;\n }\n }\n }\n return result;\n }", "public void getPossibleMoves() {\n\t\tGameWindow.potentialMoves.clear();\n\t}", "@Override\n public Map<Coordinate, List<Coordinate>> getAllLegalMoves(List<Integer> playerStates) {\n Map<Coordinate, List<Coordinate>> allLegalMoves = new TreeMap<>();\n for (List<GamePiece> row: myGamePieces) {\n for(GamePiece currPiece: row){\n if (playerStates.contains(currPiece.getState()) || currPiece.getState() == myEmptyState) {\n Coordinate currCoord = currPiece.getPosition();\n List<Coordinate> moves = currPiece.calculateAllPossibleMoves(getNeighbors(currPiece), playerStates.get(0));\n if (moves.size() > 0) {\n allLegalMoves.put(currCoord, moves);\n }\n }\n }\n }\n return allLegalMoves;\n }", "public List<ScoredMove> allValidMoves(GameState gm){\n\t\tList<ScoredMove> validMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for draw move\n\t\tif (getDeckSize() > 0) {\n\t\t\tvalidMoves.add(new ScoredMove(ACTION.DRAW, null, null));\n\t\t}\n\t\t/*\n\t\telse {\n\t\t\t// check for discarding move (note: only allowing if decksize is empty)\n\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\tif (!(c instanceof MerchantShip)) {\n\t\t\t\t\tvalidMoves.add(new ScoredMove(ACTION.DISCARD, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\tvalidMoves.addAll(allDiscardMoves(gm));\n\t\t\n\t\t// check for playing merchant ships\n\t\tvalidMoves.addAll(allmShipMoves(gm));\n\t\t\n\t\t// add all attacks\n\t\tvalidMoves.addAll(allAttackMoves(gm));\n\t\t\n\t\tif (super.getVerbosity()) {\n\t\t\tSystem.out.println(\"Valid moves found: \" + validMoves.size());\n\t\t}\n\t\treturn validMoves;\n\t}", "public int[][] legalMoves() {\n return legalMoves[nextPiece];\n }", "public List<IMove> getMoves() {\n List<ICard> hand = hands.get(currentTurn);\n\n List<IMove> moves = new ArrayList<>(hand.size() + 1);\n for (ICard card : hand) {\n if (isValidPlay(card)) {\n moves.addAll(card.getMoves(this));\n }\n }\n\n moves.add(new DrawCardMove(currentTurn));\n\n return moves;\n }", "@Override\n ArrayList<Cell> findPossibleMoves(Cell workerPosition) {\n ArrayList<Cell> neighbors = board.getNeighbors(workerPosition);\n ArrayList<Cell> possibleMoves = new ArrayList<Cell>();\n for (Cell cell : neighbors) {\n // + allow movement to cells occupied by opponents, if they can be pushed away\n Cell nextCell;\n int nextX = cell.getPosX() + (cell.getPosX() - workerPosition.getPosX());\n int nextY = cell.getPosY() + (cell.getPosY() - workerPosition.getPosY());\n try {\n nextCell = board.getCell(nextX, nextY);\n } catch (ArrayIndexOutOfBoundsException e) {\n nextCell = null;\n }\n if ((!cell.hasWorker() || (nextCell != null && !nextCell.hasWorker() && !nextCell.isDomed())) &&\n !cell.isDomed() && (cell.getBuildLevel() <= workerPosition.getBuildLevel() + 1))\n possibleMoves.add(cell);\n //\n }\n return findLegalMoves(workerPosition, possibleMoves);\n }", "public abstract ArrayList<Move> possibleMoves(Board board);", "public PossibleMoves getPossibleMoves(State state){\n if(possibleMoves == null){\n possibleMoves = new PossibleMoves(state);\n }\n return possibleMoves;\n }", "public LinkedList<Move> getPossibleMoves() {\n\t\tAIPossibleMoves.clear();\n\t\tint xOrigin = 0, yOrigin = 0, xMove1 = 0, xMove2 = 0, yMove1 = 0, yMove2 = 0;\n\t\tMove move = null;\t\n\t\t\tint type = 0;\n\t\t\tfor(Checker checker: model.whitePieces) {\n\t\t\t\t\n\t\t\t\txOrigin = checker.getCurrentXPosition();\n\t\t\t\tyOrigin = checker.getCurrentYPosition();\n\t\t\t\txMove1 = (checker.getCurrentXPosition() - 1);\n\t\t\t\txMove2 = (checker.getCurrentXPosition() + 1);\n\t\t\t\tyMove1 = (checker.getCurrentYPosition() - 1);\n\t\t\t\tyMove2 = (checker.getCurrentYPosition() + 1);\n\t\t\t\ttype = checker.getType();\n\t\t\t\tswitch(type) {\n\t\t\t\tcase 2:\n\n\t\t\t\t\tif((xMove1 < 0) || (yMove1 <0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t\t//System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \n\t\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t\t// System.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t\t//Moving up and left isMovingRight,IsMovingDown\n\t\t\t\t\tif((xMove1 <0) || (yMove1 < 0)) {\n\t\t\t\t\t\t//continue;\n\t\t\t\t\t} else {\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove1, false, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove1, false, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove1 < 0)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving up and right\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove1, true, false )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove1)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove1,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove1, true, false)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove1);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove1 < 0) || (yMove2 > 7)) {\n\t\t\t\t//\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//moving down and left isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove1, yMove2, false, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove1,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove1,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove1, yMove2, false, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove1, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((xMove2 > 7) || (yMove2 > 7)) {\n\t\t\t\t\t//continue;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t//moving down and right isMovingRight,IsMovingDown\n\t\t\t\t\tif(isMoveValid(xOrigin,yOrigin, xMove2, yMove2, true, true )) {\n\t\t\t\t\t\tif(!isSpaceTaken(xMove2,yMove2)) {\n\t\t\t\t\t\t//\tSystem.out.println(\"Space is not Taken\");\n\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(isPieceEnemy(xMove2,yMove2,checker,2)) {\n\t\t\t\t\t\t\t\tif(isJumpValid(xOrigin, yOrigin, xMove2, yMove2, true, true)) {\n\t\t\t\t\t\t\t\t\tmove = new Move(xOrigin, yOrigin, xMove2, yMove2);\n\t\t\t\t\t\t\t\t\tAIPossibleMoves.add(move);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tbreak;\t\n\t\t\t\t}\t\n\t\t\t\n\t\t\t}\n\n\t\t\treturn AIPossibleMoves;\n\t\t\t\n\t\t}", "public static int[][] getAllBasicMoves(int[][] board, int player) {\r\n\t\t\r\n\t\tint[][] moves = new int [0][4];\r\n\t\tint[][] SaveMoves = new int [0][4];/*save our moves of the soldures*/\r\n\t\tint[][] positions = playerDiscs(board,player);\r\n\t\tint SumAllMove=0;/*varibel ho count all the posible moves*/\r\n\t\t\r\n\t\tfor(int IPD=0;IPD<positions.length;IPD=IPD+1){/*running on all the solduers*/\r\n\t\t\t//tow loops running in the 4 moves of the soldures\r\n\t\t\tfor(int indxMove1=-1;indxMove1<2;indxMove1=indxMove1+2){\r\n\t\t\t\tfor(int indxMove2=-1;indxMove2<2;indxMove2=indxMove2+2){\r\n\t\t\t\t\tboolean MovePossible = isBasicMoveValid(board,player,positions[IPD][0],positions[IPD][1],positions[IPD][0]+indxMove1,positions[IPD][1]+indxMove2);/*is the move is legal*/\r\n\t\t\t\t\tif (MovePossible){/*if the move legal enter the move in the arry*/\r\n\t\t\t\t\t\tSumAllMove=SumAllMove+1;\r\n\t\t\t\t\t\tSaveMoves = moves;\r\n\t\t\t\t\t\tmoves = new int [SumAllMove][4];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][0]=positions[IPD][0];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][1]=positions[IPD][1];\r\n\t\t\t\t\t\tmoves [SumAllMove-1][2]=positions[IPD][0]+indxMove1;\r\n\t\t\t\t\t\tmoves [SumAllMove-1][3]=positions[IPD][1]+indxMove2;\r\n\t\t\t\t\t\tif (SumAllMove>1) {\r\n\t\t\t\t\t\t\tfor (int idxSAM1=SumAllMove-2;idxSAM1>-1;idxSAM1=idxSAM1-1){\r\n\t\t\t\t\t\t\tfor (int idxSAM2=0;idxSAM2<4;idxSAM2=idxSAM2+1){\r\n\t\t\t\t\t\t\t\tmoves[idxSAM1][idxSAM2]=SaveMoves[idxSAM1][idxSAM2];\r\n\t\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\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn moves;\r\n\t}", "public int[] getPlayableMovesNaive() {\n\t\tint ret[];\n\t\t\n\t\tint curNumPlayable = 0;\n\t\t\n\t\tfor(int i=0; i<Constants.SIZE; i++) {\n\t\t\tfor(int j=0; j<Constants.SIZE; j++) {\n\t\t\t\tif(P1turn && P1Movable[i][j]) {\n\t\t\t\t\tcurNumPlayable++;\n\t\t\t\t} else if(P1turn == false && P2Movable[i][j]) {\n\t\t\t\t\tcurNumPlayable++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tret = new int[curNumPlayable];\n\t\tcurNumPlayable = 0;\n\t\t\n\t\tfor(int i=0; i<Constants.SIZE; i++) {\n\t\t\tfor(int j=0; j<Constants.SIZE; j++) {\n\t\t\t\tif(P1turn && P1Movable[i][j]) {\n\t\t\t\t\tret[curNumPlayable] = i * Constants.SIZE + j;\n\t\t\t\t\tcurNumPlayable++;\n\t\t\t\t\t\n\t\t\t\t} else if(P1turn == false && P2Movable[i][j]) {\n\t\t\t\t\tret[curNumPlayable] = i * Constants.SIZE + j;\n\t\t\t\t\tcurNumPlayable++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public List<Board> neighbors(int player)\n\t{\n\t\tList<Board> ret = new ArrayList<Board>();\n\t\t\n\t\tList<Integer> moves = getLegalMoves();\n\t\tfor (int i : moves)\n\t\t{\n\t\t\tret.add(makeMove(i,player));\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "public List<BoardPos> getMoves(BoardPos from) {\n List<BoardPos> result;\n\n // strike check\n if (board.get(from).isCrown())\n result = getStrikesCrown(from);\n else result = getStrikes(from);\n\n // regular moves\n final int[] shifts = {-1, 1};\n if (result.isEmpty() && !board.get(from).isEmpty()) {\n if (board.get(from).isCrown())\n for (int shiftX : shifts)\n for (int shiftY : shifts) {\n BoardPos to = from.add(shiftX, shiftY);\n while (to.inBounds(board.side()) && board.get(to).isEmpty()) {\n result.add(to);\n to = to.add(shiftX, shiftY);\n }\n }\n else for (int shift : shifts) { // add adjacent empty positions\n BoardPos move = from.add(new BoardPos(shift,\n board.get(from).color() ? 1 : -1));\n if (board.get(move) != null && board.get(move).isEmpty())\n result.add(new BoardPos(move));\n } }\n\n // complete by adding the start position to every legal route, so that\n // it will be cleared as well when the player will move\n for (BoardPos pos : result)\n pos.addToRoute(new BoardPos(from));\n\n return result;\n }", "public Move[] getAllPossibleMoves(boolean isWhitesMove)\r\n\t{\r\n\t\tArrayList<Move> legalMoves = new ArrayList<Move>();\r\n\r\n\t\tPiece[] piecesToMove = isWhitesMove ? whitePieces : blackPieces;\r\n\t\tfor (int i = 0; i < piecesToMove.length; i++)\r\n\t\t{\r\n\t\t\tlegalMoves.addAll(getPieceMove(piecesToMove[i]));\r\n\t\t}\r\n\r\n\t\tlegalMoves.trimToSize();\r\n\t\tMove[] moves = legalMoves.toArray(new Move[legalMoves.size()]);\r\n\t\tisKingCheck(moves, isWhitesMove);\r\n\t\treturn moves;\r\n\t}", "protected abstract Collection<Direction> getDirections(Position position, Player player) ;", "@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}", "public Set<Line> getPossibleMoves(Square[][] board) {\n Set<Line> empty = new HashSet<Line>();\n return getPossibleMoves(board, empty, 0);\n }", "Iterator<BoardPosition> possibleMovingPositions(BoardPosition from, Game game, Map<BoardPosition, Piece> pieceMap);", "@Override\n\tpublic List<Move> getPossibleMoves(Chessboard chessboard) {\n\t\tthrow new UnsupportedOperationException(\"Not supported yet.\");\n\t}", "protected List<Move> getMoves() {\n return moves;\n }", "public List<Move> getValidMoves(TileState playerColor) {\r\n\t\tfinal long validMoveMask = playerColor == TileState.DARK ? legalDarkMoves : legalLightMoves;\r\n\t\tMove[] validMoves = new Move[Long.bitCount(validMoveMask)];\r\n\t\tint counter = 0;\r\n\t\tint highestOneIndex = 64 - Long.numberOfLeadingZeros(validMoveMask);\r\n\t\tfor (int i = Long.numberOfTrailingZeros(validMoveMask); i < highestOneIndex; i++) {\r\n\t\t\tif (((0x1L << i) & validMoveMask) != 0L) {\r\n\t\t\t\tvalidMoves[counter] = MovePool.pool[i];\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Arrays.asList(validMoves);\r\n\t}", "public List<Position> getAllMoves(Board chessBoard) {\n return getAllDiscreteMoves(chessBoard);\n }", "private void generateLegalMovesPlayer(char player) {\r\n\r\n\t\t// loop through the unitLIst and generate all the moves a player can make\r\n\t\tfor (Unit unit : this.unitList) {\r\n\t\t\tif (unit != null && unit.getColor() == player) {\r\n\t\t\t\tunit.getLegalMoves();\r\n\t\t\t\tinsertMovesIntoMoveList(unit, unit.getMoveList());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public List<Integer> GetMoves() {\n return GetMoves(true, true, true, Settings.MaxVolcanoLevel);\n }", "ArrayList<Move> getMoves() {\n ArrayList<Move> result = new ArrayList<>();\n getMoves(result);\n return result;\n }", "@Override\n\tpublic List<Point> getAvailableMoves() {\n\t\treturn new ArrayList<Point>();\n\t}", "public List<Integer> getLegalMoves()\n\t{\n\t\tArrayList<Integer> moves = new ArrayList<Integer>();\n\t\tfor (int col = 0; col < cols; col++)\n\t\t{\n\t\t\tif (isEmpty(0,col))\n\t\t\t\tmoves.add(col);\n\t\t}\n\t\treturn moves;\n\t}", "public List<Move> getMoves(ChessBoard chessBoard) {\r\n\t\tList<Move> moves = new ArrayList<>();\r\n\t\tfor (Direction direction : directions) {\r\n\t\t\tfor (int n = 1; n <= maxRange ; n++) {\r\n\t\t\t\tMove move = new Move(x, y, direction, n);\r\n\t\t\t\tif (chessBoard.allows(move)) {\r\n\t\t\t\t\tif (move.isTake(chessBoard)) {\r\n\t\t\t\t\t\tTakeMove takeMove = new TakeMove(x, y, direction, n);\r\n\t\t\t\t\t\ttakeMove.setPiece(this);\r\n\t\t\t\t\t\tPiece pieceAtDestination = chessBoard.pieceAtField(move.getToX(), move.getToY());\r\n\t\t\t\t\t\ttakeMove.setTaken(pieceAtDestination);\r\n\t\t\t\t\t\tmoves.add(takeMove);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmove.setPiece(this);\r\n\t\t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn moves;\r\n\t}", "public static int[][] getAllBasicJumps(int[][] board, int player) {\r\n\t\t\t\r\n\t\tint[][] moves = new int [0][4];\r\n\t\tint[][] SaveMoves = new int [0][4]; /*save our moves of the soldures*/\r\n\t\tint[][] positions = playerDiscs(board,player);\r\n\t\tint SumAllJump=0; /*varibel ho count all the posible Jumps*/\r\n\t\t\t\r\n\t\tfor(int IPD=0;IPD<positions.length;IPD=IPD+1){/*running on all the solduers*/\r\n\t\t\t/*Building an array with all the move possible for a specific soldier*/\r\n\t\t\tint[][] JumpsPossible = getRestrictedBasicJumps (board,player,positions[IPD][0],positions[IPD][1]); \r\n\t\t\t/*if the move legal enter the move in the arry*/\r\n\t\t\tif (JumpsPossible.length>0){/*If the soldier has jumps legality, From one with jumps by other soldiers*/\t\t\t\t\r\n\t\t\t\tSumAllJump=SumAllJump+JumpsPossible.length;\r\n\t\t\t\tSaveMoves = moves;\r\n\t\t\t\tmoves = new int [SumAllJump][4];\r\n\t\t\t\tif (SumAllJump>1) {\r\n\t\t\t\t\tfor (int idxSAM1=SaveMoves.length-1;idxSAM1>-1;idxSAM1=idxSAM1-1){\r\n\t\t\t\t\t\tfor (int idxSAM2=0;idxSAM2<4;idxSAM2=idxSAM2+1){\r\n\t\t\t\t\t\t\tmoves[idxSAM1][idxSAM2]=SaveMoves[idxSAM1][idxSAM2];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\tfor(int indx=0;indx<JumpsPossible.length;indx=indx+1){\r\n\t\t\t\t\tmoves [moves.length-JumpsPossible.length+indx][0]=JumpsPossible [indx][0];\r\n\t\t\t\t\tmoves [moves.length-JumpsPossible.length+indx][1]=JumpsPossible [indx][1];\r\n\t\t\t\t\tmoves [moves.length-JumpsPossible.length+indx][2]=JumpsPossible [indx][2];\r\n\t\t\t\t\tmoves [moves.length-JumpsPossible.length+indx][3]=JumpsPossible [indx][3];\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn moves;\r\n\t}", "public Iterator<Move> getMoves() {\n\t\treturn new MoveSetIterator<CMNMove>(movesLeft);\n\t}", "public List<Player> getAvailablePlayers(Round round) {\r\n\t\tList<Player> availablePlayers = playerLogic.createNew(round.getPlayers());\r\n\r\n\t\tfor (Match match : round.getMatches()) {\r\n\t\t\tavailablePlayers.removeAll(match.getHomeTeam());\r\n\t\t\tavailablePlayers.removeAll(match.getAwayTeam());\r\n\t\t}\r\n\t\treturn availablePlayers;\r\n\t}", "public static int[][] getPlayerFullMove(int[][] board, int player) {\r\n\t\t// Get first move/jump\r\n\t\tint fromRow = -1, fromCol = -1, toRow = -1, toCol = -1;\r\n\t\tboolean jumpingMove = canJump(board, player);\r\n\t\tboolean badMove = true;\r\n\t\tgetPlayerFullMoveScanner = new Scanner(System.in);//I've modified it\r\n\t\twhile (badMove) {\r\n\t\t\tif (player == 1){\r\n\t\t\t\tSystem.out.println(\"Red, Please play:\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Blue, Please play:\");\r\n\t\t\t}\r\n\r\n\t\t\tfromRow = getPlayerFullMoveScanner.nextInt();\r\n\t\t\tfromCol = getPlayerFullMoveScanner.nextInt();\r\n\r\n\t\t\tint[][] moves = jumpingMove ? getAllBasicJumps(board, player) : getAllBasicMoves(board, player);\r\n\t\t\tmarkPossibleMoves(board, moves, fromRow, fromCol, MARK);\r\n\t\t\ttoRow = getPlayerFullMoveScanner.nextInt();\r\n\t\t\ttoCol = getPlayerFullMoveScanner.nextInt();\r\n\t\t\tmarkPossibleMoves(board, moves, fromRow, fromCol, EMPTY);\r\n\r\n\t\t\tbadMove = !isMoveValid(board, player, fromRow, fromCol, toRow, toCol); \r\n\t\t\tif (badMove)\r\n\t\t\t\tSystem.out.println(\"\\nThis is an illegal move\");\r\n\t\t}\r\n\r\n\t\t// Apply move/jump\r\n\t\tboard = playMove(board, player, fromRow, fromCol, toRow, toCol);\r\n\t\tshowBoard(board);\r\n\r\n\t\t// Get extra jumps\r\n\t\tif (jumpingMove) {\r\n\t\t\tboolean longMove = (getRestrictedBasicJumps(board, player, toRow, toCol).length > 0);\r\n\t\t\twhile (longMove) {\r\n\t\t\t\tfromRow = toRow;\r\n\t\t\t\tfromCol = toCol;\r\n\r\n\t\t\t\tint[][] moves = getRestrictedBasicJumps(board, player, fromRow, fromCol);\r\n\r\n\t\t\t\tboolean badExtraMove = true;\r\n\t\t\t\twhile (badExtraMove) {\r\n\t\t\t\t\tmarkPossibleMoves(board, moves, fromRow, fromCol, MARK);\r\n\t\t\t\t\tSystem.out.println(\"Continue jump:\");\r\n\t\t\t\t\ttoRow = getPlayerFullMoveScanner.nextInt();\r\n\t\t\t\t\ttoCol = getPlayerFullMoveScanner.nextInt();\r\n\t\t\t\t\tmarkPossibleMoves(board, moves, fromRow, fromCol, EMPTY);\r\n\r\n\t\t\t\t\tbadExtraMove = !isMoveValid(board, player, fromRow, fromCol, toRow, toCol); \r\n\t\t\t\t\tif (badExtraMove)\r\n\t\t\t\t\t\tSystem.out.println(\"\\nThis is an illegal jump destination :(\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply extra jump\r\n\t\t\t\tboard = playMove(board, player, fromRow, fromCol, toRow, toCol);\r\n\t\t\t\tshowBoard(board);\r\n\r\n\t\t\t\tlongMove = (getRestrictedBasicJumps(board, player, toRow, toCol).length > 0);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn board;\r\n\t}", "public abstract HashSet<Location> getPossibleMovements(GameBoard board);", "static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}", "public List<Player> findAllPlayers(){\n\t\treturn playerRepository.findAll();\n\t}", "public ArrayList<Point> moves() {\n\t\tmoves = new ArrayList<Point>();\n\t\tif (point.x > 0 && board.pieceAt(point.x - 1, point.y) == null)\n\t\t\tmoves.add(board.left(point));\n\t\tif (point.x < board.getXDim() - 1 && board.pieceAt(point.x + 1, point.y) == null)\n\t\t\tmoves.add(board.right(point));\n\t\tif (point.y > 0 && board.pieceAt(point.x, point.y - 1) == null)\n\t\t\tmoves.add(board.above(point));\n\t\tif (point.y < board.getYDim() - 1 && board.pieceAt(point.x, point.y + 1) == null)\n\t\t\tmoves.add(board.below(point));\n\t\treturn (ArrayList<Point>) moves.clone();\n\t}", "List<Move> legalMoves(Piece side) {\r\n legalMovesArr = new ArrayList<Move>();\r\n HashSet<Square> pieceSide = pieceLocations(side);\r\n for (Square pieces : pieceSide) {\r\n for (int i = 0; i <= 8; i++) {\r\n Move x = mv(pieces, sq(pieces.col(), i));\r\n legalMovesArr.add(x);\r\n }\r\n for (int j = 0; j <= 8; j++) {\r\n Move y = mv(pieces, sq(j, pieces.row()));\r\n legalMovesArr.add(y);\r\n }\r\n while (legalMovesArr.remove(null));\r\n }\r\n return legalMovesArr;\r\n }", "@Override\n public void getMoves(ArrayList<Move> moves) {\n // WARNING: This function must not return duplicate moves\n moves.clear();\n\n for (int i = 0; i < 81; ++i) {\n if (board[i] == currentPlayer) {\n getMovesSingleStep(moves, i);\n getMovesJump(moves, i, i);\n }\n }\n }", "public List<RubiksMove> getSolutionMoves() {\n return solutionMoves;\n }", "public List<MoveTicket> getValidSingleMovesAtLocation(Colour player, int location);", "public ArrayList<Move> availableMoves() {\n if (getColour() == PieceCode.WHITE)\n return whiteKing();\n else\n return blackKing();\n }", "public List<ScoredMove> allmShipMoves(GameState gm){\n\t\t\n\t\tList<ScoredMove> mShipMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\tif (getHand().hasMShip()) {\n\t\t\tfor (Card c: getHand().getCards()) {\n\t\t\t\tif (c instanceof MerchantShip) {\n\t\t\t\t\tmShipMoves.add(new ScoredMove(ACTION.PLAY_MERCHANT_SHIP, c, null));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn mShipMoves;\n\t}", "public Collection<Board> getNextBoards(final Player player) {\r\n\t\treturn board.getNextBoards(player);\r\n\t}", "public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}", "public String[] getPossibleMoves(Position p)\r\n\t{\r\n\t\tint x,y,z,counter = 0; \r\n\t\tString[] moves;\r\n\t\t\r\n\t\tx = p.getX();\r\n\t\ty = p.getY();\r\n\t\tz = p.getZ();\r\n\t\t\r\n\t\tif(y+1 < maze.length)\r\n\t\t\tif(this.maze[y+1][z][x] == 0)\r\n\t\t\t\tcounter++;\r\n\t\tif(y-1 >= 0)\r\n\t\t\tif(this.maze[y-1][z][x] == 0)\r\n\t\t\t\tcounter++;\r\n\t\tif(z+1 < maze[0].length)\r\n\t\t\tif(this.maze[y][z+1][x] == 0)\r\n\t\t\t\tcounter++;\r\n\t\tif(z-1 >= 0)\r\n\t\t\tif(this.maze[y][z-1][x] == 0)\r\n\t\t\t\tcounter++;\r\n\t\tif(x+1 < maze[0][0].length)\r\n\t\t\tif(this.maze[y][z][x+1] == 0)\r\n\t\t\t\tcounter++;\r\n\t\tif(x-1 >= 0)\r\n\t\t\tif(this.maze[y][z][x-1] == 0)\r\n\t\t\t\tcounter++;\r\n\t\t\r\n\t\tmoves = new String[counter];\r\n\t\tint j = 0;\r\n\t\t\r\n\t\tif(y+1 < maze.length)\r\n\t\t\tif(this.maze[y+1][z][x] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Up\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\tif(y-1 >= 0)\r\n\t\t\tif(this.maze[y-1][z][x] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Down\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\tif(z+1 < maze[0].length)\r\n\t\t\tif(this.maze[y][z+1][x] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Forward\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\tif(z-1 >= 0)\r\n\t\t\tif(this.maze[y][z-1][x] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Backward\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\tif(x+1 < maze[0][0].length)\r\n\t\t\tif(this.maze[y][z][x+1] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Right\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\tif(x-1 >= 0)\r\n\t\t\tif(this.maze[y][z][x-1] == 0)\r\n\t\t\t{\r\n\t\t\t\tmoves[j] = \"Left\";\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\r\n\t\treturn moves;\r\n\t\t\r\n\t}", "static List<Move> generateLegalMoves(Position pos) {\n\t\tList<Move> moves = new ArrayList<>();\n\n\t\t// for (int square : pos.pieces) {\n\t\t// \tif (pos.pieces.size() > 32) {\n\t\t// \t\tSystem.out.println(\"problem\" + pos.pieces.size());\n\t\t// \t}\n\t\t// \tif (pos.at(square) != 0 && Piece.isColor(pos.at(square), pos.toMove)) {\n\t\t// \t\tint piece = pos.at(square);\n\t\t// \t\tint name = Piece.name(piece);\n\t\t// \t\tif (name == Piece.Pawn) {\n\t\t// \t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t// \t\t\tif (square + step >= 0 && square + step < 64) {\n\t\t// \t\t\t\t// 1 square\n\t\t// \t\t\t\tif (pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'q'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'b'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'n'));\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step, 'r'));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + step));\n\t\t// \t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\n\t\t// \t\t\t\t// 2 squares\n\t\t// \t\t\t\tif ((square < 16 && pos.toMove == 'w') || square > 47 && pos.toMove == 'b') {\n\t\t// \t\t\t\t\tif (pos.board.squares[square + 2*step] == 0 && pos.board.squares[square + step] == 0) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, square + 2*step));\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t\t// capture\n\t\t// \t\t\t\t// right\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][3] > 0) {\n\t\t// \t\t\t\t\tint target = square + step + 1;\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\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\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\t\t\t\n\t\t// \t\t\t\t\t} \n\t\t// \t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\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// left\n\t\t// \t\t\t\tif (MoveData.DistanceToEdge[square][2] > 0) {\n\t\t// \t\t\t\t\tint target = square + step - 1;\n\t\t// \t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && square >= 48) || (pos.toMove == 'b' && square <= 15)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'q'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'b'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'n'));\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target, 'r'));\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\tmoves.add(new Move(square, target));\n\t\t// \t\t\t\t\t\t}\t\t\t\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t// \t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t// \t\t\t\t\t\t\tmoves.add(new Move(square, target));\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\t\t\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\tfor (int offset : MoveData.KnightOffsets.get(square)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\tif (!Piece.isColor(pos.board.squares[square + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tMove move = new Move(square, square + offset);\n\t\t// \t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t// \t\t\t\t}\t\n\t\t// \t\t\t}\t\t\t\t\t\n\t\t// \t\t}\n\t\t// \t\telse {\n\t\t// \t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t// \t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t// \t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t// \t\t\t\tint maxDist = MoveData.DistanceToEdge[square][dir];\n\t\t// \t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\n\t\t// \t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t// \t\t\t\t\tint squareIdx = square + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t// \t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t// \t\t\t\t\t\tmoves.add(new Move(square, squareIdx));\n\t\t// \t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\n\t\t// \t\t\t\t\t\t\tbreak;\n\t\t// \t\t\t\t\t\t}\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t\telse {\n\t\t// \t\t\t\t\t\tbreak;\n\t\t// \t\t\t\t\t}\n\t\t// \t\t\t\t}\t\t\t\t\t\t\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t\t// \t}\n\t\t// }\n\n\t\tfor (int i = 0; i < 64; i++) {\n\t\t\tif (pos.board.squares[i] != 0 && Piece.isColor(pos.board.squares[i], pos.toMove)) {\n\t\t\t\tint piece = pos.board.squares[i];\n\t\t\t\tint name = Piece.name(piece);\n\t\t\t\tif (name == Piece.Pawn) {\n\t\t\t\t\tint step = pos.toMove == 'w' ? MoveData.Up : MoveData.Down;\n\t\t\t\t\tif (i + step >= 0 && i + step < 64) {\n\t\t\t\t\t\t// 1 square\n\t\t\t\t\t\tif (pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'q'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'b'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'n'));\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step, 'r'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + step));\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 2 squares\n\t\t\t\t\t\tif ((i < 16 && pos.toMove == 'w') || i > 47 && pos.toMove == 'b') {\n\t\t\t\t\t\t\tif (pos.board.squares[i + 2*step] == 0 && pos.board.squares[i + step] == 0) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, i + 2*step));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t// capture\n\t\t\t\t\t\t// right\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][3] > 0) {\n\t\t\t\t\t\t\tint target = i + step + 1;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\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\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\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// left\n\t\t\t\t\t\tif (MoveData.DistanceToEdge[i][2] > 0) {\n\t\t\t\t\t\t\tint target = i + step - 1;\n\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[target], Opposite(pos.toMove))) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && i >= 48) || (pos.toMove == 'b' && i <= 15)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'q'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'b'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'n'));\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target, 'r'));\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\tmoves.add(new Move(i, target));\n\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (target == pos.enPassantTarget) {\n\t\t\t\t\t\t\t\tif ((pos.toMove == 'w' && target > 32) || (pos.toMove == 'b' && target < 24)) {\n\t\t\t\t\t\t\t\t\tmoves.add(new Move(i, target));\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\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (name == Piece.Knight) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor (int offset : MoveData.KnightOffsets.get(i)) {\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[i + offset], pos.toMove)) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tMove move = new Move(i, i + offset);\n\t\t\t\t\t\t\tmoves.add(move);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint dirStart = name == Piece.Bishop ? 4 : 0;\n\t\t\t\t\tint dirEnd = name == Piece.Rook ? 4 : 8;\n\t\t\t\t\tfor (int dir = dirStart; dir < dirEnd; dir++) {\n\t\t\t\t\t\tint maxDist = MoveData.DistanceToEdge[i][dir];\n\t\t\t\t\t\tint dist = name == Piece.King ? Math.min(1, maxDist) : maxDist;\n\t\t\t\t\t\tfor (int steps = 1; steps <= dist; steps++) {\n\t\t\t\t\t\t\tint squareIdx = i + steps * MoveData.Offsets[dir];\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!Piece.isColor(pos.board.squares[squareIdx], pos.toMove)) {\n\t\t\t\t\t\t\t\tmoves.add(new Move(i, squareIdx));\n\t\t\t\t\t\t\t\tif (Piece.isColor(pos.board.squares[squareIdx], Opposite(pos.toMove))) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// castling\t\t\n\t\tif (pos.toMove == 'w' && !underAttack(pos, pos.whiteKing, 'b')) {\t\t\t\n\t\t\tif (pos.castlingRights.whiteKingSide && pos.at(Board.H1) == (Piece.Rook | Piece.White)) {\n\t\t\t\tif (pos.at(Board.F1) == Piece.Empty && pos.at(Board.G1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F1, 'b') && !underAttack(pos, Board.G1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.G1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif (pos.castlingRights.whiteQueenSide && pos.at(Board.A1) == (Piece.Rook | Piece.White)) {\t\t\t\t\n\t\t\t\tif (pos.at(Board.B1) == Piece.Empty && pos.at(Board.C1) == Piece.Empty && pos.at(Board.D1) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D1, 'b') && !underAttack(pos, Board.C1, 'b')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E1, Board.C1));\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\telse if (pos.toMove == 'b' && !underAttack(pos, pos.blackKing, 'w')){\n\t\t\tif (pos.castlingRights.blackKingSide && pos.at(Board.H8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.F8) == Piece.Empty && pos.at(Board.G8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.F8, 'w') && !underAttack(pos, Board.G8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.G8));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pos.castlingRights.blackQueenSide && pos.at(Board.A8) == (Piece.Rook | Piece.Black)) {\n\t\t\t\tif (pos.at(Board.B8) == Piece.Empty && pos.at(Board.C8) == Piece.Empty && pos.at(Board.D8) == Piece.Empty) {\n\t\t\t\t\tif (!underAttack(pos, Board.D8, 'w') && !underAttack(pos, Board.C8, 'w')) {\n\t\t\t\t\t\tmoves.add(new Move(Board.E8, Board.C8));\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// filter illegal moves\n\t\tList<Move> legalMoves = new ArrayList<>();\n\t\tchar color = pos.toMove;\n\t\tfor (Move move : moves) {\n\t\t\tpos.makeMove(move);\n\t\t\tif (!kingInCheck(pos, color)) {\n\t\t\t\tlegalMoves.add(move);\n\t\t\t}\t\t\t\n\t\t\tpos.undoMove();\n\t\t}\n\n\t\treturn legalMoves;\n\t}", "public ArrayList<Tile> getAllLegalMoves(PrimaryColor playerColor) {\n\n\t\tLinkedHashSet<Tile> possibleTileSet = new LinkedHashSet<Tile>();\n\n\t\tArrayList<Piece> colorPieces = getColorPieces(playerColor);\n\t\tfor(Piece p : colorPieces) {\n\t\t\tpossibleTileSet.addAll(p.getPossibleMoves(playerColor));\n\t\t}\n\t\tArrayList<Tile> possibleTiles= new ArrayList<Tile>(possibleTileSet);\n\t\treturn possibleTiles;\n\t}", "@Override\n public Collection<Move> calculateLegalMoves(Board board) {\n System.out.println(\"INSIDE Knight: calculateLegalMoves()\");\n System.out.println(\"------------------------------>\\n\");\n\n //ArrayList of moves used to store all possible legal moves.\n final List<Move> legalMoves = new ArrayList<>();\n\n //Iterate the constant class array of piece offsets.\n for(final int currentCandidate : CANDIDATE_MOVE_COORDS){\n //Add the current coordinate of the piece to each offset, storing as a destination coordinate.\n final int candidateDestinationCoord = this.piecePosition + currentCandidate;\n\n //If the destination coordinate is within legal board bounds (between 0 and 64)...\n if(BoardUtils.isValidCoord(candidateDestinationCoord)){\n //Check to see if the piece is in the first column and its destination would move it outside the board.\n if(isfirstColumnExclusion(this.piecePosition, currentCandidate) ||\n isSecondColumnExclusion(this.piecePosition, currentCandidate) ||\n isSeventhColumnExclusion(this.piecePosition, currentCandidate) ||\n isEighthColumnExclusion(this.piecePosition, currentCandidate)){\n continue; //Continue the loop if any of these methods return true\n }\n\n //Store the tile of the destination coordinate.\n final Tile candidateDestinationTile = board.getTile(candidateDestinationCoord);\n\n //If the tile is not marked as occupied by the Tile class...\n if(!candidateDestinationTile.isOccupied()){\n //Add the move to the list of legal moves as a non-attack move.\n legalMoves.add(new MajorMove(board, this, candidateDestinationCoord));\n }\n else{\n //Otherwise, get the type and alliance of the piece at the destination.\n final Piece pieceAtDestination = candidateDestinationTile.getPiece();\n final Alliance pieceAlliance = pieceAtDestination.getPieceAlliance();\n\n //If the piece at the occupied tile's alliance differs...\n if(this.pieceAlliance != pieceAlliance){\n //Add the move to the list of legal moves as an attack move.\n legalMoves.add(new MajorAttackMove(board, this, candidateDestinationCoord, pieceAtDestination));\n }\n }\n }\n }\n\n //Return the list of legal moves.\n return legalMoves;\n }", "Iterator<Move> legalMoves() {\n return new MoveIterator();\n }", "public List<Grid> getPossibleMoves(Grid g){\n\t\tint i=g.row, j=g.col;\n\t\tif(i>=0 && i<data.length && j>=0 && j<data[i].length){\n\t\t\tList<Grid> list=new ArrayList<>();\n\t\t\tif(isFree(i, j-1)) list.add(new Grid(i,j-1));\n\t\t\tif(isFree(i-1, j-1)) list.add(new Grid(i-1,j-1));\n\t\t\tif(isFree(i-1, j)) list.add(new Grid(i-1,j));\n\t\t\tif(isFree(i-1, j+1)) list.add(new Grid(i-1,j+1));\n\t\t\tif(isFree(i, j+1)) list.add(new Grid(i,j+1));\n\t\t\tif(isFree(i+1, j+1)) list.add(new Grid(i+1,j+1));\n\t\t\tif(isFree(i+1, j)) list.add(new Grid(i+1,j));\n\t\t\tif(isFree(i+1, j-1)) list.add(new Grid(i+1,j-1));\n\t\t\treturn list;\n\t\t}\n\t\treturn null;\n\t}", "public Collection<Move> getLegalMoves(){\n return legalMoves;\n }", "public void getPossibleMoves() { \n\t\t\tsuper.getPossibleMoves();\n\t\t\tfor (int i = 0; i < Math.abs(xrange); i++) {\n\t\t\t\tif (currentx + xrange - ((int) Math.pow(-1,color)*i) >= 0) { \n\t\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + xrange - ((int) Math.pow(-1,color)*i) ][currenty]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( currentx - 1 >= 0 && currenty - 1 >= 0 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1].isOccupiedByOpponent()) {\t// Diagonol left space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty - 1]);\n\t\t\t}\n\t\t\tif (currentx - 1 >= 0 && currenty + 1 <= 7 &&\n\t\t\t\t\tGameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1].isOccupiedByOpponent()) { \t//Diagonol right space occupied\n\t\t\t\tGameWindow.potentialMoves.add(GameWindow.GridCells[currentx + ((int) Math.pow(-1,color)) ][currenty + 1]);\n\t\t\t}\n\t\t\t\n\t}", "public Collection<Key> getAllPossibleMoves(Key currentKey,\n\t\t\tint numberGeneratedSoFarLength) {\n\n\t\tif (KeyPad.isFirstTwoRows(currentKey)) {\n\t\t\tif (isFirstMove(numberGeneratedSoFarLength)) {\n\t\t\t\taddTwoStepForwardToPositionCache(currentKey);\n\t\t\t} else if (isSecondMove(numberGeneratedSoFarLength)) {\n\t\t\t\tremoveTwoStepForwardFromPositionCache(currentKey);\n\t\t\t}\n\t\t}\n\n\t\treturn positionCache.get(currentKey);\n\t}", "List<Move> findByGameAndPlayer(Game game, Player player);", "public String [] getMoves() {\n return moves;\n }", "public ArrayList<Location> getMoveLocations()\n {\n ArrayList<Location> locs = new ArrayList<Location>();\n ArrayList<Location> validLocations = getGrid().getValidAdjacentLocations(getLocation());\n for (Location neighborLoc : validLocations)\n {\n if (getGrid().get(neighborLoc) == null || getGrid().get(neighborLoc) instanceof AbstractPokemon || getGrid().get(neighborLoc) instanceof PokemonTrainer)\n locs.add(neighborLoc);\n }\n return locs;\n }", "@Override\r\n\tpublic ArrayList<PlayerPO> getAllPlayers() {\n\t\treturn playerController.getAllPlayers();\r\n\t}", "List<Player> findAllPlayers();", "public List<PossibleMove> getPossibleMoves(char color) {\r\n\t\tif (color != 'B' && color != 'W') {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Error! Invalid color. Expected B or W.\");\r\n\t\t}\r\n\r\n\t\tList<PossibleMove> posMoves = new ArrayList<PossibleMove>();\r\n\t\tthis.findPossibleMoves(color);\r\n\t\tCollections.sort(possibleMoves);\r\n\t\tfor (PossibleMove p : possibleMoves) {\r\n\t\t\tposMoves.add(new PossibleMove(p.getColumn(), p.getLine()));\r\n\t\t}\r\n\t\treturn posMoves;\r\n\t}", "private List<Move> generateMoves(boolean debug) {\r\n\r\n\t\tList<Piece> pieces = this.chessGame.getPieces();\r\n\t\tList<Move> validMoves = new ArrayList<Move>();\r\n\t\tMove testMove = new Move(0,0,0,0);\r\n\t\t\r\n\t\tint pieceColor = (this.chessGame.getGameState()==ChessGame.GAME_STATE_WHITE\r\n\t\t\t?Piece.COLOR_WHITE\r\n\t\t\t:Piece.COLOR_BLACK);\r\n\r\n\t\t// iterate over all non-captured pieces\r\n\t\tfor (Piece piece : pieces) {\r\n\r\n\t\t\t// only look at pieces of current players color\r\n\t\t\tif (pieceColor == piece.getColor()) {\r\n\t\t\t\t// start generating move\r\n\t\t\t\ttestMove.sourceRow = piece.getRow();\r\n\t\t\t\ttestMove.sourceColumn = piece.getColumn();\r\n\r\n\t\t\t\t// iterate over all board rows and columns\r\n\t\t\t\tfor (int targetRow = Piece.ROW_1; targetRow <= Piece.ROW_8; targetRow++) {\r\n\t\t\t\t\tfor (int targetColumn = Piece.COLUMN_A; targetColumn <= Piece.COLUMN_H; targetColumn++) {\r\n\r\n\t\t\t\t\t\t// finish generating move\r\n\t\t\t\t\t\ttestMove.targetRow = targetRow;\r\n\t\t\t\t\t\ttestMove.targetColumn = targetColumn;\r\n\r\n\t\t\t\t\t\tif(debug) System.out.println(\"testing move: \"+testMove);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// check if generated move is valid\r\n\t\t\t\t\t\tif (this.validator.isMoveValid(testMove, true)) {\r\n\t\t\t\t\t\t\t// valid move\r\n\t\t\t\t\t\t\tvalidMoves.add(testMove.clone());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// generated move is invalid, so we skip it\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}\r\n\t\t}\r\n\t\treturn validMoves;\r\n\t}", "private static void playersMove() {\r\n\t\tPrint print = new Print(); \r\n\t\tprint.board(game); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints the entire gameBoard.\r\n\t\t\r\n\t\tboolean flag = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//true = Get Gideon's move | false = Get User's move\r\n\t\r\n\t\tArrayList<Integer> moves = MoveGenerator.Gen(flag, gamePieces);\t\t\t\t\t\t\t//returns all the legal moves possible to make by the player.\r\n\t\tPrint.moves(moves);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints all the moves returned by the Gen method.\r\n\t\t\r\n\t\tSystem.out.print(\"\\n\\n Enter your move: \");\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tString userInput = kb.next();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Captures the players move\r\n\t\t\r\n\t\tboolean moveCheck = CheckUserInput.checkMove(userInput, moves);\t\t\t\t\t\t\t//Checks if the move entered by the player is in the legal move list\r\n\t\t\r\n\t\tString formattedUserInput = null;\r\n\t\t\r\n\t\tif(!moveCheck)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Recall the playersMove() method if the move entered by the user is illegal\r\n\t\t\tplayersMove();\r\n\r\n\t\tformattedUserInput = FormatInput.formatUserMove(userInput);\t\t\t\t\t\t\t//Formatting the user's move to make it as an executable move on the board\r\n\t\t\r\n\t\t//System.out.println(formattedUserInput);\r\n\t\t\r\n\t\tUpdateBoard boardUpdater = new UpdateBoard();\r\n\t\tgame = boardUpdater.playMove(formattedUserInput,game, gamePieces, flag, false, true); //Executing the legal move on the gameBoard\r\n\t\tgamePieces = game.getGamePiecesArray();\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the updated copy of the Game Pieces Array\r\n\t\tgame.updateGameBoard();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Updating the String copy of the game board (required to print the updated gameBoard)\r\n\t\t\r\n\t\tSystem.out.println(\"\\n ========================\");\r\n\t\tGideonsMove();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Gideon's turn to make a move\r\n\t\r\n\t}", "List<Player> getPlayers();", "public ArrayList<Move> getLegalMoves() {\n return Logic.legalMoves(turn, this);\n }", "public ArrayList<ArrayList<Tile>> getAllMovePaths(Board board) {\n ArrayList<ArrayList<Tile>> result = new ArrayList<>();\n for (int row = 0; row < board.getRows(); row++) {\n for (int col = 0; col < board.getColumns(); col++) {\n if(isValidMove(row,col)){\n result.add(getMovePath(board, row, col));\n }\n }\n }\n return result;\n }", "@Override\n public Map<Direction, List<Coordinate>> getPossibleMoves() {\n\n Map<Direction, List<Coordinate>> moves = new HashMap<>();\n\n Coordinate coordinate = this.getCoordinate();\n int row = coordinate.getRow();\n int col = coordinate.getCol();\n\n //Jumps\n List<Coordinate> jumps = new ArrayList<>();\n\n //\n //\n ////\n int tempRow1 = row - 2;\n int tempCol1 = col - 1;\n Coordinate tempCoordinate1 = new Coordinate(tempRow1, tempCol1);\n if (Board.inBounds(tempCoordinate1)) {\n jumps.add(tempCoordinate1);\n }\n\n ////\n //\n //\n int tempRow2 = row + 2;\n int tempCol2 = col - 1;\n Coordinate tempCoordinate2 = new Coordinate(tempRow2, tempCol2);\n if (Board.inBounds(tempCoordinate2)) {\n jumps.add(tempCoordinate2);\n }\n\n //////\n //\n int tempRow3 = row - 1;\n int tempCol3 = col - 2;\n Coordinate tempCoordinate3 = new Coordinate(tempRow3, tempCol3);\n if (Board.inBounds(tempCoordinate3)) {\n jumps.add(tempCoordinate3);\n }\n\n ///////\n //\n int tempRow4 = row - 1;\n int tempCol4 = col + 2;\n Coordinate tempCoordinate4 = new Coordinate(tempRow4, tempCol4);\n if (Board.inBounds(tempCoordinate4)) {\n jumps.add(tempCoordinate4);\n }\n\n ////\n //\n //\n int tempRow5 = row + 2;\n int tempCol5 = col + 1;\n Coordinate tempCoordinate5 = new Coordinate(tempRow5, tempCol5);\n if (Board.inBounds(tempCoordinate5)) {\n jumps.add(tempCoordinate5);\n }\n\n //\n //\n ////\n int tempRow6 = row - 2;\n int tempCol6 = col + 1;\n Coordinate tempCoordinate6 = new Coordinate(tempRow6, tempCol6);\n if (Board.inBounds(tempCoordinate6)) {\n jumps.add(tempCoordinate6);\n }\n\n //\n //////\n int tempRow7 = row + 1;\n int tempCol7 = col - 2;\n Coordinate tempCoordinate7 = new Coordinate(tempRow7, tempCol7);\n if (Board.inBounds(tempCoordinate7)) {\n jumps.add(tempCoordinate7);\n }\n\n //\n //////\n int tempRow8 = row + 1;\n int tempCol8 = col + 2;\n Coordinate tempCoordinate8 = new Coordinate(tempRow8, tempCol8);\n if (Board.inBounds(tempCoordinate8)) {\n jumps.add(tempCoordinate8);\n }\n\n if (!jumps.isEmpty()) {\n moves.put(Direction.Jump, jumps);\n }\n return moves;\n }", "public ArrayList<Pair<Coord,Coord>> returnMoves(Board b) {\r\n\t\t//copy Piece grid\r\n\t\tPiece[][] g = b.getGrid();\r\n\t\t\r\n\t\t//return array of all the possible moves\r\n\t\tArrayList<Pair<Coord,Coord>> possibleMoves = new ArrayList<Pair<Coord,Coord>>();\r\n\r\n\t\t//System.out.println(team + \": (\" + c.y + \", \" + c.x + \")\");\r\n\t\t//if the team is moving north (white team)\r\n\t\tif(team) {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y-1][c.x] == null && g[c.y-2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-2,c.x),null));\r\n\t\t\t\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y-1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y-1][c.x-1]!=null && (!g[c.y-1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y-1][c.x+1]!=null && (!g[c.y-1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==3 && g[c.y-1][c.x-1]==null && g[c.y][c.x-1]!=null && !g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==3 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && !g[c.y][c.x+1].team\r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y-1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t//if the team is moving south (black team)\r\n\t\t} else {\r\n\t\t\t//first move, two square pawn advance\r\n\t\t\tif(moves==0 && g[c.y+1][c.x] == null && g[c.y+2][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+2,c.x),null));\r\n\r\n\t\t\t//single square pawn advance\r\n\t\t\tif(g[c.y+1][c.x] == null)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally west\r\n\t\t\tif(c.x-1>=0 && c.x-1<=7 && g[c.y+1][c.x-1]!=null && (g[c.y+1][c.x-1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),null));\r\n\t\t\t\r\n\t\t\t//capture diagonally east\r\n\t\t\tif(c.x+1>=0 && c.x+1<=7 && g[c.y+1][c.x+1]!=null && (g[c.y+1][c.x+1].team))\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),null));\r\n\t\t\t\r\n\t\t\t//en passant west\r\n\t\t\tif(c.x-1>=0 && c.y==4 && g[c.y+1][c.x-1]==null && g[c.y][c.x-1]!=null && g[c.y][c.x-1].team \r\n\t\t\t\t\t&& g[c.y][c.x-1].toString().equals(\"P\") && g[c.y][c.x-1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x-1),new Coord(c.y, c.x-1)));\r\n\t\t\t\r\n\t\t\t//en passant east\r\n\t\t\tif(c.x+1<=7 && c.y==4 && g[c.y-1][c.x+1]==null && g[c.y][c.x+1]!=null && g[c.y][c.x+1].team \r\n\t\t\t\t\t&& g[c.y][c.x+1].toString().equals(\"P\") && g[c.y][c.x+1].moves==1)\r\n\t\t\t\tpossibleMoves.add(new Pair<Coord, Coord>(new Coord(c.y+1,c.x+1),new Coord(c.y, c.x+1)));\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\treturn possibleMoves;\r\n\t}", "public ArrayList<Location> getMoveLocations(Piece p)\n {\n Location loc = getLocation(p);\n ArrayList<Location> locs = getCandidateLocations(loc);\n if (p==null)\n return null;\n for (int i = 0; i < locs.size(); i++)\n {\n if (canMoveTo(p,locs.get(i))==ILLEGAL_MOVE)\n {\n locs.remove(i);\n i--;\n }\n else\n {\n Board b = new Board(this);\n b.movePiece(loc,locs.get(i));\n if (b.findKing(p.getColor())!=null&&b.inCheck(p.getColor()))\n {\n locs.remove(i);\n i--;\n }\n }\n }\n return locs;\n }", "public Iterable<Board> solution() {\n if (!isSolvable()) {\n return null;\n }\n\n Stack<Board> solution = new Stack<Board>();\n\n Move current = finalMove;\n while (current.previous != null) {\n solution.push(current.board);\n current = current.previous;\n }\n solution.push(current.board);\n\n return solution;\n }", "List<Cell> getPossibleMoves(Board board,\n Color color) {\n List<Cell> possible_moves = new ArrayList<Cell>();\n boolean flip_dir = false;\n //loop through all cells in board\n for (int i = 0; i < board.getRows(); i++) {\n for (int j = 0; j < board.getCols(); j++) {\n //check in all directions if move will flip cells\n for (Direction d : Direction.values()) {\n flip_dir = flipInDirection(board, i, j, d, color);\n if (flip_dir) {\n possible_moves.add(board.getCell(i,j));\n break;\n }\n }\n }\n }\n return possible_moves;\n }", "public ArrayList<GameActionSet> getPossibleActions(GameMap map, GamePath movePath)\n {\n return getPossibleActions(map, movePath, false);\n }", "boolean[][][] getNewAvailMoves() {\n\t\tboolean[][][] newAvailMoves = new boolean[boardSize][boardSize][boardSize];\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tnewAvailMoves[i][j][k] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn newAvailMoves;\n\t}", "public static HashSet<gameState> Actions(gameState currentState) {\n\t\t\n\t\tHashSet<gameState> possibleStates = new HashSet<gameState>();\n\t\t\n\t\t\n\t\t// Store which player goes next after this player plays\n\t\tint nextNextUp;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tnextNextUp = 1;\n\t\t} else {\n\t\t\tnextNextUp = 0;\n\t\t}\n\t\t\n\t\t// Store corresponding characters for each player\n\t\t// DARK(X) - 0, LIGHT(O) - 1\n\t\tchar myTile;\n\t\tchar opponentTile;\n\t\tif (currentState.getNextUp() == 0) {\n\t\t\tmyTile = 'x';\n\t\t\topponentTile = 'o';\n\t\t} else {\n\t\t\tmyTile = 'o';\n\t\t\topponentTile = 'x';\n\t\t}\n\n\t\t\n\n\t\t// Check the entire board of the state \n\t\tfor (int i = 0; i<boardSize; i++) {\n\t\t\tfor (int j = 0; j<boardSize; j++) {\n\t\t\t\t\n\t\t\t\t// If the tile is my tile\n\t\t\t\tif (currentState.getBoard()[i][j] == '_') {\n\t\t\t\t\t\n\t\t\t\t\tchar[][] moveBoard = createNewBoard(currentState);\n\t\t\t\t\t\n\t\t\t\t\t// Up\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// If it is an opponent tile, then you keep going up until you either my tile (fail) or\n\t\t\t\t\t\t// a blank space (success/move possible)\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=i;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Down\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][j] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=i;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[l][j] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][j] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j-1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k+1; l<=j;l++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i][j+1] == opponentTile) { \n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tfor (int k = j+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[i][k] == myTile) {\n\t\t\t\t\t\t\t\t\tfor (int l = k-1; l>=j;l--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[i][l] = myTile;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[i][k] == opponentTile) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j-1] == opponentTile) { \n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Up and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i-1][j+1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i-2; k >= 0; k--) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k+1; q<=i;q++) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\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} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Left\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j-1] == opponentTile) { \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j-2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l+1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\t// Down and Right\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (currentState.getBoard()[i+1][j+1] == opponentTile) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Keep going up until the top is hit\n\t\t\t\t\t\t\tint l = j+2;\n\t\t\t\t\t\t\tfor (int k = i+2; k < boardSize; k++) {\n\t\t\t\t\t\t\t\tif (currentState.getBoard()[k][l] == myTile) {\n\t\t\t\t\t\t\t\t\tint p = l-1;\n\t\t\t\t\t\t\t\t\tfor (int q = k-1; q>=i;q--) {\n\t\t\t\t\t\t\t\t\t\tmoveBoard[q][p] = myTile;\n\t\t\t\t\t\t\t\t\t\tp--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (currentState.getBoard()[k][l] == opponentTile) {\n\t\t\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t\t\n\t\t\t\t\tif (!compareBoards(moveBoard, currentState.getBoard())) {\n\t\t\t\t\t\tgameState move = new gameState(moveBoard, nextNextUp);\t\t\n\t\t\t\t\t\tpossibleStates.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\n\t\treturn possibleStates;\n\t\t\n\t\t\n\t\t\n\t}", "public List<Player> getAll() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAll();\n }", "@Override\n public Position[] getCanMoves() {\n PieceWay way = new PieceWay(getPosition());\n Position[] PawnWay = way.waysPawnPos(color);\n return PawnWay;\n }", "@Test\n void testAllLegalMoves() {\n \tplayer1 = new HumanPlayer(\"Arnold\");\n player2 = new HumanPlayer(\"Intelligent Twig\");\n gameState = new GameState(Arrays.asList(player1, player2));\n board = gameState.getBoard();\n \n Set<PlayableMove> moves = Move.allLegalMoves(gameState);\n\n assertTrue(moves.stream().allMatch(e -> e.isLegal()));\n assertEquals(44, moves.size());\n }", "public List<ScoredMove> allAttackMoves(GameState gm) {\n\t\tList<ScoredMove> attackMoves = new ArrayList<ScoredMove>();\n\t\t\n\t\t// check for attacking battles\n\t\tif (gm.getBattleList().size() > 0) {\n\t\t\tfor (Battle b: gm.getBattleList()) {\n\t\t\t\tif (!b.isBattleUsingTrumps()) {\n\t\t\t\t\tfor (Card c: getHand().getCards()){\n\t\t\t\t\t\tif (c instanceof PirateShip) {\n\t\t\t\t\t\t\tif (canPirateShipCardAttack(b, (PirateShip)c)){\n\t\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\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\tfor (Card c: getHand().getCards()) {\n\t\t\t\t\tif (c instanceof Trump) {\n\t\t\t\t\t\tif (canTrumpCardAttack(b, (Trump)c)) {\n\t\t\t\t\t\t\tattackMoves.add(new ScoredMove(ACTION.PLAY_ATTACK, c, b));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn attackMoves;\n\t}", "@Override\n @Transactional(readOnly = true)\n public Page<PositionMoveDTO> findAll(Pageable pageable) {\n log.debug(\"Request to get all PositionMoves\");\n Page<PositionMove> result = positionMoveRepository.findAll(pageable);\n return result.map(positionMove -> positionMoveMapper.positionMoveToPositionMoveDTO(positionMove));\n }", "private ArrayList<MoveNode> getAllMoves(int slotColor) {\n ArrayList<MoveNode> movePaths = new ArrayList<>();\n ArrayList<Pair<Slot, Slot>> moves = new ArrayList<>();\n HashMap<Slot, Slot> parents = new HashMap<>();\n\n for (int r = 0; r < Board.MAX_ROW; r++) {\n for (int c = 0; c < Board.MAX_COLUMN; c++) {\n if (boardObject.getSlot(r, c).getColor() == slotColor) {\n Slot slot = new Slot(r, c, slotColor);\n\n depthFirstSearch(slot, moves, parents);\n getPath(parents, moves, movePaths);\n\n parents.clear();\n moves.clear();\n }\n }\n }\n\n return movePaths;\n }", "public Set<Location> getPlayerLocations()\n\t{\n\t\tSet<Location> places = new HashSet<Location>();\n\t\tfor(Location place: playerLocations.values())\n\t\t{\n\t\t\tplaces.add(place);\n\t\t}\n\t\treturn places;\n\t}", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "public ArrayList<Cell> getPseudoLegalMoves() {\n\n int[][] offsetMultiplier = {{-1,-1},{-1,1},{1,-1},{1,1}}; //4 directions NW, NE, SW, SE\n int x = getRow(); int y = getColumn();\n\n\n return Piece.slidingPieceMoves(x,y,this.getColor(),offsetMultiplier);\n\n }" ]
[ "0.74146914", "0.7398428", "0.6916818", "0.6900997", "0.66503334", "0.66167927", "0.6591039", "0.6542648", "0.6510128", "0.6504331", "0.64602846", "0.6432252", "0.64268917", "0.6397344", "0.6386405", "0.6382053", "0.6353914", "0.632844", "0.6313678", "0.63020635", "0.6296172", "0.628216", "0.62467116", "0.6237277", "0.6229855", "0.62271416", "0.61883646", "0.6179182", "0.6158257", "0.6125626", "0.61166316", "0.61141413", "0.60955095", "0.60882115", "0.60861254", "0.60728294", "0.60699326", "0.60693735", "0.60691774", "0.60305345", "0.60108656", "0.59944344", "0.599431", "0.5987532", "0.597165", "0.5962344", "0.5962038", "0.5942699", "0.5920318", "0.59075224", "0.5904605", "0.5893489", "0.5876114", "0.58676994", "0.5862891", "0.58597225", "0.5853797", "0.58512825", "0.5849385", "0.5846142", "0.584611", "0.5845137", "0.5841475", "0.58204484", "0.5820152", "0.57984227", "0.5795958", "0.57721967", "0.576266", "0.5760557", "0.5752227", "0.57447785", "0.57258964", "0.57239115", "0.5719688", "0.5719372", "0.5716231", "0.57149106", "0.5707808", "0.57072884", "0.57035404", "0.5703039", "0.5679762", "0.5660535", "0.5655833", "0.5651944", "0.5650409", "0.56501585", "0.5648801", "0.5639787", "0.5624103", "0.56235975", "0.56223136", "0.56090325", "0.56021374", "0.55945814", "0.5585854", "0.5580317", "0.55688894", "0.5562839" ]
0.7582761
0
Retuns the current board as a string.
String getBoardString();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getBoard() {\r\n\t\tString r = \"\";\r\n\t\tfor (int y = 0; y < 3; y++) {\r\n\t\t\tfor (int x = 0; x < 3; x++) {\r\n\t\t\t\tr = r + board[y][x];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "public String toString()\n\t{\n\t\tString s = \"\";\n\t\tfor(int r = 0; r < board.length; r++)\n\t\t{\n\t\t\tfor(int c = 0; c < board[0].length; c++)\n\t\t\t{\n\t\t\t\ts += \"|\" + board[r][c];\n\t\t\t}\t\t\t\t\n\t\t\ts += \"|\" + \"\\n\" + \"-------------------\" + \"\\n\";\n\t\t}\n\t\treturn s;\n\t}", "public String toString() {\n\tString str = \"\";\n\tfor (int i = 0; i < board.length; i++) {\n\t str = str + \"\\n\";\n\t for (int j = 0; j <= (board.length - 1); j++)\n\t\tstr = \" \" + str + board[i][j] + \" \";\n\t}\n\treturn str;\n }", "String getBoard();", "public String toString() {\n String boardString = \"\";\n for (int j = 0; j < nRows; j++) {\n String row = \"\";\n for (int i = 0; i < nCols; i++) {\n if (board[j][i] == null) {\n row = row + \"Empty \";\n } else {\n row = row + board[j][i].getType() + \" \";\n }\n }\n boardString = boardString + row + \"\\n\";\n }\n return boardString;\n }", "public String toString() {\n String bs = \" \"; // bs stands for board string\n for (int col = 0; col <= (this.boardSize - 1); col++) {\n bs = bs + (col + 1) + \" \";\n if (col < this.boardSize - 1) {\n bs = bs + \" \";\n }\n }\n bs = bs + \"\\n\";\n char rowHead = 'A';\n for (int row = 0; row <= (this.boardSize - 1); row++) {\n bs = bs + \" \" + rowHead++ + \" \";\n for (int col = 0; col < this.boardSize; ++col) {\n bs = bs + \" \" + this.board[row][col];\n if (col < this.boardSize - 1) {\n bs = bs + \" |\";\n }\n }\n bs = bs + \"\\n\";\n if (row < this.boardSize - 1) {\n bs = bs + \" \";\n for (int col = 0; col < this.boardSize; col++) {\n bs = bs + \"---\";\n if (col < this.boardSize - 1) {\n bs = bs + \"|\";\n }\n }\n }\n bs = bs + \"\\n\";\n }\n return bs;\n }", "public String toString() {\n\t\tString str = \"\\n \";\n\t\tfor (int i = 1; i <= board.length; i++) {\n\t\t\tstr += i + \" \";\n\t\t}\n\t\tstr = str.stripTrailing() + \"\\n\";\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tstr += (i+1) + \" \";\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tif (board[i][j] == Disc.WHITE) {\n\t\t\t\t\tstr += \"W \";\n\t\t\t\t} else if (board[i][j] == Disc.BLACK) {\n\t\t\t\t\tstr += \"B \";\n\t\t\t\t} else {\n\t\t\t\t\tstr += \"- \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr = str.stripTrailing() + \"\\n\";\n\t\t}\n\t\treturn str;\n\t}", "public String toString() {\n \t// string representation of the board (in the output format specified below)\n \tStringBuilder sb = new StringBuilder(dimension() + \" \\n \");\n \t\n \tfor (int row = 0; row < dimension(); row++) {\n \t\tfor (int column = 0; column < dimension(); column++) {\n \t\t\tsb.append(blocks[row][column]);\n \t\t\tsb.append(\" \");\n \t\t}\n \t\t\n \t\tsb.append(\"\\n \");\n \t}\n \t\n \treturn sb.toString();\n }", "public String toString() {\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < SIZE; i++) {\n for (int j = 0; j < SIZE; j++) {\n sb.append(board[i][j]);\n sb.append(\" \");\n }\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "public String toString() {\n StringBuilder s = new StringBuilder(); // Initialize new string builder\n s.append(N + \"\\n\"); // Append board dimension to string\n\n for (int[] row : tiles) {\n for (int tile : row)\n s.append(String.format(\"%2d \", tile)); // Append formatted board tiles string\n s.append(\"\\n\"); // Append new line to string\n }\n return s.toString(); // Return string representation of board\n }", "public String boardCellToString() {\n String str;\n Integer convertX, convertY;\n //adjusting the co'ordinates because the board starts at 1 not 0\n convertX=this.xCor + 1;\n convertY= this.yCor + 1;\n str = \"(\" + convertX.toString() + \",\" + convertY.toString() + \")\";\n return str;\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n\n //Print board\n int c = 0;\n for (Piece piece : board) {\n if (piece == null) {\n sb.append(\"\\t\");\n } else {\n sb.append(piece.pieceString()).append(\"\\t\");\n }\n if (++c % 4 == 0) {\n sb.append(\"\\n\");\n }\n }\n sb.append(\"\\n\");\n\n return sb.toString();\n }", "public String toString() {\n String returnString = \"\";\n returnString = returnString + \"\\r\\n\";\n for (int i = 0; i < rows + 1; i++) {\n for (int j = 0; j < cols + 1; j++) {\n if (i == 0 && j == 0) {\n returnString = returnString + \" \";\n continue;\n }\n if (i == 0) {\n if (j > 0) {\n returnString = returnString + (j + \" \");\n }\n if (j == 8) {\n returnString = returnString + \"\\r\\n\";\n }\n } else {\n if (j > 0) {\n if (!isEmpty(i - 1, j - 1)) {\n returnString = returnString + (getBoard()[i - 1][j - 1] + \" \");\n } else {\n returnString = returnString + \" \";\n }\n }\n }\n if (j == 0) {\n returnString = returnString + (i + \" \");\n }\n\n }\n returnString = returnString + \"\\r\\n\";\n }\n return returnString;\n }", "private String gameBoardToString(){\n StringBuilder config = new StringBuilder();\n\n //length attribute gets the number of rows in a 2D array. length attribute on a row gets the number of columns in a\n // 2D array. We iterate through all the rows and columns and join all the characters in the array into a single\n // String config\n\n for (int i = 0; i < this.boardRows; i++){\n for (int j =0; j < this.boardColumns; j++){\n config.append(this.gameBoard[i][j]);\n }\n }\n\n // Returns String object representation of StringBuilder object\n return config.toString();\n\n }", "public String toString(){\n\t\tString board = \"\";\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tif(theGrid[i][j]){ //iterate through, if cell is alive, mark with *\n\t\t\t\t\tboard += \"*\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tboard += \" \"; //else, [space]\n\t\t\t\t}\n\t\t\t}\n\t\t\tboard += \"\\n\";//create a new line, to create the board\n\t\t}\n\t\treturn board; //return the board\n\t}", "public String getGameStr() {\n StringBuilder outStr = new StringBuilder();\n for(int i=0;i<ROWS;i++) {\n for(int j=0;j<COLS;j++){ \n outStr.append(\"|\").append(gameBoard[i][j].show());\n }\n outStr.append(\"|\").append(System.getProperty(\"line.separator\"));\n }\n return outStr.toString();\n }", "public String showBoard() {\n return name + \"\\r\\n\" + myBoard.displayMyBoard() + \"\\r\\n\" + opponentsBoard.displayShotsTaken();\n }", "public static String printBoard(Game board) {\n return board.toString();\n }", "public String toString() {\n\t\tString temp = \"\";\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\ttemp += String.format(\"%d \", i);\n\t\t}\n\t\ttemp += \"\\n\";\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\ttemp += String.format(\"%d | \", i + 1);\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\ttemp += String.format(\"%c | \", board[i][j]);\n\t\t\t}\n\t\t\ttemp += \"\\n\";\n\t\t}\n\t\treturn temp;\n\t}", "@Override\n\tpublic String toString(){\n\t\t// return a string of the board representation following these rules:\n\t\t// - if printed, it shows the board in R rows and C cols\n\t\t// - every cell should be represented as a 5-character long right-aligned string\n\t\t// - there should be one space between columns\n\t\t// - use \"-\" for empty cells\n\t\t// - every row ends with a new line \"\\n\"\n\t\t\n\t\t\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tfor (int i=0; i<numRows; i++){\n\t\t\tfor (int j =0; j<numCols; j++){\n\t\t\t\tPosition pos = new Position(i,j);\n\t\t\t\t\n\t\t\t\t// use the hash table to get the symbol at Position(i,j)\n\t\t\t\tif (grid.contains(pos))\n\t\t\t\t\tsb.append(String.format(\"%5s \",this.get(pos)));\n\t\t\t\telse\n\t\t\t\t\tsb.append(String.format(\"%5s \",\"-\")); //empty cell\n\t\t\t}\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\n\t}", "@Override\n public String toString() {\n String returnBoard = \" \";\n for (int i = 1; i <= 3; i++) {\n returnBoard=returnBoard+\" \" +Integer.toString(i);\n }\n returnBoard+=\"\\n\";\n for (int i = 1; i <= 3; i++) {\n returnBoard+= Integer.toString(i);\n for (int j = 1; j <= 3; j++) {\n returnBoard = returnBoard + \" \" + board[i-1][j-1].toString();\n }\n returnBoard+=\"\\n\";\n }\n return returnBoard;\n }", "public String toString() {\n\n\t\tString result = \"\";\n\n\t\tfor(Cell[][] dim : board) {\n\t\t\tfor(Cell[] row : dim) {\n\t\t\t\tfor(Cell col : row) {\n\t\t\t\t\tif(col== Cell.E)\n\t\t\t\t\t\tresult += \"-\";\n\t\t\t\t\telse\n\t\t\t\t\t\tresult += col;\t\n\t\t\t\t}\n\t\t\t\tresult += \"\\n\";\n\t\t\t}\n\t\t\tresult += \"\\n\";\n\t\t}\n\n//\t\tSystem.out.println(\"\\n***********\\n\");\n\t\treturn result;\n\n\t}", "public String toString() {\n\t\tString resultString = \"\\r\\n\";\n\t\t//resultString += \"Checkerboard state: \\r\\n\";\n\t\tfor (int i = 0; i < checkerboard.length; i++) {\n\t\t\tfor (int j = 0; j < checkerboard.length; j++) {\n\t\t\t\tif (checkerboard[i][j] == WHITE) {\n\t\t\t\t\tresultString += \"o \";\n\t\t\t\t} else if (checkerboard[i][j] == BLACK) {\n\t\t\t\t\tresultString += \"x \";\n\t\t\t\t} else {\n\t\t\t\t\tresultString += \"- \";\n\t\t\t\t}//Of if\n\t\t\t}//Of for j\n\t\t\tresultString += \"\\r\\n\";\n\t\t}//Of for i\n\t\t\n\t\tresultString += currentState;\n\n\t\t//resultString += \"\\r\\nThe current situation is: \" + gameSituation;\n\t\treturn resultString;\n\t}", "public String toString(){\n\t\tchar[][] boardRep = new char[yDim + 2][xDim + 2];\n\t\t\n\t\tfor(int i = 0; i < boardRep.length; i++){\n\t\t\tfor(int j = 0; j < boardRep[i].length; j++){\n\t\t\t\tboardRep[i][j] = ' ';\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < yDim + 2; i++){\n\t\t\tboardRep[i][0] = '.';\n\t\t\tboardRep[i][xDim + 1] = '.';\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < xDim + 2; i++){\n\t\t\tboardRep[0][i] = '.';\n\t\t\tboardRep[yDim + 1][i] = '.';\n\t\t}\n\t\t\n\t\tfor (Gadget g : gadgets){\n\t\t\tif(g instanceof SquareBumper){\n\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '#';\n\t\t\t}else if(g instanceof TriangularBumper){\n\t\t\t\tif(((TriangularBumper) g).getOrientation() % 2 == 0)\t\n\t\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '/';\n\t\t\t\tif(((TriangularBumper) g).getOrientation() % 2 == 1)\t\n\t\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= '\\\\';\n\t\t\t}else if(g instanceof CircularBumper){\n\t\t\t\tboardRep[g.getY() + 1][g.getX() + 1]= 'O';\n\t\t\t}else if(g instanceof Absorber){\n\t\t\t\tfor(int i=g.getX(); i < g.getX() + g.getWidth(); i++){\n\t\t\t\t\tfor(int j=g.getY(); j < g.getY() + g.getHeight(); j++){\n\t\t\t\t\t\tboardRep[j + 1][i + 1] = '=';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(g instanceof Flipper){\n\t\t\t\tFlipper f = (Flipper) g;\n\t\t\t\tif (f.isLeft && f.orientation == 0){\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+1] = '|';\n\t\t\t\t\tboardRep[f.getY()+2][f.getX()+1] = '|';\n\t\t\t\t} else if(f.orientation == 0){\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+2] = '|';\n\t\t\t\t\tboardRep[f.getY()+2][f.getX()+2] = '|';\n\t\t\t\t} else{\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+1] = '-';\n\t\t\t\t\tboardRep[f.getY()+1][f.getX()+2] = '-';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(Ball b : balls){\n\t\t\tboardRep[(int) (b.getY() + 1)][(int) (b.getX() + 1)]= '*';\n\t\t}\n\t\t\n\t\tStringBuffer boardString = new StringBuffer();\n\t\tfor(char[] row : boardRep){\n\t\t\tfor(char c : row){\n\t\t\t\tboardString.append(c);\n\t\t\t}\n\t\t\tboardString.append('\\n');\n\t\t}\n\t\t\n\t\treturn boardString.toString();\n\t}", "@Override\n public String toString() {\n\n \n String str = \"\";\n for(int rowIndex = 0; rowIndex < this.board.length; rowIndex++) {\n \n for(int columnIndex = 0; columnIndex < this.board[rowIndex].length; columnIndex++) {\n\n switch (this.board[rowIndex][columnIndex]) {\n case IBoardState.symbolOfInactiveCell:\n str += \"*|\";\n break;\n case IBoardState.symbolOfEmptyCell:\n str += \"0|\";\n break;\n case IBoardState.symbolOfFirstPlayer:\n str += \"1|\";\n break;\n case IBoardState.symbolOfSecondPlayer:\n str += \"2|\";\n break;\n }\n\n }\n str +=\"\\n\";\n }\n return str;\n }", "public String getSlackRepresentationOfBoard() {\n String boardBorders[] = {\"```| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |```\"};\n int boardBordersIndex = 0;\n StringBuilder boardString = new StringBuilder();\n for(int row = 0; row < BOARD_SIZE; row ++ ){\n for(int col = 0; col <BOARD_SIZE; col ++ ){\n boardString.append( boardBorders[boardBordersIndex] );\n boardString.append( getTokenAsCharFromBoardPosition(row, col, boardBordersIndex+1));\n boardBordersIndex++;\n }\n }\n boardString.append( boardBorders[boardBordersIndex] );\n return boardString.toString();\n }", "private String encodedBoard() {\r\n char[] result = new char[Square.SQUARE_LIST.size() + 1];\r\n result[0] = turn().toString().charAt(0);\r\n for (Square sq : SQUARE_LIST) {\r\n result[sq.index() + 1] = get(sq).toString().charAt(0);\r\n }\r\n return new String(result);\r\n }", "public String toString() {\n\t\t// Variables\n\t\tString gameboard;\n\t\tchar[] firstLetter = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' };\n\n\t\t// Top\n\t\tgameboard = \" ===============================================================\\n\";\n\n\t\t// Middle\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\t// Beginning of the line\n\t\t\tgameboard += \" \" + firstLetter[i] + \" ||\";\n\n\t\t\t// Letters\n\t\t\tfor (int j = 0; j < 15; j++) {\n\t\t\t\tif (this.grid[i][j].getTile().getLetter() == Character.MIN_VALUE) {\n\t\t\t\t\tif (this.grid[i][j].getScoreMult() > 1)\n\t\t\t\t\t\tgameboard += \" * \";\n\t\t\t\t\telse\n\t\t\t\t\t\tgameboard += \" . \";\n\t\t\t\t} else {\n\t\t\t\t\tgameboard += \" \" + this.grid[i][j].getTile().getLetter() + \" \";\n\t\t\t\t}\n\t\t\t\tif (j != 14)\n\t\t\t\t\tgameboard += '|';\n\t\t\t}\n\n\t\t\t// End of the line\n\t\t\tgameboard += \"||\\n\";\n\t\t\tif (i != 14)\n\t\t\t\tgameboard += \" ||---|---|---|---|---|---|---|---|---|---|---|---|---|---|---||\\n\";\n\t\t}\n\n\t\t// Bottom\n\t\tgameboard += \" ===============================================================\\n\";\n\t\tgameboard += \" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\";\n\n\t\treturn gameboard;\n\t}", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "public String getBoardOverview() {\n String boardOverview = \"\";\n\n for (int y = 0; y < this.boardSize; y++) {\n for (int x = 0; x < this.boardSize; x++) {\n char StoneColor = ' ';\n\n if (!this.fields[x][y].isEmpty()) {\n switch (this.fields[x][y].getStone().getColor()) {\n case BLACK:\n StoneColor = 'B';\n break;\n case WHITE:\n StoneColor = 'W';\n break;\n }\n } else if (this.fields[x][y].isPossibleMove()) {\n StoneColor = 'x';\n }\n\n boardOverview = boardOverview + StoneColor;\n\n }\n // next line\n boardOverview = boardOverview + String.format(\"%n\");\n }\n\n return boardOverview;\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(dim + \"\\n\");\n for (int i = 0; i < dim; i++) {\n for (int j = 0; j < dim; j++) {\n s.append(String.format(\"%2d \", board[i][j]));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public String toString(){\n //KEY --------\n // WHITE WALL = WW\n // WHITE ROAD = WR\n // WHITE CAPSTONE = WC\n // BLACK WALL = BW\n // BLACK ROAD = BR\n // BLACK CAPSTONE = BC\n // EMPTY = \"blank\"\n\n StringBuilder builder = new StringBuilder();\n\n /*TOP ROW*/ builder.append(\"\\t\"); for(int i = 0; i < SIZE; i++){ builder.append(i + \"\\t\");} builder.append(\"\\n\\n\");\n /*REST OF THE ROWS*/ \n for(int x = 0; x < SIZE; x++){\n builder.append(x + \"\\t\");\n for(int y = 0; y < SIZE; y++){\n TakStack current = stacks[y][x]; \n if(!current.isEmpty()){\n builder.append(getPieceString(current.top()));\n }\n builder.append(\"\\t\");\n }\n builder.append(\"\\n\\n\");\n }\n\n\n //BUILDER RETURN\n return builder.toString();\n }", "public String dumpState() {\n StringBuilder out = new StringBuilder();\n out.append(currentPlayer);\n for (int i = 0; i < board.length; ++i)\n out.append(\" \" + board[i]);\n\n return out.toString();\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < column; j++) {\n sb.append(game[i][j]);\n }\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "public String toString()\n {\n String boardString = \"\";\n int space = 1;\n for(int i = 0; i < NUM_SQUARES; i++)\n {\n boardString += \"| \" + board[i].toString() + \" | \";\n //Make a new line every 10 squares\n if(space == 10 || space == 20 || space == 30 || space == 40 || space == 50 || space == 60 || space == 70 || space == 80 || space == 90) boardString += \"\\n\";\n space++;\n }\n return boardString;\n }", "public String convertBoardToString(){\n String tmp= \"\";\n\n for (int i=0; i<30; i++){\n for (int j=0; j<80; j++){\n if (board.getCharacter(j,i)==0){\n tmp += '-';\n } else {\n tmp += board.getCharacter(j,i);\n }\n }\n }\n return tmp;\n }", "public String toString() {\r\n\t\tString s = (currentPlayer == getP1() ? \"Cross : \" : \"Nought : \");\r\n\t\tfor (int y = 0; y < 3; y++) {\r\n\t\t\tfor (int x = 0; x < 3; x++) {\r\n\t\t\t\ts = s + board[y][x];\r\n\t\t\t}\r\n\t\t\ts = s + \" \";\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "public String toString() {\n\t\tStringBuilder string = new StringBuilder();\n\t\tstring.append(n + \"\\n\");\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) \n\t\t\t\tstring.append(String.format(\"%2d \", board[i][j]));\n\t\t\tstring.append(\"\\n\");\n\t\t}\n\t\treturn string.toString();\n\t}", "String displayMyBoard();", "public String getStateOfBoard()\n {\n // This function is used to print state of the board. such as number of coins present on the board\n String str=\"\";\n str += \"Black_Coins Count:\"+this.gameController.getCoinsCount(CoinType.BLACK) +\" Red_Coins Count:\"+this.gameController.getCoinsCount(CoinType.RED);\n return str;\n }", "public String drawBoard() {\n fillBoard();\n return \"\\n\" +\n \" \" + boardArray[0][0] + \" | \" + boardArray[0][1] + \" | \" + boardArray[0][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[1][0] + \" | \" + boardArray[1][1] + \" | \" + boardArray[1][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[2][0] + \" | \" + boardArray[2][1] + \" | \" + boardArray[2][2] + \" \\n\";\n }", "public static String printOpenBoard(Game board) {\n return board.openBoardToString();\n }", "public String toString() {\n return String.format(\"Final board:\\n%s\" +\n \"Number of conflicts:%d\\n\" +\n \"Time elapsed: %f seconds\\n\",\n board,\n BoardState.countConflicts(board.getBoard()),\n time * 0.000000001);\n }", "public String toString() {\n // show marbles on board with indexes\n String s = \"\";\n for (int i = 0; i < DIMENSION; i++) {\n if ((i > 4) && (i != 10)) {\n s += \" \".repeat(i - 2);\n // char index bottom board\n s += \"\\u001b[32m\" + String.valueOf((char) ((char) i + 'A' - 1)) + \"\\u001b[0m \";\n } else {\n s += \" \".repeat(i);\n }\n for (int j = 0; j < DIMENSION; j++) {\n if (i + j == 4) {\n if (i == 0) {\n s += \" \";\n } else {\n // char index top board\n s += \"\\u001b[32m\" + String.valueOf((char) ((char) i + 'A' - 1)) + \"\\u001b[0m\";\n }\n } else if ((i + j < 4) || i + j > 15) {\n s += \"\\u001b[32m\";\n if ((i == 7 && j == 9)) {\n s += \"9\";\n } else if ((i == 8 && j == 8)) {\n s += \"8\";\n } else if ((i == 9 && j == 7)) {\n s += \"7\";\n } else if ((i == 10 && j == 6)) {\n s += \"6\";\n } else {\n s += \" \";\n }\n s += \"\\u001b[0m\";\n } else if (isOutOfBoard(fields[i][j])) {\n \n s += fields[i][j].getMarbleColor().toString().charAt(0);\n } else {\n // show marbles with color\n switch (fields[i][j].getMarbleColor()) {\n case BLACK:\n s += \"\\u001b[30mo\";\n break;\n case WHITE:\n s += \"\\u001b[37mo\";\n break;\n case RED:\n s += \"\\u001b[31mo\";\n break;\n case BLUE:\n s += \"\\u001b[34mo\";\n break;\n case NONE:\n s += \" \";\n break;\n }\n }\n s += \"\\u001b[0m \";\n }\n \n s += \"\\n\";\n }\n \n s += \" \".repeat(13) + \"\\u001b[32m1 2 3 4 5\\u001b[0m\";\n return s;\n\n\n }", "public static String toString(String[][] board) {\n\n return board[0][0] + \" \" + board[0][1] + \" \" + board[0][2] + \" \"\n + board[1][0] + \" \" + board[1][1] + \" \" + board[1][2] + \" \"\n + board[2][0] + \" \" + board[2][1] + \" \" + board[2][2];\n }", "@Override\n\tpublic String toString(){\n\t\tString game;\n\t\t\n\t\tgame=this.currentBoard.toString();\n\t\tgame=game+\"best value: \"+this.currentRules.getWinValue(currentBoard)+\" Score: \"+this.points+\"\\n\";\n\t\t\n\t\tif(currentRules.win(currentBoard)){\n\t\t\tgame=game+\"Well done!\\n\";\n\t\t\tfinish=true;\n\t\t}\n\t\telse if(currentRules.lose(currentBoard)){\n\t\t\tgame=game+\"Game over.\\n\";\n\t\t\tfinish=true;\n\t\t}\n\t\t\n\t\treturn game;\n\t}", "public String toString() {\n\t\tString returnString=\"\";\n\t\t\n\t\tfor (int i=0; i<squares.length; i++) {\n\t\t\tfor (int j=0; j<squares.length; j++) {\n\t\t\t\treturnString+=Character.toString(squares[i][j].getValue());\n\t\t\t}\n\t\t\treturnString+=\"// \";\n\t\t}\n\t\t\n\t\treturn returnString;\n\t}", "public String toString ()\n\t{\n\t\tString s = \"Grid:\\n\";\n\t\tfor (int row=0; row<GRID_SIZE; row++)\n\t\t{\n\t\t\tfor (int col=0; col<GRID_SIZE; col++) {\n\t\t\t\ts = s + grid[col][row].value()+ \" \";\n\t\t\t}\n\t\t\ts += \"\\n\";\n\t\t}\n\t\treturn s;\n\t}", "private String boardToString(char[] board) {\n String boardString = \"\";\n for (char aBoard : board) boardString += aBoard;\n return boardString.replaceAll(\" \", \"_\");\n }", "public static String serializeBoard(final Board gameBoard) {\n StringJoiner joiner = new StringJoiner(\" \");\n \n joiner\n .add(generatePiecePlacement(gameBoard.getMatrix()))\n .add(determineActiveColor(gameBoard))\n .add(generateCastlingAvailability(gameBoard));\n \n return joiner.toString();\n }", "public String configString() {\n \n String boardConfig = \"\";\n // adds each element in the array to the string with a space in between\n // condition is numPiles - 1 so last element does not print with a space afterwards\n \n for (int i = 0; i < numPiles - 1; i++){\n boardConfig += piles[i] + \" \";\n }\n boardConfig += piles[numPiles - 1] + \" \";\n \n //check if valid board still\n assert isValidSolitaireBoard();\n \n //return the current board configuration string\n return boardConfig;\n }", "public GoPlayingBoard getCurrentBoard() {\n \t\treturn currentBoard.clone();\n \t}", "@Override\n public String toString() {\n String[] output = new String[getHeight()];\n for (int row=0; row < getHeight(); row++) {\n StringBuilder builder = new StringBuilder();\n for (int col=0; col < getWidth(); col++) {\n Square current = getSquare(row, col);\n builder.append(getCharForSquare(current));\n }\n output[row] = builder.toString();\n }\n return String.join(\"\\n\", output);\n }", "@Override\n\tpublic String toString() {\n\t\tString result = \"-------------------\\n\";\n\t\tfor (Cell[] cellRow : board) {\n\t\t\tresult += \"|\";\n\t\t\tfor (Cell cell : cellRow) {\n\t\t\t\tresult += (cell.val == 0 ? \" \" : cell.val) + \"|\";\n\t\t\t}\n\t\t\tresult += \"\\n-------------------\\n\";\n\t\t}\n\t\treturn result += \"\\n\" + toTest();\n\t}", "public String toString() {\n\t\tStringBuilder buff = new StringBuilder();\n\t\tfor (int y = height-1; y>=0; y--) {\n\t\t\tbuff.append('|');\n\t\t\tfor (int x=0; x<width; x++) {\n\t\t\t\tif (getGrid(x,y)) buff.append('+');\n\t\t\t\telse buff.append(' ');\n\t\t\t}\n\t\t\tbuff.append(\"|\\n\");\n\t\t}\n\t\tfor (int x=0; x<width+2; x++) buff.append('-');\n\t\treturn(buff.toString());\n\t}", "public String toString() {\n\t\tStringBuilder buff = new StringBuilder();\n\t\tfor (int y = height-1; y>=0; y--) {\n\t\t\tbuff.append('|');\n\t\t\tfor (int x=0; x<width; x++) {\n\t\t\t\tif (getGrid(x,y)) buff.append('+');\n\t\t\t\telse buff.append(' ');\n\t\t\t}\n\t\t\tbuff.append(\"|\\n\");\n\t\t}\n\t\tfor (int x=0; x<width+2; x++) buff.append('-');\n\t\treturn(buff.toString());\n\t}", "public String toString() {\n\t\tString r = \"\";\n\t\tchar[][] a = toMatrix();\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tif (a[i][j] == '\\0')\n\t\t\t\t\tr += \"-\";\n\t\t\t\telse\n\t\t\t\t\tr += a[i][j];\n\t\t\t}\n\t\t\tr += \"\\n\";\n\t\t}\n\t\treturn r.substring(0, r.length() - 1);\n\t}", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "public String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (byte m = 0; m < 9; m++) {\n\t\t\tfor (byte n = 0; n < 9; n++) {\n\t\t\t\tsb.append(cells[m][n].getValue());\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static char[][] getBoard() {\n\t\treturn board;\n\t}", "public String toString() {\n\t\treturn (new StringBuilder().append(\"Turn: \")\n\t\t\t.append(turnNumber)\n\t\t\t.append(\"\\n\")\n\t\t\t.append(towerSet.toString())\n\t\t\t.append('\\n')).toString();\n\t}", "public String toString() {\n return String.format(\"%s%s\", column, row);\n }", "public String getBoardName(){\n return boardNameLbl.getText();\n }", "public char[][] getBoard() {\n return board;\n\t}", "String drawBoard();", "public Board getCurrentBoard() {\n return boardIterator.board;\n }", "private String digestGameBoard() {\n StringBuilder config = new StringBuilder();\n for(char[] gameBoardRow : gameBoard) {\n for(char slot : gameBoardRow) {\n config.append(slot);\n }\n }\n return config.toString();\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(this.dim + \"\\n\");\n int counter = 0;\n for (int i = 0; i < this.dim; i++) {\n for (int j = 0; j < this.dim; j++) {\n int n = tiles[counter++];\n s.append(String.format(\"%2d \", n));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public String toString() {\n\tStringBuffer buffer = new StringBuffer();\n\t//\tbuffer.append(\" 6 5 4 3 2 1 \\n\");\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 12; i >= 7; --i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"|\");\n\tbuffer.append(toString(state[13]));\n\tbuffer.append(\"-----------------------------|\");\n\tbuffer.append(toString(state[6]));\n\tbuffer.append(\"\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 0; i <= 5; ++i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\tbuffer.append(\" 0 1 2 3 4 5 \\n\");\n\t\n\treturn buffer.toString();\n }", "private Board getBoard() {\n return gameStatus.getBoard();\n }", "@Override\n public final String toString()\n {\n String str = formatInt(turn)+formatInt(fiftyMove);\n //int counter = 0;\n for (Square[] s1: getSquares())\n {\n for (Square s: s1)\n {\n if (!s.isEmpty())\n {\n str+=\"\"+s;\n //counter++;\n /*if (counter%4==0)\n str+=\"\\n\";*/\n }\n }\n }\n return str;\n }", "public void displayBoard() {\n newLine();\n for (int row = _board[0].length - 1; row >= 0; row -= 1) {\n String pair = new String();\n for (int col = 0; col < _board.length; col += 1) {\n pair += \"|\";\n pair += _board[col][row].abbrev();\n }\n System.out.println(pair + \"|\");\n newLine();\n }\n }", "@Override\n public String toString() {\n StringBuilder builder = new StringBuilder();\n\n for (int row = 0; row < this.getNumberOfRows(); row++) {\n for (int column = 0; column < this.getNumberOfCols(); column++) {\n\n if (row == this.getState()[0] && column == this.getState()[1])\n builder.append(\"* \");\n else\n builder.append(Integer.toString(this.getEnvironment()[row][column]) + ' ');\n\n }\n\n if (row != (this.getNumberOfRows() - 1))\n builder.append('\\n');\n }\n\n return builder.toString();\n }", "public String toString()\n\t{\n\t\tchar rowLetter = (char)('A'+row);\n\t\treturn(\"\"+rowLetter+col);\n\t}", "public String toString() {\n String s = \"\";\n for(int i = 1; i <= rows; i++){\n for(int j = 1; j <= cols; j++){ \n s = s + String.format(\"%2d\",m[i][j]) + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "public String getScoreBoardText() {\n putListInPointOrder();\n String scoreText;\n StringBuilder sb = new StringBuilder();\n\n for (Player player : players)\n sb.append(player.toString() + \"\\n\");\n\n scoreText = sb.toString();\n return scoreText;\n }", "public String getPlugboard() {\r\n\t\tif (plugboard == null) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn plugboard.getPlugboardMap();\r\n\t\t}\r\n\t}", "@Override\n public String toString() {\n StringBuilder output = new StringBuilder();\n\n output.append(\"Currently \" + _passengersOnboard + \" Passengers Onboard\\r\\n\");\n output.append(\"On Floor : \" + _currentFloor + \"\\r\\n\");\n return output.toString();\n\n }", "@Override\n public String displayGameBoard(int stage) {\n String out=\"\";\n switch(stage) {\n case 0:\n out = \"Initial State: \";\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 1:\n out = String.format(\"%s rolls %d:\", this.currentPlayer.getName(), this.numSquares);\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 2:\n out = \"Final State: \";\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 3:\n out = String.format(\"%s wins!\",this.currentPlayer.getName());\n break;\n }\n return(out);\n }", "public String toString() {\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tint n = dimension();\r\n\t\tsb = sb.append(n + \"\\n\");\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tsb = sb.append(\" \" + this.blocks[i][j]);\r\n\t\t\t}\r\n\t\t\tif (i != n) {\r\n\t\t\t\tsb = sb.append(\"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String toString()\n\t{\n\t\treturn \"Current Floor: \" + currentFloor +\" Total passangers on board: \" + totalPassengers + \" Direction: \" + currentDirection;\n\t}", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\tString s = new String(\"\");\r\n\t\tfor (int i = 0; i < maze.length; i++) {\r\n\t\t\ts+= \"\\n\";\r\n\t\t\ts+= \"Floor #\";\r\n\t\t\ts+= (i+1);\r\n\t\t\ts+= \":\";\r\n\t\t\ts+= \"\\n\";\r\n\t\t\tfor (int j = 0; j < maze[0].length; j++) {\r\n\t\t\t\ts+= \"\\n\";\r\n\t\t\t\tfor (int j2 = 0; j2 < maze[0][0].length; j2++) {\r\n\t\t\t\t\ts += this.maze[i][j][j2];\r\n\t\t\t\t\ts += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts+= \"\\n\";\r\n\t\t}\r\n\t\treturn s;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\tString countCell = \"\";\n\t\tfor ( int row = 0; row < gameGrid.length; row++){\n\t\t\tfor ( int column = 0; column < gameGrid[0].length; column++){\n\t\t\t\tif(gameGrid[row][column] == 1) //this represents a live cell or exist\n\t\t\t\t\tcountCell = countCell + \"0\"; \n\t\t\t\telse{\n\t\t\t\t\tcountCell = countCell + \".\";//this will create little dots if there is no live cell...\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcountCell = countCell + \"\\n\"; //creates a new line and moves down in the array\n\t\t}\n\n\t\treturn countCell;\n\t}", "public void printBoard() {\r\n\t\tBoard.printBoard(this.board);\r\n\t}", "public String toString() { \n String canvas = \"\";\n for(int i=0; i<height; i++) {\n for(int j=0; j<width; j++) {\n if(drawingArray[i][j] == ' ') {\n canvas += \"_\";\n } else {\n canvas += drawingArray[i][j];\n }\n }\n canvas += System.lineSeparator();\n }\n return canvas;\n }", "public String toString() {\n StringBuilder res = new StringBuilder();\n res.append(n + \"\\n\");\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++)\n res.append(String.format(\" %2d \", tileAt(i, j)));\n res.append(\"\\n\");\n }\n return res.toString();\n }", "public char[][] getBoardState(){\n\t\treturn board;\n\t}", "public String toString()\r\n {\r\n String result = \"\";\r\n \r\n for (int index=0; index < top; index++) \r\n result = result + stack[index].toString() + \"\\n\";\r\n \r\n return result;\r\n }", "@Override\r\n public String toString() {\r\n StringBuilder res = new StringBuilder();\r\n for (int i=0 ; i<this.tiles.length ; i++) {\r\n if (i>0 && i%this.width == 0) {\r\n res.append(\"\\n\");\r\n }\r\n res.append(this.tiles[i]);\r\n }\r\n return res.toString();\r\n }", "public String toString() {\n\t\treturn toString(0, 0);\n\t}", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(N + \"\\n\");\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n s.append(String.format(\"%2d \", tiles[i][j]));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(N + \"\\n\");\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n s.append(String.format(\"%2d \", tiles[i][j]));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public String toString()\n\t{\n\t\treturn (new String(wLocalBuffer)) ;\n\t}", "public void printBoard() {\n String value = \"\";\n renderBoard();\n System.out.println(\"\");\n // loop to print out values in rows and columns\n for (int i = 0; i < game.getRows(); i++) {\n for (int j = 0; j < game.getCols(); j++) {\n if (grid[i][j] == 0)\n value = \".\";\n else\n value = \"\" + grid[i][j];\n System.out.print(\"\\t\" + value);\n }\n System.out.print(\"\\n\");\n }\n }", "public String toString() {\r\n\t\treturn gameState;\r\n\t}", "public String toString() {\n\tString retStr = \"\";\n\tfor (int r = 0; r < this.size(); r++){\n\t for (int c = 0; c < this.size(); c++){\n\t\tretStr += matrix[r][c] + \"\\t\";\n\t }\n\t retStr += \"\\n\";\n\t}\n\treturn retStr;\n }", "public String stateToCheckerboardString(int paraState) {\n\t\tint[][] tempCheckerboard = stateToCheckerboard(paraState);\n\t\tString resultString = \"\\r\\n\";\n\t\t//resultString += \"Checkerboard state: \\r\\n\";\n\t\tfor (int i = 0; i < tempCheckerboard.length; i++) {\n\t\t\tfor (int j = 0; j < tempCheckerboard[0].length; j++) {\n\t\t\t\tif (tempCheckerboard[i][j] == WHITE) {\n\t\t\t\t\tresultString += \"o \";\n\t\t\t\t} else if (tempCheckerboard[i][j] == BLACK) {\n\t\t\t\t\tresultString += \"x \";\n\t\t\t\t} else {\n\t\t\t\t\tresultString += \"- \";\n\t\t\t\t}//Of if\n\t\t\t}//Of for j\n\t\t\tresultString += \"\\r\\n\";\n\t\t}//Of for i\n\t\t\n\t\t//resultString += currentState;\n\t\treturn resultString;\n\t}", "public void printShipBoard() {\n\t\tSystem.out.println(Arrays.deepToString(this.shipBoard));\n\t}", "public String toString() { return stringify(this, true); }", "public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(n + System.lineSeparator());\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n sb.append(tiles[i][j] + \" \");\n }\n sb.append(System.lineSeparator());\n }\n return sb.toString();\n }" ]
[ "0.834287", "0.79493904", "0.78302455", "0.77541566", "0.77467245", "0.77438974", "0.7742452", "0.77234113", "0.76909447", "0.7689286", "0.7660723", "0.7645146", "0.7608319", "0.75960135", "0.75927246", "0.75206995", "0.75187665", "0.75126946", "0.74971664", "0.74943626", "0.7488777", "0.7486935", "0.74686253", "0.74491453", "0.74423015", "0.74371684", "0.7430691", "0.73981297", "0.7356086", "0.7348812", "0.7302989", "0.715883", "0.71475327", "0.71227115", "0.70977074", "0.70935994", "0.709262", "0.7089031", "0.70483804", "0.70130676", "0.6978978", "0.69634783", "0.692377", "0.6874388", "0.6848117", "0.68282515", "0.6823721", "0.67713463", "0.67399454", "0.66883576", "0.6683847", "0.6682214", "0.668051", "0.6667381", "0.6627853", "0.6627853", "0.6623136", "0.6621473", "0.659093", "0.6586086", "0.6541976", "0.6523707", "0.6522754", "0.65191984", "0.6519183", "0.65024054", "0.64920986", "0.64919466", "0.64903754", "0.6482621", "0.6472664", "0.6458001", "0.64568007", "0.64440715", "0.6425135", "0.64184177", "0.6389582", "0.63840723", "0.6372715", "0.6354704", "0.6354331", "0.63501495", "0.6334981", "0.63260514", "0.6317293", "0.63125515", "0.62901795", "0.6287841", "0.6286636", "0.62791586", "0.62653875", "0.62653875", "0.625676", "0.6254973", "0.62524116", "0.62396705", "0.6237503", "0.62314343", "0.6230983", "0.62009335" ]
0.8355081
0
Log.e(Constant.MAIN_LOG, tHttpPage.getPageTotal() + "");
@Override public T call(HttpPage<T> tHttpPage) { if (!tHttpPage.getCode().equals("00")) { throw new ApiException(tHttpPage.getCode()); } return tHttpPage.getResult(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getAmountPage();", "public String getTotalPage() {\r\n return totalPage;\r\n }", "int getPagesAmount();", "@Override\r\n\t\tpublic int getCurrentpage() throws Exception\r\n\t\t\t{\n\t\t\t\treturn 0;\r\n\t\t\t}", "public static int getTotalPage() {\n List<WebElement> PAGINATION = findElements(pagination);\n int size = PAGINATION.size() - 1;\n //Get the number of the second-last item which next to the \">\" icon\n WebElement lastPage = findElement(By.xpath(String.format(last_page, size)));\n return Integer.parseInt(lastPage.getText());\n }", "public int getTotalPages()\r\n {\r\n return pageNames.size()-1;\r\n }", "public int getTotalPages() {\r\n return totalPages;\r\n }", "public int getPageTotalNumber(int totalNumber) {\n/* 70 */ int fullPage = totalNumber / 25;\n/* 71 */ return (totalNumber % 25 > 0) ? (fullPage + 1) : ((fullPage == 0) ? 1 : fullPage);\n/* */ }", "String pageDetails();", "public Integer getBookTotalPage() {\n return bookTotalPage;\n }", "@GetMapping(value = \"/memTotal\")\n public ResponseEntity<Long> memTotal(){\n try {\n String s = CommandExecutor.execute(Commands.mem);\n s = findLine(s, \"MemTotal\");\n s = filterForNumbers(s);\n Long memTotal = Long.parseLong(s)/1_000_000;\n return ResponseEntity.ok(memTotal);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return ResponseEntity.status(500).build();\n }", "public String _paymentpage_pagefinished(String _url) throws Exception{\n__c.ProgressDialogHide();\n //BA.debugLineNum = 158;BA.debugLine=\"Loaded = True\";\n_loaded = __c.True;\n //BA.debugLineNum = 159;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "int getPageNumber();", "public int getCountRequests() {\n/* 415 */ return this.countRequests;\n/* */ }", "public int getPageCount() { return _pages.size(); }", "public void setTotalPage(String totalPage) {\r\n this.totalPage = totalPage;\r\n }", "private void updateTotalPageNumbers() {\n totalPageNumbers = rows.size() / NUM_ROWS_PER_PAGE;\n }", "int getPagesize();", "long getPageSize();", "long getPageSize();", "long getPageSize();", "Integer getPage();", "@Override\r\n\tpublic int nombrePage() {\n\t\treturn 0;\r\n\t}", "public void setBookTotalPage(Integer bookTotalPage) {\n this.bookTotalPage = bookTotalPage;\n }", "public int getTotalPage() {\n return getSize() == 0 ? 1 : (int) Math.ceil((double) total / (double) getSize());\n }", "int getLastItemOnPage();", "@Override\r\n\tpublic int customPageViewTotal() {\n\t\treturn adminCustomChartMapper.customPageViewTotal();\r\n\t}", "private int totalNumberOfSpansInWebappTrace() {\n return 3;\n }", "public long getTotal() { return total; }", "public long getTotal() { return total; }", "public int getPageNo() {\n return pageNo;\n }", "@Override\n public double total() {\n return 2500;\n }", "int getPage();", "public int getPages(){\n return pages;\n }", "io.dstore.values.IntegerValue getPageNo();", "io.dstore.values.IntegerValue getPageNo();", "private static int lastPage(PdfReader pdfFile){\n int pages;\n\n pages = pdfFile.getNumberOfPages();\n\n return(pages);\n }", "public Long getTotalPageNum() {\n\t\treturn this.totalPageNum;\n\t}", "public int getEndPage() {\n return endPage;\n }", "io.dstore.values.StringValue getPage();", "int getPageSize();", "int getPageSize();", "int getPageSize();", "int getPageSize();", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tpageIndex++;\n\t\t\tloadInfo(pageIndex, 1);\n\t\t\tif (DzqcStu.isDebug) {\n\t\t\t\tLog.i(\"pageIndex------\", pageIndex+\"\");\n\t\t\t}\n\t\t}", "public float total_scroll() {\r\n\t\treturn total_scroll;\r\n\t}", "public double Get_Total(Context context){\n return ((double) (TrafficStats.getTotalRxBytes()+TrafficStats.getTotalTxBytes())/1048576);\n }", "public String getPageText();", "@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}", "public int getTotalArticle() {\n int listLimit;\n int total;\n int totalPage;\n listLimit = getArticleRowCount();\n clickGoToLastPageBtn();\n // Has to used this method instead of goToPageBtn().size() since the maximum size of the goToPageBtn list is always 10\n totalPage = Integer.parseInt(goToPageBtn().get(goToPageBtn().size() - 1).getText().trim());\n total = getArticleRowCount() + listLimit * totalPage;\n return total;\n }", "public void setPageInfo(){\n\t\tif(AllP>=1){\n\t\t\tPageInfo=\"<table border='0' cellpadding='3'><tr><td>\";\n\t\t\tPageInfo+=\"Show: \"+PerR+\"/\"+AllR+\" Records!&nbsp;\";\n\t\t\tPageInfo+=\"Current page: \"+CurrentP+\"/\"+AllP;\n\t\t\tPageInfo+=\"</td></tr></table>\";\t\t\t\n\t\t}\t\t\t\t\n\t}", "public Integer getTotalPageCount() {\n return totalPageCount;\n }", "protected int getSkipPage(){\n\t\tint pageNum = 0;\n\t\tfor (Integer p : mPageNum){\n\t\t\tpageNum *= 10;\n\t\t\tpageNum += p.intValue();\n\t\t}\n\t\tif (pageNum > Integer.MAX_VALUE){\n\t\t\tpageNum = Integer.MAX_VALUE;\n\t\t}\n\t\tif (pageNum <= getTotalPage()){\n\t\t\tmSkipPage = pageNum;\n\t\t}\n\t\treturn mSkipPage;\n\t}", "public void total() {\n\t\t\n\t}", "public int getPageEnd() {\n int val = (_pageIndex + 1) * _pageSize;\n return (val > _totalRecords) ? _totalRecords : val;\n }", "private int getPageEnd() {\n if(itemrow==0)\n return 1;\n if(itemrow%displaylimit!=0)\n return itemrow / displaylimit + 1;\n else\n return itemrow / displaylimit;\n }", "@Override\r\n\tpublic int[] calPageParameter(int curPage) {\n\t\tint start = curPage*BATCH_NUM+1;\r\n\t\tint end = (curPage+1)*BATCH_NUM;\r\n return new int[]{start,end};\r\n\t}", "@Override\n public String getTotalSavings() {\n\n setLogString(\"Get total Savings Amount\", true, CustomLogLevel.HIGH);\n final String savingsValue = getElement(getDriver(), By.className(SAVINGS_DOLLARS),\n TINY_TIMEOUT).getText();\n setLogString(\"Total Savings :\" + savingsValue, true, CustomLogLevel.LOW);\n return savingsValue;\n }", "int totalWritten();", "@Override\n\tpublic Integer getTotalPages(ConditionInfo cf) {\n\t\treturn rd.getTotalPages(cf);\n\t}", "public int getLastPage() {\n\t\treturn lastPage;\n\t}", "@Override\n\tpublic int getTotalPage(Integer pageSize, EmpTypeVo vo) {\n\t\treturn 0;\n\t}", "@Test\n public void test002() {\n int total = response.extract().path(\"total\");\n\n\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"The search query is: \" + total);\n System.out.println(\"------------------End of Test---------------------------\");\n\n }", "@Override\r\n\tpublic IPage<T> setTotal(long total) {\n\t\treturn null;\r\n\t}", "public static int getPageTo(String info) {\n/* 816 */ int pageNum = 0;\n/* */ \n/* 818 */ if (!Utils.isNullOrEmpty(info)) {\n/* */ try {\n/* 820 */ JSONObject jsonObj = new JSONObject(info);\n/* 821 */ pageNum = jsonObj.getInt(\"To\");\n/* 822 */ } catch (Exception e) {\n/* 823 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }\n/* */ \n/* 827 */ return pageNum;\n/* */ }", "@Override\n public int numberOfPages() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }", "public int findTotalLof() throws DAOException;", "public int getPageIncrement() {\n \tcheckWidget();\n \treturn pageIncrement;\n }", "public void setTotalPageCount(Integer totalPageCount) {\n this.totalPageCount = totalPageCount;\n }", "@Override\n public String toString() {\n return super.toString() + \"\\nSố trang sách: \"+amountPage\n +\"\\nTình trang sách: \"+status+\"\\nSố lượng mượn: \"+amountBorrow;\n }", "default Integer getPageSize() {\n return 10;\n }", "@Override\n public void onLoadMore() {\n MyApplacation.getmHandler().postDelayed(new Runnable() {\n @Override\n public void run() {\n pageNo++;\n getDataForService();\n }\n }, 1000);\n\n }", "public long getTotal() {\r\n\t\treturn page.getTotalElements();\r\n\t}", "public int getTotal() {\n return total;\n }", "public String get(@PAGE int page) {\n if (!mPageSummary.containsKey(page)) {\n return \"\";\n }\n return mPageSummary.get(page).toString();\n }", "@Override\n public int getCount() {\n int TOTAL_PAGES = totalPages;\n return TOTAL_PAGES;\n }", "public int getTotal () {\n return total;\n }", "int getCurrentPage();", "public int getTotalPageCount() {\n try {\n return (int) this.webView.getEngine().executeScript(\"PDFViewerApplication.pagesCount;\");\n } catch (RuntimeException e) {\n e.printStackTrace();\n return 0;\n }\n }", "public long getTimestampOfPage() {\n return timestampOfPage;\n }", "public int getPages()\n {\n return pages;\n }", "public void updateProgress( int pagesPrinted );", "private int pagesLeft() {\n return this.pages - this.pagesRead;\n }", "@Override\n\t\t\t\t\t\tpublic void onLoading(long count, long current) {\n\t\t\t\t\t\t\tsuper.onLoading(count, current);\n\t\t\t\t\t\t\tprocess_tv.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\tint process = (int) (current*100/count);\n\t\t\t\t\t\t\tprocess_tv.setText(\"下载进度:\"+process+\"%\");\n\t\t\t\t\t\t}", "protected int getInitialPage(HttpServletRequest request) {\n return 0;\n }", "public int getTotalPages() {\r\n\t\treturn page.getTotalPages();\r\n\t}", "public String getPageNum() {\r\n return pageNum;\r\n }", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "@Override\n public void onPageChanged(int page, int pageCount) {\n }", "@Override\r\n\tpublic int selectJobMngTotalPaging() {\n\t\treturn 0;\r\n\t}", "public Integer getCurrentPageSize();", "public static int getPageHits() {\r\n return _count;\r\n }", "short getPageStart();", "public String getPage(String targetUrl, String q, Long totalCnt, int rows, int start, int page) {\n String paramStr = \"\";\n String htmlPage = \"\";\n String pageUrl = \"\";\n\n int targetPageValue;\n int pagingMin;\n int pageSeed;\n int pageBlock = page;\n int countInPage = page;\n int loopCnt = 0;\n int currentPage = 0;\n\n try {\n double totalPage;\n switch (rows) {\n case 8:\n currentPage = start / 8;\n break;\n case 16:\n currentPage = start / 16;\n break;\n case 24:\n currentPage = start / 24;\n break;\n\n case 10:\n currentPage = start / 10;\n break;\n case 20:\n currentPage = start / 20;\n break;\n case 50:\n currentPage = start / 50;\n break;\n case 100:\n currentPage = start / 100;\n break;\n default:\n currentPage = start / rows;\n break;\n }\n\n pagingMin = ((currentPage - 1) / countInPage) * countInPage;\n if (currentPage > 5) {\n pageSeed = currentPage - 4;\n } else {\n pageSeed = pagingMin;\n }\n double flTotalPage = Float.parseFloat(totalCnt.toString()) / rows;\n\n totalPage = Math.ceil(flTotalPage);\n\n paramStr = \"q=\" + q;\n\n\n\n\n if (currentPage != 0) { //이전\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + (start - rows);\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\"></a></li>\\n\";\n }\n\n while (loopCnt < pageBlock && pageSeed < totalPage) {\n if (pageSeed == currentPage) {\n targetPageValue = pageSeed;\n htmlPage += \"<li class=\\\"active\\\"><a href=\\\"javascript:;\\\">\" + (targetPageValue + 1) + \"</a></li>\\n\";\n } else {\n targetPageValue = pageSeed;\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + targetPageValue * rows;\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\">\" + (targetPageValue + 1) + \"</a></li>\\n\";\n }\n pageSeed++;\n loopCnt++;\n }\n\n if (currentPage < totalPage - 1) { //다음\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + (start + rows);\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\"></a></li>\";\n }\n\n return htmlPage;\n } catch (Exception e) {\n System.out.println(\"getPage : \" + e.toString());\n return \"\";\n }\n }", "public double getTotal (){ \r\n return total;\r\n }", "public int getPages() {\n return pages;\n }", "@Override\r\n\tprotected String go() throws Exception {\n\t\tif(userSize==0)\r\n\t\t{\r\n\t\t\tuserSize=3;\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tint userid=(Integer)this.get(\"currentUserid\");\r\n\t\t\tProDiaryService proDiaryService=(ProDiaryService)this.getBean(\"proDiaryService\");\r\n\t\t\t\r\n\t\t\tpage=proDiaryService.getCurrProDiaryListByUserID(userid,userSize,pageNo);\r\n\t\t\tPagefoot pagefoot = new Pagefoot();\r\n\t\t\tpageString = pagefoot.packString(page, pageNo,\"getPage\",userSize);\r\n\t\t\t \r\n\t\t\t}catch(Exception e){\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t}\r\n\t return \"success\";\r\n\t}", "String getStartpage();", "@Test\n\tpublic void totalHires()\n\t{\t\t\n\t\tassertTrue(controller.getReport().getTotalHires() == 4);\n\t}" ]
[ "0.6914778", "0.63489866", "0.6275213", "0.59681875", "0.59500134", "0.58766174", "0.5831466", "0.580111", "0.5787155", "0.5758351", "0.57292", "0.5723332", "0.57213014", "0.57091343", "0.5654179", "0.5625503", "0.5609502", "0.55900836", "0.55853486", "0.55853486", "0.55853486", "0.5585084", "0.5540258", "0.55364656", "0.55309033", "0.5519509", "0.5492076", "0.5489743", "0.54877734", "0.54877734", "0.5480449", "0.547915", "0.5468407", "0.5464886", "0.54574054", "0.54574054", "0.54573745", "0.54479444", "0.5434587", "0.5428822", "0.54200685", "0.54200685", "0.54200685", "0.54200685", "0.5406607", "0.54045653", "0.53968537", "0.538954", "0.53786874", "0.5370892", "0.53645426", "0.5363138", "0.5352014", "0.5349406", "0.53458595", "0.5339392", "0.53277653", "0.532764", "0.5323087", "0.5317215", "0.5309782", "0.53031754", "0.5302663", "0.5302229", "0.5301608", "0.5296676", "0.52904725", "0.5282685", "0.52825516", "0.5279498", "0.5278118", "0.52756345", "0.52535254", "0.52529556", "0.5230137", "0.52300155", "0.5227777", "0.522418", "0.5217549", "0.5210026", "0.52092946", "0.5208555", "0.5205094", "0.5196285", "0.51960874", "0.51880944", "0.51879853", "0.518585", "0.518585", "0.518585", "0.51853216", "0.5174546", "0.51724243", "0.5171511", "0.51649076", "0.51593375", "0.51589286", "0.51526564", "0.5149014", "0.51396036", "0.5137519" ]
0.0
-1
never happens as already handled
public int execute( ModelImpl model ) throws Exception { return STATUS_PAGE_NOT_FOUND; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean isHandled() {\n\t\treturn true;\r\n\t}", "@Override\n public boolean isHandled() {\n return handled;\n }", "protected void afterActiveHandled() {\n\t}", "@Override\n\tpublic void initiateHandling() {\n\t}", "@Override\n\tpublic void initiateHandling() {\n\t}", "@Override\n\tpublic void initiateHandling() {\n\t}", "@Override\n\tvoid endHandling() {\n\t}", "@Override\n\tvoid endHandling() {\n\t}", "@Override\n\tvoid endHandling() {\n\t}", "@Override\n\tvoid endHandling() {\n\t}", "void preHandle() throws InvalidationException;", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic boolean postIt() {\n\t\treturn false;\n\t}", "public final void setHandled() {\n this.handled = true;\n this.target = null;\n this.info = null;\n }", "protected void additionalProcessing() {\n\t}", "public boolean isHandled() {\r\n return handled;\r\n }", "@Override\n\tpublic boolean handlesThrowable() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void catchPiece() {\n\t\t\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tprotected void interr() {\n\t}", "public void handle() throws Exception {}", "protected boolean func_70041_e_() { return false; }", "@Override\n public void setHandled(boolean status) {\n handled = true;\n }", "@Override\r\n\tpublic boolean handleMessage(Message msg) {\n\t\treturn false;\r\n\t}", "@Override\n\tpublic boolean beforeHandle(BaseEvent event) {\n\t\treturn false;\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "public void smell() {\n\t\t\n\t}", "public HandlePiaoSvlt() {\n\t\tsuper();\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void exucute() {\n\t\t\n\t}", "protected abstract void handleOk();", "protected void handleCleanup() {\r\n\t\t// Implement in subclass\r\n\t}", "protected int handleNext(int position) {\n/* 283 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n\tpublic void accept_order() {\n\t\t\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n\tprotected void processInput() {\n\t}", "public final void mo51373a() {\n }", "private final void m90474c() {\n RxBus.m86979a().mo84367a(new UnFriendlyEvent(2));\n popSelf();\n }", "public void process(Object signal)\r\n/* 25: */ {\r\n/* 26:23 */ System.out.println(\"Cause observed!\");\r\n/* 27: */ }", "@Override\n\tpublic void preBacktrack() {\n\t\t\n\t}", "protected void handleMessage(Message msg) {}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n\n }", "@Override\n public void onSure() {\n\n }", "void berechneFlaeche() {\n\t}", "public void markHandled(int newVal){\n if(count == newVal || count + 1 == newVal) count = newVal;\n else throw new RuntimeException(\"Message was handled out of order\");\n }", "public boolean proceedOnErrors() {\n return false;\n }", "@Override\r\n \tprotected void handlePossibleInterpreterChange() {\n \t\t\r\n \t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\r\n\tpublic boolean doCatch(Throwable ex) throws Exception\r\n\t{\n\t\treturn false;\r\n\t}", "protected void handleOther(final boolean invalidCmd) {\r\n\t\t// do nothing\r\n\t}", "@Override\n public void onSure() {\n\n }", "private final void m90475d() {\n RxBus.m86979a().mo84367a(new UnFriendlyEvent(1));\n popSelf();\n }", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "@Override\n protected void onFar() {\n }", "@Override\n\tpublic void afterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\t\tsuper.afterConcurrentHandlingStarted(request, response, handler);\n\t}", "private TedCorrigendumHandler() {\n throw new AssertionError();\n }", "@Override\n\tpublic void inorder() {\n\n\t}", "private void callHandlerAddedForAllHandlers() {\n /*\n r2 = this;\n monitor-enter(r2)\n r0 = 1\n r2.registered = r0 // Catch:{ all -> 0x0015 }\n io.netty.channel.DefaultChannelPipeline$PendingHandlerCallback r0 = r2.pendingHandlerCallbackHead // Catch:{ all -> 0x0015 }\n r1 = 0\n r2.pendingHandlerCallbackHead = r1 // Catch:{ all -> 0x0015 }\n monitor-exit(r2) // Catch:{ all -> 0x0015 }\n L_0x000a:\n if (r0 == 0) goto L_0x0012\n r0.execute()\n io.netty.channel.DefaultChannelPipeline$PendingHandlerCallback r0 = r0.next\n goto L_0x000a\n L_0x0012:\n return\n L_0x0013:\n monitor-exit(r2) // Catch:{ all -> 0x0015 }\n throw r0\n L_0x0015:\n r0 = move-exception\n goto L_0x0013\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p043io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers():void\");\n }", "void postHandle() throws InvalidationException;", "@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}", "@Override\n\tpublic void process(Exchange arg0) throws Exception {\n\t\t\n\t}", "protected int handlePrevious(int position) {\n/* 289 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\r\n\tpublic boolean handleEvent(IEvent event) {\n\t\treturn false;\r\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onIOException(IOException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n\n }", "@Override\r\n\tprotected void doF3() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\t\tpublic void worked(int arg0) {\n\n\t\t}", "protected void failed()\r\n {\r\n //overwrite\r\n }", "public boolean handleMessage(Message message)\n {\n return false;\n }", "public void postProcessing() {\n //empty\n }", "@Override\n\tpublic void handleEvent(Event arg0) {\n\t\t\n\t}", "protected void handleECEMarkedPacket() {\n //halveCongestionWindow();\n }", "@Override\n\tprotected void handleClose() {\n\t}", "private void correctError()\r\n\t{\r\n\t\t\r\n\t}", "public final boolean isHandled() {\n return this.handled;\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void handleMessage(Message message) {}", "public boolean method_108() {\r\n return false;\r\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void processEvent(Event e) {\n\n\t}", "public void inquiryError() {\n\t\t\n\t}", "@Override\n\tpublic String process() {\n\t\treturn null;\n\t}", "@Override\r\n\t\tpublic void handle(Event e) {\r\n\t\t\t// TODO Auto-generated method stub\r\n\t\t\tlogger.error(\"Error: handle never pressed. \");\r\n\t\t}", "@Override\n\tpublic void afterConcurrentHandlingStarted(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler) throws Exception {\n\t\tsuper.afterConcurrentHandlingStarted(request, response, handler);\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n public void handleMessage(Message msg) {\n }" ]
[ "0.7058149", "0.67302567", "0.6613174", "0.62500566", "0.62500566", "0.62500566", "0.6184525", "0.6184525", "0.6184525", "0.6184525", "0.6064645", "0.6031178", "0.6027964", "0.5970588", "0.59680873", "0.5959335", "0.5946339", "0.59401155", "0.5918813", "0.5914061", "0.5913745", "0.58876735", "0.58756113", "0.58570284", "0.584921", "0.58470285", "0.58294195", "0.5825969", "0.58198345", "0.5794919", "0.5781466", "0.57807004", "0.5770903", "0.5689192", "0.5672968", "0.5666307", "0.56584656", "0.56565374", "0.5650792", "0.5650792", "0.56300867", "0.5614296", "0.560095", "0.5579035", "0.55764383", "0.55698186", "0.5565152", "0.5556355", "0.55489814", "0.55468863", "0.5544016", "0.55416995", "0.5536816", "0.55366385", "0.55360484", "0.55360484", "0.55260235", "0.55232185", "0.5517824", "0.55159205", "0.551244", "0.551244", "0.549852", "0.5482258", "0.54821193", "0.547848", "0.5472952", "0.54687464", "0.54670954", "0.54639727", "0.5461225", "0.54609364", "0.5459654", "0.54590064", "0.5458593", "0.54585284", "0.5458064", "0.545789", "0.5451844", "0.54440784", "0.54388", "0.5436552", "0.543139", "0.5431386", "0.54299587", "0.5420612", "0.54196364", "0.54193103", "0.5415098", "0.5414574", "0.54106855", "0.5408233", "0.5407888", "0.5404334", "0.5402164", "0.53999496", "0.5391616", "0.5391616", "0.5391616", "0.5390835", "0.53880835" ]
0.0
-1
TODO Autogenerated method stub
private static int playblackjack(int i, int j) { if (i > 21 && j > 21) { return 0; } if (i > 21) { return j; } if (j > 21) { return i; } if (i > j) { return i; } else { return j; } }
{ "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
Created by Main Server on 28.12.2016.
public interface ModelFactory <ModelObject> { public void createElement(ModelObject object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void init() {\n\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@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 create() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \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 tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n protected void startUp() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void create() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\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\tprotected void initialize() {\n\n\t}", "public final void mo51373a() {\n }", "@Override\n void init() {\n }", "@Override\n public void init() {}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "private Singletion3() {}", "@Override\n public void init() {\n }", "private static void cajas() {\n\t\t\n\t}", "private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void create() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "protected void mo6255a() {\n }", "public contrustor(){\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void mo6081a() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void create() {\n\r\n\t}", "private HSBC() {\n\t\t\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 static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "zzang mo29839S() throws RemoteException;", "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 }", "private void initialize() {\n\t\t\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "public void mo38117a() {\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "private TMCourse() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void init() {\n\n\n\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "protected void onFirstUse() {}", "Petunia() {\r\n\t\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n public void initialize() { \n }", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void initialize() {\n \n }", "private SingleTon() {\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}" ]
[ "0.6046734", "0.57254076", "0.5694772", "0.56544393", "0.5598509", "0.55940074", "0.5577986", "0.55733687", "0.5572704", "0.5572704", "0.55476475", "0.55464786", "0.553809", "0.553809", "0.553809", "0.553809", "0.553809", "0.553809", "0.5532628", "0.55216783", "0.5517684", "0.5514756", "0.549284", "0.5492623", "0.5492623", "0.547639", "0.54731125", "0.54679924", "0.5467396", "0.543803", "0.543803", "0.543389", "0.54336464", "0.54284066", "0.54284066", "0.54284066", "0.54284066", "0.54284066", "0.5419193", "0.5414798", "0.53990865", "0.5397747", "0.5391347", "0.53909653", "0.53890806", "0.5387321", "0.53869903", "0.5385139", "0.5381475", "0.5379695", "0.53754556", "0.5363933", "0.5363933", "0.5363933", "0.5360053", "0.5358363", "0.53486013", "0.53448313", "0.53440934", "0.53407145", "0.53407145", "0.5338727", "0.5337993", "0.53371596", "0.53367954", "0.53340423", "0.53340423", "0.53340423", "0.5323923", "0.5318929", "0.5318321", "0.5318321", "0.5318321", "0.53115743", "0.53100073", "0.53100073", "0.53100073", "0.53100073", "0.53100073", "0.53100073", "0.53100073", "0.5309887", "0.5308574", "0.5308574", "0.5308574", "0.53066087", "0.53059953", "0.53059953", "0.5291914", "0.5287738", "0.528741", "0.5285656", "0.52840817", "0.5276049", "0.52705604", "0.52651644", "0.52650106", "0.52641326", "0.5262395", "0.5261095", "0.5256026" ]
0.0
-1
Replace the changed fields and update the contents of inputFileContent to the data file
public static void architect() { NewProject.architect_name = getInput("Please enter the NEW name of the architect: "); NewProject.architect_tel = getInput("Please enter the NEW telephone number of the architect: "); NewProject.architect_email = getInput("Please enter the NEW email of the architect: "); NewProject.architect_address = getInput("Please enter the NEW address of the architect: "); UpdateData.updateArchitect(); updateMenu(); //Return back to previous menu. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateDataFile(DataFile dataFile) {\n updateMeeting(dataFile.getMeeting());\n }", "void updateFile() throws IOException;", "public int update(FFileInputDO FFileInput) throws DataAccessException;", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "@Override\r\n\tpublic void updateFileData(FileMetaDataEntity userInfo) {\n\t\t\r\n\t}", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void update(String filename, SensorData sensorData){\n //Adds the sensor data to the buffer. \n addToBuffer(filename, sensorData);\n \n //Uploads the data to the server if it's turned on. \n if (Server.getInstance().getServerIsOn())\n if(uploadData()){\n //If the upload was successful, clear the buffer.\n clearBuffer();\n }\n }", "public FileFormatFormData update(FileFormatFormData formData)\r\n\t\t\tthrows ProcessingException;", "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "private void updateToFile(PQNode node) throws Exception{\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n int replaceIndex = node.getPqIndex()-bufStart;\n\n nodes.set(replaceIndex,node);\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n storeToFile(file,nodes, false);\n }", "public void replaceFile(String inputFilename) {\n try {\n FileReader fr = new FileReader(inputFilename);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n if (line.isEmpty()) {\n System.out.println();\n } else {\n line = replaceLine(line);\n System.out.println(line);\n }\n }\n } catch (IOException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }", "public void testChanges(String filePath) {\n Object[] fileObjectArray = fetchTextFile(filePath);\n String newFile = prepareText(fileObjectArray);\n System.out.println(newFile);\n }", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "private void updateFiles() {\n\t}", "public void updateContent(Map<String, ContentChange> files);", "private void setDataFileChanged(String newPath) {\r\n \t\t// set file to be reloaded if changed\r\n \t\tif ((null == dataFile && !newPath.equals(\"\"))\r\n \t\t\t\t|| (null != dataFile && !dataFile.equals(newPath))) {\r\n \t\t\treloadFile = true;\r\n \t\t}\r\n \t\t// copy new value\r\n \t\tdataFile = newPath;\r\n \t\t// add log\r\n \t\tif (localLOGV) {\r\n \t\t\tLog.i(TAG, \"Reload file set to \" + String.valueOf(reloadFile));\r\n \t\t}\r\n \t}", "private void copyInputFile(String originalFilePath, String destinationFilePath) {\n String inputType = ((DataMapperDiagramEditor) workBenchPart.getSite().getWorkbenchWindow().getActivePage()\n .getActiveEditor()).getInputSchemaType();\n\n if (null != originalFilePath && null != destinationFilePath\n && (inputType.equals(\"XML\") || inputType.equals(\"JSON\") || inputType.equals(\"CSV\"))) {\n File originalFile = new File(originalFilePath);\n File copiedFile = new File(destinationFilePath);\n try {\n FileUtils.copyFile(originalFile, copiedFile);\n assert (copiedFile).exists();\n\t\t\t\tassert (Files.readAllLines(originalFile.toPath(), Charset.defaultCharset())\n\t\t\t\t\t\t.equals(Files.readAllLines(copiedFile.toPath(), Charset.defaultCharset())));\n } catch (IOException e) {\n log.error(\"IO error occured while saving the datamapper input file!\", e);\n }\n } else if (null != destinationFilePath) {\n clearContent(new File(destinationFilePath));\n }\n }", "public void set(String keyInput, String valueInput) {\n\t\tfileData.put(keyInput, valueInput);\n\t\ttry {\n\t\t\twriteToFile();\n\t\t}\n\t\tcatch (IOException anything) {\n\t\t\tSystem.out.println(\"Couldn't write to file \" + path + \". Error: \" + anything.getMessage());\n\t\t}\n\t}", "@Override\n\tpublic FileModel update(FileModel c) {\n\t\treturn fm.saveAndFlush(c);\n\t}", "public void refreshData(File file) throws IOException{\n\t\tmodel = new FileDataModel(file);\n\t}", "void update(FileInfo fileInfo);", "@Override\r\n\tpublic void updateAll() throws IOException {\n\t}", "@Override\n\tpublic void update(finalDataBean t, String[] fields) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void updatePizzaRecord(int pId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\t\r\n\t\tList<PizzaBean> updateList = new ArrayList<PizzaBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList = (List<PizzaBean>) ois.readObject();\r\n\t\t\tfor (PizzaBean p : updateList) {\r\n\t\t\t\tif (p.getpId() == pId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza name\");\r\n\t\t\t\t\t\tp.setpName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Pizza Price\");\r\n\t\t\t\t\t\tp.setpPrice(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList = new ArrayList<PizzaBean>();\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\t\t\toos.writeObject(tempList);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile.renameTo(original);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Pizza Updated Successfully\");\r\n\t}", "boolean update(DataTableDef def) throws IOException;", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void updateNonDynamicFields() {\n\n\t}", "public static void UpdateLineInFileByID(String i_FileName, String i_ID, StringBuilder i_StringToReplace,\n\t\t\tStringBuilder i_StringToReplaceWith) {\n\t}", "public void updateRecord(String companyName) {\n String option = \"\";\n boolean quit = false;\n byte [] numEmplyees = new byte[Constants.NUM_BYTES_COMPANY_EMPLOYEES];\n byte [] cityName = new byte[Constants.NUM_BYTES_COMPANY_CITY];\n byte [] rank = new byte[Constants.NUM_BYTES_RANK];\n byte [] state = new byte[Constants.NUM_BYTES_COMPANY_STATE];\n byte [] zip = new byte[Constants.NUM_BYTES_COMPANY_ZIP];\n\n BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n RandomAccessFile din = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n RandomAccessFile oin = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n\n //find company to update\n String recordLocation = \"normal\";\n int recordNumber = this.binarySearch(din, companyName.toUpperCase());\n\n if (recordNumber == -1) {\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String record = getRecord(\"overflow\", oin, i);\n String recordName = record.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.toUpperCase().equals(recordName)) {\n recordNumber = i;\n recordLocation = \"overflow\";\n break;\n }\n }\n }\n\n //if company found\n if(recordNumber != -1){\n //untill the user wants to stop updating\n while(!quit){\n System.out.println(\"What would you like to change?\");\n System.out.println(\"[1] Rank\");\n System.out.println(\"[2] City\");\n System.out.println(\"[3] State\"); \n System.out.println(\"[4] Zip Code\");\n System.out.println(\"[5] Number of Employees\");\n System.out.println(\"[6] done updating\");\n option = inputReader.readLine();\n\n byte [] update;\n switch(option) {\n case \"1\":\n System.out.println(\"Enter updated Rank\");\n update = HelperFunctions.getInputDataBytes(5);\n // option = inputReader.readLine();\n //format input to fixed length\n \n // option = String.format(\"%-5s\", option.toUpperCase());\n // rank = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n //replace current rank with new rank\n oin.write(update); \n }\n break;\n case \"2\":\n System.out.println(\"Enter updated City\");\n update = HelperFunctions.getInputDataBytes(20);\n // option = inputReader.readLine();\n // option = String.format(\"%-20s\", option.toUpperCase());\n // cityName = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n oin.write(update); \n } \n break;\n case \"3\":\n System.out.println(\"Enter updated State Abbreviation\");\n // option = inputReader.readLine();\n // option = String.format(\"%-3s\", option.toUpperCase());\n // state = option.getBytes();\n update = HelperFunctions.getInputDataBytes(3);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n oin.write(update);\n }\n break;\n case \"4\":\n System.out.println(\"Enter updated Zip Code\");\n // option = inputReader.readLine();\n // option = String.format(\"%-6s\", option.toUpperCase());\n // zip = option.getBytes();\n update = HelperFunctions.getInputDataBytes(6);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n oin.write(update);\n }\n break;\n case \"5\":\n System.out.println(\"Enter updated Number of Employees\");\n // option = inputReader.readLine();\n // option = String.format(\"%-10s\", option.toUpperCase());\n // numEmplyees = option.getBytes();\n update = HelperFunctions.getInputDataBytes(10);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n oin.write(update); \n }\n break;\n case \"6\":\n quit = true;\n din.close();\n oin.close();\n break;\n default:\n System.out.println(\"That is not a valid option, please select a valid option\");\n break; \n }\n }\n }\n //if not found, let the user know\n else{\n System.out.println(\"NOT FOUND\");\n return;\n } \n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public interface FileReplacer {\n public void replaceTags(ArrayList<String> header, CSVRecord record, File resultFile);\n public void replaceTagsWithCoef(ArrayList<String> header, int headerIndex, double coefficient, CSVRecord record, File resultFile);\n\n public void replaceInOneDoc(ArrayList<String> header, CSVRecord record, File file, Table cellTable);\n}", "public void updateData() {}", "public static interface DataReplace {\n\t\t/**\n\t\t * This method is used to alter the lines in the data array. Each line is parsed to this method, and whatever is returned will replace the current line.\n\t\t * \n\t\t * @param input\n\t\t * One line of the data array\n\t\t */\n\t\tpublic String replace(String input);\n\t}", "public void setInputFile(File inputFile) {\n this.inputFile = inputFile;\n }", "private byte[] updateContent(byte[] request) {\n if (replaceFirst()) {\n return Utils.byteArrayRegexReplaceFirst(request, this.match, this.replace);\n } else {\n return Utils.byteArrayRegexReplaceAll(request, this.match, this.replace);\n }\n }", "@Override\r\n\tpublic void updateIceCreamRecord(int iceId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original1);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile1);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\r\n\t\tList<IceCreamBean> updateList1 = new ArrayList<IceCreamBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList1 = (List<IceCreamBean>) ois.readObject();\r\n\t\t\tfor (IceCreamBean p : updateList1) {\r\n\t\t\t\tif (p.getIceId() == iceId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream name\");\r\n\t\t\t\t\t\tp.setIceName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Price\");\r\n\t\t\t\t\t\tp.setIceprice(sc.nextDouble());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList1 = new ArrayList<IceCreamBean>();\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfos=new FileOutputStream(tempFile1);\r\n\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\toos.writeObject(tempList1);\r\n\t\t\t\toriginal1.delete();\r\n\t\t\t\ttempFile1.renameTo(original);\r\n\t\t\t\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void setEditedContent(CGFile file) {\n\n\t\t}", "@Override\n\t\tpublic void update() throws IOException {\n\t\t}", "public void readReplace(String fname, String oldPattern, String replPattern) {\n\t\tString line;\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(fname);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfis));\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tMatcher matcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\tif (matcher.find()){\n\t\t\t\t\tmatcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\t\tline = matcher.replaceAll(replPattern);\n\t\t\t\t}\n\t\t\t\tsb.append(line + Constants.RETURN);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(fname));\n\t\t\tout.write(sb.toString());\n\t\t\tout.close();\n\t\t\t// logger.debug(\"Fichero remplazado con exito \" + fname);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(LOG, e);\n\t\t}\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "private void processModify(int fileId, int commitId) throws SQLException,\n \t\t\tIOException {\n \t\tint previousCommitId = commitGraph.findPreviousCommitId(fileId,\n \t\t\t\tcommitId);\n \t\tString newContent = FileUtils.getContent(fileId, commitId);\n \t\tString oldContent = getPreviousContent(fileId, previousCommitId);\n \t\tList<SourceCodeChange> changes = extractDiff(new FileRevision(\n \t\t\t\tpreviousCommitId, fileId, oldContent), new FileRevision(\n \t\t\t\tcommitId, fileId, newContent));\n \t\tif (changes == null || changes.size() == 0) {\n \t\t\tlogger.warning(\"No changes distilled for file \" + fileId\n \t\t\t\t\t+ \" at commit_id \" + commitId + \" from previous commit id \"\n \t\t\t\t\t+ previousCommitId);\n \t\t} else {\n \t\t\tthis.reducer.add(changes, fileId, commitId);\n \t\t}\n \t\tif (changes != null) { // can't check newcontent alone, as it can have\n \t\t\t\t\t\t\t\t// invalid syntax\n \t\t\tassert (newContent != null);\n \t\t\tfileContentCache.put(fileId, new FileRevision(commitId, fileId,\n \t\t\t\t\tnewContent));\n \t\t}\n \t}", "public static void modifytext (String name) throws IOException {\n // Copy the contents of the input file and put it into the new file\n File inputF = new File(\"src/main/java/ex45/\"+ name +\".txt\");\n Path dest = inputF.toPath();\n Path src = Paths.get(\"src/main/java/ex45/exercise45_input.txt\");\n Files.copy(src, dest);\n\n // This process will replace the word 'utilize' with the word 'use'\n String utilize = new String(Files.readAllBytes(dest));\n Charset charset = StandardCharsets.UTF_8;\n utilize = utilize.replaceAll(\"utilize\", \"use\");\n Files.write(dest, utilize.getBytes(charset));\n\n System.out.print(\"Your file has been created.\");\n }", "private static void updateFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedWriter frequencyWriter = new BufferedWriter(new FileWriter(frequencyFile));\n\n\t\tfor(Entry<String, Long> entry : dataMap.entrySet()) { // Write every entry to the frequency file\n\n\t\t\tfrequencyWriter.write(generateStringFromEntry(entry));\n\t\t\tfrequencyWriter.newLine();\n\t\t}\n\n\t\tfrequencyWriter.close();\n\t}", "@Override\n public void saveDataFromCsvFile(List<TimetableUpload> inputData) {\n Map<String, Timetable> timetables = new HashMap<>();\n Semester semester = semesterService.getLatestSemester();\n Long latestVersionInSemester = timetableService.getLatestTimetableVersionInSemester(semester.getId());\n\n //timetableUpload = eden red od csv fajlot\n for (TimetableUpload timetableUpload : inputData) {\n //odreduvanje na modul\n String studentGroup = timetableUpload.getModule();\n String identifier = timetableUpload.getProfessor() + \" \" + timetableUpload.getSubject() + \" \" + timetableUpload.getRoom() + \" \" + studentGroup + \" \" + timetableUpload.getDay();\n\n if (!timetables.containsKey(identifier)) {\n\n //vnesuvanje na profesori i asistenti\n Professor professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n if(professor == null) {\n professorService.saveProfessor(timetableUpload.getProfessor());\n professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n }\n\n Subject subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n if (subject == null) {\n subjectService.saveSubject(timetableUpload.getSubject());\n subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n }\n\n Timetable newTimetable = new Timetable(8 + Long.parseLong(timetableUpload.getHourFrom()),\n 9 + Long.parseLong(timetableUpload.getHourFrom()), Long.parseLong(timetableUpload.getDay()), timetableUpload.getRoom(),\n studentGroup, professor, subject, semester, latestVersionInSemester + 1);\n timetables.put(identifier, newTimetable);\n } else {\n Timetable existingTimetable = timetables.get(identifier);\n existingTimetable.setHourTo(existingTimetable.getHourTo() + 1);\n timetables.replace(identifier, existingTimetable);\n }\n timetableService.saveAll(timetables.values());\n }\n }", "public void replace(int idIndex, String inputFilePath) {\n\t\tString url = IP + String.valueOf(PORT) + \"/replace\";\n\t\thelper(url, idIndex, inputFilePath);\n\t}", "public void reload() {\n\t\tif (file.lastModified() <= fileModified)\n\t\t\treturn;\n\t\n\t\treadFile();\n\t}", "@Override\r\n\tpublic void changeInf1(Scanner input, String path) {\n\t\tSystem.out.println(\"原去处为\"+this.getInfo1());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo1(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "public void performChange() {\n String nm = fqname.substring(fqname.lastIndexOf('.') + 1);\n if (oldAttrName == null) {\n // no attribute -> it's a filename change. eg. org-milos-kleint-MyInstance.instance\n newFileName = oldFileName.replaceAll(\"\\\\-\" + nm + \"$\", \"-\" + rename.getNewName());\n } else {\n if (oldAttrName.indexOf(fqname.replace('.','-') + \".instance\") > 0) {\n //replacing the ordering attribute..\n newAttrName = oldAttrName.replaceAll(\"-\" + nm + \"\\\\.\", \"-\" + rename.getNewName() + \".\");\n } else {\n //replacing attr value probably in instanceCreate and similar\n if (oldAttrValue != null) {\n String toReplacePattern = nm;\n newAttrValue = oldAttrValue.replaceAll(toReplacePattern, rename.getNewName());\n }\n }\n }\n \n if (newAttrValue != null) {\n doAttributeValueChange(newAttrValue, valueType);\n }\n if (newAttrName != null) {\n doAttributeMove(oldAttrName, newAttrName);\n }\n if (newFileName != null) {\n doFileMove(newFileName);\n }\n }", "public void updateTableData(String currentSchema,\n\t\t\tTreeMap<Integer,List<String>> tableDataMap,\n\t\t\tTreeMap<Integer,List<String>> tableSchemaMap){\n\t\ttry{\n\t\t\tInsertHelper iH = InsertHelper.getInsertHelperInstance();\n\t\t\tRandomAccessFile tableDataFile = new RandomAccessFile(currentSchema + \".\" + tableName + \".tbl\", \"rw\");\n\n\t\t\t//Table Data Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> tableDataMapSet = tableDataMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> tableDataMapIterator = tableDataMapSet.iterator();\n\n\t\t\t//Table Schema Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> columnSet = tableSchemaMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> columnIterator = columnSet.iterator();\n\t\t\tList<String> columnSchema = new ArrayList<String>();\n\n\t\t\t//Adding Column_Name,INT serially in the list\n\t\t\twhile(columnIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = columnIterator.next();\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tcolumnSchema.add(currentColumn.get(0));\n\t\t\t\tcolumnSchema.add(currentColumn.get(1));\n\t\t\t}\n\n\t\t\t//Checks the array list and writes accordingly to the File \n\t\t\twhile(tableDataMapIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = tableDataMapIterator.next();\n\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tint columnDataCounter = currentColumn.size();\n\t\t\t\tint columnSchemaCounter = 0;\n\n\t\t\t\tfor(int i = 0;i < columnDataCounter; i++){\n\t\t\t\t\tlong tableIndexPointer = tableDataFile.getFilePointer();\n\t\t\t\t\tif(columnSchema.get(columnSchemaCounter + 1).contains(\"VARCHAR\")){\n\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch(columnSchema.get(columnSchemaCounter + 1)){\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"BYTE\": \n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"SHORT\":\n\t\t\t\t\t\t\ttableDataFile.writeShort(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\t\ttableDataFile.writeInt(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"LONG\": \n\t\t\t\t\t\t\ttableDataFile.writeLong(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FLOAT\": \n\t\t\t\t\t\t\ttableDataFile.writeFloat(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DOUBLE\": \n\t\t\t\t\t\t\ttableDataFile.writeDouble(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\": \n\t\t\t\t\t\t\tDateFormat dateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH:mm:ss\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate dateTime = dateTimeFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(dateTime.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATE\": \n\t\t\t\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate date = dateFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(date.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\ttableDataFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic int update_file(Map<String, Object> map) throws Exception {\n\t\treturn sql.update(\"cms_board.update_file\", map);\r\n\t}", "public void processFile() throws IOException {\n\t\tsetContent(file.getBytes());\n\t\tsetMultipartFileContentType(file.getContentType());\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateFile(String fname, String content) {\n\t\tprintMsg(\"running updateFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\tString text = null;\n\t\tPath filepath = Paths.get(theRootPath + System.getProperty(\"file.separator\") + fname);\n\t\tif(Files.exists(filepath)) {\n\t\t\tprintMsg(\"File \" + fname + \" exists, updating...\");\n\t\t\t\n\t\t\tif(content.isEmpty() || content == null) {\n\t\t\t\ttext = String.format(\"%s, testing appending text to an empty file.\\r\\n\", new Date());\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttext = content + \"\\r\\n\";\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFiles.write(filepath, text.getBytes(), StandardOpenOption.APPEND);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void updateSoftDrinkRecord(int sId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\r\n\t\tList<SoftDrinkBean>updateList=new ArrayList<SoftDrinkBean>();\r\n\t\t\r\n\t\t\tupdateList=(List<SoftDrinkBean>)ois.readObject();\r\n\t\t\tfor(SoftDrinkBean s:updateList){\r\n\t\t\t\tif(s.getsId()==sId){\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tswitch (n) {\r\n\t\t\tcase 1:\r\n\t\t\t\tSystem.out.println(\"Enter new drink name\");\r\n\t\t\t\ts.setsName(sc.next());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Price\");\r\n\t\t\t\ts.setsPrice(sc.nextDouble());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Quantity\");\r\n\t\t\t\ts.setSqty(sc.nextInt());\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\t\ttempList2.add(s);\r\n\t\t} else {\r\n\t\t\ttempList2.add(s);\r\n\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile2);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\toos.writeObject(tempList2);\r\n\t\toriginal.delete();\r\n\t\ttempFile.renameTo(original);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"------------------SoftDrink Updated successfully------------\");\r\n\t}", "@Override\r\n\tpublic void changeInf2(Scanner input, String path) {\n\t\tSystem.out.println(\"原联系方式为\"+this.getInfo2());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo2(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "@Override\r\n public void updateTable() {\n FileManager fileManager = new FileManager();\r\n InputStream input = fileManager.readFileFromRAM(fileManager.XML_DIR, FILE_NAME);\r\n if(input != null){\r\n dropTable();\r\n createTable();\r\n parserXml(input); \r\n }else{\r\n Log.i(FILE_NAME,\"file is null\");\r\n }\r\n \r\n }", "private void getDataFromCustomerDataUpdate(Map<String, Object> cusData, CustomerDataTypeDTO data,\n List<FileInfosDTO> listFiles, String formatDate) throws JsonProcessingException {\n if (FieldTypeEnum.FILE.getCode().equals(data.getFieldType())) {\n if (listFiles != null) {\n List<BaseFileInfosDTO> listSaveDb = new ArrayList<>();\n listFiles.forEach(file -> {\n BaseFileInfosDTO fileSaveDb = new BaseFileInfosDTO();\n fileSaveDb.setFileName(file.getFileName());\n fileSaveDb.setFilePath(file.getFilePath());\n listSaveDb.add(fileSaveDb);\n });\n cusData.put(data.getKey(), objectMapper.writeValueAsString(listSaveDb));\n } else {\n cusData.put(data.getKey(), STRING_ARRAY_EMPTY);\n }\n } else if (FieldTypeEnum.MULTIPLE_PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.CHECKBOX.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RELATION.getCode().equals(data.getFieldType())) {\n List<Long> fValue = null;\n try {\n TypeReference<ArrayList<Long>> typeRef = new TypeReference<ArrayList<Long>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RADIO.getCode().equals(data.getFieldType())\n || FieldTypeEnum.NUMBER.getCode().equals(data.getFieldType())) {\n if (StringUtils.isBlank(data.getValue())) {\n if (cusData.containsKey(data.getKey())) {\n cusData.remove(data.getKey());\n }\n } else {\n if (CheckUtil.isNumeric(data.getValue())) {\n cusData.put(data.getKey(), Long.valueOf(data.getValue()));\n } else {\n cusData.put(data.getKey(), Double.valueOf(data.getValue()));\n }\n }\n } else if (FieldTypeEnum.DATE.getCode().equals(data.getFieldType())) {\n getSystemDate(cusData, formatDate, data.getValue(), data.getKey(), null);\n } else if (FieldTypeEnum.TIME.getCode().equals(data.getFieldType())) {\n getSystemTime(cusData, DateUtil.FORMAT_HOUR_MINUTE, data.getValue(), data.getKey());\n } else if (FieldTypeEnum.DATETIME.getCode().equals(data.getFieldType())) {\n String date = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(0, formatDate.length())\n : \"\";\n String hour = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(formatDate.length()) : \"\";\n getSystemDate(cusData, formatDate, date, data.getKey(), hour);\n } else if (FieldTypeEnum.SELECT_ORGANIZATION.getCode().equals(data.getFieldType())) {\n List<Object> fValue = null;\n try {\n TypeReference<ArrayList<Object>> typeRef = new TypeReference<ArrayList<Object>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.LINK.getCode().equals(data.getFieldType())) {\n Map<String, String> fValue = new HashMap<>();\n try {\n TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n cusData.put(data.getKey(), fValue);\n } catch (Exception e) {\n log.error(e.getLocalizedMessage());\n }\n } else {\n cusData.put(data.getKey(), data.getValue());\n }\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "public void update(final UploadFile uploadFile) {\n\t\t UploadFile uploadFileDB = uploadFileDAO.findById(uploadFile.getId());\n\t\t uploadFileDB.setFileName(uploadFile.getFileName());\n\t\t uploadFileDB.setData(uploadFile.getData());\n\t\t uploadFileDAO.persist(uploadFileDB);\n\t }", "protected void changeContent() {\n byte[] data = Arrays.copyOf(content.getContent(),\n content.getContent().length + 1);\n data[content.getContent().length] = '2'; // append one byte\n content.setContent(data);\n LOG.info(\"document content changed\");\n }", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\n this.updateFaxJobFromInputDataImpl(inputData,faxJob);\n }", "public void update() throws IOException{\r\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agenda.txt\", false));\r\n\t\toos.writeObject(artists);\r\n\t\toos.writeObject(stages);\r\n\t\toos.writeObject(performances);\r\n\t\tartists.clear();\r\n\t\tstages.clear();\r\n\t\tperformances.clear();\r\n\t\toos.close();\r\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public void setFileContent(String fileContent) {\n this.fileContent = fileContent;\n }", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "private void updateDatabaseFile() {\n Log.i(\"updateDatabaseFile\", \"Updating server app database\");\n try {\n FileInputStream inputStream = new FileInputStream(databaseFile);\n DropboxAPI.Entry response = MainActivity.mDBApi.putFileOverwrite(databaseFile.getName(), inputStream,\n databaseFile.length(), null);\n Log.i(\"updateDatabaseFile\", \"The uploaded file's rev is: \" + response.rev);\n } catch (Exception e) {\n Log.e(\"updateDatabaseFile\", e.toString(), e);\n }\n }", "@Test\r\n public void testUpdateFile() {\r\n System.out.println(\"updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n // no assertEquals needed because the method itself would throw an error\r\n // if an error occurs check your connection to the internet\r\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void modifyClass2File() throws IOException {\n\t\tMap<String, Object> properties = specificConfig();\n\t\tModifyDriver.modify2File(properties, mvfactory);\n\t}", "public void data(RecordInput recordInput) {\n try {\n byte[] bytes = new byte[100];\n recordInput.readBytes(bytes);\n crc.update(bytes);\n } catch (IOException e) {\n throw new ServingXmlException(e.getMessage(), e);\n }\n }", "@Test\n public void testApplyToOldFile() throws IOException, PatchFailedException {\n Path oldFile = scratch.file(\"/root/oldfile\", \"line one\");\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(oldFile, UTF_8)).isEqualTo(newContent);\n // new file should not change\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).containsExactly(\"line one\");\n }", "@ActionKey(\"/api/blog/updateFile\")\n public void updateFile() throws IOException {\n Integer id = getParaToInt(\"id\");\n File blogFile = getFile(\"blog\").getFile();\n if (id == null) {\n mResult.fail(102);\n renderJson(mResult);\n return;\n }\n if (!blogFile.getName().endsWith(\".md\")) {\n mResult.fail(110);\n renderJson(mResult);\n return;\n }\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(blogFile), \"UTF-8\"));\n StringBuilder builder = new StringBuilder();\n String line = \"\";\n while (line != null) {\n line = reader.readLine();\n builder.append(line);\n }\n mResult.success(mBlogService.update(id, \"content\", builder.toString()));\n renderJson(mResult);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n mResult.fail(109);\n if (reader != null) {\n reader.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private void updateImformation(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint fileId= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tString caption= request.getParameter(\"caption\");\n\t\tString label= request.getParameter(\"label\");\n\t\tString fileName= request.getParameter(\"fileName\");\n\t\tFiles file= new Files(fileId, fileName, label, caption);\n\t\tnew FilesDAO().update(fileId, caption, label);;\n\t\tlistingPage(request, response);\n\t}", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "void overwriteContent(Md2Entity content);", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "void setNewFile(File file);", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "void updateData();", "@Update({ \"update csv_file\", \"set pid = #{pid,jdbcType=VARCHAR},\", \"filename = #{filename,jdbcType=VARCHAR},\",\n\t\t\t\"start_time = #{startTime,jdbcType=TIMESTAMP},\", \"end_time = #{endTime,jdbcType=TIMESTAMP},\",\n\t\t\t\"length = #{length,jdbcType=INTEGER},\", \"density = #{density,jdbcType=DOUBLE},\",\n\t\t\t\"machine = #{machine,jdbcType=VARCHAR},\", \"ar = #{ar,jdbcType=BIT},\", \"path = #{path,jdbcType=VARCHAR},\",\n\t\t\t\"size = #{size,jdbcType=BIGINT},\", \"uuid = #{uuid,jdbcType=CHAR},\",\n\t\t\t\"header_time = #{headerTime,jdbcType=TIMESTAMP},\", \"last_update = #{lastUpdate,jdbcType=TIMESTAMP},\",\n\t\t\t\"conflict_resolved = #{conflictResolved,jdbcType=BIT},\", \"status = #{status,jdbcType=INTEGER},\",\n\t\t\t\"comment = #{comment,jdbcType=VARCHAR},\", \"width = #{width,jdbcType=INTEGER},\",\n\t\t\t\"start_version = #{startVersion,jdbcType=INTEGER},\", \"end_version = #{endVersion,jdbcType=INTEGER}\",\n\t\t\t\"where id = #{id,jdbcType=INTEGER}\" })\n\tint updateByPrimaryKey(CsvFile record);", "public static void fileEditor(String sourcePath, String targetPath, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(sourcePath);\n\t\t\t\t File tar= new File(targetPath);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(tar);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "public void updatePersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tserializeToFile(file);\n\t\tupdatePersistentSettings();\n\t}", "public void updateContent(Map<String, Object> update_params) throws SolrServerException, IOException {\n\t\tSolrInputDocument doc_in = new SolrInputDocument();\n\n\t\tIterator<String> itr = update_params.keySet().iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString key = itr.next();\n\t\t\t\n\t\t\tdoc_in.addField(key, update_params.get(key));\n\t\t\titr.remove(); // avoids a ConcurrentModificationException\n\t\t}\n\t\t\n\t\t\n\t\t//System.out.println(\"Debug.\");\n\t\tSystem.out.println(\"Debug: Doc_in: \" + doc_in.toString());\n\t\tSystem.out.println(\"updating content...\");\n\t\tUpdateResponse UD_response = server.add(doc_in);\n\t\tserver.commit();\n\t\tSystem.out.println(\"Debug: \"+UD_response.toString());\n\t\tSystem.out.println(\"Finished updating solr.\");\n\n\t}", "public void setFileContent(Byte[] fileContent) {\n this.fileContent = fileContent;\n }", "public static void makeEntityObservable(FileObject fileInProject, String[] entityInfo, MetadataModel<EntityMappingsMetadata> mappings) {\n if (entityInfo == null) return;\n ClassPath cp = ClassPath.getClassPath(fileInProject, ClassPath.SOURCE);\n String resName = entityInfo[1].replace('.', '/') + \".java\"; // NOI18N\n FileObject entity = cp.findResource(resName);\n if (entity == null) return;\n final List<String> properties;\n try {\n properties = propertiesForColumns(mappings, entityInfo[0], null);\n } catch (IOException ioex) {\n return;\n }\n JavaSource source = JavaSource.forFileObject(entity);\n final boolean[] alreadyUpdated = new boolean[1];\n try {\n // PENDING merge into one task once it will be possible\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n \n for (Tree member : clazz.getMembers()) {\n if (Tree.Kind.VARIABLE == member.getKind()) {\n VariableTree variable = (VariableTree)member;\n String type = variable.getType().toString();\n if (type.endsWith(\"PropertyChangeSupport\")) { // NOI18N\n alreadyUpdated[0] = true;\n }\n }\n }\n \n TreeMaker make = wc.getTreeMaker();\n ClassTree modifiedClass = clazz;\n \n if (!alreadyUpdated[0]) {\n // changeSupport field\n TypeElement transientElement = wc.getElements().getTypeElement(\"javax.persistence.Transient\"); // NOI18N\n TypeMirror transientMirror = transientElement.asType();\n Tree transientType = make.Type(transientMirror);\n AnnotationTree transientTree = make.Annotation(transientType, Collections.EMPTY_LIST);\n ModifiersTree modifiers = make.Modifiers(Modifier.PRIVATE, Collections.singletonList(transientTree));\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n TypeMirror changeSupportMirror = changeSupportElement.asType();\n Tree changeSupportType = make.Type(changeSupportMirror);\n NewClassTree changeSupportConstructor = make.NewClass(null, Collections.EMPTY_LIST, make.QualIdent(changeSupportElement), Collections.singletonList(make.Identifier(\"this\")), null);\n VariableTree changeSupport = make.Variable(modifiers, \"changeSupport\", changeSupportType, changeSupportConstructor); // NOI18N\n modifiedClass = make.insertClassMember(clazz, 0, changeSupport);\n }\n\n // property change notification\n for (Tree clMember : modifiedClass.getMembers()) {\n if (clMember.getKind() == Tree.Kind.METHOD) {\n MethodTree method = (MethodTree)clMember;\n String methodName = method.getName().toString();\n if (methodName.startsWith(\"set\") && (methodName.length() > 3) && (Character.isUpperCase(methodName.charAt(3))) && (method.getParameters().size() == 1)) { // NOI18N\n String propName = methodName.substring(3);\n if ((propName.length() == 1) || (Character.isLowerCase(propName.charAt(1)))) {\n propName = Character.toLowerCase(propName.charAt(0)) + propName.substring(1);\n }\n if (!properties.contains(propName)) continue;\n BlockTree block = method.getBody();\n if (block.getStatements().size() != 1) continue;\n StatementTree statement = block.getStatements().get(0);\n if (statement.getKind() != Tree.Kind.EXPRESSION_STATEMENT) continue;\n ExpressionTree expression = ((ExpressionStatementTree)statement).getExpression();\n if (expression.getKind() != Tree.Kind.ASSIGNMENT) continue;\n AssignmentTree assignment = (AssignmentTree)expression;\n String parName = assignment.getExpression().toString();\n VariableTree parameter = method.getParameters().get(0);\n if (!parameter.getName().toString().equals(parName)) continue;\n ExpressionTree persistentVariable = assignment.getVariable();\n\n // <Type> old<PropertyName> = this.<propertyName>\n String parameterName = parameter.getName().toString();\n String oldParameterName = \"old\" + Character.toUpperCase(parameterName.charAt(0)) + parameterName.substring(1); // NOI18N\n Tree parameterTree = parameter.getType();\n VariableTree oldParameter = make.Variable(make.Modifiers(Collections.EMPTY_SET), oldParameterName, parameterTree, persistentVariable);\n BlockTree newBlock = make.insertBlockStatement(block, 0, oldParameter);\n\n // changeSupport.firePropertyChange(\"<propertyName>\", old<PropertyName>, <propertyName>);\n MemberSelectTree fireMethod = make.MemberSelect(make.Identifier(\"changeSupport\"), \"firePropertyChange\"); // NOI18N\n List<ExpressionTree> fireArgs = new LinkedList<ExpressionTree>();\n fireArgs.add(make.Literal(propName));\n fireArgs.add(make.Identifier(oldParameterName));\n fireArgs.add(make.Identifier(parameterName));\n MethodInvocationTree notification = make.MethodInvocation(Collections.EMPTY_LIST, fireMethod, fireArgs);\n newBlock = make.addBlockStatement(newBlock, make.ExpressionStatement(notification));\n wc.rewrite(block, newBlock);\n }\n }\n }\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n if (alreadyUpdated[0]) return;\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // addPropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree addCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"addPropertyChangeListener\"); // NOI18N\n MethodInvocationTree addInvocation = make.MethodInvocation(Collections.EMPTY_LIST, addCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree addMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"addPropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(addInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, addMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // removePropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree removeCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"removePropertyChangeListener\"); // NOI18N\n MethodInvocationTree removeInvocation = make.MethodInvocation(Collections.EMPTY_LIST, removeCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree removeMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"removePropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(removeInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, removeMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n } catch (IOException ioex) {\n Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, ioex.getMessage(), ioex);\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "public static boolean editEntry(String tableName, String newData, int id){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n String fileContent = tableReader.nextLine()+\"\\n\";\n boolean lineFound = false;\n while (tableReader.hasNextLine()){\n String currentLine = tableReader.nextLine();\n int lineId = Integer.parseInt(currentLine.split(\",\")[0]);\n if(lineId != id){\n fileContent += currentLine+\"\\n\";\n }else{\n lineFound = true;\n }\n }\n tableReader.close();\n if(lineFound){\n fileContent += id+\",\"+newData+\"\\n\";\n FileWriter tableWriter = new FileWriter(table);\n String[] fileLines = fileContent.split(\"\\n\");\n for(String l : fileLines){\n tableWriter.write(l+\"\\n\");\n }\n tableWriter.close();\n return true;\n }else{\n System.out.println(\"No se encontró una entrada con el id: \"+id);\n return false;\n }\n\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }", "public void uploadDataFromFile()\n {\n String jobSeekerFile = (\"JobSeeker.txt\");\n String jobRecruiterFile = (\"JobRecruiter.txt\");\n String jobFile = (\"Job.txt\");\n String notificationFile = (\"Notification.txt\");\n \n String jobSeekerLines = readFile(jobSeekerFile);\n String jobRecruiterLines = readFile(jobRecruiterFile);\n String jobLines = readFile(jobFile);\n String notificationLines = readFile(notificationFile);\n \n storeJobSeekersToJobSeekerList(jobSeekerLines);\n storeJobRecruitersToJobRecruiterList(jobRecruiterLines);\n storeJobsToJobList(jobLines);\n storeNotificationsToNotificationList(notificationLines);\n \n }", "public void processInput(String theFile){processInput(new File(theFile));}", "private void updateFieldRows(Connection con,\n IdentifiedRecordTemplate template, GenericDataRecord record)\n throws SQLException, FormException, CryptoException {\n PreparedStatement update = null;\n PreparedStatement insert = null;\n \n try {\n update = con.prepareStatement(UPDATE_FIELD);\n int recordId = record.getInternalId();\n String[] fieldNames = record.getFieldNames();\n Map<String, String> rows = new HashMap<String, String>();\n for (String fieldName : fieldNames) {\n Field field = record.getField(fieldName);\n String fieldValue = field.getStringValue();\n \n SilverTrace.debug(\"form\", \"GenericRecordSetManager.updateFieldRows\",\n \"root.MSG_GEN_PARAM_VALUE\", \"fieldName = \" + fieldName\n + \", fieldValue = \" + fieldValue\n + \", recordId = \" + recordId);\n \n rows.put(fieldName, fieldValue);\n }\n \n if (template.isEncrypted()) {\n rows = getEncryptionService().encryptContent(rows);\n }\n \n for (String fieldName : rows.keySet()) {\n String fieldValue = rows.get(fieldName);\n update.setString(1, fieldValue);\n update.setInt(2, recordId);\n update.setString(3, fieldName);\n \n int nbRowsCount = update.executeUpdate();\n if (nbRowsCount == 0) {\n // no row has been updated because the field fieldName doesn't exist in database.\n // The form has changed since the last modification of the record.\n // So we must insert this new field.\n insert = con.prepareStatement(INSERT_FIELD);\n insert.setInt(1, recordId);\n insert.setString(2, fieldName);\n insert.setString(3, fieldValue);\n \n insert.execute();\n }\n }\n } finally {\n DBUtil.close(update);\n DBUtil.close(insert);\n }\n }", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "public void updateSettings(FileObject file) {\n DataObject dobj = null;\n DataFolder folder = null;\n try {\n dobj = DataObject.find(file);\n folder = dobj.getFolder();\n } catch (DataObjectNotFoundException ex) {\n Exceptions.printStackTrace(ex);\n }\n if (dobj == null || folder == null) {\n return;\n }\n for (CreateFromTemplateAttributesProvider provider\n : Lookup.getDefault().lookupAll(CreateFromTemplateAttributesProvider.class)) {\n Map<String, ?> attrs = provider.attributesFor(dobj, folder, \"XXX\"); // NOI18N\n if (attrs == null) {\n continue;\n }\n Object aName = attrs.get(\"user\"); // NOI18N\n if (aName != null) {\n author = aName.toString();\n break;\n }\n }\n }", "public void update() throws IOException {\n\n\t\tif(this.bdgDataColIdx < 4){\n\t\t\tSystem.err.println(\"Invalid index for bedgraph column of data value. Resetting to 4. Expected >=4. Got \" + this.bdgDataColIdx);\n\t\t\tthis.bdgDataColIdx= 4;\n\t\t}\n\n\t\tif(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BIGWIG)){\n\t\t\t\n\t\t\tbigWigToScores(this.bigWigReader);\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.TDF)){\n\n\t\t\tthis.screenWiggleLocusInfoList= \n\t\t\t\t\tTDFUtils.tdfRangeToScreen(this.getFilename(), this.getGc().getChrom(), \n\t\t\t\t\t\t\tthis.getGc().getFrom(), this.getGc().getTo(), this.getGc().getMapping());\n\t\t\t\n\t\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\t\tfor(ScreenWiggleLocusInfo x : screenWiggleLocusInfoList){\n\t\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t\t}\n\t\t\tthis.setScreenScores(screenScores);\t\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BEDGRAPH)){\n\n\t\t\t// FIXME: Do not use hardcoded .samTextViewer.tmp.gz!\n\t\t\tif(Utils.hasTabixIndex(this.getFilename())){\n\t\t\t\tbedGraphToScores(this.getFilename());\n\t\t\t} else if(Utils.hasTabixIndex(this.getFilename() + \".samTextViewer.tmp.gz\")){\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t} else {\n\t\t\t\tblockCompressAndIndex(this.getFilename(), this.getFilename() + \".samTextViewer.tmp.gz\", true);\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Extension (i.e. file type) not recognized for \" + this.getFilename());\n\t\t}\n\t\tthis.setYLimitMin(this.getYLimitMin());\n\t\tthis.setYLimitMax(this.getYLimitMax());\n\t}", "public void saveWorkingDataFile(String rftNo, String fileName, int fileRecordNumber, Connection conn) \n\t\tthrows ReadWriteException, NotFoundException, InvalidDefineException, IllegalAccessException, IOException\n\t{\t\t\n\t\tString id = \"\";\n\t\tMatcher m = Pattern.compile(\"ID(\\\\d\\\\d\\\\d\\\\d).txt\").matcher(fileName);\n\t\tif (m.find())\n\t\t{\n\t\t\tid = m.group(1);\n\t\t}\n\t\t//#CM702621\n\t\t// Generation of instance of work file\n\t\tWorkDataFile workDataFile =\n\t\t (WorkDataFile) PackageManager.getObject(\"Id\"+ id + \"DataFile\");\n\t\tworkDataFile.setFileName(fileName);\n\t\t\n\t\t//#CM702622\n\t\t// Remove the passing part of File Name. \n\t\tFile file = new File(fileName);\n\t\tString registFileName = file.getName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tWorkingDataHandler wHandler = new WorkingDataHandler(conn);\n\t\t\t//#CM702623\n\t\t\t// Open the made work file. \n\t\t\tworkDataFile.openReadOnly();\n\t\t\tint i = 0;\n\t\t\tfor(workDataFile.next(); i < fileRecordNumber; workDataFile.next())\n\t\t\t{\t\n\t\t\t\tWorkingDataAlterKey akey = new WorkingDataAlterKey();\n\t\t\t\takey.setRftNo(rftNo);\n\t\t\t\takey.setLineNo(i);\n\t\t\t\takey.updateFileName(registFileName);\n\t\t\t\takey.updateContents(workDataFile.getContents());\n\n\t\t\t\tWorkingDataSearchKey skey = new WorkingDataSearchKey();\n\t\t\t\tskey.setRftNo(rftNo);\n\t\t\t\tskey.setFileName(registFileName);\n\t\t\t\tskey.setLineNo(i);\n\t\t\t\tWorkingData[] workingArr= (WorkingData[])wHandler.find(skey);\n\t\t\t\tif (workingArr.length > 0)\n\t\t\t\t{\n\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tWorkingData workdata = new WorkingData();\n\t\t\t\t\t\tworkdata.setRftNo(rftNo);\n\t\t\t\t\t\tworkdata.setFileName(registFileName);\n\t\t\t\t\t\tworkdata.setLineNo(i);\n\t\t\t\t\t\tworkdata.setContents(workDataFile.getContents());\n\t\t\t\t\t\twHandler.create(workdata);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (DataExistsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tworkDataFile.closeReadOnly();\n\t\t}\n\t\t\n\t}", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void updatePathAndFile(String path, String file){\r\n\t\tthis.path = path;\r\n\t\tthis.file = file;\r\n\t}", "public void convert(File inputFile, File outputFile) throws IOException {\n\n setType(inputFile);\n\n BufferedReader reader = null;\n PrintWriter writer = null;\n\n try {\n reader = new BufferedReader(new FileReader(inputFile));\n writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n\n String nextLine = null;\n\n // Skip meta data. Note for GCT files this includes the mandatory first line\n while ((nextLine = reader.readLine()).startsWith(\"#\") && (nextLine != null)) {\n writer.println(nextLine);\n }\n\n // This is the first non-meta line\n writer.println(nextLine);\n\n // for TAB and RES files the first row contains the column headings.\n int nCols = 0;\n if (type == FileType.TAB || type == FileType.RES) {\n nCols = nextLine.split(\"\\t\").length;\n }\n\n\n if (type == FileType.GCT) {\n // GCT files. Column headings are 3rd row (read next line)\n nextLine = reader.readLine();\n nCols = nextLine.split(\"\\t\").length;\n writer.println(nextLine);\n } else if (type == FileType.RES) {\n // Res files -- skip lines 2 and 3\n writer.println(reader.readLine());\n writer.println(reader.readLine());\n }\n\n\n // Compute the # of data points\n int columnSkip = 1;\n if (type == FileType.RES) {\n columnSkip = 2;\n nCols++; // <= last call column of a res file is sometimes blank, if not this will get\n }\n nPts = (nCols - dataStartColumn) / columnSkip;\n\n // Now for the data\n while ((nextLine = reader.readLine()) != null) {\n String[] tokens = nextLine.split(\"\\t\");\n\n for (int i = 0; i < dataStartColumn; i++) {\n writer.print(tokens[i] + \"\\t\");\n }\n\n DataRow row = new DataRow(tokens, nextLine);\n for (int i = 0; i < nPts; i++) {\n\n if (Double.isNaN(row.scaledData[i])) {\n writer.print(\"\\t\");\n } else {\n\n writer.print(row.scaledData[i]);\n if (type == FileType.RES) {\n writer.print(\"\\t\" + row.calls[i]);\n }\n if (i < nPts - 1) {\n writer.print(\"\\t\");\n }\n }\n }\n writer.println();\n }\n }\n finally {\n if (reader != null) {\n reader.close();\n }\n if (writer != null) {\n writer.close();\n }\n }\n }", "public void testAppendDataInFile() throws IOException {\n\t\tfinal CachedParserDocument pdoc = new CachedParserDocument(this.tempFilemanager,0);\n\t\tassertTrue(pdoc.inMemory());\n\t\tassertEquals(0, pdoc.length());\n\t\tassertFalse(this.outputFile.exists());\n\t\t\n\t\t// copying data\n\t\tthis.appendData(TESTFILE, pdoc);\n\t\t\n\t\t// some tests\n\t\tassertFalse(pdoc.inMemory());\n\t\tassertEquals(this.fileSize, pdoc.length());\n\t\tassertTrue(this.outputFile.exists());\n\t\tassertEquals(TESTFILE, pdoc.getTextAsReader());\n\t\tassertEquals(TESTFILE, pdoc.getTextFile());\n\t\tassertFalse(pdoc.inMemory());\n\t}" ]
[ "0.6363993", "0.6327591", "0.6238817", "0.60848284", "0.5953929", "0.5840126", "0.580509", "0.56849295", "0.55798477", "0.55735934", "0.55515474", "0.5514112", "0.54922724", "0.5472793", "0.5466484", "0.5448518", "0.5432361", "0.5427619", "0.54107314", "0.53919333", "0.5391078", "0.5379845", "0.53657675", "0.5363369", "0.53521186", "0.53485817", "0.5346697", "0.5341902", "0.53310674", "0.5321722", "0.53150535", "0.53052354", "0.52906585", "0.52875465", "0.52780855", "0.5271152", "0.5254369", "0.52241737", "0.520797", "0.5166202", "0.5157792", "0.5153733", "0.51408106", "0.51388305", "0.51289487", "0.5107202", "0.5106505", "0.5099499", "0.5086874", "0.5085743", "0.5084165", "0.50835705", "0.50765395", "0.5072969", "0.50532556", "0.50417787", "0.50364345", "0.5032577", "0.50277364", "0.50254387", "0.5020029", "0.50191313", "0.5011235", "0.5007486", "0.5003232", "0.498886", "0.4973334", "0.4970443", "0.4966099", "0.49524814", "0.49482983", "0.49347138", "0.4933355", "0.49239856", "0.49228066", "0.49172747", "0.4916409", "0.491016", "0.49090725", "0.49045405", "0.4904236", "0.48937035", "0.48843938", "0.48810142", "0.48666072", "0.48582393", "0.48549888", "0.48549825", "0.48536915", "0.48517382", "0.4841129", "0.48357022", "0.48353213", "0.48337573", "0.48295", "0.48291633", "0.48290193", "0.4822843", "0.48213533", "0.4814946", "0.48035917" ]
0.0
-1
Replace the changed fields and update the contents of inputFileContent to the data file
public static void contractors(){ NewProject.contract_name = getInput("Please enter the NEW name of the contractor:"); NewProject.contract_tel = getInput("Please enter the NEW telephone number of the contractor:"); NewProject.contract_email = getInput("Please enter the NEW email of the contractor:"); NewProject.contract_address = getInput("Please enter the NEW email of the contractor:"); UpdateData.updateContractor(); updateMenu(); //Return back to previous menu. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateDataFile(DataFile dataFile) {\n updateMeeting(dataFile.getMeeting());\n }", "void updateFile() throws IOException;", "public int update(FFileInputDO FFileInput) throws DataAccessException;", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "@Override\r\n\tpublic void updateFileData(FileMetaDataEntity userInfo) {\n\t\t\r\n\t}", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void update(String filename, SensorData sensorData){\n //Adds the sensor data to the buffer. \n addToBuffer(filename, sensorData);\n \n //Uploads the data to the server if it's turned on. \n if (Server.getInstance().getServerIsOn())\n if(uploadData()){\n //If the upload was successful, clear the buffer.\n clearBuffer();\n }\n }", "public FileFormatFormData update(FileFormatFormData formData)\r\n\t\t\tthrows ProcessingException;", "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "private void updateToFile(PQNode node) throws Exception{\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n int replaceIndex = node.getPqIndex()-bufStart;\n\n nodes.set(replaceIndex,node);\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n storeToFile(file,nodes, false);\n }", "public void replaceFile(String inputFilename) {\n try {\n FileReader fr = new FileReader(inputFilename);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n if (line.isEmpty()) {\n System.out.println();\n } else {\n line = replaceLine(line);\n System.out.println(line);\n }\n }\n } catch (IOException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }", "public void testChanges(String filePath) {\n Object[] fileObjectArray = fetchTextFile(filePath);\n String newFile = prepareText(fileObjectArray);\n System.out.println(newFile);\n }", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "private void updateFiles() {\n\t}", "public void updateContent(Map<String, ContentChange> files);", "private void setDataFileChanged(String newPath) {\r\n \t\t// set file to be reloaded if changed\r\n \t\tif ((null == dataFile && !newPath.equals(\"\"))\r\n \t\t\t\t|| (null != dataFile && !dataFile.equals(newPath))) {\r\n \t\t\treloadFile = true;\r\n \t\t}\r\n \t\t// copy new value\r\n \t\tdataFile = newPath;\r\n \t\t// add log\r\n \t\tif (localLOGV) {\r\n \t\t\tLog.i(TAG, \"Reload file set to \" + String.valueOf(reloadFile));\r\n \t\t}\r\n \t}", "private void copyInputFile(String originalFilePath, String destinationFilePath) {\n String inputType = ((DataMapperDiagramEditor) workBenchPart.getSite().getWorkbenchWindow().getActivePage()\n .getActiveEditor()).getInputSchemaType();\n\n if (null != originalFilePath && null != destinationFilePath\n && (inputType.equals(\"XML\") || inputType.equals(\"JSON\") || inputType.equals(\"CSV\"))) {\n File originalFile = new File(originalFilePath);\n File copiedFile = new File(destinationFilePath);\n try {\n FileUtils.copyFile(originalFile, copiedFile);\n assert (copiedFile).exists();\n\t\t\t\tassert (Files.readAllLines(originalFile.toPath(), Charset.defaultCharset())\n\t\t\t\t\t\t.equals(Files.readAllLines(copiedFile.toPath(), Charset.defaultCharset())));\n } catch (IOException e) {\n log.error(\"IO error occured while saving the datamapper input file!\", e);\n }\n } else if (null != destinationFilePath) {\n clearContent(new File(destinationFilePath));\n }\n }", "public void set(String keyInput, String valueInput) {\n\t\tfileData.put(keyInput, valueInput);\n\t\ttry {\n\t\t\twriteToFile();\n\t\t}\n\t\tcatch (IOException anything) {\n\t\t\tSystem.out.println(\"Couldn't write to file \" + path + \". Error: \" + anything.getMessage());\n\t\t}\n\t}", "public void refreshData(File file) throws IOException{\n\t\tmodel = new FileDataModel(file);\n\t}", "@Override\n\tpublic FileModel update(FileModel c) {\n\t\treturn fm.saveAndFlush(c);\n\t}", "void update(FileInfo fileInfo);", "@Override\r\n\tpublic void updateAll() throws IOException {\n\t}", "@Override\n\tpublic void update(finalDataBean t, String[] fields) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void updatePizzaRecord(int pId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\t\r\n\t\tList<PizzaBean> updateList = new ArrayList<PizzaBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList = (List<PizzaBean>) ois.readObject();\r\n\t\t\tfor (PizzaBean p : updateList) {\r\n\t\t\t\tif (p.getpId() == pId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza name\");\r\n\t\t\t\t\t\tp.setpName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Pizza Price\");\r\n\t\t\t\t\t\tp.setpPrice(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList = new ArrayList<PizzaBean>();\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\t\t\toos.writeObject(tempList);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile.renameTo(original);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Pizza Updated Successfully\");\r\n\t}", "boolean update(DataTableDef def) throws IOException;", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void updateNonDynamicFields() {\n\n\t}", "public static void UpdateLineInFileByID(String i_FileName, String i_ID, StringBuilder i_StringToReplace,\n\t\t\tStringBuilder i_StringToReplaceWith) {\n\t}", "public void updateRecord(String companyName) {\n String option = \"\";\n boolean quit = false;\n byte [] numEmplyees = new byte[Constants.NUM_BYTES_COMPANY_EMPLOYEES];\n byte [] cityName = new byte[Constants.NUM_BYTES_COMPANY_CITY];\n byte [] rank = new byte[Constants.NUM_BYTES_RANK];\n byte [] state = new byte[Constants.NUM_BYTES_COMPANY_STATE];\n byte [] zip = new byte[Constants.NUM_BYTES_COMPANY_ZIP];\n\n BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n RandomAccessFile din = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n RandomAccessFile oin = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n\n //find company to update\n String recordLocation = \"normal\";\n int recordNumber = this.binarySearch(din, companyName.toUpperCase());\n\n if (recordNumber == -1) {\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String record = getRecord(\"overflow\", oin, i);\n String recordName = record.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.toUpperCase().equals(recordName)) {\n recordNumber = i;\n recordLocation = \"overflow\";\n break;\n }\n }\n }\n\n //if company found\n if(recordNumber != -1){\n //untill the user wants to stop updating\n while(!quit){\n System.out.println(\"What would you like to change?\");\n System.out.println(\"[1] Rank\");\n System.out.println(\"[2] City\");\n System.out.println(\"[3] State\"); \n System.out.println(\"[4] Zip Code\");\n System.out.println(\"[5] Number of Employees\");\n System.out.println(\"[6] done updating\");\n option = inputReader.readLine();\n\n byte [] update;\n switch(option) {\n case \"1\":\n System.out.println(\"Enter updated Rank\");\n update = HelperFunctions.getInputDataBytes(5);\n // option = inputReader.readLine();\n //format input to fixed length\n \n // option = String.format(\"%-5s\", option.toUpperCase());\n // rank = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n //replace current rank with new rank\n oin.write(update); \n }\n break;\n case \"2\":\n System.out.println(\"Enter updated City\");\n update = HelperFunctions.getInputDataBytes(20);\n // option = inputReader.readLine();\n // option = String.format(\"%-20s\", option.toUpperCase());\n // cityName = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n oin.write(update); \n } \n break;\n case \"3\":\n System.out.println(\"Enter updated State Abbreviation\");\n // option = inputReader.readLine();\n // option = String.format(\"%-3s\", option.toUpperCase());\n // state = option.getBytes();\n update = HelperFunctions.getInputDataBytes(3);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n oin.write(update);\n }\n break;\n case \"4\":\n System.out.println(\"Enter updated Zip Code\");\n // option = inputReader.readLine();\n // option = String.format(\"%-6s\", option.toUpperCase());\n // zip = option.getBytes();\n update = HelperFunctions.getInputDataBytes(6);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n oin.write(update);\n }\n break;\n case \"5\":\n System.out.println(\"Enter updated Number of Employees\");\n // option = inputReader.readLine();\n // option = String.format(\"%-10s\", option.toUpperCase());\n // numEmplyees = option.getBytes();\n update = HelperFunctions.getInputDataBytes(10);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n oin.write(update); \n }\n break;\n case \"6\":\n quit = true;\n din.close();\n oin.close();\n break;\n default:\n System.out.println(\"That is not a valid option, please select a valid option\");\n break; \n }\n }\n }\n //if not found, let the user know\n else{\n System.out.println(\"NOT FOUND\");\n return;\n } \n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public interface FileReplacer {\n public void replaceTags(ArrayList<String> header, CSVRecord record, File resultFile);\n public void replaceTagsWithCoef(ArrayList<String> header, int headerIndex, double coefficient, CSVRecord record, File resultFile);\n\n public void replaceInOneDoc(ArrayList<String> header, CSVRecord record, File file, Table cellTable);\n}", "public void updateData() {}", "public static interface DataReplace {\n\t\t/**\n\t\t * This method is used to alter the lines in the data array. Each line is parsed to this method, and whatever is returned will replace the current line.\n\t\t * \n\t\t * @param input\n\t\t * One line of the data array\n\t\t */\n\t\tpublic String replace(String input);\n\t}", "public void setInputFile(File inputFile) {\n this.inputFile = inputFile;\n }", "private byte[] updateContent(byte[] request) {\n if (replaceFirst()) {\n return Utils.byteArrayRegexReplaceFirst(request, this.match, this.replace);\n } else {\n return Utils.byteArrayRegexReplaceAll(request, this.match, this.replace);\n }\n }", "@Override\r\n\tpublic void updateIceCreamRecord(int iceId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original1);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile1);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\r\n\t\tList<IceCreamBean> updateList1 = new ArrayList<IceCreamBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList1 = (List<IceCreamBean>) ois.readObject();\r\n\t\t\tfor (IceCreamBean p : updateList1) {\r\n\t\t\t\tif (p.getIceId() == iceId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream name\");\r\n\t\t\t\t\t\tp.setIceName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Price\");\r\n\t\t\t\t\t\tp.setIceprice(sc.nextDouble());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList1 = new ArrayList<IceCreamBean>();\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfos=new FileOutputStream(tempFile1);\r\n\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\toos.writeObject(tempList1);\r\n\t\t\t\toriginal1.delete();\r\n\t\t\t\ttempFile1.renameTo(original);\r\n\t\t\t\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void setEditedContent(CGFile file) {\n\n\t\t}", "@Override\n\t\tpublic void update() throws IOException {\n\t\t}", "public void readReplace(String fname, String oldPattern, String replPattern) {\n\t\tString line;\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(fname);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfis));\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tMatcher matcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\tif (matcher.find()){\n\t\t\t\t\tmatcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\t\tline = matcher.replaceAll(replPattern);\n\t\t\t\t}\n\t\t\t\tsb.append(line + Constants.RETURN);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(fname));\n\t\t\tout.write(sb.toString());\n\t\t\tout.close();\n\t\t\t// logger.debug(\"Fichero remplazado con exito \" + fname);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(LOG, e);\n\t\t}\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "private void processModify(int fileId, int commitId) throws SQLException,\n \t\t\tIOException {\n \t\tint previousCommitId = commitGraph.findPreviousCommitId(fileId,\n \t\t\t\tcommitId);\n \t\tString newContent = FileUtils.getContent(fileId, commitId);\n \t\tString oldContent = getPreviousContent(fileId, previousCommitId);\n \t\tList<SourceCodeChange> changes = extractDiff(new FileRevision(\n \t\t\t\tpreviousCommitId, fileId, oldContent), new FileRevision(\n \t\t\t\tcommitId, fileId, newContent));\n \t\tif (changes == null || changes.size() == 0) {\n \t\t\tlogger.warning(\"No changes distilled for file \" + fileId\n \t\t\t\t\t+ \" at commit_id \" + commitId + \" from previous commit id \"\n \t\t\t\t\t+ previousCommitId);\n \t\t} else {\n \t\t\tthis.reducer.add(changes, fileId, commitId);\n \t\t}\n \t\tif (changes != null) { // can't check newcontent alone, as it can have\n \t\t\t\t\t\t\t\t// invalid syntax\n \t\t\tassert (newContent != null);\n \t\t\tfileContentCache.put(fileId, new FileRevision(commitId, fileId,\n \t\t\t\t\tnewContent));\n \t\t}\n \t}", "public static void modifytext (String name) throws IOException {\n // Copy the contents of the input file and put it into the new file\n File inputF = new File(\"src/main/java/ex45/\"+ name +\".txt\");\n Path dest = inputF.toPath();\n Path src = Paths.get(\"src/main/java/ex45/exercise45_input.txt\");\n Files.copy(src, dest);\n\n // This process will replace the word 'utilize' with the word 'use'\n String utilize = new String(Files.readAllBytes(dest));\n Charset charset = StandardCharsets.UTF_8;\n utilize = utilize.replaceAll(\"utilize\", \"use\");\n Files.write(dest, utilize.getBytes(charset));\n\n System.out.print(\"Your file has been created.\");\n }", "private static void updateFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedWriter frequencyWriter = new BufferedWriter(new FileWriter(frequencyFile));\n\n\t\tfor(Entry<String, Long> entry : dataMap.entrySet()) { // Write every entry to the frequency file\n\n\t\t\tfrequencyWriter.write(generateStringFromEntry(entry));\n\t\t\tfrequencyWriter.newLine();\n\t\t}\n\n\t\tfrequencyWriter.close();\n\t}", "@Override\n public void saveDataFromCsvFile(List<TimetableUpload> inputData) {\n Map<String, Timetable> timetables = new HashMap<>();\n Semester semester = semesterService.getLatestSemester();\n Long latestVersionInSemester = timetableService.getLatestTimetableVersionInSemester(semester.getId());\n\n //timetableUpload = eden red od csv fajlot\n for (TimetableUpload timetableUpload : inputData) {\n //odreduvanje na modul\n String studentGroup = timetableUpload.getModule();\n String identifier = timetableUpload.getProfessor() + \" \" + timetableUpload.getSubject() + \" \" + timetableUpload.getRoom() + \" \" + studentGroup + \" \" + timetableUpload.getDay();\n\n if (!timetables.containsKey(identifier)) {\n\n //vnesuvanje na profesori i asistenti\n Professor professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n if(professor == null) {\n professorService.saveProfessor(timetableUpload.getProfessor());\n professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n }\n\n Subject subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n if (subject == null) {\n subjectService.saveSubject(timetableUpload.getSubject());\n subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n }\n\n Timetable newTimetable = new Timetable(8 + Long.parseLong(timetableUpload.getHourFrom()),\n 9 + Long.parseLong(timetableUpload.getHourFrom()), Long.parseLong(timetableUpload.getDay()), timetableUpload.getRoom(),\n studentGroup, professor, subject, semester, latestVersionInSemester + 1);\n timetables.put(identifier, newTimetable);\n } else {\n Timetable existingTimetable = timetables.get(identifier);\n existingTimetable.setHourTo(existingTimetable.getHourTo() + 1);\n timetables.replace(identifier, existingTimetable);\n }\n timetableService.saveAll(timetables.values());\n }\n }", "public void replace(int idIndex, String inputFilePath) {\n\t\tString url = IP + String.valueOf(PORT) + \"/replace\";\n\t\thelper(url, idIndex, inputFilePath);\n\t}", "public void reload() {\n\t\tif (file.lastModified() <= fileModified)\n\t\t\treturn;\n\t\n\t\treadFile();\n\t}", "@Override\r\n\tpublic void changeInf1(Scanner input, String path) {\n\t\tSystem.out.println(\"原去处为\"+this.getInfo1());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo1(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "public void performChange() {\n String nm = fqname.substring(fqname.lastIndexOf('.') + 1);\n if (oldAttrName == null) {\n // no attribute -> it's a filename change. eg. org-milos-kleint-MyInstance.instance\n newFileName = oldFileName.replaceAll(\"\\\\-\" + nm + \"$\", \"-\" + rename.getNewName());\n } else {\n if (oldAttrName.indexOf(fqname.replace('.','-') + \".instance\") > 0) {\n //replacing the ordering attribute..\n newAttrName = oldAttrName.replaceAll(\"-\" + nm + \"\\\\.\", \"-\" + rename.getNewName() + \".\");\n } else {\n //replacing attr value probably in instanceCreate and similar\n if (oldAttrValue != null) {\n String toReplacePattern = nm;\n newAttrValue = oldAttrValue.replaceAll(toReplacePattern, rename.getNewName());\n }\n }\n }\n \n if (newAttrValue != null) {\n doAttributeValueChange(newAttrValue, valueType);\n }\n if (newAttrName != null) {\n doAttributeMove(oldAttrName, newAttrName);\n }\n if (newFileName != null) {\n doFileMove(newFileName);\n }\n }", "public void updateTableData(String currentSchema,\n\t\t\tTreeMap<Integer,List<String>> tableDataMap,\n\t\t\tTreeMap<Integer,List<String>> tableSchemaMap){\n\t\ttry{\n\t\t\tInsertHelper iH = InsertHelper.getInsertHelperInstance();\n\t\t\tRandomAccessFile tableDataFile = new RandomAccessFile(currentSchema + \".\" + tableName + \".tbl\", \"rw\");\n\n\t\t\t//Table Data Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> tableDataMapSet = tableDataMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> tableDataMapIterator = tableDataMapSet.iterator();\n\n\t\t\t//Table Schema Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> columnSet = tableSchemaMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> columnIterator = columnSet.iterator();\n\t\t\tList<String> columnSchema = new ArrayList<String>();\n\n\t\t\t//Adding Column_Name,INT serially in the list\n\t\t\twhile(columnIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = columnIterator.next();\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tcolumnSchema.add(currentColumn.get(0));\n\t\t\t\tcolumnSchema.add(currentColumn.get(1));\n\t\t\t}\n\n\t\t\t//Checks the array list and writes accordingly to the File \n\t\t\twhile(tableDataMapIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = tableDataMapIterator.next();\n\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tint columnDataCounter = currentColumn.size();\n\t\t\t\tint columnSchemaCounter = 0;\n\n\t\t\t\tfor(int i = 0;i < columnDataCounter; i++){\n\t\t\t\t\tlong tableIndexPointer = tableDataFile.getFilePointer();\n\t\t\t\t\tif(columnSchema.get(columnSchemaCounter + 1).contains(\"VARCHAR\")){\n\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch(columnSchema.get(columnSchemaCounter + 1)){\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"BYTE\": \n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"SHORT\":\n\t\t\t\t\t\t\ttableDataFile.writeShort(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\t\ttableDataFile.writeInt(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"LONG\": \n\t\t\t\t\t\t\ttableDataFile.writeLong(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FLOAT\": \n\t\t\t\t\t\t\ttableDataFile.writeFloat(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DOUBLE\": \n\t\t\t\t\t\t\ttableDataFile.writeDouble(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\": \n\t\t\t\t\t\t\tDateFormat dateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH:mm:ss\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate dateTime = dateTimeFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(dateTime.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATE\": \n\t\t\t\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate date = dateFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(date.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\ttableDataFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void processFile() throws IOException {\n\t\tsetContent(file.getBytes());\n\t\tsetMultipartFileContentType(file.getContentType());\n\t}", "@Override\r\n\tpublic int update_file(Map<String, Object> map) throws Exception {\n\t\treturn sql.update(\"cms_board.update_file\", map);\r\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateFile(String fname, String content) {\n\t\tprintMsg(\"running updateFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\tString text = null;\n\t\tPath filepath = Paths.get(theRootPath + System.getProperty(\"file.separator\") + fname);\n\t\tif(Files.exists(filepath)) {\n\t\t\tprintMsg(\"File \" + fname + \" exists, updating...\");\n\t\t\t\n\t\t\tif(content.isEmpty() || content == null) {\n\t\t\t\ttext = String.format(\"%s, testing appending text to an empty file.\\r\\n\", new Date());\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttext = content + \"\\r\\n\";\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFiles.write(filepath, text.getBytes(), StandardOpenOption.APPEND);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void updateSoftDrinkRecord(int sId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\r\n\t\tList<SoftDrinkBean>updateList=new ArrayList<SoftDrinkBean>();\r\n\t\t\r\n\t\t\tupdateList=(List<SoftDrinkBean>)ois.readObject();\r\n\t\t\tfor(SoftDrinkBean s:updateList){\r\n\t\t\t\tif(s.getsId()==sId){\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tswitch (n) {\r\n\t\t\tcase 1:\r\n\t\t\t\tSystem.out.println(\"Enter new drink name\");\r\n\t\t\t\ts.setsName(sc.next());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Price\");\r\n\t\t\t\ts.setsPrice(sc.nextDouble());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Quantity\");\r\n\t\t\t\ts.setSqty(sc.nextInt());\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\t\ttempList2.add(s);\r\n\t\t} else {\r\n\t\t\ttempList2.add(s);\r\n\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile2);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\toos.writeObject(tempList2);\r\n\t\toriginal.delete();\r\n\t\ttempFile.renameTo(original);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"------------------SoftDrink Updated successfully------------\");\r\n\t}", "@Override\r\n\tpublic void changeInf2(Scanner input, String path) {\n\t\tSystem.out.println(\"原联系方式为\"+this.getInfo2());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo2(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "@Override\r\n public void updateTable() {\n FileManager fileManager = new FileManager();\r\n InputStream input = fileManager.readFileFromRAM(fileManager.XML_DIR, FILE_NAME);\r\n if(input != null){\r\n dropTable();\r\n createTable();\r\n parserXml(input); \r\n }else{\r\n Log.i(FILE_NAME,\"file is null\");\r\n }\r\n \r\n }", "private void getDataFromCustomerDataUpdate(Map<String, Object> cusData, CustomerDataTypeDTO data,\n List<FileInfosDTO> listFiles, String formatDate) throws JsonProcessingException {\n if (FieldTypeEnum.FILE.getCode().equals(data.getFieldType())) {\n if (listFiles != null) {\n List<BaseFileInfosDTO> listSaveDb = new ArrayList<>();\n listFiles.forEach(file -> {\n BaseFileInfosDTO fileSaveDb = new BaseFileInfosDTO();\n fileSaveDb.setFileName(file.getFileName());\n fileSaveDb.setFilePath(file.getFilePath());\n listSaveDb.add(fileSaveDb);\n });\n cusData.put(data.getKey(), objectMapper.writeValueAsString(listSaveDb));\n } else {\n cusData.put(data.getKey(), STRING_ARRAY_EMPTY);\n }\n } else if (FieldTypeEnum.MULTIPLE_PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.CHECKBOX.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RELATION.getCode().equals(data.getFieldType())) {\n List<Long> fValue = null;\n try {\n TypeReference<ArrayList<Long>> typeRef = new TypeReference<ArrayList<Long>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RADIO.getCode().equals(data.getFieldType())\n || FieldTypeEnum.NUMBER.getCode().equals(data.getFieldType())) {\n if (StringUtils.isBlank(data.getValue())) {\n if (cusData.containsKey(data.getKey())) {\n cusData.remove(data.getKey());\n }\n } else {\n if (CheckUtil.isNumeric(data.getValue())) {\n cusData.put(data.getKey(), Long.valueOf(data.getValue()));\n } else {\n cusData.put(data.getKey(), Double.valueOf(data.getValue()));\n }\n }\n } else if (FieldTypeEnum.DATE.getCode().equals(data.getFieldType())) {\n getSystemDate(cusData, formatDate, data.getValue(), data.getKey(), null);\n } else if (FieldTypeEnum.TIME.getCode().equals(data.getFieldType())) {\n getSystemTime(cusData, DateUtil.FORMAT_HOUR_MINUTE, data.getValue(), data.getKey());\n } else if (FieldTypeEnum.DATETIME.getCode().equals(data.getFieldType())) {\n String date = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(0, formatDate.length())\n : \"\";\n String hour = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(formatDate.length()) : \"\";\n getSystemDate(cusData, formatDate, date, data.getKey(), hour);\n } else if (FieldTypeEnum.SELECT_ORGANIZATION.getCode().equals(data.getFieldType())) {\n List<Object> fValue = null;\n try {\n TypeReference<ArrayList<Object>> typeRef = new TypeReference<ArrayList<Object>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.LINK.getCode().equals(data.getFieldType())) {\n Map<String, String> fValue = new HashMap<>();\n try {\n TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n cusData.put(data.getKey(), fValue);\n } catch (Exception e) {\n log.error(e.getLocalizedMessage());\n }\n } else {\n cusData.put(data.getKey(), data.getValue());\n }\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "public void update(final UploadFile uploadFile) {\n\t\t UploadFile uploadFileDB = uploadFileDAO.findById(uploadFile.getId());\n\t\t uploadFileDB.setFileName(uploadFile.getFileName());\n\t\t uploadFileDB.setData(uploadFile.getData());\n\t\t uploadFileDAO.persist(uploadFileDB);\n\t }", "protected void changeContent() {\n byte[] data = Arrays.copyOf(content.getContent(),\n content.getContent().length + 1);\n data[content.getContent().length] = '2'; // append one byte\n content.setContent(data);\n LOG.info(\"document content changed\");\n }", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\n this.updateFaxJobFromInputDataImpl(inputData,faxJob);\n }", "public void update() throws IOException{\r\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agenda.txt\", false));\r\n\t\toos.writeObject(artists);\r\n\t\toos.writeObject(stages);\r\n\t\toos.writeObject(performances);\r\n\t\tartists.clear();\r\n\t\tstages.clear();\r\n\t\tperformances.clear();\r\n\t\toos.close();\r\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public void setFileContent(String fileContent) {\n this.fileContent = fileContent;\n }", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "private void updateDatabaseFile() {\n Log.i(\"updateDatabaseFile\", \"Updating server app database\");\n try {\n FileInputStream inputStream = new FileInputStream(databaseFile);\n DropboxAPI.Entry response = MainActivity.mDBApi.putFileOverwrite(databaseFile.getName(), inputStream,\n databaseFile.length(), null);\n Log.i(\"updateDatabaseFile\", \"The uploaded file's rev is: \" + response.rev);\n } catch (Exception e) {\n Log.e(\"updateDatabaseFile\", e.toString(), e);\n }\n }", "@Test\r\n public void testUpdateFile() {\r\n System.out.println(\"updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n // no assertEquals needed because the method itself would throw an error\r\n // if an error occurs check your connection to the internet\r\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void modifyClass2File() throws IOException {\n\t\tMap<String, Object> properties = specificConfig();\n\t\tModifyDriver.modify2File(properties, mvfactory);\n\t}", "public void data(RecordInput recordInput) {\n try {\n byte[] bytes = new byte[100];\n recordInput.readBytes(bytes);\n crc.update(bytes);\n } catch (IOException e) {\n throw new ServingXmlException(e.getMessage(), e);\n }\n }", "@Test\n public void testApplyToOldFile() throws IOException, PatchFailedException {\n Path oldFile = scratch.file(\"/root/oldfile\", \"line one\");\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(oldFile, UTF_8)).isEqualTo(newContent);\n // new file should not change\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).containsExactly(\"line one\");\n }", "@ActionKey(\"/api/blog/updateFile\")\n public void updateFile() throws IOException {\n Integer id = getParaToInt(\"id\");\n File blogFile = getFile(\"blog\").getFile();\n if (id == null) {\n mResult.fail(102);\n renderJson(mResult);\n return;\n }\n if (!blogFile.getName().endsWith(\".md\")) {\n mResult.fail(110);\n renderJson(mResult);\n return;\n }\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(blogFile), \"UTF-8\"));\n StringBuilder builder = new StringBuilder();\n String line = \"\";\n while (line != null) {\n line = reader.readLine();\n builder.append(line);\n }\n mResult.success(mBlogService.update(id, \"content\", builder.toString()));\n renderJson(mResult);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n mResult.fail(109);\n if (reader != null) {\n reader.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private void updateImformation(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint fileId= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tString caption= request.getParameter(\"caption\");\n\t\tString label= request.getParameter(\"label\");\n\t\tString fileName= request.getParameter(\"fileName\");\n\t\tFiles file= new Files(fileId, fileName, label, caption);\n\t\tnew FilesDAO().update(fileId, caption, label);;\n\t\tlistingPage(request, response);\n\t}", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "void overwriteContent(Md2Entity content);", "void setNewFile(File file);", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "void updateData();", "@Update({ \"update csv_file\", \"set pid = #{pid,jdbcType=VARCHAR},\", \"filename = #{filename,jdbcType=VARCHAR},\",\n\t\t\t\"start_time = #{startTime,jdbcType=TIMESTAMP},\", \"end_time = #{endTime,jdbcType=TIMESTAMP},\",\n\t\t\t\"length = #{length,jdbcType=INTEGER},\", \"density = #{density,jdbcType=DOUBLE},\",\n\t\t\t\"machine = #{machine,jdbcType=VARCHAR},\", \"ar = #{ar,jdbcType=BIT},\", \"path = #{path,jdbcType=VARCHAR},\",\n\t\t\t\"size = #{size,jdbcType=BIGINT},\", \"uuid = #{uuid,jdbcType=CHAR},\",\n\t\t\t\"header_time = #{headerTime,jdbcType=TIMESTAMP},\", \"last_update = #{lastUpdate,jdbcType=TIMESTAMP},\",\n\t\t\t\"conflict_resolved = #{conflictResolved,jdbcType=BIT},\", \"status = #{status,jdbcType=INTEGER},\",\n\t\t\t\"comment = #{comment,jdbcType=VARCHAR},\", \"width = #{width,jdbcType=INTEGER},\",\n\t\t\t\"start_version = #{startVersion,jdbcType=INTEGER},\", \"end_version = #{endVersion,jdbcType=INTEGER}\",\n\t\t\t\"where id = #{id,jdbcType=INTEGER}\" })\n\tint updateByPrimaryKey(CsvFile record);", "public static void fileEditor(String sourcePath, String targetPath, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(sourcePath);\n\t\t\t\t File tar= new File(targetPath);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(tar);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "public void updatePersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tserializeToFile(file);\n\t\tupdatePersistentSettings();\n\t}", "public void setFileContent(Byte[] fileContent) {\n this.fileContent = fileContent;\n }", "public void updateContent(Map<String, Object> update_params) throws SolrServerException, IOException {\n\t\tSolrInputDocument doc_in = new SolrInputDocument();\n\n\t\tIterator<String> itr = update_params.keySet().iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString key = itr.next();\n\t\t\t\n\t\t\tdoc_in.addField(key, update_params.get(key));\n\t\t\titr.remove(); // avoids a ConcurrentModificationException\n\t\t}\n\t\t\n\t\t\n\t\t//System.out.println(\"Debug.\");\n\t\tSystem.out.println(\"Debug: Doc_in: \" + doc_in.toString());\n\t\tSystem.out.println(\"updating content...\");\n\t\tUpdateResponse UD_response = server.add(doc_in);\n\t\tserver.commit();\n\t\tSystem.out.println(\"Debug: \"+UD_response.toString());\n\t\tSystem.out.println(\"Finished updating solr.\");\n\n\t}", "public static void makeEntityObservable(FileObject fileInProject, String[] entityInfo, MetadataModel<EntityMappingsMetadata> mappings) {\n if (entityInfo == null) return;\n ClassPath cp = ClassPath.getClassPath(fileInProject, ClassPath.SOURCE);\n String resName = entityInfo[1].replace('.', '/') + \".java\"; // NOI18N\n FileObject entity = cp.findResource(resName);\n if (entity == null) return;\n final List<String> properties;\n try {\n properties = propertiesForColumns(mappings, entityInfo[0], null);\n } catch (IOException ioex) {\n return;\n }\n JavaSource source = JavaSource.forFileObject(entity);\n final boolean[] alreadyUpdated = new boolean[1];\n try {\n // PENDING merge into one task once it will be possible\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n \n for (Tree member : clazz.getMembers()) {\n if (Tree.Kind.VARIABLE == member.getKind()) {\n VariableTree variable = (VariableTree)member;\n String type = variable.getType().toString();\n if (type.endsWith(\"PropertyChangeSupport\")) { // NOI18N\n alreadyUpdated[0] = true;\n }\n }\n }\n \n TreeMaker make = wc.getTreeMaker();\n ClassTree modifiedClass = clazz;\n \n if (!alreadyUpdated[0]) {\n // changeSupport field\n TypeElement transientElement = wc.getElements().getTypeElement(\"javax.persistence.Transient\"); // NOI18N\n TypeMirror transientMirror = transientElement.asType();\n Tree transientType = make.Type(transientMirror);\n AnnotationTree transientTree = make.Annotation(transientType, Collections.EMPTY_LIST);\n ModifiersTree modifiers = make.Modifiers(Modifier.PRIVATE, Collections.singletonList(transientTree));\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n TypeMirror changeSupportMirror = changeSupportElement.asType();\n Tree changeSupportType = make.Type(changeSupportMirror);\n NewClassTree changeSupportConstructor = make.NewClass(null, Collections.EMPTY_LIST, make.QualIdent(changeSupportElement), Collections.singletonList(make.Identifier(\"this\")), null);\n VariableTree changeSupport = make.Variable(modifiers, \"changeSupport\", changeSupportType, changeSupportConstructor); // NOI18N\n modifiedClass = make.insertClassMember(clazz, 0, changeSupport);\n }\n\n // property change notification\n for (Tree clMember : modifiedClass.getMembers()) {\n if (clMember.getKind() == Tree.Kind.METHOD) {\n MethodTree method = (MethodTree)clMember;\n String methodName = method.getName().toString();\n if (methodName.startsWith(\"set\") && (methodName.length() > 3) && (Character.isUpperCase(methodName.charAt(3))) && (method.getParameters().size() == 1)) { // NOI18N\n String propName = methodName.substring(3);\n if ((propName.length() == 1) || (Character.isLowerCase(propName.charAt(1)))) {\n propName = Character.toLowerCase(propName.charAt(0)) + propName.substring(1);\n }\n if (!properties.contains(propName)) continue;\n BlockTree block = method.getBody();\n if (block.getStatements().size() != 1) continue;\n StatementTree statement = block.getStatements().get(0);\n if (statement.getKind() != Tree.Kind.EXPRESSION_STATEMENT) continue;\n ExpressionTree expression = ((ExpressionStatementTree)statement).getExpression();\n if (expression.getKind() != Tree.Kind.ASSIGNMENT) continue;\n AssignmentTree assignment = (AssignmentTree)expression;\n String parName = assignment.getExpression().toString();\n VariableTree parameter = method.getParameters().get(0);\n if (!parameter.getName().toString().equals(parName)) continue;\n ExpressionTree persistentVariable = assignment.getVariable();\n\n // <Type> old<PropertyName> = this.<propertyName>\n String parameterName = parameter.getName().toString();\n String oldParameterName = \"old\" + Character.toUpperCase(parameterName.charAt(0)) + parameterName.substring(1); // NOI18N\n Tree parameterTree = parameter.getType();\n VariableTree oldParameter = make.Variable(make.Modifiers(Collections.EMPTY_SET), oldParameterName, parameterTree, persistentVariable);\n BlockTree newBlock = make.insertBlockStatement(block, 0, oldParameter);\n\n // changeSupport.firePropertyChange(\"<propertyName>\", old<PropertyName>, <propertyName>);\n MemberSelectTree fireMethod = make.MemberSelect(make.Identifier(\"changeSupport\"), \"firePropertyChange\"); // NOI18N\n List<ExpressionTree> fireArgs = new LinkedList<ExpressionTree>();\n fireArgs.add(make.Literal(propName));\n fireArgs.add(make.Identifier(oldParameterName));\n fireArgs.add(make.Identifier(parameterName));\n MethodInvocationTree notification = make.MethodInvocation(Collections.EMPTY_LIST, fireMethod, fireArgs);\n newBlock = make.addBlockStatement(newBlock, make.ExpressionStatement(notification));\n wc.rewrite(block, newBlock);\n }\n }\n }\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n if (alreadyUpdated[0]) return;\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // addPropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree addCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"addPropertyChangeListener\"); // NOI18N\n MethodInvocationTree addInvocation = make.MethodInvocation(Collections.EMPTY_LIST, addCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree addMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"addPropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(addInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, addMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // removePropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree removeCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"removePropertyChangeListener\"); // NOI18N\n MethodInvocationTree removeInvocation = make.MethodInvocation(Collections.EMPTY_LIST, removeCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree removeMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"removePropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(removeInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, removeMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n } catch (IOException ioex) {\n Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, ioex.getMessage(), ioex);\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "public static boolean editEntry(String tableName, String newData, int id){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n String fileContent = tableReader.nextLine()+\"\\n\";\n boolean lineFound = false;\n while (tableReader.hasNextLine()){\n String currentLine = tableReader.nextLine();\n int lineId = Integer.parseInt(currentLine.split(\",\")[0]);\n if(lineId != id){\n fileContent += currentLine+\"\\n\";\n }else{\n lineFound = true;\n }\n }\n tableReader.close();\n if(lineFound){\n fileContent += id+\",\"+newData+\"\\n\";\n FileWriter tableWriter = new FileWriter(table);\n String[] fileLines = fileContent.split(\"\\n\");\n for(String l : fileLines){\n tableWriter.write(l+\"\\n\");\n }\n tableWriter.close();\n return true;\n }else{\n System.out.println(\"No se encontró una entrada con el id: \"+id);\n return false;\n }\n\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }", "public void uploadDataFromFile()\n {\n String jobSeekerFile = (\"JobSeeker.txt\");\n String jobRecruiterFile = (\"JobRecruiter.txt\");\n String jobFile = (\"Job.txt\");\n String notificationFile = (\"Notification.txt\");\n \n String jobSeekerLines = readFile(jobSeekerFile);\n String jobRecruiterLines = readFile(jobRecruiterFile);\n String jobLines = readFile(jobFile);\n String notificationLines = readFile(notificationFile);\n \n storeJobSeekersToJobSeekerList(jobSeekerLines);\n storeJobRecruitersToJobRecruiterList(jobRecruiterLines);\n storeJobsToJobList(jobLines);\n storeNotificationsToNotificationList(notificationLines);\n \n }", "public void processInput(String theFile){processInput(new File(theFile));}", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "private void updateFieldRows(Connection con,\n IdentifiedRecordTemplate template, GenericDataRecord record)\n throws SQLException, FormException, CryptoException {\n PreparedStatement update = null;\n PreparedStatement insert = null;\n \n try {\n update = con.prepareStatement(UPDATE_FIELD);\n int recordId = record.getInternalId();\n String[] fieldNames = record.getFieldNames();\n Map<String, String> rows = new HashMap<String, String>();\n for (String fieldName : fieldNames) {\n Field field = record.getField(fieldName);\n String fieldValue = field.getStringValue();\n \n SilverTrace.debug(\"form\", \"GenericRecordSetManager.updateFieldRows\",\n \"root.MSG_GEN_PARAM_VALUE\", \"fieldName = \" + fieldName\n + \", fieldValue = \" + fieldValue\n + \", recordId = \" + recordId);\n \n rows.put(fieldName, fieldValue);\n }\n \n if (template.isEncrypted()) {\n rows = getEncryptionService().encryptContent(rows);\n }\n \n for (String fieldName : rows.keySet()) {\n String fieldValue = rows.get(fieldName);\n update.setString(1, fieldValue);\n update.setInt(2, recordId);\n update.setString(3, fieldName);\n \n int nbRowsCount = update.executeUpdate();\n if (nbRowsCount == 0) {\n // no row has been updated because the field fieldName doesn't exist in database.\n // The form has changed since the last modification of the record.\n // So we must insert this new field.\n insert = con.prepareStatement(INSERT_FIELD);\n insert.setInt(1, recordId);\n insert.setString(2, fieldName);\n insert.setString(3, fieldValue);\n \n insert.execute();\n }\n }\n } finally {\n DBUtil.close(update);\n DBUtil.close(insert);\n }\n }", "public void saveWorkingDataFile(String rftNo, String fileName, int fileRecordNumber, Connection conn) \n\t\tthrows ReadWriteException, NotFoundException, InvalidDefineException, IllegalAccessException, IOException\n\t{\t\t\n\t\tString id = \"\";\n\t\tMatcher m = Pattern.compile(\"ID(\\\\d\\\\d\\\\d\\\\d).txt\").matcher(fileName);\n\t\tif (m.find())\n\t\t{\n\t\t\tid = m.group(1);\n\t\t}\n\t\t//#CM702621\n\t\t// Generation of instance of work file\n\t\tWorkDataFile workDataFile =\n\t\t (WorkDataFile) PackageManager.getObject(\"Id\"+ id + \"DataFile\");\n\t\tworkDataFile.setFileName(fileName);\n\t\t\n\t\t//#CM702622\n\t\t// Remove the passing part of File Name. \n\t\tFile file = new File(fileName);\n\t\tString registFileName = file.getName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tWorkingDataHandler wHandler = new WorkingDataHandler(conn);\n\t\t\t//#CM702623\n\t\t\t// Open the made work file. \n\t\t\tworkDataFile.openReadOnly();\n\t\t\tint i = 0;\n\t\t\tfor(workDataFile.next(); i < fileRecordNumber; workDataFile.next())\n\t\t\t{\t\n\t\t\t\tWorkingDataAlterKey akey = new WorkingDataAlterKey();\n\t\t\t\takey.setRftNo(rftNo);\n\t\t\t\takey.setLineNo(i);\n\t\t\t\takey.updateFileName(registFileName);\n\t\t\t\takey.updateContents(workDataFile.getContents());\n\n\t\t\t\tWorkingDataSearchKey skey = new WorkingDataSearchKey();\n\t\t\t\tskey.setRftNo(rftNo);\n\t\t\t\tskey.setFileName(registFileName);\n\t\t\t\tskey.setLineNo(i);\n\t\t\t\tWorkingData[] workingArr= (WorkingData[])wHandler.find(skey);\n\t\t\t\tif (workingArr.length > 0)\n\t\t\t\t{\n\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tWorkingData workdata = new WorkingData();\n\t\t\t\t\t\tworkdata.setRftNo(rftNo);\n\t\t\t\t\t\tworkdata.setFileName(registFileName);\n\t\t\t\t\t\tworkdata.setLineNo(i);\n\t\t\t\t\t\tworkdata.setContents(workDataFile.getContents());\n\t\t\t\t\t\twHandler.create(workdata);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (DataExistsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tworkDataFile.closeReadOnly();\n\t\t}\n\t\t\n\t}", "public void updateSettings(FileObject file) {\n DataObject dobj = null;\n DataFolder folder = null;\n try {\n dobj = DataObject.find(file);\n folder = dobj.getFolder();\n } catch (DataObjectNotFoundException ex) {\n Exceptions.printStackTrace(ex);\n }\n if (dobj == null || folder == null) {\n return;\n }\n for (CreateFromTemplateAttributesProvider provider\n : Lookup.getDefault().lookupAll(CreateFromTemplateAttributesProvider.class)) {\n Map<String, ?> attrs = provider.attributesFor(dobj, folder, \"XXX\"); // NOI18N\n if (attrs == null) {\n continue;\n }\n Object aName = attrs.get(\"user\"); // NOI18N\n if (aName != null) {\n author = aName.toString();\n break;\n }\n }\n }", "public void update() throws IOException {\n\n\t\tif(this.bdgDataColIdx < 4){\n\t\t\tSystem.err.println(\"Invalid index for bedgraph column of data value. Resetting to 4. Expected >=4. Got \" + this.bdgDataColIdx);\n\t\t\tthis.bdgDataColIdx= 4;\n\t\t}\n\n\t\tif(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BIGWIG)){\n\t\t\t\n\t\t\tbigWigToScores(this.bigWigReader);\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.TDF)){\n\n\t\t\tthis.screenWiggleLocusInfoList= \n\t\t\t\t\tTDFUtils.tdfRangeToScreen(this.getFilename(), this.getGc().getChrom(), \n\t\t\t\t\t\t\tthis.getGc().getFrom(), this.getGc().getTo(), this.getGc().getMapping());\n\t\t\t\n\t\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\t\tfor(ScreenWiggleLocusInfo x : screenWiggleLocusInfoList){\n\t\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t\t}\n\t\t\tthis.setScreenScores(screenScores);\t\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BEDGRAPH)){\n\n\t\t\t// FIXME: Do not use hardcoded .samTextViewer.tmp.gz!\n\t\t\tif(Utils.hasTabixIndex(this.getFilename())){\n\t\t\t\tbedGraphToScores(this.getFilename());\n\t\t\t} else if(Utils.hasTabixIndex(this.getFilename() + \".samTextViewer.tmp.gz\")){\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t} else {\n\t\t\t\tblockCompressAndIndex(this.getFilename(), this.getFilename() + \".samTextViewer.tmp.gz\", true);\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Extension (i.e. file type) not recognized for \" + this.getFilename());\n\t\t}\n\t\tthis.setYLimitMin(this.getYLimitMin());\n\t\tthis.setYLimitMax(this.getYLimitMax());\n\t}", "public void updatePathAndFile(String path, String file){\r\n\t\tthis.path = path;\r\n\t\tthis.file = file;\r\n\t}", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void convert(File inputFile, File outputFile) throws IOException {\n\n setType(inputFile);\n\n BufferedReader reader = null;\n PrintWriter writer = null;\n\n try {\n reader = new BufferedReader(new FileReader(inputFile));\n writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n\n String nextLine = null;\n\n // Skip meta data. Note for GCT files this includes the mandatory first line\n while ((nextLine = reader.readLine()).startsWith(\"#\") && (nextLine != null)) {\n writer.println(nextLine);\n }\n\n // This is the first non-meta line\n writer.println(nextLine);\n\n // for TAB and RES files the first row contains the column headings.\n int nCols = 0;\n if (type == FileType.TAB || type == FileType.RES) {\n nCols = nextLine.split(\"\\t\").length;\n }\n\n\n if (type == FileType.GCT) {\n // GCT files. Column headings are 3rd row (read next line)\n nextLine = reader.readLine();\n nCols = nextLine.split(\"\\t\").length;\n writer.println(nextLine);\n } else if (type == FileType.RES) {\n // Res files -- skip lines 2 and 3\n writer.println(reader.readLine());\n writer.println(reader.readLine());\n }\n\n\n // Compute the # of data points\n int columnSkip = 1;\n if (type == FileType.RES) {\n columnSkip = 2;\n nCols++; // <= last call column of a res file is sometimes blank, if not this will get\n }\n nPts = (nCols - dataStartColumn) / columnSkip;\n\n // Now for the data\n while ((nextLine = reader.readLine()) != null) {\n String[] tokens = nextLine.split(\"\\t\");\n\n for (int i = 0; i < dataStartColumn; i++) {\n writer.print(tokens[i] + \"\\t\");\n }\n\n DataRow row = new DataRow(tokens, nextLine);\n for (int i = 0; i < nPts; i++) {\n\n if (Double.isNaN(row.scaledData[i])) {\n writer.print(\"\\t\");\n } else {\n\n writer.print(row.scaledData[i]);\n if (type == FileType.RES) {\n writer.print(\"\\t\" + row.calls[i]);\n }\n if (i < nPts - 1) {\n writer.print(\"\\t\");\n }\n }\n }\n writer.println();\n }\n }\n finally {\n if (reader != null) {\n reader.close();\n }\n if (writer != null) {\n writer.close();\n }\n }\n }", "public void testAppendDataInFile() throws IOException {\n\t\tfinal CachedParserDocument pdoc = new CachedParserDocument(this.tempFilemanager,0);\n\t\tassertTrue(pdoc.inMemory());\n\t\tassertEquals(0, pdoc.length());\n\t\tassertFalse(this.outputFile.exists());\n\t\t\n\t\t// copying data\n\t\tthis.appendData(TESTFILE, pdoc);\n\t\t\n\t\t// some tests\n\t\tassertFalse(pdoc.inMemory());\n\t\tassertEquals(this.fileSize, pdoc.length());\n\t\tassertTrue(this.outputFile.exists());\n\t\tassertEquals(TESTFILE, pdoc.getTextAsReader());\n\t\tassertEquals(TESTFILE, pdoc.getTextFile());\n\t\tassertFalse(pdoc.inMemory());\n\t}" ]
[ "0.63659966", "0.63275295", "0.62384194", "0.60855085", "0.5955166", "0.58391285", "0.58047044", "0.5685859", "0.5579543", "0.5572445", "0.5551324", "0.5513216", "0.5493238", "0.54738164", "0.5466045", "0.5448318", "0.54337513", "0.54272074", "0.5411458", "0.53925943", "0.53913015", "0.5379262", "0.53635633", "0.53621566", "0.53494436", "0.5349078", "0.5346488", "0.5340003", "0.53316206", "0.5320239", "0.531496", "0.53058386", "0.5290273", "0.52888435", "0.5277027", "0.5268765", "0.5256243", "0.522289", "0.52074", "0.5167554", "0.51576924", "0.51529515", "0.5141616", "0.51384354", "0.51280016", "0.51081216", "0.5104228", "0.509826", "0.5086957", "0.5085901", "0.50853175", "0.5084096", "0.5077521", "0.5070626", "0.50508624", "0.50415224", "0.50360686", "0.503347", "0.50276464", "0.5025986", "0.50208485", "0.502015", "0.5009873", "0.5006669", "0.5002079", "0.49922663", "0.49713135", "0.49694362", "0.49663746", "0.49525535", "0.49475014", "0.49358252", "0.49327683", "0.49237514", "0.49220783", "0.49172756", "0.49158528", "0.49107683", "0.49090573", "0.49058697", "0.49025717", "0.4893902", "0.48842558", "0.48808742", "0.48664686", "0.48583126", "0.48571655", "0.48551816", "0.48545218", "0.48517323", "0.4840943", "0.4836562", "0.48341274", "0.48339885", "0.48307753", "0.482992", "0.4829761", "0.4821867", "0.48210764", "0.48164526", "0.4806506" ]
0.0
-1
Replace the changed fields and update the contents of inputFileContent to the data file
public static void dateDue() { Date date = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); String strDate = formatter.format(date); NewProject.due_date = getInput("Please enter the due date for this project(dd/mm/yyyy): "); UpdateData.updateDueDate(); updateMenu(); //Return back to previous menu. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateDataFile(DataFile dataFile) {\n updateMeeting(dataFile.getMeeting());\n }", "void updateFile() throws IOException;", "public int update(FFileInputDO FFileInput) throws DataAccessException;", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "@Override\r\n\tpublic void updateFileData(FileMetaDataEntity userInfo) {\n\t\t\r\n\t}", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void update(String filename, SensorData sensorData){\n //Adds the sensor data to the buffer. \n addToBuffer(filename, sensorData);\n \n //Uploads the data to the server if it's turned on. \n if (Server.getInstance().getServerIsOn())\n if(uploadData()){\n //If the upload was successful, clear the buffer.\n clearBuffer();\n }\n }", "public FileFormatFormData update(FileFormatFormData formData)\r\n\t\t\tthrows ProcessingException;", "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "private void updateToFile(PQNode node) throws Exception{\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n int replaceIndex = node.getPqIndex()-bufStart;\n\n nodes.set(replaceIndex,node);\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n storeToFile(file,nodes, false);\n }", "public void replaceFile(String inputFilename) {\n try {\n FileReader fr = new FileReader(inputFilename);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n if (line.isEmpty()) {\n System.out.println();\n } else {\n line = replaceLine(line);\n System.out.println(line);\n }\n }\n } catch (IOException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }", "public void testChanges(String filePath) {\n Object[] fileObjectArray = fetchTextFile(filePath);\n String newFile = prepareText(fileObjectArray);\n System.out.println(newFile);\n }", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "private void updateFiles() {\n\t}", "public void updateContent(Map<String, ContentChange> files);", "private void setDataFileChanged(String newPath) {\r\n \t\t// set file to be reloaded if changed\r\n \t\tif ((null == dataFile && !newPath.equals(\"\"))\r\n \t\t\t\t|| (null != dataFile && !dataFile.equals(newPath))) {\r\n \t\t\treloadFile = true;\r\n \t\t}\r\n \t\t// copy new value\r\n \t\tdataFile = newPath;\r\n \t\t// add log\r\n \t\tif (localLOGV) {\r\n \t\t\tLog.i(TAG, \"Reload file set to \" + String.valueOf(reloadFile));\r\n \t\t}\r\n \t}", "private void copyInputFile(String originalFilePath, String destinationFilePath) {\n String inputType = ((DataMapperDiagramEditor) workBenchPart.getSite().getWorkbenchWindow().getActivePage()\n .getActiveEditor()).getInputSchemaType();\n\n if (null != originalFilePath && null != destinationFilePath\n && (inputType.equals(\"XML\") || inputType.equals(\"JSON\") || inputType.equals(\"CSV\"))) {\n File originalFile = new File(originalFilePath);\n File copiedFile = new File(destinationFilePath);\n try {\n FileUtils.copyFile(originalFile, copiedFile);\n assert (copiedFile).exists();\n\t\t\t\tassert (Files.readAllLines(originalFile.toPath(), Charset.defaultCharset())\n\t\t\t\t\t\t.equals(Files.readAllLines(copiedFile.toPath(), Charset.defaultCharset())));\n } catch (IOException e) {\n log.error(\"IO error occured while saving the datamapper input file!\", e);\n }\n } else if (null != destinationFilePath) {\n clearContent(new File(destinationFilePath));\n }\n }", "public void set(String keyInput, String valueInput) {\n\t\tfileData.put(keyInput, valueInput);\n\t\ttry {\n\t\t\twriteToFile();\n\t\t}\n\t\tcatch (IOException anything) {\n\t\t\tSystem.out.println(\"Couldn't write to file \" + path + \". Error: \" + anything.getMessage());\n\t\t}\n\t}", "public void refreshData(File file) throws IOException{\n\t\tmodel = new FileDataModel(file);\n\t}", "@Override\n\tpublic FileModel update(FileModel c) {\n\t\treturn fm.saveAndFlush(c);\n\t}", "void update(FileInfo fileInfo);", "@Override\r\n\tpublic void updateAll() throws IOException {\n\t}", "@Override\n\tpublic void update(finalDataBean t, String[] fields) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void updatePizzaRecord(int pId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\t\r\n\t\tList<PizzaBean> updateList = new ArrayList<PizzaBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList = (List<PizzaBean>) ois.readObject();\r\n\t\t\tfor (PizzaBean p : updateList) {\r\n\t\t\t\tif (p.getpId() == pId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza name\");\r\n\t\t\t\t\t\tp.setpName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Pizza Price\");\r\n\t\t\t\t\t\tp.setpPrice(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList = new ArrayList<PizzaBean>();\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\t\t\toos.writeObject(tempList);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile.renameTo(original);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Pizza Updated Successfully\");\r\n\t}", "boolean update(DataTableDef def) throws IOException;", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void updateNonDynamicFields() {\n\n\t}", "public static void UpdateLineInFileByID(String i_FileName, String i_ID, StringBuilder i_StringToReplace,\n\t\t\tStringBuilder i_StringToReplaceWith) {\n\t}", "public void updateRecord(String companyName) {\n String option = \"\";\n boolean quit = false;\n byte [] numEmplyees = new byte[Constants.NUM_BYTES_COMPANY_EMPLOYEES];\n byte [] cityName = new byte[Constants.NUM_BYTES_COMPANY_CITY];\n byte [] rank = new byte[Constants.NUM_BYTES_RANK];\n byte [] state = new byte[Constants.NUM_BYTES_COMPANY_STATE];\n byte [] zip = new byte[Constants.NUM_BYTES_COMPANY_ZIP];\n\n BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n RandomAccessFile din = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n RandomAccessFile oin = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n\n //find company to update\n String recordLocation = \"normal\";\n int recordNumber = this.binarySearch(din, companyName.toUpperCase());\n\n if (recordNumber == -1) {\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String record = getRecord(\"overflow\", oin, i);\n String recordName = record.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.toUpperCase().equals(recordName)) {\n recordNumber = i;\n recordLocation = \"overflow\";\n break;\n }\n }\n }\n\n //if company found\n if(recordNumber != -1){\n //untill the user wants to stop updating\n while(!quit){\n System.out.println(\"What would you like to change?\");\n System.out.println(\"[1] Rank\");\n System.out.println(\"[2] City\");\n System.out.println(\"[3] State\"); \n System.out.println(\"[4] Zip Code\");\n System.out.println(\"[5] Number of Employees\");\n System.out.println(\"[6] done updating\");\n option = inputReader.readLine();\n\n byte [] update;\n switch(option) {\n case \"1\":\n System.out.println(\"Enter updated Rank\");\n update = HelperFunctions.getInputDataBytes(5);\n // option = inputReader.readLine();\n //format input to fixed length\n \n // option = String.format(\"%-5s\", option.toUpperCase());\n // rank = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n //replace current rank with new rank\n oin.write(update); \n }\n break;\n case \"2\":\n System.out.println(\"Enter updated City\");\n update = HelperFunctions.getInputDataBytes(20);\n // option = inputReader.readLine();\n // option = String.format(\"%-20s\", option.toUpperCase());\n // cityName = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n oin.write(update); \n } \n break;\n case \"3\":\n System.out.println(\"Enter updated State Abbreviation\");\n // option = inputReader.readLine();\n // option = String.format(\"%-3s\", option.toUpperCase());\n // state = option.getBytes();\n update = HelperFunctions.getInputDataBytes(3);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n oin.write(update);\n }\n break;\n case \"4\":\n System.out.println(\"Enter updated Zip Code\");\n // option = inputReader.readLine();\n // option = String.format(\"%-6s\", option.toUpperCase());\n // zip = option.getBytes();\n update = HelperFunctions.getInputDataBytes(6);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n oin.write(update);\n }\n break;\n case \"5\":\n System.out.println(\"Enter updated Number of Employees\");\n // option = inputReader.readLine();\n // option = String.format(\"%-10s\", option.toUpperCase());\n // numEmplyees = option.getBytes();\n update = HelperFunctions.getInputDataBytes(10);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n oin.write(update); \n }\n break;\n case \"6\":\n quit = true;\n din.close();\n oin.close();\n break;\n default:\n System.out.println(\"That is not a valid option, please select a valid option\");\n break; \n }\n }\n }\n //if not found, let the user know\n else{\n System.out.println(\"NOT FOUND\");\n return;\n } \n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public interface FileReplacer {\n public void replaceTags(ArrayList<String> header, CSVRecord record, File resultFile);\n public void replaceTagsWithCoef(ArrayList<String> header, int headerIndex, double coefficient, CSVRecord record, File resultFile);\n\n public void replaceInOneDoc(ArrayList<String> header, CSVRecord record, File file, Table cellTable);\n}", "public void updateData() {}", "public static interface DataReplace {\n\t\t/**\n\t\t * This method is used to alter the lines in the data array. Each line is parsed to this method, and whatever is returned will replace the current line.\n\t\t * \n\t\t * @param input\n\t\t * One line of the data array\n\t\t */\n\t\tpublic String replace(String input);\n\t}", "public void setInputFile(File inputFile) {\n this.inputFile = inputFile;\n }", "private byte[] updateContent(byte[] request) {\n if (replaceFirst()) {\n return Utils.byteArrayRegexReplaceFirst(request, this.match, this.replace);\n } else {\n return Utils.byteArrayRegexReplaceAll(request, this.match, this.replace);\n }\n }", "@Override\r\n\tpublic void updateIceCreamRecord(int iceId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original1);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile1);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\r\n\t\tList<IceCreamBean> updateList1 = new ArrayList<IceCreamBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList1 = (List<IceCreamBean>) ois.readObject();\r\n\t\t\tfor (IceCreamBean p : updateList1) {\r\n\t\t\t\tif (p.getIceId() == iceId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream name\");\r\n\t\t\t\t\t\tp.setIceName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Price\");\r\n\t\t\t\t\t\tp.setIceprice(sc.nextDouble());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList1 = new ArrayList<IceCreamBean>();\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfos=new FileOutputStream(tempFile1);\r\n\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\toos.writeObject(tempList1);\r\n\t\t\t\toriginal1.delete();\r\n\t\t\t\ttempFile1.renameTo(original);\r\n\t\t\t\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void setEditedContent(CGFile file) {\n\n\t\t}", "@Override\n\t\tpublic void update() throws IOException {\n\t\t}", "public void readReplace(String fname, String oldPattern, String replPattern) {\n\t\tString line;\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(fname);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfis));\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tMatcher matcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\tif (matcher.find()){\n\t\t\t\t\tmatcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\t\tline = matcher.replaceAll(replPattern);\n\t\t\t\t}\n\t\t\t\tsb.append(line + Constants.RETURN);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(fname));\n\t\t\tout.write(sb.toString());\n\t\t\tout.close();\n\t\t\t// logger.debug(\"Fichero remplazado con exito \" + fname);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(LOG, e);\n\t\t}\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "private void processModify(int fileId, int commitId) throws SQLException,\n \t\t\tIOException {\n \t\tint previousCommitId = commitGraph.findPreviousCommitId(fileId,\n \t\t\t\tcommitId);\n \t\tString newContent = FileUtils.getContent(fileId, commitId);\n \t\tString oldContent = getPreviousContent(fileId, previousCommitId);\n \t\tList<SourceCodeChange> changes = extractDiff(new FileRevision(\n \t\t\t\tpreviousCommitId, fileId, oldContent), new FileRevision(\n \t\t\t\tcommitId, fileId, newContent));\n \t\tif (changes == null || changes.size() == 0) {\n \t\t\tlogger.warning(\"No changes distilled for file \" + fileId\n \t\t\t\t\t+ \" at commit_id \" + commitId + \" from previous commit id \"\n \t\t\t\t\t+ previousCommitId);\n \t\t} else {\n \t\t\tthis.reducer.add(changes, fileId, commitId);\n \t\t}\n \t\tif (changes != null) { // can't check newcontent alone, as it can have\n \t\t\t\t\t\t\t\t// invalid syntax\n \t\t\tassert (newContent != null);\n \t\t\tfileContentCache.put(fileId, new FileRevision(commitId, fileId,\n \t\t\t\t\tnewContent));\n \t\t}\n \t}", "public static void modifytext (String name) throws IOException {\n // Copy the contents of the input file and put it into the new file\n File inputF = new File(\"src/main/java/ex45/\"+ name +\".txt\");\n Path dest = inputF.toPath();\n Path src = Paths.get(\"src/main/java/ex45/exercise45_input.txt\");\n Files.copy(src, dest);\n\n // This process will replace the word 'utilize' with the word 'use'\n String utilize = new String(Files.readAllBytes(dest));\n Charset charset = StandardCharsets.UTF_8;\n utilize = utilize.replaceAll(\"utilize\", \"use\");\n Files.write(dest, utilize.getBytes(charset));\n\n System.out.print(\"Your file has been created.\");\n }", "private static void updateFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedWriter frequencyWriter = new BufferedWriter(new FileWriter(frequencyFile));\n\n\t\tfor(Entry<String, Long> entry : dataMap.entrySet()) { // Write every entry to the frequency file\n\n\t\t\tfrequencyWriter.write(generateStringFromEntry(entry));\n\t\t\tfrequencyWriter.newLine();\n\t\t}\n\n\t\tfrequencyWriter.close();\n\t}", "@Override\n public void saveDataFromCsvFile(List<TimetableUpload> inputData) {\n Map<String, Timetable> timetables = new HashMap<>();\n Semester semester = semesterService.getLatestSemester();\n Long latestVersionInSemester = timetableService.getLatestTimetableVersionInSemester(semester.getId());\n\n //timetableUpload = eden red od csv fajlot\n for (TimetableUpload timetableUpload : inputData) {\n //odreduvanje na modul\n String studentGroup = timetableUpload.getModule();\n String identifier = timetableUpload.getProfessor() + \" \" + timetableUpload.getSubject() + \" \" + timetableUpload.getRoom() + \" \" + studentGroup + \" \" + timetableUpload.getDay();\n\n if (!timetables.containsKey(identifier)) {\n\n //vnesuvanje na profesori i asistenti\n Professor professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n if(professor == null) {\n professorService.saveProfessor(timetableUpload.getProfessor());\n professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n }\n\n Subject subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n if (subject == null) {\n subjectService.saveSubject(timetableUpload.getSubject());\n subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n }\n\n Timetable newTimetable = new Timetable(8 + Long.parseLong(timetableUpload.getHourFrom()),\n 9 + Long.parseLong(timetableUpload.getHourFrom()), Long.parseLong(timetableUpload.getDay()), timetableUpload.getRoom(),\n studentGroup, professor, subject, semester, latestVersionInSemester + 1);\n timetables.put(identifier, newTimetable);\n } else {\n Timetable existingTimetable = timetables.get(identifier);\n existingTimetable.setHourTo(existingTimetable.getHourTo() + 1);\n timetables.replace(identifier, existingTimetable);\n }\n timetableService.saveAll(timetables.values());\n }\n }", "public void replace(int idIndex, String inputFilePath) {\n\t\tString url = IP + String.valueOf(PORT) + \"/replace\";\n\t\thelper(url, idIndex, inputFilePath);\n\t}", "public void reload() {\n\t\tif (file.lastModified() <= fileModified)\n\t\t\treturn;\n\t\n\t\treadFile();\n\t}", "@Override\r\n\tpublic void changeInf1(Scanner input, String path) {\n\t\tSystem.out.println(\"原去处为\"+this.getInfo1());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo1(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "public void performChange() {\n String nm = fqname.substring(fqname.lastIndexOf('.') + 1);\n if (oldAttrName == null) {\n // no attribute -> it's a filename change. eg. org-milos-kleint-MyInstance.instance\n newFileName = oldFileName.replaceAll(\"\\\\-\" + nm + \"$\", \"-\" + rename.getNewName());\n } else {\n if (oldAttrName.indexOf(fqname.replace('.','-') + \".instance\") > 0) {\n //replacing the ordering attribute..\n newAttrName = oldAttrName.replaceAll(\"-\" + nm + \"\\\\.\", \"-\" + rename.getNewName() + \".\");\n } else {\n //replacing attr value probably in instanceCreate and similar\n if (oldAttrValue != null) {\n String toReplacePattern = nm;\n newAttrValue = oldAttrValue.replaceAll(toReplacePattern, rename.getNewName());\n }\n }\n }\n \n if (newAttrValue != null) {\n doAttributeValueChange(newAttrValue, valueType);\n }\n if (newAttrName != null) {\n doAttributeMove(oldAttrName, newAttrName);\n }\n if (newFileName != null) {\n doFileMove(newFileName);\n }\n }", "public void updateTableData(String currentSchema,\n\t\t\tTreeMap<Integer,List<String>> tableDataMap,\n\t\t\tTreeMap<Integer,List<String>> tableSchemaMap){\n\t\ttry{\n\t\t\tInsertHelper iH = InsertHelper.getInsertHelperInstance();\n\t\t\tRandomAccessFile tableDataFile = new RandomAccessFile(currentSchema + \".\" + tableName + \".tbl\", \"rw\");\n\n\t\t\t//Table Data Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> tableDataMapSet = tableDataMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> tableDataMapIterator = tableDataMapSet.iterator();\n\n\t\t\t//Table Schema Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> columnSet = tableSchemaMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> columnIterator = columnSet.iterator();\n\t\t\tList<String> columnSchema = new ArrayList<String>();\n\n\t\t\t//Adding Column_Name,INT serially in the list\n\t\t\twhile(columnIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = columnIterator.next();\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tcolumnSchema.add(currentColumn.get(0));\n\t\t\t\tcolumnSchema.add(currentColumn.get(1));\n\t\t\t}\n\n\t\t\t//Checks the array list and writes accordingly to the File \n\t\t\twhile(tableDataMapIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = tableDataMapIterator.next();\n\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tint columnDataCounter = currentColumn.size();\n\t\t\t\tint columnSchemaCounter = 0;\n\n\t\t\t\tfor(int i = 0;i < columnDataCounter; i++){\n\t\t\t\t\tlong tableIndexPointer = tableDataFile.getFilePointer();\n\t\t\t\t\tif(columnSchema.get(columnSchemaCounter + 1).contains(\"VARCHAR\")){\n\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch(columnSchema.get(columnSchemaCounter + 1)){\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"BYTE\": \n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"SHORT\":\n\t\t\t\t\t\t\ttableDataFile.writeShort(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\t\ttableDataFile.writeInt(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"LONG\": \n\t\t\t\t\t\t\ttableDataFile.writeLong(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FLOAT\": \n\t\t\t\t\t\t\ttableDataFile.writeFloat(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DOUBLE\": \n\t\t\t\t\t\t\ttableDataFile.writeDouble(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\": \n\t\t\t\t\t\t\tDateFormat dateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH:mm:ss\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate dateTime = dateTimeFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(dateTime.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATE\": \n\t\t\t\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate date = dateFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(date.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\ttableDataFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void processFile() throws IOException {\n\t\tsetContent(file.getBytes());\n\t\tsetMultipartFileContentType(file.getContentType());\n\t}", "@Override\r\n\tpublic int update_file(Map<String, Object> map) throws Exception {\n\t\treturn sql.update(\"cms_board.update_file\", map);\r\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateFile(String fname, String content) {\n\t\tprintMsg(\"running updateFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\tString text = null;\n\t\tPath filepath = Paths.get(theRootPath + System.getProperty(\"file.separator\") + fname);\n\t\tif(Files.exists(filepath)) {\n\t\t\tprintMsg(\"File \" + fname + \" exists, updating...\");\n\t\t\t\n\t\t\tif(content.isEmpty() || content == null) {\n\t\t\t\ttext = String.format(\"%s, testing appending text to an empty file.\\r\\n\", new Date());\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttext = content + \"\\r\\n\";\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFiles.write(filepath, text.getBytes(), StandardOpenOption.APPEND);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void updateSoftDrinkRecord(int sId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\r\n\t\tList<SoftDrinkBean>updateList=new ArrayList<SoftDrinkBean>();\r\n\t\t\r\n\t\t\tupdateList=(List<SoftDrinkBean>)ois.readObject();\r\n\t\t\tfor(SoftDrinkBean s:updateList){\r\n\t\t\t\tif(s.getsId()==sId){\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tswitch (n) {\r\n\t\t\tcase 1:\r\n\t\t\t\tSystem.out.println(\"Enter new drink name\");\r\n\t\t\t\ts.setsName(sc.next());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Price\");\r\n\t\t\t\ts.setsPrice(sc.nextDouble());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Quantity\");\r\n\t\t\t\ts.setSqty(sc.nextInt());\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\t\ttempList2.add(s);\r\n\t\t} else {\r\n\t\t\ttempList2.add(s);\r\n\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile2);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\toos.writeObject(tempList2);\r\n\t\toriginal.delete();\r\n\t\ttempFile.renameTo(original);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"------------------SoftDrink Updated successfully------------\");\r\n\t}", "@Override\r\n\tpublic void changeInf2(Scanner input, String path) {\n\t\tSystem.out.println(\"原联系方式为\"+this.getInfo2());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo2(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "@Override\r\n public void updateTable() {\n FileManager fileManager = new FileManager();\r\n InputStream input = fileManager.readFileFromRAM(fileManager.XML_DIR, FILE_NAME);\r\n if(input != null){\r\n dropTable();\r\n createTable();\r\n parserXml(input); \r\n }else{\r\n Log.i(FILE_NAME,\"file is null\");\r\n }\r\n \r\n }", "private void getDataFromCustomerDataUpdate(Map<String, Object> cusData, CustomerDataTypeDTO data,\n List<FileInfosDTO> listFiles, String formatDate) throws JsonProcessingException {\n if (FieldTypeEnum.FILE.getCode().equals(data.getFieldType())) {\n if (listFiles != null) {\n List<BaseFileInfosDTO> listSaveDb = new ArrayList<>();\n listFiles.forEach(file -> {\n BaseFileInfosDTO fileSaveDb = new BaseFileInfosDTO();\n fileSaveDb.setFileName(file.getFileName());\n fileSaveDb.setFilePath(file.getFilePath());\n listSaveDb.add(fileSaveDb);\n });\n cusData.put(data.getKey(), objectMapper.writeValueAsString(listSaveDb));\n } else {\n cusData.put(data.getKey(), STRING_ARRAY_EMPTY);\n }\n } else if (FieldTypeEnum.MULTIPLE_PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.CHECKBOX.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RELATION.getCode().equals(data.getFieldType())) {\n List<Long> fValue = null;\n try {\n TypeReference<ArrayList<Long>> typeRef = new TypeReference<ArrayList<Long>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RADIO.getCode().equals(data.getFieldType())\n || FieldTypeEnum.NUMBER.getCode().equals(data.getFieldType())) {\n if (StringUtils.isBlank(data.getValue())) {\n if (cusData.containsKey(data.getKey())) {\n cusData.remove(data.getKey());\n }\n } else {\n if (CheckUtil.isNumeric(data.getValue())) {\n cusData.put(data.getKey(), Long.valueOf(data.getValue()));\n } else {\n cusData.put(data.getKey(), Double.valueOf(data.getValue()));\n }\n }\n } else if (FieldTypeEnum.DATE.getCode().equals(data.getFieldType())) {\n getSystemDate(cusData, formatDate, data.getValue(), data.getKey(), null);\n } else if (FieldTypeEnum.TIME.getCode().equals(data.getFieldType())) {\n getSystemTime(cusData, DateUtil.FORMAT_HOUR_MINUTE, data.getValue(), data.getKey());\n } else if (FieldTypeEnum.DATETIME.getCode().equals(data.getFieldType())) {\n String date = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(0, formatDate.length())\n : \"\";\n String hour = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(formatDate.length()) : \"\";\n getSystemDate(cusData, formatDate, date, data.getKey(), hour);\n } else if (FieldTypeEnum.SELECT_ORGANIZATION.getCode().equals(data.getFieldType())) {\n List<Object> fValue = null;\n try {\n TypeReference<ArrayList<Object>> typeRef = new TypeReference<ArrayList<Object>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.LINK.getCode().equals(data.getFieldType())) {\n Map<String, String> fValue = new HashMap<>();\n try {\n TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n cusData.put(data.getKey(), fValue);\n } catch (Exception e) {\n log.error(e.getLocalizedMessage());\n }\n } else {\n cusData.put(data.getKey(), data.getValue());\n }\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "protected void changeContent() {\n byte[] data = Arrays.copyOf(content.getContent(),\n content.getContent().length + 1);\n data[content.getContent().length] = '2'; // append one byte\n content.setContent(data);\n LOG.info(\"document content changed\");\n }", "public void update(final UploadFile uploadFile) {\n\t\t UploadFile uploadFileDB = uploadFileDAO.findById(uploadFile.getId());\n\t\t uploadFileDB.setFileName(uploadFile.getFileName());\n\t\t uploadFileDB.setData(uploadFile.getData());\n\t\t uploadFileDAO.persist(uploadFileDB);\n\t }", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\n this.updateFaxJobFromInputDataImpl(inputData,faxJob);\n }", "public void update() throws IOException{\r\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agenda.txt\", false));\r\n\t\toos.writeObject(artists);\r\n\t\toos.writeObject(stages);\r\n\t\toos.writeObject(performances);\r\n\t\tartists.clear();\r\n\t\tstages.clear();\r\n\t\tperformances.clear();\r\n\t\toos.close();\r\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public void setFileContent(String fileContent) {\n this.fileContent = fileContent;\n }", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "private void updateDatabaseFile() {\n Log.i(\"updateDatabaseFile\", \"Updating server app database\");\n try {\n FileInputStream inputStream = new FileInputStream(databaseFile);\n DropboxAPI.Entry response = MainActivity.mDBApi.putFileOverwrite(databaseFile.getName(), inputStream,\n databaseFile.length(), null);\n Log.i(\"updateDatabaseFile\", \"The uploaded file's rev is: \" + response.rev);\n } catch (Exception e) {\n Log.e(\"updateDatabaseFile\", e.toString(), e);\n }\n }", "@Test\r\n public void testUpdateFile() {\r\n System.out.println(\"updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n // no assertEquals needed because the method itself would throw an error\r\n // if an error occurs check your connection to the internet\r\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void modifyClass2File() throws IOException {\n\t\tMap<String, Object> properties = specificConfig();\n\t\tModifyDriver.modify2File(properties, mvfactory);\n\t}", "public void data(RecordInput recordInput) {\n try {\n byte[] bytes = new byte[100];\n recordInput.readBytes(bytes);\n crc.update(bytes);\n } catch (IOException e) {\n throw new ServingXmlException(e.getMessage(), e);\n }\n }", "@Test\n public void testApplyToOldFile() throws IOException, PatchFailedException {\n Path oldFile = scratch.file(\"/root/oldfile\", \"line one\");\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(oldFile, UTF_8)).isEqualTo(newContent);\n // new file should not change\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).containsExactly(\"line one\");\n }", "@ActionKey(\"/api/blog/updateFile\")\n public void updateFile() throws IOException {\n Integer id = getParaToInt(\"id\");\n File blogFile = getFile(\"blog\").getFile();\n if (id == null) {\n mResult.fail(102);\n renderJson(mResult);\n return;\n }\n if (!blogFile.getName().endsWith(\".md\")) {\n mResult.fail(110);\n renderJson(mResult);\n return;\n }\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(blogFile), \"UTF-8\"));\n StringBuilder builder = new StringBuilder();\n String line = \"\";\n while (line != null) {\n line = reader.readLine();\n builder.append(line);\n }\n mResult.success(mBlogService.update(id, \"content\", builder.toString()));\n renderJson(mResult);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n mResult.fail(109);\n if (reader != null) {\n reader.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private void updateImformation(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint fileId= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tString caption= request.getParameter(\"caption\");\n\t\tString label= request.getParameter(\"label\");\n\t\tString fileName= request.getParameter(\"fileName\");\n\t\tFiles file= new Files(fileId, fileName, label, caption);\n\t\tnew FilesDAO().update(fileId, caption, label);;\n\t\tlistingPage(request, response);\n\t}", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "void overwriteContent(Md2Entity content);", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "void setNewFile(File file);", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "void updateData();", "@Update({ \"update csv_file\", \"set pid = #{pid,jdbcType=VARCHAR},\", \"filename = #{filename,jdbcType=VARCHAR},\",\n\t\t\t\"start_time = #{startTime,jdbcType=TIMESTAMP},\", \"end_time = #{endTime,jdbcType=TIMESTAMP},\",\n\t\t\t\"length = #{length,jdbcType=INTEGER},\", \"density = #{density,jdbcType=DOUBLE},\",\n\t\t\t\"machine = #{machine,jdbcType=VARCHAR},\", \"ar = #{ar,jdbcType=BIT},\", \"path = #{path,jdbcType=VARCHAR},\",\n\t\t\t\"size = #{size,jdbcType=BIGINT},\", \"uuid = #{uuid,jdbcType=CHAR},\",\n\t\t\t\"header_time = #{headerTime,jdbcType=TIMESTAMP},\", \"last_update = #{lastUpdate,jdbcType=TIMESTAMP},\",\n\t\t\t\"conflict_resolved = #{conflictResolved,jdbcType=BIT},\", \"status = #{status,jdbcType=INTEGER},\",\n\t\t\t\"comment = #{comment,jdbcType=VARCHAR},\", \"width = #{width,jdbcType=INTEGER},\",\n\t\t\t\"start_version = #{startVersion,jdbcType=INTEGER},\", \"end_version = #{endVersion,jdbcType=INTEGER}\",\n\t\t\t\"where id = #{id,jdbcType=INTEGER}\" })\n\tint updateByPrimaryKey(CsvFile record);", "public static void fileEditor(String sourcePath, String targetPath, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(sourcePath);\n\t\t\t\t File tar= new File(targetPath);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(tar);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "public void updatePersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tserializeToFile(file);\n\t\tupdatePersistentSettings();\n\t}", "public void updateContent(Map<String, Object> update_params) throws SolrServerException, IOException {\n\t\tSolrInputDocument doc_in = new SolrInputDocument();\n\n\t\tIterator<String> itr = update_params.keySet().iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString key = itr.next();\n\t\t\t\n\t\t\tdoc_in.addField(key, update_params.get(key));\n\t\t\titr.remove(); // avoids a ConcurrentModificationException\n\t\t}\n\t\t\n\t\t\n\t\t//System.out.println(\"Debug.\");\n\t\tSystem.out.println(\"Debug: Doc_in: \" + doc_in.toString());\n\t\tSystem.out.println(\"updating content...\");\n\t\tUpdateResponse UD_response = server.add(doc_in);\n\t\tserver.commit();\n\t\tSystem.out.println(\"Debug: \"+UD_response.toString());\n\t\tSystem.out.println(\"Finished updating solr.\");\n\n\t}", "public void setFileContent(Byte[] fileContent) {\n this.fileContent = fileContent;\n }", "public static void makeEntityObservable(FileObject fileInProject, String[] entityInfo, MetadataModel<EntityMappingsMetadata> mappings) {\n if (entityInfo == null) return;\n ClassPath cp = ClassPath.getClassPath(fileInProject, ClassPath.SOURCE);\n String resName = entityInfo[1].replace('.', '/') + \".java\"; // NOI18N\n FileObject entity = cp.findResource(resName);\n if (entity == null) return;\n final List<String> properties;\n try {\n properties = propertiesForColumns(mappings, entityInfo[0], null);\n } catch (IOException ioex) {\n return;\n }\n JavaSource source = JavaSource.forFileObject(entity);\n final boolean[] alreadyUpdated = new boolean[1];\n try {\n // PENDING merge into one task once it will be possible\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n \n for (Tree member : clazz.getMembers()) {\n if (Tree.Kind.VARIABLE == member.getKind()) {\n VariableTree variable = (VariableTree)member;\n String type = variable.getType().toString();\n if (type.endsWith(\"PropertyChangeSupport\")) { // NOI18N\n alreadyUpdated[0] = true;\n }\n }\n }\n \n TreeMaker make = wc.getTreeMaker();\n ClassTree modifiedClass = clazz;\n \n if (!alreadyUpdated[0]) {\n // changeSupport field\n TypeElement transientElement = wc.getElements().getTypeElement(\"javax.persistence.Transient\"); // NOI18N\n TypeMirror transientMirror = transientElement.asType();\n Tree transientType = make.Type(transientMirror);\n AnnotationTree transientTree = make.Annotation(transientType, Collections.EMPTY_LIST);\n ModifiersTree modifiers = make.Modifiers(Modifier.PRIVATE, Collections.singletonList(transientTree));\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n TypeMirror changeSupportMirror = changeSupportElement.asType();\n Tree changeSupportType = make.Type(changeSupportMirror);\n NewClassTree changeSupportConstructor = make.NewClass(null, Collections.EMPTY_LIST, make.QualIdent(changeSupportElement), Collections.singletonList(make.Identifier(\"this\")), null);\n VariableTree changeSupport = make.Variable(modifiers, \"changeSupport\", changeSupportType, changeSupportConstructor); // NOI18N\n modifiedClass = make.insertClassMember(clazz, 0, changeSupport);\n }\n\n // property change notification\n for (Tree clMember : modifiedClass.getMembers()) {\n if (clMember.getKind() == Tree.Kind.METHOD) {\n MethodTree method = (MethodTree)clMember;\n String methodName = method.getName().toString();\n if (methodName.startsWith(\"set\") && (methodName.length() > 3) && (Character.isUpperCase(methodName.charAt(3))) && (method.getParameters().size() == 1)) { // NOI18N\n String propName = methodName.substring(3);\n if ((propName.length() == 1) || (Character.isLowerCase(propName.charAt(1)))) {\n propName = Character.toLowerCase(propName.charAt(0)) + propName.substring(1);\n }\n if (!properties.contains(propName)) continue;\n BlockTree block = method.getBody();\n if (block.getStatements().size() != 1) continue;\n StatementTree statement = block.getStatements().get(0);\n if (statement.getKind() != Tree.Kind.EXPRESSION_STATEMENT) continue;\n ExpressionTree expression = ((ExpressionStatementTree)statement).getExpression();\n if (expression.getKind() != Tree.Kind.ASSIGNMENT) continue;\n AssignmentTree assignment = (AssignmentTree)expression;\n String parName = assignment.getExpression().toString();\n VariableTree parameter = method.getParameters().get(0);\n if (!parameter.getName().toString().equals(parName)) continue;\n ExpressionTree persistentVariable = assignment.getVariable();\n\n // <Type> old<PropertyName> = this.<propertyName>\n String parameterName = parameter.getName().toString();\n String oldParameterName = \"old\" + Character.toUpperCase(parameterName.charAt(0)) + parameterName.substring(1); // NOI18N\n Tree parameterTree = parameter.getType();\n VariableTree oldParameter = make.Variable(make.Modifiers(Collections.EMPTY_SET), oldParameterName, parameterTree, persistentVariable);\n BlockTree newBlock = make.insertBlockStatement(block, 0, oldParameter);\n\n // changeSupport.firePropertyChange(\"<propertyName>\", old<PropertyName>, <propertyName>);\n MemberSelectTree fireMethod = make.MemberSelect(make.Identifier(\"changeSupport\"), \"firePropertyChange\"); // NOI18N\n List<ExpressionTree> fireArgs = new LinkedList<ExpressionTree>();\n fireArgs.add(make.Literal(propName));\n fireArgs.add(make.Identifier(oldParameterName));\n fireArgs.add(make.Identifier(parameterName));\n MethodInvocationTree notification = make.MethodInvocation(Collections.EMPTY_LIST, fireMethod, fireArgs);\n newBlock = make.addBlockStatement(newBlock, make.ExpressionStatement(notification));\n wc.rewrite(block, newBlock);\n }\n }\n }\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n if (alreadyUpdated[0]) return;\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // addPropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree addCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"addPropertyChangeListener\"); // NOI18N\n MethodInvocationTree addInvocation = make.MethodInvocation(Collections.EMPTY_LIST, addCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree addMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"addPropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(addInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, addMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // removePropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree removeCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"removePropertyChangeListener\"); // NOI18N\n MethodInvocationTree removeInvocation = make.MethodInvocation(Collections.EMPTY_LIST, removeCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree removeMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"removePropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(removeInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, removeMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n } catch (IOException ioex) {\n Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, ioex.getMessage(), ioex);\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "public static boolean editEntry(String tableName, String newData, int id){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n String fileContent = tableReader.nextLine()+\"\\n\";\n boolean lineFound = false;\n while (tableReader.hasNextLine()){\n String currentLine = tableReader.nextLine();\n int lineId = Integer.parseInt(currentLine.split(\",\")[0]);\n if(lineId != id){\n fileContent += currentLine+\"\\n\";\n }else{\n lineFound = true;\n }\n }\n tableReader.close();\n if(lineFound){\n fileContent += id+\",\"+newData+\"\\n\";\n FileWriter tableWriter = new FileWriter(table);\n String[] fileLines = fileContent.split(\"\\n\");\n for(String l : fileLines){\n tableWriter.write(l+\"\\n\");\n }\n tableWriter.close();\n return true;\n }else{\n System.out.println(\"No se encontró una entrada con el id: \"+id);\n return false;\n }\n\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }", "public void uploadDataFromFile()\n {\n String jobSeekerFile = (\"JobSeeker.txt\");\n String jobRecruiterFile = (\"JobRecruiter.txt\");\n String jobFile = (\"Job.txt\");\n String notificationFile = (\"Notification.txt\");\n \n String jobSeekerLines = readFile(jobSeekerFile);\n String jobRecruiterLines = readFile(jobRecruiterFile);\n String jobLines = readFile(jobFile);\n String notificationLines = readFile(notificationFile);\n \n storeJobSeekersToJobSeekerList(jobSeekerLines);\n storeJobRecruitersToJobRecruiterList(jobRecruiterLines);\n storeJobsToJobList(jobLines);\n storeNotificationsToNotificationList(notificationLines);\n \n }", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "public void processInput(String theFile){processInput(new File(theFile));}", "private void updateFieldRows(Connection con,\n IdentifiedRecordTemplate template, GenericDataRecord record)\n throws SQLException, FormException, CryptoException {\n PreparedStatement update = null;\n PreparedStatement insert = null;\n \n try {\n update = con.prepareStatement(UPDATE_FIELD);\n int recordId = record.getInternalId();\n String[] fieldNames = record.getFieldNames();\n Map<String, String> rows = new HashMap<String, String>();\n for (String fieldName : fieldNames) {\n Field field = record.getField(fieldName);\n String fieldValue = field.getStringValue();\n \n SilverTrace.debug(\"form\", \"GenericRecordSetManager.updateFieldRows\",\n \"root.MSG_GEN_PARAM_VALUE\", \"fieldName = \" + fieldName\n + \", fieldValue = \" + fieldValue\n + \", recordId = \" + recordId);\n \n rows.put(fieldName, fieldValue);\n }\n \n if (template.isEncrypted()) {\n rows = getEncryptionService().encryptContent(rows);\n }\n \n for (String fieldName : rows.keySet()) {\n String fieldValue = rows.get(fieldName);\n update.setString(1, fieldValue);\n update.setInt(2, recordId);\n update.setString(3, fieldName);\n \n int nbRowsCount = update.executeUpdate();\n if (nbRowsCount == 0) {\n // no row has been updated because the field fieldName doesn't exist in database.\n // The form has changed since the last modification of the record.\n // So we must insert this new field.\n insert = con.prepareStatement(INSERT_FIELD);\n insert.setInt(1, recordId);\n insert.setString(2, fieldName);\n insert.setString(3, fieldValue);\n \n insert.execute();\n }\n }\n } finally {\n DBUtil.close(update);\n DBUtil.close(insert);\n }\n }", "public void update() throws IOException {\n\n\t\tif(this.bdgDataColIdx < 4){\n\t\t\tSystem.err.println(\"Invalid index for bedgraph column of data value. Resetting to 4. Expected >=4. Got \" + this.bdgDataColIdx);\n\t\t\tthis.bdgDataColIdx= 4;\n\t\t}\n\n\t\tif(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BIGWIG)){\n\t\t\t\n\t\t\tbigWigToScores(this.bigWigReader);\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.TDF)){\n\n\t\t\tthis.screenWiggleLocusInfoList= \n\t\t\t\t\tTDFUtils.tdfRangeToScreen(this.getFilename(), this.getGc().getChrom(), \n\t\t\t\t\t\t\tthis.getGc().getFrom(), this.getGc().getTo(), this.getGc().getMapping());\n\t\t\t\n\t\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\t\tfor(ScreenWiggleLocusInfo x : screenWiggleLocusInfoList){\n\t\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t\t}\n\t\t\tthis.setScreenScores(screenScores);\t\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BEDGRAPH)){\n\n\t\t\t// FIXME: Do not use hardcoded .samTextViewer.tmp.gz!\n\t\t\tif(Utils.hasTabixIndex(this.getFilename())){\n\t\t\t\tbedGraphToScores(this.getFilename());\n\t\t\t} else if(Utils.hasTabixIndex(this.getFilename() + \".samTextViewer.tmp.gz\")){\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t} else {\n\t\t\t\tblockCompressAndIndex(this.getFilename(), this.getFilename() + \".samTextViewer.tmp.gz\", true);\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Extension (i.e. file type) not recognized for \" + this.getFilename());\n\t\t}\n\t\tthis.setYLimitMin(this.getYLimitMin());\n\t\tthis.setYLimitMax(this.getYLimitMax());\n\t}", "public void saveWorkingDataFile(String rftNo, String fileName, int fileRecordNumber, Connection conn) \n\t\tthrows ReadWriteException, NotFoundException, InvalidDefineException, IllegalAccessException, IOException\n\t{\t\t\n\t\tString id = \"\";\n\t\tMatcher m = Pattern.compile(\"ID(\\\\d\\\\d\\\\d\\\\d).txt\").matcher(fileName);\n\t\tif (m.find())\n\t\t{\n\t\t\tid = m.group(1);\n\t\t}\n\t\t//#CM702621\n\t\t// Generation of instance of work file\n\t\tWorkDataFile workDataFile =\n\t\t (WorkDataFile) PackageManager.getObject(\"Id\"+ id + \"DataFile\");\n\t\tworkDataFile.setFileName(fileName);\n\t\t\n\t\t//#CM702622\n\t\t// Remove the passing part of File Name. \n\t\tFile file = new File(fileName);\n\t\tString registFileName = file.getName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tWorkingDataHandler wHandler = new WorkingDataHandler(conn);\n\t\t\t//#CM702623\n\t\t\t// Open the made work file. \n\t\t\tworkDataFile.openReadOnly();\n\t\t\tint i = 0;\n\t\t\tfor(workDataFile.next(); i < fileRecordNumber; workDataFile.next())\n\t\t\t{\t\n\t\t\t\tWorkingDataAlterKey akey = new WorkingDataAlterKey();\n\t\t\t\takey.setRftNo(rftNo);\n\t\t\t\takey.setLineNo(i);\n\t\t\t\takey.updateFileName(registFileName);\n\t\t\t\takey.updateContents(workDataFile.getContents());\n\n\t\t\t\tWorkingDataSearchKey skey = new WorkingDataSearchKey();\n\t\t\t\tskey.setRftNo(rftNo);\n\t\t\t\tskey.setFileName(registFileName);\n\t\t\t\tskey.setLineNo(i);\n\t\t\t\tWorkingData[] workingArr= (WorkingData[])wHandler.find(skey);\n\t\t\t\tif (workingArr.length > 0)\n\t\t\t\t{\n\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tWorkingData workdata = new WorkingData();\n\t\t\t\t\t\tworkdata.setRftNo(rftNo);\n\t\t\t\t\t\tworkdata.setFileName(registFileName);\n\t\t\t\t\t\tworkdata.setLineNo(i);\n\t\t\t\t\t\tworkdata.setContents(workDataFile.getContents());\n\t\t\t\t\t\twHandler.create(workdata);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (DataExistsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tworkDataFile.closeReadOnly();\n\t\t}\n\t\t\n\t}", "public void updateSettings(FileObject file) {\n DataObject dobj = null;\n DataFolder folder = null;\n try {\n dobj = DataObject.find(file);\n folder = dobj.getFolder();\n } catch (DataObjectNotFoundException ex) {\n Exceptions.printStackTrace(ex);\n }\n if (dobj == null || folder == null) {\n return;\n }\n for (CreateFromTemplateAttributesProvider provider\n : Lookup.getDefault().lookupAll(CreateFromTemplateAttributesProvider.class)) {\n Map<String, ?> attrs = provider.attributesFor(dobj, folder, \"XXX\"); // NOI18N\n if (attrs == null) {\n continue;\n }\n Object aName = attrs.get(\"user\"); // NOI18N\n if (aName != null) {\n author = aName.toString();\n break;\n }\n }\n }", "public void updatePathAndFile(String path, String file){\r\n\t\tthis.path = path;\r\n\t\tthis.file = file;\r\n\t}", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void convert(File inputFile, File outputFile) throws IOException {\n\n setType(inputFile);\n\n BufferedReader reader = null;\n PrintWriter writer = null;\n\n try {\n reader = new BufferedReader(new FileReader(inputFile));\n writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n\n String nextLine = null;\n\n // Skip meta data. Note for GCT files this includes the mandatory first line\n while ((nextLine = reader.readLine()).startsWith(\"#\") && (nextLine != null)) {\n writer.println(nextLine);\n }\n\n // This is the first non-meta line\n writer.println(nextLine);\n\n // for TAB and RES files the first row contains the column headings.\n int nCols = 0;\n if (type == FileType.TAB || type == FileType.RES) {\n nCols = nextLine.split(\"\\t\").length;\n }\n\n\n if (type == FileType.GCT) {\n // GCT files. Column headings are 3rd row (read next line)\n nextLine = reader.readLine();\n nCols = nextLine.split(\"\\t\").length;\n writer.println(nextLine);\n } else if (type == FileType.RES) {\n // Res files -- skip lines 2 and 3\n writer.println(reader.readLine());\n writer.println(reader.readLine());\n }\n\n\n // Compute the # of data points\n int columnSkip = 1;\n if (type == FileType.RES) {\n columnSkip = 2;\n nCols++; // <= last call column of a res file is sometimes blank, if not this will get\n }\n nPts = (nCols - dataStartColumn) / columnSkip;\n\n // Now for the data\n while ((nextLine = reader.readLine()) != null) {\n String[] tokens = nextLine.split(\"\\t\");\n\n for (int i = 0; i < dataStartColumn; i++) {\n writer.print(tokens[i] + \"\\t\");\n }\n\n DataRow row = new DataRow(tokens, nextLine);\n for (int i = 0; i < nPts; i++) {\n\n if (Double.isNaN(row.scaledData[i])) {\n writer.print(\"\\t\");\n } else {\n\n writer.print(row.scaledData[i]);\n if (type == FileType.RES) {\n writer.print(\"\\t\" + row.calls[i]);\n }\n if (i < nPts - 1) {\n writer.print(\"\\t\");\n }\n }\n }\n writer.println();\n }\n }\n finally {\n if (reader != null) {\n reader.close();\n }\n if (writer != null) {\n writer.close();\n }\n }\n }", "public void testAppendDataInFile() throws IOException {\n\t\tfinal CachedParserDocument pdoc = new CachedParserDocument(this.tempFilemanager,0);\n\t\tassertTrue(pdoc.inMemory());\n\t\tassertEquals(0, pdoc.length());\n\t\tassertFalse(this.outputFile.exists());\n\t\t\n\t\t// copying data\n\t\tthis.appendData(TESTFILE, pdoc);\n\t\t\n\t\t// some tests\n\t\tassertFalse(pdoc.inMemory());\n\t\tassertEquals(this.fileSize, pdoc.length());\n\t\tassertTrue(this.outputFile.exists());\n\t\tassertEquals(TESTFILE, pdoc.getTextAsReader());\n\t\tassertEquals(TESTFILE, pdoc.getTextFile());\n\t\tassertFalse(pdoc.inMemory());\n\t}" ]
[ "0.63654107", "0.6328003", "0.6237628", "0.60860044", "0.5955357", "0.5837597", "0.5805012", "0.5685616", "0.55792284", "0.55723965", "0.55527437", "0.5512726", "0.549281", "0.5472843", "0.5466059", "0.54492396", "0.5433361", "0.5426097", "0.5410725", "0.5392123", "0.53916186", "0.5379693", "0.5365372", "0.5362732", "0.53501546", "0.5349444", "0.53470236", "0.5340252", "0.5331697", "0.5319992", "0.5316423", "0.53062797", "0.5291451", "0.5286143", "0.52787435", "0.52692443", "0.52554744", "0.5224223", "0.52082175", "0.5167456", "0.51581764", "0.5153432", "0.51419634", "0.5138886", "0.51280195", "0.51080924", "0.51043797", "0.5098715", "0.5087148", "0.50858444", "0.50856346", "0.5084349", "0.5077724", "0.5070971", "0.5050992", "0.50416553", "0.5036287", "0.50338346", "0.5026899", "0.50266653", "0.5019919", "0.50197315", "0.50098723", "0.50086343", "0.5003353", "0.499035", "0.49718258", "0.49694467", "0.4965634", "0.49532333", "0.49475157", "0.49350744", "0.49334475", "0.49246305", "0.49220538", "0.4918485", "0.49170926", "0.49097085", "0.49095142", "0.490617", "0.49035275", "0.48940146", "0.48845422", "0.48812157", "0.48666424", "0.48579508", "0.48566595", "0.48557007", "0.4853903", "0.4852243", "0.4841159", "0.48347494", "0.4834357", "0.4833695", "0.4830389", "0.48294058", "0.48291248", "0.48213032", "0.48213005", "0.48151606", "0.48064038" ]
0.0
-1
Replace the changed fields and update the contents of inputFileContent to the data file
public static void amountPaid(){ NewProject.tot_paid = Double.parseDouble(getInput("Please enter NEW amount paid to date: ")); UpdateData.updatePayment(); updateMenu(); //Return back to previous menu. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateDataFile(DataFile dataFile) {\n updateMeeting(dataFile.getMeeting());\n }", "void updateFile() throws IOException;", "public int update(FFileInputDO FFileInput) throws DataAccessException;", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "@Override\r\n\tpublic void updateFileData(FileMetaDataEntity userInfo) {\n\t\t\r\n\t}", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "public void update(String filename, SensorData sensorData){\n //Adds the sensor data to the buffer. \n addToBuffer(filename, sensorData);\n \n //Uploads the data to the server if it's turned on. \n if (Server.getInstance().getServerIsOn())\n if(uploadData()){\n //If the upload was successful, clear the buffer.\n clearBuffer();\n }\n }", "public FileFormatFormData update(FileFormatFormData formData)\r\n\t\t\tthrows ProcessingException;", "protected abstract void updateFaxJobFromInputDataImpl(T inputData,FaxJob faxJob);", "private void updateToFile(PQNode node) throws Exception{\n List<PQNode> nodes = retrieveWholeFile(node.getPqIndex());\n int replaceIndex = node.getPqIndex()-bufStart;\n\n nodes.set(replaceIndex,node);\n int fileId = (node.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n storeToFile(file,nodes, false);\n }", "public void replaceFile(String inputFilename) {\n try {\n FileReader fr = new FileReader(inputFilename);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n while ((line = br.readLine()) != null) {\n if (line.isEmpty()) {\n System.out.println();\n } else {\n line = replaceLine(line);\n System.out.println(line);\n }\n }\n } catch (IOException e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }", "public void testChanges(String filePath) {\n Object[] fileObjectArray = fetchTextFile(filePath);\n String newFile = prepareText(fileObjectArray);\n System.out.println(newFile);\n }", "private void updateFile(CrowdinFile _file) {\n String fileN = _file.getFile().getName();\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Initializing: \" + fileN);\n // Making sure the file is a master file and not a translation\n if (_file.getClass().equals(CrowdinFile.class)) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Init dir\");\n initDir(_file.getCrowdinPath());\n try {\n if (_file.getFile().exists()) {\n \n //escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersBeforeSyncFromCodeToCrowdin\");\n \n if (!getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Add file: \" + _file.getCrowdinPath());\n String result = getHelper().addFile(_file);\n if (result.contains(\"success\")) {\n getLog().info(\"File \" + fileN + \" created succesfully.\");\n initTranslations(_file);\n } else {\n getLog().warn(\"Cannot create file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n }\n } else {\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"*** Update file: \" + _file.getCrowdinPath());\n }\n String result = getHelper().updateFile(_file);\n System.out.println(result);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" updated succesfully.\");\n else\n getLog().warn(\"Cannot update file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n if (_file.isShouldBeCleaned()) {\n _file.getFile().delete();\n }\n \n //remove escape special character before sync\n FileUtils.replaceCharactersInFile(_file.getFile().getPath(), \"config/special_character_processing.properties\", \"EscapeSpecialCharactersAfterSyncFromCodeToCrowdin\");\n \n }\n } else {\n if (getHelper().elementExists(_file.getCrowdinPath())) {\n if (getLog().isDebugEnabled())\n getLog().debug(\"*** Delete file: \" + _file.getCrowdinPath());\n String result = getHelper().deleteFile(_file);\n if (result.contains(\"success\"))\n getLog().info(\"File \" + fileN + \" deleted succesfully.\");\n else\n getLog().warn(\"Cannot delete file '\" + _file.getFile().getPath() + \"'. Reason:\\n\" + result);\n }\n }\n } catch (MojoExecutionException e) {\n getLog().error(\"Error while updating file '\" + _file.getFile().getPath() + \"'. Exception:\\n\" + e.getMessage());\n }\n }\n }", "private void updateFiles() {\n\t}", "public void updateContent(Map<String, ContentChange> files);", "private void setDataFileChanged(String newPath) {\r\n \t\t// set file to be reloaded if changed\r\n \t\tif ((null == dataFile && !newPath.equals(\"\"))\r\n \t\t\t\t|| (null != dataFile && !dataFile.equals(newPath))) {\r\n \t\t\treloadFile = true;\r\n \t\t}\r\n \t\t// copy new value\r\n \t\tdataFile = newPath;\r\n \t\t// add log\r\n \t\tif (localLOGV) {\r\n \t\t\tLog.i(TAG, \"Reload file set to \" + String.valueOf(reloadFile));\r\n \t\t}\r\n \t}", "private void copyInputFile(String originalFilePath, String destinationFilePath) {\n String inputType = ((DataMapperDiagramEditor) workBenchPart.getSite().getWorkbenchWindow().getActivePage()\n .getActiveEditor()).getInputSchemaType();\n\n if (null != originalFilePath && null != destinationFilePath\n && (inputType.equals(\"XML\") || inputType.equals(\"JSON\") || inputType.equals(\"CSV\"))) {\n File originalFile = new File(originalFilePath);\n File copiedFile = new File(destinationFilePath);\n try {\n FileUtils.copyFile(originalFile, copiedFile);\n assert (copiedFile).exists();\n\t\t\t\tassert (Files.readAllLines(originalFile.toPath(), Charset.defaultCharset())\n\t\t\t\t\t\t.equals(Files.readAllLines(copiedFile.toPath(), Charset.defaultCharset())));\n } catch (IOException e) {\n log.error(\"IO error occured while saving the datamapper input file!\", e);\n }\n } else if (null != destinationFilePath) {\n clearContent(new File(destinationFilePath));\n }\n }", "public void set(String keyInput, String valueInput) {\n\t\tfileData.put(keyInput, valueInput);\n\t\ttry {\n\t\t\twriteToFile();\n\t\t}\n\t\tcatch (IOException anything) {\n\t\t\tSystem.out.println(\"Couldn't write to file \" + path + \". Error: \" + anything.getMessage());\n\t\t}\n\t}", "public void refreshData(File file) throws IOException{\n\t\tmodel = new FileDataModel(file);\n\t}", "@Override\n\tpublic FileModel update(FileModel c) {\n\t\treturn fm.saveAndFlush(c);\n\t}", "void update(FileInfo fileInfo);", "@Override\r\n\tpublic void updateAll() throws IOException {\n\t}", "@Override\n\tpublic void update(finalDataBean t, String[] fields) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void updatePizzaRecord(int pId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\t\r\n\t\tList<PizzaBean> updateList = new ArrayList<PizzaBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList = (List<PizzaBean>) ois.readObject();\r\n\t\t\tfor (PizzaBean p : updateList) {\r\n\t\t\t\tif (p.getpId() == pId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza name\");\r\n\t\t\t\t\t\tp.setpName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Pizza Price\");\r\n\t\t\t\t\t\tp.setpPrice(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new pizza Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList = new ArrayList<PizzaBean>();\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList.add(p);\r\n\t\t\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\t\t\toos.writeObject(tempList);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile.renameTo(original);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Pizza Updated Successfully\");\r\n\t}", "boolean update(DataTableDef def) throws IOException;", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void updateNonDynamicFields() {\n\n\t}", "public static void UpdateLineInFileByID(String i_FileName, String i_ID, StringBuilder i_StringToReplace,\n\t\t\tStringBuilder i_StringToReplaceWith) {\n\t}", "public void updateRecord(String companyName) {\n String option = \"\";\n boolean quit = false;\n byte [] numEmplyees = new byte[Constants.NUM_BYTES_COMPANY_EMPLOYEES];\n byte [] cityName = new byte[Constants.NUM_BYTES_COMPANY_CITY];\n byte [] rank = new byte[Constants.NUM_BYTES_RANK];\n byte [] state = new byte[Constants.NUM_BYTES_COMPANY_STATE];\n byte [] zip = new byte[Constants.NUM_BYTES_COMPANY_ZIP];\n\n BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n RandomAccessFile din = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n RandomAccessFile oin = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n\n //find company to update\n String recordLocation = \"normal\";\n int recordNumber = this.binarySearch(din, companyName.toUpperCase());\n\n if (recordNumber == -1) {\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String record = getRecord(\"overflow\", oin, i);\n String recordName = record.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.toUpperCase().equals(recordName)) {\n recordNumber = i;\n recordLocation = \"overflow\";\n break;\n }\n }\n }\n\n //if company found\n if(recordNumber != -1){\n //untill the user wants to stop updating\n while(!quit){\n System.out.println(\"What would you like to change?\");\n System.out.println(\"[1] Rank\");\n System.out.println(\"[2] City\");\n System.out.println(\"[3] State\"); \n System.out.println(\"[4] Zip Code\");\n System.out.println(\"[5] Number of Employees\");\n System.out.println(\"[6] done updating\");\n option = inputReader.readLine();\n\n byte [] update;\n switch(option) {\n case \"1\":\n System.out.println(\"Enter updated Rank\");\n update = HelperFunctions.getInputDataBytes(5);\n // option = inputReader.readLine();\n //format input to fixed length\n \n // option = String.format(\"%-5s\", option.toUpperCase());\n // rank = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber)));\n //replace current rank with new rank\n oin.write(update); \n }\n break;\n case \"2\":\n System.out.println(\"Enter updated City\");\n update = HelperFunctions.getInputDataBytes(20);\n // option = inputReader.readLine();\n // option = String.format(\"%-20s\", option.toUpperCase());\n // cityName = option.getBytes();\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+45);\n oin.write(update); \n } \n break;\n case \"3\":\n System.out.println(\"Enter updated State Abbreviation\");\n // option = inputReader.readLine();\n // option = String.format(\"%-3s\", option.toUpperCase());\n // state = option.getBytes();\n update = HelperFunctions.getInputDataBytes(3);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+65);\n oin.write(update);\n }\n break;\n case \"4\":\n System.out.println(\"Enter updated Zip Code\");\n // option = inputReader.readLine();\n // option = String.format(\"%-6s\", option.toUpperCase());\n // zip = option.getBytes();\n update = HelperFunctions.getInputDataBytes(6);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+68);\n oin.write(update);\n }\n break;\n case \"5\":\n System.out.println(\"Enter updated Number of Employees\");\n // option = inputReader.readLine();\n // option = String.format(\"%-10s\", option.toUpperCase());\n // numEmplyees = option.getBytes();\n update = HelperFunctions.getInputDataBytes(10);\n if (recordLocation.equals(\"normal\")) {\n recordNumber = binarySearchToFindClosest(companyName.trim().toUpperCase(), 0, Integer.parseInt(getNumberOfRecords(recordLocation)));\n din.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n din.write(update);\n } else {\n oin.getChannel().position((Constants.NUM_BYTES_LINUX_RECORD * (recordNumber))+74);\n oin.write(update); \n }\n break;\n case \"6\":\n quit = true;\n din.close();\n oin.close();\n break;\n default:\n System.out.println(\"That is not a valid option, please select a valid option\");\n break; \n }\n }\n }\n //if not found, let the user know\n else{\n System.out.println(\"NOT FOUND\");\n return;\n } \n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public interface FileReplacer {\n public void replaceTags(ArrayList<String> header, CSVRecord record, File resultFile);\n public void replaceTagsWithCoef(ArrayList<String> header, int headerIndex, double coefficient, CSVRecord record, File resultFile);\n\n public void replaceInOneDoc(ArrayList<String> header, CSVRecord record, File file, Table cellTable);\n}", "public void updateData() {}", "public static interface DataReplace {\n\t\t/**\n\t\t * This method is used to alter the lines in the data array. Each line is parsed to this method, and whatever is returned will replace the current line.\n\t\t * \n\t\t * @param input\n\t\t * One line of the data array\n\t\t */\n\t\tpublic String replace(String input);\n\t}", "public void setInputFile(File inputFile) {\n this.inputFile = inputFile;\n }", "private byte[] updateContent(byte[] request) {\n if (replaceFirst()) {\n return Utils.byteArrayRegexReplaceFirst(request, this.match, this.replace);\n } else {\n return Utils.byteArrayRegexReplaceAll(request, this.match, this.replace);\n }\n }", "@Override\r\n\tpublic void updateIceCreamRecord(int iceId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original1);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile1);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\r\n\t\r\n\t\tList<IceCreamBean> updateList1 = new ArrayList<IceCreamBean>();\r\n\r\n\t\t\r\n\t\t\tupdateList1 = (List<IceCreamBean>) ois.readObject();\r\n\t\t\tfor (IceCreamBean p : updateList1) {\r\n\t\t\t\tif (p.getIceId() == iceId) {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\t\t\tint n = sc.nextInt();\r\n\t\t\t\t\tswitch (n) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream name\");\r\n\t\t\t\t\t\tp.setIceName(sc.next());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Price\");\r\n\t\t\t\t\t\tp.setIceprice(sc.nextDouble());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tSystem.out.println(\"Enter new Icecream Quantity\");\r\n\t\t\t\t\t\tp.setPqty(sc.nextInt());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttempList1 = new ArrayList<IceCreamBean>();\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList1.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfos=new FileOutputStream(tempFile1);\r\n\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\toos.writeObject(tempList1);\r\n\t\t\t\toriginal1.delete();\r\n\t\t\t\ttempFile1.renameTo(original);\r\n\t\t\t\r\n\t\t\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "@Override\n\t\tpublic void setEditedContent(CGFile file) {\n\n\t\t}", "@Override\n\t\tpublic void update() throws IOException {\n\t\t}", "public void readReplace(String fname, String oldPattern, String replPattern) {\n\t\tString line;\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(fname);\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tfis));\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tMatcher matcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\tif (matcher.find()){\n\t\t\t\t\tmatcher = Pattern.compile(oldPattern).matcher(line);\n\t\t\t\t\tline = matcher.replaceAll(replPattern);\n\t\t\t\t}\n\t\t\t\tsb.append(line + Constants.RETURN);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(fname));\n\t\t\tout.write(sb.toString());\n\t\t\tout.close();\n\t\t\t// logger.debug(\"Fichero remplazado con exito \" + fname);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(LOG, e);\n\t\t}\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "private void processModify(int fileId, int commitId) throws SQLException,\n \t\t\tIOException {\n \t\tint previousCommitId = commitGraph.findPreviousCommitId(fileId,\n \t\t\t\tcommitId);\n \t\tString newContent = FileUtils.getContent(fileId, commitId);\n \t\tString oldContent = getPreviousContent(fileId, previousCommitId);\n \t\tList<SourceCodeChange> changes = extractDiff(new FileRevision(\n \t\t\t\tpreviousCommitId, fileId, oldContent), new FileRevision(\n \t\t\t\tcommitId, fileId, newContent));\n \t\tif (changes == null || changes.size() == 0) {\n \t\t\tlogger.warning(\"No changes distilled for file \" + fileId\n \t\t\t\t\t+ \" at commit_id \" + commitId + \" from previous commit id \"\n \t\t\t\t\t+ previousCommitId);\n \t\t} else {\n \t\t\tthis.reducer.add(changes, fileId, commitId);\n \t\t}\n \t\tif (changes != null) { // can't check newcontent alone, as it can have\n \t\t\t\t\t\t\t\t// invalid syntax\n \t\t\tassert (newContent != null);\n \t\t\tfileContentCache.put(fileId, new FileRevision(commitId, fileId,\n \t\t\t\t\tnewContent));\n \t\t}\n \t}", "public static void modifytext (String name) throws IOException {\n // Copy the contents of the input file and put it into the new file\n File inputF = new File(\"src/main/java/ex45/\"+ name +\".txt\");\n Path dest = inputF.toPath();\n Path src = Paths.get(\"src/main/java/ex45/exercise45_input.txt\");\n Files.copy(src, dest);\n\n // This process will replace the word 'utilize' with the word 'use'\n String utilize = new String(Files.readAllBytes(dest));\n Charset charset = StandardCharsets.UTF_8;\n utilize = utilize.replaceAll(\"utilize\", \"use\");\n Files.write(dest, utilize.getBytes(charset));\n\n System.out.print(\"Your file has been created.\");\n }", "private static void updateFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedWriter frequencyWriter = new BufferedWriter(new FileWriter(frequencyFile));\n\n\t\tfor(Entry<String, Long> entry : dataMap.entrySet()) { // Write every entry to the frequency file\n\n\t\t\tfrequencyWriter.write(generateStringFromEntry(entry));\n\t\t\tfrequencyWriter.newLine();\n\t\t}\n\n\t\tfrequencyWriter.close();\n\t}", "@Override\n public void saveDataFromCsvFile(List<TimetableUpload> inputData) {\n Map<String, Timetable> timetables = new HashMap<>();\n Semester semester = semesterService.getLatestSemester();\n Long latestVersionInSemester = timetableService.getLatestTimetableVersionInSemester(semester.getId());\n\n //timetableUpload = eden red od csv fajlot\n for (TimetableUpload timetableUpload : inputData) {\n //odreduvanje na modul\n String studentGroup = timetableUpload.getModule();\n String identifier = timetableUpload.getProfessor() + \" \" + timetableUpload.getSubject() + \" \" + timetableUpload.getRoom() + \" \" + studentGroup + \" \" + timetableUpload.getDay();\n\n if (!timetables.containsKey(identifier)) {\n\n //vnesuvanje na profesori i asistenti\n Professor professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n if(professor == null) {\n professorService.saveProfessor(timetableUpload.getProfessor());\n professor = professorService.getProfessorByName(timetableUpload.getProfessor());\n }\n\n Subject subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n if (subject == null) {\n subjectService.saveSubject(timetableUpload.getSubject());\n subject = subjectService.getSubjectByName(timetableUpload.getSubject());\n }\n\n Timetable newTimetable = new Timetable(8 + Long.parseLong(timetableUpload.getHourFrom()),\n 9 + Long.parseLong(timetableUpload.getHourFrom()), Long.parseLong(timetableUpload.getDay()), timetableUpload.getRoom(),\n studentGroup, professor, subject, semester, latestVersionInSemester + 1);\n timetables.put(identifier, newTimetable);\n } else {\n Timetable existingTimetable = timetables.get(identifier);\n existingTimetable.setHourTo(existingTimetable.getHourTo() + 1);\n timetables.replace(identifier, existingTimetable);\n }\n timetableService.saveAll(timetables.values());\n }\n }", "public void replace(int idIndex, String inputFilePath) {\n\t\tString url = IP + String.valueOf(PORT) + \"/replace\";\n\t\thelper(url, idIndex, inputFilePath);\n\t}", "public void reload() {\n\t\tif (file.lastModified() <= fileModified)\n\t\t\treturn;\n\t\n\t\treadFile();\n\t}", "@Override\r\n\tpublic void changeInf1(Scanner input, String path) {\n\t\tSystem.out.println(\"原去处为\"+this.getInfo1());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo1(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "public void performChange() {\n String nm = fqname.substring(fqname.lastIndexOf('.') + 1);\n if (oldAttrName == null) {\n // no attribute -> it's a filename change. eg. org-milos-kleint-MyInstance.instance\n newFileName = oldFileName.replaceAll(\"\\\\-\" + nm + \"$\", \"-\" + rename.getNewName());\n } else {\n if (oldAttrName.indexOf(fqname.replace('.','-') + \".instance\") > 0) {\n //replacing the ordering attribute..\n newAttrName = oldAttrName.replaceAll(\"-\" + nm + \"\\\\.\", \"-\" + rename.getNewName() + \".\");\n } else {\n //replacing attr value probably in instanceCreate and similar\n if (oldAttrValue != null) {\n String toReplacePattern = nm;\n newAttrValue = oldAttrValue.replaceAll(toReplacePattern, rename.getNewName());\n }\n }\n }\n \n if (newAttrValue != null) {\n doAttributeValueChange(newAttrValue, valueType);\n }\n if (newAttrName != null) {\n doAttributeMove(oldAttrName, newAttrName);\n }\n if (newFileName != null) {\n doFileMove(newFileName);\n }\n }", "public void updateTableData(String currentSchema,\n\t\t\tTreeMap<Integer,List<String>> tableDataMap,\n\t\t\tTreeMap<Integer,List<String>> tableSchemaMap){\n\t\ttry{\n\t\t\tInsertHelper iH = InsertHelper.getInsertHelperInstance();\n\t\t\tRandomAccessFile tableDataFile = new RandomAccessFile(currentSchema + \".\" + tableName + \".tbl\", \"rw\");\n\n\t\t\t//Table Data Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> tableDataMapSet = tableDataMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> tableDataMapIterator = tableDataMapSet.iterator();\n\n\t\t\t//Table Schema Map\n\t\t\tSet<Map.Entry<Integer,List<String>>> columnSet = tableSchemaMap.entrySet();\n\t\t\tIterator<Map.Entry<Integer,List<String>>> columnIterator = columnSet.iterator();\n\t\t\tList<String> columnSchema = new ArrayList<String>();\n\n\t\t\t//Adding Column_Name,INT serially in the list\n\t\t\twhile(columnIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = columnIterator.next();\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tcolumnSchema.add(currentColumn.get(0));\n\t\t\t\tcolumnSchema.add(currentColumn.get(1));\n\t\t\t}\n\n\t\t\t//Checks the array list and writes accordingly to the File \n\t\t\twhile(tableDataMapIterator.hasNext()){\n\t\t\t\tMap.Entry<Integer,List<String>> columnME = tableDataMapIterator.next();\n\n\t\t\t\tList<String> currentColumn = columnME.getValue();\n\t\t\t\tint columnDataCounter = currentColumn.size();\n\t\t\t\tint columnSchemaCounter = 0;\n\n\t\t\t\tfor(int i = 0;i < columnDataCounter; i++){\n\t\t\t\t\tlong tableIndexPointer = tableDataFile.getFilePointer();\n\t\t\t\t\tif(columnSchema.get(columnSchemaCounter + 1).contains(\"VARCHAR\")){\n\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch(columnSchema.get(columnSchemaCounter + 1)){\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\t\ttableDataFile.writeByte(currentColumn.get(i).length());\n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"BYTE\": \n\t\t\t\t\t\t\ttableDataFile.writeBytes(currentColumn.get(i));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"SHORT\":\n\t\t\t\t\t\t\ttableDataFile.writeShort(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\t\ttableDataFile.writeInt(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"LONG\": \n\t\t\t\t\t\t\ttableDataFile.writeLong(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"FLOAT\": \n\t\t\t\t\t\t\ttableDataFile.writeFloat(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DOUBLE\": \n\t\t\t\t\t\t\ttableDataFile.writeDouble(Integer.parseInt(currentColumn.get(i)));\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\": \n\t\t\t\t\t\t\tDateFormat dateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH:mm:ss\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate dateTime = dateTimeFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(dateTime.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATE\": \n\t\t\t\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n\t\t\t\t\t\t\tDate date = dateFormat.parse(currentColumn.get(i));\n\t\t\t\t\t\t\ttableDataFile.writeLong(date.getTime());\n\t\t\t\t\t\t\tiH.updateIndex(currentSchema, tableName, columnSchema.get(columnSchemaCounter), tableIndexPointer,columnSchema.get(columnSchemaCounter + 1), currentColumn.get(i));\n\t\t\t\t\t\t\tcolumnSchemaCounter = columnSchemaCounter + 2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\ttableDataFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void processFile() throws IOException {\n\t\tsetContent(file.getBytes());\n\t\tsetMultipartFileContentType(file.getContentType());\n\t}", "@Override\r\n\tpublic int update_file(Map<String, Object> map) throws Exception {\n\t\treturn sql.update(\"cms_board.update_file\", map);\r\n\t}", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateFile(String fname, String content) {\n\t\tprintMsg(\"running updateFiles() in \\\"\" + this.getClass().getName() + \"\\\" class.\");\n\t\tString text = null;\n\t\tPath filepath = Paths.get(theRootPath + System.getProperty(\"file.separator\") + fname);\n\t\tif(Files.exists(filepath)) {\n\t\t\tprintMsg(\"File \" + fname + \" exists, updating...\");\n\t\t\t\n\t\t\tif(content.isEmpty() || content == null) {\n\t\t\t\ttext = String.format(\"%s, testing appending text to an empty file.\\r\\n\", new Date());\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttext = content + \"\\r\\n\";\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFiles.write(filepath, text.getBytes(), StandardOpenOption.APPEND);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void updateSoftDrinkRecord(int sId) {\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\r\n\t\tList<SoftDrinkBean>updateList=new ArrayList<SoftDrinkBean>();\r\n\t\t\r\n\t\t\tupdateList=(List<SoftDrinkBean>)ois.readObject();\r\n\t\t\tfor(SoftDrinkBean s:updateList){\r\n\t\t\t\tif(s.getsId()==sId){\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t.println(\"select \\n1.pname \\n2.pprice\\n3.pqty you want to update\");\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tswitch (n) {\r\n\t\t\tcase 1:\r\n\t\t\t\tSystem.out.println(\"Enter new drink name\");\r\n\t\t\t\ts.setsName(sc.next());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Price\");\r\n\t\t\t\ts.setsPrice(sc.nextDouble());\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tSystem.out.println(\"Enter new drink Quantity\");\r\n\t\t\t\ts.setSqty(sc.nextInt());\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"choose between 1-3\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\t\ttempList2.add(s);\r\n\t\t} else {\r\n\t\t\ttempList2.add(s);\r\n\t\t}\r\n\t\t\t\tfos=new FileOutputStream(tempFile2);\r\n\t\t\t\toos=new ObjectOutputStream(oos);\r\n\t\t\t\t\r\n\t\toos.writeObject(tempList2);\r\n\t\toriginal.delete();\r\n\t\ttempFile.renameTo(original);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"------------------SoftDrink Updated successfully------------\");\r\n\t}", "@Override\r\n\tpublic void changeInf2(Scanner input, String path) {\n\t\tSystem.out.println(\"原联系方式为\"+this.getInfo2());\r\n\t\tSystem.out.println(\"请输入新的信息\");\r\n\t\tthis.setInfo2(input.next());\r\n\t\tSystem.out.println(\"修改完成\");\r\n\t}", "@Override\r\n public void updateTable() {\n FileManager fileManager = new FileManager();\r\n InputStream input = fileManager.readFileFromRAM(fileManager.XML_DIR, FILE_NAME);\r\n if(input != null){\r\n dropTable();\r\n createTable();\r\n parserXml(input); \r\n }else{\r\n Log.i(FILE_NAME,\"file is null\");\r\n }\r\n \r\n }", "private void getDataFromCustomerDataUpdate(Map<String, Object> cusData, CustomerDataTypeDTO data,\n List<FileInfosDTO> listFiles, String formatDate) throws JsonProcessingException {\n if (FieldTypeEnum.FILE.getCode().equals(data.getFieldType())) {\n if (listFiles != null) {\n List<BaseFileInfosDTO> listSaveDb = new ArrayList<>();\n listFiles.forEach(file -> {\n BaseFileInfosDTO fileSaveDb = new BaseFileInfosDTO();\n fileSaveDb.setFileName(file.getFileName());\n fileSaveDb.setFilePath(file.getFilePath());\n listSaveDb.add(fileSaveDb);\n });\n cusData.put(data.getKey(), objectMapper.writeValueAsString(listSaveDb));\n } else {\n cusData.put(data.getKey(), STRING_ARRAY_EMPTY);\n }\n } else if (FieldTypeEnum.MULTIPLE_PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.CHECKBOX.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RELATION.getCode().equals(data.getFieldType())) {\n List<Long> fValue = null;\n try {\n TypeReference<ArrayList<Long>> typeRef = new TypeReference<ArrayList<Long>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.PULLDOWN.getCode().equals(data.getFieldType())\n || FieldTypeEnum.RADIO.getCode().equals(data.getFieldType())\n || FieldTypeEnum.NUMBER.getCode().equals(data.getFieldType())) {\n if (StringUtils.isBlank(data.getValue())) {\n if (cusData.containsKey(data.getKey())) {\n cusData.remove(data.getKey());\n }\n } else {\n if (CheckUtil.isNumeric(data.getValue())) {\n cusData.put(data.getKey(), Long.valueOf(data.getValue()));\n } else {\n cusData.put(data.getKey(), Double.valueOf(data.getValue()));\n }\n }\n } else if (FieldTypeEnum.DATE.getCode().equals(data.getFieldType())) {\n getSystemDate(cusData, formatDate, data.getValue(), data.getKey(), null);\n } else if (FieldTypeEnum.TIME.getCode().equals(data.getFieldType())) {\n getSystemTime(cusData, DateUtil.FORMAT_HOUR_MINUTE, data.getValue(), data.getKey());\n } else if (FieldTypeEnum.DATETIME.getCode().equals(data.getFieldType())) {\n String date = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(0, formatDate.length())\n : \"\";\n String hour = StringUtils.isNotBlank(data.getValue()) ? data.getValue().substring(formatDate.length()) : \"\";\n getSystemDate(cusData, formatDate, date, data.getKey(), hour);\n } else if (FieldTypeEnum.SELECT_ORGANIZATION.getCode().equals(data.getFieldType())) {\n List<Object> fValue = null;\n try {\n TypeReference<ArrayList<Object>> typeRef = new TypeReference<ArrayList<Object>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n } catch (IOException e) {\n log.error(e.getLocalizedMessage());\n }\n cusData.put(data.getKey(), fValue);\n } else if (FieldTypeEnum.LINK.getCode().equals(data.getFieldType())) {\n Map<String, String> fValue = new HashMap<>();\n try {\n TypeReference<Map<String, String>> typeRef = new TypeReference<Map<String, String>>() {\n };\n fValue = objectMapper.readValue(data.getValue(), typeRef);\n cusData.put(data.getKey(), fValue);\n } catch (Exception e) {\n log.error(e.getLocalizedMessage());\n }\n } else {\n cusData.put(data.getKey(), data.getValue());\n }\n }", "public void save(String newFilePath) {\r\n File deletedFile = new File(path);\r\n deletedFile.delete();\r\n path = newFilePath;\r\n File dataFile = new File(path);\r\n File tempFile = new File(path.substring(0, path.lastIndexOf(\"/\")) + \"/myTempFile.txt\");\r\n\r\n try {\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(\r\n new FileOutputStream(tempFile), \"UTF-8\"));\r\n\r\n for (String line : data) {\r\n bw.write(line);\r\n bw.newLine();\r\n }\r\n\r\n bw.close();\r\n dataFile.delete();\r\n tempFile.renameTo(dataFile);\r\n } catch (IOException ex) {\r\n System.out.println(\"IOException in save2 : FileData\");\r\n }\r\n }", "protected void changeContent() {\n byte[] data = Arrays.copyOf(content.getContent(),\n content.getContent().length + 1);\n data[content.getContent().length] = '2'; // append one byte\n content.setContent(data);\n LOG.info(\"document content changed\");\n }", "public void update(final UploadFile uploadFile) {\n\t\t UploadFile uploadFileDB = uploadFileDAO.findById(uploadFile.getId());\n\t\t uploadFileDB.setFileName(uploadFile.getFileName());\n\t\t uploadFileDB.setData(uploadFile.getData());\n\t\t uploadFileDAO.persist(uploadFileDB);\n\t }", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "public void updateFaxJobFromInputData(T inputData,FaxJob faxJob)\n {\n if(!this.initialized)\n {\n throw new FaxException(\"Fax bridge not initialized.\");\n }\n \n //get fax job\n this.updateFaxJobFromInputDataImpl(inputData,faxJob);\n }", "public void update() throws IOException{\r\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agenda.txt\", false));\r\n\t\toos.writeObject(artists);\r\n\t\toos.writeObject(stages);\r\n\t\toos.writeObject(performances);\r\n\t\tartists.clear();\r\n\t\tstages.clear();\r\n\t\tperformances.clear();\r\n\t\toos.close();\r\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public void setFileContent(String fileContent) {\n this.fileContent = fileContent;\n }", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "private void updateDatabaseFile() {\n Log.i(\"updateDatabaseFile\", \"Updating server app database\");\n try {\n FileInputStream inputStream = new FileInputStream(databaseFile);\n DropboxAPI.Entry response = MainActivity.mDBApi.putFileOverwrite(databaseFile.getName(), inputStream,\n databaseFile.length(), null);\n Log.i(\"updateDatabaseFile\", \"The uploaded file's rev is: \" + response.rev);\n } catch (Exception e) {\n Log.e(\"updateDatabaseFile\", e.toString(), e);\n }\n }", "@Test\r\n public void testUpdateFile() {\r\n System.out.println(\"updateFile\");\r\n InparseManager instance = ((InparseManager) new ParserGenerator().getNewApplicationInparser());\r\n try {\r\n File file = File.createTempFile(\"TempInpFile\", null);\r\n instance.setlocalPath(file.getAbsolutePath());\r\n } catch (IOException ex) {\r\n Logger.getLogger(ApplicationInparserTest.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n instance.updateFile();\r\n // no assertEquals needed because the method itself would throw an error\r\n // if an error occurs check your connection to the internet\r\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void modifyClass2File() throws IOException {\n\t\tMap<String, Object> properties = specificConfig();\n\t\tModifyDriver.modify2File(properties, mvfactory);\n\t}", "public void data(RecordInput recordInput) {\n try {\n byte[] bytes = new byte[100];\n recordInput.readBytes(bytes);\n crc.update(bytes);\n } catch (IOException e) {\n throw new ServingXmlException(e.getMessage(), e);\n }\n }", "@Test\n public void testApplyToOldFile() throws IOException, PatchFailedException {\n Path oldFile = scratch.file(\"/root/oldfile\", \"line one\");\n Path newFile = scratch.file(\"/root/newfile\", \"line one\");\n Path patchFile =\n scratch.file(\n \"/root/patchfile\",\n \"--- oldfile\",\n \"+++ newfile\",\n \"@@ -1,1 +1,2 @@\",\n \" line one\",\n \"+line two\");\n PatchUtil.apply(patchFile, 0, root);\n ImmutableList<String> newContent = ImmutableList.of(\"line one\", \"line two\");\n assertThat(FileSystemUtils.readLines(oldFile, UTF_8)).isEqualTo(newContent);\n // new file should not change\n assertThat(FileSystemUtils.readLines(newFile, UTF_8)).containsExactly(\"line one\");\n }", "@ActionKey(\"/api/blog/updateFile\")\n public void updateFile() throws IOException {\n Integer id = getParaToInt(\"id\");\n File blogFile = getFile(\"blog\").getFile();\n if (id == null) {\n mResult.fail(102);\n renderJson(mResult);\n return;\n }\n if (!blogFile.getName().endsWith(\".md\")) {\n mResult.fail(110);\n renderJson(mResult);\n return;\n }\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(blogFile), \"UTF-8\"));\n StringBuilder builder = new StringBuilder();\n String line = \"\";\n while (line != null) {\n line = reader.readLine();\n builder.append(line);\n }\n mResult.success(mBlogService.update(id, \"content\", builder.toString()));\n renderJson(mResult);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n mResult.fail(109);\n if (reader != null) {\n reader.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "private void updateImformation(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint fileId= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tString caption= request.getParameter(\"caption\");\n\t\tString label= request.getParameter(\"label\");\n\t\tString fileName= request.getParameter(\"fileName\");\n\t\tFiles file= new Files(fileId, fileName, label, caption);\n\t\tnew FilesDAO().update(fileId, caption, label);;\n\t\tlistingPage(request, response);\n\t}", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "void overwriteContent(Md2Entity content);", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "void setNewFile(File file);", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "public static void UpdateTable(String s) throws IOException {\n String result=\"\";\n String s_analysis=\"(?<=set ).+(?=;)\";\n String s_property=\"(.+)( where )(.+)\";\n String s_update_values=\"(.+)=(.+),(.+)=(.+)\";\n String table_name=\"\";//表名\n String find = \"\" ;\n String values=\"\";//where前面的属性\n String values1=\"\";//where后面的属性\n String []x=s.split(\" \");\n table_name=x[1];//表名\n// System.out.println(table_name); //student\n\n //此版块实现判断是否有此表\n File file = new File(\"E:\\\\\"+table_name+\".txt\");\n if(file.exists()){\n //此版块实现将set后语句识别出来\n Pattern p = Pattern.compile(s_analysis);\n Matcher m = p.matcher(s);\n m.find();\n find= m.group().toString();\n// System.out.println(find); //set id=6666,grade=3 where name=houwei\n //实现将where语句前后属性分解出来\n Pattern p1 = Pattern.compile(s_property);\n Matcher m1 = p1.matcher(find);\n while(m1.find()){\n\n values=m1.group(1); //存要设置的新值\n values1=m1.group(3); //存定位到修改行的依据值\n }\n// System.out.println(values); //id=6666,grade=3 (下标为1的那部分)\n// System.out.println(values1); //where name=houwei (下标为3的那部分)\n //此版块实现将需要修改的属性及其值得到\n int weizhi=-1;//\n String line=\"\",attr = \"\";\n\n String[] y=values1.split(\"=\");\n String y_alter_property=y[0];//需要修改的属性\n String y_alter_values=y[1];//需要修改的属性的值\n// System.out.println(y_alter_values+\"需要修改\"); // houwei\n //此版块实现获取更改的属性和值\n BufferedReader br = new BufferedReader(new FileReader(file));\n line=br.readLine();//读取第一行\n result+=line+\"\\r\\n\";\n // list.add(line+\"\\r\\n\");//添加第一行\n attr = line = br.readLine();//读取第二行 属性\n\n //===================================================\n String[] sAttr=attr.split(\" \"); //保存每个属性的值\n String tmp [];\n for(int i = 0;i<sAttr.length;i++){\n\n tmp = sAttr[i].split(\"\\\\(\");\n sAttr[i] = tmp[0];\n\n// System.out.println(\"sAttr[i]\"+sAttr[i]);\n\n }\n\n //用来保存每一行的值\n ArrayList<String> list=new ArrayList<String>();\n\n\n result+=line+\"\";\n // list.add(line+\"\\r\\n\");//添加第二行\n //将第二行数据用空格分开\n String[] h=line.split(\" \");\n\n\n for(int j=0;j<h.length;j++){\n //得到定位属性的位置\n if(y_alter_property.equals(h[j].replaceAll(\"\\\\(.*?\\\\)\",\"\"))){\n weizhi=j;\n// System.out.println(y_alter_property); //name\n }\n }\n// System.out.println(\"要修改的位置是:\"+weizhi); //0 根据哪个属性要修改值得下标\n\n //筛选出修改的值的内容\n String z =\"\";\n Pattern p2 = Pattern.compile(s_update_values);\n Matcher m2 = p2.matcher(values);\n m2.find();\n// System.out.println(m2.group().toString()+\"==================\");\n\n\n //===========================================================\n\n// for(int b=2;b<5;){\n// System.out.println(m2.group(b));\n// z+=m2.group(b)+\" \";\n// b+=2;\n// }\n// z+=y_alter_values;\n// System.out.println(z+\"lalal\");\n\n //存第一个要修改属性的值 houwei\n String a = m2.group(2);\n //存第二个要修改属性的值 6666\n String b = m2.group(4);\n\n //存第一个要修改的属性(含类型)\n String c = m2.group(1);\n //存第二个要修改的属性(含类型)\n String d = m2.group(3);\n\n// System.out.println(\"111111111111111111111\");\n// System.out.println(\"a \"+a);\n// System.out.println(\"b \"+b);\n// System.out.println(\"c \"+c);\n// System.out.println(\"d \"+d);\n\n //从第三行开始读\n while((line=br.readLine())!=null){\n\n// System.out.println(\"读取的行是:\"+line);\n String[] k=line.split(\" \");\n\n if(k==null){\n\n// System.out.println(\"此表中没有值\");\n\n }\n\n //读到的那一行的属性值为 where的属性\n else if(k[weizhi].equals( y_alter_values )){\n\n result+=\"\\r\\n\";\n\n //建立一个动态数组\n // 1. 将修改的值变成新的值 填入动态数组对应的位置\n // 2. 将未修改的值也存入对应位置\n // 3. 将该动态数组拼接成一个字符串(最后加\\r\\n)\n // 4. 接着读取下面的行,重复以上操作\n\n //先将原一行原数据放入数组中\n for(int i = 0;i<k.length;i++) {\n list.add(k[i]);\n }\n\n for(int i = 0;i<k.length;i++){\n\n // if(c == sAttr[i]){\n if(sAttr[i].equals(c)){\n list.set(i,a);\n }\n\n\n //if(d == sAttr[i]){\n if(d.equals(sAttr[i])){\n list.set(i,b);\n\n }\n\n }\n\n // result+=\"\\r\\n\";\n\n for(int i = 0;i<k.length;i++){\n\n result+=list.get(i)+\" \";\n\n }\n\n\n }else{\n //没有则按照原来情况正常写入\n// System.out.println(\"正常\");\n result+=\"\\r\\n\"+line;\n\n }\n }\n //将字符串写入文件中\n System.out.println(result);\n FileWriter fileWriter=new FileWriter(\"E:\\\\\"+table_name+\".txt\", false);\n fileWriter.write(result+\"\");\n fileWriter.close();\n System.out.println(\"成功执行\");\n\n }else{\n System.out.println(\"此表不存在\");\n }\n\n\n\n\n }", "void updateData();", "@Update({ \"update csv_file\", \"set pid = #{pid,jdbcType=VARCHAR},\", \"filename = #{filename,jdbcType=VARCHAR},\",\n\t\t\t\"start_time = #{startTime,jdbcType=TIMESTAMP},\", \"end_time = #{endTime,jdbcType=TIMESTAMP},\",\n\t\t\t\"length = #{length,jdbcType=INTEGER},\", \"density = #{density,jdbcType=DOUBLE},\",\n\t\t\t\"machine = #{machine,jdbcType=VARCHAR},\", \"ar = #{ar,jdbcType=BIT},\", \"path = #{path,jdbcType=VARCHAR},\",\n\t\t\t\"size = #{size,jdbcType=BIGINT},\", \"uuid = #{uuid,jdbcType=CHAR},\",\n\t\t\t\"header_time = #{headerTime,jdbcType=TIMESTAMP},\", \"last_update = #{lastUpdate,jdbcType=TIMESTAMP},\",\n\t\t\t\"conflict_resolved = #{conflictResolved,jdbcType=BIT},\", \"status = #{status,jdbcType=INTEGER},\",\n\t\t\t\"comment = #{comment,jdbcType=VARCHAR},\", \"width = #{width,jdbcType=INTEGER},\",\n\t\t\t\"start_version = #{startVersion,jdbcType=INTEGER},\", \"end_version = #{endVersion,jdbcType=INTEGER}\",\n\t\t\t\"where id = #{id,jdbcType=INTEGER}\" })\n\tint updateByPrimaryKey(CsvFile record);", "public static void fileEditor(String sourcePath, String targetPath, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(sourcePath);\n\t\t\t\t File tar= new File(targetPath);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(tar);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "public void updatePersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tserializeToFile(file);\n\t\tupdatePersistentSettings();\n\t}", "public void updateContent(Map<String, Object> update_params) throws SolrServerException, IOException {\n\t\tSolrInputDocument doc_in = new SolrInputDocument();\n\n\t\tIterator<String> itr = update_params.keySet().iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tString key = itr.next();\n\t\t\t\n\t\t\tdoc_in.addField(key, update_params.get(key));\n\t\t\titr.remove(); // avoids a ConcurrentModificationException\n\t\t}\n\t\t\n\t\t\n\t\t//System.out.println(\"Debug.\");\n\t\tSystem.out.println(\"Debug: Doc_in: \" + doc_in.toString());\n\t\tSystem.out.println(\"updating content...\");\n\t\tUpdateResponse UD_response = server.add(doc_in);\n\t\tserver.commit();\n\t\tSystem.out.println(\"Debug: \"+UD_response.toString());\n\t\tSystem.out.println(\"Finished updating solr.\");\n\n\t}", "public void setFileContent(Byte[] fileContent) {\n this.fileContent = fileContent;\n }", "public static void makeEntityObservable(FileObject fileInProject, String[] entityInfo, MetadataModel<EntityMappingsMetadata> mappings) {\n if (entityInfo == null) return;\n ClassPath cp = ClassPath.getClassPath(fileInProject, ClassPath.SOURCE);\n String resName = entityInfo[1].replace('.', '/') + \".java\"; // NOI18N\n FileObject entity = cp.findResource(resName);\n if (entity == null) return;\n final List<String> properties;\n try {\n properties = propertiesForColumns(mappings, entityInfo[0], null);\n } catch (IOException ioex) {\n return;\n }\n JavaSource source = JavaSource.forFileObject(entity);\n final boolean[] alreadyUpdated = new boolean[1];\n try {\n // PENDING merge into one task once it will be possible\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n \n for (Tree member : clazz.getMembers()) {\n if (Tree.Kind.VARIABLE == member.getKind()) {\n VariableTree variable = (VariableTree)member;\n String type = variable.getType().toString();\n if (type.endsWith(\"PropertyChangeSupport\")) { // NOI18N\n alreadyUpdated[0] = true;\n }\n }\n }\n \n TreeMaker make = wc.getTreeMaker();\n ClassTree modifiedClass = clazz;\n \n if (!alreadyUpdated[0]) {\n // changeSupport field\n TypeElement transientElement = wc.getElements().getTypeElement(\"javax.persistence.Transient\"); // NOI18N\n TypeMirror transientMirror = transientElement.asType();\n Tree transientType = make.Type(transientMirror);\n AnnotationTree transientTree = make.Annotation(transientType, Collections.EMPTY_LIST);\n ModifiersTree modifiers = make.Modifiers(Modifier.PRIVATE, Collections.singletonList(transientTree));\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n TypeMirror changeSupportMirror = changeSupportElement.asType();\n Tree changeSupportType = make.Type(changeSupportMirror);\n NewClassTree changeSupportConstructor = make.NewClass(null, Collections.EMPTY_LIST, make.QualIdent(changeSupportElement), Collections.singletonList(make.Identifier(\"this\")), null);\n VariableTree changeSupport = make.Variable(modifiers, \"changeSupport\", changeSupportType, changeSupportConstructor); // NOI18N\n modifiedClass = make.insertClassMember(clazz, 0, changeSupport);\n }\n\n // property change notification\n for (Tree clMember : modifiedClass.getMembers()) {\n if (clMember.getKind() == Tree.Kind.METHOD) {\n MethodTree method = (MethodTree)clMember;\n String methodName = method.getName().toString();\n if (methodName.startsWith(\"set\") && (methodName.length() > 3) && (Character.isUpperCase(methodName.charAt(3))) && (method.getParameters().size() == 1)) { // NOI18N\n String propName = methodName.substring(3);\n if ((propName.length() == 1) || (Character.isLowerCase(propName.charAt(1)))) {\n propName = Character.toLowerCase(propName.charAt(0)) + propName.substring(1);\n }\n if (!properties.contains(propName)) continue;\n BlockTree block = method.getBody();\n if (block.getStatements().size() != 1) continue;\n StatementTree statement = block.getStatements().get(0);\n if (statement.getKind() != Tree.Kind.EXPRESSION_STATEMENT) continue;\n ExpressionTree expression = ((ExpressionStatementTree)statement).getExpression();\n if (expression.getKind() != Tree.Kind.ASSIGNMENT) continue;\n AssignmentTree assignment = (AssignmentTree)expression;\n String parName = assignment.getExpression().toString();\n VariableTree parameter = method.getParameters().get(0);\n if (!parameter.getName().toString().equals(parName)) continue;\n ExpressionTree persistentVariable = assignment.getVariable();\n\n // <Type> old<PropertyName> = this.<propertyName>\n String parameterName = parameter.getName().toString();\n String oldParameterName = \"old\" + Character.toUpperCase(parameterName.charAt(0)) + parameterName.substring(1); // NOI18N\n Tree parameterTree = parameter.getType();\n VariableTree oldParameter = make.Variable(make.Modifiers(Collections.EMPTY_SET), oldParameterName, parameterTree, persistentVariable);\n BlockTree newBlock = make.insertBlockStatement(block, 0, oldParameter);\n\n // changeSupport.firePropertyChange(\"<propertyName>\", old<PropertyName>, <propertyName>);\n MemberSelectTree fireMethod = make.MemberSelect(make.Identifier(\"changeSupport\"), \"firePropertyChange\"); // NOI18N\n List<ExpressionTree> fireArgs = new LinkedList<ExpressionTree>();\n fireArgs.add(make.Literal(propName));\n fireArgs.add(make.Identifier(oldParameterName));\n fireArgs.add(make.Identifier(parameterName));\n MethodInvocationTree notification = make.MethodInvocation(Collections.EMPTY_LIST, fireMethod, fireArgs);\n newBlock = make.addBlockStatement(newBlock, make.ExpressionStatement(notification));\n wc.rewrite(block, newBlock);\n }\n }\n }\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n if (alreadyUpdated[0]) return;\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // addPropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree addCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"addPropertyChangeListener\"); // NOI18N\n MethodInvocationTree addInvocation = make.MethodInvocation(Collections.EMPTY_LIST, addCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree addMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"addPropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(addInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, addMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n source.runModificationTask(new CancellableTask<WorkingCopy>() {\n\n @Override\n public void run(WorkingCopy wc) throws Exception {\n wc.toPhase(JavaSource.Phase.RESOLVED);\n CompilationUnitTree cu = wc.getCompilationUnit();\n ClassTree clazz = null;\n for (Tree typeDecl : cu.getTypeDecls()) {\n if (TreeUtilities.CLASS_TREE_KINDS.contains(typeDecl.getKind())) {\n ClassTree candidate = (ClassTree) typeDecl;\n if (candidate.getModifiers().getFlags().contains(javax.lang.model.element.Modifier.PUBLIC)) {\n clazz = candidate;\n break;\n }\n }\n }\n TreeMaker make = wc.getTreeMaker();\n\n // removePropertyChange method\n ModifiersTree parMods = make.Modifiers(Collections.EMPTY_SET, Collections.EMPTY_LIST);\n TypeElement changeListenerElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeListener\"); // NOI18N\n VariableTree par = make.Variable(parMods, \"listener\", make.QualIdent(changeListenerElement), null); // NOI18N\n TypeElement changeSupportElement = wc.getElements().getTypeElement(\"java.beans.PropertyChangeSupport\"); // NOI18N\n VariableTree changeSupport = make.Variable(parMods, \"changeSupport\", make.QualIdent(changeSupportElement), null); // NOI18N\n MemberSelectTree removeCall = make.MemberSelect(make.Identifier(changeSupport.getName()), \"removePropertyChangeListener\"); // NOI18N\n MethodInvocationTree removeInvocation = make.MethodInvocation(Collections.EMPTY_LIST, removeCall, Collections.singletonList(make.Identifier(par.getName())));\n MethodTree removeMethod = make.Method(\n make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),\n \"removePropertyChangeListener\", // NOI18N\n make.PrimitiveType(TypeKind.VOID),\n Collections.EMPTY_LIST,\n Collections.singletonList(par),\n Collections.EMPTY_LIST,\n make.Block(Collections.singletonList(make.ExpressionStatement(removeInvocation)), false),\n null\n );\n ClassTree modifiedClass = make.addClassMember(clazz, removeMethod);\n wc.rewrite(clazz, modifiedClass);\n }\n\n @Override\n public void cancel() {\n }\n\n }).commit();\n } catch (IOException ioex) {\n Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, ioex.getMessage(), ioex);\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "public static boolean editEntry(String tableName, String newData, int id){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n String fileContent = tableReader.nextLine()+\"\\n\";\n boolean lineFound = false;\n while (tableReader.hasNextLine()){\n String currentLine = tableReader.nextLine();\n int lineId = Integer.parseInt(currentLine.split(\",\")[0]);\n if(lineId != id){\n fileContent += currentLine+\"\\n\";\n }else{\n lineFound = true;\n }\n }\n tableReader.close();\n if(lineFound){\n fileContent += id+\",\"+newData+\"\\n\";\n FileWriter tableWriter = new FileWriter(table);\n String[] fileLines = fileContent.split(\"\\n\");\n for(String l : fileLines){\n tableWriter.write(l+\"\\n\");\n }\n tableWriter.close();\n return true;\n }else{\n System.out.println(\"No se encontró una entrada con el id: \"+id);\n return false;\n }\n\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }", "public void uploadDataFromFile()\n {\n String jobSeekerFile = (\"JobSeeker.txt\");\n String jobRecruiterFile = (\"JobRecruiter.txt\");\n String jobFile = (\"Job.txt\");\n String notificationFile = (\"Notification.txt\");\n \n String jobSeekerLines = readFile(jobSeekerFile);\n String jobRecruiterLines = readFile(jobRecruiterFile);\n String jobLines = readFile(jobFile);\n String notificationLines = readFile(notificationFile);\n \n storeJobSeekersToJobSeekerList(jobSeekerLines);\n storeJobRecruitersToJobRecruiterList(jobRecruiterLines);\n storeJobsToJobList(jobLines);\n storeNotificationsToNotificationList(notificationLines);\n \n }", "private void onContentsChanged(IChangeEvent event) {\n IPosition fromPos = event.getFrom();\n int fromOffset = mapper.getOffset(fromPos.getLine(), fromPos.getChar());\n IPosition toPos = event.getTo();\n int toOffset = mapper.getOffset(toPos.getLine(), toPos.getChar());\n // Create a transformation that corresponds to the change.\n TransformBuilder builder = new TransformBuilder();\n builder.skip(fromOffset);\n if (fromOffset != toOffset)\n builder.delete(mapper.substring(fromOffset, toOffset));\n for (int i = 0; i < event.getTextLineCount(); i++) {\n if (i > 0)\n builder.insert(\"\\n\");\n builder.insert(event.getTextLine(i));\n }\n builder.skip(mapper.getLength() - toOffset);\n Transform transform = builder.flush();\n Assert.equals(mapper.getLength(), transform.getInputLength());\n for (IListener listener : listeners)\n listener.onChange(transform);\n doc.apply(transform);\n mapper.apply(transform);\n }", "public void processInput(String theFile){processInput(new File(theFile));}", "private void updateFieldRows(Connection con,\n IdentifiedRecordTemplate template, GenericDataRecord record)\n throws SQLException, FormException, CryptoException {\n PreparedStatement update = null;\n PreparedStatement insert = null;\n \n try {\n update = con.prepareStatement(UPDATE_FIELD);\n int recordId = record.getInternalId();\n String[] fieldNames = record.getFieldNames();\n Map<String, String> rows = new HashMap<String, String>();\n for (String fieldName : fieldNames) {\n Field field = record.getField(fieldName);\n String fieldValue = field.getStringValue();\n \n SilverTrace.debug(\"form\", \"GenericRecordSetManager.updateFieldRows\",\n \"root.MSG_GEN_PARAM_VALUE\", \"fieldName = \" + fieldName\n + \", fieldValue = \" + fieldValue\n + \", recordId = \" + recordId);\n \n rows.put(fieldName, fieldValue);\n }\n \n if (template.isEncrypted()) {\n rows = getEncryptionService().encryptContent(rows);\n }\n \n for (String fieldName : rows.keySet()) {\n String fieldValue = rows.get(fieldName);\n update.setString(1, fieldValue);\n update.setInt(2, recordId);\n update.setString(3, fieldName);\n \n int nbRowsCount = update.executeUpdate();\n if (nbRowsCount == 0) {\n // no row has been updated because the field fieldName doesn't exist in database.\n // The form has changed since the last modification of the record.\n // So we must insert this new field.\n insert = con.prepareStatement(INSERT_FIELD);\n insert.setInt(1, recordId);\n insert.setString(2, fieldName);\n insert.setString(3, fieldValue);\n \n insert.execute();\n }\n }\n } finally {\n DBUtil.close(update);\n DBUtil.close(insert);\n }\n }", "public void update() throws IOException {\n\n\t\tif(this.bdgDataColIdx < 4){\n\t\t\tSystem.err.println(\"Invalid index for bedgraph column of data value. Resetting to 4. Expected >=4. Got \" + this.bdgDataColIdx);\n\t\t\tthis.bdgDataColIdx= 4;\n\t\t}\n\n\t\tif(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BIGWIG)){\n\t\t\t\n\t\t\tbigWigToScores(this.bigWigReader);\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.TDF)){\n\n\t\t\tthis.screenWiggleLocusInfoList= \n\t\t\t\t\tTDFUtils.tdfRangeToScreen(this.getFilename(), this.getGc().getChrom(), \n\t\t\t\t\t\t\tthis.getGc().getFrom(), this.getGc().getTo(), this.getGc().getMapping());\n\t\t\t\n\t\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\t\tfor(ScreenWiggleLocusInfo x : screenWiggleLocusInfoList){\n\t\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t\t}\n\t\t\tthis.setScreenScores(screenScores);\t\n\t\t\t\n\t\t} else if(Utils.getFileTypeFromName(this.getFilename()).equals(TrackFormat.BEDGRAPH)){\n\n\t\t\t// FIXME: Do not use hardcoded .samTextViewer.tmp.gz!\n\t\t\tif(Utils.hasTabixIndex(this.getFilename())){\n\t\t\t\tbedGraphToScores(this.getFilename());\n\t\t\t} else if(Utils.hasTabixIndex(this.getFilename() + \".samTextViewer.tmp.gz\")){\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t} else {\n\t\t\t\tblockCompressAndIndex(this.getFilename(), this.getFilename() + \".samTextViewer.tmp.gz\", true);\n\t\t\t\tbedGraphToScores(this.getFilename() + \".samTextViewer.tmp.gz\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"Extension (i.e. file type) not recognized for \" + this.getFilename());\n\t\t}\n\t\tthis.setYLimitMin(this.getYLimitMin());\n\t\tthis.setYLimitMax(this.getYLimitMax());\n\t}", "public void saveWorkingDataFile(String rftNo, String fileName, int fileRecordNumber, Connection conn) \n\t\tthrows ReadWriteException, NotFoundException, InvalidDefineException, IllegalAccessException, IOException\n\t{\t\t\n\t\tString id = \"\";\n\t\tMatcher m = Pattern.compile(\"ID(\\\\d\\\\d\\\\d\\\\d).txt\").matcher(fileName);\n\t\tif (m.find())\n\t\t{\n\t\t\tid = m.group(1);\n\t\t}\n\t\t//#CM702621\n\t\t// Generation of instance of work file\n\t\tWorkDataFile workDataFile =\n\t\t (WorkDataFile) PackageManager.getObject(\"Id\"+ id + \"DataFile\");\n\t\tworkDataFile.setFileName(fileName);\n\t\t\n\t\t//#CM702622\n\t\t// Remove the passing part of File Name. \n\t\tFile file = new File(fileName);\n\t\tString registFileName = file.getName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tWorkingDataHandler wHandler = new WorkingDataHandler(conn);\n\t\t\t//#CM702623\n\t\t\t// Open the made work file. \n\t\t\tworkDataFile.openReadOnly();\n\t\t\tint i = 0;\n\t\t\tfor(workDataFile.next(); i < fileRecordNumber; workDataFile.next())\n\t\t\t{\t\n\t\t\t\tWorkingDataAlterKey akey = new WorkingDataAlterKey();\n\t\t\t\takey.setRftNo(rftNo);\n\t\t\t\takey.setLineNo(i);\n\t\t\t\takey.updateFileName(registFileName);\n\t\t\t\takey.updateContents(workDataFile.getContents());\n\n\t\t\t\tWorkingDataSearchKey skey = new WorkingDataSearchKey();\n\t\t\t\tskey.setRftNo(rftNo);\n\t\t\t\tskey.setFileName(registFileName);\n\t\t\t\tskey.setLineNo(i);\n\t\t\t\tWorkingData[] workingArr= (WorkingData[])wHandler.find(skey);\n\t\t\t\tif (workingArr.length > 0)\n\t\t\t\t{\n\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tWorkingData workdata = new WorkingData();\n\t\t\t\t\t\tworkdata.setRftNo(rftNo);\n\t\t\t\t\t\tworkdata.setFileName(registFileName);\n\t\t\t\t\t\tworkdata.setLineNo(i);\n\t\t\t\t\t\tworkdata.setContents(workDataFile.getContents());\n\t\t\t\t\t\twHandler.create(workdata);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (DataExistsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\twHandler.modify(akey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tworkDataFile.closeReadOnly();\n\t\t}\n\t\t\n\t}", "public void updateSettings(FileObject file) {\n DataObject dobj = null;\n DataFolder folder = null;\n try {\n dobj = DataObject.find(file);\n folder = dobj.getFolder();\n } catch (DataObjectNotFoundException ex) {\n Exceptions.printStackTrace(ex);\n }\n if (dobj == null || folder == null) {\n return;\n }\n for (CreateFromTemplateAttributesProvider provider\n : Lookup.getDefault().lookupAll(CreateFromTemplateAttributesProvider.class)) {\n Map<String, ?> attrs = provider.attributesFor(dobj, folder, \"XXX\"); // NOI18N\n if (attrs == null) {\n continue;\n }\n Object aName = attrs.get(\"user\"); // NOI18N\n if (aName != null) {\n author = aName.toString();\n break;\n }\n }\n }", "public void updatePathAndFile(String path, String file){\r\n\t\tthis.path = path;\r\n\t\tthis.file = file;\r\n\t}", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void convert(File inputFile, File outputFile) throws IOException {\n\n setType(inputFile);\n\n BufferedReader reader = null;\n PrintWriter writer = null;\n\n try {\n reader = new BufferedReader(new FileReader(inputFile));\n writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));\n\n String nextLine = null;\n\n // Skip meta data. Note for GCT files this includes the mandatory first line\n while ((nextLine = reader.readLine()).startsWith(\"#\") && (nextLine != null)) {\n writer.println(nextLine);\n }\n\n // This is the first non-meta line\n writer.println(nextLine);\n\n // for TAB and RES files the first row contains the column headings.\n int nCols = 0;\n if (type == FileType.TAB || type == FileType.RES) {\n nCols = nextLine.split(\"\\t\").length;\n }\n\n\n if (type == FileType.GCT) {\n // GCT files. Column headings are 3rd row (read next line)\n nextLine = reader.readLine();\n nCols = nextLine.split(\"\\t\").length;\n writer.println(nextLine);\n } else if (type == FileType.RES) {\n // Res files -- skip lines 2 and 3\n writer.println(reader.readLine());\n writer.println(reader.readLine());\n }\n\n\n // Compute the # of data points\n int columnSkip = 1;\n if (type == FileType.RES) {\n columnSkip = 2;\n nCols++; // <= last call column of a res file is sometimes blank, if not this will get\n }\n nPts = (nCols - dataStartColumn) / columnSkip;\n\n // Now for the data\n while ((nextLine = reader.readLine()) != null) {\n String[] tokens = nextLine.split(\"\\t\");\n\n for (int i = 0; i < dataStartColumn; i++) {\n writer.print(tokens[i] + \"\\t\");\n }\n\n DataRow row = new DataRow(tokens, nextLine);\n for (int i = 0; i < nPts; i++) {\n\n if (Double.isNaN(row.scaledData[i])) {\n writer.print(\"\\t\");\n } else {\n\n writer.print(row.scaledData[i]);\n if (type == FileType.RES) {\n writer.print(\"\\t\" + row.calls[i]);\n }\n if (i < nPts - 1) {\n writer.print(\"\\t\");\n }\n }\n }\n writer.println();\n }\n }\n finally {\n if (reader != null) {\n reader.close();\n }\n if (writer != null) {\n writer.close();\n }\n }\n }", "public void testAppendDataInFile() throws IOException {\n\t\tfinal CachedParserDocument pdoc = new CachedParserDocument(this.tempFilemanager,0);\n\t\tassertTrue(pdoc.inMemory());\n\t\tassertEquals(0, pdoc.length());\n\t\tassertFalse(this.outputFile.exists());\n\t\t\n\t\t// copying data\n\t\tthis.appendData(TESTFILE, pdoc);\n\t\t\n\t\t// some tests\n\t\tassertFalse(pdoc.inMemory());\n\t\tassertEquals(this.fileSize, pdoc.length());\n\t\tassertTrue(this.outputFile.exists());\n\t\tassertEquals(TESTFILE, pdoc.getTextAsReader());\n\t\tassertEquals(TESTFILE, pdoc.getTextFile());\n\t\tassertFalse(pdoc.inMemory());\n\t}" ]
[ "0.63654107", "0.6328003", "0.6237628", "0.60860044", "0.5955357", "0.5837597", "0.5805012", "0.5685616", "0.55792284", "0.55723965", "0.55527437", "0.5512726", "0.549281", "0.5472843", "0.5466059", "0.54492396", "0.5433361", "0.5426097", "0.5410725", "0.5392123", "0.53916186", "0.5379693", "0.5365372", "0.5362732", "0.53501546", "0.5349444", "0.53470236", "0.5340252", "0.5331697", "0.5319992", "0.5316423", "0.53062797", "0.5291451", "0.5286143", "0.52787435", "0.52692443", "0.52554744", "0.5224223", "0.52082175", "0.5167456", "0.51581764", "0.5153432", "0.51419634", "0.5138886", "0.51280195", "0.51080924", "0.51043797", "0.5098715", "0.5087148", "0.50858444", "0.50856346", "0.5084349", "0.5077724", "0.5070971", "0.5050992", "0.50416553", "0.5036287", "0.50338346", "0.5026899", "0.50266653", "0.5019919", "0.50197315", "0.50098723", "0.50086343", "0.5003353", "0.499035", "0.49718258", "0.49694467", "0.4965634", "0.49532333", "0.49475157", "0.49350744", "0.49334475", "0.49246305", "0.49220538", "0.4918485", "0.49170926", "0.49097085", "0.49095142", "0.490617", "0.49035275", "0.48940146", "0.48845422", "0.48812157", "0.48666424", "0.48579508", "0.48566595", "0.48557007", "0.4853903", "0.4852243", "0.4841159", "0.48347494", "0.4834357", "0.4833695", "0.4830389", "0.48294058", "0.48291248", "0.48213032", "0.48213005", "0.48151606", "0.48064038" ]
0.0
-1
Creates a new delay with a specified trigger time. This constructor is identical to calling the following: new Delay(delay,0);
public Delay(float delay) { this(delay,0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }", "public Delay(float delay, int repeat)\n\t{\n\t\tsetDelay(delay);\n\t\tdelayCount=0f;\n\t\trepeatMax=repeat;\n\t\trepeatCount=0;\n\t}", "public T setDelay(float delay)\n\t{\n\t\tthis.delay = delay;\n\t\treturn (T) this;\n\t}", "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "public void setDelay(int delay) {\n this.delay = delay;\n }", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "public void setDelay(long d){delay = d;}", "public DraggableBehavior setDelay(int delay)\n\t{\n\t\tthis.options.put(\"delay\", delay);\n\t\treturn this;\n\t}", "public void setDelay(org.apache.axis.types.UnsignedInt delay) {\n this.delay = delay;\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "private Flusher(final int delay) {\r\n\t\t\tthis.delay = Checks.assertPositive(delay) * MILLISECONDS_PER_SECOND;\r\n\t\t}", "public void setDelay(int delay) {\n\t\ttimer.setInitialDelay(delay);\n\t}", "public static void createDelay(int duration) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(duration);\r\n\t\t} catch(Exception e) {\r\n\t\t\t//do nothing\r\n\t\t}\r\n\t}", "public void setDelay(BigDecimal delay) {\r\n this.delay = delay;\r\n }", "public void setDelay(double clock);", "public Scheduling(Runnable runnable, long delay) {\n this.runnable = runnable;\n this.delay = delay;\n }", "public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime = new AlarmTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), \r\n\t\t\t\tcal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), message);\r\n\r\n\t\tSystem.out.println(delayTime.getHour());\r\n\t\tSystem.out.println(delayTime.getMinute());\r\n\r\n\t\talarmList.add(delayTime);\r\n\t\txmanager.write(delayTime);\r\n\t}", "public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "public void setDelay(float time)\n\t{\n\t\tdelayMax=time;\n\t}", "public void setStartDelay(long delay){\n if(delay < 0){\n delay = 0;\n }\n this.mStartDelay = delay;\n }", "public MessageTimer(String channel, String id, String message, long delay) {\n\t\tthis(channel, id, message, delay, \"REQUIRES_LIVE+\");\n\t}", "public AutonDelay(double timeout) {\n super(\"autonDelay\");\n setTimeout(timeout);\n }", "public long getDelay();", "public void setDelayTime(int delayTime)\n\t{\n\t\tthis.delayTime = delayTime;\n\t\tthis.updateTimer.setDelay(delayTime);\n\t}", "public double getDelay();", "protected Gate( String name, float delay ) {\n\tthis.name = name;\n\tthis.delay = delay;\n }", "public void setDelay(int delayValue)\r\n {\r\n\t timer.setDelay(delayValue);\r\n }", "public String scheduleAFixedDelayJob(Object instance,\n String methodName,\n Class<?>[] inputTypes,\n Object[] inputParams,\n long initialDelay,\n long taskDelay,\n TimeUnit timeUnit);", "public NaughtyModule(int period)\n\t{\n\t\tdelay = 2 * period;\n\t}", "public CUETrigger withParseLatency(@IntRange(from = 0) long delay) {\n final CUETrigger result = new CUETrigger();\n result.mode = getMode();\n result.latency = getLatency() + delay;\n result.noise = getNoise();\n result.indices = getIndices();\n result.power = getPower();\n result.numSymbols = getNumSymbols();\n result.rawCalib = getRawCalib();\n result.rawTrigger = getRawTrigger();\n result.winnerBinary = getWinnerBinary();\n result.winnerIndices = getWinnerIndices();\n return result;\n }", "public void start(int delayTime)\n\t{\n\t\tsetDelayTime(delayTime);\n\t\n\t\tstart();\n\t}", "public SimpleSandTimer(final TemporalAmount duration, final Supplier<Instant> now) {\n this(now.get().plus(duration), now);\n }", "private void delay(int delayTime){\n\t\ttry{\n\t\t\tThread.sleep(delayTime);\n\t\t}catch(InterruptedException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(e.toString());\n\t\t}\n\t}", "public void setDroneDelay(int delay)\r\n {\r\n droneDelay=delay;\r\n }", "public DynamicSchedule(TaskScheduler scheduler, Runnable task, int delay) {\n\t this.scheduler = scheduler;\n\t this.task = task;\n\t reset(delay);\n\t }", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "@JsonProperty(\"delay\")\n public void setDelay(Double delay) {\n this.delay = delay;\n }", "public void setDelayMove(float delay_)\n\t{\n\t\tdelayMove=delayMove+delay_;\n\t}", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "public static void sleep(int delay) {\n try {\n \t// int delay = (int)(Math.random()*maxDelay);\n Thread.sleep(delay);\n } catch (InterruptedException e) {}\n\t}", "public NotGate( String name, float delay ) {\n\tsuper( name, delay );\n }", "public UpdateTimer()\n\t\t{\n\t\t\tsuper(delayTime, null);\n\t\t\t\n\t\t\taddActionListener(this);\n\t\t}", "public void schedule(Runnable job, long delay, TimeUnit unit);", "public abstract int delay();", "public void schedule(String name, long initialDelay, long period, TimeUnit tunit) {\n\t\tschedule(name, period, period, tunit, opLevel);\n\t}", "long getInitialDelayInSeconds();", "public DelayData(AudioContext context, double delay,\r\n\t\t\tDataBeadReceiver receiver, DataBead db) {\r\n\t\tsuper(context, delay);\r\n\t\tthis.receiver = receiver;\r\n\t\tthis.dataBead = db;\r\n\t}", "public void autoStopForwardDelayTime(int delay) throws JposException;", "public LogicGate( String name, float delay ) {\n\tsuper( name, delay );\n }", "public ConstGate( String name, float delay ) {\n\tsuper( name, delay );\n }", "void setPaymentDelay(ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay paymentDelay);", "public native void setDelay(int delay) throws MagickException;", "public void setAutoResetDelay(int delay) {\n this.mAutoResetDelay = delay;\n }", "public void addDelay(int delay) {\n lastNeuron().addDelay(delay);\n }", "public int getDelayTime()\n\t{\n\t\treturn delayTime;\n\t}", "void schedule(long delay, TimeUnit unit) {\r\n\t\tthis.delay = delay;\r\n\t\tthis.unit = unit;\r\n\t\tif (monitor != null) {\r\n\t\t\tmonitor.cancel(false);\r\n\t\t\tmonitor = pool.scheduleWithFixedDelay(sync, delay, delay, unit);\r\n\t\t}\r\n\t}", "public int getDelay() {\r\n return delay;\r\n }", "public int getDelay()\r\n {\r\n return this.delay;\r\n }", "public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }", "public long getDelay()\n {\n return delay;\n }", "public MessageTimer(String channel, String id, String message, long delay, String flags) {\n\t\tthis.channel = channel;\n\t\tthis.timerID = id;\n\t\tthis.message = message;\n\t\tthis.delay = delay;\n\t\tthis.flags = flags;\n\t\tthis.flagsVals = parseFlags();\n\t\tif(timer == null) {\n\t\t\ttimer = new Timer(id, true);\n\t\t}\n\t\ttimer.schedule(this, delay * 1000, delay * 1000);\n\t}", "public AnimationFX setDelay(Duration value) {\n this.timeline.setDelay(value);\n return this;\n }", "public long getDelay() {\n return mDelay;\n }", "private void updateAutoTriggerDelay(long delay) {\n if (mAutoTriggerDelay != delay) {\n mAutoTriggerDelay = delay;\n updateReachabilityStatus();\n }\n }", "private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "protected MainDoorIntrusionPolicy(AlarmSystem alarmSystem, Communicator communicator, DelayTimer delayTimer) {\n super(alarmSystem);\n this.communicator = communicator;\n this.delayTimer = delayTimer;\n }", "String scheduleAConfigurableDelayJob(Object instance,\n String methodName,\n Class<?>[] inputTypes,\n Object[] inputParams,\n long initialDelay,\n String configurableDelayKeyName,\n TimeUnit timeUnit);", "public int getDelay() {\r\n\t\treturn delay;\r\n\t}", "public org.apache.axis.types.UnsignedInt getDelay() {\n return delay;\n }", "public int getDelay() {\n return delay;\n }", "public SimpleSandTimer(final Instant deadline, final Supplier<Instant> now) {\n this.deadline = deadline;\n this.now = now;\n }", "public void setMaxDelayTime(Long MaxDelayTime) {\n this.MaxDelayTime = MaxDelayTime;\n }", "@Override\n public void setExecutionDelayTime(double delayTime)\n {\n this.executionDelayTime = delayTime;\n }", "public static <T, U, V> Observable<T> delay(\r\n\t\t\t@Nonnull Observable<? extends T> source, \r\n\t\t\t@Nonnull Observable<U> registerDelay, \r\n\t\t\t@Nonnull Func1<? super T, ? extends Observable<V>> delaySelector) {\r\n\t\treturn new Delay.ByObservable<T, U, V>(source, registerDelay, delaySelector);\r\n\t}", "public static Ani from(Object theTarget, float theDuration, float theDelay, String theFieldName, float theEnd){\n\t\treturn addAni(true, theTarget, theDuration, theDelay, theFieldName, theEnd, defaultEasing, defaultTimeMode, theTarget, defaultCallback);\n\t}", "public int getDelay() {\n\t\treturn delay;\n\t}", "@Nonnull\r\n\tpublic static <T> Observable<T> delay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal long time,\r\n\t\t\t@Nonnull final TimeUnit unit,\r\n\t\t\t@Nonnull final Scheduler pool) {\r\n\t\treturn new Delay.ByTime<T>(source, time, unit, pool, true);\r\n\t}", "public void setNotificationDelay(long notificationDelay) {\n\t\tthis.notificationDelay = notificationDelay;\n\t}", "public void setStartDelay(long startDelay) {\n/* 211 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public S<T> delay(int time, String function){\n\t\t \n\t\t final String s =function;\n\t\t final Handler handler = new Handler();\n\t\t handler.postDelayed(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t callFun(s);\n\t\t }\n\t\t }, time);\n\t\t return this;\n\t\t \n\t }", "public MessageResponseAction(Message message, long delayInMs) {\n this.message = message;\n this.delayInMs = delayInMs;\n }", "public long getDelay() {\n return this.delay;\n }", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "@Nonnull\r\n\tpublic static <T> Observable<T> delay(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal long time,\r\n\t\t\t@Nonnull final TimeUnit unit) {\r\n\t\treturn delay(source, time, unit, scheduler());\r\n\t}", "public int getDelay()\n {\n return delay;\n }", "public BigDecimal getDelay() {\r\n return delay;\r\n }", "public static <T, U> Observable<T> delay(\r\n\t\t\t@Nonnull Observable<? extends T> source, \r\n\t\t\t@Nonnull Func1<? super T, ? extends Observable<U>> delaySelector) {\r\n\t\treturn delay(source, null, delaySelector);\r\n\t}", "public static void delay() {\n\n long ONE_SECOND = 1_000;\n\n try {\n Thread.sleep(ONE_SECOND);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public AllpassFilter setDelay(UGen del) {\r\n\t\tif (del == null) {\r\n\t\t\tsetDelay(delay);\r\n\t\t} else {\r\n\t\t\tdelayUGen = del;\r\n\t\t\tdel.update();\r\n\t\t\tif ((delay = (int) del.getValue()) < 0) {\r\n\t\t\t\tdelay = 0;\r\n\t\t\t} else if (delay > maxDelay) {\r\n\t\t\t\tdelay = maxDelay;\r\n\t\t\t}\r\n\t\t\tisDelayStatic = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t}", "public OrGate( String name, float delay ) {\n\tsuper( name, delay );\n }", "public void autoStopBackwardDelayTime(int delay) throws JposException;", "public void setDelayedTimeout(int seconds);", "@Override\n public native void setAutoDelay(int ms);", "public float getDelay()\n\t{\n\t\treturn delay;\n\t}", "public SimpleSandTimer(final TemporalAmount duration) {\n this(duration, Instant::now);\n }", "@Test\n public void testDelay() {\n long future = System.currentTimeMillis() + (rc.getRetryDelay() * 1000L);\n\n rc.delay();\n\n assertTrue(System.currentTimeMillis() >= future);\n }", "public CheckDownloadImageTaskDelay(CheckDownloadImageCallbackDelay callback, long delayTime){\n this.checkDelay = callback;\n this.delayTime = delayTime;\n }", "public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public int getDelayedTimeout();" ]
[ "0.69936246", "0.6815893", "0.681308", "0.67156726", "0.66570514", "0.6611817", "0.6592031", "0.65307385", "0.6522355", "0.64032733", "0.6362342", "0.63609475", "0.6315806", "0.6300559", "0.6297515", "0.6238388", "0.62365353", "0.62223715", "0.61834055", "0.6161507", "0.61402017", "0.61364037", "0.6069683", "0.6001202", "0.5982189", "0.5975217", "0.5956919", "0.5942704", "0.5940595", "0.5917645", "0.5886781", "0.5841301", "0.58172745", "0.5816322", "0.5787304", "0.5773683", "0.57712704", "0.5730913", "0.5721939", "0.57083213", "0.5705286", "0.5665362", "0.5660113", "0.564533", "0.56423515", "0.56290823", "0.56074214", "0.5587751", "0.5584846", "0.55811805", "0.55420595", "0.5510578", "0.55028945", "0.5502241", "0.54943985", "0.5492823", "0.549181", "0.548923", "0.5488172", "0.5484325", "0.5484083", "0.54811263", "0.54721445", "0.54506856", "0.5447403", "0.54450226", "0.5443925", "0.54406226", "0.54367965", "0.54283446", "0.5417752", "0.5407053", "0.5403019", "0.53870726", "0.5383935", "0.53714794", "0.53647083", "0.53575814", "0.53522885", "0.535194", "0.53496313", "0.53280103", "0.5327039", "0.53253806", "0.5322849", "0.53102857", "0.5306094", "0.5304898", "0.5300917", "0.5298404", "0.5296254", "0.5287518", "0.528422", "0.5273845", "0.5271976", "0.5266026", "0.52572536", "0.52563965", "0.525207", "0.52433324" ]
0.78495497
0
Creates a new delay with a specified trigger time and repetition count. This delay will cease to function when the amount of triggers has exceeded the repeat count.
public Delay(float delay, int repeat) { setDelay(delay); delayCount=0f; repeatMax=repeat; repeatCount=0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T repeat(int count, float delay)\n\t{\n\t\tif (isStarted())\n\t\t{\n\t\t\tLttl.Throw(\"You can't change the repetitions of a tween or timeline once it is started\");\n\t\t}\n\t\tif (delay < 0)\n\t\t{\n\t\t\tLttl.Throw(\"Repeat delay can't be negative\");\n\t\t}\n\t\trepeatCnt = count;\n\t\tthis.repeatDelay = delay;\n\t\tisYoyo = false;\n\t\treturn (T) this;\n\t}", "public Trigger createTrigger(ConfigProperties cprop){\n\t\tint repeat;\n\t\tlong interval;\n\t\tCalendar sd = calculateStartTime(cprop);\n\t\tCalendar ed = calculateEndTime(cprop);\n\t\tString name = cprop.getProperty(\"PROJ.name\");\n\n\t\tString rstr = cprop.getProperty(\"TIME.repeat\");\n\t\tString istr = cprop.getProperty(\"TIME.interval\");\n\t\tString fstr = cprop.getProperty(\"TIME.frequency\");\n\n\t\t//repeat this many times or forever\n\t\tif(rstr!=null)\n\t\t\trepeat = Integer.parseInt(rstr);\n\t\telse\n\t\t\trepeat = SimpleTrigger.REPEAT_INDEFINITELY;\n\n\t\t//repeat every interval milliseconds or daily\n\t\t//interval overrides frequency\n\t\tif(istr!=null)\n\t\t\tinterval = Long.parseLong(istr);\n\t\telse if (fstr!=null)\n\t\t\tinterval = ONE_DAY/Long.parseLong(fstr);\n\t\telse\n\t\t\tinterval = ONE_DAY;\n\n\t\tjlog.info(\"Create Trigger n=\"+name+\" sd=\"+sd.getTime()+\" ed=\"+ed.getTime()+\" r=\"+repeat+\" i=\"+interval);\n\n\t\tTrigger trigger = new SimpleTrigger(name, null,sd.getTime(),ed.getTime(),repeat,interval);\n\t\ttrigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT);\n\t\treturn trigger;\n\n\n\t}", "public T repeatYoyo(int count, float delay)\n\t{\n\t\tif (isStarted())\n\t\t{\n\t\t\tLttl.Throw(\"You can't change the repetitions of a tween or timeline once it is started\");\n\t\t}\n\t\tif (delay < 0)\n\t\t{\n\t\t\tLttl.Throw(\"Repeat delay can't be negative\");\n\t\t}\n\t\trepeatCnt = count;\n\t\trepeatDelay = delay;\n\t\tisYoyo = true;\n\t\treturn (T) this;\n\t}", "public Builder setRepeatCount(int value) {\n\n repeatCount_ = value;\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "CompositionBuilder<T> setRepeat1(int repeats);", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "long getRepeatIntervalPref();", "@IntRange(from = 0L) long interval(int retryCount, long elapsedTime);", "public static void createDelay(int duration) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(duration);\r\n\t\t} catch(Exception e) {\r\n\t\t\t//do nothing\r\n\t\t}\r\n\t}", "CompositionBuilder<T> setRepeat2(int repeats, int startrep, int endrep);", "public static String repeatTextNTimes(int nTimes, String text) {\n return String.join(EMPTY, nCopies(nTimes, text));\n }", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "void addRepeat(int beatNum, RepeatType repeatType);", "public Delay(float delay)\n\t{\n\t\tthis(delay,0);\n\t}", "public float getRepeatDelay()\n\t{\n\t\treturn repeatDelay;\n\t}", "public PayloadBuilderSet[] generateRepeatingPayload() {\n\t\tPayloadBuilderSet[] updatedPayloadList = new PayloadBuilderSet[(int)getNumberOfPayloadRepetitions()];\n\n\t\tSystem.arraycopy(sets, 0, updatedPayloadList, 0, sets.length); //keep the original payloads, and put them into the updated list\n\n\t\t// create the repetitions for each of the payloadSets within the workload, and put them into the updatedList of payloads\n\t\tfor (int i = sets.length; i<updatedPayloadList.length; i++) {\n\t\t\t\n\t\t\tint setNumber = getRemainder(i, sets.length);\n\t\t\tint sequenceNumber = i/sets.length;\n\t\t\tint scalarValue = sequenceNumber * (int)workloadConfiguration.getRepetitionDelay();\n\t\t\tupdatedPayloadList[i] = sets[setNumber].generateSet(scalarValue);\n\t\t}\n\n\t\treturn updatedPayloadList;\n\t}", "@BackpressureSupport(BackpressureKind.FULL)\n @SchedulerSupport(SchedulerKind.NONE)\n public final Observable<T> retry(long times, Predicate<? super Throwable> predicate) {\n if (times < 0) {\n throw new IllegalArgumentException(\"times >= 0 required but it was \" + times);\n }\n Objects.requireNonNull(predicate, \"predicate is null\");\n\n return create(new PublisherRetryPredicate<T>(this, times, predicate));\n }", "public int getDelayedTimeout();", "public void Repeat(boolean repeat);", "public GIFMaker withDelay(int delay);", "public Builder clearRepeatCount() {\n bitField0_ = (bitField0_ & ~0x00000004);\n repeatCount_ = 0;\n onChanged();\n return this;\n }", "long getInitialDelayInSeconds();", "int getRepeatCount();", "private void createAlarm(long backoffTimeMs) {\n Log.d(TAG, \"Scheduling registration retry, backoff = \" + backoffTimeMs);\n Intent retryIntent = new Intent(C2DM_RETRY);\n PendingIntent retryPIntent = PendingIntent.getBroadcast(context, 0, retryIntent, 0);\n AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n am.set(AlarmManager.ELAPSED_REALTIME, backoffTimeMs, retryPIntent);\n }", "public void setMaxDelayTime(Long MaxDelayTime) {\n this.MaxDelayTime = MaxDelayTime;\n }", "private Duration calculateRetryDelay(int backoffCount) {\n long delayWithJitterInNanos = ThreadLocalRandom.current()\n .nextLong((long) (throttlingDelay.toNanos() * (1 - JITTER_FACTOR)),\n (long) (throttlingDelay.toNanos() * (1 + JITTER_FACTOR)));\n\n return Duration.ofNanos(Math.min((1L << backoffCount) * delayWithJitterInNanos, maxThrottlingDelay.toNanos()));\n }", "public void setDelay(float time)\n\t{\n\t\tdelayMax=time;\n\t}", "@Test\n public void repeatingTask_changeRepeatPeriod_nextWeekDate() {\n LocalDate testDate = LocalDateTime.now().minusWeeks(1).minusDays(1).toLocalDate();\n LocalTime testTime = LocalTime.of(8, 30);\n LocalDateTime testDateTime = LocalDateTime.of(testDate, testTime);\n Event testEvent = new Event(\"8 days ago\", \"CS2113T\", testDateTime, testDateTime.plusHours(4),\n \"testing\");\n testTaskList.addTask(testEvent);\n // Set to 1w\n RepeatCommand testRepeatCommand = new RepeatCommand(2, 1, RepeatCommand.WEEKLY_ICON);\n testRepeatCommand.execute(testTaskList, testUi);\n RepeatEvent repeatEvent = (RepeatEvent) testTaskList.getTask(2);\n // Set to 1d\n testRepeatCommand = new RepeatCommand(2, 1, RepeatCommand.DAILY_ICON);\n testRepeatCommand.execute(testTaskList, testUi);\n repeatEvent = (RepeatEvent) testTaskList.getTask(2);\n\n assertEquals(repeatEvent.getPeriodCounter(), 0);\n assertEquals(repeatEvent.getNextDateTime(), LocalDateTime.of(LocalDate.now().plusWeeks(1), testTime));\n }", "@Nonnull\r\n\tpublic static <T> Observable<T> repeat(\r\n\t\t\t@Nonnull final Func0<? extends T> func,\r\n\t\t\tfinal int count) {\r\n\t\treturn repeat(func, count, scheduler());\r\n\t}", "private void reschedule(long delayMillis) {\n if (timeout != NULL_TIMEOUT) {\n timeout.cancel();\n }\n\n if (idleTimeMillis != 0) {\n timeout = timer.newTimeout(this, delayMillis, MILLISECONDS);\n }\n else {\n timeout = NULL_TIMEOUT;\n }\n }", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "RepeatStatement createRepeatStatement();", "public Duration scheduleWithDelay(Runnable connectTast) {\n Duration delaySinceLastSchedule = Duration.between(lastSchedule, Instant.now());\n if (retrySequence.getMaxDelay().multipliedBy(2).minus(delaySinceLastSchedule).isNegative()) {\n // yes\n lastDelay = Duration.ZERO;\n } else {\n // no\n lastDelay = retrySequence.nextDelay(lastDelay)\n .orElseThrow(() -> new RuntimeException(\"may retries reached\"));\n }\n \n lastSchedule = Instant.now();\n ScheduledExceutor.common().schedule(connectTast, lastDelay.toMillis(), TimeUnit.MILLISECONDS);\n \n return lastDelay;\n }", "public void setDelay(long d){delay = d;}", "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "public Action restrictDuration(long durationMillis) {\n // If we start after the duration, then we just won't run.\n if (mStartOffset > durationMillis) {\n mStartOffset = durationMillis;\n mDuration = 0;\n mRepeatCount = 0;\n return this;\n }\n \n long dur = mDuration + mStartOffset;\n if (dur > durationMillis) {\n mDuration = durationMillis-mStartOffset;\n dur = durationMillis;\n }\n // If the duration is 0 or less, then we won't run.\n if (mDuration <= 0) {\n mDuration = 0;\n mRepeatCount = 0;\n return this;\n }\n // Reduce the number of repeats to keep below the maximum duration.\n // The comparison between mRepeatCount and duration is to catch\n // overflows after multiplying them.\n if (mRepeatCount < 0 || mRepeatCount > durationMillis\n || (dur*mRepeatCount) > durationMillis) {\n // Figure out how many times to do the action. Subtract 1 since\n // repeat count is the number of times to repeat so 0 runs once.\n mRepeatCount = (int)(durationMillis/dur) - 1;\n if (mRepeatCount < 0) {\n mRepeatCount = 0;\n }\n }\n return this;\n }", "public static ActionListener clock() {\n\n\t\tActionListener action = new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\trepetitions++;\n\t\t\t\tif((repetitions%(new Integer(getConfiguration().getTiempo())/timerRepeater))==0){\n\t\t\t\t\tFileUtils.createDailyReport(getConfiguration());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t};\n\n\t\treturn action;\n\n\t}", "@Nonnull\r\n\tpublic static <T> Observable<T> repeat(\r\n\t\t\tfinal T value,\r\n\t\t\tfinal int count) {\r\n\t\treturn repeat(value, count, scheduler());\r\n\t}", "public void setDelay(int delay) {\n this.delay = delay;\n }", "int getMaximumDelay();", "public NaughtyModule(int period)\n\t{\n\t\tdelay = 2 * period;\n\t}", "public void setDelayedTimeout(int seconds);", "public int getRepeatInterval()\n {\n if (isRepeated()) return repeat;\n else return 0;\n }", "@Nonnull\r\n\tpublic static <T> Observable<T> repeat(\r\n\t\t\t@Nonnull Observable<? extends T> source,\r\n\t\t\tfinal int count) {\r\n\t\tif (count > 0) {\r\n\t\t\tPred0 condition = new Pred0() {\r\n\t\t\t\t/** Repeat counter. */\r\n\t\t\t\tint i = count - 1;\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic Boolean invoke() {\r\n\t\t\t\t\treturn i-- > 0;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\treturn doWhile(source, condition);\r\n\t\t}\r\n\t\treturn empty();\r\n\t}", "public void setDelay(int delay) {\n\t\ttimer.setInitialDelay(delay);\n\t}", "public void setDelay(double clock);", "@Test\n public void testDelay() {\n long future = System.currentTimeMillis() + (rc.getRetryDelay() * 1000L);\n\n rc.delay();\n\n assertTrue(System.currentTimeMillis() >= future);\n }", "private void updateAutoTriggerDelay(long delay) {\n if (mAutoTriggerDelay != delay) {\n mAutoTriggerDelay = delay;\n updateReachabilityStatus();\n }\n }", "private static long computeSleepTimeMillis(int retryCount, long baseSleepTimeMillis, long maxSleepMillis)\n {\n long baseTime = baseSleepTimeMillis * (1L << retryCount);\n // its possible that this overflows, so fall back to max;\n if (baseTime <= 0)\n {\n baseTime = maxSleepMillis;\n }\n // now make sure this is capped to target max\n baseTime = Math.min(baseTime, maxSleepMillis);\n\n return (long) (baseTime * (ThreadLocalRandom.current().nextDouble() + 0.5));\n }", "public MovingRunner(int x, int y, int repeat, JComponent component) {\n super(x, y);\n this.repeat = repeat;\n this.component = component;\n delay = ((int) (Math.random() * 2000) + 1000) / MAX_FRAMES;\n }", "int getAbsoluteMaximumDelay();", "public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }", "public DraggableBehavior setDelay(int delay)\n\t{\n\t\tthis.options.put(\"delay\", delay);\n\t\treturn this;\n\t}", "public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime = new AlarmTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), \r\n\t\t\t\tcal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), message);\r\n\r\n\t\tSystem.out.println(delayTime.getHour());\r\n\t\tSystem.out.println(delayTime.getMinute());\r\n\r\n\t\talarmList.add(delayTime);\r\n\t\txmanager.write(delayTime);\r\n\t}", "@Nonnull\r\n\tpublic static <T> Observable<T> retry(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal int count) {\r\n\t\treturn new Resume.RetryCount<T>(source, count);\r\n\t}", "@Override\n\tpublic int withRepeatCount() {\n\t\treturn 0;\n\t}", "@SuppressWarnings(\"LambdaLast\")\n public RetryOptions(@Nullable final IShouldRetry shouldRetry, int maxRetries, long delay) {\n if(delay > MAX_DELAY)\n throw new IllegalArgumentException(\"Delay cannot exceed \" + MAX_DELAY);\n if(delay < 0)\n throw new IllegalArgumentException(\"Delay cannot be negative\");\n if(maxRetries > MAX_RETRIES)\n throw new IllegalArgumentException(\"Max retries cannot exceed \" + MAX_RETRIES);\n if(maxRetries < 0)\n throw new IllegalArgumentException(\"Max retries cannot be negative\");\n\n this.mShouldretry = shouldRetry == null ? DEFAULT_SHOULD_RETRY : shouldRetry;\n this.mMaxRetries = maxRetries;\n this.mDelay = delay;\n }", "public void setAutoResetDelay(int delay) {\n this.mAutoResetDelay = delay;\n }", "public Builder numberOfRetries(int numberOfRetries) {\r\n configurationBuilder.numberOfRetries(numberOfRetries);\r\n return this;\r\n }", "public AutonDelay(double timeout) {\n super(\"autonDelay\");\n setTimeout(timeout);\n }", "public DynamicSchedule(TaskScheduler scheduler, Runnable task, int delay) {\n\t this.scheduler = scheduler;\n\t this.task = task;\n\t reset(delay);\n\t }", "public void makeTimer(){\n\t\n\t\tframeIndex = 0;\n\t\n\t\t//Create a new interpolator\n\t\tInterpolator lint = new Interpolator();\n\t\n\t\t//interpolate between all of the key frames in the list to fill the array\n\t\tframes = lint.makeFrames(keyFrameList);\n\t\n\t\t//timer delay is set in milliseconds, so 1000/fps gives delay per frame\n\t\tint delay = 1000/fps; \n\t\n\t\n\t\tActionListener taskPerformer = new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tif(frameIndex == frames.length){ frameIndex = 0;}\n\n\t\t\t\tframes[frameIndex].display();\n\t\t\t\tframes[frameIndex].clearDisplay();\n\t\t\t\tframeIndex++;\n\t\t\t}\n\t\t};\n\n\t\ttimer = new Timer(delay, taskPerformer);\t\n\t}", "private void stressTest() {\n\t\t\n\t\tTimerTask task = new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tint count = 1;\n\t\t\t\tint len = 100;\n\t\t\t\tint maxCount = 1000000;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Start stress test...\");\n\t\t\t\twhile (count <= maxCount) {\n\t\t\t\t\t\n\t\t\t\t\tif ((count % 1000) == 0) {\n\t\t\t\t\t\tSystem.out.println(\"Count: \" + count + \" of \" + maxCount);\n\t\t\t\t\t\tSystem.gc();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlong larray[] = new long[len];\n\t\t\t\t\t\n\t\t\t\t\tlarray[0] = count;\n\t\t\t\t\tlarray[len-1] = count;\n\t\t\t\t\t\n\t\t\t\t\tMessage message = Message.createMessage(getId(), \"Triggers\");\n\t\t\t\t\tmessage.setPayload(larray);\n\t\t\t\t\tsend(message);\n\n\t\t\t\t\t\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tThread.sleep(25);\n//\t\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t}\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Done.\");\n\n\t\t\t}\n\n\t\t};\n\n\t\tTimer timer = new Timer();\n\t\t// one time schedule\n\t\ttimer.schedule(task, 2000L);\n\t}", "public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }", "public void incrementDelayCounter() {\n\t\tthis.delayCounter++;\n\t}", "public void createRepeatingPayloads(){\n\t\tthis.sets = generateRepeatingPayload();\n\t}", "public long getDelay();", "public void setRepeatInterval(Long repeatInterval) {\n\t\tthis.repeatInterval = repeatInterval;\n\t}", "public Builder setUpdateTriggerTime(int value) {\n copyOnWrite();\n instance.setUpdateTriggerTime(value);\n return this;\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public void autoStopForwardDelayTime(int delay) throws JposException;", "public abstract int delay();", "public void setDelayTime(int delayTime)\n\t{\n\t\tthis.delayTime = delayTime;\n\t\tthis.updateTimer.setDelay(delayTime);\n\t}", "public static String repeat(String str, int count) {\n\t\tfinal StringBuilder result = new StringBuilder();\n\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tresult.append(str);\n\t\t}\n\t\t\n\t\treturn result.toString();\n\t}", "private static int randomCycleCap() {\n int newValue = 0;\n int iterations = 3;\n Random bombRandGen = new Random();\n\n for (int i = 0; i <= iterations; i++) {\n newValue += bombRandGen.nextInt(4);\n }\n\n return newValue;\n }", "private static void timerTest2() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (count < 5) {\n\t\t\t\t\tSystem.out.println(\"timertest2\" + \" \" + ++count);\n\t\t\t\t} else {\n\t\t\t\t\ttimer.cancel();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 2000, 1000);\n\n\t}", "public void setRetryDelay(long retryDelay) {\n this.retryDelay = retryDelay;\n }", "public void setDelay(int delayValue)\r\n {\r\n\t timer.setDelay(delayValue);\r\n }", "public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void spawnInvincibilityPickup() {\n\n Random random = new Random();\n\n invincibilityTimer.cancel();\n invincibilityTimer.purge();\n invincibilityTimer = new Timer();\n invincibilityTimer.schedule(\n new TimerTask() {\n @Override\n public void run() {\n Pickup pickup = new InvincibilityPickup(canvas);\n pickup.spawn();\n activePickups.add(pickup);\n spawnInvincibilityPickup();\n }\n }, (random.nextInt(INVINCIBILITY_MAX_SPAWN_TIME - INVINCIBILITY_MIN_SPAWN_TIME) + INVINCIBILITY_MIN_SPAWN_TIME));\n }", "public void createDelayNotification (Invite inv) {\n Notification notification = new Notification();\n notification.setRelatedEvent(inv.getEvent());\n notification.setNotificatedUser(inv.getUser());\n notification.setSeen(false);\n notification.setType(NotificationType.delayedEvent);\n notification.setGenerationDate(new Date());\n em.persist(notification);\n \n \n }", "String getDelayPattern();", "public String scheduleAFixedDelayJob(Object instance,\n String methodName,\n Class<?>[] inputTypes,\n Object[] inputParams,\n long initialDelay,\n long taskDelay,\n TimeUnit timeUnit);", "public Task(String title, int start, int end, int repeat)\n {\n try\n {\n check(start, end, repeat);\n\n setTitle(title);\n\n if(repeat == 0)\n {\n setTime(start);\n }\n else\n {\n setTime(start, end, repeat);\n }\n\n setActive(false);\n }\n catch (IllegalArgumentException e)\n {\n System.out.println(\"Incorrect data for a repeated tasks\");\n throw e;\n }\n\n }", "void restartEventsWithDelay(final boolean longDelay, final boolean alsoRescan, final boolean unblockEventsRun,\n final int logType)\n {\n if (longDelay) {\n\n Data workData = new Data.Builder()\n .putBoolean(PhoneProfilesService.EXTRA_ALSO_RESCAN, alsoRescan)\n .putBoolean(PhoneProfilesService.EXTRA_UNBLOCK_EVENTS_RUN, unblockEventsRun)\n .putInt(PhoneProfilesService.EXTRA_LOG_TYPE, logType)\n .build();\n\n OneTimeWorkRequest restartEventsWithDelayWorker;\n restartEventsWithDelayWorker =\n new OneTimeWorkRequest.Builder(RestartEventsWithDelayWorker.class)\n .addTag(RestartEventsWithDelayWorker.WORK_TAG_2)\n .setInputData(workData)\n .setInitialDelay(15, TimeUnit.SECONDS)\n .build();\n try {\n if (PPApplicationStatic.getApplicationStarted(true, true)) {\n WorkManager workManager = PPApplication.getWorkManagerInstance();\n if (workManager != null) {\n\n// //if (PPApplicationStatic.logEnabled()) {\n// ListenableFuture<List<WorkInfo>> statuses;\n// statuses = workManager.getWorkInfosForUniqueWork(RestartEventsWithDelayWorker.WORK_TAG);\n// try {\n// List<WorkInfo> workInfoList = statuses.get();\n// } catch (Exception ignored) {\n// }\n// //}\n\n// PPApplicationStatic.logE(\"[WORKER_CALL] DataWrapper.restartEventsWithDelay\", \"xxx\");\n //workManager.enqueue(restartEventsWithDelayWorker);\n //if (replace)\n workManager.enqueueUniqueWork(RestartEventsWithDelayWorker.WORK_TAG_2, ExistingWorkPolicy.REPLACE, restartEventsWithDelayWorker);\n //else\n // workManager.enqueueUniqueWork(RestartEventsWithDelayWorker.WORK_TAG_APPEND, ExistingWorkPolicy.APPEND_OR_REPLACE, restartEventsWithDelayWorker);\n }\n }\n } catch (Exception e) {\n PPApplicationStatic.recordException(e);\n }\n } else {\n// PPApplicationStatic.logE(\"[EXECUTOR_CALL] ***** DataWrapper.restartEventsWithDelay\", \"schedule\");\n\n final Context appContext = context.getApplicationContext();\n //final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();\n Runnable runnable = () -> {\n// long start = System.currentTimeMillis();\n// PPApplicationStatic.logE(\"[IN_EXECUTOR] ***** DataWrapper.restartEventsWithDelay\", \"--------------- START\");\n\n PowerManager powerManager = (PowerManager) appContext.getSystemService(Context.POWER_SERVICE);\n PowerManager.WakeLock wakeLock = null;\n try {\n if (powerManager != null) {\n wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, PPApplication.PACKAGE_NAME + \":DataWrapper_restartEventsWithDelay\");\n wakeLock.acquire(10 * 60 * 1000);\n }\n\n //PPExecutors.doRestartEventsWithDelay(alsoRescan, unblockEventsRun, logType, context);\n\n DataWrapper dataWrapper = new DataWrapper(appContext, false, 0, false, 0, 0, 0f);\n if (logType != PPApplication.ALTYPE_UNDEFINED)\n PPApplicationStatic.addActivityLog(appContext, logType, null, null, \"\");\n //dataWrapper.restartEvents(unblockEventsRun, true, true, false);\n dataWrapper.restartEventsWithRescan(alsoRescan, unblockEventsRun, false, false, true, false);\n //dataWrapper.invalidateDataWrapper();\n\n\n// long finish = System.currentTimeMillis();\n// long timeElapsed = finish - start;\n// PPApplicationStatic.logE(\"[IN_EXECUTOR] ***** DataWrapper.restartEventsWithDelay\", \"--------------- END - timeElapsed=\"+timeElapsed);\n } catch (Exception e) {\n// PPApplicationStatic.logE(\"[IN_EXECUTOR] PPApplication.startHandlerThread\", Log.getStackTraceString(e));\n PPApplicationStatic.recordException(e);\n } finally {\n if ((wakeLock != null) && wakeLock.isHeld()) {\n try {\n wakeLock.release();\n } catch (Exception ignored) {\n }\n }\n //worker.shutdown();\n }\n };\n PPApplicationStatic.createDelayedEventsHandlerExecutor();\n PPApplication.delayedEventsHandlerExecutor.schedule(runnable, 5, TimeUnit.SECONDS);\n }\n }", "@Nonnull\r\n\tpublic static <T> Observable<T> repeat(\r\n\t\t\tfinal T value,\r\n\t\t\tfinal int count,\r\n\t\t\t@Nonnull final Scheduler pool) {\r\n\t\treturn repeat(Functions.constant0(value), count, pool);\r\n\t}", "public T setDelay(float delay)\n\t{\n\t\tthis.delay = delay;\n\t\treturn (T) this;\n\t}", "public S<T> delay(int time, String function){\n\t\t \n\t\t final String s =function;\n\t\t final Handler handler = new Handler();\n\t\t handler.postDelayed(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t callFun(s);\n\t\t }\n\t\t }, time);\n\t\t return this;\n\t\t \n\t }", "public abstract long retryAfter();", "public void setRepeat(boolean repeat) {\n this.repeat = repeat;\n }", "public TestTask buildRecurringTask(RecurringType type, int recurringPeriod) throws IllegalValueException {\n builder = new TaskBuilder();\n return builder.withName(\"recurring\").withStartDate(\"11 oct 2016 11pm\").withEndDate(\"12 oct 2016 11pm\")\n .withRecurringType(type).withRecurringPeriod(recurringPeriod - RECURRING_PERIOD_OFFSET).build();\n }", "public void setDelay(org.apache.axis.types.UnsignedInt delay) {\n this.delay = delay;\n }", "private void trigger() {\n\t\t\tif (repeatState == REPEAT_ADD) {\n\t\t\t\tadd();\n\t\t\t}\n\t\t\tif (repeatState == REPEAT_SUBTRACT) {\n\t\t\t\tsubtract();\n\t\t\t}\n\t\t}", "public EventTime(float interval, boolean repeat) {\n\t\tthis.timer = new Timer(interval);\n\t\tthis.repeat = repeat;\n\t}", "public static void sleep(int delay) {\n try {\n \t// int delay = (int)(Math.random()*maxDelay);\n Thread.sleep(delay);\n } catch (InterruptedException e) {}\n\t}", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "public final flipsParser.repeat_return repeat() throws RecognitionException {\n flipsParser.repeat_return retval = new flipsParser.repeat_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token string_literal78=null;\n Token string_literal79=null;\n Token string_literal81=null;\n Token string_literal82=null;\n Token string_literal83=null;\n Token string_literal86=null;\n flipsParser.statement_return statement80 = null;\n\n flipsParser.repeatCondition_return repeatCondition84 = null;\n\n flipsParser.statement_return statement85 = null;\n\n\n CommonTree string_literal78_tree=null;\n CommonTree string_literal79_tree=null;\n CommonTree string_literal81_tree=null;\n CommonTree string_literal82_tree=null;\n CommonTree string_literal83_tree=null;\n CommonTree string_literal86_tree=null;\n RewriteRuleTokenStream stream_138=new RewriteRuleTokenStream(adaptor,\"token 138\");\n RewriteRuleTokenStream stream_136=new RewriteRuleTokenStream(adaptor,\"token 136\");\n RewriteRuleTokenStream stream_137=new RewriteRuleTokenStream(adaptor,\"token 137\");\n RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,\"rule statement\");\n RewriteRuleSubtreeStream stream_repeatCondition=new RewriteRuleSubtreeStream(adaptor,\"rule repeatCondition\");\n try {\n // flips.g:204:2: ( ( 'rpt' | 'repeat' ) ( statement )* 'end' -> ^( REPEAT ^( CONDITION FOREVER ) ^( EXECUTE ( statement )* ) ) | ( 'rpt' | 'repeat' ) repeatCondition ( statement )* 'end' -> ^( REPEAT ^( CONDITION repeatCondition ) ^( EXECUTE ( statement )* ) ) )\n int alt34=2;\n int LA34_0 = input.LA(1);\n\n if ( (LA34_0==136) ) {\n int LA34_1 = input.LA(2);\n\n if ( (LA34_1==For||(LA34_1>=BinaryLiteral && LA34_1<=HexLiteral)||LA34_1==142) ) {\n alt34=2;\n }\n else if ( (LA34_1==Identifier||(LA34_1>=136 && LA34_1<=138)||(LA34_1>=143 && LA34_1<=148)) ) {\n alt34=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 34, 1, input);\n\n throw nvae;\n }\n }\n else if ( (LA34_0==137) ) {\n int LA34_2 = input.LA(2);\n\n if ( (LA34_2==For||(LA34_2>=BinaryLiteral && LA34_2<=HexLiteral)||LA34_2==142) ) {\n alt34=2;\n }\n else if ( (LA34_2==Identifier||(LA34_2>=136 && LA34_2<=138)||(LA34_2>=143 && LA34_2<=148)) ) {\n alt34=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 34, 2, input);\n\n throw nvae;\n }\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 34, 0, input);\n\n throw nvae;\n }\n switch (alt34) {\n case 1 :\n // flips.g:204:4: ( 'rpt' | 'repeat' ) ( statement )* 'end'\n {\n // flips.g:204:4: ( 'rpt' | 'repeat' )\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==136) ) {\n alt30=1;\n }\n else if ( (LA30_0==137) ) {\n alt30=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 30, 0, input);\n\n throw nvae;\n }\n switch (alt30) {\n case 1 :\n // flips.g:204:5: 'rpt'\n {\n string_literal78=(Token)match(input,136,FOLLOW_136_in_repeat1007); \n stream_136.add(string_literal78);\n\n\n }\n break;\n case 2 :\n // flips.g:204:11: 'repeat'\n {\n string_literal79=(Token)match(input,137,FOLLOW_137_in_repeat1009); \n stream_137.add(string_literal79);\n\n\n }\n break;\n\n }\n\n // flips.g:204:21: ( statement )*\n loop31:\n do {\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0==Identifier||(LA31_0>=136 && LA31_0<=137)||(LA31_0>=143 && LA31_0<=148)) ) {\n alt31=1;\n }\n\n\n switch (alt31) {\n \tcase 1 :\n \t // flips.g:204:21: statement\n \t {\n \t pushFollow(FOLLOW_statement_in_repeat1012);\n \t statement80=statement();\n\n \t state._fsp--;\n\n \t stream_statement.add(statement80.getTree());\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop31;\n }\n } while (true);\n\n string_literal81=(Token)match(input,138,FOLLOW_138_in_repeat1015); \n stream_138.add(string_literal81);\n\n\n\n // AST REWRITE\n // elements: statement\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 // 205:2: -> ^( REPEAT ^( CONDITION FOREVER ) ^( EXECUTE ( statement )* ) )\n {\n // flips.g:205:5: ^( REPEAT ^( CONDITION FOREVER ) ^( EXECUTE ( statement )* ) )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REPEAT, \"REPEAT\"), root_1);\n\n // flips.g:205:14: ^( CONDITION FOREVER )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CONDITION, \"CONDITION\"), root_2);\n\n adaptor.addChild(root_2, (CommonTree)adaptor.create(FOREVER, \"FOREVER\"));\n\n adaptor.addChild(root_1, root_2);\n }\n // flips.g:205:35: ^( EXECUTE ( statement )* )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EXECUTE, \"EXECUTE\"), root_2);\n\n // flips.g:205:45: ( statement )*\n while ( stream_statement.hasNext() ) {\n adaptor.addChild(root_2, stream_statement.nextTree());\n\n }\n stream_statement.reset();\n\n adaptor.addChild(root_1, root_2);\n }\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:206:4: ( 'rpt' | 'repeat' ) repeatCondition ( statement )* 'end'\n {\n // flips.g:206:4: ( 'rpt' | 'repeat' )\n int alt32=2;\n int LA32_0 = input.LA(1);\n\n if ( (LA32_0==136) ) {\n alt32=1;\n }\n else if ( (LA32_0==137) ) {\n alt32=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 32, 0, input);\n\n throw nvae;\n }\n switch (alt32) {\n case 1 :\n // flips.g:206:5: 'rpt'\n {\n string_literal82=(Token)match(input,136,FOLLOW_136_in_repeat1041); \n stream_136.add(string_literal82);\n\n\n }\n break;\n case 2 :\n // flips.g:206:11: 'repeat'\n {\n string_literal83=(Token)match(input,137,FOLLOW_137_in_repeat1043); \n stream_137.add(string_literal83);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_repeatCondition_in_repeat1046);\n repeatCondition84=repeatCondition();\n\n state._fsp--;\n\n stream_repeatCondition.add(repeatCondition84.getTree());\n // flips.g:206:37: ( statement )*\n loop33:\n do {\n int alt33=2;\n int LA33_0 = input.LA(1);\n\n if ( (LA33_0==Identifier||(LA33_0>=136 && LA33_0<=137)||(LA33_0>=143 && LA33_0<=148)) ) {\n alt33=1;\n }\n\n\n switch (alt33) {\n \tcase 1 :\n \t // flips.g:206:37: statement\n \t {\n \t pushFollow(FOLLOW_statement_in_repeat1048);\n \t statement85=statement();\n\n \t state._fsp--;\n\n \t stream_statement.add(statement85.getTree());\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop33;\n }\n } while (true);\n\n string_literal86=(Token)match(input,138,FOLLOW_138_in_repeat1051); \n stream_138.add(string_literal86);\n\n\n\n // AST REWRITE\n // elements: statement, repeatCondition\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 // 207:2: -> ^( REPEAT ^( CONDITION repeatCondition ) ^( EXECUTE ( statement )* ) )\n {\n // flips.g:207:5: ^( REPEAT ^( CONDITION repeatCondition ) ^( EXECUTE ( statement )* ) )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REPEAT, \"REPEAT\"), root_1);\n\n // flips.g:207:14: ^( CONDITION repeatCondition )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CONDITION, \"CONDITION\"), root_2);\n\n adaptor.addChild(root_2, stream_repeatCondition.nextTree());\n\n adaptor.addChild(root_1, root_2);\n }\n // flips.g:207:43: ^( EXECUTE ( statement )* )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EXECUTE, \"EXECUTE\"), root_2);\n\n // flips.g:207:53: ( statement )*\n while ( stream_statement.hasNext() ) {\n adaptor.addChild(root_2, stream_statement.nextTree());\n\n }\n stream_statement.reset();\n\n adaptor.addChild(root_1, root_2);\n }\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 }", "@Override\n\tpublic void repeatChanged(boolean repeating) {\n\t\t\n\t}", "public void setDelayCounter(int value) {\n delayCounter = value;\n }", "public void playSometimes(final int occurrenceRate) {\n if (playCount % occurrenceRate == 0) {\n play();\n }\n playCount++;\n }" ]
[ "0.6261507", "0.5554471", "0.5543828", "0.5530267", "0.5462399", "0.5415895", "0.53040683", "0.5273599", "0.5243376", "0.5218663", "0.51603526", "0.5138837", "0.5133033", "0.5108299", "0.50880986", "0.50670105", "0.5064105", "0.5044791", "0.5032091", "0.5028048", "0.5012228", "0.5005532", "0.50052345", "0.4995386", "0.4983878", "0.496962", "0.4961689", "0.49479103", "0.49382275", "0.4915511", "0.489227", "0.48686862", "0.4868277", "0.48681834", "0.4862471", "0.48529416", "0.48480606", "0.48303935", "0.48256484", "0.4813353", "0.48079574", "0.47791553", "0.47769707", "0.4772476", "0.47647223", "0.47588143", "0.47301418", "0.4719497", "0.47111404", "0.47072488", "0.46956035", "0.4693408", "0.46889535", "0.46852556", "0.46806282", "0.46795896", "0.4676015", "0.46760038", "0.46714565", "0.46698323", "0.46692845", "0.46666965", "0.4656301", "0.46538708", "0.46445385", "0.46334806", "0.4616164", "0.4602331", "0.45990756", "0.45918924", "0.45892787", "0.45734295", "0.45662335", "0.45650065", "0.4563654", "0.4563638", "0.45604345", "0.45588207", "0.45527834", "0.45486164", "0.4537595", "0.4528059", "0.45273355", "0.45244053", "0.44853705", "0.44835314", "0.44825497", "0.4481662", "0.44723988", "0.4471786", "0.44713515", "0.44706923", "0.4468342", "0.44657502", "0.4460576", "0.44531897", "0.44499892", "0.44486272", "0.4448149", "0.4448005" ]
0.65074575
0
Sets the delay timing. This will not reset the internal delay count.
public void setDelay(float time) { delayMax=time; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "public void setDelay(int delay) {\n this.delay = delay;\n }", "public void setDelay(int delay) {\n\t\ttimer.setInitialDelay(delay);\n\t}", "public void setDelay(double clock);", "public void setDelay(long d){delay = d;}", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "public void setDelay(int delayValue)\r\n {\r\n\t timer.setDelay(delayValue);\r\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public void setDelay(org.apache.axis.types.UnsignedInt delay) {\n this.delay = delay;\n }", "public void setDelayTime(int delayTime)\n\t{\n\t\tthis.delayTime = delayTime;\n\t\tthis.updateTimer.setDelay(delayTime);\n\t}", "public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }", "public void setStartDelay(long delay){\n if(delay < 0){\n delay = 0;\n }\n this.mStartDelay = delay;\n }", "public void setDelay(BigDecimal delay) {\r\n this.delay = delay;\r\n }", "public DraggableBehavior setDelay(int delay)\n\t{\n\t\tthis.options.put(\"delay\", delay);\n\t\treturn this;\n\t}", "public T setDelay(float delay)\n\t{\n\t\tthis.delay = delay;\n\t\treturn (T) this;\n\t}", "@Override\n public native void setAutoDelay(int ms);", "public native void setDelay(int delay) throws MagickException;", "public void setDroneDelay(int delay)\r\n {\r\n droneDelay=delay;\r\n }", "public void setDelayMove(float delay_)\n\t{\n\t\tdelayMove=delayMove+delay_;\n\t}", "public void setAutoResetDelay(int delay) {\n this.mAutoResetDelay = delay;\n }", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "@JsonProperty(\"delay\")\n public void setDelay(Double delay) {\n this.delay = delay;\n }", "public Delay(float delay)\n\t{\n\t\tthis(delay,0);\n\t}", "@Override\n public void setSleepTime(int st) {\n this.sleepTime = st;\n\n // notify the update thread so that it can recalculate\n if (updateThread.isRunning())\n updateThread.interrupt();\n }", "public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime = new AlarmTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), \r\n\t\t\t\tcal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), message);\r\n\r\n\t\tSystem.out.println(delayTime.getHour());\r\n\t\tSystem.out.println(delayTime.getMinute());\r\n\r\n\t\talarmList.add(delayTime);\r\n\t\txmanager.write(delayTime);\r\n\t}", "public void setBetDelay(Integer betDelay){\n this.betDelay = betDelay;\n }", "public void setDelayCounter(int value) {\n delayCounter = value;\n }", "@Override\n public void setExecutionDelayTime(double delayTime)\n {\n this.executionDelayTime = delayTime;\n }", "public void setDelayedTimeout(int seconds);", "public AllpassFilter setDelay(UGen del) {\r\n\t\tif (del == null) {\r\n\t\t\tsetDelay(delay);\r\n\t\t} else {\r\n\t\t\tdelayUGen = del;\r\n\t\t\tdel.update();\r\n\t\t\tif ((delay = (int) del.getValue()) < 0) {\r\n\t\t\t\tdelay = 0;\r\n\t\t\t} else if (delay > maxDelay) {\r\n\t\t\t\tdelay = maxDelay;\r\n\t\t\t}\r\n\t\t\tisDelayStatic = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t}", "public void delay(){\n try {\n Thread.sleep((long) ((samplingTime * simulationSpeed.factor)* 1000));\n } catch (InterruptedException e) {\n started = false;\n }\n }", "public void setAnimationDelay(int animationDelay) {\n\t\tmAnimationDelay = animationDelay;\n\t}", "private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public static void delay() {\n\n long ONE_SECOND = 1_000;\n\n try {\n Thread.sleep(ONE_SECOND);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }", "public Delay(float delay, int repeat)\n\t{\n\t\tsetDelay(delay);\n\t\tdelayCount=0f;\n\t\trepeatMax=repeat;\n\t\trepeatCount=0;\n\t}", "void setPaymentDelay(ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay paymentDelay);", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }", "public int setDelay(int duration, int slow_duration, int affected_points_size)\r\n {\r\n if (slow_duration != 0)\r\n {\r\n this.delay = (slow_duration - duration)*(affected_points_size-1);\r\n }\r\n else\r\n {\r\n this.delay = 0;\r\n }\r\n\r\n return this.delay;\r\n }", "public void faster() {\n myTimer.setDelay((int) (myTimer.getDelay() * SPEED_FACTOR));\n }", "public void setStartDelay(long startDelay) {\n/* 211 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public static void sleep(int delay) {\n try {\n \t// int delay = (int)(Math.random()*maxDelay);\n Thread.sleep(delay);\n } catch (InterruptedException e) {}\n\t}", "private void delay(int delayTime){\n\t\ttry{\n\t\t\tThread.sleep(delayTime);\n\t\t}catch(InterruptedException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(e.toString());\n\t\t}\n\t}", "public AutonDelay(double timeout) {\n super(\"autonDelay\");\n setTimeout(timeout);\n }", "public void setTimer(long ms) {\r\n\t\tthis.timer = ms;\r\n\t}", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "public void setNotificationDelay(long notificationDelay) {\n\t\tthis.notificationDelay = notificationDelay;\n\t}", "private static void addDelay() {\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ignored) {\n }\n }", "public int getDelay() {\r\n\t\treturn delay;\r\n\t}", "private void simulateDelay(long millis) {\n try {\n Thread.sleep(millis);\n } catch (InterruptedException ignored) {\n }\n }", "public int getDelayTime()\n\t{\n\t\treturn delayTime;\n\t}", "public int getDelay() {\r\n return delay;\r\n }", "@Override\n public native void delay(int ms);", "public void setRetryDelay(long retryDelay) {\n this.retryDelay = retryDelay;\n }", "void setFastSpeed () {\n if (stepDelay == fastSpeed)\n return;\n stepDelay = fastSpeed;\n step();\n resetLoop();\n }", "public void addDelay(int delay) {\n lastNeuron().addDelay(delay);\n }", "public long getDelay();", "public long getDelay()\n {\n return delay;\n }", "public void setFlashDelay(int flashDelay) {\n getState().flashDelay = flashDelay;\n }", "void schedule(long delay, TimeUnit unit) {\r\n\t\tthis.delay = delay;\r\n\t\tthis.unit = unit;\r\n\t\tif (monitor != null) {\r\n\t\t\tmonitor.cancel(false);\r\n\t\t\tmonitor = pool.scheduleWithFixedDelay(sync, delay, delay, unit);\r\n\t\t}\r\n\t}", "private Flusher(final int delay) {\r\n\t\t\tthis.delay = Checks.assertPositive(delay) * MILLISECONDS_PER_SECOND;\r\n\t\t}", "public double getDelay();", "public AnimationFX setDelay(Duration value) {\n this.timeline.setDelay(value);\n return this;\n }", "public int getDelay() {\n\t\treturn delay;\n\t}", "private void delay (int milliSec)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep (milliSec);\r\n\t\t}\r\n\t\tcatch (InterruptedException e)\r\n\t\t{\r\n\t\t}\r\n\t}", "static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }", "public int getDelay() {\n return delay;\n }", "public void incrementDelayCounter() {\n\t\tthis.delayCounter++;\n\t}", "public static void setPrepositionDelay(long l){\n\t\tprepositionDelay = l;\n\t}", "public org.apache.axis.types.UnsignedInt getDelay() {\n return delay;\n }", "public long getDelay() {\n return mDelay;\n }", "public void setSleepTime(final long l) {\n if (l <= 0) {\n throw new IllegalArgumentException(\"Sleep Time must be a non-zero positive number\");\n }\n sleepTime = l;\n }", "void setNormalSpeed () {\n if (stepDelay == normalSpeed)\n return;\n stepDelay = normalSpeed;\n resetLoop();\n }", "public int getDelay()\r\n {\r\n return this.delay;\r\n }", "public void setReconnectionDelay(final int delay) {\n int oldValue = this.reconnectionDelay;\n this.reconnectionDelay = delay;\n firePropertyChange(\"reconnectionDelay\", oldValue, this.reconnectionDelay);\n }", "public void SetDuration(int duration)\n {\n TimerMax = duration;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "private void updateAutoTriggerDelay(long delay) {\n if (mAutoTriggerDelay != delay) {\n mAutoTriggerDelay = delay;\n updateReachabilityStatus();\n }\n }", "public void moveDelay ( )\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.sleep( 1000 );\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void pause() {\n pause(myDelay);\n }", "public void autoStopForwardDelayTime(int delay) throws JposException;", "public Long getDelaytime() {\n return delaytime;\n }", "public void setTimeout(long t) {\n StepTimeout = t;\n }", "public void start(int delayTime)\n\t{\n\t\tsetDelayTime(delayTime);\n\t\n\t\tstart();\n\t}", "public void setPolitenessDelay(int milliseconds)\n\t{\n\t\tif (milliseconds < 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tif (milliseconds > 10000)\n\t\t{\n\t\t\tmilliseconds = 10000;\n\t\t}\n\t\tPageFetcher.setPolitenessDelay(milliseconds);\n\t}", "public int getDelay()\n {\n return delay;\n }", "public static void createDelay(int duration) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(duration);\r\n\t\t} catch(Exception e) {\r\n\t\t\t//do nothing\r\n\t\t}\r\n\t}", "public float getDelay()\n\t{\n\t\treturn delay;\n\t}", "protected void setDuraction(int seconds) {\n duration = seconds * 1000L;\n }", "public void setFetchDelay(int fetchDelay) {\r\n setAttribute(\"fetchDelay\", fetchDelay, true);\r\n }", "private void delayStart() {\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n LOGGER.error(\"Could not sleep\", e);\n }\n }", "public static void delay(int ms){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(ms);\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public void setSpeed() {\r\n\t\tint delay = 0;\r\n\t\tint value = h.getS(\"speed\").getValue();\r\n\t\t\r\n\t\tif(value == 0) {\r\n\t\t\ttimer.stop();\r\n\t\t} else if(value >= 1 && value < 50) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (1) == delay (5000). value (50) == delay (25)\r\n\t\t\tdelay = (int)(a1 * (Math.pow(25/5000.0000, value / 49.0000)));\r\n\t\t} else if(value >= 50 && value <= 100) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (50) == delay(25). value (100) == delay (1)\r\n\t\t\tdelay = (int)(a2 * (Math.pow(1/25.0000, value/50.0000)));\r\n\t\t}\r\n\t\ttimer.setDelay(delay);\r\n\t}", "public void setPlaylistDelay(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), PLAYLISTDELAY, value);\r\n\t}", "public void setMaxDelayTime(Long MaxDelayTime) {\n this.MaxDelayTime = MaxDelayTime;\n }", "public abstract int delay();", "void setDuration(int duration);", "void delayForDesiredFPS(){\n delayMs=(int)Math.round(desiredPeriodMs-(float)getLastDtNs()/1000000);\n if(delayMs<0) delayMs=1;\n try {Thread.currentThread().sleep(delayMs);} catch (java.lang.InterruptedException e) {}\n }", "public void setPlaylistDelay( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), PLAYLISTDELAY, value);\r\n\t}" ]
[ "0.7899251", "0.78579366", "0.78385437", "0.7803715", "0.7764255", "0.7578456", "0.7533186", "0.747909", "0.73823655", "0.73463833", "0.7258081", "0.7184694", "0.7144212", "0.71046937", "0.7077414", "0.6974919", "0.69663227", "0.6951664", "0.6909298", "0.6836549", "0.6780889", "0.67691517", "0.65628904", "0.65506923", "0.65027386", "0.6476707", "0.6453452", "0.6446599", "0.6433091", "0.64087343", "0.6401238", "0.63182527", "0.63148004", "0.6297108", "0.6286667", "0.6285873", "0.627577", "0.6238189", "0.6197651", "0.6172119", "0.61500883", "0.61144865", "0.6111644", "0.6100428", "0.6090068", "0.60391104", "0.5945606", "0.5937094", "0.5934486", "0.5930354", "0.5925655", "0.592355", "0.59224516", "0.59182537", "0.59131825", "0.59038657", "0.5903013", "0.5895802", "0.58767897", "0.58746654", "0.5869961", "0.5865477", "0.58486855", "0.5845944", "0.5835472", "0.582431", "0.5812979", "0.58127844", "0.58056736", "0.5804871", "0.57666254", "0.57498777", "0.57466227", "0.57440996", "0.57396483", "0.5739092", "0.573895", "0.5724084", "0.5720459", "0.57125306", "0.57105786", "0.5690824", "0.5689184", "0.56811947", "0.5677628", "0.5666289", "0.5644169", "0.56408745", "0.5638488", "0.5607856", "0.5606661", "0.5601452", "0.5595375", "0.5590821", "0.5585463", "0.5551448", "0.5551258", "0.55414605", "0.5540987", "0.5540914" ]
0.69699115
16
Hard resets the delay by settings all counters back to 0. This will also enable the delay.
public void reset() { delayCount = 0f; repeatCount = 0; enabled = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetCounters() {\n setErrorCounter(0);\n setDelayCounter(0);\n }", "private void resetCooldown() {\n nextAttack = tower.getFireFrequency();\n }", "public void reset()\r\n\t{\r\n\t\ttimer.stop();\r\n\t\ttimer.reset();\r\n\t\tautoStep = 0;\r\n\t}", "public void reset()\n {\n this.timeToCook = 0;\n this.startTime = 0;\n }", "public void setAutoResetDelay(int delay) {\n this.mAutoResetDelay = delay;\n }", "public void reset() {\n cycles = 0;\n nextHaltCycle = GB_CYCLES_PER_FRAME;\n nextUpdateCycle = 0;\n running = false;\n timer.reset();\n \n cpu.reset();\n ram.reset();\n soundHandler.reset();\n }", "public void setDelayCounter(int value) {\n delayCounter = value;\n }", "void resetLoop () {\n try {\n timer.cancel();\n timer.purge();\n } catch (Exception e) {\n\n }\n timer = new Timer();\n timer.schedule(new LoopTask(), stepDelay, stepDelay);\n }", "public void setDelay(double clock);", "public void resetLoop(){\n\t\tloopTime = 0;\n\t}", "@Override\n public native void setAutoDelay(int ms);", "public void resetTimeLimit();", "public void reset() {\n cooldowns.clear();\n }", "private void delay() {\n\t\tDelay.msDelay(1000);\n\t}", "private void reset () {\n this.logic = null;\n this.lastPulse = 0;\n this.pulseDelta = 0;\n }", "public void ResetCounter()\r\n {\r\n counter.setCurrentValue(this.startValue);\r\n }", "public void reset() {\n\t\tthis.startTime = 0;\n\t\tthis.stopTime = 0;\n\t\tthis.running = false;\n\t}", "public void resetTime() {\n\t\ttime_passed = 0l;\n\t}", "public void setDelay(long d){delay = d;}", "public void reset() {\n/* 54 */ this.count = 0;\n/* 55 */ this.totalTime = 0L;\n/* */ }", "public void reset()\n\t{\n\t\tm_running = false;\n\t\tm_elapsedMs = 0;\n\t\tm_lastMs = 0;\n\t}", "public synchronized void reset()\n\t{\n\t\tm_elapsed = 0;\n\t}", "public void resetTimer(){\n timerStarted = 0;\n }", "public void reset() {\n\t\tstartTime = System.nanoTime();\n\t\tpreviousTime = getTime();\n\t}", "@Override\n public synchronized void reset() {\n m_accumulatedTime = 0;\n m_startTime = getMsClock();\n }", "public void resetAttackAttempts() {\r\n\t\tattackAttempts = 0;\r\n\t}", "public void setDelay(int delay) {\n\t\ttimer.setInitialDelay(delay);\n\t}", "public void resetTimeout(){\n this.timeout = this.timeoutMax;\n }", "public static void sleepReset()\r\n\t{\r\n\t\t//FileRegister.setDataInBank(2, Speicher.getPC() + 1);\r\n\t\t//Speicher.setPC(Speicher.getPC()+1);\r\n\t\tFileRegister.setDataInBank(1, 8, FileRegister.getBankValue(1, 8) & 0b00001111); // EECON1\r\n\t}", "void unsetPaymentDelay();", "public synchronized static void resetTime() {\n\t\ttime = 0;\n\t}", "@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}", "public void zero()\n {\n Runnable zeroRunnable = new Runnable() {\n @Override\n public void run()\n {\n {\n boolean liftLimit;\n boolean extendLimit;\n\n\n\n do\n {\n liftLimit = liftLimitSwitch.getState();\n extendLimit = extendLimitSwitch.getState();\n\n if (!liftLimit)\n {\n lift.setPower(-0.5);\n }\n else\n {\n lift.setPower(0);\n }\n\n if (extendLimit)\n {\n extend.setPower(-0.5);\n }\n else\n {\n extend.setPower(0);\n }\n\n if (cancel)\n {\n break;\n }\n } while (!liftLimit || !extendLimit);\n\n if (!cancel)\n {\n lift.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n lift.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n extend.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n extend.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n isZeroed = true;\n }\n }\n }\n };\n\n zeroThread = new Thread(zeroRunnable);\n zeroThread.start();\n }", "public void kickTimer() {\n delayTime = System.currentTimeMillis() + shutdownDelay;\n// System.out.println(\"Time at which the loop should kick: \" + delayTime);\n }", "public static void resetTime() {\n\t\ttime = TimeUtils.millis();\n\t}", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "protected void reset()\n {\n if (_resetTimedEvent != null && !_resetTimedEvent.hasAborted()\n && !_resetTimedEvent.hasFired()) _resetTimedEvent.abort();\n\n clearFlag();\n }", "private void softReset() {\n // variables\n lapMap.clear();\n // ui\n sessionTView.setText(\"\");\n positionTView.setText(\"-\");\n currentLapTView.setText(\"--:--:---\");\n lastLapTView.setText(\"--:--:---\");\n bestLapTView.setText(\"--:--:---\");\n currentLapNumberTView.setText(\"-\");\n gapTView.setText(\" -.---\");\n fastestDriver = Float.MAX_VALUE;\n fastestDriverName = null;\n fastestDriverTView.setText(\"--:--:---\");\n fastestDriverNameTView.setText(\"Fastest lap\");\n Log.d(TAG, \"SOFT Reset: between game states\");\n }", "public void resetTimeLimitAction();", "private void resetTime()\n {\n timer.stop();\n timeDisplay.setText(ZERO_TIME);\n time = 0.0;\n }", "public synchronized void resetTime() {\n }", "private float resetTimer() {\r\n final float COUNTDOWNTIME = 10;\r\n return COUNTDOWNTIME;\r\n }", "public void setDelay(int delay) {\n this.delay = delay;\n }", "public void reset(){\n ioTime=0;\n waitingTime=0;\n state=\"unstarted\";\n rem=total_CPU_time;\n ioBurstTime=0;\n cpuBurstTime=0;\n remainingCPUBurstTime=null;\n }", "public void setDelay(int delayValue)\r\n {\r\n\t timer.setDelay(delayValue);\r\n }", "private void hardReset() {\n softReset();\n // variables\n recordLap = 0; // force first query on database after race restart\n trackName = null;\n // ui\n recordLapTView.setText(\"--:--:---\");\n trackTView.setText(\"Track location\");\n carTView.setText(\"Car\");\n Log.d(TAG, \"HARD Reset: main menu\");\n }", "public void reset() {\n // stop motors\n Motor.A.stop();\t\n Motor.A.setPower(0);\t\n Motor.B.stop();\n Motor.B.setPower(0);\t\n Motor.C.stop();\n Motor.C.setPower(0);\t\n // passivate sensors\n Sensor.S1.passivate();\n Sensor.S2.passivate();\n Sensor.S3.passivate();\n for(int i=0;i<fSensorState.length;i++)\n fSensorState[i] = false;\n }", "public final synchronized void resetTime() {\n this.last = System.nanoTime();\n }", "public void resetTimer() {\n button.setText(\"Notify Me!\");\n timerSeekBar.setProgress(60);\n timerSeekBar.setEnabled(true);\n timerText.setText(\"1:00\");\n counter.cancel();\n counterActive = false;\n }", "public void setDelay(long delay) {\n this.delay = delay;\n }", "private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public static synchronized void resetAllTimers() {\r\n _count = 0;\r\n _time = 0;\r\n _serverStarted = -1;\r\n _timers.clear();\r\n }", "public static void resetCounter() {\n\t\t\tcount = new AtomicInteger();\n\t\t}", "public static void resetCounter() {\n\t\t\tcount = new AtomicInteger();\n\t\t}", "public void resetClock()\n {\n\tstartTime = System.currentTimeMillis();\n\tpauseTime = startTime;\n\n computeClock = 0;\n\n\tframeNumber = 0;\n }", "public void autoStopForwardDelayTime(int delay) throws JposException;", "public void resetTimeActive()\n\t{\n\t\tm_TimeActive = 0.0f;\n\t}", "public void resetAllOperations() {\n\t\t/*\n\t\t * Check to see if we are in any countdown modes\n\t\t */\n\t\tif(inCountdown1Mode) {\n\t\t\twarmUpWindow1.dismiss();\n\t\t}\t\t\n\t\tif(inBaselineMode) {\n\t\t\tbaselineWindow.dismiss();\n\t\t}\n\t\t\n\t\t/**\n\t\t * Turn off any red leds\n\t\t */\n\t\tledOn1.setVisibility(View.INVISIBLE);\n\t\tledOn2.setVisibility(View.INVISIBLE);\n\t\tledOn3.setVisibility(View.INVISIBLE);\n\t\tledOn4.setVisibility(View.INVISIBLE);\n\t\tledOn5.setVisibility(View.INVISIBLE);\n\t\tledOn6.setVisibility(View.INVISIBLE);\n\t\tledOn7.setVisibility(View.INVISIBLE);\n\t\tledOn8.setVisibility(View.INVISIBLE);\n\t\tledOn9.setVisibility(View.INVISIBLE);\n\t\t\n\t\t/*\n\t\t * Reset any program flow variables\n\t\t */\n\t\tinCountdown1Mode = false;\n\t\tinBaselineMode = false;\n\t\ton = false;\n\t\tmodeChange = false;\n\t\twarmedUp = false;\n\t\t\n\t\t/*\n\t\t * Reset counts\n\t\t */\n\t\tcountdown1 = WARMUP_COUNT;\n\t\tcountdown2 = BASELINE_COUNT;\n\t\ttvUpdate(tvSensorValue, \"--\");\n\t\t\n\t\tcountdown1Handler.removeCallbacksAndMessages(null);\n\t\tcountdown2Handler.removeCallbacksAndMessages(null);\n\t\tmodeHandler.removeCallbacksAndMessages(null);\n\t\ttickHandler.removeCallbacksAndMessages(null);\n\t\tsetLEDsHandler.removeCallbacksAndMessages(null);\n\t\t\n\t\t// Stop taking measurements\n\t\tstreamer.disable();\n\t\t// Disable the sensor\n\t\tdroneApp.myDrone.quickDisable(qsSensor);\n\t}", "public void reset() {\n onoff.reset();\n itiefe.reset();\n itiefe.setEnabled(false);\n }", "public void reset(){\r\n \tif (resetdelay<=0){//if he didn't just die\r\n \t\tsetLoc(400,575);\r\n \t\timg = imgs[4];\r\n \t}\r\n }", "public Builder clearStateChangeDelayUntilTurn() {\n \n stateChangeDelayUntilTurn_ = 0L;\n onChanged();\n return this;\n }", "public void reset() {\n this.inhibited = false;\n this.forced = false;\n }", "public synchronized void reset() {\n\t\tlisteners.clear();\n\t\tbuffer.clear();\n\t\ttrash.clear();\n\n\t\ttickCount = 1;\n\n\t\tif (log.isInfoEnabled()) {\n\t\t\tlog.info(\"Clock reset\");\n\t\t}\n\t}", "public void unReset () {\n count = lastSave;\n }", "public void resetTimer() {\n\t\tsetStartingTime(System.currentTimeMillis());\t\n\t\tthis.progressBar.setForeground(Color.black);\n\t\tlogger.fine(\"Set normal timer with data: \" + this.toString());\n\n\t}", "protected void reset() {\n speed = 2.0;\n max_bomb = 1;\n flame = false;\n }", "public void setStartDelay(long delay){\n if(delay < 0){\n delay = 0;\n }\n this.mStartDelay = delay;\n }", "public void reset() {\nsuper.reset();\nsetIncrease_( \"no\" );\nsetSwap_( \"tbr\" );\nsetMultrees_( \"no\" );\nsetRatchetreps_(\"200\");\nsetRatchetprop_(\"0.2\");\nsetRatchetseed_(\"0\");\n}", "public void resetTask() {\n super.resetTask();\n this.entity.setAggroed(false);\n this.seeTime = 0;\n this.attackTime = -1;\n this.entity.resetActiveHand();\n }", "public static void delay(){\n System.out.print(\"\");\r\n System.out.print(\"\");\r\n }", "public void reset() {\r\n\t\tplayAgain = false;\r\n\t\tmainMenu = false;\r\n\t\tachievement = 0;\r\n\t}", "public void reset () {\n lastSave = count;\n count = 0;\n }", "public void reset() {\n\t\tthis.count = 0;\n\t}", "public void reset() {\n\t\tsuper.reset(); // reset the Reportable, too.\n\n\t\tif (_interArrivalTimeActivated && _interArrivalTally != null)\n\t\t\t_interArrivalTally.reset();\n\t\t\n\t\t// really reset the counter value?\n\t\tif (!this.isResetResistant) {\n\t\t\tthis._value = 0;\n \t this._min = this._max = 0;\n\t\t}\n\t}", "public void reset() {\n\t\tmCycleFlip = false;\n\t\tmRepeated = 0;\n\t\tmMore = true;\n //mOneMoreTime = true;\n \n\t\t// 추가\n\t\tmStarted = mEnded = false;\n\t\tmCanceled = false;\n }", "public void resetRunCount() {\n\n }", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "private void disableActions() {\r\n\t\tif (resetToDefaults.isEnabled()) {\r\n\t\t\tresetToDefaults.setEnabled(true);\r\n\t\t\tresetToDefaults.setEnabled(false);\r\n\t\t}\r\n\t}", "void reset() {\n count = 0;\n\n }", "public static void reset() {\n start = new Date().getTime();\n killed = 0;\n time = 0;\n }", "@Override\n public void reset() {\n updateDice(1, 1);\n playerCurrentScore = 0;\n playerScore = 0;\n updateScore();\n notifyPlayer(\"\");\n game.init();\n }", "private void resetTriesRemaining() {\n triesLeft[0] = tryLimit;\n }", "public final void reset() {\n\t\tscore = 0;\n\t\tlives = 10;\n\t\tshields = 3;\n\t}", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "public void reset() {\n next = 1000;\n }", "public void resetCumulativeTime()\r\n/* 249: */ {\r\n/* 250:456 */ this.lastCumulativeTime = System.currentTimeMillis();\r\n/* 251:457 */ this.cumulativeReadBytes.set(0L);\r\n/* 252:458 */ this.cumulativeWrittenBytes.set(0L);\r\n/* 253: */ }", "public static void performanceCountReset() { }", "public final void resetCtxts(){\n System.arraycopy(initStates,0,I,0,I.length);\n ArrayUtil.intArraySet(mPS,0);\n }", "public void resetCounters()\n {\n cacheHits = 0;\n cacheMisses = 0;\n }", "public void resetCounters() {\n\t\t//RobotMap.leftEncoder.reset();\n\t\t//RobotMap.rightEncoder.reset();\n\t\tRobotMap.ahrs.zeroYaw();\n\t\tRobotMap.talonLeft.setSelectedSensorPosition(0, 0, 10);\n\t\tRobotMap.talonRight.setSelectedSensorPosition(0, 0, 10);\n\t\tbearing = 0;\n\t}", "public void reset() {\n\t\tcount = 0;\n\t}", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "public void setDelayedTimeout(int seconds);", "public void resetClock()\n {\n startingTime = System.currentTimeMillis();\n }", "private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}", "public void resetTries() {\n this.tries = 0;\n }", "public void countDown() {\n makeTimer();\n int delay = 100;\n int period = 30;\n timer.scheduleAtFixedRate(new TimerTask() {\n public void run() {\n tick();\n updatePlayerHealthUI();\n }\n }, delay, period);\n }", "public void reset() { \r\n stop(); \r\n if (midi) \r\n sequencer.setTickPosition(0); \r\n else \r\n clip.setMicrosecondPosition(0); \r\n audioPosition = 0; \r\n progress.setValue(0); \r\n }", "public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}" ]
[ "0.6878444", "0.66579145", "0.6617009", "0.6560841", "0.6553582", "0.6525572", "0.64852107", "0.64837617", "0.6432514", "0.6414023", "0.636634", "0.63450706", "0.6303893", "0.62906915", "0.62874746", "0.62581766", "0.62379116", "0.6224388", "0.6222501", "0.62192464", "0.6182385", "0.6161276", "0.61593056", "0.6118471", "0.61153144", "0.6081517", "0.6076558", "0.6069254", "0.60562843", "0.60495025", "0.6037059", "0.6023029", "0.6022488", "0.6015609", "0.60107267", "0.60042715", "0.5992335", "0.5976376", "0.59568924", "0.5946927", "0.59439987", "0.59375226", "0.59361523", "0.5905783", "0.59033734", "0.59009033", "0.5895367", "0.5895331", "0.58907485", "0.58862174", "0.588325", "0.5872011", "0.5861635", "0.58455163", "0.58455163", "0.5838465", "0.5825484", "0.58209574", "0.58187836", "0.58150935", "0.5799541", "0.57942617", "0.5792285", "0.5787985", "0.5765961", "0.5759269", "0.57560116", "0.57434714", "0.5728316", "0.5727285", "0.5725706", "0.57256806", "0.57162416", "0.57129693", "0.57024485", "0.56957", "0.5686617", "0.56860894", "0.5678822", "0.5676216", "0.56717795", "0.56665325", "0.5658303", "0.5657685", "0.5655821", "0.5651936", "0.56517124", "0.5644068", "0.56428576", "0.5637816", "0.56357133", "0.5626819", "0.5624472", "0.5623245", "0.5615587", "0.5608436", "0.56070596", "0.56061375", "0.56047714", "0.56001055" ]
0.76532024
0
Call enterClicked() when pressed
@Override public void onClick(View v) { String input = Text.getText().toString(); Intent intent = new Intent(); intent.putExtra("?", input); setResult(RESULT_OK, intent); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "public String enterPressed();", "private void clickEnter(){\n\t\tString commandInput = textInput.getText();\n\t\tString feedback;\n\n\t\tif (commandIsClear(commandInput)) {\n\t\t\tusedCommands.addFirst(commandInput);\n\t\t\tclearLinkedDisplay();\n\n\t\t} else {\n\t\t\tif (commandInput.trim().isEmpty()) {\n\t\t\t\tfeedback = \"Empty command\";\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tusedCommands.addFirst(commandInput);\n\t\t\t\t\tParser parser = new Parser(commandInput);\n\t\t\t\t\tTask currentTask = parser.parseInput();\n\t\t\t\t\t\n\t\t\t\t\tif (currentTask.getOpCode() == OPCODE.EXIT) {\n\t\t\t\t\t\tWindow frame = findWindow(widgetPanel);\n\t\t\t\t\t\tframe.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));\n\t\t\t\t\t\tframe.dispose();\n\t\t\t\t\t}\n\t\t\t\t\tif (currentTask.getOpCode() == OPCODE.HELP) {\n\t\t\t\t\t\tfeedback = currentTask.getHelpMessage();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfeedback = GUIAbstract.getLogic().executeTask(currentTask);\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tfeedback = e.getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t\tlinkedDisplay.displayFeedback(feedback);\n\t\t\tfor (TasksWidget widget : linkedOptionalDisplays) {\n\t\t\t\twidget.doActionOnClick();\n\t\t\t}\n\t\t}\n\t\tclearTextInput();\n\t}", "public void keyPressed(KeyEvent e) {\n if (e.getKeyCode()==KeyEvent.VK_ENTER){\n enter();\n } \n }", "public void actionPerformed(ActionEvent e) { \n enter();\n }", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_ENTER) {\n\t\t\t\t\tsbt_jbt.doClick();\n\t\t\t\t}\n\t\t\t}", "public void setEnterAction(OnEnter et){\n this.enterText = et;\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if(keyCode==KeyEvent.KEYCODE_ENTER) {\n layout.requestFocus();\n }\n return false;\n }", "public void keyPressed(KeyEvent e) {\n\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_ENTER) {\n\t\t\t\t\tsbt_jbt.doClick();\n\t\t\t\t}\n\t\t\t}", "private void enterPressed(java.awt.event.KeyEvent evt){\n //Check if enter was pressed\n if(evt.getKeyCode()==java.awt.event.KeyEvent.VK_ENTER){\n //If the button is enabled\n if(this.jButtonSearch.isEnabled()){\n //Simulate a click on the button\n this.jButtonSearchActionPerformed(new java.awt.event.ActionEvent(new Object(),0,\"\"));\n }\n }\n }", "@Override\n public void mouseEntered(MouseEvent e) {\n view.requestFocus();\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {\n //enter key has been pressed and we hide the keyboard\n hideKeyboard();\n editPenalty.setCursorVisible(false);\n rootView.requestFocus();\n //return true to let it know we handled the event\n return true;\n }\n return false;\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {\n //enter key has been pressed and we hide the keyboard\n hideKeyboard();\n editFinish.setCursorVisible(false);\n rootView.requestFocus();\n //return true to let it know we handled the event\n return true;\n }\n return false;\n }", "public void keyPressed(KeyEvent e) {\n if(e.getKeyCode()==KeyEvent.VK_ENTER){\n\n }\n }", "@Override\n\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\t\tif (e.getKeyChar() == KeyEvent.VK_ENTER) getActionNewParticipant().actionPerformed(null);\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void handle(KeyEvent event) {\n\t\t\t\tif(event.getCode().equals(KeyCode.ENTER)){\n\t\t\t\t\tPlatform.runLater(()->{dodaj.fire(); sifra.requestFocus();});\n\t\t\t\t}\n\t\t\t}", "void redirectToEnterKey();", "protected void enter() {\n \tresult.setForeground(red);\n \tif (entered == true) {\n \t\tshow(current);\n \t}\n \tentered = true;\n \tstack.add(current);\n \tcurrent = 0;\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if ((event.getAction() == KeyEvent.ACTION_DOWN) &&\n (keyCode == KeyEvent.KEYCODE_ENTER)) {\n irMapa();\n return true;\n }\n return false;\n }", "public static void enterPressesWhenFocused(JButton button)\r\n\t{\t\t\r\n\t button.registerKeyboardAction(\r\n\t button.getActionForKeyStroke(\r\n\t KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, false)), \r\n\t KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), \r\n\t JComponent.WHEN_FOCUSED);\r\n\t \r\n\t button.registerKeyboardAction(\r\n\t button.getActionForKeyStroke(\r\n\t KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, true)), \r\n\t KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true), \r\n\t JComponent.WHEN_FOCUSED);\r\n\t}", "public void keyPressed(KeyEvent e) {\r\n\r\n\t\tif(e == null || e.getKeyCode()==KeyEvent.VK_ENTER){\r\n\t\t\t//System.out.println(\"keypressed: Enter\");\r\n\t\t\tif (!input.getText().equals(\"\")) {\r\n\t\t\t\tinput.setEditable(false);\r\n\t\t\t\tquote[1] = Long.toString(System.currentTimeMillis());\r\n\t\t\t\tquote[0]=input.getText();\r\n\r\n\t\t\t\tinput.setText(\"\");\r\n\t\t\t\tquote[0] = quote[0].trim();\r\n\t\t\t\taddText(\"> \"+quote[0]+\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tmDispatcher.newInput(quote);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setEditable(false);\r\n\t\t\t\tinput.setText(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@FXML\n\tprivate void onKeyReleased(KeyEvent e) {\n\t\tif (e.getCode() == KeyCode.ENTER)\n\t\t\tanswerQuestion();\n\t}", "public static void pressEnterToContinue() {\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Press Enter to continue...\");\n\t\tinput.nextLine();\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\r\n\t\t\t\tif (e.getKeyCode()==e.VK_ENTER) {\r\n\t\t\t\t\ttfNota.requestFocus();\r\n\t\t\t\t}\r\n\t\t\t}", "@FXML\r\n void enterPressed(KeyEvent event) {\r\n if(event.getCode() == KeyCode.ENTER){//sprawdzenie czy wcisinieto enter\r\n connectSerialPort();//wywolanie wyzej zdefiniowanej metody - nawiaza polaczenie + otworzenie okna glownego aplikacji\r\n }\r\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if (event.getAction() == KeyEvent.ACTION_DOWN)\n if (keyCode == KeyEvent.KEYCODE_ENTER)\n {\n\n calculate();\n dismiss();\n return true;\n }\n return false;\n }", "@Override\n public boolean onKey(View v, int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {\n //enter key has been pressed and we hide the keyboard\n hideKeyboard();\n //return true to let it know we handled the event\n return true;\n }\n return false;\n }", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\r\n\t\t\t\tif (arg0.getKeyCode()==arg0.VK_ENTER) {\r\n\t\t\t\t\ttxtFornecedor.requestFocus();\r\n\t\t\t\t}\r\n\t\t\t}", "public void enter();", "public static void triggerEnter(Component c) {\n\t\t// text components will not perform built-in actions if they are not focused\n\t\ttriggerFocusGained(c);\n\t\ttriggerActionKey(c, 0, KeyEvent.VK_ENTER);\n\t\twaitForSwing();\n\t}", "@Override\n\t\t\t\tpublic void handle(KeyEvent event) {\n\t\t\t\t\tif(event.getCode().equals(KeyCode.ENTER))\n\t\t\t\t\t\tPlatform.runLater(()->{dugme.fire();});\n\t\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n \t Robot r;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tr = new Robot();\r\n\t\t\t\t int keyCode = KeyEvent.VK_ENTER; // the A key\r\n\t\t\t\t r.keyPress(keyCode);\t\t\t\t \r\n\t\t\t\t} catch (AWTException e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent ev) {\n\t\tString command = ev.getActionCommand();\n\t\tif (command.equals(\"Enter\")) {\n\t\t\tshowResult();\n\t\n\t\t} else if (command.equals(\"Reset\")) {\n\t\t\treset();\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tObject source = e.getSource();\r\n\t\tif(source==button) {\r\n\t\t\tlabel.setText(\"You clicked the button\");\r\n\t\t} else {\r\n\t\t\tlabel.setText(\"You pressed Enter\");\r\n\t\t}\r\n\t\t\r\n\t}", "@FXML\n\tprivate void MainEnterBt() throws IOException {\n\n\t\tmain.showSelectionPage(); // #1\n\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent typedKey)\n\t\t\t{\n\t\t\t\tif(typedKey.getID() == KeyEvent.VK_ENTER)\n\t\t\t\t{\n\t\t\t\t\tgatherInfo();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "void urlFieldEnterKeyPressed();", "public void commandListener(KeyEvent event) {\n\t\tKeyCode code = event.getCode();\n\t\tif(code == KeyCode.ENTER) {\n\t\t\tinputBar.setText((\"entered:\" + inputBar.getText()));\n\t\t}\n\t}", "public static void pressEnterKey() {\n\t\tActions act = new Actions(Browser.Driver);\n\t\tact.sendKeys(Keys.ENTER).perform();\n\t}", "@Override\r\n\tpublic void enter() {\n\t\t\r\n\t}", "@FXML\n\tvoid inputPass(KeyEvent event) {\n\t\tif (event.getCode().equals(KeyCode.ENTER))\n\t\t\tbtnLogin.fire();\n\t}", "@FXML private void pwdKeyEntered(KeyEvent keyEvent) {\n pwdClick();\n if(keyEvent.getCode() == KeyCode.ENTER)\n buttonLoginClick();\n }", "private void txt_montoKeyReleased(java.awt.event.KeyEvent evt) {\n if (evt.getKeyCode()==KeyEvent.VK_ENTER){\n insertarRubro();\n } \n }", "@Override\n\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"entre no butão\");\n\t\t\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tif(e.getKeyCode() == KeyEvent.VK_ENTER){\n\t\t\tif(state == 0){\n\t\t\t\tint temp = numberHighlight.i;\n\t\t\t\t//stop number highlight thread;\n\t\t\t\tnumberHighlight.cancel(true);\n\t\t\t\t//update text field with number\n\t\t\t\ttextField.setText(textField.getText() + String.valueOf(temp));\n\t\t\t\tnumberButton[temp].setBackground(new Color(224, 223, 219));\n\t\t\t\tfunctionHighlight.execute();\n\t\t\t\tstate = 1;\n\t\t\t}\n\t\t\telse if(state == 1){\n\t\t\t\top = functionHighlight.i;\n\t\t\t\ttextField.setText(textField.getText() + getFunc(op));\n\t\t\t\t//stop function highlight thread\n\t\t\t\tfunctionHighlight.cancel(true);\n\t\t\t\t//one object can only be run once therefore new object needs to be created\n\t\t\t\tnumberHighlight = new objectHighlight(numberButton, 0);\n\t\t\t\tnumberHighlight.execute();\n\t\t\t\tstate = 2;\n\t\t\t}\n\t\t\telse if(state == 2){\n\t\t\t\tint temp = numberHighlight.i;\n\t\t\t\tnumberHighlight.cancel(true);\n\t\t\t\ttextField.setText(textField.getText() + String.valueOf(temp));\n\t\t\t\tnumberButton[temp].setBackground(new Color(224, 223, 219));\n\t\t\t\tfunctionButton[op].setBackground(new Color(224, 223, 219));\n\t\t\t\tfunctionButton[op].setBackground(new Color(224, 223, 219));\n\t\t\t\ttextField.setText(evaluateExpr(textField.getText()));\n\t\t\t\t//after evaluation return to function enter state\n\t\t\t\tstate = 1;\n\t\t\t\tfunctionHighlight = new objectHighlight(functionButton, 1);\n\t\t\t\tfunctionHighlight.execute();\n\t\t\t}\n\t\t}\n\t\t//clear the user input\n\t\tif(e.getKeyCode() == KeyEvent.VK_C){\n\t\t\tif(state == 1){\n\t\t\t\t\top = functionHighlight.i;\n\t\t\t\t\tfunctionHighlight.cancel(true);\n\t\t\t\t\tnumberHighlight = new objectHighlight(numberButton, 0);\n\t\t\t\t\tnumberHighlight.execute();\n\t\t\t\t\tfunctionButton[op].setBackground(new Color(224, 223, 219));\n\t\t\t\t\tfunctionHighlight = new objectHighlight(functionButton, 1);\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\t\tstate = 0;\n\t\t\t\t}\n\t\t\t\telse if(state == 2){\n\t\t\t\t\tfunctionButton[op].setBackground(new Color(224, 223, 219));\n\t\t\t\t\tfunctionHighlight = new objectHighlight(functionButton, 1);\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\t\tstate = 0;\n\t\t\t\t}\n\t\t\t\telse if(state ==3){\n\t\t\t\t\ttextField.setText(\"\");\n\t\t\t\t\tstate = 0;\n\t\t\t\t\tnumberHighlight = new objectHighlight(numberButton, 0);\n\t\t\t\t\tnumberHighlight.execute();\n\t\t\t\t}\n\t\t}\n\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n postTaskState(\"\", 13 + \"\");\n }", "@Override\n\tpublic void mouseEntered(MouseEvent arg0) {\n\t\tObject o = arg0.getSource();\n\t\tJButton b = null;\n\t\tString buttonText = \"\";\n\t\tString buttonID = \"\";\n\t\tif(o instanceof JButton)\n\t\t\tb = (JButton)o;\n\n\t\tif(b != null)\n\t\t{\n\t\t\tbuttonText = b.getText();\n\t\t\tswitch(buttonText)\n\t\t\t{\n\t\t\t\tcase \"4\":\n\t\t\t\t\tbuttonID = this.hkp.FOUR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"5\":\n\t\t\t\t\tbuttonID = this.hkp.FIVE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"6\":\n\t\t\t\t\tbuttonID = this.hkp.SIX;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"7\":\n\t\t\t\t\tbuttonID = this.hkp.SEVEN;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"8\":\n\t\t\t\t\tbuttonID = this.hkp.EIGHT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"9\":\n\t\t\t\t\tbuttonID = this.hkp.NINE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tbuttonID = this.hkp.DOWN;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\t\tbuttonID = this.hkp.UP;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//lblTest.setText(buttonText);\n\t\t\tlblTest.setText(this.hkp.GetKey(buttonID));\n\t\t}\n\t}", "public void onKeyPress(Widget sender, char keyCode, int modifiers) {\n }", "private void clickOn() {\n\t\tll_returnbtn.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t}", "public void mouseEntered(MouseEvent arg0) {\n\t\trequestFocus();\n\t\t\n\t}", "@Override\n public boolean onKeyDown(int keyCode, KeyEvent event) {\n if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK) { // Checking for which button is clicked\n MainMethod(); // Start the main method\n return true;\n }\n return super.onKeyDown(keyCode, event); // Default return\n }", "@FXML\n public void onEnter(ActionEvent ae){\n System.out.println(\"Controller.onEnter()\");\n handleButtonClick();\n\n }", "@Override\r\npublic void keyReleased(KeyEvent e) {\n\tif(e.getKeyCode()==KeyEvent.VK_ENTER) {\r\n\t\tinput.setEditable(true);\r\n\t}\r\n\t\r\n}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tClickKeyPad();\n\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\texit.setFont(font2);\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\tif(e.getKeyCode()==KeyEvent.VK_ENTER){\n\t\t\t\t\te.consume();\n\t\t\t\t\t KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent();\n\t\t\t\t}\n\t\t\t}", "public void keyPressed(KeyEvent e) {\r\n\r\n\t\tif (getAceptarKeyLikeTabKey()) {\r\n\t\t\tint key = e.getKeyCode();\r\n\t\t\tif (key == KeyEvent.VK_ENTER) {\r\n\t\t\t\ttransferFocus();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\r\n\t\t\t\tif (e.getKeyCode()==e.VK_ENTER) {\r\n\t\t\t\t\ttfPreco.requestFocus();\r\n\t\t\t\t}\r\n\t\t\t}", "public void pressMainMenu() {\n }", "@Override\n\tpublic void enter() {\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tBeginNewText();\r\n\t\t\t}", "public void actionPerformed(ActionEvent event) {\n sendData(event.getActionCommand());\n enterField.setText(\"\");\n }", "public static void toClick(AndroidDriver driver) {\n\t\t driver.pressKeyCode(AndroidKeyCode.KEYCODE_ENTER);\n\t\t\n\t}", "public void onButtonAPressed();", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_ENTER && e.isControlDown())\r\n\t\t\t\t{\r\n\t\t\t\t\tSend();\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n showKeyboard();\n }", "public void mouseEntered(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public void mouseEntered(MouseEvent e) {\n }", "@Override\n public boolean onKey(View view, int i, KeyEvent keyEvent){\n if( i == KeyEvent.KEYCODE_ENTER && keyEvent.getAction() == KeyEvent.ACTION_DOWN) {\n signUp(view);\n return true;\n }\n return false;\n }", "public void mousePressed(MouseEvent e){\n\t\tGObject obj = program.getElementAt(e.getX(), e.getY());\n\t\tif(obj == returnToMain){\n\t\t\tprogram.resetGame();\n\t\t\tprogram.switchToMenu();\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void keyReleased(KeyEvent arg0)\r\n\t\t\t{\n\t\t\t\tif(arg0.getKeyCode() == KeyEvent.VK_ENTER)\r\n\t\t\t\t{\r\n\t\t\t\t\tverify(input.getText());\r\n\t\t\t\t\tinput.setText(\"\");\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public void mousePressed(MouseEvent e) {\n if(e.getButton() == 1) {\n campo.abrir();\n } else {\n campo.alternarMarcacao();\n }\n }", "public void mouseEntered(MouseEvent e) {\n\t\t\t\tlogin.setFont(font2);\n\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}", "void enter();", "public void mouseEntered(MouseEvent e) {\n\t\tadaptee.botonEditar_mouseEntered(e);\n\t}", "@Override\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\tif(e.getKeyCode() == KeyEvent.VK_ENTER )\n\t\t\t\tthis.convert();\n\t\t}", "public void mouseEntered(MouseEvent e) {\n if (mouseEnteredCmd != null) {\n mouseEnteredCmd.execute();\n }\n }", "@Override\n public final void actionPerformed(ActionEvent e) {\n if (!isKeyPressed) {\n isKeyPressed = true;\n keyPressed();\n }\n }", "public boolean onKey(View v, int keyCode, KeyEvent event) {\n\t\t\t\tif (event.getAction() != KeyEvent.ACTION_DOWN) {\n\t\t\t\t\t// if the pressed key = enter we do the add code\n\t\t\t\t\tif (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {\n\t\t\t\t\t\tonClickBtAdd();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if we dont return false our text wont get in the\n\t\t\t\t// edittext\n\t\t\t\treturn false;\n\t\t\t}", "public void mouseEntered(MouseEvent e) {\r\n\t}", "@Override\n\tpublic void mouseEntered(MouseEvent m) {\n\t}", "public void mouseEntered(MouseEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent ke) {\n if (ke.getSource().equals(frmMain.getMessageBox()) && ke.getKeyCode() == KeyEvent.VK_ENTER) {\n sendContent();\n }\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent me) {\n\t\t\t\trequestFocusInWindow();\n\t\t\t}", "@Override\r\n\tpublic String press() {\n\t\treturn null;\r\n\t}", "public void mouseEntered(MouseEvent e) {\n\t}", "@Override\n\tpublic boolean onKey(View view, int keyCode, KeyEvent event) {\n\t\tboolean handle = false;\n\t\tif(event.getAction()==KeyEvent.ACTION_DOWN && keyCode==KeyEvent.KEYCODE_ENTER){\n\t\t\thandle = entrarUrl();\n\t\t}\n\t\treturn handle;\n\t}", "public static void pressEnter(WebElement wb) {\n\t\tActions act = new Actions(Browser.Driver);\n\t\tact.sendKeys(Keys.ENTER).perform();\n\t\t\n\t}", "public void mouseEntered(MouseEvent e) {\n\n\t}", "@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tintiEntry();\n\t\t\t\t\t\trefreshFragment();\n\t\t\t\t\t\tiGetFirstFocus();\n\t\t\t\t\t}", "@Override\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t// Check if input fields are filled in\n\t\t\ttoggleSearchButton();\n\t\t}", "@Override\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t// Check if input fields are filled in\n\t\t\ttoggleSearchButton();\n\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\tswitch(num){\n\t\t\t\tcase 1:\n\t\t\t\t\tconfirm.setIcon(new ImageIcon(\"src/image/userUi/confirmW.png\") );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcancel.setIcon(new ImageIcon(\"src/image/userUi/cancelW.png\") );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void inputHandling() {\n if (input.clickedKeys.contains(InputHandle.DefinedKey.ESCAPE.getKeyCode())\n || input.clickedKeys.contains(InputHandle.DefinedKey.RIGHT.getKeyCode())) { \n if (sourceMenu != null) {\n exit();\n sourceMenu.activate(); \n return;\n }\n }\n \n if (input.clickedKeys.contains(InputHandle.DefinedKey.UP.getKeyCode())) { \n if (selection > 0) {\n selection--;\n }\n }\n \n if (input.clickedKeys.contains(InputHandle.DefinedKey.DOWN.getKeyCode())) { \n if (selection < choices.size() - 1) {\n selection++;\n } \n }\n \n if (input.clickedKeys.contains(InputHandle.DefinedKey.ENTER.getKeyCode())) {\n if (choices.size() > 0) {\n use();\n }\n exit(); \n }\n }", "public boolean onKey(View v, int keyCode, KeyEvent event) {\n Log.e(\"event.getAction()\",event.getAction()+\"\");\n Log.e(\"event.keyCode()\",keyCode+\"\");\n if ((event.getAction() == KeyEvent.ACTION_DOWN) &&\n (keyCode == KeyEvent.KEYCODE_ENTER)) {\n\n checkAnswer();\n return true;\n }\n return false;\n }", "public void mouseEntered(MouseEvent e) {\n\n\t\t\t}", "public void mouseEntered(MouseEvent e) {\n\n\t\t\t}" ]
[ "0.7964847", "0.7875948", "0.73241216", "0.73136616", "0.72861457", "0.7128472", "0.6910671", "0.69084454", "0.6868653", "0.6841841", "0.68339056", "0.68294066", "0.6733812", "0.66889113", "0.66793543", "0.6612968", "0.6610967", "0.6594852", "0.6572485", "0.6506041", "0.6501324", "0.646315", "0.64502615", "0.6450116", "0.64197695", "0.6384923", "0.63711", "0.6367469", "0.634194", "0.6340481", "0.63254064", "0.63122815", "0.6297132", "0.62951666", "0.62933785", "0.6293261", "0.62697726", "0.62648284", "0.62625265", "0.6258875", "0.6257737", "0.6256425", "0.6238627", "0.62218046", "0.6210064", "0.620944", "0.6208442", "0.61966777", "0.6181032", "0.61798275", "0.6175416", "0.6169807", "0.6165138", "0.61549556", "0.61304146", "0.61251295", "0.6124439", "0.60977435", "0.6075869", "0.6071508", "0.60469127", "0.60335547", "0.60240906", "0.6020409", "0.6018098", "0.6001578", "0.5969594", "0.5969594", "0.5969594", "0.59655565", "0.59634745", "0.5960667", "0.5958885", "0.595679", "0.59553677", "0.59545445", "0.59522307", "0.59464645", "0.59446585", "0.5942308", "0.5941647", "0.5938252", "0.5937094", "0.5933065", "0.5929106", "0.5928205", "0.5925495", "0.5922697", "0.5922694", "0.59149027", "0.59134734", "0.5910754", "0.5909851", "0.59084696", "0.59084696", "0.59079504", "0.59072804", "0.5907256", "0.5906401", "0.59042823", "0.59042823" ]
0.0
-1
Create a default action using a ListView as the selection tool in the expanded state, and a combo box otherwise, with the default customization action.
public static <T> FolderPanel<T> create(String folder, Class<T> selectionType) { return create(folder, selectionType, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "public LimeComboBox(List<Action> newActions) { \n setText(null);\n actions = new ArrayList<Action>();\n addActions(newActions);\n \n if (!actions.isEmpty()) {\n selectedAction = actions.get(0);\n } else {\n selectedAction = null;\n } \n \n initModel();\n \n actionListener = new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n ActionLabel label = (ActionLabel)e.getSource();\n Action action = label.getAction();\n selectedAction = action;\n selectedComponent = (JComponent)label.getParent();\n selectedLabel = label;\n fireChangeEvent(action);\n repaint();\n menu.setVisible(false);\n }\n };\n \n mouseListener = new MouseAdapter() {\n \n private final Color foreground = UIManager.getColor(\"MenuItem.foreground\");\n private final Color selectedForeground = UIManager.getColor(\"MenuItem.selectionForeground\");\n \n @Override\n public void mouseEntered(MouseEvent e) {\n paintNormal(e.getSource(), true);\n }\n \n @Override\n public void mouseExited(MouseEvent e) {\n paintNormal(e.getSource(), false);\n }\n \n @Override\n public void mouseClicked(MouseEvent e) {\n paintNormal(e.getSource(), true);\n }\n \n private void paintNormal(Object source, boolean selected) {\n JComponent label = (JComponent)source;\n label.setForeground(selected ? selectedForeground : foreground );\n \n JComponent parent = (JComponent) label.getParent();\n parent.setOpaque(selected);\n parent.repaint();\n \n // Remove highlight on the last selected component.\n if (selectedComponent != null && selectedComponent != parent) {\n selectedLabel.setForeground(foreground);\n selectedComponent.setOpaque(false);\n selectedComponent.repaint();\n selectedLabel = null;\n selectedComponent = null;\n }\n }\n };\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "public void selected(String action);", "private void initializeMenuForListView() {\n\t\tMenuItem sItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_S_MENU));\n\t\tsItem.setOnAction(event ->\n\t\t\taddSAction()\n\t\t);\n\t\t\n\t\tMenuItem scItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_SC_MENU));\n\t\tscItem.setOnAction(event ->\n\t\t\t\taddScAction()\n\t\t);\n\t\t\n\t\tContextMenu menu = new ContextMenu(sItem, scItem);\n\t\tfirstListView.setContextMenu(menu);\n\t\tsecondListView.setContextMenu(menu);\n\t}", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true;\n }", "@Override\n public boolean onCreateActionMode(ActionMode mode, Menu menu)\n {\n MenuInflater inflater = mode.getMenuInflater();\n inflater.inflate(R.menu.menu_multi_select, menu);\n multi_select_menu = menu;\n adapter.is_action_mode = true;\n adapter.notifyDataSetChanged();\n fab.hide();\n //context_menu = menu;\n return true;\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.expandable_list_view_test, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n //menu.setHeaderTitle(\"Select The Action\");\n menu.add(0, v.getId(), 0, \"Edit word\");\n menu.add(1, v.getId(), 0, \"Delete word\");\n\n super.onCreateContextMenu(menu, v, menuInfo);\n }", "public void listAction () {//GEN-END:|13-action|0|13-preAction\n // enter pre-action user code here\nString __selectedString = getList ().getString (getList ().getSelectedIndex ());//GEN-BEGIN:|13-action|1|17-preAction\nif (__selectedString != null) {\nif (__selectedString.equals (\"S\\u00F6k text\")) {//GEN-END:|13-action|1|17-preAction\n // write pre-action user code here\nswitchDisplayable (null, getSeatchform ());//GEN-LINE:|13-action|2|17-postAction\n // write post-action user code here\n} else if (__selectedString.equals (\"Tidigare s\\u00F6kningar\")) {//GEN-LINE:|13-action|3|18-preAction\n // write pre-action user code here\nswitchDisplayable (null, getSearchList ());//GEN-LINE:|13-action|4|18-postAction\n // write post-action user code here\n}//GEN-BEGIN:|13-action|5|13-postAction\n}//GEN-END:|13-action|5|13-postAction\n // enter post-action user code here\n}", "@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\n\n return true;\n }", "abstract public void cabMultiselectPrimaryAction();", "@Override\n public boolean onPrepareActionMode(ActionMode mode, Menu menu) {\n// if (mSelectedItem==1) {\n// MenuInflater inflater = mode.getMenuInflater();\n// inflater.inflate(R.menu.geo, menu);\n// }\n return true; // Return false if nothing is done\n }", "public void selectionChanged(Action item);", "protected abstract PopupMenuHelper createActionMenuHelper();", "@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n int id = item.getItemId();\n //use switch condition\n switch (id){\n case R.id.select_delete:\n //when click delete\n //use for loop\n for (NoteEntity noteSelect :selectList) {\n //remove select item from list\n list.remove(noteSelect);\n mainViewModel.deleteById(noteSelect.getId());\n }\n //check condition\n if (list.size()==0){\n //when list is empty\n //visible text view\n tvEmpty.setVisibility(View.VISIBLE);\n }\n mode.finish();\n break;\n case R.id.select_all:\n //when click on select all\n //check condition\n if (selectList.size() == list.size()){\n //when all item selected\n //set isSelectAll false\n isSelectAll = false;\n //clear select list\n selectList.clear();\n }else {\n //when all item unselected\n //set isSelectAll true\n isSelectAll = true;\n //clear list\n selectList.clear();\n //add all values in select list\n selectList.addAll(list);\n }\n //set text in view mode\n mainViewModel.setSelectedLiveData(String.valueOf(selectList.size()));\n //notify adaptor\n notifyDataSetChanged();\n break;\n }\n return true;\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n menu.setHeaderTitle(\"Select the Action\");\n getMenuInflater().inflate(R.menu.my_context_menu, menu); // add costume menu\n }", "public void createNewItem(ActionEvent actionEvent) {\n // we will create a new item instance here (ideally we would use another window for this)\n // and then we will simply addItem() to the currently selected list\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!isEdit) {\r\n\t\t\t\t\txb_popup.showAsDropDown(xbet, 0, 1, xbet.getWidth(),\r\n\t\t\t\t\t\t\tLayoutParams.WRAP_CONTENT);\r\n\t\t\t\t}\r\n\t\t\t}", "protected ListView<T> createTargetListView() {\n/* 447 */ return createListView();\n/* */ }", "private void setupListViewListener() {\n\t\t\n\t\t// OnItemLongClick - show edit options\n\t\tlvItems.setOnItemLongClickListener(new OnItemLongClickListener() {\n\t\t\t@Override\n\t\t\tpublic boolean onItemLongClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long rowId) {\n\n\t\t\t\titemsAdapter.setSelectedPosition(position);\n\t\t\t\tif (itemsAdapter.getSelectedPosition() == -1)\n\t\t\t\t\tgetActionBar().hide();\n\t\t\t\telse {\n\t\t\t\t\tgetActionBar().setDisplayShowHomeEnabled(false);\n\t\t\t\t\tgetActionBar().show();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t});\n\t\t// OnItemClick - Open Detail Screen\n\t\tlvItems.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long rowId) {\n\t\t\t\titemsAdapter.unsetSelectedPosition();\n\t\t\t\tgetActionBar().hide();\n\t\t\t\tIntent i = new Intent(TodoActivity.this, EditItemActivity.class);\n\t\t\t\ti.putExtra(\"position\", position);\n\t\t\t\tTodoItem item = (TodoItem) parent.getItemAtPosition(position);\n\t\t\t\ti.putExtra(\"item\", item);\n\t\t\t\tstartActivityForResult(i, REQUEST_CODE);\n\n\t\t\t}\n\n\t\t});\n\n\t}", "@Override\n public void onClick(View view) {\n if(view.isSelected()){\n view.setSelected(false);\n selectedList.remove((Integer) getAdapterPosition());\n }\n else{\n view.setSelected(true);\n selectedList.add((Integer) getAdapterPosition());\n }\n\n //when a meta magic is selected we allow the modifications\n if(! (selectedList == null) && ! selectedList.isEmpty()){\n parent.findViewById(R.id.buttonDelete).setEnabled(true);\n\n //we allow modification only if there is one item selected\n if(selectedList.size() == 1)\n {\n parent.findViewById(R.id.buttonEdit).setEnabled(true);\n }\n else\n {\n parent.findViewById(R.id.buttonEdit).setEnabled(false);\n }\n\n }\n else{\n parent.findViewById(R.id.buttonDelete).setEnabled(false);\n parent.findViewById(R.id.buttonEdit).setEnabled(false);\n }\n\n }", "public void toSelectingAction() {\n }", "@Override\r\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\r\n // TODO Auto-generated method stub\r\n return false;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void initDefaultCommand() {\n setDefaultCommand(new operateClimber());\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n adapter.setFilter(lista1);\n return true; // Return true to collapse action view\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.action_add_widget) {\n\n selectWidget();\n\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public ActionMenuItem() {\n this(\"\");\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "@Override\r\n public SystemAction getDefaultAction() {\n return SystemAction.get(OpenAction.class);\r\n }", "private void bind() \r\n\t{\r\n\t\tsuper.menuPut(\"list\", newJMenu(\"List\", 'L'));\r\n\t\tsuper.menuPut(\"list/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionNew(x));\r\n\t\tsuper.menuPut(\"list/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionLoad(x));\r\n\t\tsuper.menuPut(\"list/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionSave(x));\r\n\t\tsuper.menuPut(\"list/***1\", \"\");\r\n\t\tsuper.menuPut(\"list/add\", newJMenuItem(\"Add\", 'A', KeyEvent.VK_4, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionAdd(x));\r\n\t\tsuper.menuPut(\"list/remove\", newJMenuItem(\"Remove\", 'R', KeyEvent.VK_5, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionRemove(x));\r\n\t\t\r\n\t\tsuper.menuPut(\"tree\", newJMenu(\"Tree\", 'T'));\r\n\t\tsuper.menuPut(\"tree/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.SHIFT_MASK), x -> menuEdit.actionNew(x));\r\n\t\tsuper.menuPut(\"tree/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.SHIFT_MASK), x -> menuEdit.actionLoad(x));\r\n\t\tsuper.menuPut(\"tree/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.SHIFT_MASK), x -> menuEdit.actionSave(x));\r\n\t\tsuper.menuPut(\"tree/***1\", \"\");\r\n\t\tsuper.menuPut(\"tree/add\", newJMenuItem(\"Add\", 'A', KeyEvent.VK_4, ActionEvent.SHIFT_MASK), x -> menuEdit.actionAdd(x));\r\n\t\tsuper.menuPut(\"tree/remove\", newJMenuItem(\"Remove\", 'R', KeyEvent.VK_5, ActionEvent.SHIFT_MASK), x -> menuEdit.actionRemove(x));\r\n\t\tsuper.menuPut(\"tree/move\", newJMenuItem(\"Move\", 'V', KeyEvent.VK_6, ActionEvent.SHIFT_MASK), x -> menuEdit.actionMove(x));\r\n\t\t\r\n\t\tsuper.menuPut(\"graph\", newJMenu(\"Graph\", 'G'));\r\n\t\tsuper.menuPut(\"graph/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.CTRL_MASK), x -> menuHelp.actionNew(x));\r\n\t\tsuper.menuPut(\"graph/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.CTRL_MASK), x -> menuHelp.actionOpen(x));\r\n\t\tsuper.menuPut(\"graph/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.CTRL_MASK), x -> menuHelp.actionSave(x));\r\n\t\tsuper.menuPut(\"graph/***1\", \"\");\r\n\t\tsuper.menuPut(\"graph/add-node\", newJMenuItem(\"Add node\", 'A', KeyEvent.VK_4, ActionEvent.CTRL_MASK), x -> menuHelp.actionAddNode(x));\r\n\t\tsuper.menuPut(\"graph/remove-node\", newJMenuItem(\"Remove node\", 'R', KeyEvent.VK_5, ActionEvent.CTRL_MASK), x -> menuHelp.actionRemoveNode(x));\r\n\t\tsuper.menuPut(\"graph/move-node\", newJMenuItem(\"Move node\", 'V', KeyEvent.VK_6, ActionEvent.CTRL_MASK), x -> menuHelp.actionMoveNode(x));\r\n\t\tsuper.menuPut(\"graph/***2\", \"\");\r\n\t\tsuper.menuPut(\"graph/add-link\", newJMenuItem(\"Add link\", 'D', KeyEvent.VK_7, ActionEvent.CTRL_MASK), x -> menuHelp.actionAddLink(x));\r\n\t\tsuper.menuPut(\"graph/remove-link\", newJMenuItem(\"Remove link\", 'L', KeyEvent.VK_8, ActionEvent.CTRL_MASK), x -> menuHelp.actionRemoveLink(x));\r\n\t\t\r\n\t\tsuper.menuDump();\t\t\r\n\t}", "@Override\r\n\tpublic boolean onCreateActionMode(ActionMode mode, Menu menu) {\n\t\ttype = SINGLE_MODE;\r\n\t\tinflater = getSherlockActivity().getSupportMenuInflater();\r\n\t\tinflater.inflate(R.menu.movies_list_single_selection, menu);\r\n\r\n\t\treturn true;\r\n\t}", "public ActionChangeButton(final ActionChanger<?> action) {\n this((String) action.getValue(Action.NAME), (ResizableIcon) action.getValue(Action.LARGE_ICON_KEY));\n addAction(action);\n setDefaultAction(action);\n setState(ElementState.SMALL, true);\n setCommandButtonKind(CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);\n\n this.addPopupMenuListener(new PopupMenuListener() {\n\n @Override\n public void menuAboutToShow(final JPopupMenu popup) {\n for (final Action action : actions) {\n popup.add(new JMenuItem(action));\n }\n }\n\n });\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@OnClick(R.id.converter_sale_or_purchase_cv)\n public void chooseAction() {\n mDialog = new DialogList(mContext,\n mActionDialogTitle, mListForActionDialog, null,\n new RecyclerViewAdapterDialogList.OnItemClickListener() {\n @Override\n public void onClick(int position) {\n if (position == 0) {\n mAction = ConstantsManager.CONVERTER_ACTION_PURCHASE;\n } else {\n mAction = ConstantsManager.CONVERTER_ACTION_SALE;\n }\n mPreferenceManager.setConverterAction(mAction);\n mDialog.getDialog().dismiss();\n setLang();\n }\n });\n ((ImageView) mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done))\n .setImageResource(R.drawable.ic_tr);\n mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done)\n .setBackground(getResources().getDrawable(R.drawable.ic_tr));\n }", "protected ViewerPopupMenu createPopupMenu()\n {\n ViewerPopupMenu menu = super.createPopupMenu();\n\n viewAction = new ViewerAction(this, \"View\", \"view\",\n \"View Dofs\",\n \"View the dofs of an Actor in table form.\",\n null, null, \"Ctrl-V\", null, \"false\");\n\n menu.addSeparator();\n menu.add(viewAction);\n\n return menu;\n }", "public void initDefaultCommand() {\n \tsetDefaultCommand(new boxChange());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n if (mActionMode != null)\n onListItemSelect(position);\n }", "@Override\r\n\tpublic String getAction() {\n\t\tString action = null;\r\n\t\tif(caction.getSelectedIndex() == -1) {\r\n\t\t\treturn null;\r\n\t}\r\n\tif(caction.getSelectedIndex() >= 0) {\r\n\t\t\taction = caction.getSelectedItem().toString();\r\n\t}\r\n\t\treturn action;\r\n\t\r\n\t}", "public void setButtonSelection(String action);", "public ActionBarDropDown(Context context) {\n super(context);\n\n CheckUtil.isContextThemeWrapper(context);\n CheckUtil.isUIThread(context);\n\n mMeasureSpecM2 = HtcResUtil.getM2(context);\n\n getDefaultHeight();\n // setup the module overall environment\n // setPadding(padding,0,padding,0);\n setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));\n\n // inflate the external layout and merge to current layout\n LayoutInflater.from(context).inflate(R.layout.action_dropdown, this, true);\n\n mArrowView = (ImageView) findViewById(R.id.arrow);\n mPrimaryView = (ActionBarTextView) findViewById(R.id.primary);\n mSecondaryView = (ActionBarTextView) findViewById(R.id.secondary);\n mCounterView = (ActionBarTextView) findViewById(R.id.counter);\n // check the layout resource correctness\n if (mPrimaryView == null || mSecondaryView == null || mArrowView == null) throw new RuntimeException(\"inflate layout resource incorrect\");\n\n mPrimaryView.setState(ActionBarTextView.PRIMARY_DEFAULT_ONLY);\n mSecondaryView.setState(ActionBarTextView.SECONDARY_DEFAULT);\n mCounterView.setState(ActionBarTextView.COUNTER_FOLLOW_PRIMARY);\n\n setBackground(ActionBarUtil.getActionMenuItemBackground(context));\n\n /* support D-Pad function */\n setFocusable(true);\n }", "protected void createContextMenu() {\n\t\t// TODO : XML Editor 에서 Query Editor 관련 Action 삭제~~\n\t\tMenuManager contextMenu = new MenuManager(\"#PopUp\"); //$NON-NLS-1$\n\t\tcontextMenu.add(new Separator(\"additions\")); //$NON-NLS-1$\n\t\tcontextMenu.setRemoveAllWhenShown(true);\n\t\tcontextMenu.addMenuListener(new NodeActionMenuListener());\n\t\tMenu menu = contextMenu.createContextMenu(getControl());\n\t\tgetControl().setMenu(menu);\n\t\t// makeActions();\n\t\t// hookSingleClickAction();\n\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_settings:\n\n startActivity(new Intent(ListViewCompany.this, Help.class));\n\n return true;\n\n default:\n\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public void setActivePart(IAction action, IWorkbenchPart targetPart) {}", "public void createNewList(ActionEvent actionEvent) {\n // ideally again, this would have its own window\n // give it a title, and optionally populate it with some items\n }", "private void initializeActionModeHelper() {\n mActionModeHelper = new ActionModeHelper(mAdapter, R.menu.menu_action_header, this) {\n // Override to customize the title\n @Override\n public void updateContextTitle(int count) {\n // You can use the internal mActionMode instance\n if (mActionMode != null) {\n int position = mAdapter.getSelectedPositions().get(0);\n AbstractFlexibleItem item = mAdapter.getItem(position);\n mActionMode.setTitle(fontifyString(getActivity(), getString(R.string.action_edit_category, item)));\n }\n }\n }.withDefaultMode(SelectableAdapter.Mode.SINGLE);\n mActionModeHelper.withDefaultMode(SelectableAdapter.Mode.SINGLE);\n mAdapter.setMode(SelectableAdapter.Mode.SINGLE);\n }", "public void setDefaultAction(final ActionChanger<?> defaultAction) {\n if ((defaultAction != null) && (actions.indexOf(defaultAction) != -1)) {\n removeActionListener(this.defaultAction);\n this.defaultAction = defaultAction;\n addActionListener(this.defaultAction);\n final Object objIcon = defaultAction.getValue(Action.LARGE_ICON_KEY);\n if (objIcon instanceof ResizableIcon) {\n setIcon((ResizableIcon) objIcon);\n }\n setText((String) defaultAction.getValue(Action.NAME));\n setToolTipText((String) defaultAction.getValue(Action.SHORT_DESCRIPTION));\n }\n }", "@Override\n public boolean onOptionsItemSelected(android.view.MenuItem item) {\n int id = item.getItemId();\n if (!editing) {\n item.setTitle(getResources().getString(R.string.done));\n editing = true;\n }else{\n item.setTitle(getResources().getString(R.string.edit));\n editing = false;\n }\n customAdapter.notifyDataSetChanged();\n return super.onOptionsItemSelected(item);\n }", "boolean onExtendMenuItemClick(int itemId, View view);", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tmenu.add(group1Id, Edit, Edit, \"Edit\");\n\t\t\tmenu.add(group1Id, Delete, Delete, \"Delete\");\n\t\t\tmenu.add(group1Id, Finish, Finish, \"Finish\");\n\t\t\treturn super.onCreateOptionsMenu(menu); \n\t\t}", "@Override\n public List<UpdatableItem> createPopup() {\n final List<UpdatableItem> items = new ArrayList<UpdatableItem>();\n \n /* host wizard */\n final MyMenuItem newHostWizardItem =\n new MyMenuItem(Tools.getString(\"EmptyBrowser.NewHostWizard\"),\n HOST_ICON,\n null,\n new AccessMode(ConfigData.AccessType.RO, false),\n new AccessMode(ConfigData.AccessType.RO, false)) {\n private static final long serialVersionUID = 1L;\n \n @Override\n public String enablePredicate() {\n return null;\n }\n \n @Override\n public void action() {\n final AddHostDialog dialog = new AddHostDialog(new Host());\n dialog.showDialogs();\n }\n };\n items.add(newHostWizardItem);\n Tools.getGUIData().registerAddHostButton(newHostWizardItem);\n return items;\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n reloadMenuItem.setVisible(false);\n listToggleMenuItem.setVisible(false);\n mIsSearchMode = true;\n return true;\n }", "private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \t\t}\n \t\t\n \t}", "@Override\n public void widgetDefaultSelected(SelectionEvent exc) {\n }", "ActionOpen()\n {\n super(\"Open\");\n this.setShortcut(UtilGUI.createKeyStroke('O', true));\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v,\n ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n menu.setHeaderTitle(\"Select Action:\");\n menu.add(0, v.getId(), 0, \"Edit Activity\");\n menu.add(0, v.getId(), 0, \"Delete Activity\");\n getActivityDetails(v);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n\n }", "private boolean performAction(int action) {\n TagEditorFragment tagEditorFragment = (TagEditorFragment) caller;\n final int size = rows.getChildCount();\n List<TagEditRow> selected = new ArrayList<>();\n for (int i = 0; i < size; ++i) {\n View view = rows.getChildAt(i);\n TagEditRow row = (TagEditRow) view;\n if (row.isSelected()) {\n selected.add(row);\n }\n }\n switch (action) {\n case MENU_ITEM_DELETE:\n if (!selected.isEmpty()) {\n for (TagEditRow r : selected) {\n r.delete();\n }\n tagEditorFragment.updateAutocompletePresetItem(null);\n }\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_COPY:\n copyTags(selected, false);\n tagEditorFragment.updateAutocompletePresetItem(null);\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_CUT:\n copyTags(selected, true);\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_CREATE_PRESET:\n CustomPreset.create(tagEditorFragment, selected);\n tagEditorFragment.presetFilterUpdate.update(null);\n break;\n case MENU_ITEM_SELECT_ALL:\n ((PropertyRows) caller).selectAllRows();\n return true;\n case MENU_ITEM_DESELECT_ALL:\n ((PropertyRows) caller).deselectAllRows();\n return true;\n case MENU_ITEM_HELP:\n HelpViewer.start(caller.getActivity(), R.string.help_propertyeditor);\n return true;\n default:\n return false;\n }\n return true;\n }", "public Menu createViewMenu();", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n\n getActivity().getMenuInflater().inflate(R.menu.actions , menu);\n\n }", "@Override\n public void showContextMenu()\n {\n showContextMenu(selection, View.SELECTION);\n }", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "public ContentCard defaultAction(ContentCardAction defaultAction) {\n this.defaultAction = defaultAction;\n return this;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.buttonListView:\n showActivityEntries();\n return true;\n case R.id.buttonManualAdd:\n showActivityAdd();\n return true;\n case R.id.action_settings:\n \tgetFragmentManager().beginTransaction()\n .replace(android.R.id.content, new SettingsFragment())\n .addToBackStack(null)\n .commit();\n \treturn true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "public void addActionChoice () {\r\n\t\tactionChoices.add(new ActionChoice());\r\n\t}", "private SelectOSAction() {\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n if (id == R.id.action_add) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Add Item\");\n\n\n\n\n final EditText input = new EditText(this);\n builder.setView(input);\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n masterItems.add(preferredCase(input.getText().toString()));\n Collections.sort(masterItems);\n storeArrayVal(masterItems, getApplicationContext());\n lv.setAdapter(adapter);\n }\n });\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n builder.show();\n return true;\n\n\n }\n\n\n if (id == R.id.action_clear) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Clear Entire List\");\n builder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n masterItems.clear();\n lv.setAdapter(adapter);\n }\n });\n builder.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n builder.show();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void createToolBarActions() {\r\n\t\t// create the action\r\n\t\tGetMessage<Transport> getMessage = new GetMessage<Transport>(new Transport());\r\n\t\tgetMessage.addParameter(IFilterTypes.TRANSPORT_TODO_FILTER, \"\");\r\n\r\n\t\t// add to the toolbar\r\n\t\tform.getToolBarManager().add(new RefreshViewAction<Transport>(getMessage));\r\n\t\tform.getToolBarManager().update(true);\r\n\t}", "private void initListView() {\n\t\trefreshListItems();\n\n\t\t/* Add Context-Menu listener to the ListView. */\n\t\tlv.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCreateContextMenu(ContextMenu menu, View v,\n\t\t\t\t\tContextMenu.ContextMenuInfo menuInfo) {\n\t\t\t\tmenu.setHeaderTitle(((TextView) ((AdapterView.AdapterContextMenuInfo) menuInfo).targetView)\n\t\t\t\t\t\t.getText());\n\t\t\t\tmenu.add(0, CONTEXTMENU_EDITITEM, 0, \"Edit this VDR!\");\n\t\t\t\tmenu.add(0, CONTEXTMENU_DELETEITEM, 0, \"Delete this VDR!\");\n\t\t\t\t/* Add as many context-menu-options as you want to. */\n\n\t\t\t}\n\t\t});\n\t}", "void setupToolbarDropDown(List<? extends CharSequence> dropDownItemList);", "@Override\r\n\t\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n public void contextMenuOpened(ObservableList<GUITemplate> selected) {\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.action_settings) {\n return true;\n }\n if (R.id.action_add == id && mSelectedItem == 1) {\n return mFencesFragment.onOptionsItemSelected(item);\n } else if (R.id.action_add == id && mSelectedItem == 2) {\n return mTargetsFragment.onOptionsItemSelected(item);\n }\n return super.onOptionsItemSelected(item);\n }", "void populateCellMenu(Cell cell, List<String> actions);", "@SuppressWarnings(\"unchecked\")\n\tpublic void chooseAction(String actionSet, String action) {\n\t\topen();\n\n\t\tnew DefaultCombo().setSelection(actionSet);\n\t\tnew DefaultTreeItem(new TreeItemRegexMatcher(action + \".*\")).doubleClick();\n\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\n\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "public void buildConsultantComboBox(){\r\n combo_user.getSelectionModel().selectFirst(); // Select the first element\r\n \r\n // Update each timewindow to show the string representation of the window\r\n Callback<ListView<User>, ListCell<User>> factory = lv -> new ListCell<User>(){\r\n @Override\r\n protected void updateItem(User user, boolean empty) {\r\n super.updateItem(user, empty);\r\n setText(empty ? \"\" : user.getName());\r\n }\r\n };\r\n \r\n combo_user.setCellFactory(factory);\r\n combo_user.setButtonCell(factory.call(null)); \r\n }", "public void buildSelectedAction() {\n\t\tfinal List<Project> selectedItems = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (!selectedItems.isEmpty()) {\n\t\t\tnavigationController.clickProgress();\n\t\t\tprojectService.build(selectedItems, false);\n\t\t}\n\t}" ]
[ "0.58235073", "0.58235073", "0.5747465", "0.5703662", "0.5703662", "0.5703662", "0.5688454", "0.56437784", "0.560666", "0.55138105", "0.54741985", "0.54093045", "0.5375858", "0.53725463", "0.5354195", "0.53490907", "0.5341077", "0.5335554", "0.531762", "0.5317074", "0.53130674", "0.5260466", "0.52481127", "0.5238135", "0.52273476", "0.5223421", "0.51993513", "0.5179649", "0.51728934", "0.5163457", "0.5161659", "0.51603925", "0.515526", "0.5150151", "0.5150151", "0.5147512", "0.5142742", "0.5138575", "0.51343256", "0.5133584", "0.5132573", "0.5132573", "0.5132573", "0.5132573", "0.51288235", "0.5126473", "0.5120477", "0.5119064", "0.5112355", "0.5102882", "0.5102239", "0.5100892", "0.5098797", "0.5096882", "0.5095001", "0.509441", "0.50877994", "0.5076394", "0.50727963", "0.5062945", "0.50586295", "0.5058626", "0.5056317", "0.5052964", "0.5049809", "0.50417125", "0.5038954", "0.503881", "0.50378525", "0.50327253", "0.50269496", "0.50266397", "0.50266397", "0.50266397", "0.50266397", "0.50266397", "0.50266397", "0.5023987", "0.5020106", "0.5019551", "0.5019551", "0.50177014", "0.50112957", "0.5009476", "0.50035655", "0.5002764", "0.50005394", "0.49951047", "0.49909312", "0.49902126", "0.49853632", "0.4982521", "0.49803853", "0.4980108", "0.4980108", "0.4980108", "0.4980108", "0.4980108", "0.4980108", "0.49795622", "0.4975647" ]
0.0
-1
Create a default action using a ListView as the selection tool in the expanded state, and a combo box otherwise, with the default customization action.
public static <T> FolderPanel<T> create(String folder, Class<T> selectionType, Consumer<Lookup> customizeAction) { return create(folder, selectionType, "", customizeAction); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "public LimeComboBox(List<Action> newActions) { \n setText(null);\n actions = new ArrayList<Action>();\n addActions(newActions);\n \n if (!actions.isEmpty()) {\n selectedAction = actions.get(0);\n } else {\n selectedAction = null;\n } \n \n initModel();\n \n actionListener = new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n ActionLabel label = (ActionLabel)e.getSource();\n Action action = label.getAction();\n selectedAction = action;\n selectedComponent = (JComponent)label.getParent();\n selectedLabel = label;\n fireChangeEvent(action);\n repaint();\n menu.setVisible(false);\n }\n };\n \n mouseListener = new MouseAdapter() {\n \n private final Color foreground = UIManager.getColor(\"MenuItem.foreground\");\n private final Color selectedForeground = UIManager.getColor(\"MenuItem.selectionForeground\");\n \n @Override\n public void mouseEntered(MouseEvent e) {\n paintNormal(e.getSource(), true);\n }\n \n @Override\n public void mouseExited(MouseEvent e) {\n paintNormal(e.getSource(), false);\n }\n \n @Override\n public void mouseClicked(MouseEvent e) {\n paintNormal(e.getSource(), true);\n }\n \n private void paintNormal(Object source, boolean selected) {\n JComponent label = (JComponent)source;\n label.setForeground(selected ? selectedForeground : foreground );\n \n JComponent parent = (JComponent) label.getParent();\n parent.setOpaque(selected);\n parent.repaint();\n \n // Remove highlight on the last selected component.\n if (selectedComponent != null && selectedComponent != parent) {\n selectedLabel.setForeground(foreground);\n selectedComponent.setOpaque(false);\n selectedComponent.repaint();\n selectedLabel = null;\n selectedComponent = null;\n }\n }\n };\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true; // Return true to expand action view\n }", "public void selected(String action);", "private void initializeMenuForListView() {\n\t\tMenuItem sItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_S_MENU));\n\t\tsItem.setOnAction(event ->\n\t\t\taddSAction()\n\t\t);\n\t\t\n\t\tMenuItem scItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_SC_MENU));\n\t\tscItem.setOnAction(event ->\n\t\t\t\taddScAction()\n\t\t);\n\t\t\n\t\tContextMenu menu = new ContextMenu(sItem, scItem);\n\t\tfirstListView.setContextMenu(menu);\n\t\tsecondListView.setContextMenu(menu);\n\t}", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true;\n }", "@Override\n public boolean onCreateActionMode(ActionMode mode, Menu menu)\n {\n MenuInflater inflater = mode.getMenuInflater();\n inflater.inflate(R.menu.menu_multi_select, menu);\n multi_select_menu = menu;\n adapter.is_action_mode = true;\n adapter.notifyDataSetChanged();\n fab.hide();\n //context_menu = menu;\n return true;\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.expandable_list_view_test, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n //menu.setHeaderTitle(\"Select The Action\");\n menu.add(0, v.getId(), 0, \"Edit word\");\n menu.add(1, v.getId(), 0, \"Delete word\");\n\n super.onCreateContextMenu(menu, v, menuInfo);\n }", "public void listAction () {//GEN-END:|13-action|0|13-preAction\n // enter pre-action user code here\nString __selectedString = getList ().getString (getList ().getSelectedIndex ());//GEN-BEGIN:|13-action|1|17-preAction\nif (__selectedString != null) {\nif (__selectedString.equals (\"S\\u00F6k text\")) {//GEN-END:|13-action|1|17-preAction\n // write pre-action user code here\nswitchDisplayable (null, getSeatchform ());//GEN-LINE:|13-action|2|17-postAction\n // write post-action user code here\n} else if (__selectedString.equals (\"Tidigare s\\u00F6kningar\")) {//GEN-LINE:|13-action|3|18-preAction\n // write pre-action user code here\nswitchDisplayable (null, getSearchList ());//GEN-LINE:|13-action|4|18-postAction\n // write post-action user code here\n}//GEN-BEGIN:|13-action|5|13-postAction\n}//GEN-END:|13-action|5|13-postAction\n // enter post-action user code here\n}", "@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\n\n return true;\n }", "abstract public void cabMultiselectPrimaryAction();", "@Override\n public boolean onPrepareActionMode(ActionMode mode, Menu menu) {\n// if (mSelectedItem==1) {\n// MenuInflater inflater = mode.getMenuInflater();\n// inflater.inflate(R.menu.geo, menu);\n// }\n return true; // Return false if nothing is done\n }", "public void selectionChanged(Action item);", "protected abstract PopupMenuHelper createActionMenuHelper();", "@Override\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n int id = item.getItemId();\n //use switch condition\n switch (id){\n case R.id.select_delete:\n //when click delete\n //use for loop\n for (NoteEntity noteSelect :selectList) {\n //remove select item from list\n list.remove(noteSelect);\n mainViewModel.deleteById(noteSelect.getId());\n }\n //check condition\n if (list.size()==0){\n //when list is empty\n //visible text view\n tvEmpty.setVisibility(View.VISIBLE);\n }\n mode.finish();\n break;\n case R.id.select_all:\n //when click on select all\n //check condition\n if (selectList.size() == list.size()){\n //when all item selected\n //set isSelectAll false\n isSelectAll = false;\n //clear select list\n selectList.clear();\n }else {\n //when all item unselected\n //set isSelectAll true\n isSelectAll = true;\n //clear list\n selectList.clear();\n //add all values in select list\n selectList.addAll(list);\n }\n //set text in view mode\n mainViewModel.setSelectedLiveData(String.valueOf(selectList.size()));\n //notify adaptor\n notifyDataSetChanged();\n break;\n }\n return true;\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n menu.setHeaderTitle(\"Select the Action\");\n getMenuInflater().inflate(R.menu.my_context_menu, menu); // add costume menu\n }", "public void createNewItem(ActionEvent actionEvent) {\n // we will create a new item instance here (ideally we would use another window for this)\n // and then we will simply addItem() to the currently selected list\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!isEdit) {\r\n\t\t\t\t\txb_popup.showAsDropDown(xbet, 0, 1, xbet.getWidth(),\r\n\t\t\t\t\t\t\tLayoutParams.WRAP_CONTENT);\r\n\t\t\t\t}\r\n\t\t\t}", "protected ListView<T> createTargetListView() {\n/* 447 */ return createListView();\n/* */ }", "private void setupListViewListener() {\n\t\t\n\t\t// OnItemLongClick - show edit options\n\t\tlvItems.setOnItemLongClickListener(new OnItemLongClickListener() {\n\t\t\t@Override\n\t\t\tpublic boolean onItemLongClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long rowId) {\n\n\t\t\t\titemsAdapter.setSelectedPosition(position);\n\t\t\t\tif (itemsAdapter.getSelectedPosition() == -1)\n\t\t\t\t\tgetActionBar().hide();\n\t\t\t\telse {\n\t\t\t\t\tgetActionBar().setDisplayShowHomeEnabled(false);\n\t\t\t\t\tgetActionBar().show();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn true;\n\n\t\t\t}\n\t\t});\n\t\t// OnItemClick - Open Detail Screen\n\t\tlvItems.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long rowId) {\n\t\t\t\titemsAdapter.unsetSelectedPosition();\n\t\t\t\tgetActionBar().hide();\n\t\t\t\tIntent i = new Intent(TodoActivity.this, EditItemActivity.class);\n\t\t\t\ti.putExtra(\"position\", position);\n\t\t\t\tTodoItem item = (TodoItem) parent.getItemAtPosition(position);\n\t\t\t\ti.putExtra(\"item\", item);\n\t\t\t\tstartActivityForResult(i, REQUEST_CODE);\n\n\t\t\t}\n\n\t\t});\n\n\t}", "@Override\n public void onClick(View view) {\n if(view.isSelected()){\n view.setSelected(false);\n selectedList.remove((Integer) getAdapterPosition());\n }\n else{\n view.setSelected(true);\n selectedList.add((Integer) getAdapterPosition());\n }\n\n //when a meta magic is selected we allow the modifications\n if(! (selectedList == null) && ! selectedList.isEmpty()){\n parent.findViewById(R.id.buttonDelete).setEnabled(true);\n\n //we allow modification only if there is one item selected\n if(selectedList.size() == 1)\n {\n parent.findViewById(R.id.buttonEdit).setEnabled(true);\n }\n else\n {\n parent.findViewById(R.id.buttonEdit).setEnabled(false);\n }\n\n }\n else{\n parent.findViewById(R.id.buttonDelete).setEnabled(false);\n parent.findViewById(R.id.buttonEdit).setEnabled(false);\n }\n\n }", "public void toSelectingAction() {\n }", "@Override\r\n public boolean onActionItemClicked(ActionMode mode, MenuItem item) {\r\n // TODO Auto-generated method stub\r\n return false;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void initDefaultCommand() {\n setDefaultCommand(new operateClimber());\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n adapter.setFilter(lista1);\n return true; // Return true to collapse action view\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.action_add_widget) {\n\n selectWidget();\n\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public ActionMenuItem() {\n this(\"\");\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "@Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n return true; // Return true to collapse action view\n }", "@Override\r\n public SystemAction getDefaultAction() {\n return SystemAction.get(OpenAction.class);\r\n }", "private void bind() \r\n\t{\r\n\t\tsuper.menuPut(\"list\", newJMenu(\"List\", 'L'));\r\n\t\tsuper.menuPut(\"list/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionNew(x));\r\n\t\tsuper.menuPut(\"list/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionLoad(x));\r\n\t\tsuper.menuPut(\"list/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionSave(x));\r\n\t\tsuper.menuPut(\"list/***1\", \"\");\r\n\t\tsuper.menuPut(\"list/add\", newJMenuItem(\"Add\", 'A', KeyEvent.VK_4, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionAdd(x));\r\n\t\tsuper.menuPut(\"list/remove\", newJMenuItem(\"Remove\", 'R', KeyEvent.VK_5, ActionEvent.SHIFT_MASK | ActionEvent.CTRL_MASK), x -> menuFile.actionRemove(x));\r\n\t\t\r\n\t\tsuper.menuPut(\"tree\", newJMenu(\"Tree\", 'T'));\r\n\t\tsuper.menuPut(\"tree/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.SHIFT_MASK), x -> menuEdit.actionNew(x));\r\n\t\tsuper.menuPut(\"tree/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.SHIFT_MASK), x -> menuEdit.actionLoad(x));\r\n\t\tsuper.menuPut(\"tree/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.SHIFT_MASK), x -> menuEdit.actionSave(x));\r\n\t\tsuper.menuPut(\"tree/***1\", \"\");\r\n\t\tsuper.menuPut(\"tree/add\", newJMenuItem(\"Add\", 'A', KeyEvent.VK_4, ActionEvent.SHIFT_MASK), x -> menuEdit.actionAdd(x));\r\n\t\tsuper.menuPut(\"tree/remove\", newJMenuItem(\"Remove\", 'R', KeyEvent.VK_5, ActionEvent.SHIFT_MASK), x -> menuEdit.actionRemove(x));\r\n\t\tsuper.menuPut(\"tree/move\", newJMenuItem(\"Move\", 'V', KeyEvent.VK_6, ActionEvent.SHIFT_MASK), x -> menuEdit.actionMove(x));\r\n\t\t\r\n\t\tsuper.menuPut(\"graph\", newJMenu(\"Graph\", 'G'));\r\n\t\tsuper.menuPut(\"graph/new\", newJMenuItem(\"New\", 'N', KeyEvent.VK_1, ActionEvent.CTRL_MASK), x -> menuHelp.actionNew(x));\r\n\t\tsuper.menuPut(\"graph/open\", newJMenuItem(\"Open\", 'O', KeyEvent.VK_2, ActionEvent.CTRL_MASK), x -> menuHelp.actionOpen(x));\r\n\t\tsuper.menuPut(\"graph/save\", newJMenuItem(\"Save\", 'S', KeyEvent.VK_3, ActionEvent.CTRL_MASK), x -> menuHelp.actionSave(x));\r\n\t\tsuper.menuPut(\"graph/***1\", \"\");\r\n\t\tsuper.menuPut(\"graph/add-node\", newJMenuItem(\"Add node\", 'A', KeyEvent.VK_4, ActionEvent.CTRL_MASK), x -> menuHelp.actionAddNode(x));\r\n\t\tsuper.menuPut(\"graph/remove-node\", newJMenuItem(\"Remove node\", 'R', KeyEvent.VK_5, ActionEvent.CTRL_MASK), x -> menuHelp.actionRemoveNode(x));\r\n\t\tsuper.menuPut(\"graph/move-node\", newJMenuItem(\"Move node\", 'V', KeyEvent.VK_6, ActionEvent.CTRL_MASK), x -> menuHelp.actionMoveNode(x));\r\n\t\tsuper.menuPut(\"graph/***2\", \"\");\r\n\t\tsuper.menuPut(\"graph/add-link\", newJMenuItem(\"Add link\", 'D', KeyEvent.VK_7, ActionEvent.CTRL_MASK), x -> menuHelp.actionAddLink(x));\r\n\t\tsuper.menuPut(\"graph/remove-link\", newJMenuItem(\"Remove link\", 'L', KeyEvent.VK_8, ActionEvent.CTRL_MASK), x -> menuHelp.actionRemoveLink(x));\r\n\t\t\r\n\t\tsuper.menuDump();\t\t\r\n\t}", "@Override\r\n\tpublic boolean onCreateActionMode(ActionMode mode, Menu menu) {\n\t\ttype = SINGLE_MODE;\r\n\t\tinflater = getSherlockActivity().getSupportMenuInflater();\r\n\t\tinflater.inflate(R.menu.movies_list_single_selection, menu);\r\n\r\n\t\treturn true;\r\n\t}", "public ActionChangeButton(final ActionChanger<?> action) {\n this((String) action.getValue(Action.NAME), (ResizableIcon) action.getValue(Action.LARGE_ICON_KEY));\n addAction(action);\n setDefaultAction(action);\n setState(ElementState.SMALL, true);\n setCommandButtonKind(CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);\n\n this.addPopupMenuListener(new PopupMenuListener() {\n\n @Override\n public void menuAboutToShow(final JPopupMenu popup) {\n for (final Action action : actions) {\n popup.add(new JMenuItem(action));\n }\n }\n\n });\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n\n return super.onOptionsItemSelected(item);\n }", "protected ViewerPopupMenu createPopupMenu()\n {\n ViewerPopupMenu menu = super.createPopupMenu();\n\n viewAction = new ViewerAction(this, \"View\", \"view\",\n \"View Dofs\",\n \"View the dofs of an Actor in table form.\",\n null, null, \"Ctrl-V\", null, \"false\");\n\n menu.addSeparator();\n menu.add(viewAction);\n\n return menu;\n }", "@OnClick(R.id.converter_sale_or_purchase_cv)\n public void chooseAction() {\n mDialog = new DialogList(mContext,\n mActionDialogTitle, mListForActionDialog, null,\n new RecyclerViewAdapterDialogList.OnItemClickListener() {\n @Override\n public void onClick(int position) {\n if (position == 0) {\n mAction = ConstantsManager.CONVERTER_ACTION_PURCHASE;\n } else {\n mAction = ConstantsManager.CONVERTER_ACTION_SALE;\n }\n mPreferenceManager.setConverterAction(mAction);\n mDialog.getDialog().dismiss();\n setLang();\n }\n });\n ((ImageView) mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done))\n .setImageResource(R.drawable.ic_tr);\n mDialog.getDialog().getWindow().findViewById(R.id.dialog_list_done)\n .setBackground(getResources().getDrawable(R.drawable.ic_tr));\n }", "public void initDefaultCommand() {\n \tsetDefaultCommand(new boxChange());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n if (mActionMode != null)\n onListItemSelect(position);\n }", "@Override\r\n\tpublic String getAction() {\n\t\tString action = null;\r\n\t\tif(caction.getSelectedIndex() == -1) {\r\n\t\t\treturn null;\r\n\t}\r\n\tif(caction.getSelectedIndex() >= 0) {\r\n\t\t\taction = caction.getSelectedItem().toString();\r\n\t}\r\n\t\treturn action;\r\n\t\r\n\t}", "public ActionBarDropDown(Context context) {\n super(context);\n\n CheckUtil.isContextThemeWrapper(context);\n CheckUtil.isUIThread(context);\n\n mMeasureSpecM2 = HtcResUtil.getM2(context);\n\n getDefaultHeight();\n // setup the module overall environment\n // setPadding(padding,0,padding,0);\n setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));\n\n // inflate the external layout and merge to current layout\n LayoutInflater.from(context).inflate(R.layout.action_dropdown, this, true);\n\n mArrowView = (ImageView) findViewById(R.id.arrow);\n mPrimaryView = (ActionBarTextView) findViewById(R.id.primary);\n mSecondaryView = (ActionBarTextView) findViewById(R.id.secondary);\n mCounterView = (ActionBarTextView) findViewById(R.id.counter);\n // check the layout resource correctness\n if (mPrimaryView == null || mSecondaryView == null || mArrowView == null) throw new RuntimeException(\"inflate layout resource incorrect\");\n\n mPrimaryView.setState(ActionBarTextView.PRIMARY_DEFAULT_ONLY);\n mSecondaryView.setState(ActionBarTextView.SECONDARY_DEFAULT);\n mCounterView.setState(ActionBarTextView.COUNTER_FOLLOW_PRIMARY);\n\n setBackground(ActionBarUtil.getActionMenuItemBackground(context));\n\n /* support D-Pad function */\n setFocusable(true);\n }", "protected void createContextMenu() {\n\t\t// TODO : XML Editor 에서 Query Editor 관련 Action 삭제~~\n\t\tMenuManager contextMenu = new MenuManager(\"#PopUp\"); //$NON-NLS-1$\n\t\tcontextMenu.add(new Separator(\"additions\")); //$NON-NLS-1$\n\t\tcontextMenu.setRemoveAllWhenShown(true);\n\t\tcontextMenu.addMenuListener(new NodeActionMenuListener());\n\t\tMenu menu = contextMenu.createContextMenu(getControl());\n\t\tgetControl().setMenu(menu);\n\t\t// makeActions();\n\t\t// hookSingleClickAction();\n\n\t}", "public void setButtonSelection(String action);", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_settings:\n\n startActivity(new Intent(ListViewCompany.this, Help.class));\n\n return true;\n\n default:\n\n return super.onOptionsItemSelected(item);\n }\n }", "public void createNewList(ActionEvent actionEvent) {\n // ideally again, this would have its own window\n // give it a title, and optionally populate it with some items\n }", "@Override\n public void setActivePart(IAction action, IWorkbenchPart targetPart) {}", "private void initializeActionModeHelper() {\n mActionModeHelper = new ActionModeHelper(mAdapter, R.menu.menu_action_header, this) {\n // Override to customize the title\n @Override\n public void updateContextTitle(int count) {\n // You can use the internal mActionMode instance\n if (mActionMode != null) {\n int position = mAdapter.getSelectedPositions().get(0);\n AbstractFlexibleItem item = mAdapter.getItem(position);\n mActionMode.setTitle(fontifyString(getActivity(), getString(R.string.action_edit_category, item)));\n }\n }\n }.withDefaultMode(SelectableAdapter.Mode.SINGLE);\n mActionModeHelper.withDefaultMode(SelectableAdapter.Mode.SINGLE);\n mAdapter.setMode(SelectableAdapter.Mode.SINGLE);\n }", "public void setDefaultAction(final ActionChanger<?> defaultAction) {\n if ((defaultAction != null) && (actions.indexOf(defaultAction) != -1)) {\n removeActionListener(this.defaultAction);\n this.defaultAction = defaultAction;\n addActionListener(this.defaultAction);\n final Object objIcon = defaultAction.getValue(Action.LARGE_ICON_KEY);\n if (objIcon instanceof ResizableIcon) {\n setIcon((ResizableIcon) objIcon);\n }\n setText((String) defaultAction.getValue(Action.NAME));\n setToolTipText((String) defaultAction.getValue(Action.SHORT_DESCRIPTION));\n }\n }", "@Override\n public boolean onOptionsItemSelected(android.view.MenuItem item) {\n int id = item.getItemId();\n if (!editing) {\n item.setTitle(getResources().getString(R.string.done));\n editing = true;\n }else{\n item.setTitle(getResources().getString(R.string.edit));\n editing = false;\n }\n customAdapter.notifyDataSetChanged();\n return super.onOptionsItemSelected(item);\n }", "boolean onExtendMenuItemClick(int itemId, View view);", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tmenu.add(group1Id, Edit, Edit, \"Edit\");\n\t\t\tmenu.add(group1Id, Delete, Delete, \"Delete\");\n\t\t\tmenu.add(group1Id, Finish, Finish, \"Finish\");\n\t\t\treturn super.onCreateOptionsMenu(menu); \n\t\t}", "@Override\n public List<UpdatableItem> createPopup() {\n final List<UpdatableItem> items = new ArrayList<UpdatableItem>();\n \n /* host wizard */\n final MyMenuItem newHostWizardItem =\n new MyMenuItem(Tools.getString(\"EmptyBrowser.NewHostWizard\"),\n HOST_ICON,\n null,\n new AccessMode(ConfigData.AccessType.RO, false),\n new AccessMode(ConfigData.AccessType.RO, false)) {\n private static final long serialVersionUID = 1L;\n \n @Override\n public String enablePredicate() {\n return null;\n }\n \n @Override\n public void action() {\n final AddHostDialog dialog = new AddHostDialog(new Host());\n dialog.showDialogs();\n }\n };\n items.add(newHostWizardItem);\n Tools.getGUIData().registerAddHostButton(newHostWizardItem);\n return items;\n }", "@Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n reloadMenuItem.setVisible(false);\n listToggleMenuItem.setVisible(false);\n mIsSearchMode = true;\n return true;\n }", "private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \t\t}\n \t\t\n \t}", "@Override\n public void widgetDefaultSelected(SelectionEvent exc) {\n }", "ActionOpen()\n {\n super(\"Open\");\n this.setShortcut(UtilGUI.createKeyStroke('O', true));\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v,\n ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n menu.setHeaderTitle(\"Select Action:\");\n menu.add(0, v.getId(), 0, \"Edit Activity\");\n menu.add(0, v.getId(), 0, \"Delete Activity\");\n getActivityDetails(v);\n }", "public Menu createViewMenu();", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n\n }", "private boolean performAction(int action) {\n TagEditorFragment tagEditorFragment = (TagEditorFragment) caller;\n final int size = rows.getChildCount();\n List<TagEditRow> selected = new ArrayList<>();\n for (int i = 0; i < size; ++i) {\n View view = rows.getChildAt(i);\n TagEditRow row = (TagEditRow) view;\n if (row.isSelected()) {\n selected.add(row);\n }\n }\n switch (action) {\n case MENU_ITEM_DELETE:\n if (!selected.isEmpty()) {\n for (TagEditRow r : selected) {\n r.delete();\n }\n tagEditorFragment.updateAutocompletePresetItem(null);\n }\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_COPY:\n copyTags(selected, false);\n tagEditorFragment.updateAutocompletePresetItem(null);\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_CUT:\n copyTags(selected, true);\n if (currentAction != null) {\n currentAction.finish();\n }\n break;\n case MENU_ITEM_CREATE_PRESET:\n CustomPreset.create(tagEditorFragment, selected);\n tagEditorFragment.presetFilterUpdate.update(null);\n break;\n case MENU_ITEM_SELECT_ALL:\n ((PropertyRows) caller).selectAllRows();\n return true;\n case MENU_ITEM_DESELECT_ALL:\n ((PropertyRows) caller).deselectAllRows();\n return true;\n case MENU_ITEM_HELP:\n HelpViewer.start(caller.getActivity(), R.string.help_propertyeditor);\n return true;\n default:\n return false;\n }\n return true;\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n\n getActivity().getMenuInflater().inflate(R.menu.actions , menu);\n\n }", "@Override\n public void showContextMenu()\n {\n showContextMenu(selection, View.SELECTION);\n }", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}", "public ContentCard defaultAction(ContentCardAction defaultAction) {\n this.defaultAction = defaultAction;\n return this;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.buttonListView:\n showActivityEntries();\n return true;\n case R.id.buttonManualAdd:\n showActivityAdd();\n return true;\n case R.id.action_settings:\n \tgetFragmentManager().beginTransaction()\n .replace(android.R.id.content, new SettingsFragment())\n .addToBackStack(null)\n .commit();\n \treturn true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "public void addActionChoice () {\r\n\t\tactionChoices.add(new ActionChoice());\r\n\t}", "private SelectOSAction() {\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n if (id == R.id.action_add) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Add Item\");\n\n\n\n\n final EditText input = new EditText(this);\n builder.setView(input);\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n masterItems.add(preferredCase(input.getText().toString()));\n Collections.sort(masterItems);\n storeArrayVal(masterItems, getApplicationContext());\n lv.setAdapter(adapter);\n }\n });\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n builder.show();\n return true;\n\n\n }\n\n\n if (id == R.id.action_clear) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Clear Entire List\");\n builder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n masterItems.clear();\n lv.setAdapter(adapter);\n }\n });\n builder.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n builder.show();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void initListView() {\n\t\trefreshListItems();\n\n\t\t/* Add Context-Menu listener to the ListView. */\n\t\tlv.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCreateContextMenu(ContextMenu menu, View v,\n\t\t\t\t\tContextMenu.ContextMenuInfo menuInfo) {\n\t\t\t\tmenu.setHeaderTitle(((TextView) ((AdapterView.AdapterContextMenuInfo) menuInfo).targetView)\n\t\t\t\t\t\t.getText());\n\t\t\t\tmenu.add(0, CONTEXTMENU_EDITITEM, 0, \"Edit this VDR!\");\n\t\t\t\tmenu.add(0, CONTEXTMENU_DELETEITEM, 0, \"Delete this VDR!\");\n\t\t\t\t/* Add as many context-menu-options as you want to. */\n\n\t\t\t}\n\t\t});\n\t}", "private void createToolBarActions() {\r\n\t\t// create the action\r\n\t\tGetMessage<Transport> getMessage = new GetMessage<Transport>(new Transport());\r\n\t\tgetMessage.addParameter(IFilterTypes.TRANSPORT_TODO_FILTER, \"\");\r\n\r\n\t\t// add to the toolbar\r\n\t\tform.getToolBarManager().add(new RefreshViewAction<Transport>(getMessage));\r\n\t\tform.getToolBarManager().update(true);\r\n\t}", "void setupToolbarDropDown(List<? extends CharSequence> dropDownItemList);", "@Override\r\n\t\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n public void contextMenuOpened(ObservableList<GUITemplate> selected) {\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.action_settings) {\n return true;\n }\n if (R.id.action_add == id && mSelectedItem == 1) {\n return mFencesFragment.onOptionsItemSelected(item);\n } else if (R.id.action_add == id && mSelectedItem == 2) {\n return mTargetsFragment.onOptionsItemSelected(item);\n }\n return super.onOptionsItemSelected(item);\n }", "void populateCellMenu(Cell cell, List<String> actions);", "@SuppressWarnings(\"unchecked\")\n\tpublic void chooseAction(String actionSet, String action) {\n\t\topen();\n\n\t\tnew DefaultCombo().setSelection(actionSet);\n\t\tnew DefaultTreeItem(new TreeItemRegexMatcher(action + \".*\")).doubleClick();\n\t}", "@Override\n\t\t\tpublic void widgetDefaultSelected(SelectionEvent e) {\n\n\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return super.onOptionsItemSelected(item);\n }", "public void buildConsultantComboBox(){\r\n combo_user.getSelectionModel().selectFirst(); // Select the first element\r\n \r\n // Update each timewindow to show the string representation of the window\r\n Callback<ListView<User>, ListCell<User>> factory = lv -> new ListCell<User>(){\r\n @Override\r\n protected void updateItem(User user, boolean empty) {\r\n super.updateItem(user, empty);\r\n setText(empty ? \"\" : user.getName());\r\n }\r\n };\r\n \r\n combo_user.setCellFactory(factory);\r\n combo_user.setButtonCell(factory.call(null)); \r\n }", "public void buildSelectedAction() {\n\t\tfinal List<Project> selectedItems = selectionList.getSelectionModel().getSelectedItems();\n\t\tif (!selectedItems.isEmpty()) {\n\t\t\tnavigationController.clickProgress();\n\t\t\tprojectService.build(selectedItems, false);\n\t\t}\n\t}" ]
[ "0.5822778", "0.5822778", "0.5748068", "0.57028687", "0.57028687", "0.57028687", "0.56876415", "0.564315", "0.56085795", "0.5512862", "0.5474224", "0.54100776", "0.5376957", "0.53727823", "0.5353767", "0.53485817", "0.5340975", "0.53346336", "0.531841", "0.5316582", "0.5314907", "0.5260893", "0.524854", "0.52400154", "0.52288777", "0.5223279", "0.51985365", "0.5179176", "0.5173674", "0.51635695", "0.5160192", "0.516008", "0.5156113", "0.5148872", "0.5148872", "0.51472974", "0.5143625", "0.5139414", "0.513479", "0.51335716", "0.51325345", "0.51325345", "0.51325345", "0.51325345", "0.5129146", "0.5128711", "0.5120475", "0.5119245", "0.5110494", "0.5102689", "0.51026213", "0.51024395", "0.50989026", "0.5097207", "0.5095757", "0.5094141", "0.5087463", "0.50750065", "0.50723255", "0.5063243", "0.5059152", "0.5057755", "0.5055897", "0.50525707", "0.5050307", "0.50437385", "0.50402045", "0.5039031", "0.5038725", "0.50344723", "0.5028724", "0.50264174", "0.50264174", "0.50264174", "0.50264174", "0.50264174", "0.50264174", "0.50230247", "0.5020707", "0.5019516", "0.5019516", "0.5016285", "0.50122994", "0.50104713", "0.5005412", "0.5004317", "0.50009245", "0.49948925", "0.49930215", "0.4989968", "0.49865034", "0.4982216", "0.4980132", "0.49801072", "0.49801072", "0.49801072", "0.49801072", "0.49801072", "0.49801072", "0.4979028", "0.4977091" ]
0.0
-1
This method adds new tabs to the tab pane
public void addTab(String filename) { MinLFile nminl = new MinLFile(filename); JComponent panel = nminl; tabbedPane.addTab(filename, null, panel, filename); tabbedPane.setMnemonicAt(0, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initTabs() {\n\t\tJPanel newTab = new JPanel();\r\n\t\taddTab(\"\", newTab); //$NON-NLS-1$\r\n\t\tsetTabComponentAt(0, new NewPaneButton());\r\n\t\tsetEnabledAt(0, false);\r\n\t\t// Add a new pane\r\n\t\taddPane();\r\n }", "public void addNewTab() {\n int count = workspaceTabs.getComponentCount() + 1;\n String title = \"Workspace \" + count;\n WorkspacePanel panel = new WorkspacePanel(title);\n DropHandler dropHandler = searchMenu.createDropHandler(panel.getBaseLayout());\n panel.setDropHandler(dropHandler);\n workspaceTabs.addTab(panel).setCaption(title);\n }", "private void createTabs() {\r\n\t\ttabbedPane = new JTabbedPane();\r\n\t\t\r\n\t\t//changes title and status bar \r\n\t\ttabbedPane.addChangeListener((l) -> { \r\n\t\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\t\tif (index < 0) {\r\n\t\t\t\tcurrentFile = \"-\";\r\n\t\t\t} else {\r\n\t\t\t\tcurrentFile = tabbedPane.getToolTipTextAt(index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (currentFile.isEmpty()) {\t//file not yet saved\r\n\t\t\t\tcurrentFile = tabbedPane.getTitleAt(tabbedPane.getSelectedIndex());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTitle(currentFile + \" - JNotepad++\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tJTextArea current = getSelectedTextArea();\r\n\t\t\tif (current == null) return;\r\n\t\t\tCaretListener[] listeners = current.getCaretListeners();\r\n\t\t\tlisteners[0].caretUpdate(new CaretEvent(current) {\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Serial UID.\r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getMark() {\r\n\t\t\t\t\treturn 0;\t//not used\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getDot() {\r\n\t\t\t\t\treturn current.getCaretPosition();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t\tcreateSingleTab(null, null);\r\n\t\tgetContentPane().add(tabbedPane, BorderLayout.CENTER);\t\r\n\t}", "@Override\n\tpublic void addTab(Tab tab) {\n\t\t\n\t}", "@Override\n\tpublic void addTab(Tab tab, int position, boolean setSelected) {\n\t\t\n\t}", "@Override\n\tpublic void addTab(Tab tab, int position) {\n\t\t\n\t}", "@Override\n\tpublic void addTab(Tab tab, boolean setSelected) {\n\t\t\n\t}", "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.connect);\n tabLayout.getTabAt(1).setIcon(R.drawable.speak);\n tabLayout.getTabAt(2).setIcon(R.drawable.walk);\n tabLayout.getTabAt(3).setIcon(R.drawable.camera);\n tabLayout.getTabAt(4).setIcon(R.drawable.moves);\n }", "private void addNewTab(SingleDocumentModel model) {\n\t\tString title = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().getFileName().toString();\n\t\tImageIcon icon = createIcon(\"icons/green.png\");\n\t\tJScrollPane component = new JScrollPane(model.getTextComponent());\n\t\tString toolTip = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().toAbsolutePath().toString();\n\t\taddTab(title, icon, component, toolTip);\n\t\tsetSelectedComponent(component);\n\t}", "public void add(TabLike tab){\n TabLabel btn = tabLabelCreator.create(tab.getName(), this);\n\n tab.setVisible(tabs.isEmpty());\n btn.setDisable(tabs.isEmpty());\n if (tabs.isEmpty()){\n selected = btn;\n }\n\n tabs.add(tab);\n nameTab.getChildren().add(btn);\n tabContent.getChildren().add(tab);\n tab.setContainer(this);\n }", "public void addTab(Tab tab)\n\t{\n\t\ttabs.add(tab);\n\t}", "protected void addTab(Tab tab) {\n mUi.addTab(tab);\n }", "private void setupTabs() {\n }", "private void addTab(String title, File file, String contents) {\n \tTextPane newTextPane = new TextPane(parentFrame,TextPane.getProperties(false), false);\r\n\r\n \t// 2nd create the tab\r\n \tStyledTab tab = new StyledTab(title);\r\n \tTextPaneTab paneTab = new TextPaneTab(file, newTextPane, tab);\r\n\r\n \t// 3rd add contents if any\r\n \tif (contents != null) {\r\n \t\tnewTextPane.getBuffer().insert(0, contents);\r\n \t\tnewTextPane.setCaretPosition(0);\r\n \t\tpaneTab.setModified(false);\r\n \t}\r\n\r\n \t// 4th add new TextPaneTab\r\n \tpanes.add(paneTab);\r\n\r\n \t// 5th create the pane and add it to manager\r\n \tJPanel pane = new JPanel();\r\n \tpane.setLayout(new BorderLayout());\r\n\t\tJPanel textPaneContainer = new JPanel();\r\n\t\ttextPaneContainer.setBorder(BorderFactory.createLineBorder(new Color(102, 102, 102), 1));\r\n\t\ttextPaneContainer.setLayout(new BorderLayout());\r\n\t\ttextPaneContainer.add(newTextPane, BorderLayout.CENTER);\r\n \tpane.add(textPaneContainer, BorderLayout.CENTER);\r\n \tpane.add(makePrgButtonPanel(), BorderLayout.EAST);\r\n \tint index = getTabCount()-1;\r\n \tinsertTab(title, null, pane, null, index);\r\n \tsetTabComponentAt(index,tab);\r\n \tif (!file.isDirectory())\r\n \t\tsetToolTipTextAt(index, file.getAbsolutePath());\r\n }", "public void openTab(String tabName){\r\n\r\n\t\tTabView selectedTabView = new TabView(this);\r\n\t\ttabViews.add(selectedTabView);\r\n\t\t\r\n\t\t\r\n\t\tif(tabName == null){ // If a new tab..\r\n\t\t\t// Ensure that there isn't already a model with that name\r\n\t\t\twhile(propertiesMemento.getTabNames().contains(tabName) || tabName == null){\r\n\t\t\t\ttabName = \"New Model \" + newModelIndex;\r\n\t\t\t\tnewModelIndex++;\r\n\t\t\t}\r\n\t\t}\r\n logger.info(\"Adding tab:\" + tabName);\r\n\r\n\t\t// Just resizes and doesn't scroll - so don't need the scroll pane\r\n\t\t/*JScrollPane scrollPane = new JScrollPane(selectedTabView, \r\n \t\t\t\t\t\t\t\t JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, \r\n \t\t\t\t\t\t\t\t JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\r\n scrollPane.getVerticalScrollBar().setUnitIncrement(20);\r\n tabbedPane.addTab(tabName, scrollPane);*/\r\n\r\n\t\ttabbedPane.addTab(tabName, selectedTabView);\r\n\r\n currentView = selectedTabView;\r\n tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);\r\n setTabName(tabName);\r\n\t\t\t\t\r\n tabbedPane.setTabComponentAt(tabbedPane.getSelectedIndex(), \r\n\t\t\t\t new TabButtonComponent(propertiesMemento.getImageDir(), this, currentView));\r\n \r\n // Add Mouse motion Listener \r\n currentView.addMouseMotionListener(currentView);\r\n currentView.addMouseListener(currentView);\r\n\r\n // Record the tab in the memento\r\n propertiesMemento.addTabRecord(tabName);\r\n \r\n setTabButtons(true);\r\n \r\n setStatusBarText(\"Ready\");\r\n\r\n requestFocusInWindow();\r\n\t}", "public void addTab (String tabname, boolean closeable, Widget widget, final String key) {\n\n\n\t\tPanel localTP = new Panel();\n\t\tlocalTP.setClosable(closeable);\n\t\tlocalTP.setTitle(tabname);\n\t\tlocalTP.setId(key + id);\n\t\tlocalTP.setAutoScroll(true);\n\t\tlocalTP.add(widget);\n\n\t\ttp.add(localTP, this.centerLayoutData);\n\n\t\tlocalTP.addListener(new PanelListenerAdapter() {\n\n\t\t\tpublic void onDestroy(Component component) {\n\t\t\t\topenedTabs.remove(key);\n\t\t\t}\n\t\t});\n\n\n\t\ttp.activate(localTP.getId());\n\n\n\n\n\t\topenedTabs.put(key, localTP);\n\t}", "@Override\n public void addTab(String title, Component component) {\n this.addTab(title, null, component, null, null);\n }", "private void initTabs() {\n\t\tmContainer.removeAllViews();\n\n\t\tif(mAdapter==null||mViewPager==null){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<mViewPager.getAdapter().getCount();i++){\n\t\t\tfinal int index=i;\n\t\t\tButton tabs= (Button) mAdapter.getView(index);\n\t\t\tLayoutParams layoutParams=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\t\tlayoutParams.weight=1;\n\t\t\tmContainer.addView(tabs,layoutParams);\n\t\t\t\n\t\t\ttabs.setOnClickListener(new OnClickListener(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tif(mViewPager.getCurrentItem()==index){\n\t\t\t\t\t\tselectTab(index);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmViewPager.setCurrentItem(index, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\tselectTab(0);\n\t}", "public void addedToDom() {\n activateTab();\n }", "private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}", "void addTab(Type<RequestTabsHandler> requestTabsEventType,\n Type<RevealContentHandler<?>> revealContentEventType,\n String label, String historyToken, boolean isMainTab,\n String contentUrl, TabOptions options) {\n dynamicUrlContentTabProxyFactory.create(\n requestTabsEventType, revealContentEventType,\n label, historyToken, isMainTab, contentUrl,\n options.getAlignRight() ? Align.RIGHT : Align.LEFT);\n\n // Redraw the corresponding tab container\n RedrawDynamicTabContainerEvent.fire(this, requestTabsEventType);\n }", "protected abstract void doAddTab(GridTab tab, JPiereIADTabpanel tabPanel);", "public void onCreateTabClicked(View view) {\n if (mAdapter.isEmpty()) {\n Toast.makeText(this, R.string.you_must_create_at_least_one_tab, Toast.LENGTH_LONG).show();\n return;\n }\n ArrayList<TabInformation> list = new ArrayList<>(mAdapter.getTabInformation());\n startActivity(new Intent(this, DisplayTabsActivity.class).putExtra(TAB_CONTENT, list));\n }", "public void initializeTabs() {\n\n\t\tTabHost.TabSpec spec;\n\n\t\tspec = mTabHost.newTabSpec(Const.EVENTS);\n\t\tmTabHost.setCurrentTab(0);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_events_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(1);\n\t\tspec = mTabHost.newTabSpec(Const.FEED);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_feed_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(2);\n\t\tspec = mTabHost.newTabSpec(Const.INFO);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_info_selector));\n\t\tmTabHost.addTab(spec);\n\n\t}", "public void addCompositeToTab(String tabName){\r\n\t\tTabItem item = new TabItem(folderReference, SWT.NONE);\r\n\t\titem.setText(tabName);\r\n\t\t\r\n\t\tfolderReference.getItem(compositeIndex).setControl(compositeMap.get(compositeIndex));\r\n\t\t++compositeIndex;\r\n\t}", "private static void AddTab(MenuActivity activity, TabHost tabHost,\n TabHost.TabSpec tabSpec, TabInfo tabInfo) {\n tabSpec.setContent(activity.new TabFactory(activity));\n tabHost.addTab(tabSpec);\n Log.i(\"LOG\",\"Cria Aba\");\n }", "private void createTabsDiv() {\n tabsDiv = new Block(Block.Div, \"id='tabs'\");\n page.add(tabsDiv);\n }", "private void addChatTab(ChatPanel chatPanel)\n {\n ChatSession chatSession = chatPanel.getChatSession();\n String chatName = chatSession.getChatName();\n\n ChatPanel currentChatPanel = getCurrentChat();\n\n if (currentChatPanel == null)\n {\n this.mainPanel.add(chatPanel, BorderLayout.CENTER);\n }\n else if (getChatTabCount() == 0)\n {\n ChatSession firstChatSession = currentChatPanel.getChatSession();\n\n // Add first two tabs to the tabbed pane.\n chatTabbedPane.addTab( firstChatSession.getChatName(),\n firstChatSession.getChatStatusIcon(),\n currentChatPanel);\n\n chatTabbedPane.addTab( chatName,\n chatSession.getChatStatusIcon(),\n chatPanel);\n\n // When added to the tabbed pane, the first chat panel should\n // rest the selected component.\n chatTabbedPane.setSelectedComponent(currentChatPanel);\n\n //add the chatTabbedPane to the window\n this.mainPanel.add(chatTabbedPane, BorderLayout.CENTER);\n this.mainPanel.validate();\n }\n else\n {\n // The tabbed pane already contains tabs.\n\n chatTabbedPane.addTab(\n chatName,\n chatSession.getChatStatusIcon(),\n chatPanel);\n\n chatTabbedPane.getParent().validate();\n }\n }", "private void layoutTabs() {\n\tJTabbedPane tabs = new JTabbedPane();\n\ttabs.add(\"MAIN MENU\", mainMenu);\n\ttabs.add(\"LEVEL EDITOR\", levelEditor);\n\tthis.getContentPane().add(tabs);\n }", "private void initTab()\n {\n \n }", "public void buttonNewTab(ActionEvent actionEvent) {\n }", "private void createTabList() throws UnsupportedEncodingException {\n\n org.mortbay.html.List tabList =\n new org.mortbay.html.List(org.mortbay.html.List.Unordered);\n tabsDiv.add(tabList);\n Integer tabCount = 1;\n for (Map.Entry letterPairs : startLetterList.entrySet()) {\n Character startLetter = (Character) letterPairs.getKey();\n Character endLetter = (Character) letterPairs.getValue();\n Link tabLink = new Link(\"DisplayContentTab?start=\" + startLetter + \"&amp;end=\" + endLetter + \"&amp;group=\"\n + grouping + \"&amp;type=\" + type + \"&amp;filter=\" + filterKey +\n \"&amp;timeKey=\" + timeKey, startLetter + \" - \" + endLetter);\n Composite tabListItem = tabList.newItem();\n tabListItem.add(tabLink);\n Block loadingDiv = new Block(Block.Div, \"id='ui-tabs-\" + tabCount++ + \"'\");\n Image loadingImage = new Image(LOADING_SPINNER);\n loadingImage.alt(\"Loading...\");\n loadingDiv.add(loadingImage);\n loadingDiv.add(\" Loading...\");\n tabsDiv.add(loadingDiv);\n }\n }", "private void addScheduleTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_VISIBLE_TRACKS);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_SCHEDULE);\n spec.setIndicator(mResources.getString(R.string.schedule), mResources\n .getDrawable(R.drawable.ic_tab_schedule));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private void addTabs(List<TemplateAttribute> templateAttributes, TemplateRelation tr) {\n ObjectGroupTab otv = null;\n int prevTgId = 0;\n for (TemplateAttribute ta : templateAttributes) {\n if (ta.getTgId() != prevTgId) {\n prevTgId = ta.getTgId();\n if (ta.getTg().getSubRank() == 0) {\n otv = tr == null ? new ObjectGroupTab(this, ta.getTg())\n : new ObjectRelationGroupTab(this, tr, ta.getTg());\n add(otv, ta.getTg().getName());\n final int iTab = getTabBar().getTabCount() - 1;\n getTabBar().getTab(iTab).addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n getModel().setTemplateRelation(null);\n }\n });\n }\n otv.displayGroupLabel(ta.getTg());\n }\n\n TemplateWidget tw = otv.display(ta);\n if (tw != null)\n tw.initialize();\n }\n if (getTabBar().getTabCount() > 0)\n selectTab(0);\n }", "private void addPanel(TabComponent tabComp, PlotPanel pnl) {\n tabbedPanePlots.addTab(null, null, pnl, tabComp.getTitle());\n pnl.setParent(this);\n // replace the tab component and select this new tab\n tabbedPanePlots.setTabComponentAt(tabbedPanePlots.getTabCount() - 1, tabComp);\n tabbedPanePlots.setSelectedIndex(tabbedPanePlots.getTabCount() - 1);\n requestFocus();\n }", "public void addTab(DocumentWrapper file, String text) {\n\t\tJTextArea textEditor = new JTextArea();\n\n\t\ttextEditor.setText(text);\n\t\ttextEditor.getDocument().putProperty(\"changed\", false);\n\t\ttextEditor.addCaretListener(new CaretListener() {\n\t\t\t@Override\n\t\t\tpublic void caretUpdate(CaretEvent arg0) {\n\t\t\t\tint dot = arg0.getDot();\n\t\t\t\tint mark = arg0.getMark();\n\n\t\t\t\tint caretpos = textEditor.getCaretPosition();\n\t\t\t\tint lineNum = 1;\n\t\t\t\tint columnNum = 1;\n\t\t\t\ttry {\n\t\t\t\t\tlineNum = textEditor.getLineOfOffset(caretpos);\n\t\t\t\t\tcolumnNum = 1 + caretpos - textEditor.getLineStartOffset(lineNum);\n\t\t\t\t\tlineNum += 1;\n\n\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tstatusLabel.setText(\"length : \" + textEditor.getText().length());\n\t\t\t\tlineLabel.setText(\"Ln : \" + lineNum);\n\t\t\t\tcolumnLabel.setText(\"Col : \" + columnNum);\n\t\t\t\tselectedLabel.setText(\"Sel : \" + Math.abs(dot - mark));\n\t\t\t\t;\n\n\t\t\t\tif (dot == mark) {\n\t\t\t\t\titemInvert.setEnabled(false);\n\t\t\t\t\titemLower.setEnabled(false);\n\t\t\t\t\titemUpper.setEnabled(false);\n\t\t\t\t} else {\n\t\t\t\t\titemInvert.setEnabled(true);\n\t\t\t\t\titemLower.setEnabled(true);\n\t\t\t\t\titemUpper.setEnabled(true);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttextEditor.getDocument().addDocumentListener(new DocumentListener() {\n\n\t\t\t@Override\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\n\t\t\t\ttextEditor.getDocument().putProperty(\"changed\", true);\n\n\t\t\t\tButtonTabComponent comp = (ButtonTabComponent) pane.getTabComponentAt(pane.getSelectedIndex());\n\n\t\t\t\tcomp.setImage(true);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\n\t\t\t\ttextEditor.getDocument().putProperty(\"changed\", true);\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\n\t\t\t\ttextEditor.getDocument().putProperty(\"changed\", true);\n\n\t\t\t}\n\t\t});\n\n\t\tfile.setEditor(textEditor);\n\n\t\tJScrollPane scPane = new JScrollPane(textEditor);\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.add(scPane, BorderLayout.CENTER);\n\n\t\tint index = pane.getTabCount();\n\n\t\tpane.addTab(file.getName(), textEditor);\n\n\t\tinitTabComponent(file, index);\n\t}", "@Override\n\tpublic Tab newTab() {\n\t\treturn null;\n\t}", "private void addMenuItems() {\n menuBar.setLayout(new FlowLayout(FlowLayout.CENTER));\n menuBar.setBackground(Color.BLUE);\n JMenuItem newTabButton = new JMenuItem(\"New Tab\");\n newTabButton.addActionListener(e ->\n {\n String tabName = \"Space \";\n Random rand = new Random();\n float r = (float) (rand.nextFloat() / 2f + 0.5);\n float g = (float) (rand.nextFloat() / 2f + 0.5);\n float b = (float) (rand.nextFloat() / 2f + 0.5);\n Color backgroundColor = new Color(r, g, b);\n tabName += tabIndex;\n tabIndex += 1;\n WorkingPanel workingPanel = new WorkingPanel();\n workingPanel.setBackground(backgroundColor);\n jTabbedPane.add(tabName, workingPanel);\n addIconToTab(workingPanel, \"(\");\n addIconToTab(workingPanel, \")\");\n });\n JMenuItem saveButton = new JMenuItem(\"Save\");\n fileManager = new FileManager(this);\n saveButton.addActionListener(e -> {\n try {\n fileManager.saveFile();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n } catch (NullPointerException nullPointerException){\n JOptionPane.showMessageDialog(null, \"No file selected\");\n }\n });\n JMenuItem loadButton = new JMenuItem(\"Load\");\n loadButton.addActionListener(e -> {\n try {\n fileManager.loadFile();\n } catch (IOException | ClassNotFoundException ioException) {\n ioException.printStackTrace();\n }\n });\n JMenuItem compileButton = new JMenuItem(\"Compile\");\n compileButton.addActionListener(e -> {\n visited = new HashSet<>();\n boolean compileFlag = true;\n for (int idx = 0; idx < jTabbedPane.getTabCount(); idx++) {\n WorkingPanel workingPanel = (WorkingPanel) jTabbedPane.getComponent(idx);\n boolean isSuccessfullyCompiled = compileTab(workingPanel.getConnections(), workingPanel, idx);\n if (!isSuccessfullyCompiled) {\n compileFlag = false;\n }\n }\n if (compileFlag) {\n generateGraphCode();\n }\n });\n newTabButton.setPreferredSize(new Dimension(150, 40));\n loadButton.setPreferredSize(new Dimension(150, 40));\n saveButton.setPreferredSize(new Dimension(150, 40));\n compileButton.setPreferredSize(new Dimension(150, 40));\n menuBar.add(newTabButton);\n menuBar.add(saveButton);\n menuBar.add(loadButton);\n menuBar.add(compileButton);\n }", "protected void addData(TreeMap treeMap) {\n AnchorPane container = createTabContent(treeMap);\n Tab tab = new Tab(treeMap.getData().getName(), container);\n tab.setClosable(false);\n tabPane.getTabs().add(tab);\n }", "public void applyTab();", "private void createTabs(){\n canvasPanel = new JPanel();\n canvasPanel.setLayout(new BorderLayout());\n canvasPanel.add(mCanvas, BorderLayout.CENTER);\n canvasPanel.setMinimumSize(new Dimension(100,50));\n \n // Create the options and properties panel\n optionPanel = new JPanel();\n optionPanel.setLayout(new FlowLayout());\n\n // Set the size\n optionPanel.setMinimumSize(new Dimension(30,30));\t\n optionPanel.setPreferredSize(new Dimension(200,10));\n\n // Create the log area\n mLogArea = new JTextArea(5,20);\n mLogArea.setMargin(new Insets(5,5,5,5));\n mLogArea.setEditable(false);\n JScrollPane logScrollPane = new JScrollPane(mLogArea);\n \n // Das SplitPanel wird in optionPanel (links) und canvasPanel (rechts) unterteilt\n JSplitPane split = new JSplitPane();\n split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n split.setLeftComponent(canvasPanel);\n split.setRightComponent(optionPanel);\n \n JSplitPane splitLog = new JSplitPane();\n splitLog.setOrientation(JSplitPane.VERTICAL_SPLIT);\n splitLog.setBottomComponent(logScrollPane);\n splitLog.setTopComponent(split);\n splitLog.setResizeWeight(1);\n \n mMainFrame.add(splitLog, BorderLayout.CENTER); \n }", "private void insertarTabs(ViewGroup container) {\n View padre = (View) container.getParent();\n pestanas = (TabLayout)padre.findViewById(R.id.tabs);\n }", "private void addControl() {\n // Gan adapter va danh sach tab\n PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager());\n // Them noi dung cac tab\n adapter.AddFragment(new TourMapTab());\n adapter.AddFragment(new TourInfoTab());\n adapter.AddFragment(new TourMapImageTab());\n // Set adapter danh sach tab\n ViewPager viewPager = ActivityManager.getInstance().activityTourTabsBinding.viewpager;\n TabLayout tabLayout = ActivityManager.getInstance().activityTourTabsBinding.tablayout;\n viewPager.setAdapter(adapter);\n tabLayout.setupWithViewPager(viewPager);\n // Them vach ngan cach cac tab\n View root = tabLayout.getChildAt(0);\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColor(getResources().getColor(R.color.colorPrimaryDark));\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n // Icon cac tab\n tabLayout.getTabAt(0).setIcon(R.drawable.tour_map_icon_select);\n tabLayout.getTabAt(1).setIcon(R.mipmap.tour_info_icon);\n tabLayout.getTabAt(2).setIcon(R.mipmap.tour_map_image_icon);\n\n // Doi mau tab icon khi click\n tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager) {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n super.onTabSelected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.drawable.tour_map_icon_select);\n break;\n case 1:\n tab.setIcon(R.drawable.tour_info_icon_select);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon_select);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n super.onTabUnselected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.mipmap.tour_map_icon);\n break;\n case 1:\n tab.setIcon(R.mipmap.tour_info_icon);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n super.onTabReselected(tab);\n }\n }\n );\n }", "private void addTab(String label, int drawableId, Intent i) {\n \tTabHost.TabSpec spec = tabHost.newTabSpec(label);\r\n \tView tabIndicator = LayoutInflater.from(this).inflate(R.layout.tabs, getTabWidget(), false);\r\n \tTextView title = (TextView) tabIndicator.findViewById(R.id.title);\r\n \ttitle.setText(label);\r\n// \tImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);\r\n// \ticon.setImageResource(drawableId);\r\n \tspec.setIndicator(tabIndicator).setContent(i);\r\n \ttabHost.addTab(spec);\r\n }", "public void addTab(ActionBar.Tab tab, Class<?> fragmentClass, Bundle args) {\r\n\t\t\tTabInfo info = new TabInfo(fragmentClass, args);\r\n\t\t\ttab.setTag(info);\r\n\t\t\ttab.setTabListener(this);\r\n\t\t\tgetTabs().add(info);\r\n\t\t\tgetActionBar().addTab(tab);\r\n\t\t\tnotifyDataSetChanged();\r\n\t\t}", "private void addTracksTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n //intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n // SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_TWITTER);\n spec.setIndicator(mResources.getString(R.string.tracks), mResources\n .getDrawable(R.drawable.ic_menu_archive));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "public KonTabbedPane() {\n // Initialize the ArrayList\n graphInterfaces = new ArrayList<DrawingLibraryInterface>();\n\n DirectedGraph<String, DefaultEdge> graph = CreateTestGraph();\n\n /*\n * Adds a tab\n */\n DrawingLibraryInterface<String, DefaultEdge> graphInterface =\n DrawingLibraryFactory.createNewInterface(graph);\n \n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n addTab(\"First Tab\", graphInterface.getPanel());\n\n /*\n * Adds a tab\n */\n graphInterface = DrawingLibraryFactory.createNewInterface(graph);\n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n\n graphInterface.getGraphManipulationInterface().highlightNode(graph\n .vertexSet().iterator().next(), true);\n\n addTab(\"Second Tab\", graphInterface.getPanel());\n }", "private void setTabLayout() {\n View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n TextView title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n ImageView imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.MOVIES);\n imgIcon.setImageResource(R.mipmap.ic_home);\n mTabLayout.getTabAt(0).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n count = (TextView) view.findViewById(R.id.item_tablayout_count_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.FAVOURITE);\n imgIcon.setImageResource(R.mipmap.ic_favorite);\n count.setVisibility(View.VISIBLE);\n mTabLayout.getTabAt(1).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.SETTINGS);\n imgIcon.setImageResource(R.mipmap.ic_settings);\n mTabLayout.getTabAt(2).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.ABOUT);\n imgIcon.setImageResource(R.mipmap.ic_info);\n mTabLayout.getTabAt(3).setCustomView(view);\n }", "public Tabs() {\n initComponents();\n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private void addStarredTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_STARRED);\n spec.setIndicator(mResources.getString(R.string.starred), mResources\n .getDrawable(R.drawable.ic_tab_starred));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private void createView() {\n\t\tTabWidget tWidget = (TabWidget) findViewById(android.R.id.tabs);\r\n\t\tshowLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView = (ImageView) showLayout.getChildAt(0);\r\n\t\tTextView textView = (TextView) showLayout.getChildAt(1);\r\n\t\timageView.setImageResource(R.drawable.main_selector);\r\n\t\ttextView.setText(R.string.show);\r\n\r\n\t\taddLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView1 = (ImageView) addLayout.getChildAt(0);\r\n\t\tTextView textView1 = (TextView) addLayout.getChildAt(1);\r\n\t\timageView1.setImageResource(R.drawable.add_selector);\r\n\t\ttextView1.setText(R.string.add_record);\r\n\r\n\t\tchartLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView2 = (ImageView) chartLayout.getChildAt(0);\r\n\t\tTextView textView2 = (TextView) chartLayout.getChildAt(1);\r\n\t\timageView2.setImageResource(R.drawable.chart_selector);\r\n\t\ttextView2.setText(R.string.chart_show);\r\n\t}", "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}", "private JList Add(String[] ss, String s) {\n\t\t// if (ss.length > 0) {\n\t\tJList l = new JList(ss);\n\t\tint indices[] = new int[ss.length];\n\t\tfor (int i = 0; i < ss.length; i++) {\n\t\t\tindices[i] = i;\n\t\t}\n\t\tl.setSelectedIndices(indices);\n\t\ttheTabbedPane.addTab(s, new JScrollPane(l));\n\t\treturn l;\n\t\t// }\n\t\t// return null;\n\t}", "public static void new_tab(By locator) throws CheetahException {\n\t\ttry {\n\t\t\tWebElement element = CheetahEngine.getDriverInstance().findElement(locator);\n\t\t\tdriverUtils.highlightElement(element);\n\t\t\tdriverUtils.unHighlightElement(element);\n\t\t\telement.sendKeys(Keys.CONTROL, \"t\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\n\t}", "private void createNetworksPanel() {\n\t\ttabs = new ArrayList<>();\n\t\tnetworksPanel = new JTabbedPane();\n\t\tthis.add(networksPanel, BorderLayout.CENTER);\n\t}", "@Override public void addTab(String title, Component content) {\n super.addTab(title, new JLabel(\"Loading...\"));\n JProgressBar bar = new JProgressBar();\n int currentIndex = getTabCount() - 1;\n JLabel label = new JLabel(title);\n Dimension dim = label.getPreferredSize();\n int w = Math.max(80, dim.width);\n label.setPreferredSize(new Dimension(w, dim.height));\n Insets tabInsets = UIManager.getInsets(\"TabbedPane.tabInsets\");\n bar.setPreferredSize(new Dimension(w, dim.height - tabInsets.top - 1));\n // bar.setString(title);\n // bar.setUI(new BasicProgressBarUI());\n setTabComponentAt(currentIndex, bar);\n SwingWorker<String, Integer> worker = new BackgroundTask() {\n @Override protected void process(List<Integer> chunks) {\n if (!isDisplayable()) {\n // System.out.println(\"process: DISPOSE_ON_CLOSE\");\n cancel(true);\n }\n }\n\n @Override protected void done() {\n if (!isDisplayable()) {\n // System.out.println(\"done: DISPOSE_ON_CLOSE\");\n cancel(true);\n return;\n }\n setTabComponentAt(currentIndex, label);\n setComponentAt(currentIndex, content);\n String txt;\n try {\n txt = get();\n } catch (InterruptedException ex) {\n txt = \"Interrupted\";\n Thread.currentThread().interrupt();\n } catch (ExecutionException ex) {\n txt = \"Exception\";\n }\n label.setToolTipText(txt);\n }\n };\n worker.addPropertyChangeListener(new ProgressListener(bar));\n // executor.execute(worker);\n worker.execute();\n }", "private void fuenteTab() {\n\n\n View view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n TextView tv=(TextView) view.findViewById(R.id.pestanias_txt);\n ImageView imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.detalles);\n tv.setTypeface(fuente2);\n tv.setText(\"Detalles\");\n tabLayout.getTabAt(0).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.marciano);\n tv.setTypeface(fuente2);\n tv.setText(\"Juegos\");\n tabLayout.getTabAt(1).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.tienda);\n tv.setTypeface(fuente2);\n tv.setText(\"Tienda\");\n tabLayout.getTabAt(2).setCustomView(view);\n\n }", "private void createSingleTab(String text, Path path) {\r\n\t\tif (text == null) {\r\n\t\t\ttext = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tJTextArea txtArea = new JTextArea(text);\r\n\t\ttxtArea.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprivate void changeIcon() {\r\n\t\t\t\ttabbedPane.setIconAt(tabbedPane.getSelectedIndex(), redIcon);\r\n\t\t\t}\r\n\t\t});\r\n\t\ttxtArea.addCaretListener(new CaretListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void caretUpdate(CaretEvent e) {\r\n\t\t\t\tlengthLab.setText(\"Length: \"+txtArea.getText().length());\r\n\t\t\t\t\r\n\t\t\t\tint offset = txtArea.getCaretPosition();\r\n\t int line= 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tline = txtArea.getLineOfOffset(offset);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tlnLab.setText(\"Ln: \"+(line+1));\r\n\t\t\t\t\r\n\t\t\t\tint col = 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcol = offset - txtArea.getLineStartOffset(line);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tcolLab.setText(\"Col: \"+ (col+1));\r\n\t\t\t\t\r\n\t\t\t\tint sel = Math.abs(txtArea.getSelectionStart() - txtArea.getSelectionEnd());\t\r\n\t\t\t\tselLab.setText(\"sel: \"+sel);\r\n\t\t\t\tfor (JMenuItem i : toggable) {\r\n\t\t\t\t\tboolean enabled;\r\n\t\t\t\t\tenabled = sel != 0;\r\n\t\t\t\t\ti.setEnabled(enabled);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJScrollPane scrPane = new JScrollPane(txtArea);\r\n\t\tif (path == null) {\t//create empty tab\t\r\n\t\t\tString name = \"New \" + (count +1);\r\n\t\t\ttabbedPane.addTab(name, greenIcon, scrPane, \"\");\r\n\t\t\tcount++;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttabbedPane.addTab(path.getFileName().toString(), greenIcon, scrPane, path.toString());\r\n\t\tcount++;\r\n\t}", "@Override\n\tpublic void addTab(final String newTitle, final Component theComponent) {\n\t\tif (newTitle==null || newTitle.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid tab title\");\n\t\t}\n\t\tif (theComponent.getName()==null || theComponent.getName().isEmpty()) {\n\t\t\ttheComponent.setName(newTitle);\n\t\t}\n\t\t// Check if the component is already present\n\t\tfor (int i=0; i<getTabCount(); i++) {\n\t\t\tComponent c= getTabComponentAt(i);\n\t\t\tif (c!=null) {\n\t\t\t\tif (c.getName().equals(theComponent.getName())) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Component already displayed: \"+c.getName());\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif (EventQueue.isDispatchThread()) {\n\t\t\taddTheTab(newTitle, theComponent);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tSwingUtilities.invokeAndWait(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\taddTheTab(newTitle, theComponent);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Exception caught while adding \"+theComponent+\" with a TAB having title \"+newTitle+\": \"+e.getMessage());\n\t\t}\n\t}", "public void addPages() {\n\t\tpage = new NewTotoriWizardPage(selection);\n\t\taddPage(page);\n\t}", "private void setupTabLayout() {\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n });\n tabLayout.getTabAt(0).select();\n View root = tabLayout.getChildAt(0);\n //create divider between the tabs\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColorFilter(0xffff0000, PorterDuff.Mode.MULTIPLY);\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n }", "private VTabSheet initTabLayout() {\r\n VTabSheet tabs = new VTabSheet();\r\n Map<Component, Integer> tabComponentMap = new HashMap<Component, Integer>();\r\n Binder<Report> binder = new Binder<>(Report.class);\r\n fireEventTypeComponent = new FireEventTypeDataTab(report,userNeedToPrepare, binder, tabComponentMap);\r\n boolean basicEditRight = !report.getStatus().equals(ReportStatus.APPROVED) && (organizationIsCreator || userNeedToPrepare);\r\n tabs.addTab(getTranslation(\"reportView.tab.basicData.label\"), new ReportBasicDataTab(report, binder, basicEditRight, tabComponentMap, addressServiceRef.get(), this));\r\n tabs.addTab(getTranslation(\"reportView.tab.forcesData.label\"), new ReportForcesTab(report, userNeedToPrepare, organizationServiceRef.get(), vechileServiceRef.get(), reportServiceRef.get()));\r\n fireEventTab = tabs.addTab(getTranslation(\"reportView.tab.fireEventData.label\"), fireEventTypeComponent);\r\n tabs.addTab(getTranslation(\"reportView.tab.authorizationData.label\"), new ReportAuthorizationTab(report, binder, userNeedToPrepare, (userNeedToPrepare || userNeedToApprove), tabs, tabComponentMap, organizationServiceRef.get(), reportServiceRef.get(), notificationServiceRef.get()));\r\n return tabs;\r\n }", "public void init() {\n\t\ttabbed = new JTabbedPane();\n\t\ttabbed.insertTab(\"Sesion\", null, getPanelSesion(), \"Control de la sesion\", 0);\n\t\ttabbed.insertTab(\"Evolución bolsa\", null, new JPanel(), \"Control de los usuarios\", 1);\n\t\ttabbed.insertTab(\"Eventos\", null, new JPanel(), \"Control de los eventos\", 2);\n\t\ttabbed.insertTab(\"Control de Agentes\", null, getPanelAgentes(), \"Control de los agentes\", 3);\n\t\tgetContentPane().add(tabbed);\n\t\ttabbed.setEnabledAt(1, false);\n\t\ttabbed.setEnabledAt(2, false);\n\t\tsetSize(new Dimension(800, 600));\n\t}", "private void setupTab() {\n setLayout(new BorderLayout());\n JSplitPane mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);\n mainSplit.setDividerLocation(160);\n mainSplit.setBorder(BorderFactory.createEmptyBorder());\n\n // set up the MBean tree panel (left pane)\n tree = new XTree(this);\n tree.setCellRenderer(new XTreeRenderer());\n tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n tree.addTreeSelectionListener(this);\n tree.addTreeWillExpandListener(this);\n tree.addMouseListener(ml);\n JScrollPane theScrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n JPanel treePanel = new JPanel(new BorderLayout());\n treePanel.add(theScrollPane, BorderLayout.CENTER);\n mainSplit.add(treePanel, JSplitPane.LEFT, 0);\n\n // set up the MBean sheet panel (right pane)\n viewer = new XDataViewer(this);\n sheet = new XSheet(this);\n mainSplit.add(sheet, JSplitPane.RIGHT, 0);\n\n add(mainSplit);\n }", "private void createTab() {\n tab = new char[tabSize];\n for (int i = 0; i < tabSize; i++) {\n tab[i] = tabChar;\n }\n }", "public void createTabs(ILaunchConfigurationDialog dialog, String mode) {\n setTabs(new ILaunchConfigurationTab[] { new JavaArgumentsTab(),\n new JavaJRETab(), new JavaClasspathTab(), new CommonTab() });\n }", "public void addMainTab(String label, String historyToken, String contentUrl, TabOptions options) {\n addTab(MainTabPanelPresenter.TYPE_RequestTabs,\n MainTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, true, contentUrl, options);\n }", "public void addSubTab(EntityType entityType, String label, String historyToken, String contentUrl,\n TabOptions options) {\n switch (entityType) {\n case DataCenter:\n addTab(DataCenterSubTabPanelPresenter.TYPE_RequestTabs,\n DataCenterSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Cluster:\n addTab(ClusterSubTabPanelPresenter.TYPE_RequestTabs,\n ClusterSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Host:\n addTab(HostSubTabPanelPresenter.TYPE_RequestTabs,\n HostSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Storage:\n addTab(StorageSubTabPanelPresenter.TYPE_RequestTabs,\n StorageSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Disk:\n addTab(DiskSubTabPanelPresenter.TYPE_RequestTabs,\n DiskSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case VirtualMachine:\n addTab(VirtualMachineSubTabPanelPresenter.TYPE_RequestTabs,\n VirtualMachineSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Template:\n addTab(TemplateSubTabPanelPresenter.TYPE_RequestTabs,\n TemplateSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n }\n }", "protected WMSLayersPanel addTab(int position, String server) {\n\t\ttry {\n\t\t\tWMSLayersPanel layersPanel = new WMSLayersPanel(this.getWwd(), server, wmsPanelSize);\n\t\t\tthis.tabbedPane.add(layersPanel, BorderLayout.CENTER);\n\t\t\tString title = layersPanel.getServerDisplayString();\n\t\t\tthis.tabbedPane.setTitleAt(position, title != null && title.length() > 0 ? title : server);\n\n\t\t\t// Add a listener to notice wms layer selections and tell the layer\n\t\t\t// panel to reflect the new state.\n\t\t\tlayersPanel.addPropertyChangeListener(\"LayersPanelUpdated\", new PropertyChangeListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void propertyChange(PropertyChangeEvent propertyChangeEvent) {\n\t\t\t\t\tLayer newLayer = (Layer) propertyChangeEvent.getNewValue();\n\t\t\t\t\t// AppFrame.this.getLayerPanel().update(WMSLayerManager.this.getWwd());\n\t\t\t\t\tTacsitManager.getInstance().getWorldWindowJPanel().getModel().getLayers().add(newLayer);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn layersPanel;\n\t\t} catch (URISyntaxException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Server URL is invalid\", \"Invalid Server URL\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\ttabbedPane.setSelectedIndex(previousTabIndex);\n\t\t\treturn null;\n\t\t}\n\t}", "private void addAdditionalFieldsTab()\n {\n\t\t// START OF ADDITIONAL FIELDS TAB ///\n\t\t// ////////////////////////\n \twAdditionalFieldsTab = new CTabItem(wTabFolder, SWT.NONE);\n \twAdditionalFieldsTab.setText(BaseMessages.getString(PKG, \"AccessInputDialog.AdditionalFieldsTab.TabTitle\"));\n\n \twAdditionalFieldsComp = new Composite(wTabFolder, SWT.NONE);\n\t\tprops.setLook(wAdditionalFieldsComp);\n\n\t\tFormLayout fieldsLayout = new FormLayout();\n\t\tfieldsLayout.marginWidth = 3;\n\t\tfieldsLayout.marginHeight = 3;\n\t\twAdditionalFieldsComp.setLayout(fieldsLayout);\n\t\t\n\t\t// ShortFileFieldName line\n\t\twlShortFileFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlShortFileFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.ShortFileFieldName.Label\"));\n\t\tprops.setLook(wlShortFileFieldName);\n\t\tfdlShortFileFieldName = new FormData();\n\t\tfdlShortFileFieldName.left = new FormAttachment(0, 0);\n\t\tfdlShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);\n\t\tfdlShortFileFieldName.right = new FormAttachment(middle, -margin);\n\t\twlShortFileFieldName.setLayoutData(fdlShortFileFieldName);\n\n\t\twShortFileFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wShortFileFieldName);\n\t\twShortFileFieldName.addModifyListener(lsMod);\n\t\tfdShortFileFieldName = new FormData();\n\t\tfdShortFileFieldName.left = new FormAttachment(middle, 0);\n\t\tfdShortFileFieldName.right = new FormAttachment(100, -margin);\n\t\tfdShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);\n\t\twShortFileFieldName.setLayoutData(fdShortFileFieldName);\n\t\t\n\t\t\n\t\t// ExtensionFieldName line\n\t\twlExtensionFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlExtensionFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.ExtensionFieldName.Label\"));\n\t\tprops.setLook(wlExtensionFieldName);\n\t\tfdlExtensionFieldName = new FormData();\n\t\tfdlExtensionFieldName.left = new FormAttachment(0, 0);\n\t\tfdlExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);\n\t\tfdlExtensionFieldName.right = new FormAttachment(middle, -margin);\n\t\twlExtensionFieldName.setLayoutData(fdlExtensionFieldName);\n\n\t\twExtensionFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wExtensionFieldName);\n\t\twExtensionFieldName.addModifyListener(lsMod);\n\t\tfdExtensionFieldName = new FormData();\n\t\tfdExtensionFieldName.left = new FormAttachment(middle, 0);\n\t\tfdExtensionFieldName.right = new FormAttachment(100, -margin);\n\t\tfdExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);\n\t\twExtensionFieldName.setLayoutData(fdExtensionFieldName);\n\t\t\n\t\t\n\t\t// PathFieldName line\n\t\twlPathFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlPathFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.PathFieldName.Label\"));\n\t\tprops.setLook(wlPathFieldName);\n\t\tfdlPathFieldName = new FormData();\n\t\tfdlPathFieldName.left = new FormAttachment(0, 0);\n\t\tfdlPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);\n\t\tfdlPathFieldName.right = new FormAttachment(middle, -margin);\n\t\twlPathFieldName.setLayoutData(fdlPathFieldName);\n\n\t\twPathFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wPathFieldName);\n\t\twPathFieldName.addModifyListener(lsMod);\n\t\tfdPathFieldName = new FormData();\n\t\tfdPathFieldName.left = new FormAttachment(middle, 0);\n\t\tfdPathFieldName.right = new FormAttachment(100, -margin);\n\t\tfdPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);\n\t\twPathFieldName.setLayoutData(fdPathFieldName);\n\t\t\n\n\n \t\t// SizeFieldName line\n\t\twlSizeFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlSizeFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.SizeFieldName.Label\"));\n\t\tprops.setLook(wlSizeFieldName);\n\t\tfdlSizeFieldName = new FormData();\n\t\tfdlSizeFieldName.left = new FormAttachment(0, 0);\n\t\tfdlSizeFieldName.top = new FormAttachment(wPathFieldName, margin);\n\t\tfdlSizeFieldName.right = new FormAttachment(middle, -margin);\n\t\twlSizeFieldName.setLayoutData(fdlSizeFieldName);\n\n\t\twSizeFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wSizeFieldName);\n\t\twSizeFieldName.addModifyListener(lsMod);\n\t\tfdSizeFieldName = new FormData();\n\t\tfdSizeFieldName.left = new FormAttachment(middle, 0);\n\t\tfdSizeFieldName.right = new FormAttachment(100, -margin);\n\t\tfdSizeFieldName.top = new FormAttachment(wPathFieldName, margin);\n\t\twSizeFieldName.setLayoutData(fdSizeFieldName);\n\t\t\n\t\t\n\t\t// IsHiddenName line\n\t\twlIsHiddenName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlIsHiddenName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.IsHiddenName.Label\"));\n\t\tprops.setLook(wlIsHiddenName);\n\t\tfdlIsHiddenName = new FormData();\n\t\tfdlIsHiddenName.left = new FormAttachment(0, 0);\n\t\tfdlIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);\n\t\tfdlIsHiddenName.right = new FormAttachment(middle, -margin);\n\t\twlIsHiddenName.setLayoutData(fdlIsHiddenName);\n\n\t\twIsHiddenName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wIsHiddenName);\n\t\twIsHiddenName.addModifyListener(lsMod);\n\t\tfdIsHiddenName = new FormData();\n\t\tfdIsHiddenName.left = new FormAttachment(middle, 0);\n\t\tfdIsHiddenName.right = new FormAttachment(100, -margin);\n\t\tfdIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);\n\t\twIsHiddenName.setLayoutData(fdIsHiddenName);\n\t\t\n\t\t// LastModificationTimeName line\n\t\twlLastModificationTimeName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlLastModificationTimeName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.LastModificationTimeName.Label\"));\n\t\tprops.setLook(wlLastModificationTimeName);\n\t\tfdlLastModificationTimeName = new FormData();\n\t\tfdlLastModificationTimeName.left = new FormAttachment(0, 0);\n\t\tfdlLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);\n\t\tfdlLastModificationTimeName.right = new FormAttachment(middle, -margin);\n\t\twlLastModificationTimeName.setLayoutData(fdlLastModificationTimeName);\n\n\t\twLastModificationTimeName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wLastModificationTimeName);\n\t\twLastModificationTimeName.addModifyListener(lsMod);\n\t\tfdLastModificationTimeName = new FormData();\n\t\tfdLastModificationTimeName.left = new FormAttachment(middle, 0);\n\t\tfdLastModificationTimeName.right = new FormAttachment(100, -margin);\n\t\tfdLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);\n\t\twLastModificationTimeName.setLayoutData(fdLastModificationTimeName);\n\t\t\n\t\t// UriName line\n\t\twlUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlUriName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.UriName.Label\"));\n\t\tprops.setLook(wlUriName);\n\t\tfdlUriName = new FormData();\n\t\tfdlUriName.left = new FormAttachment(0, 0);\n\t\tfdlUriName.top = new FormAttachment(wLastModificationTimeName, margin);\n\t\tfdlUriName.right = new FormAttachment(middle, -margin);\n\t\twlUriName.setLayoutData(fdlUriName);\n\n\t\twUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wUriName);\n\t\twUriName.addModifyListener(lsMod);\n\t\tfdUriName = new FormData();\n\t\tfdUriName.left = new FormAttachment(middle, 0);\n\t\tfdUriName.right = new FormAttachment(100, -margin);\n\t\tfdUriName.top = new FormAttachment(wLastModificationTimeName, margin);\n\t\twUriName.setLayoutData(fdUriName);\n\t\t\n\t\t// RootUriName line\n\t\twlRootUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlRootUriName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.RootUriName.Label\"));\n\t\tprops.setLook(wlRootUriName);\n\t\tfdlRootUriName = new FormData();\n\t\tfdlRootUriName.left = new FormAttachment(0, 0);\n\t\tfdlRootUriName.top = new FormAttachment(wUriName, margin);\n\t\tfdlRootUriName.right = new FormAttachment(middle, -margin);\n\t\twlRootUriName.setLayoutData(fdlRootUriName);\n\n\t\twRootUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wRootUriName);\n\t\twRootUriName.addModifyListener(lsMod);\n\t\tfdRootUriName = new FormData();\n\t\tfdRootUriName.left = new FormAttachment(middle, 0);\n\t\tfdRootUriName.right = new FormAttachment(100, -margin);\n\t\tfdRootUriName.top = new FormAttachment(wUriName, margin);\n\t\twRootUriName.setLayoutData(fdRootUriName);\n\t\n\n\t\tfdAdditionalFieldsComp = new FormData();\n\t\tfdAdditionalFieldsComp.left = new FormAttachment(0, 0);\n\t\tfdAdditionalFieldsComp.top = new FormAttachment(wStepname, margin);\n\t\tfdAdditionalFieldsComp.right = new FormAttachment(100, 0);\n\t\tfdAdditionalFieldsComp.bottom = new FormAttachment(100, 0);\n\t\twAdditionalFieldsComp.setLayoutData(fdAdditionalFieldsComp);\n\n\t\twAdditionalFieldsComp.layout();\n\t\twAdditionalFieldsTab.setControl(wAdditionalFieldsComp);\n\n\t\t// ///////////////////////////////////////////////////////////\n\t\t// / END OF ADDITIONAL FIELDS TAB\n\t\t// ///////////////////////////////////////////////////////////\n\n\t\t\n \t\n }", "private static void addPanel(MouseEvent evt, TabComponent tabComp, PlotPanel pnl) {\n EDACCPlotTabView tabView = new EDACCPlotTabView();\n tabView.setLocation(evt.getXOnScreen(), evt.getYOnScreen());\n if (tabViews.size() > 0) {\n tabView.setSize(tabViews.get(0).getSize());\n } else {\n tabView.updateTitle(\"\");\n }\n tabViews.add(tabView);\n tabComp.setParent(tabView);\n tabView.addPanel(tabComp, pnl);\n tabView.updateAdditionalInformations(pnl);\n tabView.updateTitle(pnl.getPlot().getPlotTitle());\n tabViewCountChanged();\n }", "public void addTableNavigation(String title) {\n\n\t\t// Create panel\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setLayout(new BorderLayout());\n\n\t\t// Create and add text editor to panel\n\t\tConsoleTableNavigation table = new ConsoleTableNavigation();\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\tpanel.add(scrollPane, BorderLayout.CENTER);\n\n\t\t// Add the tab\n\t\taddTab(title, null, scrollPane);\n\n\t\t// Store it in the map\n\t\tthis.tabPanelsMap.put(title, table);\n\t}", "private void setupTab(final View view, final String tag) {\r\n\t\tView tabview = createTabView(mTabHost.getContext(), tag);\r\n\r\n\t\tTabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview)\r\n\t\t\t\t.setContent(new TabContentFactory() {\r\n\t\t\t\t\tpublic View createTabContent(String tag) {\r\n\t\t\t\t\t\tView view;\r\n\t\t\t\t\t\tif (tag.contains(\"EXTENDED\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_2_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedNO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET1);\r\n\t\t\t\t\t\t\tedNIO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET2);\r\n\t\t\t\t\t\t\tedNP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET3);\r\n\t\t\t\t\t\t\tedNIP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET4);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tedNO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNP.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIP.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB1);\r\n\t\t\t\t\t\t\tNIO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB2);\r\n\t\t\t\t\t\t\tNP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB3);\r\n\t\t\t\t\t\t\tNIP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB4);\r\n\t\t\t\t\t\t\tNO.setEnabled(false); \r\n\t\t\t\t\t\t\tNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tNP.setEnabled(false);\r\n\t\t\t\t\t\t\tNIP.setEnabled(false);\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\textended = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB0);\r\n\t\t\t\t\t\t\textended.setOnClickListener(S3R4Listener2);\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} else if (tag.contains(\"CUSTOM\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_3_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_1_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedlevels = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET1);\r\n\t\t\t\t\t\t\tedSons = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET2);\r\n\t\t\t\t\t\t\tedlevel = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET3);\r\n\t\t\t\t\t\t\tedpruduct = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET4);\r\n\t\t\t\t\t\t\tedcampaign = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET5);\r\n\t\t\t\t\t\t\tedadd = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET6);\r\n\t\t\t\t\t\t\tedlevels.setEnabled(false);\r\n\t\t\t\t\t\t\tedSons.setEnabled(false);\r\n\t\t\t\t\t\t\tedlevel.setEnabled(false);\r\n\t\t\t\t\t\t\tedpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tedcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tedadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tlevel= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB3);\r\n\t\t\t\t\t\t\tpruduct= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB4);\r\n\t\t\t\t\t\t\tcampaign= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB5);\r\n\t\t\t\t\t\t\tadd= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB6);\r\n\t\t\t\t\t\t\tlevel.setEnabled(false); \r\n\t\t\t\t\t\t\tpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tStructure = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB1);\r\n\t\t\t\t\t\t\tRules = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB2);\r\n\t\t\t\t\t\t\tStructure.setOnClickListener(S3R4Listener);\r\n\t\t\t\t\t\t\tRules.setOnClickListener(S3R4Listener);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn view;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\tmTabHost.addTab(setContent);\r\n\r\n\t}", "private void createTabFolder() {\r\n\t\tGridData gridData1 = new GridData();\r\n\t\tgridData1.grabExcessHorizontalSpace = true;\r\n\t\tgridData1.heightHint = 500;\r\n\t\tgridData1.grabExcessVerticalSpace = true;\r\n\t\tgridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;\r\n\t\tgridData1.widthHint = 600;\r\n\t\ttabFolder = new TabFolder(sShell, SWT.NONE);\r\n\t\ttabFolder.setLayoutData(gridData1);\r\n\t\tcreateCompositeRoomMange();\r\n\t\tcreateCompositeGoodsMange();\r\n\t\tcreateCompositeStaffMange();\r\n\t\tcreateCompositeUserMange();\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"房间管理\");\r\n\t\ttabItem.setControl(compositeRoomMange);\r\n\t\tTabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem1.setText(\"商品管理\");\r\n\t\ttabItem1.setControl(compositeGoodsMange);\r\n\t\tTabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem2.setText(\"员工管理\");\r\n\t\ttabItem2.setControl(compositeStaffMange);\r\n\t\tTabItem tabItem3 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem3.setText(\"系统用户管理\");\r\n\t\ttabItem3.setControl(compositeUserMange);\r\n\t}", "protected void showTabs() {\r\n\t\tif (getPageCount() > 1) {\r\n\t\t\tsetPageText(0, getString(\"_UI_SelectionPage_label\"));\r\n\t\t\tif (getContainer() instanceof CTabFolder) {\r\n\t\t\t\t((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT);\r\n\t\t\t\tPoint point = getContainer().getSize();\r\n\t\t\t\tgetContainer().setSize(point.x, point.y - 6);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public CategoryNew(JTabbedPane tabs,JPanel parent) {\n this.parent=parent;\n this.tabs=tabs;\n initComponents();\n ErrorLabel.setVisible(false);\n }", "public void createPage3(){\n tabAbout = new JPanel();\n tabAbout.setLayout( null );\n \n\n JLabel lblGuidText_syn = new JLabel( \"<html><h1>Useless Dictionary</h1><p>Sulochana Kodituwakku<br>2014/CS/066<br>14000662</p></html>\" ); //html can be used in JLables\n lblGuidText_syn.setHorizontalAlignment(JLabel.LEFT);\n lblGuidText_syn.setVerticalAlignment(JLabel.TOP);\n lblGuidText_syn.setBounds( 10, 200, 750, 380 );\n tabAbout.add( lblGuidText_syn );\n \n btnImport.setBounds(10,10,125,25);\n tabAbout.add(btnImport);\n \n \n //set conlick event for Import button\n event_buttonImport ebd = new event_buttonImport();\n btnImport.addActionListener(ebd);\n }", "public JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft)\n {\n // Check if the fragment is already initialized\n if (mFragment == null)\n {\n // If not, instantiate and add it to the activity\n mFragment = Fragment.instantiate(mActivity, mClass.getName());\n ft.add(android.R.id.content, mFragment, mTag);\n }\n else\n {\n // If it exists, simply attach it in order to show it\n ft.attach(mFragment);\n }\n\n if(mTag.equals(MiNoteConstants.NOTES_TAB))\n {\n createNotes(true);\n\n isNoteTabSelected = true;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n else if(mTag.equals(MiNoteConstants.EVENTS_TAB))\n {\n createNotes(false);\n\n isNoteTabSelected = false;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n }", "private void enableTabPages() {\n // Disables all tabs except the first (the common for all Net Objects)\n for (int i = jTabbedPane1.getTabCount() - 1; i > 0; i--) {\n int tabIndex = i;\n // Enables specific Net Object tab\n if (!IntStream.of(currentTabIndices).anyMatch(x -> x == tabIndex)) {\n this.jTabbedPane1.remove(i);\n }\n }\n }", "private JPanel getContents(final JTabbedPane jtp,\n final MyTabPreviewPainter mainTabPreviewPainter) {\n FormBuilder builder = FormBuilder.create().\n columns(\"right:pref, 4dlu, fill:min:grow(1), 2dlu, fill:min:grow(1)\").\n rows(\"p, 2dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, \"\n + \"p, 3dlu, p, 7dlu, p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu,\"\n + \"p, 2dlu, p, 3dlu, p, 0dlu, p, 3dlu, p, 3dlu, p, 7dlu, \"\n + \"p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu, p, 2dlu, p, 3dlu, p\").\n columnGroups(new int[][] { { 3, 5 } });\n\n int row = 1;\n builder.addSeparator(\"General\").xyw(1, row, 5);\n\n final JComboBox<String> addKindCombo = new JComboBox<>(\n new String[] { \"regular\", \"null\", \"modified\" });\n JButton addNewTabButton = new JButton(\"Add\");\n addNewTabButton.addActionListener(actionEvent -> {\n String selectedKind = (String) addKindCombo.getSelectedItem();\n if (\"null\".equals(selectedKind)) {\n SwingUtilities.invokeLater(() -> jtp.addTab(\"null tab\", null));\n return;\n }\n\n final int count = 1 + jtp.getTabCount();\n final JComponent tabComp = new NumberedPanel(count);\n if (\"modified\".equals(selectedKind)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified(tabComp, true);\n }\n SwingUtilities.invokeLater(() -> jtp.addTab(\"tab\" + count, tabComp));\n });\n row += 2;\n\n builder.addLabel(\"Add tab\").xy(1, row);\n builder.add(addKindCombo).xy(3, row);\n builder.add(addNewTabButton).xy(5, row);\n\n final JComboBox<String> placementCombo = new JComboBox<>(\n new String[] { \"top\", \"bottom\", \"left\", \"right\" });\n placementCombo.addActionListener(actionEvent -> {\n String selected = (String) placementCombo.getSelectedItem();\n if (\"top\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.TOP);\n if (\"bottom\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.BOTTOM);\n if (\"left\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.LEFT);\n if (\"right\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.RIGHT);\n });\n row += 2;\n builder.addLabel(\"Placement\").xy(1, row);\n builder.add(placementCombo).xyw(3, row, 3);\n\n try {\n final JComboBox<TabOverviewKind> overviewKindCombo = new FlexiComboBox<>(\n TabOverviewKind.GRID, TabOverviewKind.MENU_CAROUSEL,\n TabOverviewKind.ROUND_CAROUSEL) {\n @Override\n public String getCaption(TabOverviewKind item) {\n return item.getName();\n }\n };\n overviewKindCombo.addActionListener(actionEvent -> mainTabPreviewPainter\n .setTabOverviewKind((TabOverviewKind) overviewKindCombo.getSelectedItem()));\n row += 2;\n builder.addLabel(\"Overview kind\").xy(1, row);\n builder.add(overviewKindCombo).xyw(3, row, 3);\n } catch (NoClassDefFoundError ncdfe) {\n }\n\n final JCheckBox useScrollLayout = new JCheckBox(\"Uses scroll layout\");\n useScrollLayout.setSelected(false);\n useScrollLayout.addActionListener(actionEvent -> jtp\n .setTabLayoutPolicy(useScrollLayout.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT\n : JTabbedPane.WRAP_TAB_LAYOUT));\n row += 2;\n builder.addLabel(\"Layout\").xy(1, row);\n builder.add(useScrollLayout).xyw(3, row, 3);\n\n final JComboBox<TabContentPaneBorderKind> contentBorderCombo = new JComboBox<>(new TabContentPaneBorderKind[] {\n TabContentPaneBorderKind.DOUBLE_PLACEMENT,\n TabContentPaneBorderKind.SINGLE_PLACEMENT });\n contentBorderCombo.setSelectedItem(TabContentPaneBorderKind.DOUBLE_PLACEMENT);\n contentBorderCombo.addActionListener(actionEvent -> {\n TabContentPaneBorderKind contentBorderKind = (TabContentPaneBorderKind) contentBorderCombo\n .getSelectedItem();\n RadianceThemingCortex.ComponentScope.setTabContentPaneBorderKind(jtp, contentBorderKind);\n jtp.updateUI();\n jtp.repaint();\n });\n row += 2;\n builder.addLabel(\"Content border\").xy(1, row);\n builder.add(contentBorderCombo).xyw(3, row, 3);\n\n JButton enableAll = new JButton(\"+ all\");\n enableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, true);\n }\n });\n\n JButton disableAll = new JButton(\"- all\");\n disableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, false);\n }\n });\n\n row += 2;\n builder.addLabel(\"Enable all\").xy(1, row);\n builder.add(enableAll).xy(3, row);\n builder.add(disableAll).xy(5, row);\n\n JButton closeAllEnabled = new JButton(\"Close\");\n closeAllEnabled.addActionListener(actionEvent -> {\n Set<Component> toRemove = new HashSet<>();\n for (int i = 0; i < jtp.getTabCount(); i++) {\n if (jtp.isEnabledAt(i))\n toRemove.add(jtp.getComponentAt(i));\n }\n for (Component comp : toRemove)\n jtp.remove(comp);\n });\n\n JButton restoreClosed = new JButton(\"Restore\");\n restoreClosed.addActionListener(actionEvent -> {\n for (Component tnp : closed) {\n jtp.addTab(\"restored\", tnp);\n }\n });\n\n row += 2;\n builder.addLabel(\"Close all\").xy(1, row);\n builder.add(closeAllEnabled).xy(3, row);\n builder.add(restoreClosed).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Single Tab\").xyw(1, row, 5);\n\n final JComboBox<Integer> tabSelectorCombo = new JComboBox<>(new TabComboBoxModel(this.jtp));\n //tabSelectorCombo.setRenderer(new TabCellRenderer());\n jtp.addContainerListener(new ContainerAdapter() {\n @Override\n public void componentAdded(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n\n @Override\n public void componentRemoved(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n });\n\n row += 2;\n builder.addLabel(\"Select\").xy(1, row);\n builder.add(tabSelectorCombo).xyw(3, row, 3);\n\n final JButton markAsModified = new JButton(\"-> modified\");\n markAsModified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, true);\n }\n });\n final JButton markAsUnmodified = new JButton(\"-> unmodified\");\n markAsUnmodified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, false);\n }\n });\n row += 2;\n builder.addLabel(\"Modified\").xy(1, row);\n builder.add(markAsModified).xy(3, row);\n builder.add(markAsUnmodified).xy(5, row);\n\n final JButton runModifiedAnimOnClose = new JButton(\"Animate on X\");\n runModifiedAnimOnClose.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, true);\n }\n });\n final JButton runModifiedAnimOnTab = new JButton(\"Animate on tab\");\n runModifiedAnimOnTab.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, false);\n }\n });\n row += 2;\n builder.add(runModifiedAnimOnClose).xy(3, row);\n builder.add(runModifiedAnimOnTab).xy(5, row);\n\n final JButton showCloseButton = new JButton(\"+ close button\");\n showCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, true);\n jtp.repaint();\n }\n });\n final JButton hideCloseButton = new JButton(\"- close button\");\n hideCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, false);\n jtp.repaint();\n }\n });\n\n JButton closeButton = new JButton(\"Close\");\n closeButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n jtp.removeTabAt((Integer) tabSelectorCombo.getSelectedItem());\n closed.add(comp);\n jtp.repaint();\n }));\n\n JButton selectButton = new JButton(\"Select\");\n selectButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n jtp.setSelectedIndex((Integer) tabSelectorCombo.getSelectedItem());\n }));\n row += 2;\n builder.addLabel(\"Tab op\").xy(1, row);\n builder.add(closeButton).xy(3, row);\n builder.add(selectButton).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Close Button Single\").xyw(1, row, 5);\n\n row += 2;\n builder.addLabel(\"Visible\").xy(1, row);\n builder.add(showCloseButton).xy(3, row);\n builder.add(hideCloseButton).xy(5, row);\n\n return builder.getPanel();\n }", "private void initTabs()\n {\n updateDayTab();\n\n // Set initial time on time tab\n updateTimeTab();\n }", "public static void AddTab(EventActivity activity, TabHost tabHost, TabHost.TabSpec tabSpec, TabInfo tabInfo) {\n\t\t// Attach a Tab view factory to the spec\n\t\ttabSpec.setContent(new Utils.TabFactory(activity));\n tabHost.addTab(tabSpec);\n\t}", "public TabPane createTabPane(TableauFrame parent) {\n\t\t\tTabPaneExtensionExample tpee = new TabPaneExtensionExample();\n\n\t\t\t/*\n\t\t\t * Optionally you can create a method called setTabName and use the\n\t\t\t * \"name\" value from the configuration.xml file by calling\n\t\t\t * this.getName(). For Example if you have <property\n\t\t\t * name=\"randomTestTab\"\n\t\t\t * class=\"org.kepler.gui.TabPaneExtensionExample$Factory\" /> in\n\t\t\t * configuration.xml then the name of the tab in the GUI becomes\n\t\t\t * randomTestTab\n\t\t\t */\n\t\t\ttpee.setTabName(this.getName());\n\n\t\t\treturn tpee;\n\t\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\t\tshell.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\t\t\r\n\t\tfinal TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\r\n\t\ttabFolder.setToolTipText(\"\");\r\n\t\t\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"欢迎使用\");\r\n\t\t\r\n\t\tTabItem tabItem_1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem_1.setText(\"员工查询\");\r\n\t\t\r\n\t\tMenu menu = new Menu(shell, SWT.BAR);\r\n\t\tshell.setMenuBar(menu);\r\n\t\t\r\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.NONE);\r\n\t\tmenuItem.setText(\"系统管理\");\r\n\t\t\r\n\t\tMenuItem menuItem_1 = new MenuItem(menu, SWT.CASCADE);\r\n\t\tmenuItem_1.setText(\"员工管理\");\r\n\t\t\r\n\t\tMenu menu_1 = new Menu(menuItem_1);\r\n\t\tmenuItem_1.setMenu(menu_1);\r\n\t\t\r\n\t\tMenuItem menuItem_2 = new MenuItem(menu_1, SWT.NONE);\r\n\t\tmenuItem_2.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tTabItem tbtmNewItem = new TabItem(tabFolder,SWT.NONE);\r\n\t\t\t\ttbtmNewItem.setText(\"员工查询\");\r\n\t\t\t\t//创建自定义组件\r\n\t\t\t\tEmpQueryCmp eqc = new EmpQueryCmp(tabFolder, SWT.NONE);\r\n\t\t\t\t//设置标签显示的自定义组件\r\n\t\t\t\ttbtmNewItem.setControl(eqc);\r\n\t\t\t\t\r\n\t\t\t\t//选中当前标签页\r\n\t\t\t\ttabFolder.setSelection(tbtmNewItem);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tmenuItem_2.setText(\"员工查询\");\r\n\r\n\t}", "public void switchToHistory() {\r\n\t\thistoryPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"historyPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "public AutomatedTestingTabbedPane()\r\n\t{\r\n\t\tsuper();\r\n\t\t\r\n\t\tthis.setBackground(Constants.WHITE);\r\n\t\tthis.setForeground(Constants.BLUE);\r\n\t\t\r\n\t\tthis.setFont(new Font(\"sans-serif\", Font.PLAIN, 16));\r\n\t\tthis.addTab(\"CXCParticipant\", participantPanel);\r\n\t\tthis.setMnemonicAt(0, KeyEvent.VK_1);\r\n\t\t\r\n\t\tthis.addTab(\"CXCToken\", tokenPanel);\r\n\t\tthis.setMnemonicAt(1, KeyEvent.VK_2);\r\n\t\t\r\n\t\tthis.addTab(\"CXCRecipient\", recipientPanel);\r\n\t\tthis.setMnemonicAt(2, KeyEvent.VK_3);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPayment\", paymentPanel);\r\n\t\tthis.setMnemonicAt(3, KeyEvent.VK_4);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPaymentRequest\", paymentRequestPanel);\r\n\t\tthis.setMnemonicAt(4, KeyEvent.VK_5);\r\n\t\t\r\n//\t\tthis.addTab(\"Export\", exportPanel);\r\n//\t\tthis.setMnemonicAt(5, KeyEvent.VK_6);\r\n\r\n\t}", "private static void addPanelInMainTabView(TabComponent tc, PlotPanel pnl) {\n EDACCPlotTabView tabView = getMainTabView();\n if (tc == null) {\n tabView.addPanel(pnl);\n } else {\n tabView.addPanel(tc, pnl);\n }\n }", "public void addPages() {\n //super.addPages(); //<--- notice we're overriding here\n mainPage = new NewTargetWizardPage(\"newFilePage1\", getSelection());//$NON-NLS-1$\n mainPage.setTitle(TITLE);\n mainPage.setDescription(DESCRIPTION); \n addPage(mainPage);\n }", "public void add(View v) {\n\t\tint type = tabHost.getCurrentTab() + 1;\n\t\tIntent i = new Intent(this, AddActivity.class);\n\t\ti.putExtra(\"type\", type);\n\t\tstartActivityForResult(i, MainActivity.REQUEST_ADD);\n\t}", "@Override\n\tpublic void addPages() {\n\t\tthis.mainPage = new SNLFilePage(this.workbench, this.selection);\n\t\tthis.addPage(this.mainPage);\n\t}", "@Override\n\tpublic JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "private void createLayout () {\n \t\n \tBorderPane border = new BorderPane();\n \t\n \t\n \t tabPane = new TabPane();\n ArrayList <ScrollPane> tabs = new ArrayList <ScrollPane>();\n \t\n //create column 1 - need to refactor this and make more generic\n TilePane col1 = new TilePane();\n \tcol1.setPrefColumns(2);\n \tcol1.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n \tcol1.setAlignment(Pos.TOP_LEFT);\n \tcol1.getChildren().addAll(createElements ());\n \tScrollPane scrollCol1 = new ScrollPane(col1);\n \ttabs.add(scrollCol1);\n \t\n \tTilePane col2 = new TilePane();\n \tcol2.setPrefColumns(2);\n \tcol2.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n \tcol2.setAlignment(Pos.TOP_LEFT);\n \tcol2.getChildren().addAll(createElements ());\n \tScrollPane scrollCol2 = new ScrollPane(col2);\n \ttabs.add(scrollCol2);\n \t\n \t\n \t\n for (int i = 0; i < tabs.size(); i++) {\n Tab tab = new Tab();\n String tabLabel = \"Col-\" + i;\n tab.setText(tabLabel);\n keywordsList.put(tabLabel, new ArrayList <String>());\n \n tab.setContent(tabs.get(i));\n tabPane.getTabs().add(tab);\n }\n \t\n \t\n \t\n \t\n \t\n \t\n //System.out.println(controller.getScene());\n border.prefHeightProperty().bind(controller.primaryStage.heightProperty());\n border.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n ToolBar toolbar = createtoolBar();\n toolbar.setPrefHeight(50);\n \n border.setTop(toolbar);\n\t\t\n\n\t scrollCol1.prefHeightProperty().bind(controller.primaryStage.heightProperty());\n\t scrollCol1.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n border.setCenter(tabPane);\n\t Group root = (Group)this.getRoot();\n root.getChildren().add(border);\n\t}", "public JTabbedPane createPanel()\r\n {\r\n\r\n /** LoadTabPaneData Thread - Inner class that will load the historic data on the AWT\r\n * Thread as to not muck up things on the GUI thread\r\n * The Thread will die after it loads everything.\r\n */\r\n class LoadTabPaneDataTask extends TimerTask\r\n {\r\n // Handle to main outer class\r\n WatchListTableModule watchListTableModule = null;\r\n\r\n /** \r\n * LoadTabPaneDataTask constructor\r\n */\r\n public LoadTabPaneDataTask(WatchListTableModule watchListTableModule)\r\n {\r\n this.watchListTableModule = watchListTableModule;\r\n }\r\n\r\n /** \r\n * LoadTabPaneDataTask::run() this method simply invokes. \r\n * WatchListTableModule::loadPersistantWatchLists() method.\r\n * The method will populate all watchlists to be loaded on\r\n * the JTabbedPane then it dies off\r\n */\r\n public void run()\r\n {\r\n debug(\"LoadTabPaneDataTask::run() - calling watchListTableModule.loadPersistantWatchLists()\");\r\n watchListTableModule.loadPersistantWatchLists();\r\n this.cancel();\r\n }\r\n }\r\n\r\n // Create an Application Properties instance\r\n appProps = new AppProperties(getString(\"WatchListTableModule.application_ini_filename\"));\r\n // Setup our Time Delays\r\n standardDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.standard_time_delay\"), ONE_MINUTE);\r\n extendedDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.extended_time_delay\"), ONE_HOUR);\r\n\r\n // Create our Basic Tabbed Pane and Listener ( inner class )\r\n tabPane = new JTabbedPane();\r\n tabPane.addChangeListener(new TabPaneListener());\r\n\r\n // Load the Tab Pane Data on the Util Event Thread as \r\n // to get our screen up and going as fast as possible\r\n // So we can get out of here - This Inner class thread\r\n // invokes method\r\n // loadPersistantWatchLists();\r\n TimerTask tabPaneTask = new LoadTabPaneDataTask(this);\r\n Timer timer = new Timer(true); // Deamon\r\n timer.schedule(tabPaneTask, ONE_SECOND);\r\n\r\n return tabPane;\r\n }", "private void initTeamsTab() throws IOException {\n // THESE ARE THE CONTROLS FOR THE BASIC SCHEDULE PAGE HEADER INFO\n // WE'LL ARRANGE THEM IN A VBox\n teamTab = new Tab();\n teamWorkspacePane = new VBox();\n teamWorkspacePane.getStyleClass().add(CLASS_DRAFT_PANE);\n \n teamScroll = new ScrollPane();\n \n // PAGE LABEL & BUTTON\n Label teams = new Label();\n teams = initChildLabel(teamWorkspacePane, DraftKit_PropertyType.TEAMS_HEADING_LABEL, CLASS_HEADING_LABEL);\n \n PropertiesManager props = PropertiesManager.getPropertiesManager();\n String imagePath = \"file:\" + PATH_IMAGES + props.getProperty(DraftKit_PropertyType.TEAM_ICON);\n Image buttonImage = new Image(imagePath);\n teamTab.setGraphic(new ImageView(buttonImage));\n \n // ADD THINGS TO VBOX HERE\n HBox draftNameControls = new HBox();\n initHBoxLabel(draftNameControls, DraftKit_PropertyType.DRAFT_NAME_LABEL, CLASS_PROMPT_LABEL);\n draftNameText = initHBoxTextField(draftNameControls, \"\", true);\n\n HBox teamControls = new HBox();\n addTeam = initHBoxButton(teamControls, DraftKit_PropertyType.ADD_ICON, DraftKit_PropertyType.ADD_TEAM_TOOLTIP, false);\n removeTeam = initHBoxButton(teamControls, DraftKit_PropertyType.MINUS_ICON, DraftKit_PropertyType.REMOVE_TEAM_TOOLTIP, true);\n editTeam = initHBoxButton(teamControls, DraftKit_PropertyType.EDIT_ICON, DraftKit_PropertyType.EDIT_TEAM_TOOLTIP, true);\n\n initHBoxLabel(teamControls, DraftKit_PropertyType.TEAM_SELECT_LABEL, CLASS_PROMPT_LABEL);\n selectTeam = new ComboBox();\n selectTeam.getItems().clear();\n for (int n = 0; n < dataManager.getDraft().getFantasyTeams().size(); n++) {\n selectTeam.getItems().add(dataManager.getDraft().getFantasyTeams().get(n).getTeamName());\n }\n selectTeam.setValue(\"Choose a team\");\n \n selectTeam.valueProperty().addListener(new ChangeListener<String>() {\n @Override public void changed(ObservableValue ov, String t, String t1) {\n ArrayList<Player> tempTeam = new ArrayList<>();\n ArrayList<Player> tempTaxi = new ArrayList<>();\n teamTable.getItems().clear();\n for (Team tt : dataManager.getDraft().getFantasyTeams()) {\n if (tt.getTeamName().equals(selectTeam.getSelectionModel().getSelectedItem())) {\n tempTeam = tt.getTeamList();\n tempTaxi = tt.getTaxiList();\n }\n }\n teamTable = resetTeamTable(tempTeam);\n teamTaxiTable = resetTaxiTable(tempTaxi);\n }\n });\n \n teamControls.getChildren().add(selectTeam);\n\n // TABLE FOR MAIN PLAYERS IN THE FANTASY TEAMS PAGE\n VBox teamTableBox = new VBox();\n initVBoxLabel(teamTableBox, DraftKit_PropertyType.TEAM_TABLE_LABEL, CLASS_SUBHEADING_LABEL);\n positionCompare = new PositionCompare();\n teamTable = new TableView<>();\n \n posCol = new TableColumn<>(\"Position\");\n posCol.setCellValueFactory(new PropertyValueFactory<>(\"ChosenPosition\"));\n posCol.setComparator(positionCompare);\n posCol.setSortType(SortType.ASCENDING);\n posCol.setSortable(true);\n firstCol = new TableColumn<>(\"First\");\n firstCol.setCellValueFactory(new PropertyValueFactory<>(\"FirstName\"));\n firstCol.setSortable(false);\n lastCol = new TableColumn<>(\"Last\");\n lastCol.setCellValueFactory(new PropertyValueFactory<>(\"LastName\"));\n lastCol.setSortable(false);\n teamCol = new TableColumn<>(\"Pro Team\");\n teamCol.setCellValueFactory(new PropertyValueFactory<>(\"MLBTeam\"));\n teamCol.setSortable(false);\n positionsCol = new TableColumn<>(\"Positions\");\n positionsCol.setCellValueFactory(new PropertyValueFactory<>(\"position\"));\n positionsCol.setSortable(false);\n rwCol = new TableColumn<>(\"R/W\");\n rwCol.setCellValueFactory(new PropertyValueFactory<>(\"RW\"));\n rwCol.setSortable(false);\n hrsvCol = new TableColumn<>(\"HR/SV\");\n hrsvCol.setCellValueFactory(new PropertyValueFactory<>(\"HRSV\"));\n hrsvCol.setSortable(false);\n rbikCol = new TableColumn<>(\"RBI/K\");\n rbikCol.setCellValueFactory(new PropertyValueFactory<>(\"RBIK\"));\n rbikCol.setSortable(false);\n sberaCol = new TableColumn<>(\"SB/ERA\");\n sberaCol.setCellValueFactory(new PropertyValueFactory<>(\"SBERA\"));\n sberaCol.setSortable(false);\n bawhipCol = new TableColumn<>(\"BA/WHIP\");\n bawhipCol.setCellValueFactory(new PropertyValueFactory<>(\"BAWHIP\"));\n bawhipCol.setSortable(false);\n eValueCol = new TableColumn<>(\"Estimated Value\");\n eValueCol.setCellValueFactory(new PropertyValueFactory<>(\"estimatedValue\"));\n eValueCol.setSortable(false);\n contractCol = new TableColumn<>(\"Contract\");\n contractCol.setCellValueFactory(new PropertyValueFactory<>(\"Contract\"));\n contractCol.setSortable(false);\n salaryCol = new TableColumn<>(\"Salary\");\n salaryCol.setCellValueFactory(new PropertyValueFactory<>(\"Salary\"));\n salaryCol.setSortable(false);\n \n teamTable.getColumns().setAll(posCol, firstCol, lastCol, positionsCol,\n rwCol, hrsvCol, rbikCol, sberaCol, bawhipCol, eValueCol, contractCol, salaryCol);\n \n teamTable.getSortOrder().add(posCol);\n \n teamTable.setItems(teamList);\n \n // TABLE FOR TAXI PLAYERS IN THE FANTASY TEAMS PAGE\n VBox teamTaxiBox = new VBox();\n initVBoxLabel(teamTaxiBox, DraftKit_PropertyType.TEAM_TAXI_LABEL, CLASS_SUBHEADING_LABEL);\n teamTaxiTable = new TableView<>();\n \n firstCol2 = new TableColumn<>(\"First\");\n firstCol2.setCellValueFactory(new PropertyValueFactory<>(\"FirstName\"));\n lastCol2 = new TableColumn<>(\"Last\");\n lastCol2.setCellValueFactory(new PropertyValueFactory<>(\"LastName\"));\n teamCol2 = new TableColumn<>(\"Pro Team\");\n teamCol2.setCellValueFactory(new PropertyValueFactory<>(\"MLBTeam\"));\n positionsCol2 = new TableColumn<>(\"Positions\");\n positionsCol2.setCellValueFactory(new PropertyValueFactory<>(\"position\"));\n rwCol2 = new TableColumn<>(\"R/W\");\n rwCol2.setCellValueFactory(new PropertyValueFactory<>(\"RW\"));\n hrsvCol2 = new TableColumn<>(\"HR/SV\");\n hrsvCol2.setCellValueFactory(new PropertyValueFactory<>(\"HRSV\"));\n rbikCol2 = new TableColumn<>(\"RBI/K\");\n rbikCol2.setCellValueFactory(new PropertyValueFactory<>(\"RBIK\"));\n sberaCol2 = new TableColumn<>(\"SB/ERA\");\n sberaCol2.setCellValueFactory(new PropertyValueFactory<>(\"SBERA\"));\n bawhipCol2 = new TableColumn<>(\"BA/WHIP\");\n bawhipCol2.setCellValueFactory(new PropertyValueFactory<>(\"BAWHIP\"));\n eValueCol2 = new TableColumn<>(\"Estimated Value\");\n eValueCol2.setCellValueFactory(new PropertyValueFactory<>(\"EValue\"));\n contractCol2 = new TableColumn<>(\"Contract\");\n contractCol2.setCellValueFactory(new PropertyValueFactory<>(\"Contract\"));\n salaryCol2 = new TableColumn<>(\"Salary\");\n salaryCol2.setCellValueFactory(new PropertyValueFactory<>(\"Salary\"));\n \n teamTaxiTable.getColumns().setAll(firstCol2, lastCol2, positionsCol2,\n rwCol2, hrsvCol2, rbikCol2, sberaCol2, bawhipCol2, eValueCol2, contractCol2, salaryCol2);\n \n teamTaxiTable.setItems(teamTaxiList);\n \n // SET TOOLTIP\n Tooltip t = new Tooltip(\"Fantasy Teams Page\");\n teamTab.setTooltip(t);\n \n // PUT IN TAB PANE\n teamTableBox.getChildren().add(teamTable);\n teamTaxiBox.getChildren().add(teamTaxiTable);\n teamWorkspacePane.getChildren().add(draftNameControls);\n teamWorkspacePane.getChildren().add(teamControls);\n teamWorkspacePane.getChildren().add(teamTableBox);\n teamWorkspacePane.getChildren().add(teamTaxiBox);\n teamScroll.setContent(teamWorkspacePane);\n teamTab.setContent(teamScroll);\n mainWorkspacePane.getTabs().add(teamTab);\n \n ArrayList<Player> tempTeam = new ArrayList<>();\n for (Team tt : dataManager.getDraft().getFantasyTeams()) {\n if (tt.getTeamName().equals(selectTeam.getSelectionModel().getSelectedItem()))\n tempTeam = tt.getTeamList();\n }\n teamTable = resetTeamTable(tempTeam);\n }", "public static void addScratchPanel() {\n scratchDetailPanel = new ScratchDetailPanel();\n JTabbedPane scratchTP = ScratchPanel.getScratchTP();\n numScratchLabels++;\n \n boolean debug = false;\n if (debug) { \n System.out.println(\"prior numScratchPanels \" + numScratchPanelsAdded);\n System.out.println(\"prior num Components \" + scratchTP.getComponentCount());\n System.out.println(\"numScratchPanelsRemoved \" + numScratchPanelsRemoved);\n }\n\n\n try {\n scratchTP.add(scratchDetailPanel, \"Scratch \" + numScratchLabels,numScratchPanelsAdded - numScratchPanelsRemoved);\n } catch (Exception e) {\n // ignore any errors here\n }\n \n if (debug) System.out.println(\"panel added\");\n \n if (numScratchPanelsAdded >= 1) scratchTP.setSelectedComponent(scratchDetailPanel);\n try {\n scratchTP.setTabComponentAt(numScratchPanelsAdded - numScratchPanelsRemoved, new ButtonTabComponent(scratchTP));\n } catch (Exception e) {\n //ignore any errors here\n }\n numScratchPanelsAdded++;\n \n \n if (debug) { \n System.out.println(\"post numScratchPanels \" + numScratchPanelsAdded);\n System.out.println(\"post num Components \" + scratchTP.getComponentCount());\n }\n\n }", "public String addNewAlgorithm(){\r\n \tint algID = algorithmList.addNewAlgorithmToDB(selectedAlgorithm.getServiceID()); // use the serviceID of the last selected algorithm, as the odds are good it will be the right one. \r\n \tinitAlgorithmList(algID);\r\n \tthis.getLog().info(\"+ nextView: editM_Tabpage\"); \r\n \treturn \"editM_Tabpage\";\r\n }", "private void initTabComponent(DocumentWrapper file, int i) {\n\t\tpane.setTabComponentAt(i,\n\t\t\t\tnew ButtonTabComponent(pane, file, this));\n\t}", "public void buildStagingPanel() {\n if (tabbedPane == null) {\n tabbedPane = new JTabbedPane(SwingConstants.TOP);\n tabbedPane.addTab(\"Query\", _widgetPanel);\n tabbedPane.addTab(om.getProgramName(), om.getTreePanel());\n tabbedPane.addTab(\"Calibrations\", calibrationMenu);\n tabbedPane.setVisible(true);\n } else {\n tabbedPane.setTitleAt(1, om.getProgramName());\n }\n\n tabbedPane.setSelectedIndex(1);\n }" ]
[ "0.79866046", "0.77698094", "0.7637104", "0.7609997", "0.7410794", "0.73657286", "0.73619086", "0.7357617", "0.7291783", "0.72261935", "0.71485823", "0.7049428", "0.70194364", "0.6985553", "0.6735362", "0.6713877", "0.6648356", "0.6642767", "0.65923995", "0.65859544", "0.65441775", "0.652596", "0.65167654", "0.6448859", "0.643677", "0.6424702", "0.638445", "0.63834167", "0.63636136", "0.6355508", "0.63536435", "0.6351585", "0.63372284", "0.6294259", "0.62889075", "0.6276891", "0.6258147", "0.62529516", "0.6235393", "0.62246114", "0.62071645", "0.61918956", "0.6180506", "0.6171554", "0.6133731", "0.6132987", "0.61095905", "0.6104488", "0.60903376", "0.6086063", "0.60647064", "0.6063891", "0.6057324", "0.6044985", "0.60440534", "0.602034", "0.60121244", "0.600926", "0.6007239", "0.6002285", "0.59732836", "0.59722894", "0.5963675", "0.59620816", "0.5954101", "0.5950963", "0.59353733", "0.5932605", "0.5896661", "0.58785254", "0.58764464", "0.58593094", "0.5859305", "0.58579683", "0.58549863", "0.585371", "0.584575", "0.58424336", "0.5837665", "0.5814465", "0.5813238", "0.58047116", "0.58029115", "0.5779714", "0.57775635", "0.5776602", "0.57721364", "0.577182", "0.5769959", "0.57613504", "0.5759437", "0.57435066", "0.5727529", "0.5725704", "0.572265", "0.5722373", "0.570741", "0.5698421", "0.5694417", "0.5690968" ]
0.72968245
8
===========================================================================================// THIS IS WHERE THE MAGIC HAPPENS The interpreter method the mode variable designates if the code is a part of a function method. 0 not a function 1 function
public void interpretorMainMethod(String code, int mode) { //TODO comments // Used to count the bracket balance int bracket_depth = 0; // Loop variables, loop_active designates whether the current line // is a part of a loop, loop_length designates how many times the loop // will run boolean loop_active = false; int loop_length = 0; // If statement variable, designates if the if condition // allows for the code that follows it to execute boolean conditional_state = true; // A flag the determines whether the current line should // be interpreted boolean skip_line = false; // Function variables, function_name contains the name // of the function currently being ran or written, function_is_being_written // indicates that the current lien of code is part of the function being // written/saved, function_arguments contains the arguments that the // function comes with String function_name = ""; boolean function_is_being_written = false; LinkedList<String> function_arguments = new LinkedList<>(); // The current line number being interpreted // Note: lines in loops, if statements and functions // are counted separately int line_count = 0; // Scanner for the code String Scanner line_scanner = new Scanner(code); // This String contains bracketed code which will be passed to // either a new function or to be ran via loop String passed_code = ""; // Outer interpreter while(line_scanner.hasNextLine()) { line_count++; String line_temp = line_scanner.nextLine(); String line = ""; // This code removes the leading spaces from the line for(int i = 0; i<line_temp.length(); i++) { if(line_temp.charAt(i) != ' ') { line = line_temp.substring(i); i = 999; } } // Line length after clearing the leading spaces int line_length = line.length(); // Bracket depth control // Counts bracket depth and makes the inner interpreter skip // the first and last bracket if(line.contains("(")) { bracket_depth++; if(bracket_depth == 1) skip_line = true; } else if(line.contains(")")) { bracket_depth--; if(bracket_depth == 0) skip_line = true; } else if(line.isEmpty()) { skip_line = true; } // Comments skip // Makes the inner interpreter skip lines beginning with "//" if(line_length > 2) { if(line.substring(0, 2).equals("//")) skip_line = true; } // if statement lock/skip // Makes the inner interpreter skip 'if' statement blocks if // the 'if' statement is false if(!conditional_state && bracket_depth != 0) { skip_line = true; } else if(!conditional_state && bracket_depth == 0) { conditional_state = true; } // Inner interpreter // Handles the syntax interpretation and execution if(!skip_line) { // This checks if we have reached the end of the function declaration, // should we do the function is saved in the function map if(bracket_depth == 0 && function_is_being_written) { function_is_being_written = false; functions.put(function_name, functionHandler(function_arguments, passed_code, "write")); function_arguments.clear(); passed_code = ""; // This checks if we have reached the end of the code block contained in the loop, // should we do the code contained in the loop (the passed_code variable) // gets passed along in a recursive call to the interpreter main method. } else if(bracket_depth == 0 && loop_active){ if(mode == 1) { for(int i=0; i<loop_length; i++) interpretorMainMethod(passed_code, 1); } else { for(int i=0; i<loop_length; i++) interpretorMainMethod(passed_code, 0); } loop_active = false; loop_length = 0; passed_code = ""; // This checks if we have reached the end of code block contained in the 'if' // Statement, should we do: the conditional_state variable is set to true } else if(bracket_depth == 0 && !conditional_state) { conditional_state = true; } // If either the function_is_being_written or loop_active variables are true // we simply pass the current line to a temporary string without // interpreting it if(function_is_being_written || loop_active) { passed_code += line + "\n"; // Secondary bracket skips, this is here only on account of having to // check the function, loop, 'if' statement endings } else if(line.contains("(") || line.contains(")")) { // The key words are checked } else { // This loop determines the location of the first non-space character. // However as the code above indicates, this will always be 0, because // we remove the empty spaces beforehand in the Outer interpreter. // The loop here is simply for debugging purposes. int empty_space = 0; boolean space_error = false; while(line.charAt(empty_space) == ' ' || space_error) { empty_space++; if(empty_space == 50) { space_error = true; } } // stop statement // Syntax: stop // Corresponds to: no java counterpart // Indicates the end of a code block if (line.contains("stop") && line.length() < 7) { } // def statement // Syntax: def x : y // Corresponds to: int x = y; OR Double x = y; OR String x = y; else if(line_length > 3 && line.substring(empty_space, empty_space+4).equals("def ")) { int end_of_word_offset; String var_name = ""; String var_definition = ""; boolean comma_present = false; int offset = empty_space+4; // This loop finds and assigns the definition components: // the var_name - the name of the variable we are defining // the var_definition - the contents of the variable while(offset < line_length) { if(line.charAt(offset) == ' ') offset++; else { if(var_name.isEmpty()) { end_of_word_offset = nextWordEndIndex(line, offset); var_name = line.substring(offset, end_of_word_offset); offset = end_of_word_offset; } else if(!comma_present && line.charAt(offset) == ':') { comma_present = true; offset++; } else if(var_definition.isEmpty() && comma_present) { var_definition = line.substring(offset, line_length); offset = line_length; } else { offset = line_length; } } } // This checks if the definition syntax is correct if(var_name.isEmpty() || var_definition.isEmpty() || !comma_present) { minc.consolearea.append("Error: bad definition syntax. line "+line_count+"\n"); } else { // This checks if we are using a reserved word as the name of the variable if(!(var_name.equals("def") && var_name.equals("inc") && var_name.equals("dec") && var_name.equals("output") && var_name.equals("loop") && var_name.equals("if") && var_name.equals("loadfile"))) { if(isNumber(var_definition)) { if(mode == 0) double_variables.put(var_name, 0.0 + Integer.parseInt(var_definition)); else local_double_variables.put(var_name, 0.0 + Integer.parseInt(var_definition)); } else { if(var_definition.length() > 4) { if(var_definition.substring(0, 4).equals("var.")) { String key = var_definition.substring(4, var_definition.length()); if(mode == 1) { if(local_double_variables.containsKey(key)) local_double_variables.put(var_name, local_double_variables.get(key)); else if(local_string_variables.containsKey(key)) local_string_variables.put(var_name, local_string_variables.get(key)); else if(double_variables.containsKey(key)) local_double_variables.put(var_name, double_variables.get(key)); else if(string_variables.containsKey(key)) local_string_variables.put(var_name, string_variables.get(key)); else minc.consolearea.append("Error: bad variable call in def. line "+line_count+"\n"); } else { if(double_variables.containsKey(key)) double_variables.put(var_name,double_variables.get(key)); else if(string_variables.containsKey(key)) string_variables.put(var_name,string_variables.get(key)); else minc.consolearea.append("Error: bad variable call in def. line "+line_count+"\n"); } } else { if(mode == 0) string_variables.put(var_name, var_definition); else local_string_variables.put(var_name, var_definition); } } } } else { minc.consolearea.append("Error: prohibited reserved word use. line "+line_count+"\n"); } } } // inc statement // Syntax: inc x // Corresponds to: x++; else if(line_length > 3 && line.substring(empty_space, empty_space+4).equals("inc ")) { String var_name; int offset = empty_space+4; while(offset < line_length) { if(line.charAt(offset) == ' ') { offset++; } else { var_name = line.substring(offset, line_length).replaceAll("\\s+",""); if(!var_name.isEmpty()) { if(mode == 1) { if(local_double_variables.containsKey(var_name)) local_double_variables.put(var_name, local_double_variables.get(var_name)+1.0); else if(double_variables.containsKey(var_name)) double_variables.put(var_name, double_variables.get(var_name)+1.0); else minc.consolearea.append("Error: bad increment syntax. line "+line_count+"\n"); } else { if(double_variables.containsKey(var_name)) double_variables.put(var_name, double_variables.get(var_name)+1.0); else minc.consolearea.append("Error: bad increment syntax. line "+line_count+"\n"); } } else { minc.consolearea.append("Error: bad increment syntax. line "+line_count+"\n"); } offset = line_length; } } } // dec statement // Syntax: dec x // Corresponds to: x--; else if(line_length > 3 && line.substring(empty_space, empty_space+4).equals("dec ")) { String var_name; int offset = empty_space+4; while(offset < line_length) { if(line.charAt(offset) == ' ') { offset++; } else { var_name = line.substring(offset, line_length).replaceAll("\\s+",""); if(!var_name.isEmpty()) { if(mode == 1) { if(local_double_variables.containsKey(var_name)) local_double_variables.put(var_name, local_double_variables.get(var_name)-1.0); else if(double_variables.containsKey(var_name)) double_variables.put(var_name, double_variables.get(var_name)-1.0); else minc.consolearea.append("Error: bad increment syntax. line "+line_count+"\n"); } else { if(double_variables.containsKey(var_name)) double_variables.put(var_name, double_variables.get(var_name)-1.0); else minc.consolearea.append("Error: bad increment syntax. line "+line_count+"\n"); } } else { minc.consolearea.append("Error: bad decrement syntax. line "+line_count+"\n"); } offset = line_length; } } } // output statement // Syntax: output : x // Corresponds to: System.out.println(x); else if(line_length > 8 && line.substring(empty_space, empty_space+9).equals("output : ")) { int end_of_word_offset; String output_string = ""; String temp_word; int offset = empty_space+9; while(offset < line_length) { if(line.charAt(offset) == ' ') { output_string += line.charAt(offset); offset++; } else { end_of_word_offset = nextWordEndIndex(line, offset); temp_word = line.substring(offset, end_of_word_offset); offset = end_of_word_offset; if(temp_word.length() > 4) { if(temp_word.substring(0, 4).equals("var.")) { String key = temp_word.substring(4, temp_word.length()); if(mode == 1) { if(local_double_variables.containsKey(key)) output_string += local_double_variables.get(key); else if(local_string_variables.containsKey(key)) output_string += local_string_variables.get(key); else if(double_variables.containsKey(key)) output_string += double_variables.get(key); else if(string_variables.containsKey(key)) output_string += string_variables.get(key); else minc.consolearea.append("Error: bad variable call in output. line "+line_count+"\n"); } else { if(double_variables.containsKey(key)) output_string += double_variables.get(key); else if(string_variables.containsKey(key)) output_string += string_variables.get(key); else minc.consolearea.append("Error: bad variable call in output. line "+line_count+"\n"); } } else { output_string += temp_word; } } else { output_string += temp_word; } } } minc.consolearea.append(output_string+"\n"); } // loop statement // Syntax: loop x // Corresponds to: for(int i=0; i<x; i++) else if(line_length > 4 && line.substring(empty_space, empty_space+5).equals("loop ")) { try { String next_element = line.substring(empty_space+5, nextWordEndIndex(line, empty_space+5)); // Flags the loop as active for the interpreter loop_active = true; // These conditions attempt to retrieve the loop variable, or // the number of times the loop will execute if(isNumber(next_element)) { loop_length = Integer.parseInt(next_element); } else if(mode == 1) { if(local_double_variables.containsKey(next_element)) loop_length += local_double_variables.get(next_element); else if(double_variables.containsKey(next_element)) loop_length += double_variables.get(next_element); else minc.consolearea.append("Error: bad loop syntax. line "+line_count+"\n"); } else { if(double_variables.containsKey(next_element)) loop_length += double_variables.get(next_element); else minc.consolearea.append("Error: bad loop syntax. line "+line_count+"\n"); } } catch (IndexOutOfBoundsException e) { minc.consolearea.append("Error: bad loop syntax. line "+line_count+"\n"); } } // if statement // Syntax and correspondent expressions explained below // This is a rather length segment of the interpreter, however the code logic // is very simple: the code checks for proper syntax and whether the called // variables are defined. The length is a product of the possible combinations of // variable types. else if(line_length > 2 && line.substring(empty_space, empty_space+3).equals("if ")) { try { String next_element = line.substring(empty_space+3, nextWordEndIndex(line, empty_space+3)); String lhs; String rhs; // Equals condition // Syntax: if eq x y // Corresponds to: if(x == y) if(next_element.equals("eq")) { lhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6)); rhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1)); if(isNumber(lhs) && isNumber(rhs)) { if(Integer.parseInt(lhs) != Integer.parseInt(rhs)) { conditional_state = false; } } else if(isNumber(lhs)) { if(mode == 1) { if(local_double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) != local_double_variables.get(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) != double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } else { if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) != double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } } else if(isNumber(rhs)) { if(mode == 1) { if(local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs) != Integer.parseInt(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) != Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } else { if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) != Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } } else { if(mode == 1) { if(local_double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs)+1 != local_double_variables.get(rhs)+1) { conditional_state = false; } } else if(local_double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs)+1 != double_variables.get(rhs)+1) { conditional_state = false; } } else if(double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 != local_double_variables.get(rhs)+1) { conditional_state = false; } } else if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 != double_variables.get(rhs)+1) { conditional_state = false; } } else if(local_string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) { if(!local_string_variables.get(lhs).equals(local_string_variables.get(rhs))) { conditional_state = false; } } else if(local_string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(!local_string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) { if(!string_variables.get(lhs).equals(local_string_variables.get(rhs))) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(!string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } else { if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 != double_variables.get(rhs)+1) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(!string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } } // Not equals condition // Syntax: if neq x y // Corresponds to: if(x != y) } else if(next_element.equals("neq")) { lhs = line.substring(empty_space+7, nextWordEndIndex(line, empty_space+7)); rhs = line.substring(empty_space+7+lhs.length()+1, nextWordEndIndex(line, empty_space+7+lhs.length()+1)); if(isNumber(lhs) && isNumber(rhs)) { if(Integer.parseInt(lhs) == Integer.parseInt(rhs)) { conditional_state = false; } } else if(isNumber(lhs)) { if(mode == 1) { if(local_double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) == local_double_variables.get(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) == double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } else { if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) == double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } } else if(isNumber(rhs)) { if(mode == 1) { if(local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs) == Integer.parseInt(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) == Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } else { if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) == Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } } else { if(mode == 1) { if(local_double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs)+1 == local_double_variables.get(rhs)+1) { conditional_state = false; } } else if(local_double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs)+1 == double_variables.get(rhs)+1) { conditional_state = false; } } else if(double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 == local_double_variables.get(rhs)+1) { conditional_state = false; } } else if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 == double_variables.get(rhs)+1) { conditional_state = false; } } else if(local_string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) { if(local_string_variables.get(lhs).equals(local_string_variables.get(rhs))) { conditional_state = false; } } else if(local_string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(local_string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) { if(string_variables.get(lhs).equals(local_string_variables.get(rhs))) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } else { if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 == double_variables.get(rhs)+1) { conditional_state = false; } } else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) { if(string_variables.get(lhs).equals(string_variables.get(rhs))) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } } // Less than condition // Syntax: if lt x y // Corresponds to: if(x < y) } else if(next_element.equals("lt")) { lhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6)); rhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1)); if(isNumber(lhs) && isNumber(rhs)) { if(Integer.parseInt(lhs) >= Integer.parseInt(rhs)) { conditional_state = false; } } else if(isNumber(lhs)) { if(mode == 1) { if(local_double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) >= local_double_variables.get(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) >= double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } else { if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) >= double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } } else if(isNumber(rhs)) { if(mode == 1) { if(local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs) >= Integer.parseInt(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) >= Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } else { if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) >= Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } } else { if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 >= double_variables.get(rhs)+1) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } // Greater than condition // Syntax: if gt x y // Corresponds to: if(x > y) } else if(next_element.equals("gt")) { lhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6)); rhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1)); if(isNumber(lhs) && isNumber(rhs)) { if(Integer.parseInt(lhs) <= Integer.parseInt(rhs)) { conditional_state = false; } } else if(isNumber(lhs)) { if(mode == 1) { if(local_double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) <= local_double_variables.get(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) <= double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } else { if(double_variables.containsKey(rhs)) { if(Integer.parseInt(lhs) <= double_variables.get(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+rhs+"\n"); } } } else if(isNumber(rhs)) { if(mode == 1) { if(local_double_variables.containsKey(lhs)) { if(local_double_variables.get(lhs) <= Integer.parseInt(rhs)) { conditional_state = false; } } else if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) <= Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } else { if(double_variables.containsKey(lhs)) { if(double_variables.get(lhs) <= Integer.parseInt(rhs)) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable: "+lhs+"\n"); } } } else { if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) { if(double_variables.get(lhs)+1 <= double_variables.get(rhs)+1) { conditional_state = false; } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+". Unknown variable\n"); } } } else { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+"\n"); } } catch (IndexOutOfBoundsException e) { minc.consolearea.append("Error: bad conditional syntax. line "+line_count+"\n"); } } // loadfile statement // Syntax: loadfile filename.minl // Corresponds to: no java analog // This code simply executes the MinL code written on another file. else if(line_length > 8 && line.substring(empty_space, empty_space+9).equals("loadfile ")) { try { String next_element = line.substring(empty_space+9, nextWordEndIndex(line, empty_space+9)); fileLoaderMethod(next_element); } catch (IndexOutOfBoundsException e) { //TODO error test minc.consolearea.append("Error: bad loadfile syntax. line "+line_count+"\n"); } } // function declaration/call // Syntax: f.function_name x y z // Corresponds to: public void function_name(int/Double/String x, int/Double/String y, int/Double/String z) else if(line_length > 1 && line.substring(empty_space, empty_space+2).equals("f.")) { try { String next_element = line.substring(empty_space+2, nextWordEndIndex(line, empty_space+2)); function_name = "f."+next_element; // These two conditions identify whether the function called is defined or not // if it is the function is simply called, if not it is declared. The syntax for call is simple: // f.function_name argument1 argument2 etc... // The syntax for declare requires a code block: // f.function_name argument_name1 argument_name2 etc... // { // loop argument_name1 // { // inc argument_name2 // } // } if(functions.containsKey(function_name)) { // Function call code if(function_name.length() == line_length) { interpretorMainMethod(functions.get(function_name), 1); } else { int offset = function_name.length()+1; // This loop retrieves and saves the function arguments in a list while(offset < line.length()) { if(line.charAt(offset) == ' ') { offset++; } else { next_element = line.substring(offset, nextWordEndIndex(line, offset)); offset = nextWordEndIndex(line, offset); function_arguments.add(next_element); } } // The function is called via recursive call to the interpreterMainMethod interpretorMainMethod(functionHandler(function_arguments, functions.get(function_name), "read"), 1); local_double_variables.clear(); local_string_variables.clear(); function_arguments.clear(); } } else { // function declare code // take note the function isn't actually saved here, but in the code far above function_is_being_written = true; if(function_name.length() != line_length) { int offset = function_name.length()+1; // This loop retrieves and saves the function arguments in a list while(offset < line.length()) { if(line.charAt(offset) == ' ') { offset++; } else { next_element = line.substring(offset, nextWordEndIndex(line, offset)); offset = nextWordEndIndex(line, offset); function_arguments.add(next_element); } } } } } catch (IndexOutOfBoundsException e) { //TODO error test minc.consolearea.append("Error: bad function syntax. line "+line_count+"\n"+line); } } // report error else { minc.consolearea.append("Error: Unknown Operation. line "+line_count+"\n"+line); } } } else { skip_line = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMode() { return \"FUNC\"; }", "public T mode();", "public int getFunctionType() {\n/* 60 */ return 4;\n/* */ }", "public void changeMode() {\n methodMode = !methodMode;\n }", "public abstract int code();", "public boolean isFunction() { return isFunc; }", "boolean method_108();", "@Override\n public abstract void runOpMode();", "boolean method_109();", "boolean hasCode();", "boolean hasCode();", "boolean hasCode();", "public void interpreter(Context context){\n System.out.println(\"abstract interpr of context \" +\n \"and call teminal or not terminal context\");\n context.arrayOfActions.get(0).interpreter(context);\n context.arrayOfNumbers.get(0).interpreter(context);\n\n }", "private static void functionMode() throws NoSuchCommandExceptions\n\t{\n\t\t// show some welcome message\n\t\tui.showWelcomeMsg(input);\n\n\t\t// ask user to enter G, R, A, W or E\n\t\twhile (true)\n\t\t{\n\t\t\tinput = ui.promptCommand(input);\n\n\t\t\tif (input.toUpperCase().equals(\"G\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(ui.aGradeSystem.showGrade(id));\n\t\t\t}\n\t\t\telse if (input.toUpperCase().equals(\"R\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(ui.aGradeSystem.showRank(id));\n\t\t\t}\n\t\t\telse if (input.toUpperCase().equals(\"W\"))\n\t\t\t{\n\t\t\t\tui.aGradeSystem.updateWeights();\n\t\t\t}\n\t\t\telse if (input.toUpperCase().equals(\"E\"))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public int evalMode(int op, int mode) {\n if (mode == 4) {\n return this.state <= AppOpsManager.resolveFirstUnrestrictedUidState(op) ? 0 : 1;\n }\n return mode;\n }", "int method_113();", "@Override\n\tpublic Type generateIntermediateCode(Function fun) {\n\t\tErrorList err = ErrorList.getInstance();\n\t\tFunctionDeclaration funDec = null;\n\t\tif(Semantic.globalFuntionTable.containsKey(id))\n\t\t\tfunDec = Semantic.globalFuntionTable.get(id);\n\t\telse \n\t\t\terr.addException(new SemanticException(id, super.getLine(), 8));\n\t\t\n\t\tfor(int i = argsList.size() - 1; i >= 0; i--){\n\t\t\tOperation op = new Operation(OperandType.PUSH, fun.getCurrBlock());\n\t\t\tType paramType = argsList.get(i).generateIntermediateCode(fun);\n\t\t\tif(funDec != null){\n\t\t\t\tif(funDec.getParameters().get(i) == null || funDec.getParameters().get(i).getType() != paramType ||\n\t\t\t\t\t\t(fun.getSymbolTable().get(id) != null && (funDec.getParameters().get(i).isArray() != \n\t\t\t\t\t\tfun.getSymbolTable().get(id).isArray()))){\n\t\t\t\t\terr.addException(new SemanticException(id, super.getLine(), 11));\n\t\t\t\t}\n\t\t\t}\n\t\t\tOperand oper = null;\n\t\t\tif(argsList.get(i) instanceof LiteralExpression){\n\t\t\t\tObject num = ((LiteralExpression)argsList.get(i)).getNumber();\n\t\t\t\tif(num.getClass() == Integer.class)\n\t\t\t\t\toper = new Operand(OperandType.INT, (int)num);\n\t\t\t\telse\n\t\t\t\t\toper = new Operand(OperandType.FLOAT, (double)num);\n\t\t\t}\n\t\t\telse \n\t\t\t\toper = new Operand(OperandType.REG, argsList.get(i).getRegNum());\n\t\t\top.setSrcOperand(0, oper);\n\t\t\tfun.getCurrBlock().appendOperation(op);\n\t\t}\n\t\tOperation op = new Operation(OperandType.CALL, fun.getCurrBlock());\n\t\t//Attribute\n\t\tOperand oper = new Operand(OperandType.FUNC_NAME, getId());\n\t\top.setSrcOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\t\n\t\top = new Operation(OperandType.MOV, fun.getCurrBlock());\n\t\toper = new Operand(OperandType.RET, \"ret\");\n\t\top.setSrcOperand(0, oper);\n\t\t\n\t\tsuper.setRegNum(fun.getNewRegisterNum());\n\t\toper = new Operand(OperandType.REG, super.getRegNum());\n\t\top.setDestOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\tif(funDec != null)\n\t\t\treturn funDec.getType();\n\t\telse\n\t\t\treturn Type.NULL;\n\t}", "public static int isMethod() {\n return isNameExpr;\n }", "boolean getDoFunctionInlining();", "public abstract boolean mo9737c();", "public abstract boolean mo9234ar();", "public int evalMode() {\n return this.uidState.evalMode(this.op, this.mode);\n }", "private void isMethod() {\n ArrayAdapter<String> isVariable = new ArrayAdapter<>(this, isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);\n isNameExpr.isMethod(isNameExpr);\n isNameExpr.isMethod((isParameter, isParameter, isParameter, isParameter) -> {\n isNameExpr = isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr), isNameExpr);\n isMethod(isNameExpr);\n isNameExpr = isNameExpr;\n });\n }", "boolean isOp();", "@Override\n\tpublic int returnModeNumber() {\n\t\treturn 0;\n\t}", "public interface Code {\r\n \r\n /**\r\n * Called to execute the \"next\" line of code in this\r\n * virtual hardware component.\r\n * \r\n * This can be any action (or sequence of actions) as desired by\r\n * the implementation to simulate hardware functions.\r\n * \r\n * @return true when this \"process\" wants to exit.\r\n */\r\n public boolean executeNext();\r\n \r\n /**\r\n * Called when this instruction set should terminate execution permanently.\r\n * This method SHOULD NOT modify the process Identifier or CPU. It should\r\n * only shut down any processing needs and reset internal data if this\r\n * process is executed again.\r\n */\r\n public void shutdown();\r\n\r\n /**\r\n * Get the program name.\r\n */\r\n public String getName();\r\n \r\n // </editor-fold>\r\n }", "private boolean isProcedureFunction(int nextVal) throws java.io.IOException {\n\t\tif (nextVal == PREPROCESSING) {\n\t\t\tint pos = (int) reader.getFilePointer();\n\t\t\tthis.readUntilEndOfLine(nextVal);\n\t\t\treader.seek(pos);\n\t\t\treturn next.matches(\"\\\\A!procedure.*\") || next.matches(\"\\\\A!function.*\");\n\t\t}\n\t\treturn false;\n\t}", "public void mode() {\n APIlib.getInstance().addJSLine(jsBase + \".mode();\");\n }", "private boolean isMethod() {\n return !line.contains(\"=\") && !line.contains(\".\") && !semicolon && line.contains(\"(\");\n }", "public abstract boolean mo36211n();", "public int isMethod() {\n return isNameExpr;\n }", "public interface ModeTest {\n\n public void traditionalTest();\n\n public void modeTest();\n\n}", "public boolean isFunction() {\n return false;\n }", "public abstract boolean mo9735b();", "FunctionCall getFc();", "public boolean supportsCallee(SootMethod method);", "public abstract int getMode();", "@Override\r\n\tpublic void visit(MethodDeclNode functionDeclaration) {\n\t\tStmtNode body = functionDeclaration.getBody();\r\n\t\tif(body == null||(!options.getParamBool(Parameter.TEST_CHECK_NATIVE_FUNCTION_BODIES)&&curSourceInfo.getType()==InclusionType.NATIVE)) return;\r\n\t\t\r\n\t\t//Remember old function (in case we have nested functions or local classes inside a function)\r\n\t\tOperation functionBefore = curOperation;\r\n\t\tLoopSemantics loopBefore = curLoop;\r\n\t\t\r\n\t\t//A function begins not in a loop\r\n\t\tcurLoop = null;\r\n\t\t\r\n\t\t//We are on top of the function\r\n\t\tisOnTop = true;\r\n\t\t\r\n\t\t//Set current function\r\n\t\tcurOperation = (Function)functionDeclaration.getSemantics();\r\n\t\t\r\n\t\t//Register parameters as local variables\r\n\t\tfor(VarDecl v: curOperation.getParams()){\r\n\t\t\tnameResolver.registerLocalVar(v);\r\n\t\t}\r\n\t\t\r\n\t\t//Register implicit parameters, too\r\n\t\tList<ImplicitParamDecl> implParams = curOperation.getImplicitParams();\r\n\t\tif(implParams != null){\r\n\t\t\tfor(ImplicitParamDecl p : implParams){\r\n\t\t\t\tnameResolver.registerLocalVar(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//If this is a con-/destructor, do checks for it\r\n\t\tOperationType functionType = curOperation.getOperationType();\r\n\t\tswitch(functionType){\r\n\t\tcase CONSTRUCTOR:\r\n\t\t\tcheckConstructor((Constructor)curOperation,body);\r\n\t\t\tbreak;\r\n\t\tcase DESTRUCTOR:\r\n\t\t\tcheckDestructor((Destructor)curOperation);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t//Analyze the body\r\n\t\tbody.accept(this);\r\n\t\t\t\r\n\t\t//Get the local variable result\r\n\t\tcurOperation.setLocals(nameResolver.methodFinished(OperationUtil.countParams(curOperation)));\r\n\r\n\t\t//If this is a non void function, check if the exec path does not end without a return\r\n\t\tif(curOperation.getReturnType()!=BASIC.VOID&&functionType!=OperationType.CONSTRUCTOR){\r\n\t\t\tif(!execPathStack.isTopFrameEmpty())\r\n\t\t\t\tProblem.ofType(ProblemId.MISSING_RETURN).at(functionDeclaration)\r\n\t\t\t\t\t\t.raise();\r\n\t\t}\r\n\t\t//Check if the control flow reaches the end of the function\r\n\t\tcurOperation.setFlowReachesEnd(!execPathStack.isTopFrameEmpty());\r\n\t\t\r\n\t\t//Pop the last frame from the method and check if the stack is empty\r\n\t\texecPathStack.popFrameAndDiscard();\r\n\t\tif(!execPathStack.isStackEmpty()){\r\n\t\t\tthrow new InternalProgramError(functionDeclaration,\"Execution path stack is not empty at the end of a function. Please file a bug report!\");\r\n\t\t}\r\n\t\t\r\n\t\t//Restore function before\r\n\t\tcurOperation = functionBefore;\r\n\t\tcurLoop = loopBefore;\r\n\t\t\t\t\r\n\t}", "abstract public PyCode getMain();", "public String getFunType() {\r\n return funType;\r\n }", "public String functionHandler(LinkedList<String> argumentList, String code, String mode) {\n\t\t\n\t\tScanner code_scanner = new Scanner(code);\n\t\tString code_line;\n\t\tString final_code = \"\";\n\t\t\n\t\twhile(code_scanner.hasNextLine()) {\n\t\t\tcode_line = code_scanner.nextLine();\n\t\t\t\n\t\t\tString code_word = \"\";\n\t\t\t\n\t\t\tfor(int i=0; i<code_line.length(); i++) {\t\t\t\n\t\t\t\tif(code_line.charAt(i) != ' ' && i<code_line.length()-1) {\n\t\t\t\t\tcode_word += code_line.charAt(i);\n\t\t\t\t} else if(i == code_line.length()-1) {\n\t\t\t\t\tcode_word += code_line.charAt(i);\n\t\t\t\t\tif(mode.equals(\"write\")) {\n\t\t\t\t\t\tif(argumentList.contains(code_word)) {\n\t\t\t\t\t\t\tcode_word = \"$p\" + argumentList.indexOf(code_word);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(mode.equals(\"read\")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(code_word.length() > 2 && code_word.substring(0, 2).equals(\"$p\")) {\n\t\t\t\t\t\t\tcode_word = argumentList.get(Integer.parseInt(code_word.substring(2, 3)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal_code += code_word;\n\t\t\t\t\tfinal_code += \" \";\n\t\t\t\t\tcode_word = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tif(mode.equals(\"write\")) {\n\t\t\t\t\t\tif(argumentList.contains(code_word)) {\n\t\t\t\t\t\t\tcode_word = \"$p\" + argumentList.indexOf(code_word);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(mode.equals(\"read\")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(code_word.length() > 2 && code_word.substring(0, 2).equals(\"$p\")) {\n\t\t\t\t\t\t\tcode_word = argumentList.get(Integer.parseInt(code_word.substring(2, 3)));\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal_code += code_word;\n\t\t\t\t\tfinal_code += \" \";\n\t\t\t\t\tcode_word = \"\";\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\n\t\t\tfinal_code += \"\\n\";\n\t\t}\n\t\treturn final_code;\n\t}", "public void exec(PyObject code) {\n }", "public int getFunction() {\n\t\treturn var;\n\t}", "public Integer getFuncCode() {\n\t\treturn funcCode;\n\t}", "public abstract int mo9741f();", "public boolean isInMethodMode() {\n return methodMode;\n }", "public boolean runCode ( String theCode , String routine ) throws EVASyntaxException , EVASemanticException\r\n\t{\r\n\t\t//Debug.println(\"Going to run code.\");\r\n\t\t//Debug.println(\"Routine = \" + routine );\r\n\t\t\r\n\t\t//ejecutar el segmento init (estados iniciales)\r\n\t\tint curlimit = cont[INIT]; //longitud de init\r\n\t\tfor ( int i = 0 ; i < curlimit ; i++ )\r\n\t\t{\r\n\t\t\tStringTokenizer initTokenizer = new StringTokenizer( segmento[INIT][i] , \":\" );\r\n\t\t\tif ( initTokenizer.countTokens() < 2 )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\r\n\t\t\t\t\"Too few tokens with : at INIT segment, line \" + i + \" (\" + segmento[INIT][i] + \")\" ) );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tString reg = initTokenizer.nextToken().trim();\r\n\t\t\t\tString val = initTokenizer.nextToken().trim();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Debug.println(\"Initialization done.\");\r\n\t\t\r\n\t\tprogram_counter = getLine ( routine , CODE );\r\n\t\t\r\n\t\t//Debug.println(\"PC = \" + program_counter );\r\n\t\t\r\n\t\tif ( program_counter == -1 )\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t\t//no ejecutado\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( runNextInstruction() ) ;\r\n\t\t\tif ( !continue_flag )\r\n\t\t\t\treturn true; //codigo ejecutado\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tcontinue_flag = false;\r\n\t\t\t\treturn false; //esto es si encontramos un continue, devolvemos \"false\" como si\r\n\t\t\t\t//no hubieramos ejecutado el código para que el parser siga ejecutando el comando.\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public void runProgram() {\n\t\tJTextPane code = ((MinLFile) tabbedPane.getSelectedComponent()).CodeArea;\n\t\tminc.consolearea.setText(\"\");\n\t\tinterpretorMainMethod(code.getText(), 0);\n\t\tdouble_variables.clear();\n\t\tstring_variables.clear();\n\t\tfunctions.clear();\n\t}", "public void parseFunctions(){\n\t\t\n\t}", "public abstract boolean mo9230aE();", "@Override\n public String codeGen() {\n\n\tString labelFun = \"labelFun\" + MiniFunLib.getLabIndex();\n\tString popParSequence = \"\";\n\tString popLocalVariable = \"\";\n\tString localVariableCodeGen = \"\";\n\n\tfor (int i = 0; i < funParams.size(); i++) {\n\t NodeType nt = this.funParams.get(i).getType().getNodeType();\n\n\t if (nt == NodeType.ARROWTYPE_NODE)\n\t\tpopParSequence += VMCommands.POP + \"\\n\" + VMCommands.POP + \"\\n\";\n\t else\n\t\tpopParSequence += VMCommands.POP + \"\\n\";\n\t}\n\n\tfor (int i = 0; i < funLocalVariables.size(); i++) {\n\t localVariableCodeGen += funLocalVariables.get(i).codeGen();\n\t popLocalVariable += VMCommands.POP + \"\\n\";\n\t}\n\n\tString code = labelFun + \" :\\n\" +\n\t// Preparo parte bassa dell'activation Record\n\n\t\t// Il registro FP punterà al nuovo Activation Record\n\t\tVMCommands.CFP + \"\\n\"\n\n\t\t// PUSH dei dati Locali\n\t\t+ localVariableCodeGen +\n\n\t\t// PUSH return address del chiamante\n\t\tVMCommands.LRA + \"\\n\"\n\n\t\t// Corpo della funzione\n\t\t+ funBody.codeGen() +\n\n\t\t// POP RV e salvo nel registro\n\t\tVMCommands.SRV + \"\\n\" +\n\n\t\t// POP RA e salvo nel registro\n\t\tVMCommands.SRA + \"\\n\" +\n\n\t\t// Rimuovo variabili locali\n\t\tpopLocalVariable +\n\t\t// Rimuovo Access Link\n\t\tVMCommands.POP + \"\\n\" +\n\t\t// Rimuovo Pametri\n\t\tpopParSequence +\n\n\t\t// Ripristino il Registro FP che punterà all'Activation Record\n\t\t// del chiamante\n\t\tVMCommands.SFP + \"\\n\" +\n\n\t\t// PUSH valore di ritorno\n\t\tVMCommands.LRV + \"\\n\" +\n\t\t// PUSH indirizzo di ritorno\n\t\tVMCommands.LRA + \"\\n\" +\n\n\t\t// Salto al Chiamante\n\t\tVMCommands.JS + \"\\n\";\n\n\tMiniFunLib.addFunctionCode(code);\n\n\treturn VMCommands.PUSH + \" \" + labelFun + \"\\n\";\n }", "public boolean runCode ( String theCode , String routine , String dataSegment ) throws EVASyntaxException , EVASemanticException\r\n\t{\r\n\t\taddToDataSegment ( dataSegment );\r\n\t\treturn runCode ( theCode , routine );\t\r\n\t}", "private void gameMode(int mode) {\r\n\t\tif(mode == 1) {\r\n\t\t\t//PVP\r\n\t\t\tPVP();\r\n\t\t}else{\r\n\t\t\t//PVE\r\n\t\t\tPVE();\r\n\t\t}\r\n\t\t\r\n\t}", "public abstract Object eval();", "boolean hasMode();", "public abstract int mo123247f();", "String getInizializedFunctionName();", "abstract /*package*/ Object executeRVMFunction(Function func, IValue[] posArgs, Map<String,IValue> kwArgs);", "public boolean i()\r\n/* 46: */ {\r\n/* 47:50 */ return true;\r\n/* 48: */ }", "protected abstract String getFunctionName();", "abstract protected void pre(int code);", "public boolean addFunction(Accessibility pPAccess, SubRoutine pExec, MoreData pMoreData);", "@Test\r\n public void testEval__declare_call__1() throws ScriptException {\r\n Object value = engine.eval(\"#() true\");\r\n Assert.assertTrue(value instanceof Function);\r\n Object result = ((Function) value).invoke(engine.createBindings());\r\n Assert.assertTrue((Boolean)result);\r\n }", "private void isMethod() {\n if (isNameExpr != null) {\n isNameExpr.isMethod();\n isNameExpr = null;\n }\n }", "default int foo (){\n System.out.println(\"this is bytecode G1.foo()\");\n return -1;\n }", "protected final /* synthetic */ java.lang.Object run() {\n /*\n r4 = this;\n r0 = 1;\n r1 = 0;\n r2 = com.tencent.mm.plugin.appbrand.b.c.this;\n r2 = r2.chu();\n r3 = com.tencent.mm.plugin.appbrand.b.c.this;\n r3 = r3.iKh;\n if (r2 != r3) goto L_0x0022;\n L_0x000e:\n r2 = com.tencent.mm.plugin.appbrand.b.c.this;\n r2 = r2.iKh;\n r2 = r2.iKy;\n r2 = r2 & 1;\n if (r2 <= 0) goto L_0x0020;\n L_0x0018:\n r2 = r0;\n L_0x0019:\n if (r2 == 0) goto L_0x0022;\n L_0x001b:\n r0 = java.lang.Boolean.valueOf(r0);\n return r0;\n L_0x0020:\n r2 = r1;\n goto L_0x0019;\n L_0x0022:\n r0 = r1;\n goto L_0x001b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.mm.plugin.appbrand.b.c.5.run():java.lang.Object\");\n }", "void method_115();", "public void llamarFuncion(String nombreFuncion, String symb, Integer in) throws Exception{\n\n boolean running = false;\n java.lang.reflect.Method method = null;\n try{\n method = this.getClass().getMethod(nombreFuncion.toLowerCase(), symb.getClass(), in.getClass());\n }catch(SecurityException e){\n System.out.println(\"Security exception\");\n }catch(NoSuchMethodException e){\n System.out.println(\"Method doesn't exists\");\n }\n\n try{\n method.invoke(this, symb, in);\n }catch (IllegalArgumentException e){\n System.out.println(\"Argumento ilegal\");\n }catch (IllegalAccessException e){\n System.out.println(\"Acceso ilegal\");\n }\n }", "public abstract boolean mo66253b();", "@Test\r\n public void autoPrintingFun2() {\n eval( \"f <- function( a = if(FALSE) {1 } ) { a; a}\" );\r\n\r\n eval( \"f()\");\r\n assertThat(topLevelContext.getGlobals().isInvisible(), equalTo(false));\r\n }", "int getLevelOfFunction();", "public abstract int mo8526p();", "@Override\r\n public String getCommand() {\n return \"function\";\r\n }", "public abstract void mo9254f(boolean z);", "abstract public IValue executeRVMFunctionInVisit(Frame root);", "private void jetFunctions(){\n\t\tInvokeExpr invokeExpr = (InvokeExpr) rExpr;\n\t\tSootMethodRef methodRef = invokeExpr.getMethodRef();\n\t\t\n\t\t//if this is a java.lang.String.func, we don't need to declare it\n\t\tif(StringModeling.stringMethods.contains(methodRef.getSignature())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString funStr = constructFunStr(invokeExpr);\n\t\tType thisType = null;\n\t\tif(!fileGenerator.getDeclaredFunctions().contains(funStr)){\n\t\t\tif(invokeExpr instanceof StaticInvokeExpr){\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}else{\n\t\t\t\tif(invokeExpr instanceof InterfaceInvokeExpr){\n\t\t\t\t\tthisType = ((InterfaceInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof SpecialInvokeExpr){\n\t\t\t\t\tthisType = ((SpecialInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof VirtualInvokeExpr){\n\t\t\t\t\tthisType = ((VirtualInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}\n\t\t\tfileGenerator.getDeclaredFunctions().add(funStr);\n\t\t}\n\t}", "@Override\n public void setMode(RunMode mode) {\n\n }", "public boolean switchContext(Function f){\n if(f == null) {\n switchToGlobalContext();\n return true;\n }\n if(!localConstantScopes.containsKey(f) || !localVariableScopes.containsKey(f)){\n return false;\n }\n\n currentConstants = localConstantScopes.get(f);\n currentVariables = localVariableScopes.get(f);\n\n resetTemporary();\n\n return true;\n }", "public boolean isFunction() {\n return this.type != null;\n }", "@Override\r\n \tprotected boolean supportInterpreter() {\n \t\treturn false;\r\n \t}", "Main(String mode) {\n if (mode.equals(\"game\")) {\n createGameMode();\n } else {\n createSimulatorMode();\n }\n }", "@Override\n\t\tpublic void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {\n\t\t\tparsingInstruction = new Instruction(name, desc, owner, parsingMethod);\n\t\t\tparsingMethod.getInstructions().add(parsingInstruction);\n\t\t}", "public void func_70305_f() {}", "FunDef getFunDef();", "GameMode mode();", "public ICodeInfo decompileWithMode(DecompilationMode mode) {\n\t\tDecompilationMode baseMode = root.getArgs().getDecompilationMode();\n\t\tif (mode == baseMode) {\n\t\t\treturn decompile(true);\n\t\t}\n\t\tJadxArgs args = root.getArgs();\n\t\ttry {\n\t\t\tunload();\n\t\t\targs.setDecompilationMode(mode);\n\t\t\tProcessClass process = new ProcessClass(args);\n\t\t\tprocess.initPasses(root);\n\t\t\treturn process.generateCode(this);\n\t\t} finally {\n\t\t\targs.setDecompilationMode(baseMode);\n\t\t}\n\t}", "public abstract int evalFunction(Player nodePlayer);", "@Override public boolean isCodeTask() { return true; }", "public abstract void mo27386d();", "public interface InstructionCodes {\n\n int NOP = 0;\n int ICONST = 2;\n int FCONST = 3;\n int SCONST = 4;\n int ICONST_0 = 5;\n int ICONST_1 = 6;\n int ICONST_2 = 7;\n int ICONST_3 = 8;\n int ICONST_4 = 9;\n int ICONST_5 = 10;\n int FCONST_0 = 11;\n int FCONST_1 = 12;\n int FCONST_2 = 13;\n int FCONST_3 = 14;\n int FCONST_4 = 15;\n int FCONST_5 = 16;\n int BCONST_0 = 17;\n int BCONST_1 = 18;\n int RCONST_NULL = 19;\n int BICONST = 20;\n int DCONST = 21;\n\n int IMOVE = 22;\n int FMOVE = 23;\n int SMOVE = 24;\n int BMOVE = 25;\n int RMOVE = 26;\n int BIALOAD = 27;\n int IALOAD = 28;\n int FALOAD = 29;\n int SALOAD = 30;\n int BALOAD = 31;\n int RALOAD = 32;\n int JSONALOAD = 33;\n\n int IGLOAD = 34;\n int FGLOAD = 35;\n int SGLOAD = 36;\n int BGLOAD = 37;\n int RGLOAD = 38;\n\n int CHNRECEIVE = 39;\n int CHNSEND = 40;\n\n int MAPLOAD = 41;\n int JSONLOAD = 42;\n\n int COMPENSATE = 43;\n\n int BIASTORE = 44;\n int IASTORE = 45;\n int FASTORE = 46;\n int SASTORE = 47;\n int BASTORE = 48;\n int RASTORE = 49;\n int JSONASTORE = 50;\n\n int BIAND = 51;\n int IAND = 52;\n int BIOR = 53;\n int IOR = 54;\n\n int IGSTORE = 55;\n int FGSTORE = 56;\n int SGSTORE = 57;\n int BGSTORE = 58;\n int RGSTORE = 59;\n\n int IS_LIKE = 60;\n\n int STAMP = 62;\n\n int FREEZE = 63;\n int IS_FROZEN = 64;\n\n int ERROR = 65;\n int PANIC = 66;\n int REASON = 67;\n int DETAIL = 68;\n\n int MAPSTORE = 69;\n int JSONSTORE = 70;\n\n int IADD = 71;\n int FADD = 72;\n int SADD = 73;\n int DADD = 74;\n\n int SCOPE_END = 75;\n int LOOP_COMPENSATE = 76;\n\n int XMLADD = 77;\n int ISUB = 78;\n int FSUB = 79;\n int DSUB = 80;\n int IMUL = 81;\n int FMUL = 82;\n int DMUL = 83;\n int IDIV = 84;\n int FDIV = 85;\n int DDIV = 86;\n int IMOD = 87;\n int FMOD = 88;\n int DMOD = 89;\n int INEG = 90;\n int FNEG = 91;\n int DNEG = 92;\n int BNOT = 93;\n\n int IEQ = 94;\n int FEQ = 95;\n int SEQ = 96;\n int BEQ = 97;\n int DEQ = 98;\n int REQ = 99;\n int REF_EQ = 100;\n\n int INE = 101;\n int FNE = 102;\n int SNE = 103;\n int BNE = 104;\n int DNE = 105;\n int RNE = 106;\n int REF_NEQ = 107;\n\n int IGT = 108;\n int FGT = 109;\n int DGT = 110;\n\n int IGE = 111;\n int FGE = 112;\n int DGE = 113;\n\n int ILT = 114;\n int FLT = 115;\n int DLT = 116;\n\n int ILE = 117;\n int FLE = 118;\n int DLE = 119;\n\n int REQ_NULL = 120;\n int RNE_NULL = 121;\n\n int BR_TRUE = 122;\n int BR_FALSE = 123;\n\n int GOTO = 124;\n int HALT = 125;\n int TR_RETRY = 126;\n int CALL = 127;\n int VCALL = 128;\n int FPCALL = 129;\n int FPLOAD = 130;\n int VFPLOAD = 131;\n\n // Type Conversion related instructions\n int I2F = 132;\n int I2S = 133;\n int I2B = 134;\n int I2D = 135;\n int F2I = 136;\n int F2S = 137;\n int F2B = 138;\n int F2D = 139;\n int S2I = 140;\n int S2F = 141;\n int S2B = 142;\n int S2D = 143;\n int B2I = 144;\n int B2F = 145;\n int B2S = 146;\n int B2D = 147;\n int D2I = 148;\n int D2F = 149;\n int D2S = 150;\n int D2B = 151;\n int DT2JSON = 152;\n int DT2XML = 153;\n int T2MAP = 154;\n int T2JSON = 155;\n int MAP2T = 156;\n int JSON2T = 157;\n int XML2S = 158;\n\n int BILSHIFT = 159;\n int BIRSHIFT = 160;\n int ILSHIFT = 161;\n int IRSHIFT = 162;\n\n // Type cast\n int I2ANY = 163;\n int F2ANY = 164;\n int S2ANY = 165;\n int B2ANY = 166;\n\n int TYPE_ASSERTION = 167;\n\n int ANY2I = 168;\n int ANY2F = 169;\n int ANY2S = 170;\n int ANY2B = 171;\n int ANY2D = 172;\n int ANY2JSON = 173;\n int ANY2XML = 174;\n int ANY2MAP = 175;\n int ANY2STM = 176;\n int ANY2DT = 177;\n int ANY2SCONV = 178;\n int ANY2BI = 179;\n int BI2ANY = 180;\n int ANY2E = 181;\n int ANY2T = 182;\n int ANY2C = 183;\n int CHECKCAST = 184;\n\n int ANY2TYPE = 185;\n\n int LOCK = 186;\n int UNLOCK = 187;\n\n // Transactions\n int TR_BEGIN = 188;\n int TR_END = 189;\n\n int WRKSEND = 190;\n int WRKRECEIVE = 191;\n\n int WORKERSYNCSEND = 192;\n int WAIT = 193;\n\n int MAP2JSON = 194;\n int JSON2MAP = 195;\n\n int IS_ASSIGNABLE = 196;\n int O2JSON = 197;\n\n int ARRAY2JSON = 198;\n int JSON2ARRAY = 199;\n\n int BINEWARRAY = 200;\n int INEWARRAY = 201;\n int FNEWARRAY = 202;\n int SNEWARRAY = 203;\n int BNEWARRAY = 204;\n int RNEWARRAY = 205;\n\n int CLONE = 206;\n\n int FLUSH = 207;\n\n int LENGTHOF = 208;\n int WAITALL = 209;\n\n int NEWSTRUCT = 210;\n int NEWMAP = 212;\n int NEWTABLE = 215;\n int NEWSTREAM = 217;\n \n int CONVERT = 218;\n\n int ITR_NEW = 219;\n int ITR_NEXT = 221;\n int INT_RANGE = 222;\n\n int I2BI = 223;\n int BI2I = 224;\n int BIXOR = 225;\n int IXOR = 226;\n int BACONST = 227;\n int IURSHIFT = 228;\n\n int IRET = 229;\n int FRET = 230;\n int SRET = 231;\n int BRET = 232;\n int DRET = 233;\n int RRET = 234;\n int RET = 235;\n\n int XML2XMLATTRS = 236;\n int XMLATTRS2MAP = 237;\n int XMLATTRLOAD = 238;\n int XMLATTRSTORE = 239;\n int S2QNAME = 240;\n int NEWQNAME = 241;\n int NEWXMLELEMENT = 242;\n int NEWXMLCOMMENT = 243;\n int NEWXMLTEXT = 244;\n int NEWXMLPI = 245;\n int XMLSEQSTORE = 246;\n int XMLSEQLOAD = 247;\n int XMLLOAD = 248;\n int XMLLOADALL = 249;\n int NEWXMLSEQ = 250;\n\n int TYPE_TEST = 251;\n int TYPELOAD = 252;\n\n int TEQ = 253;\n int TNE = 254;\n\n int INSTRUCTION_CODE_COUNT = 255;\n}", "Interpreter getInterpreter();", "void fun(){\n\t\tSystem.out.println(\"This is fun\");\n\t}", "public String isMethod() {\n return isNameExpr;\n }", "String method_110();", "java.lang.String getMode();", "void fun();", "void fun();", "public abstract void mo4368a(int i, boolean z);", "private static boolean methodDeclaration_4_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"methodDeclaration_4_0\")) return false;\n boolean r;\n r = consumeToken(b, SEMICOLON);\n if (!r) r = functionBodyOrNative(b, l + 1);\n if (!r) r = redirection(b, l + 1);\n return r;\n }", "int getCode();" ]
[ "0.7172271", "0.6005476", "0.59352523", "0.5903379", "0.58766896", "0.5761769", "0.57598084", "0.56517327", "0.5619204", "0.5595777", "0.5595777", "0.5595777", "0.5584112", "0.55117065", "0.5509167", "0.5508309", "0.5483764", "0.5473079", "0.5433454", "0.5413399", "0.5408989", "0.54081154", "0.54035395", "0.5376774", "0.53749865", "0.53653026", "0.5359458", "0.53565526", "0.5337108", "0.53195035", "0.53163964", "0.53108513", "0.5307246", "0.52986467", "0.5291162", "0.5282818", "0.5277465", "0.52536976", "0.52536476", "0.52523863", "0.5250319", "0.52475643", "0.5246564", "0.52459055", "0.5238079", "0.522307", "0.5221432", "0.5220052", "0.51989377", "0.51971227", "0.51946443", "0.5184938", "0.5182175", "0.51674956", "0.5166925", "0.51636124", "0.5157668", "0.5152818", "0.51434135", "0.5139067", "0.5130449", "0.5124299", "0.5123933", "0.51174474", "0.51167655", "0.5116353", "0.5115948", "0.5114687", "0.51138663", "0.5112386", "0.5109801", "0.5105457", "0.5091687", "0.5091227", "0.5083268", "0.50758725", "0.5075631", "0.5069491", "0.50656974", "0.5064338", "0.5059634", "0.5046565", "0.5046147", "0.5045985", "0.50445956", "0.5040032", "0.50321764", "0.50300074", "0.5022014", "0.501766", "0.5010419", "0.5009351", "0.5008472", "0.50036484", "0.50020146", "0.49994367", "0.49994367", "0.49952003", "0.4993338", "0.49888885" ]
0.769643
0
Helper methods functionHandler This method changes the variable names in the declared function from the ones specified by the coder to ones whose names match the positions of the variables that follow the function name on call. Example: code can be: f.add x y < first line, the variable names are not saved, only the name f.add is ( loop y ( inc x ) ) The variables x and y will be renamed to $p0 and $p1 so that when the function is called: f.add 2 3, the code will know that the first variable '2' will go to locations specified by $p0 and '3' to locations specified by $p1. on mode: write variables are as mentioned above replaced with placeholders on mode : read the process is reversed where the placeholders are replaced with the input arguments provided on function call
public String functionHandler(LinkedList<String> argumentList, String code, String mode) { Scanner code_scanner = new Scanner(code); String code_line; String final_code = ""; while(code_scanner.hasNextLine()) { code_line = code_scanner.nextLine(); String code_word = ""; for(int i=0; i<code_line.length(); i++) { if(code_line.charAt(i) != ' ' && i<code_line.length()-1) { code_word += code_line.charAt(i); } else if(i == code_line.length()-1) { code_word += code_line.charAt(i); if(mode.equals("write")) { if(argumentList.contains(code_word)) { code_word = "$p" + argumentList.indexOf(code_word); } } else if(mode.equals("read")) { if(code_word.length() > 2 && code_word.substring(0, 2).equals("$p")) { code_word = argumentList.get(Integer.parseInt(code_word.substring(2, 3))); } } final_code += code_word; final_code += " "; code_word = ""; } else { if(mode.equals("write")) { if(argumentList.contains(code_word)) { code_word = "$p" + argumentList.indexOf(code_word); } } else if(mode.equals("read")) { if(code_word.length() > 2 && code_word.substring(0, 2).equals("$p")) { code_word = argumentList.get(Integer.parseInt(code_word.substring(2, 3))); } } final_code += code_word; final_code += " "; code_word = ""; } } final_code += "\n"; } return final_code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public void function() throws ParseException {\n String name = \"\";\n LinkedList<String> params = new LinkedList<String>();\n jj_consume_token(TO);\n jj_consume_token(VARIABLE);\n name = token.image;\n label_8:\n while (true) {\n if (jj_2_44(4)) {\n ;\n } else {\n break label_8;\n }\n jj_consume_token(PARAM);\n params.add(token.image);\n }\n //retorna el viejo valor (si ya habia uno con esa misma key) y null si es la primera vez que se inserta.\n if(functions.put(name,params)!=null) {\n {if (true) throw new ParseException(\"La funcion: \"+ name +\" ya fue previamente definida.\");}\n }\n funparams = params;\n label_9:\n while (true) {\n if (jj_2_45(4)) {\n ;\n } else {\n break label_9;\n }\n jj_consume_token(34);\n }\n jj_consume_token(OUTPUT);\n label_10:\n while (true) {\n if (jj_2_46(4)) {\n ;\n } else {\n break label_10;\n }\n jj_consume_token(34);\n }\n command(salidaS);\n label_11:\n while (true) {\n if (jj_2_47(4)) {\n ;\n } else {\n break label_11;\n }\n jj_consume_token(34);\n }\n jj_consume_token(END);\n funparams = null;\n }", "@Override\r\n public void visit(FunctionDeclaration n, functionStruct fStruct) {\r\n String myName = n.f1.f0.toString();\r\n fStruct.functionName = myName;\r\n loopArray.clear();\r\n \r\n HashMap<String, String> rt= new HashMap<String, String>();\r\n HashMap<String, String> vt= new HashMap<String, String>();\r\n variableTable.put(myName, vt);\r\n registerTable.put(myName, rt);\r\n HashMap <String, Pair> myMap= new HashMap<String, Pair>();\r\n aBounds.put(myName, myMap);\r\n\r\n //we want to add a2-a7, also the passed ids to have a use at line 0\r\n if ( n.f3.present() ) {\r\n Enumeration <Node> nodeListEnum=n.f3.elements();\r\n while(nodeListEnum.hasMoreElements() ){\r\n String singleParameter= ((Identifier)nodeListEnum.nextElement()).f0.toString();\r\n addId(singleParameter, myName, 0); //give function parameters a line number of 0\r\n }\r\n }\r\n\r\n\r\n n.f5.accept(this, fStruct);\r\n lineCount=1;\r\n\r\n HashMap<String, Pair> range= new HashMap<String, Pair>();\r\n HashMap<String, Pair> aArgRange= new HashMap<String, Pair>();\r\n ArrayList<Pair> events= new ArrayList<Pair>();\r\n\r\n for(String id: fTable.get(myName).keySet()){\r\n int startPos= fTable.get(myName).get(id);\r\n int endPos= pTable.get(myName).get(id);\r\n for(Pair p: loopArray){\r\n if((p.first() <= startPos && p.second() >= startPos) || (p.first() <= endPos && p.second()>= endPos) ){\r\n startPos = Math.min(p.first(), startPos);\r\n endPos = Math.max(p.second(), endPos);\r\n }\r\n }\r\n events.add(new Pair(startPos, -1, id,0));\r\n events.add(new Pair(-1, endPos, id, 1));\r\n range.put(id, new Pair(startPos, endPos));\r\n }\r\n\r\n for(String id: aBounds.get(myName).keySet()){\r\n int startPos= aBounds.get(myName).get(id).first();\r\n int endPos= aBounds.get(myName).get(id).second();\r\n for(Pair p: loopArray){\r\n if((p.first() <= startPos && p.second() >= startPos) || (p.first() <= endPos && p.second()>= endPos) ){\r\n startPos = Math.min(p.first(), startPos);\r\n endPos = Math.max(p.second(), endPos);\r\n }\r\n }\r\n\r\n aArgRange.put(id, new Pair(startPos, endPos));\r\n }\r\n\r\n rangeTable.put(myName, range);\r\n aRangeTable.put(myName, aArgRange);\r\n\r\n Collections.sort(events, Pair.myComparator);\r\n\r\n ArrayDeque <String> available= new ArrayDeque<String>();\r\n List<String> cList = Arrays.asList(\"t0\",\"t1\",\"t2\",\"t3\",\"t4\",\"t5\",\"s1\",\"s2\",\"s3\",\"s4\",\"s5\",\"s6\",\"s7\",\"s8\");\r\n for(String ss :cList){available.add(ss);}\r\n HashMap <String, String> temp= new HashMap<String, String>();\r\n HashMap <String, String> assignment= new HashMap<String, String>();\r\n\r\n for(Pair p: events){\r\n String id = p.id;\r\n if(p.op == 1){\r\n if(temp.containsKey(id)){\r\n assignment.put(id, temp.get(id));\r\n available.add(temp.get(id));\r\n temp.remove(id);\r\n }\r\n } \r\n else{\r\n if(!available.isEmpty()){\r\n String myReg= available.poll();\r\n temp.put(id, myReg);\r\n }\r\n else{\r\n int myEnd= range.get(id).second();\r\n int otherEnd= myEnd;\r\n String otherName= id;\r\n for(String candidate: temp.keySet()){\r\n int tEnd= range.get(candidate).second();\r\n if(tEnd > otherEnd){\r\n otherEnd = tEnd;\r\n otherName = candidate;\r\n }\r\n }\r\n if(!otherName.equals(id)){\r\n String spitReg= temp.get(otherName);\r\n temp.remove(otherName);\r\n temp.put(id, spitReg);\r\n }\r\n }\r\n }\r\n }\r\n for(String name: temp.keySet()){\r\n assignment.put(name, temp.get(name));\r\n }\r\n\r\n linearTable.put(myName, assignment);\r\n }", "public void parseFunctions(){\n\t\t\n\t}", "public void interpretorMainMethod(String code, int mode) {\n\t\t\n\t\t//TODO comments\n\t\t\n\t\t// Used to count the bracket balance\n\t\tint bracket_depth = 0;\t\n\t\t\n\t\t// Loop variables, loop_active designates whether the current line\n\t\t// is a part of a loop, loop_length designates how many times the loop\n\t\t// will run\n\t\tboolean loop_active = false;\n\t\tint loop_length = 0;\t\n\t\t\n\t\t// If statement variable, designates if the if condition\n\t\t// allows for the code that follows it to execute\n\t\tboolean conditional_state = true;\t\n\t\t\n\t\t// A flag the determines whether the current line should\n\t\t// be interpreted\n\t\tboolean skip_line = false;\n\t\t\n\t\t// Function variables, function_name contains the name\n\t\t// of the function currently being ran or written, function_is_being_written\n\t\t// indicates that the current lien of code is part of the function being\n\t\t// written/saved, function_arguments contains the arguments that the\n\t\t// function comes with\n\t\tString function_name = \"\";\n\t\tboolean function_is_being_written = false;\n\t\tLinkedList<String> function_arguments = new LinkedList<>();\n\t\t\n\t\t// The current line number being interpreted\n\t\t// Note: lines in loops, if statements and functions\n\t\t// are counted separately\n\t\tint line_count = 0;\n\t\t\n\t\t// Scanner for the code String\n\t\tScanner line_scanner = new Scanner(code);\n\t\t\n\t\t// This String contains bracketed code which will be passed to\n\t\t// either a new function or to be ran via loop\n\t\tString passed_code = \"\";\n\t\t\n\t\t// Outer interpreter\n\t\twhile(line_scanner.hasNextLine()) {\n\t\t\tline_count++;\n\t\t\tString line_temp = line_scanner.nextLine();\n\t\t\tString line = \"\";\n\t\t\t\n\t\t\t// This code removes the leading spaces from the line\n\t\t\tfor(int i = 0; i<line_temp.length(); i++) {\n\t\t\t\tif(line_temp.charAt(i) != ' ') {\n\t\t\t\t\tline = line_temp.substring(i);\n\t\t\t\t\ti = 999;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Line length after clearing the leading spaces\n\t\t\tint line_length = line.length();\n\t\t\t\n\t\t\t// Bracket depth control\n\t\t\t// Counts bracket depth and makes the inner interpreter skip\n\t\t\t// the first and last bracket\n\t\t\tif(line.contains(\"(\")) {\n\t\t\t\tbracket_depth++;\n\t\t\t\tif(bracket_depth == 1)\n\t\t\t\t\tskip_line = true;\n\t\t\t} else if(line.contains(\")\")) {\n\t\t\t\tbracket_depth--;\n\t\t\t\tif(bracket_depth == 0)\n\t\t\t\t\tskip_line = true;\n\t\t\t} else if(line.isEmpty()) {\n\t\t\t\tskip_line = true;\n\t\t\t}\n\t\t\t\n\t\t\t// Comments skip\n\t\t\t// Makes the inner interpreter skip lines beginning with \"//\"\n\t\t\tif(line_length > 2) {\n\t\t\t\tif(line.substring(0, 2).equals(\"//\"))\n\t\t\t\t\tskip_line = true;\n\t\t\t}\n\t\t\t\n\t\t\t// if statement lock/skip\n\t\t\t// Makes the inner interpreter skip 'if' statement blocks if\n\t\t\t// the 'if' statement is false\n\t\t\tif(!conditional_state && bracket_depth != 0) {\n\t\t\t\tskip_line = true;\n\t\t\t} else if(!conditional_state && bracket_depth == 0) {\n\t\t\t\tconditional_state = true;\n\t\t\t}\n\t\t\t\t\n\t\t\t// Inner interpreter\n\t\t\t// Handles the syntax interpretation and execution\n\t\t\tif(!skip_line) {\n\t\t\t\t\n\t\t\t\t// This checks if we have reached the end of the function declaration,\n\t\t\t\t// should we do the function is saved in the function map\n\t\t\t\tif(bracket_depth == 0 && function_is_being_written) {\t\t\t\t\t\t\t\t\n\t\t\t\t\tfunction_is_being_written = false;\n\t\t\t\t\tfunctions.put(function_name, functionHandler(function_arguments, passed_code, \"write\"));\n\t\t\t\t\tfunction_arguments.clear();\n\t\t\t\t\tpassed_code = \"\";\n\t\t\t\t\t\n\t\t\t\t// This checks if we have reached the end of the code block contained in the loop,\n\t\t\t\t// should we do the code contained in the loop (the passed_code variable)\n\t\t\t\t// gets passed along in a recursive call to the interpreter main method.\n\t\t\t\t} else if(bracket_depth == 0 && loop_active){\n\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\tfor(int i=0; i<loop_length; i++)\n\t\t\t\t\t\t\tinterpretorMainMethod(passed_code, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor(int i=0; i<loop_length; i++)\n\t\t\t\t\t\t\tinterpretorMainMethod(passed_code, 0);\n\t\t\t\t\t}\n\t\t\t\t\tloop_active = false;\n\t\t\t\t\tloop_length = 0;\n\t\t\t\t\tpassed_code = \"\";\n\t\t\t\t\t\n\t\t\t\t// This checks if we have reached the end of code block contained in the 'if'\n\t\t\t\t// Statement, should we do: the conditional_state variable is set to true\n\t\t\t\t} else if(bracket_depth == 0 && !conditional_state) {\t\t\n\t\t\t\t\tconditional_state = true;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t// If either the function_is_being_written or loop_active variables are true\n\t\t\t\t// we simply pass the current line to a temporary string without\n\t\t\t\t// interpreting it\n\t\t\t\tif(function_is_being_written || loop_active) {\n\t\t\t\t\tpassed_code += line + \"\\n\";\n\t\t\t\t\t\n\t\t\t\t// Secondary bracket skips, this is here only on account of having to\n\t\t\t\t// check the function, loop, 'if' statement endings\n\t\t\t\t} else if(line.contains(\"(\") || line.contains(\")\")) {\n\t\t\t\t\t\n\t\t\t\t// The key words are checked\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// This loop determines the location of the first non-space character.\n\t\t\t\t\t// However as the code above indicates, this will always be 0, because\n\t\t\t\t\t// we remove the empty spaces beforehand in the Outer interpreter.\n\t\t\t\t\t// The loop here is simply for debugging purposes.\n\t\t\t\t\tint empty_space = 0;\n\t\t\t\t\tboolean space_error = false;\t\t\t\t\n\t\t\t\t\twhile(line.charAt(empty_space) == ' ' || space_error) {\n\t\t\t\t\t\tempty_space++;\n\t\t\t\t\t\tif(empty_space == 50) {\n\t\t\t\t\t\t\tspace_error = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// stop statement\n\t\t\t\t\t// Syntax: stop\n\t\t\t\t\t// Corresponds to: no java counterpart\n\t\t\t\t\t// Indicates the end of a code block\n\t\t\t\t\tif (line.contains(\"stop\") && line.length() < 7) {\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// def statement\n\t\t\t\t\t// Syntax: def x : y\n\t\t\t\t\t// Corresponds to: int x = y; OR Double x = y; OR String x = y;\n\t\t\t\t\telse if(line_length > 3 && line.substring(empty_space, empty_space+4).equals(\"def \")) {\n\t\t\t\t\t\tint end_of_word_offset;\n\t\t\t\t\t\tString var_name = \"\";\n\t\t\t\t\t\tString var_definition = \"\";\n\t\t\t\t\t\tboolean comma_present = false;\n\t\t\t\t\t\tint offset = empty_space+4;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// This loop finds and assigns the definition components:\n\t\t\t\t\t\t// the var_name - the name of the variable we are defining\n\t\t\t\t\t\t// the var_definition - the contents of the variable\n\t\t\t\t\t\twhile(offset < line_length) {\n\t\t\t\t\t\t\tif(line.charAt(offset) == ' ')\n\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif(var_name.isEmpty()) {\n\t\t\t\t\t\t\t\t\tend_of_word_offset = nextWordEndIndex(line, offset);\n\t\t\t\t\t\t\t\t\tvar_name = line.substring(offset, end_of_word_offset);\n\t\t\t\t\t\t\t\t\toffset = end_of_word_offset;\n\t\t\t\t\t\t\t\t} else if(!comma_present && line.charAt(offset) == ':') {\n\t\t\t\t\t\t\t\t\tcomma_present = true;\n\t\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t\t} else if(var_definition.isEmpty() && comma_present) {\n\t\t\t\t\t\t\t\t\tvar_definition = line.substring(offset, line_length);\n\t\t\t\t\t\t\t\t\toffset = line_length;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toffset = line_length;\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\n\t\t\t\t\t\t// This checks if the definition syntax is correct\n\t\t\t\t\t\tif(var_name.isEmpty() || var_definition.isEmpty() || !comma_present) {\n\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad definition syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// This checks if we are using a reserved word as the name of the variable\n\t\t\t\t\t\t\tif(!(var_name.equals(\"def\") && var_name.equals(\"inc\") && var_name.equals(\"dec\") && var_name.equals(\"output\") && var_name.equals(\"loop\") && var_name.equals(\"if\") && var_name.equals(\"loadfile\"))) {\n\t\t\t\t\t\t\t\tif(isNumber(var_definition)) {\n\t\t\t\t\t\t\t\t\tif(mode == 0)\n\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name, 0.0 + Integer.parseInt(var_definition));\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tlocal_double_variables.put(var_name, 0.0 + Integer.parseInt(var_definition));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(var_definition.length() > 4) {\n\t\t\t\t\t\t\t\t\t\tif(var_definition.substring(0, 4).equals(\"var.\")) {\n\t\t\t\t\t\t\t\t\t\t\tString key = var_definition.substring(4, var_definition.length());\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocal_double_variables.put(var_name, local_double_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse if(local_string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocal_string_variables.put(var_name, local_string_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse if(double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocal_double_variables.put(var_name, double_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse if(string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocal_string_variables.put(var_name, string_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad variable call in def. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name,double_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse if(string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\t\tstring_variables.put(var_name,string_variables.get(key));\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad variable call in def. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif(mode == 0)\n\t\t\t\t\t\t\t\t\t\t\t\tstring_variables.put(var_name, var_definition);\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tlocal_string_variables.put(var_name, var_definition);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: prohibited reserved word use. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\t// inc statement\n\t\t\t\t\t// Syntax: inc x\n\t\t\t\t\t// Corresponds to: x++;\n\t\t\t\t\telse if(line_length > 3 && line.substring(empty_space, empty_space+4).equals(\"inc \")) {\n\t\t\t\t\t\tString var_name;\n\t\t\t\t\t\tint offset = empty_space+4;\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(offset < line_length) {\n\t\t\t\t\t\t\tif(line.charAt(offset) == ' ') {\n\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar_name = line.substring(offset, line_length).replaceAll(\"\\\\s+\",\"\");\n\t\t\t\t\t\t\t\tif(!var_name.isEmpty()) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tlocal_double_variables.put(var_name, local_double_variables.get(var_name)+1.0);\n\t\t\t\t\t\t\t\t\t\telse if(double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name, double_variables.get(var_name)+1.0);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad increment syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name, double_variables.get(var_name)+1.0);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad increment syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad increment syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\toffset = line_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// dec statement\n\t\t\t\t\t// Syntax: dec x\n\t\t\t\t\t// Corresponds to: x--;\n\t\t\t\t\telse if(line_length > 3 && line.substring(empty_space, empty_space+4).equals(\"dec \")) {\n\t\t\t\t\t\tString var_name;\n\t\t\t\t\t\tint offset = empty_space+4;\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(offset < line_length) {\n\t\t\t\t\t\t\tif(line.charAt(offset) == ' ') {\n\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar_name = line.substring(offset, line_length).replaceAll(\"\\\\s+\",\"\");\n\t\t\t\t\t\t\t\tif(!var_name.isEmpty()) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tlocal_double_variables.put(var_name, local_double_variables.get(var_name)-1.0);\n\t\t\t\t\t\t\t\t\t\telse if(double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name, double_variables.get(var_name)-1.0);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad increment syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(var_name))\n\t\t\t\t\t\t\t\t\t\t\tdouble_variables.put(var_name, double_variables.get(var_name)-1.0);\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad increment syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad decrement syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\toffset = line_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// output statement\n\t\t\t\t\t// Syntax: output : x\n\t\t\t\t\t// Corresponds to: System.out.println(x);\t\t\t\t\n\t\t\t\t\telse if(line_length > 8 && line.substring(empty_space, empty_space+9).equals(\"output : \")) {\n\t\t\t\t\t\tint end_of_word_offset;\n\t\t\t\t\t\tString output_string = \"\";\n\t\t\t\t\t\tString temp_word;\n\t\t\t\t\t\tint offset = empty_space+9;\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(offset < line_length) {\n\t\t\t\t\t\t\tif(line.charAt(offset) == ' ') {\n\t\t\t\t\t\t\t\toutput_string += line.charAt(offset);\n\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tend_of_word_offset = nextWordEndIndex(line, offset);\n\t\t\t\t\t\t\t\ttemp_word = line.substring(offset, end_of_word_offset);\n\t\t\t\t\t\t\t\toffset = end_of_word_offset;\n\t\t\t\t\t\t\t\tif(temp_word.length() > 4) {\n\t\t\t\t\t\t\t\t\tif(temp_word.substring(0, 4).equals(\"var.\")) {\n\t\t\t\t\t\t\t\t\t\tString key = temp_word.substring(4, temp_word.length());\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += local_double_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse if(local_string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += local_string_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse if(double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += double_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse if(string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += string_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad variable call in output. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += double_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse if(string_variables.containsKey(key))\n\t\t\t\t\t\t\t\t\t\t\t\toutput_string += string_variables.get(key);\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad variable call in output. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toutput_string += temp_word;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\toutput_string += temp_word;\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\tminc.consolearea.append(output_string+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// loop statement\n\t\t\t\t\t// Syntax: loop x\n\t\t\t\t\t// Corresponds to: for(int i=0; i<x; i++)\n\t\t\t\t\telse if(line_length > 4 && line.substring(empty_space, empty_space+5).equals(\"loop \")) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tString next_element = line.substring(empty_space+5, nextWordEndIndex(line, empty_space+5));\n\t\t\t\t\t\t\t// Flags the loop as active for the interpreter\n\t\t\t\t\t\t\tloop_active = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// These conditions attempt to retrieve the loop variable, or\n\t\t\t\t\t\t\t// the number of times the loop will execute\n\t\t\t\t\t\t\tif(isNumber(next_element)) {\n\t\t\t\t\t\t\t\tloop_length = Integer.parseInt(next_element);\n\t\t\t\t\t\t\t} else if(mode == 1) {\n\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(next_element))\n\t\t\t\t\t\t\t\t\tloop_length += local_double_variables.get(next_element);\n\t\t\t\t\t\t\t\telse if(double_variables.containsKey(next_element))\n\t\t\t\t\t\t\t\t\tloop_length += double_variables.get(next_element);\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad loop syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(double_variables.containsKey(next_element))\n\t\t\t\t\t\t\t\t\tloop_length += double_variables.get(next_element);\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad loop syntax. line \"+line_count+\"\\n\");\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} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad loop syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// if statement\n\t\t\t\t\t// Syntax and correspondent expressions explained below\n\t\t\t\t\t// This is a rather length segment of the interpreter, however the code logic\n\t\t\t\t\t// is very simple: the code checks for proper syntax and whether the called\n\t\t\t\t\t// variables are defined. The length is a product of the possible combinations of\n\t\t\t\t\t// variable types.\n\t\t\t\t\telse if(line_length > 2 && line.substring(empty_space, empty_space+3).equals(\"if \")) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tString next_element = line.substring(empty_space+3, nextWordEndIndex(line, empty_space+3));\t\n\t\t\t\t\t\t\tString lhs;\n\t\t\t\t\t\t\tString rhs;\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Equals condition\n\t\t\t\t\t\t\t// Syntax: if eq x y\n\t\t\t\t\t\t\t// Corresponds to: if(x == y)\n\t\t\t\t\t\t\tif(next_element.equals(\"eq\")) {\n\t\t\t\t\t\t\t\tlhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6));\n\t\t\t\t\t\t\t\trhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isNumber(lhs) && isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) != Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(isNumber(lhs)) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) != local_double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) != double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) != double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t} else if(isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs) != Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) != Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) != Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs)+1 != local_double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs)+1 != double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 != local_double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 != double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(!local_string_variables.get(lhs).equals(local_string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(!local_string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(!string_variables.get(lhs).equals(local_string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(!string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 != double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(!string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Not equals condition\n\t\t\t\t\t\t\t// Syntax: if neq x y\n\t\t\t\t\t\t\t// Corresponds to: if(x != y)\n\t\t\t\t\t\t\t} else if(next_element.equals(\"neq\")) {\n\t\t\t\t\t\t\t\tlhs = line.substring(empty_space+7, nextWordEndIndex(line, empty_space+7));\n\t\t\t\t\t\t\t\trhs = line.substring(empty_space+7+lhs.length()+1, nextWordEndIndex(line, empty_space+7+lhs.length()+1));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isNumber(lhs) && isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) == Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(isNumber(lhs)) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) == local_double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) == double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) == double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t} else if(isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs) == Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) == Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) == Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs)+1 == local_double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs)+1 == double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs) && local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 == local_double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 == double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_string_variables.get(lhs).equals(local_string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(local_string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && local_string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(string_variables.get(lhs).equals(local_string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 == double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(string_variables.containsKey(rhs) && string_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(string_variables.get(lhs).equals(string_variables.get(rhs))) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Less than condition\n\t\t\t\t\t\t\t// Syntax: if lt x y\n\t\t\t\t\t\t\t// Corresponds to: if(x < y)\n\t\t\t\t\t\t\t} else if(next_element.equals(\"lt\")) {\n\t\t\t\t\t\t\t\tlhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6));\n\t\t\t\t\t\t\t\trhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1));\n\t\t\t\t\t\t\t\tif(isNumber(lhs) && isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) >= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(isNumber(lhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) >= local_double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) >= double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) >= double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t} else if(isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs) >= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) >= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) >= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 >= double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Greater than condition\n\t\t\t\t\t\t\t// Syntax: if gt x y\n\t\t\t\t\t\t\t// Corresponds to: if(x > y)\n\t\t\t\t\t\t\t} else if(next_element.equals(\"gt\")) {\n\t\t\t\t\t\t\t\tlhs = line.substring(empty_space+6, nextWordEndIndex(line, empty_space+6));\n\t\t\t\t\t\t\t\trhs = line.substring(empty_space+6+lhs.length()+1, nextWordEndIndex(line, empty_space+6+lhs.length()+1));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isNumber(lhs) && isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) <= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(isNumber(lhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) <= local_double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) <= double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(Integer.parseInt(lhs) <= double_variables.get(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+rhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t} else if(isNumber(rhs)) {\n\t\t\t\t\t\t\t\t\tif(mode == 1) {\n\t\t\t\t\t\t\t\t\t\tif(local_double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(local_double_variables.get(lhs) <= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else if(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) <= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs) <= Integer.parseInt(rhs)) {\n\t\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable: \"+lhs+\"\\n\");\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(double_variables.containsKey(rhs) && double_variables.containsKey(lhs)) {\n\t\t\t\t\t\t\t\t\t\tif(double_variables.get(lhs)+1 <= double_variables.get(rhs)+1) {\n\t\t\t\t\t\t\t\t\t\t\tconditional_state = false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\". Unknown variable\\n\");\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} else {\n\t\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad conditional syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// loadfile statement\n\t\t\t\t\t// Syntax: loadfile filename.minl\n\t\t\t\t\t// Corresponds to: no java analog\n\t\t\t\t\t// This code simply executes the MinL code written on another file.\n\t\t\t\t\telse if(line_length > 8 && line.substring(empty_space, empty_space+9).equals(\"loadfile \")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tString next_element = line.substring(empty_space+9, nextWordEndIndex(line, empty_space+9));\n\t\t\t\t\t\t\tfileLoaderMethod(next_element);\t\n\t\t\t\t\t\t} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\t\t//TODO error test\n\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad loadfile syntax. line \"+line_count+\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// function declaration/call\n\t\t\t\t\t// Syntax: f.function_name x y z\n\t\t\t\t\t// Corresponds to: public void function_name(int/Double/String x, int/Double/String y, int/Double/String z)\n\t\t\t\t\telse if(line_length > 1 && line.substring(empty_space, empty_space+2).equals(\"f.\")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tString next_element = line.substring(empty_space+2, nextWordEndIndex(line, empty_space+2));\t\t\t\t\t\n\t\t\t\t\t\t\tfunction_name = \"f.\"+next_element;\t\n\t\t\t\t\t\t\t// These two conditions identify whether the function called is defined or not\n\t\t\t\t\t\t\t// if it is the function is simply called, if not it is declared. The syntax for call is simple:\n\t\t\t\t\t\t\t// f.function_name argument1 argument2 etc...\n\t\t\t\t\t\t\t// The syntax for declare requires a code block:\n\t\t\t\t\t\t\t// f.function_name argument_name1 argument_name2 etc...\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// loop argument_name1\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// inc argument_name2\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tif(functions.containsKey(function_name)) {\n\t\t\t\t\t\t\t\t// Function call code\n\t\t\t\t\t\t\t\tif(function_name.length() == line_length) {\n\t\t\t\t\t\t\t\t\tinterpretorMainMethod(functions.get(function_name), 1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tint offset = function_name.length()+1;\t\n\t\t\t\t\t\t\t\t\t// This loop retrieves and saves the function arguments in a list\n\t\t\t\t\t\t\t\t\twhile(offset < line.length()) {\n\t\t\t\t\t\t\t\t\t\tif(line.charAt(offset) == ' ') {\n\t\t\t\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnext_element = line.substring(offset, nextWordEndIndex(line, offset));\n\t\t\t\t\t\t\t\t\t\t\toffset = nextWordEndIndex(line, offset);\n\t\t\t\t\t\t\t\t\t\t\tfunction_arguments.add(next_element);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t// The function is called via recursive call to the interpreterMainMethod\n\t\t\t\t\t\t\t\t\tinterpretorMainMethod(functionHandler(function_arguments, functions.get(function_name), \"read\"), 1);\n\t\t\t\t\t\t\t\t\tlocal_double_variables.clear();\n\t\t\t\t\t\t\t\t\tlocal_string_variables.clear();\n\t\t\t\t\t\t\t\t\tfunction_arguments.clear();\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// function declare code\n\t\t\t\t\t\t\t\t// take note the function isn't actually saved here, but in the code far above\n\t\t\t\t\t\t\t\tfunction_is_being_written = true;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(function_name.length() != line_length) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tint offset = function_name.length()+1;\n\t\t\t\t\t\t\t\t\t// This loop retrieves and saves the function arguments in a list\n\t\t\t\t\t\t\t\t\twhile(offset < line.length()) {\n\t\t\t\t\t\t\t\t\t\tif(line.charAt(offset) == ' ') {\n\t\t\t\t\t\t\t\t\t\t\toffset++;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tnext_element = line.substring(offset, nextWordEndIndex(line, offset));\n\t\t\t\t\t\t\t\t\t\t\toffset = nextWordEndIndex(line, offset);\n\t\t\t\t\t\t\t\t\t\t\tfunction_arguments.add(next_element);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (IndexOutOfBoundsException e) {\n\t\t\t\t\t\t\t//TODO error test\n\t\t\t\t\t\t\tminc.consolearea.append(\"Error: bad function syntax. line \"+line_count+\"\\n\"+line);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// report error\n\t\t\t\t\telse {\n\t\t\t\t\t\tminc.consolearea.append(\"Error: Unknown Operation. line \"+line_count+\"\\n\"+line);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tskip_line = false;\n\t\t\t}\t\n\t\t}\n\t}", "public void tokenizeFunctionArguments(){\n for (int i = 0; i < tokenization.size(); i++){\n if (tokenization.get(i).kind == Token.Kind.FUN && tokenization.get(i+1).kind == Token.Kind.LEFT){\n int argIn = i + 2;\n HashMap<String, String> argNameMap = new HashMap<>();\n int argNum = 1;\n while (tokenization.get(argIn).kind == Token.Kind.ID || tokenization.get(argIn).kind == Token.Kind.COMMA || tokenization.get(argIn).kind == Token.Kind.RIGHT){\n if (tokenization.get(argIn).kind == Token.Kind.ID){\n argNameMap.put(tokenization.get(argIn).varName,\"$\" + argNum);\n tokenization.get(argIn).varName = \"$\" + argNum;\n argNum++;\n }\n argIn++;\n }\n //By here argIn is the index of the right parenthesis if there are arguments\n int funBodyIn = argIn;\n if (tokenization.get(funBodyIn).kind != Token.Kind.LBRACE){\n\n }\n else{\n int bracketBalance = 1;\n funBodyIn = funBodyIn + 1;\n while (bracketBalance > 0){\n if (tokenization.get(funBodyIn).kind == Token.Kind.ID && argNameMap.containsKey(tokenization.get(funBodyIn).varName)){\n tokenization.get(funBodyIn).varName = argNameMap.get(tokenization.get(funBodyIn).varName);\n }\n else if (tokenization.get(funBodyIn).kind == Token.Kind.LBRACE){\n bracketBalance++;\n }\n else if (tokenization.get(funBodyIn).kind == Token.Kind.RBRACE){\n bracketBalance--;\n }\n funBodyIn++;\n }\n }\n }\n }\n }", "FunctionExtract createFunctionExtract();", "@Override\n public void setFunctionName(String functionName) {\n\n }", "public interface C2950c {\n /* renamed from: a */\n int mo9690a(int i, int i2);\n\n /* renamed from: a */\n int mo9691a(String str, String str2, float f);\n\n /* renamed from: a */\n int mo9692a(String[] strArr, int i);\n\n /* renamed from: a */\n void mo9693a();\n\n /* renamed from: a */\n void mo9694a(float f, float f2);\n\n /* renamed from: a */\n void mo9695a(float f, float f2, float f3, float f4, float f5);\n\n /* renamed from: a */\n void mo9696a(float f, float f2, int i);\n\n /* renamed from: a */\n void mo9697a(String str);\n\n /* renamed from: a */\n void mo9698a(String str, float f);\n\n /* renamed from: a */\n void mo9699a(String str, String str2, boolean z);\n\n /* renamed from: a */\n void mo9700a(String str, boolean z);\n\n /* renamed from: a */\n void mo9701a(boolean z);\n\n /* renamed from: b */\n int mo9702b(String str, String str2, float f);\n\n /* renamed from: b */\n void mo9703b(float f, float f2);\n\n /* renamed from: b */\n void mo9704b(float f, float f2, int i);\n\n /* renamed from: c */\n void mo9705c(float f, float f2);\n}", "ParsedRankFunction addOrReplaceFunction(ParsedRankFunction func) {\n return functions.put(func.name(), func);\n }", "@Override\n protected BDDState handleFunctionCallEdge(\n CFunctionCallEdge cfaEdge,\n List<CExpression> args,\n List<CParameterDeclaration> params,\n String calledFunction)\n throws UnsupportedCodeException {\n BDDState newState = state;\n\n // var_args cannot be handled: func(int x, ...) --> we only handle the first n parameters\n assert args.size() >= params.size();\n\n for (int i = 0; i < params.size(); i++) {\n\n // make variable (predicate) for param, this variable is not global\n final String varName = params.get(i).getQualifiedName();\n final CType targetType = params.get(i).getType();\n final Partition partition = varClass.getPartitionForParameterOfEdge(cfaEdge, i);\n final Region[] var =\n predmgr.createPredicate(\n varName,\n targetType,\n cfaEdge.getSuccessor(),\n bvComputer.getBitsize(partition, targetType),\n precision);\n final Region[] arg =\n bvComputer.evaluateVectorExpression(\n partition, args.get(i), targetType, cfaEdge.getSuccessor(), precision);\n newState = newState.addAssignment(var, arg);\n }\n\n return newState;\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public Arginfo visit(VarDeclaration n, Arginfo argu) {\n Arginfo _ret=null;\n \n \n \n n.f0.accept(this, argu);\n n.f1.accept(this, argu);\n n.f2.accept(this, argu);\n \n if(!argu.methodname.equals(\"\")){\n \t globalmap.put(n.f1.f0.tokenImage,prectr++);\n }\n \n return _ret;\n }", "public interface C0159fv {\n /* renamed from: a */\n void mo4827a(Context context, C0152fo foVar);\n\n /* renamed from: a */\n void mo4828a(C0152fo foVar, boolean z);\n\n /* renamed from: a */\n void mo4829a(C0158fu fuVar);\n\n /* renamed from: a */\n boolean mo4830a();\n\n /* renamed from: a */\n boolean mo4831a(C0153fp fpVar);\n\n /* renamed from: a */\n boolean mo4832a(C0167gc gcVar);\n\n /* renamed from: b */\n void mo4833b();\n\n /* renamed from: b */\n boolean mo4834b(C0153fp fpVar);\n}", "public void MIPSme()\n {\n System.out.println(\"Took func from offset: \" + offset);\n TEMP label_address = TEMP_FACTORY.getInstance().getFreshTEMP();\n sir_MIPS_a_lot.getInstance().load(label_address, src);\n sir_MIPS_a_lot.getInstance().addi(label_address,label_address,4*offset);\n sir_MIPS_a_lot.getInstance().load(dst,label_address); //take the function address to dst\n }", "@Override\n public String codeGeneration() {\n StringBuilder localDeclarations = new StringBuilder();\n StringBuilder popLocalDeclarations = new StringBuilder();\n\n if (declarationsArrayList.size() > 0) {\n for (INode dec : declarationsArrayList) {\n localDeclarations.append(dec.codeGeneration());\n popLocalDeclarations.append(\"pop\\n\");\n }\n }\n\n //parametri in input da togliere dallo stack al termine del record di attivazione\n StringBuilder popInputParameters = new StringBuilder();\n for (int i = 0; i < parameterNodeArrayList.size(); i++) {\n popInputParameters.append(\"pop\\n\");\n }\n\n\n String funLabel = Label.nuovaLabelFunzioneString(idFunzione.toUpperCase());\n\n if (returnType instanceof VoidType) {\n // siccome il return è Void vengono rimosse le operazioni per restituire returnvalue\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n } else {\n //inserisco il codice della funzione in fondo al main, davanti alla label\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n \"srv\\n\" + //pop del return value\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lrv\\n\" + // push del risultato\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n }\n\n return \"push \" + funLabel + \"\\n\";\n }", "<T extends Formula> T replaceArgsAndName(T f, String newName, List<Formula> args);", "public void defineFunction(String prefix, String function, String className, String methodName)\n/* */ throws ClassNotFoundException, NoSuchMethodException\n/* */ {\n/* 87 */ if ((prefix == null) || (function == null) || (className == null) || (methodName == null))\n/* */ {\n/* 89 */ throw new NullPointerException(Util.message(this.context, \"elProcessor.defineFunctionNullParams\", new Object[0]));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 94 */ Class<?> clazz = this.context.getImportHandler().resolveClass(className);\n/* */ \n/* 96 */ if (clazz == null) {\n/* 97 */ clazz = Class.forName(className, true, \n/* 98 */ Thread.currentThread().getContextClassLoader());\n/* */ }\n/* */ \n/* 101 */ if (!Modifier.isPublic(clazz.getModifiers())) {\n/* 102 */ throw new ClassNotFoundException(Util.message(this.context, \"elProcessor.defineFunctionInvalidClass\", new Object[] { className }));\n/* */ }\n/* */ \n/* */ \n/* 106 */ MethodSignature sig = new MethodSignature(this.context, methodName, className);\n/* */ \n/* */ \n/* 109 */ if (function.length() == 0) {\n/* 110 */ function = sig.getName();\n/* */ }\n/* */ \n/* 113 */ Method[] methods = clazz.getMethods();\n/* 114 */ for (Method method : methods) {\n/* 115 */ if (Modifier.isStatic(method.getModifiers()))\n/* */ {\n/* */ \n/* 118 */ if (method.getName().equals(sig.getName())) {\n/* 119 */ if (sig.getParamTypeNames() == null)\n/* */ {\n/* */ \n/* 122 */ this.manager.mapFunction(prefix, function, method);\n/* 123 */ return;\n/* */ }\n/* 125 */ if (sig.getParamTypeNames().length == method.getParameterTypes().length)\n/* */ {\n/* */ \n/* 128 */ if (sig.getParamTypeNames().length == 0) {\n/* 129 */ this.manager.mapFunction(prefix, function, method);\n/* 130 */ return;\n/* */ }\n/* 132 */ Class<?>[] types = method.getParameterTypes();\n/* 133 */ String[] typeNames = sig.getParamTypeNames();\n/* 134 */ if (types.length == typeNames.length) {\n/* 135 */ boolean match = true;\n/* 136 */ for (int i = 0; i < types.length; i++) {\n/* 137 */ if ((i == types.length - 1) && (method.isVarArgs())) {\n/* 138 */ String typeName = typeNames[i];\n/* 139 */ if (typeName.endsWith(\"...\")) {\n/* 140 */ typeName = typeName.substring(0, typeName.length() - 3);\n/* 141 */ if (!typeName.equals(types[i].getName())) {\n/* 142 */ match = false;\n/* */ }\n/* */ } else {\n/* 145 */ match = false;\n/* */ }\n/* 147 */ } else if (!types[i].getName().equals(typeNames[i])) {\n/* 148 */ match = false;\n/* 149 */ break;\n/* */ }\n/* */ }\n/* 152 */ if (match) {\n/* 153 */ this.manager.mapFunction(prefix, function, method);\n/* 154 */ return;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* 161 */ throw new NoSuchMethodException(Util.message(this.context, \"elProcessor.defineFunctionNoMethod\", new Object[] { methodName, className }));\n/* */ }", "public MathEval setFunctionHandler(String nam, FunctionHandler hdl) {\r\n if(!Character.isLetter(nam.charAt(0))) { throw new IllegalArgumentException(\"Function names must start with a letter\" ); }\r\n if(nam.indexOf('(')!=-1 ) { throw new IllegalArgumentException(\"Function names may not contain a parenthesis\"); }\r\n if(nam.indexOf(')')!=-1 ) { throw new IllegalArgumentException(\"Function names may not contain a parenthesis\"); }\r\n if(hdl!=null) { functions.put(nam,hdl); }\r\n else { functions.remove(nam); }\r\n return this;\r\n }", "public Arginfo visit(AssignmentStatement n, Arginfo argu) {\n Arginfo _ret=null;\n n.f0.accept(this, argu);\n \n String classname=argu.classname;\n String methodname=argu.methodname;\n String strtofind=n.f0.f0.tokenImage;\n if(globalmap.containsKey(strtofind)){\n \t System.out.print(\"\\tMOVE TEMP \"+globalmap.get(strtofind)+\" \");\n }\n else{\n \t System.out.print(\"\\tHSTORE TEMP 0 \"+classpos(strtofind,classname)+\" \");\n }\n \n n.f1.accept(this, argu);\n n.f2.accept(this, argu);\n n.f3.accept(this, argu);\n return _ret;\n }", "@Override\n\tpublic Type generateIntermediateCode(Function fun) {\n\t\tErrorList err = ErrorList.getInstance();\n\t\tFunctionDeclaration funDec = null;\n\t\tif(Semantic.globalFuntionTable.containsKey(id))\n\t\t\tfunDec = Semantic.globalFuntionTable.get(id);\n\t\telse \n\t\t\terr.addException(new SemanticException(id, super.getLine(), 8));\n\t\t\n\t\tfor(int i = argsList.size() - 1; i >= 0; i--){\n\t\t\tOperation op = new Operation(OperandType.PUSH, fun.getCurrBlock());\n\t\t\tType paramType = argsList.get(i).generateIntermediateCode(fun);\n\t\t\tif(funDec != null){\n\t\t\t\tif(funDec.getParameters().get(i) == null || funDec.getParameters().get(i).getType() != paramType ||\n\t\t\t\t\t\t(fun.getSymbolTable().get(id) != null && (funDec.getParameters().get(i).isArray() != \n\t\t\t\t\t\tfun.getSymbolTable().get(id).isArray()))){\n\t\t\t\t\terr.addException(new SemanticException(id, super.getLine(), 11));\n\t\t\t\t}\n\t\t\t}\n\t\t\tOperand oper = null;\n\t\t\tif(argsList.get(i) instanceof LiteralExpression){\n\t\t\t\tObject num = ((LiteralExpression)argsList.get(i)).getNumber();\n\t\t\t\tif(num.getClass() == Integer.class)\n\t\t\t\t\toper = new Operand(OperandType.INT, (int)num);\n\t\t\t\telse\n\t\t\t\t\toper = new Operand(OperandType.FLOAT, (double)num);\n\t\t\t}\n\t\t\telse \n\t\t\t\toper = new Operand(OperandType.REG, argsList.get(i).getRegNum());\n\t\t\top.setSrcOperand(0, oper);\n\t\t\tfun.getCurrBlock().appendOperation(op);\n\t\t}\n\t\tOperation op = new Operation(OperandType.CALL, fun.getCurrBlock());\n\t\t//Attribute\n\t\tOperand oper = new Operand(OperandType.FUNC_NAME, getId());\n\t\top.setSrcOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\t\n\t\top = new Operation(OperandType.MOV, fun.getCurrBlock());\n\t\toper = new Operand(OperandType.RET, \"ret\");\n\t\top.setSrcOperand(0, oper);\n\t\t\n\t\tsuper.setRegNum(fun.getNewRegisterNum());\n\t\toper = new Operand(OperandType.REG, super.getRegNum());\n\t\top.setDestOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\tif(funDec != null)\n\t\t\treturn funDec.getType();\n\t\telse\n\t\t\treturn Type.NULL;\n\t}", "public static void main(String[] args) {\n FunctionFactory<Integer, Integer> functionFactory = new FunctionFactory<>();\n // 1. add simple functions \"square\", \"increment\", \"decrement\", \"negative\"\n // 2. get each function by name, and apply to argument 5, print a result (should be 25, 6, 4,-5 accordingly)\n // 3. add simple function \"abs\" using method reference (use class Math)\n // 4. add try/catch block, catch InvalidFunctionNameException and print some error message to the console\n // 5. try to get function with invalid name\n\n functionFactory.addFunction(\"square\", n -> n * n);\n functionFactory.addFunction(\"abs\", Math::abs);\n\n functionFactory.getFunction(\"square\").apply(5);\n try{\n functionFactory.getFunction(\"abs\").apply(5);\n }catch (InvalidFunctionNameException e){\n System.out.println(e.getMessage());\n }\n\n\n\n\n }", "void addAndReplace(FuncItem f){\n // if exist replace\n if (classMethodMap.containsKey(f.funSymbol)){\n var old_f_idx = findMethod(f.funSymbol);\n f.storeIdx = old_f_idx;\n members.set(old_f_idx, f);\n } else {\n f.storeIdx = members.size();\n members.add(f);\n }\n classMethodMap.put( f.funSymbol, f.storeIdx);\n }", "@Override\n public Node rewriteFunctionExpression(FunctionExpression functionExpression) {\n RewriteItem varargRewriteItem = getVarargRewriteItem(functionExpression);\n if (varargRewriteItem != null) {\n functionExpression =\n FunctionExpression.Builder.from(functionExpression)\n .setStatements(\n redeclareItems(\n functionExpression.getBody(), ImmutableList.of(varargRewriteItem))\n .getStatements())\n .build();\n }\n\n // Redeclare non-final parameters.\n return FunctionExpression.Builder.from(functionExpression)\n .setStatements(\n redeclareItems(\n functionExpression.getBody(),\n getNonFinalRewriteItems(functionExpression))\n .getStatements())\n .build();\n }", "public Arginfo visit(MessageSend n, Arginfo argu) {\n Arginfo _ret=null;\n \n int a=prectr++;\n int b=prectr++;\n int c=prectr++;\n int d=prectr++;\n int e=prectr++;\n \n System.out.println(\"BEGIN\\n \");\n System.out.println(\"MOVE TEMP \"+e+\" CALL\\n BEGIN MOVE TEMP \"+a+\" \");\n argu.isreq=1;\n Arginfo temp1=n.f0.accept(this, argu);\n argu.isreq=0;\n \n if(temp1==null){\n \t System.err.println(\"noo \"+n.f2.f0.tokenImage+\" \"+argu.classname+\" \"+argu.methodname);\n \t System.exit(1);\n }\n String classname=temp1.str;\n String classname2=temp1.str;\n String methodname=n.f2.f0.tokenImage;\n while(true){\n \t if(finaltable.symboltable.get(classname).funcdec.containsKey(methodname)){\n \t\t break;\n \t }\n \t else{\n \t\t classname=finaltable.symboltable.get(classname).parent;\n \t\t if(classname==temp1.str||classname==null) break;\n \t }\n }\n String name=classname+\"_\"+methodname;\n //System.err.println(name+\" \"+);\n int dist=finaltable.symboltable.get(classname2).methodnum.get(name);\n \n n.f1.accept(this, argu);\n n.f2.accept(this, argu);\n n.f3.accept(this, argu);\n \n System.out.println(\"HLOAD TEMP \"+b+\" TEMP \"+a+\" 0\");\n System.out.println(\"HLOAD TEMP \"+c+\" TEMP \"+b+\" \"+dist);\n System.out.println(\"RETURN TEMP \"+c+\"\\nEND\\n\");\n System.out.println(\"( TEMP \"+a+\" \");\n \n n.f4.accept(this, argu);\n n.f5.accept(this, argu);\n \n \n System.out.println(\" )\\n\"+\"RETURN TEMP \"+e+\"\\nEND\\n\");\n\n \n temp1.str=finaltable.symboltable.get(classname).funcdec.get(methodname).get(0);\n return temp1;\n }", "public Arginfo visit(ArrayAssignmentStatement n, Arginfo argu) {\n Arginfo _ret=null;\n \n String classname=argu.classname;\n String methodname=argu.methodname;\n String strtofind=n.f0.f0.tokenImage;\n int a=prectr++;\n int b=prectr++;\n \n if(globalmap.containsKey(strtofind)){\n \t System.out.println(\"\\tMOVE TEMP \"+b+\" \"+globalmap.get(strtofind));\n \t System.out.println(\"\\tMOVE TEMP \"+a+\" PLUS 4 TIMES 4 \");\n }\n else{\n \t \n \t System.out.println(\"\\t\\tHLOAD TEMP \"+b+\" TEMP 0 \"+classpos(strtofind,classname));\n \t \n \t System.out.println(\"\\tMOVE TEMP \"+a+\" PLUS 4 TIMES 4 \");\n }\n \n n.f0.accept(this, argu);\n n.f1.accept(this, argu);\n n.f2.accept(this, argu);\n n.f3.accept(this, argu);\n n.f4.accept(this, argu);\n \n System.out.print(\"\\tMOVE TEMP \"+a+\" PLUS TEMP \"+b+\" TEMP \"+a+\" \");\n System.out.print(\"\\tHSTORE TEMP \"+a+\" 0 \");\n \n n.f5.accept(this, argu);\n n.f6.accept(this, argu);\n \n \n \n return _ret;\n }", "static public interface FunctionHandler\r\n {\r\n public double evaluateFunction(String nam, ArgParser args) throws ArithmeticException;\r\n }", "private void jetFunctions(){\n\t\tInvokeExpr invokeExpr = (InvokeExpr) rExpr;\n\t\tSootMethodRef methodRef = invokeExpr.getMethodRef();\n\t\t\n\t\t//if this is a java.lang.String.func, we don't need to declare it\n\t\tif(StringModeling.stringMethods.contains(methodRef.getSignature())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString funStr = constructFunStr(invokeExpr);\n\t\tType thisType = null;\n\t\tif(!fileGenerator.getDeclaredFunctions().contains(funStr)){\n\t\t\tif(invokeExpr instanceof StaticInvokeExpr){\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}else{\n\t\t\t\tif(invokeExpr instanceof InterfaceInvokeExpr){\n\t\t\t\t\tthisType = ((InterfaceInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof SpecialInvokeExpr){\n\t\t\t\t\tthisType = ((SpecialInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}else if(invokeExpr instanceof VirtualInvokeExpr){\n\t\t\t\t\tthisType = ((VirtualInvokeExpr) invokeExpr).getBase().getType();\n\t\t\t\t}\n\t\t\t\twriter.println(Z3MiscFunctions.v().getFuncDeclareStmt(funStr, thisType,\n\t\t\t\t\t\tmethodRef.parameterTypes(), methodRef.returnType()));\n\t\t\t}\n\t\t\tfileGenerator.getDeclaredFunctions().add(funStr);\n\t\t}\n\t}", "private void updateFunctionNode(JsMessage message, Node functionNode)\n throws MalformedException {\n checkNode(functionNode, Token.FUNCTION);\n Node nameNode = functionNode.getFirstChild();\n checkNode(nameNode, Token.NAME);\n Node argListNode = nameNode.getNext();\n checkNode(argListNode, Token.PARAM_LIST);\n Node oldBlockNode = argListNode.getNext();\n checkNode(oldBlockNode, Token.BLOCK);\n\n Iterator<CharSequence> iterator = message.parts().iterator();\n Node valueNode = constructAddOrStringNode(iterator, argListNode);\n Node newBlockNode = IR.block(IR.returnNode(valueNode));\n\n if (!newBlockNode.isEquivalentTo(\n oldBlockNode,\n /* compareType= */ false,\n /* recurse= */ true,\n /* jsDoc= */ false,\n /* sideEffect= */ false)) {\n newBlockNode.useSourceInfoIfMissingFromForTree(oldBlockNode);\n functionNode.replaceChild(oldBlockNode, newBlockNode);\n compiler.reportChangeToEnclosingScope(newBlockNode);\n }\n }", "final public void funcall() throws ParseException {\n int pcount =0;\n String tokenImage = \"\";\n jj_consume_token(VARIABLE);\n if(functions.get(token.image)==null) {\n {if (true) throw new ParseException(\"Bad input. Si es un llamado a funcall(), La funcion que se intenta llamar no ha sido definida.\");}\n }\n tokenImage = token.image;\n label_12:\n while (true) {\n if (jj_2_48(4)) {\n ;\n } else {\n break label_12;\n }\n jj_consume_token(NUMERO);\n pcount ++;\n }\n if(pcount != functions.get(tokenImage).size()) {\n {if (true) throw new ParseException(\"El numero de parametros ingresados no concuerda con el numero de parametros\\u005cn\"+\n \"definidos en la funcion.\");}\n }\n }", "org.globus.swift.language.Function addNewFunction();", "void setFunctionArray(int i, org.globus.swift.language.Function function);", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "org.globus.swift.language.Function insertNewFunction(int i);", "abstract /*package*/ Object executeRVMFunction(Function func, IValue[] posArgs, Map<String,IValue> kwArgs);", "public interface C0378an {\n /* renamed from: a */\n void mo3504a(C0505cw cwVar, Map<String, String> map);\n}", "public interface IFunction {\r\n void setFunctions(String tag);\r\n}", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "protected abstract String getFunctionName();", "public void b(fn paramfn)\r\n/* 241: */ {\r\n/* 242:254 */ paramfn.a(\"xTile\", (short)this.c);\r\n/* 243:255 */ paramfn.a(\"yTile\", (short)this.d);\r\n/* 244:256 */ paramfn.a(\"zTile\", (short)this.e);\r\n/* 245:257 */ oa localoa = (oa)atr.c.c(this.f);\r\n/* 246:258 */ paramfn.a(\"inTile\", localoa == null ? \"\" : localoa.toString());\r\n/* 247:259 */ paramfn.a(\"shake\", (byte)this.b);\r\n/* 248:260 */ paramfn.a(\"inGround\", (byte)(this.a ? 1 : 0));\r\n/* 249:262 */ if (((this.h == null) || (this.h.length() == 0)) && ((this.g instanceof ahd))) {\r\n/* 250:263 */ this.h = this.g.d_();\r\n/* 251: */ }\r\n/* 252:265 */ paramfn.a(\"ownerName\", this.h == null ? \"\" : this.h);\r\n/* 253: */ }", "public interface C39682m {\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$a */\n public interface C39683a {\n /* renamed from: a */\n int mo98966a(C29296g gVar);\n\n /* renamed from: b */\n int mo98967b(C29296g gVar);\n\n /* renamed from: c */\n float mo98968c(C29296g gVar);\n }\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$b */\n public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }\n}", "public Snippet visit(FieldAssignment n, Snippet argu) {\n\t \n\t Snippet _ret = new Snippet(\"\", \"\", null, false);\n\t Snippet f0 = n.identifier.accept(this, argu);\n\t n.nodeToken.accept(this, argu);\n\t Snippet f2 = n.identifier1.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t Snippet f5 = n.identifier2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t n.nodeToken4.accept(this, argu);\n\t _ret.returnTemp = generateTabs(blockDepth)+f0.returnTemp+\".\"+f2.returnTemp+\" = (\"+f5.returnTemp+\")\"+\";\";\n\t\t\ttPlasmaCode+=_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }", "@Override\r\n public MachineFunction getFunction (String functionName) {\r\n MachineFunction mf = super.getFunction(functionName);\r\n \r\n // Check to see if the function is a lifted let variable function.\r\n if (mf == null) {\r\n mf = liftedFunctionMap.get(functionName);\r\n }\r\n return mf;\r\n }", "public boolean addFuncDynamic(Accessibility pAccess, ExecSignature pES, MoreData pMoreData);", "private static void parseElementInternal(BufferedWriter writer, String function, Element... params) throws IOException {\n\t\tif(params.length > 1) {\n\t\t\tparseParameter(params[0], writer);\n\t\t\twriter.write(\" \" + function + \" \");\n\t\t\tparseParameter(params[1], writer);\n\t\t} else {\n\t\t\twriter.write(\" \" + function + \" \");\n\t\t\tparseParameter(params[0], writer);\n\t\t}\n\t}", "@Override\n public Ast visitFunction_definition(napParser.Function_definitionContext ctx) {\n String name = ctx.Identifier().getText();\n List<Pair<Pair<String, Type>, Boolean>> arguments = new LinkedList<>();\n for(napParser.ParameterContext arg : ctx.parameters().parameter()){\n String argName = arg.Identifier().getText();\n Type argType = (Type) arg.type().accept(this);\n boolean passByRef = arg.getChildCount() == 3;\n arguments.add(new Pair<>(new Pair<>(argName, argType), passByRef));\n }\n Block block = (Block) visit(ctx.block());\n if (ctx.returnType == null)\n return new FunctionDefinition(position(ctx), name, arguments, block);\n else {\n Type returnType = (Type) visit(ctx.returnType);\n return new FunctionDefinition(position(ctx), name, arguments, block, returnType);\n }\n }", "private void handleSpecialCases(Command c) {\n\t\tif(c instanceof Repeat) {\n\t\t\tc.addChild(myDictionary.getVariable(Repeat.DEFAULT_VAR_NAME));\n\t\t\tc.addChild(parseCommand(codeReader.next()));\n\t\t}\n\t\telse if(c instanceof MakeUserInstruction) {\n\t\t\tString following;\n\t\t\tString following2;\n\t\t\ttry {\n\t\t\t\tfollowing = codeReader.next();\n\t\t\t\tfollowing2 = codeReader.next();\n\t\t\t}\n\t\t\tcatch(NoSuchElementException e) {\n\t\t\t\tthrow new SLogoException(\"Insufficient arguments for function definition.\");\n\t\t\t}\n\t\t\tFunction f;\n\t\t\tif(commandMatch.matcher(following).matches()) {\n\t\t\t\tf = myDictionary.getFunction(following);\n\t\t\t}\n\t\t\telse throw new SLogoException(\"Attempted to define invalid function.\");\n\t\t\tCommand col = parseCommand(following2);\n\t\t\tc.addChild(f);\n\t\t\tf.replaceArg(col);\n\t\t}\n\t}", "@Override\r\n public void visit(Move n, functionStruct fStruct) {\r\n String leftObject = n.f0.f0.toString();\r\n addId(leftObject, fStruct.functionName, fStruct.lineNumber);\r\n\r\n String rightObject = n.f2.f0.toString();\r\n addId(rightObject, fStruct.functionName, fStruct.lineNumber);\r\n \r\n }", "public void redefine(String field, String value){\n\t\tif(field.equals(\"function_name\")){\n\t\t\tfunction_name = (String)value;\n\t\t}\n\t\telse if(field.equals(\"str_repr\")){\n\t\t\tstr_repr = (String)value;\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"That's not a valid option silly\");\n\t\t}\n\t}", "public void MIPSme()\n\t{\n\t\t\n\t\tTEMP varAddress = null;\n\t\t//v := v - this is the right side of the assignment - we want to load the value of v from memory\n\t\tif (isRight){\n\t\t\tif(isParamFromStack){\n\t\t\t\t// we want value from stack\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t\t//need to be modified\n\t\t\telse{\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,-(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t}\n\t\t//left side - we want to get variable address into temp t \n\t\telse{\n\t\t\t//variable is a parameter of a function\n\t\t\tif (isParamFromStack){\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressParamVar(this.localVarOffset);\n\t\t\t}\n\t\t\t//for now it represents local variable but need to be changed.... (data members, globals...) \n\t\t\telse{\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressLocalVar(this.localVarOffset);\n\t\t\t}\n\t\t\tsir_MIPS_a_lot.getInstance().move(dst,varAddress);\n\t\t}\n\t}", "public Function( String name )\n {\n this.name = name;\n }", "@Override\n\tprotected void remapVariablesInThisExpression(Map<String, String> fromToVariableMap) {\n\t}", "private void assign(DefinitionStmt stmt) {\n \n soot.Value rightOp = stmt.getRightOp();\n Value result;\n \n if (rightOp instanceof Immediate) {\n Immediate immediate = (Immediate) rightOp;\n result = immediate(stmt, immediate);\n } else if (rightOp instanceof ThisRef) {\n result = function.getParameterRef(1);\n } else if (rightOp instanceof ParameterRef) {\n ParameterRef ref = (ParameterRef) rightOp;\n int index = (sootMethod.isStatic() ? 1 : 2) + ref.getIndex();\n Value p = new VariableRef(\"p\" + index, getType(ref.getType()));\n result = widenToI32Value(p, isUnsigned(ref.getType()));\n } else if (rightOp instanceof CaughtExceptionRef) {\n result = call(BC_EXCEPTION_CLEAR, env);\n } else if (rightOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) rightOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n if (ref.getType() instanceof NullType) {\n // The base value is always null. Do a null check which will\n // always throw NPE.\n checkNull(stmt, base);\n return;\n } else {\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n result = call(getArrayLoad(ref.getType()), base, index);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n }\n } else if (rightOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) rightOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR, OBJECT_PTR));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new GetField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env, base);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) rightOp;\n FunctionRef fn = Intrinsics.getIntrinsic(sootMethod, stmt);\n if (fn == null) {\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_getter\", \n new FunctionType(getType(ref.getType()), ENV_PTR));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new GetStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n }\n result = call(fn, env);\n result = widenToI32Value(result, isUnsigned(ref.getType()));\n } else if (rightOp instanceof Expr) {\n if (rightOp instanceof BinopExpr) {\n BinopExpr expr = (BinopExpr) rightOp;\n Type rightType = getLocalType(expr.getType());\n Variable resultVar = function.newVariable(rightType);\n result = resultVar.ref();\n Value op1 = immediate(stmt, (Immediate) expr.getOp1());\n Value op2 = immediate(stmt, (Immediate) expr.getOp2());\n if (rightOp instanceof AddExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Add(resultVar, op1, op2));\n } else {\n function.add(new Fadd(resultVar, op1, op2));\n }\n } else if (rightOp instanceof AndExpr) {\n function.add(new And(resultVar, op1, op2));\n } else if (rightOp instanceof CmpExpr) {\n Variable t1 = function.newVariable(I1);\n Variable t2 = function.newVariable(I1);\n Variable t3 = function.newVariable(resultVar.getType());\n Variable t4 = function.newVariable(resultVar.getType());\n function.add(new Icmp(t1, Condition.slt, op1, op2));\n function.add(new Icmp(t2, Condition.sgt, op1, op2));\n function.add(new Zext(t3, new VariableRef(t1), resultVar.getType()));\n function.add(new Zext(t4, new VariableRef(t2), resultVar.getType()));\n function.add(new Sub(resultVar, new VariableRef(t4), new VariableRef(t3)));\n } else if (rightOp instanceof DivExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LDIV : IDIV;\n result = call(f, env, op1, op2);\n } else {\n // float or double\n function.add(new Fdiv(resultVar, op1, op2));\n }\n } else if (rightOp instanceof MulExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Mul(resultVar, op1, op2));\n } else {\n function.add(new Fmul(resultVar, op1, op2));\n }\n } else if (rightOp instanceof OrExpr) {\n function.add(new Or(resultVar, op1, op2));\n } else if (rightOp instanceof RemExpr) {\n if (rightType instanceof IntegerType) {\n FunctionRef f = rightType == I64 ? LREM : IREM;\n result = call(f, env, op1, op2);\n } else {\n FunctionRef f = rightType == DOUBLE ? DREM : FREM;\n result = call(f, env, op1, op2);\n }\n } else if (rightOp instanceof ShlExpr || rightOp instanceof ShrExpr || rightOp instanceof UshrExpr) {\n IntegerType type = (IntegerType) op1.getType();\n int bits = type.getBits();\n Variable t = function.newVariable(op2.getType());\n function.add(new And(t, op2, new IntegerConstant(bits - 1, (IntegerType) op2.getType())));\n Value shift = t.ref();\n if (((IntegerType) shift.getType()).getBits() < bits) {\n Variable tmp = function.newVariable(type);\n function.add(new Zext(tmp, shift, type));\n shift = tmp.ref();\n }\n if (rightOp instanceof ShlExpr) {\n function.add(new Shl(resultVar, op1, shift));\n } else if (rightOp instanceof ShrExpr) {\n function.add(new Ashr(resultVar, op1, shift));\n } else {\n function.add(new Lshr(resultVar, op1, shift));\n }\n } else if (rightOp instanceof SubExpr) {\n if (rightType instanceof IntegerType) {\n function.add(new Sub(resultVar, op1, op2));\n } else {\n function.add(new Fsub(resultVar, op1, op2));\n }\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof XorExpr) {\n function.add(new Xor(resultVar, op1, op2));\n } else if (rightOp instanceof CmplExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPL : DCMPL;\n function.add(new Call(resultVar, f, op1, op2));\n } else if (rightOp instanceof CmpgExpr) {\n FunctionRef f = op1.getType() == FLOAT ? FCMPG : DCMPG;\n function.add(new Call(resultVar, f, op1, op2));\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else if (rightOp instanceof CastExpr) {\n Value op = immediate(stmt, (Immediate) ((CastExpr) rightOp).getOp());\n soot.Type sootTargetType = ((CastExpr) rightOp).getCastType();\n soot.Type sootSourceType = ((CastExpr) rightOp).getOp().getType();\n if (sootTargetType instanceof PrimType) {\n Type targetType = getType(sootTargetType);\n Type sourceType = getType(sootSourceType);\n if (targetType instanceof IntegerType && sourceType instanceof IntegerType) {\n // op is at least I32 and has already been widened if source type had fewer bits then I32\n IntegerType toType = (IntegerType) targetType;\n IntegerType fromType = (IntegerType) op.getType();\n Variable v = function.newVariable(toType);\n if (fromType.getBits() < toType.getBits()) {\n // Widening\n if (isUnsigned(sootSourceType)) {\n function.add(new Zext(v, op, toType));\n } else {\n function.add(new Sext(v, op, toType));\n }\n } else if (fromType.getBits() == toType.getBits()) {\n function.add(new Bitcast(v, op, toType));\n } else {\n // Narrow\n function.add(new Trunc(v, op, toType));\n }\n result = widenToI32Value(v.ref(), isUnsigned(sootTargetType));\n } else if (targetType instanceof FloatingPointType && sourceType instanceof IntegerType) {\n // we always to a signed conversion since if op is char it has already been zero extended to I32\n Variable v = function.newVariable(targetType);\n function.add(new Sitofp(v, op, targetType));\n result = v.ref();\n } else if (targetType instanceof FloatingPointType && sourceType instanceof FloatingPointType) {\n Variable v = function.newVariable(targetType);\n if (targetType == FLOAT && sourceType == DOUBLE) {\n function.add(new Fptrunc(v, op, targetType));\n } else if (targetType == DOUBLE && sourceType == FLOAT) {\n function.add(new Fpext(v, op, targetType));\n } else {\n function.add(new Bitcast(v, op, targetType));\n }\n result = v.ref();\n } else {\n // F2I, F2L, D2I, D2L\n FunctionRef f = null;\n if (targetType == I32 && sourceType == FLOAT) {\n f = F2I;\n } else if (targetType == I64 && sourceType == FLOAT) {\n f = F2L;\n } else if (targetType == I32 && sourceType == DOUBLE) {\n f = D2I;\n } else if (targetType == I64 && sourceType == DOUBLE) {\n f = D2L;\n } else {\n throw new IllegalArgumentException();\n }\n Variable v = function.newVariable(targetType);\n function.add(new Call(v, f, op));\n result = v.ref();\n }\n } else {\n if (sootTargetType instanceof soot.ArrayType \n && ((soot.ArrayType) sootTargetType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) sootTargetType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(CHECKCAST_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(sootTargetType);\n Trampoline trampoline = new Checkcast(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n }\n } else if (rightOp instanceof InstanceOfExpr) {\n Value op = immediate(stmt, (Immediate) ((InstanceOfExpr) rightOp).getOp());\n soot.Type checkType = ((InstanceOfExpr) rightOp).getCheckType();\n if (checkType instanceof soot.ArrayType \n && ((soot.ArrayType) checkType).getElementType() instanceof PrimType) {\n soot.Type primType = ((soot.ArrayType) checkType).getElementType();\n GlobalRef arrayClassPtr = new GlobalRef(\"array_\" + getDescriptor(primType), CLASS_PTR);\n Variable arrayClass = function.newVariable(CLASS_PTR);\n function.add(new Load(arrayClass, arrayClassPtr));\n result = call(INSTANCEOF_PRIM_ARRAY, env, arrayClass.ref(), op);\n } else {\n String targetClassName = getInternalName(checkType);\n Trampoline trampoline = new Instanceof(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, op);\n }\n } else if (rightOp instanceof NewExpr) {\n String targetClassName = getInternalName(((NewExpr) rightOp).getBaseType());\n FunctionRef fn = null;\n if (targetClassName.equals(this.className)) {\n fn = FunctionBuilder.allocator(sootMethod.getDeclaringClass()).ref();\n } else {\n Trampoline trampoline = new New(this.className, targetClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n result = call(fn, env);\n } else if (rightOp instanceof NewArrayExpr) {\n NewArrayExpr expr = (NewArrayExpr) rightOp;\n Value size = immediate(stmt, (Immediate) expr.getSize());\n if (expr.getBaseType() instanceof PrimType) {\n result = call(getNewArray(expr.getBaseType()), env, size);\n } else {\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Anewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, size);\n }\n } else if (rightOp instanceof NewMultiArrayExpr) {\n NewMultiArrayExpr expr = (NewMultiArrayExpr) rightOp;\n if (expr.getBaseType().numDimensions == 1 && expr.getBaseType().getElementType() instanceof PrimType) {\n Value size = immediate(stmt, (Immediate) expr.getSize(0));\n result = call(getNewArray(expr.getBaseType().getElementType()), env, size);\n } else {\n for (int i = 0; i < expr.getSizeCount(); i++) {\n Value size = immediate(stmt, (Immediate) expr.getSize(i));\n Variable ptr = function.newVariable(new PointerType(I32));\n function.add(new Getelementptr(ptr, dims.ref(), 0, i));\n function.add(new Store(size, ptr.ref()));\n }\n Variable dimsI32 = function.newVariable(new PointerType(I32));\n function.add(new Bitcast(dimsI32, dims.ref(), dimsI32.getType()));\n String targetClassName = getInternalName(expr.getType());\n Trampoline trampoline = new Multianewarray(this.className, targetClassName);\n trampolines.add(trampoline);\n result = call(trampoline.getFunctionRef(), env, new IntegerConstant(expr.getSizeCount()), dimsI32.ref());\n }\n } else if (rightOp instanceof InvokeExpr) {\n result = invokeExpr(stmt, (InvokeExpr) rightOp);\n } else if (rightOp instanceof LengthExpr) {\n Value op = immediate(stmt, (Immediate) ((LengthExpr) rightOp).getOp());\n checkNull(stmt, op);\n Variable v = function.newVariable(I32);\n function.add(new Call(v, ARRAY_LENGTH, op));\n result = v.ref();\n } else if (rightOp instanceof NegExpr) {\n NegExpr expr = (NegExpr) rightOp;\n Value op = immediate(stmt, (Immediate) expr.getOp());\n Type rightType = op.getType();\n Variable v = function.newVariable(op.getType());\n if (rightType instanceof IntegerType) {\n function.add(new Sub(v, new IntegerConstant(0, (IntegerType) rightType), op));\n } else {\n function.add(new Fmul(v, new FloatingPointConstant(-1.0, (FloatingPointType) rightType), op));\n }\n result = v.ref();\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n } else {\n throw new IllegalArgumentException(\"Unknown type for rightOp: \" + rightOp.getClass());\n }\n \n soot.Value leftOp = stmt.getLeftOp();\n \n if (leftOp instanceof Local) {\n Local local = (Local) leftOp;\n VariableRef v = new VariableRef(local.getName(), new PointerType(getLocalType(leftOp.getType())));\n function.add(new Store(result, v, !sootMethod.getActiveBody().getTraps().isEmpty()));\n } else {\n Type leftType = getType(leftOp.getType());\n Value narrowedResult = narrowFromI32Value(leftType, result);\n if (leftOp instanceof ArrayRef) {\n ArrayRef ref = (ArrayRef) leftOp;\n VariableRef base = (VariableRef) immediate(stmt, (Immediate) ref.getBase());\n Value index = immediate(stmt, (Immediate) ref.getIndex());\n checkNull(stmt, base);\n checkBounds(stmt, base, index);\n if (leftOp.getType() instanceof RefLikeType) {\n call(BC_SET_OBJECT_ARRAY_ELEMENT, env, base, index, narrowedResult);\n } else {\n call(getArrayStore(leftOp.getType()), base, index, narrowedResult);\n }\n } else if (leftOp instanceof InstanceFieldRef) {\n InstanceFieldRef ref = (InstanceFieldRef) leftOp;\n Value base = immediate(stmt, (Immediate) ref.getBase());\n checkNull(stmt, base);\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, OBJECT_PTR, getType(ref.getType())));\n } else {\n soot.Type runtimeType = ref.getBase().getType();\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n String runtimeClassName = runtimeType == NullType.v() ? targetClassName : getInternalName(runtimeType);\n Trampoline trampoline = new PutField(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()), runtimeClassName);\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, base, narrowedResult);\n } else if (leftOp instanceof StaticFieldRef) {\n StaticFieldRef ref = (StaticFieldRef) leftOp;\n FunctionRef fn = null;\n if (canAccessDirectly(ref)) {\n fn = new FunctionRef(mangleField(ref.getFieldRef()) + \"_setter\", \n new FunctionType(VOID, ENV_PTR, getType(ref.getType())));\n } else {\n String targetClassName = getInternalName(ref.getFieldRef().declaringClass());\n Trampoline trampoline = new PutStatic(this.className, targetClassName, \n ref.getFieldRef().name(), getDescriptor(ref.getFieldRef().type()));\n trampolines.add(trampoline);\n fn = trampoline.getFunctionRef();\n }\n call(fn, env, narrowedResult);\n } else {\n throw new IllegalArgumentException(\"Unknown type for leftOp: \" + leftOp.getClass());\n }\n }\n }", "public interface ExtractorInput {\n int m3230a(int i);\n\n int m3231a(byte[] bArr, int i, int i2);\n\n void m3232a();\n\n boolean m3233a(byte[] bArr, int i, int i2, boolean z);\n\n long m3234b();\n\n void m3235b(int i);\n\n void m3236b(byte[] bArr, int i, int i2);\n\n boolean m3237b(byte[] bArr, int i, int i2, boolean z);\n\n long m3238c();\n\n void m3239c(int i);\n\n void m3240c(byte[] bArr, int i, int i2);\n\n long m3241d();\n}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\n public String codeGen() {\n\n\tString labelFun = \"labelFun\" + MiniFunLib.getLabIndex();\n\tString popParSequence = \"\";\n\tString popLocalVariable = \"\";\n\tString localVariableCodeGen = \"\";\n\n\tfor (int i = 0; i < funParams.size(); i++) {\n\t NodeType nt = this.funParams.get(i).getType().getNodeType();\n\n\t if (nt == NodeType.ARROWTYPE_NODE)\n\t\tpopParSequence += VMCommands.POP + \"\\n\" + VMCommands.POP + \"\\n\";\n\t else\n\t\tpopParSequence += VMCommands.POP + \"\\n\";\n\t}\n\n\tfor (int i = 0; i < funLocalVariables.size(); i++) {\n\t localVariableCodeGen += funLocalVariables.get(i).codeGen();\n\t popLocalVariable += VMCommands.POP + \"\\n\";\n\t}\n\n\tString code = labelFun + \" :\\n\" +\n\t// Preparo parte bassa dell'activation Record\n\n\t\t// Il registro FP punterà al nuovo Activation Record\n\t\tVMCommands.CFP + \"\\n\"\n\n\t\t// PUSH dei dati Locali\n\t\t+ localVariableCodeGen +\n\n\t\t// PUSH return address del chiamante\n\t\tVMCommands.LRA + \"\\n\"\n\n\t\t// Corpo della funzione\n\t\t+ funBody.codeGen() +\n\n\t\t// POP RV e salvo nel registro\n\t\tVMCommands.SRV + \"\\n\" +\n\n\t\t// POP RA e salvo nel registro\n\t\tVMCommands.SRA + \"\\n\" +\n\n\t\t// Rimuovo variabili locali\n\t\tpopLocalVariable +\n\t\t// Rimuovo Access Link\n\t\tVMCommands.POP + \"\\n\" +\n\t\t// Rimuovo Pametri\n\t\tpopParSequence +\n\n\t\t// Ripristino il Registro FP che punterà all'Activation Record\n\t\t// del chiamante\n\t\tVMCommands.SFP + \"\\n\" +\n\n\t\t// PUSH valore di ritorno\n\t\tVMCommands.LRV + \"\\n\" +\n\t\t// PUSH indirizzo di ritorno\n\t\tVMCommands.LRA + \"\\n\" +\n\n\t\t// Salto al Chiamante\n\t\tVMCommands.JS + \"\\n\";\n\n\tMiniFunLib.addFunctionCode(code);\n\n\treturn VMCommands.PUSH + \" \" + labelFun + \"\\n\";\n }", "void setFunctionArray(org.globus.swift.language.Function[] functionArray);", "class_1034 method_112(ahb var1, String var2, int var3, int var4, int var5);", "void mo54408a(int i, int i2, int i3, int i4);", "public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}", "public UpdateFunctionCodeRequest(UpdateFunctionCodeRequest source) {\n if (source.FunctionName != null) {\n this.FunctionName = new String(source.FunctionName);\n }\n if (source.Handler != null) {\n this.Handler = new String(source.Handler);\n }\n if (source.CosBucketName != null) {\n this.CosBucketName = new String(source.CosBucketName);\n }\n if (source.CosObjectName != null) {\n this.CosObjectName = new String(source.CosObjectName);\n }\n if (source.ZipFile != null) {\n this.ZipFile = new String(source.ZipFile);\n }\n if (source.Namespace != null) {\n this.Namespace = new String(source.Namespace);\n }\n if (source.CosBucketRegion != null) {\n this.CosBucketRegion = new String(source.CosBucketRegion);\n }\n if (source.InstallDependency != null) {\n this.InstallDependency = new String(source.InstallDependency);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.Publish != null) {\n this.Publish = new String(source.Publish);\n }\n if (source.Code != null) {\n this.Code = new Code(source.Code);\n }\n if (source.CodeSource != null) {\n this.CodeSource = new String(source.CodeSource);\n }\n }", "public interface VariableExpander {\n /**\n * Return the input string with any variables replaced by their\n * corresponding value. If there are no variables in the string,\n * then the input parameter is returned unaltered.\n */\n public String expand(String param);\n }", "void mo4827a(Context context, C0152fo foVar);", "@Override\r\n\tpublic void visit(FunctionDeclaration functionDeclaration) {\n\r\n\t}", "void mo3504a(C0505cw cwVar, Map<String, String> map);", "public CALL(Exp f, ExpList a) {func=f; args=a;}", "public int getFunctionType() {\n/* 60 */ return 4;\n/* */ }", "private void updateFunctionArgumentNameMap(List<CQLFunctionArgument> argumentList) {\n\t\tfunctionArgNameMap.clear();\n\t\tif (argumentList != null) {\n\t\t\tfor (CQLFunctionArgument argument : argumentList) {\n\t\t\t\tfunctionArgNameMap.put(argument.getArgumentName().toLowerCase(), argument);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public interface C1656t {\n /* renamed from: a */\n void mo7350a();\n\n /* renamed from: a */\n void mo7351a(C1655s sVar);\n\n /* renamed from: a */\n void mo7352a(C1655s sVar, AdError adError);\n\n /* renamed from: b */\n void mo7353b();\n\n /* renamed from: b */\n void mo7354b(C1655s sVar);\n\n /* renamed from: c */\n void mo7355c(C1655s sVar);\n\n /* renamed from: d */\n void mo7356d(C1655s sVar);\n\n /* renamed from: e */\n void mo7357e(C1655s sVar);\n\n /* renamed from: f */\n void mo7358f(C1655s sVar);\n}", "private void addFuncArgument(ST template, String reg, String id, String argtype) {\n ST alloca = this.group.getInstanceOf(\"localdeclare\");\n alloca.add(\"reg\", reg);\n alloca.add(\"type\", argtype);\n template.add(\"allocaargs\", alloca.render() + \"\\n\");\n\n ST store = this.group.getInstanceOf(\"store\");\n store.add(\"type\", argtype);\n store.add(\"reg\", id);\n store.add(\"where\", reg);\n template.add(\"storeargs\", store.render() + \"\\n\");\n }", "public FunctionVariable (Object names[])\n {\n super(names);\n }", "void mo4829a(C0158fu fuVar);", "void method_114(int var1, int var2);", "private VariableMap getParamMappingAsVariableMap() {\n paramValueEncodings.put(fileNameToIndex.keySet().toString(), \" FileNames\");\n paramValueEncodings.put(functionNameToIndex.keySet().toString(), \" FunctionNames\");\n paramValueEncodings.put(typeToIndex.keySet().toString(), \" Types\");\n\n VariableMap preInversedMap = new VariableMap(paramValueEncodings);\n ImmutableMap<String, String> inversedMap = preInversedMap.getNewNameToOriginalNameMap();\n return new VariableMap(inversedMap);\n }", "@Override\r\n\tpublic void func01() {\n\t\t\r\n\t}", "@Override\r\n public MachineFunction getFunction (QualifiedName functionName) {\r\n MachineFunction mf = super.getFunction(functionName);\r\n \r\n // Check to see if the function is a lifted let variable function.\r\n if (mf == null && functionName.getModuleName().equals(getName())) {\r\n mf = liftedFunctionMap.get(functionName.getUnqualifiedName());\r\n }\r\n\r\n return mf;\r\n }", "String getInizializedFunctionName();", "public interface C2541a {\n /* renamed from: O */\n boolean mo6498O(C41531v c41531v);\n\n /* renamed from: P */\n boolean mo6499P(C41531v c41531v);\n\n /* renamed from: a */\n void mo6500a(int i, int i2, Object obj, boolean z);\n\n /* renamed from: a */\n void mo6501a(C41531v c41531v, View view, Object obj, int i);\n\n /* renamed from: a */\n boolean mo6502a(C41531v c41531v, Object obj);\n\n /* renamed from: b */\n View mo6503b(RecyclerView recyclerView, C41531v c41531v);\n\n /* renamed from: by */\n void mo6504by(Object obj);\n\n /* renamed from: cu */\n void mo6505cu(View view);\n}", "public boolean addFunction(Accessibility pPAccess, SubRoutine pExec, MoreData pMoreData);", "private Mask$MaskMode() {\n void var2_-1;\n void var1_-1;\n }", "String getFunctionName();", "@Converted(kind = Converted.Kind.MANUAL_SEMANTIC,\n source = \"${LLVM_SRC}/llvm/lib/IR/Module.cpp\", line = 154,\n FQN=\"llvm::Module::getOrInsertFunction\", NM=\"_ZN4llvm6Module19getOrInsertFunctionENS_9StringRefENS_12AttributeSetEPNS_4TypeEz\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/Module.cpp -nm=_ZN4llvm6Module19getOrInsertFunctionENS_9StringRefENS_12AttributeSetEPNS_4TypeEz\")\n //</editor-fold>\n public Constant /*P*/ getOrInsertFunction(StringRef Name, \n AttributeSet AttributeList, \n Type /*P*/ RetTy, Type ... $VarArg)/* __attribute__((sentinel(0, 0)))*/ {\n std.vector<Type /*P*/ > ArgTys = null;\n try {\n // Build the list of argument types...\n ArgTys/*J*/= new std.vector<Type /*P*/ >((Type /*P*/ )null);\n if (false) {\n// char$ptr/*char P*/ Args = create_char$ptr();\n// __builtin_va_start(Args, RetTy);\n//\n// {\n// Type /*P*/ ArgTy;\n// while (((/*P*/ ArgTy = __builtin_va_arg(Args, Type /*P*/ .class)) != null)) {\n// ArgTys.push_back_T$C$R(ArgTy);\n// }\n// }\n// __builtin_va_end(Args);\n } else {\n // JAVA: \n if ($VarArg != null) {\n for (Type ArgTy : $VarArg) {\n if (ArgTy != null) {\n ArgTys.push_back_T$C$R(ArgTy);\n }\n }\n } \n }\n \n // Build the function type and chain to the other getOrInsertFunction...\n return getOrInsertFunction(new StringRef(Name), \n FunctionType.get(RetTy, new ArrayRef<Type /*P*/ >(ArgTys, true), false), \n new AttributeSet(AttributeList));\n } finally {\n if (ArgTys != null) { ArgTys.$destroy(); }\n }\n }", "private static INaviFunction prepareFunctionInlining(final JFrame parent,\n final INaviCodeNode node, final INaviInstruction instruction, final INaviFunction function,\n final IViewContainer viewContainer) {\n Preconditions.checkNotNull(parent, \"IE00825: Parent argument can not be null\");\n Preconditions.checkNotNull(viewContainer, \"IE00915: View container argument can not be null\");\n Preconditions.checkNotNull(node, \"IE00916: Node argument can't be null\");\n Preconditions.checkNotNull(instruction, \"IE01153: Instruction argument can't be null\");\n Preconditions.checkNotNull(function, \"IE01173: Function argument can't be null\");\n\n final int forwarderModuleId = function.getForwardedFunctionModuleId();\n final IAddress forwarderAddress = function.getForwardedFunctionAddress();\n\n return getFunctionToInline(parent, viewContainer, function, forwarderModuleId, forwarderAddress);\n }", "@Override\n public void visitFunction(Function function) {\n }", "Rule Function() {\n // Push 1 FunctionNode onto the value stack\n StringVar functionName = new StringVar(\"\");\n return Sequence(\n Optional(\"oneway \"),\n FunctionType(),\n Identifier(),\n actions.pop(),\n ACTION(functionName.set(match())),\n \"( \",\n ZeroOrMore(Field()),\n \") \",\n Optional(Throws()),\n Optional(ListSeparator()),\n push(new IdentifierNode(functionName.get())),\n actions.pushFunctionNode());\n }", "public void func_70305_f() {}", "@Override\r\n\tpublic void transform(CtExecutable method) {\n reset();\r\n \r\n // Get setup for renaming\r\n setDefs(getChildrenOfType(method, CtLocalVariable.class));\r\n setSubtokens(topTargetSubtokens);\r\n \r\n // Select some percentage of things to rename\r\n takePercentage(RENAME_PERCENT);\r\n\r\n // Build new names and apply them\r\n applyRenaming(method, false, generateRenaming(\r\n method, SHUFFLE_MODE, NAME_MIN_LENGTH, NAME_MAX_LENGTH\r\n ));\r\n\t}", "public interface IFunction {\n\n @Nonnull\n String name();\n\n String process(@Nonnull final Map<String, String> args, @Nonnull final Context context);\n\n public boolean isApplicable(@Nonnull final String functionName,\n @Nonnull final Set<String> keys,\n @Nonnull final Collection<String> values,\n @Nonnull final String raw);\n}", "private void encodeFunctionDefinition(Encoder encoder, FunctionDefinition type)\n\t\t\tthrows IOException {\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencodeNameIdAttributes(encoder, type);\n\t\tencoder.writeString(ATTRIB_METATYPE, \"code\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, 1);\t\t// Force size of 1\n\t\tCompilerSpec cspec = program.getCompilerSpec();\n\t\tFunctionPrototype fproto = new FunctionPrototype(type, cspec, voidInputIsVarargs);\n\t\tfproto.encodePrototype(encoder, this);\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}", "Function createFunction();", "private void copyParameters(Code32 code, SSAValue[] opds) {\r\n//\t\tboolean dbg = true;\r\n\t\t// information about the src registers for parameters of a call to a method \r\n\t\tint[] srcGPR = new int[maxNofParam];\t\r\n\t\tint[] srcGPRcount = new int[maxNofParam];\r\n\t\tint[] srcEXTR = new int[maxNofParam];\r\n\t\tboolean[] srcEXTRtype = new boolean[maxNofParam];\r\n\t\tint[] srcEXTRcount = new int[maxNofParam];\r\n\t\tint[] slotGPR = new int[maxNofParam];\r\n\t\tint[] slotEXTR = new int[maxNofParam];\r\n\r\n\t\tint indexGPR = 0, indexEXTR = 0;\r\n\t\tfor (int k = 0; k < maxNofParam; k++) {\r\n\t\t\tsrcGPR[k] = -1; srcGPRcount[k] = 0; srcEXTR[k] = -1; srcEXTRtype[k] = false; srcEXTRcount[k] = 0; slotGPR[k] = -1; slotEXTR[k] = -1;\r\n\t\t}\r\n\r\n\t\t// get info about in which register parameters are located\r\n\t\t// parameters which go onto the stack are treated equally, their stack slot is noted\r\n\t\tfor (int k = 0, kGPR = 0, kEXTR = 0; k < opds.length; k++) {\r\n\t\t\tint type = opds[k].type & ~(1<<ssaTaFitIntoInt);\r\n\t\t\tif (type == tLong) {\r\n\t\t\t\tsrcGPR[kGPR + paramStartGPR] = opds[k].regLong;\r\n\t\t\t\tsrcGPR[kGPR + 1 + paramStartGPR] = opds[k].reg;\r\n\t\t\t\tif (kGPR > paramEndGPR - paramStartGPR) {slotGPR[kGPR] = indexGPR; indexGPR++;}\r\n\t\t\t\tkGPR++;\r\n\t\t\t\tif (kGPR > paramEndGPR - paramStartGPR) {slotGPR[kGPR] = indexGPR; indexGPR++;}\r\n\t\t\t\tkGPR++;\r\n\t\t\t} else if (type == tFloat || type == tDouble) {\r\n\t\t\t\tsrcEXTR[kEXTR + paramStartEXTR] = opds[k].reg;\r\n\t\t\t\tsrcEXTRtype[kEXTR + paramStartEXTR] = type == tFloat;\r\n\t\t\t\tif (kEXTR > paramEndEXTR - paramStartEXTR) {slotEXTR[kEXTR + paramStartEXTR] = indexEXTR; indexEXTR += 2;}\r\n\t\t\t\tkEXTR++;\r\n\t\t\t} else {\r\n\t\t\t\tsrcGPR[kGPR + paramStartGPR] = opds[k].reg;\r\n\t\t\t\tif (kGPR > paramEndGPR - paramStartGPR) {slotGPR[kGPR] = indexGPR; indexGPR++;}\r\n\t\t\t\tkGPR++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dbg) {\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPR = \");\r\n\t\t\tfor (int k = paramStartGPR; srcGPR[k] != -1; k++) StdStreams.vrb.print(srcGPR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPRcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcGPRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTR = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRtype = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTRtype[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRDcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcEXTRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tslotGPR = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(slotGPR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tslotEXTR = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(slotEXTR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t}\r\n\r\n\t\t// count register usage\r\n\t\tint i = paramStartGPR;\r\n\t\twhile (srcGPR[i] != -1) {\r\n\t\t\tif (srcGPR[i] <= topGPR) srcGPRcount[srcGPR[i]]++;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\ti = paramStartEXTR;\r\n\t\twhile (srcEXTR[i] != -1) {\r\n\t\t\tif (srcEXTR[i] <= topEXTR) {\r\n\t\t\t\tif (srcEXTRtype[i]) srcEXTRcount[srcEXTR[i]/2]++;\r\n\t\t\t\telse srcEXTRcount[srcEXTR[i]]++;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tif (dbg) {\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPR = \");\r\n\t\t\tfor (int k = paramStartGPR; srcGPR[k] != -1; k++) StdStreams.vrb.print(srcGPR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPRcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcGPRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTR = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRtype = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTRtype[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRDcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcEXTRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t}\r\n\t\t\r\n\t\t// handle move to itself\r\n\t\ti = paramStartGPR;\r\n\t\twhile (srcGPR[i] != -1) {\r\n\t\t\tif (srcGPR[i] == i) srcGPRcount[i]--;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\ti = paramStartEXTR;\r\n\t\twhile (srcEXTR[i] != -1) {\r\n\t\t\tif (srcEXTRtype[i]) {\r\n\t\t\t\tif (srcEXTR[i] / 2 == i) srcEXTRcount[i]--;\r\n\t\t\t} else {\r\n\t\t\t\tif (srcEXTR[i] == i) srcEXTRcount[i]--;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tif (dbg) {\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPR = \");\r\n\t\t\tfor (int k = paramStartGPR; srcGPR[k] != -1; k++) StdStreams.vrb.print(srcGPR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPRcount = \");\r\n\t\t\tfor (int n = 0; n < maxNofParam; n++) StdStreams.vrb.print(srcGPRcount[n] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTR = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRtype = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTRtype[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRDcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcEXTRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t}\r\n\r\n\t\t// move registers \r\n\t\tboolean done = false;\r\n\t\twhile (!done) {\r\n\t\t\ti = paramStartGPR; done = true;\r\n\t\t\twhile (srcGPR[i] != -1) {\r\n\t\t\t\tif (i > paramEndGPR) {\t// copy to stack\r\n\t\t\t\t\tif (srcGPRcount[i] == 0) { // check if not done yet\r\n\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tGPR: parameter \" + (i-paramStartGPR) + \" from register R\" + srcGPR[i] + \" to stack slot \" + slotGPR[i]);\r\n\t\t\t\t\t\tif (srcGPR[i] >= 0x100) {\t// copy from stack slot to stack (into parameter area)\r\n\t\t\t\t\t\t\tcreateLSWordImm(code, armLdr, condAlways, scratchReg, stackPtr, code.localVarOffset + 4 * (srcGPR[i] - 0x100), 1, 1, 0);\r\n\t\t\t\t\t\t\tcreateLSWordImm(code, armStr, condAlways, scratchReg, stackPtr, paramOffset + slotGPR[i]*4, 1, 1, 0);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcreateLSWordImm(code, armStr, condAlways, srcGPR[i], stackPtr, paramOffset + slotGPR[i]*4, 1, 1, 0);\r\n\t\t\t\t\t\t\tsrcGPRcount[srcGPR[i]]--; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsrcGPRcount[i]--; \r\n\t\t\t\t\t\tdone = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\t// copy to register\r\n\t\t\t\t\tif (srcGPRcount[i] == 0) { // check if register no longer used for parameter\r\n\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tGPR: parameter \" + (i-paramStartGPR) + \" from register R\" + srcGPR[i] + \" to R\" + i);\r\n\t\t\t\t\t\tif (srcGPR[i] >= 0x100) {\t// copy from stack\r\n\t\t\t\t\t\t\tcreateLSWordImm(code, armLdr, condAlways, i, stackPtr, code.localVarOffset + 4 * (srcGPR[i] - 0x100), 1, 1, 0);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcreateDataProcMovReg(code, armMov, condAlways, i, srcGPR[i], noShift, 0);\r\n\t\t\t\t\t\t\tsrcGPRcount[srcGPR[i]]--; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsrcGPRcount[i]--; \r\n\t\t\t\t\t\tdone = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ti++; \r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdone = false;\r\n\t\twhile (!done) {\r\n\t\t\ti = paramStartEXTR; done = true;\r\n\t\t\twhile (srcEXTR[i] != -1) {\r\n\t\t\t\tif (i > paramEndEXTR) {\t// copy to stack\r\n\t\t\t\t\tif (srcEXTRtype[i]) {\t// floats\r\n\t\t\t\t\t\tif (srcEXTRcount[i] == 0) { // check if not done yet\r\n\t\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tEXTR: parameter \" + (i-paramStartEXTR) + \" from register S\" + srcEXTR[i] + \" to stack slot \" + (indexGPR + slotEXTR[i]));\r\n\t\t\t\t\t\t\tif (srcEXTR[i] >= 0x100) {\t// copy from stack slot to stack (into parameter area)\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVldr, condAlways, scratchRegEXTR0, stackPtr, code.localVarOffset + 4 * (srcEXTR[i] - 0x100), true);\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVstr, condAlways, scratchRegEXTR0, stackPtr, paramOffset + (slotEXTR[i]+indexGPR)*4, true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVstr, condAlways, srcEXTR[i], stackPtr, paramOffset + (slotEXTR[i]+indexGPR)*4, true);\r\n\t\t\t\t\t\t\t\tsrcEXTRcount[srcEXTR[i]/2]--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsrcEXTRcount[i]--; \r\n\t\t\t\t\t\t\tdone = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else { // doubles\r\n\t\t\t\t\t\tif (srcEXTRcount[i] == 0) { // check if not done yet\r\n\t\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tEXTR: parameter \" + (i-paramStartEXTR) + \" from register D\" + srcEXTR[i] + \" to stack slot \" + (indexGPR + slotEXTR[i]));\r\n\t\t\t\t\t\t\tif (srcEXTR[i] >= 0x100) {\t// copy from stack slot to stack (into parameter area)\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVldr, condAlways, scratchRegEXTR0, stackPtr, code.localVarOffset + 4 * (srcEXTR[i] - 0x100), false);\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVstr, condAlways, scratchRegEXTR0, stackPtr, paramOffset + (slotEXTR[i]+indexGPR)*4, false);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVstr, condAlways, srcEXTR[i], stackPtr, paramOffset + (slotEXTR[i]+indexGPR)*4, false);\r\n\t\t\t\t\t\t\t\tsrcEXTRcount[srcEXTR[i]]--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsrcEXTRcount[i]--; \r\n\t\t\t\t\t\t\tdone = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\t// copy to register\r\n\t\t\t\t\tif (srcEXTRtype[i]) {\t// floats\r\n\t\t\t\t\t\tif (srcEXTRcount[i] == 0) { // check if register no longer used for parameter\r\n\t\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tEXTR: parameter \" + (i-paramStartEXTR) + \" from register S\" + srcEXTR[i] + \" to S\" + (i*2));\r\n\t\t\t\t\t\t\tif (srcEXTR[i] >= 0x100) {\t// copy from stack\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVldr, condAlways, i, stackPtr, code.localVarOffset + 4 * (srcEXTR[i] - 0x100), true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcreateFPdataProc(code, armVmov, condAlways, i*2, 0, srcEXTR[i], true);\r\n\t\t\t\t\t\t\t\tsrcEXTRcount[srcEXTR[i]/2]--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsrcEXTRcount[i]--; \r\n\t\t\t\t\t\t\tdone = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else { // doubles\r\n\t\t\t\t\t\tif (srcEXTRcount[i] == 0) { // check if register no longer used for parameter\r\n\t\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tEXTR: parameter \" + (i-paramStartEXTR) + \" from register D\" + srcEXTR[i] + \" to D\" + i);\r\n\t\t\t\t\t\t\tif (srcEXTR[i] >= 0x100) {\t// copy from stack\r\n\t\t\t\t\t\t\t\tcreateLSExtReg(code, armVldr, condAlways, i, stackPtr, code.localVarOffset + 4 * (srcEXTR[i] - 0x100), false);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcreateFPdataProc(code, armVmov, condAlways, i, 0, srcEXTR[i], false);\r\n\t\t\t\t\t\t\t\tsrcEXTRcount[srcEXTR[i]]--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsrcEXTRcount[i]--; \r\n\t\t\t\t\t\t\tdone = false;\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\ti++; \r\n\t\t\t}\r\n\t\t}\r\n\t\tif (dbg) {\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPR = \");\r\n\t\t\tfor (int k = paramStartGPR; srcGPR[k] != -1; k++) StdStreams.vrb.print(srcGPR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcGPRcount = \");\r\n\t\t\tfor (int n = 0; n < maxNofParam; n++) StdStreams.vrb.print(srcGPRcount[n] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTR = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTR[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRtype = \");\r\n\t\t\tfor (int k = paramStartEXTR; srcEXTR[k] != -1; k++) StdStreams.vrb.print(srcEXTRtype[k] + \",\"); \r\n\t\t\tStdStreams.vrb.print(\"\\tsrcEXTRDcount = \");\r\n\t\t\tfor (int k = 0; k < maxNofParam; k++) StdStreams.vrb.print(srcEXTRcount[k] + \",\"); \r\n\t\t\tStdStreams.vrb.println();\r\n\t\t}\r\n\r\n\t\t// resolve cycles\r\n\t\tif (dbg) StdStreams.vrb.println(\"\\tresolve cycles\");\r\n\t\tdone = false;\r\n\t\twhile (!done) {\r\n\t\t\ti = paramStartGPR; done = true;\r\n\t\t\twhile (srcGPR[i] != -1) {\r\n\t\t\t\tint src = -1;\r\n\t\t\t\tif (srcGPRcount[i] == 1) {\r\n\t\t\t\t\tsrc = i;\r\n\t\t\t\t\tcreateDataProcMovReg(code, armMov, condAlways, scratchReg, srcGPR[i], noShift, 0);\r\n\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tGPR: from register \" + srcGPR[i] + \" to \" + scratchReg);\r\n\t\t\t\t\tsrcGPRcount[srcGPR[i]]--;\r\n\t\t\t\t\tdone = false;\r\n\t\t\t\t}\r\n\t\t\t\tboolean done1 = false;\r\n\t\t\t\twhile (!done1) {\r\n\t\t\t\t\tint k = paramStartGPR; done1 = true;\r\n\t\t\t\t\twhile (srcGPR[k] != -1) {\r\n\t\t\t\t\t\tif (srcGPRcount[k] == 0 && k != src) {\r\n\t\t\t\t\t\t\tcreateDataProcMovReg(code, armMov, condAlways, k, srcGPR[k], noShift, 0);\r\n\t\t\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tGPR: from register \" + srcGPR[k] + \" to \" + k);\r\n\t\t\t\t\t\t\tsrcGPRcount[k]--; srcGPRcount[srcGPR[k]]--; \r\n\t\t\t\t\t\t\tdone1 = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tk++; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (src != -1) {\r\n\t\t\t\t\tcreateDataProcMovReg(code, armMov, condAlways, src, scratchReg, noShift, 0);\r\n\t\t\t\t\tif (dbg) StdStreams.vrb.println(\"\\tGPR: from register \" + scratchReg + \" to \" + src);\r\n\t\t\t\t\tsrcGPRcount[src]--;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdone = false;\r\n\t\twhile (!done) {\r\n\t\t\ti = paramStartEXTR; done = true;\r\n\t\t\twhile (srcEXTR[i] >= 0) {\r\n\t\t\t\tint src = -1;\r\n\t\t\t\tif (srcEXTRcount[i] == 1) {\r\n\t\t\t\t\tsrc = i;\r\n\t\t\t\t\tif (dbg) {\r\n\t\t\t\t\t\tStdStreams.vrb.println(\"prepare\");\r\n\t\t\t\t\t\tif (srcEXTRtype[i]) StdStreams.vrb.println(\"\\tEXTR: from register S\" + srcEXTR[i] + \" to S\" + scratchRegEXTR0);\r\n\t\t\t\t\t\telse StdStreams.vrb.println(\"\\tEXTR: from register D\" + srcEXTR[i] + \" to D\" + scratchRegEXTR0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcreateFPdataProc(code, armVmov, condAlways, scratchRegEXTR0, 0, srcEXTR[i], srcEXTRtype[i]);\r\n\t\t\t\t\tif (srcEXTRtype[i]) srcEXTRcount[srcEXTR[i]/2]--;\r\n\t\t\t\t\telse srcEXTRcount[srcEXTR[i]]--;\r\n\t\t\t\t\tdone = false;\r\n\t\t\t\t}\r\n\t\t\t\tboolean done1 = false;\r\n\t\t\t\twhile (!done1) {\r\n\t\t\t\t\tint k = paramStartEXTR; done1 = true;\r\n\t\t\t\t\twhile (srcEXTR[k] >= 0) {\r\n\t\t\t\t\t\tif (srcEXTRcount[k] == 0 && k != src) {\r\n\t\t\t\t\t\t\tif (dbg) {\r\n\t\t\t\t\t\t\t\tStdStreams.vrb.println(\"k=\"+k);\r\n\t\t\t\t\t\t\t\tif (srcEXTRtype[k]) StdStreams.vrb.println(\"\\tEXTR: from register S\" + srcEXTR[k] + \" to S\" + k*2);\r\n\t\t\t\t\t\t\t\telse StdStreams.vrb.println(\"\\tEXTR: from register D\" + srcEXTR[k] + \" to D\" + k);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (srcEXTRtype[k]) createFPdataProc(code, armVmov, condAlways, k*2, 0, srcEXTR[k], srcEXTRtype[k]);\r\n\t\t\t\t\t\t\telse createFPdataProc(code, armVmov, condAlways, k, 0, srcEXTR[k], srcEXTRtype[k]);\r\n\t\t\t\t\t\t\tsrcEXTRcount[k]--; \r\n\t\t\t\t\t\t\tif (srcEXTRtype[k]) srcEXTRcount[srcEXTR[k]/2]--;\r\n\t\t\t\t\t\t\telse srcEXTRcount[srcEXTR[k]]--;\r\n\t\t\t\t\t\t\tdone1 = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tk++; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (src >= 0) {\r\n\t\t\t\t\tif (dbg) {\r\n\t\t\t\t\t\tStdStreams.vrb.println(\"cleanup\");\r\n\t\t\t\t\t\tif (srcEXTRtype[i]) StdStreams.vrb.println(\"\\tEXTR: from register S\" + scratchRegEXTR0 + \" to S\" + src*2);\r\n\t\t\t\t\t\telse StdStreams.vrb.println(\"\\tEXTR: from register D\" + scratchRegEXTR0 + \" to D\" + src);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (srcEXTRtype[i]) createFPdataProc(code, armVmov, condAlways, src*2, 0, 0, srcEXTRtype[i]);\r\n\t\t\t\t\telse createFPdataProc(code, armVmov, condAlways, src, 0, 0, srcEXTRtype[i]);\r\n\t\t\t\t\tsrcEXTRcount[src]--;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (dbg) StdStreams.vrb.println(\"\\tdone\");\r\n\t}", "public interface C39683a {\n /* renamed from: a */\n int mo98966a(C29296g gVar);\n\n /* renamed from: b */\n int mo98967b(C29296g gVar);\n\n /* renamed from: c */\n float mo98968c(C29296g gVar);\n }", "public void defineFunction(String prefix, String function, Method method)\n/* */ throws NoSuchMethodException\n/* */ {\n/* 181 */ if ((prefix == null) || (function == null) || (method == null)) {\n/* 182 */ throw new NullPointerException(Util.message(this.context, \"elProcessor.defineFunctionNullParams\", new Object[0]));\n/* */ }\n/* */ \n/* */ \n/* 186 */ int modifiers = method.getModifiers();\n/* */ \n/* */ \n/* 189 */ if ((!Modifier.isStatic(modifiers)) || (!Modifier.isPublic(modifiers))) {\n/* 190 */ throw new NoSuchMethodException(Util.message(this.context, \"elProcessor.defineFunctionInvalidMethod\", new Object[] {method\n/* 191 */ .getName(), method\n/* 192 */ .getDeclaringClass().getName() }));\n/* */ }\n/* */ \n/* 195 */ this.manager.mapFunction(prefix, function, method);\n/* */ }", "@Override\n public String getCustomFunctionInvocation(String functionName, int argumentCount) {\n if (argumentCount == 0) {\n return \"OPERATOR('\" + functionName + \"',''\";\n }\n\n return \"OPERATOR('\" + functionName + \"',\";\n }", "public Function( String name, Hex hex, String notes )\n {\n this.name = name;\n data = hex;\n this.notes = notes;\n }", "void setLevelOfFunction(int levelOfFunction) throws IllegalArgumentException;", "private static void addFuncionesName() {\n\n funcionesName = new ArrayList<String>();\n if (funciones == null) {\n addFunciones();\n }\n Iterator it = funciones.iterator();\n while (it.hasNext()) {\n funcionesName.add(((GlobalSimilarityNode) it.next()).getName());\n }\n }", "public void rewrite(LambdaExp lexp, Object formals, Object body,\n\t\t Translator tr, TemplateScope templateScopeRest)\n {\n lexp.setCallConvention(tr);\n rewriteFormals(lexp, formals, tr, templateScopeRest);\n if (body instanceof PairWithPosition)\n lexp.setFile(((PairWithPosition) body).getFileName());\n body = rewriteAttrs(lexp, body, tr);\n rewriteBody(lexp, body, tr);\n }", "public void setFunctionName(String functionName) {\r\n\t\tthis.functionName = functionName;\r\n\t}", "public interface C4740t {\n /* renamed from: a */\n void mo25261a(Context context);\n\n /* renamed from: a */\n boolean mo25262a(int i);\n\n /* renamed from: a */\n boolean mo25263a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, C4619b bVar, boolean z3);\n\n /* renamed from: b */\n byte mo25264b(int i);\n\n /* renamed from: c */\n boolean mo25265c();\n\n /* renamed from: c */\n boolean mo25266c(int i);\n}" ]
[ "0.5825593", "0.5701542", "0.5676425", "0.56076324", "0.55884606", "0.52778745", "0.52621704", "0.5233046", "0.5181671", "0.5149665", "0.51434565", "0.51098204", "0.51050705", "0.5057203", "0.50512815", "0.5033271", "0.50310683", "0.5029557", "0.50050527", "0.49976957", "0.4989196", "0.4983044", "0.49754745", "0.49745813", "0.49544674", "0.49469227", "0.49310273", "0.49167636", "0.49030706", "0.48780483", "0.48524913", "0.48479477", "0.48170504", "0.48157835", "0.48142898", "0.47898844", "0.47744033", "0.4752791", "0.47326806", "0.47239622", "0.4703732", "0.4693748", "0.46904898", "0.4689022", "0.46843383", "0.46836445", "0.46806005", "0.46779", "0.46744806", "0.46555856", "0.46391106", "0.4631425", "0.4623504", "0.46180463", "0.46180463", "0.46142197", "0.46091968", "0.46084097", "0.46065643", "0.45951647", "0.45946273", "0.4592506", "0.45899817", "0.4588259", "0.4588119", "0.4586427", "0.45820445", "0.4576849", "0.45720294", "0.45702612", "0.45668408", "0.45646128", "0.45635074", "0.45592922", "0.45569322", "0.45503533", "0.4550276", "0.4547331", "0.45368594", "0.4535771", "0.45355436", "0.452997", "0.45287767", "0.45279", "0.452765", "0.4527256", "0.45245892", "0.45229778", "0.45210522", "0.45185298", "0.45174226", "0.45146158", "0.45086694", "0.45073596", "0.45069778", "0.4502742", "0.4498034", "0.4490035", "0.4489887", "0.44878724" ]
0.5967262
0
Returns the string index value for the last character of a word starting at location 'offset' in the passed string
public static int nextWordEndIndex(String line, int offset) { int word_end_index = offset; for(int i=offset; i<line.length(); i++) { if(line.charAt(i) != ' ') word_end_index++; else i = line.length(); } return word_end_index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int lastIndexOf(String str) {\n/* 590 */ return this.m_str.lastIndexOf(str);\n/* */ }", "public String findWord(int offset) {\r\n \t\tIRegion wordRegion = findWordRegion(offset);\r\n \t\tString word = null;\r\n \t\ttry {\r\n \t\t\tword = this.get(wordRegion.getOffset(), wordRegion.getLength());\r\n \t\t} catch (BadLocationException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t\treturn word;\r\n \t}", "public int lastIndexOf(int ch) {\n/* 464 */ return this.m_str.lastIndexOf(ch);\n/* */ }", "public final Word getWord(int offset) {\n return words[offset == 0 ? offset : offset - 1];\n }", "public int lastIndexOf(int ch, int fromIndex) {\n/* 492 */ return this.m_str.lastIndexOf(ch, fromIndex);\n/* */ }", "int getEndCharIndex();", "public int lastIndexOf(String str, int fromIndex) {\n/* 615 */ return this.m_str.lastIndexOf(str, fromIndex);\n/* */ }", "public int lastIndexOf(String str)\n\t{\n\t\tint indexOf = recursiveLastIndexOf(firstC, length, 0, -1, str);\n\t\treturn indexOf;\n\t}", "private static int findTheLastIndexInString(String s, char x){\n\n\t\tfor(int i=s.length()-1 ; i>=0; i--){\n\t\t\t\n\t\t\tif(s.charAt(i) == x)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}", "public abstract int lastIndexOf(E e);", "private int huntRight(String in, int offset) {\n char temp = 0;\n for(int i = offset + 1; i < in.length(); i++) {\n temp = in.charAt(i);\n if(temp == '\\n' || temp == '\\r')\n return i;\n }\n return in.length(); //eof counts. Note this is the length because we increased it by one!\n }", "public static void main(String[] args) {\n\t\tString s = \"String -Hello, my name is algoritmia - \";\n\t\t\n\t\tint pos1 = s.indexOf(\"Hello\");\n\t\tint pos2 = s.lastIndexOf(\"my\");\n\t\tSystem.out.println(pos1);\n\t\tSystem.out.println(pos2);\n\t}", "public int lastIndexOf(Object elem, int index);", "public static String getWord(JTextComponent c, int offset)\n throws BadLocationException {\n int[] blk = getIdentifierBlock(c, offset);\n Document doc = c.getDocument();\n return (blk != null) ? doc.getText(blk[0], blk[1] - blk[0]) : null;\n }", "static int lastIndexOf(char[] source, int sourceOffset, int sourceCount, String target, int fromIndex) {\n\t\treturn lastIndexOf(source, sourceOffset, sourceCount, target.value, 0, target.value.length, fromIndex);\n\t}", "public int lastIndexOf(Object elem);", "private Integer extract_offset_fasta(String str) {\n String value = \"0\"; // Default if no offset given.\n Matcher offsetMatcher = excoOFFSETPATTERN.matcher(str);\n if (offsetMatcher.find()) {\n value = offsetMatcher.group(1);\n //System.out.println(\"Offset extracted correctly\");\n //System.out.println(\"Offset value: \"+value);\n }\n\n m_translation_offset = Integer.parseInt(value);\n\n return m_translation_offset;\n }", "public static String getWord(BaseDocument doc, int offset)\n throws BadLocationException {\n int wordEnd = getWordEnd(doc, offset);\n if (wordEnd != -1) {\n return new String(doc.getChars(offset, wordEnd - offset), 0,\n wordEnd - offset);\n }\n return null;\n }", "public int lastCharacter() {\n return string.codePointAt(string.length() - 1);\n }", "private int findIndexOfLastWord (ArrayList<String> parameters) {\n int indexOfLastWord = -1;\n for (int i = 0; i < parameters.size(); i++) {\n if (parameters.get(i).contains(\".\")) {\n indexOfLastWord = i;\n } \n }\n return indexOfLastWord;\n }", "private int getIndexOfEnd(String document) {\n int indexOfEnd = -1;\n indexOfEnd = document.indexOf(\"</span> °C\");\n return indexOfEnd;\n }", "public static int lastIndexOf(char c, CharSequence seq) {\n int max = seq.length() - 1;\n for (int i = max; i >= 0; i--) {\n if (c == seq.charAt(i)) {\n return i;\n }\n }\n return -1;\n }", "public int getLineIndex(int offset) throws BadLocationException {\n if(offset < 0 || offset > text.length()) {\n throw new BadLocationException(\"The given offset \" + offset + \" is out of bounds <0, \" + text.length() + \">\" , offset); //NOI18N\n }\n \n// //linear\n// for(int i = 0; i < lines.length; i++) {\n// int loffset = lines[i];\n// if(loffset > offset) {\n// return i - 1;\n// }\n// }\n// return lines.length - 1; //last line\n// \n //logarithmical\n int index = Arrays.binarySearch(lines, offset);\n if(index >= 0) {\n //hit\n return index;\n } else {\n //missed (between)\n return -(index + 2);\n }\n \n }", "private int readCharBackward() {\r\n \t\tif (--index < 0 || \r\n \t\t\t\tdocumentContent == null ||\r\n \t\t\t\tdocumentContent.length() <= index)\r\n \t\t\treturn -1;\r\n \r\n \t\ttry {\r\n \t\t\treturn documentContent.charAt(index);\r\n \t\t} catch (StringIndexOutOfBoundsException e) {\r\n \t\t\treturn -1;\r\n \t\t}\r\n \t}", "public int getWordEnd (int wordIndex) {\n int wordCount = -1;\n int i = 0;\n int start = 0;\n int end = 0;\n while (i < tags.length() && wordCount < wordIndex) {\n start = indexOfNextWordStart (tags, i, slashToSeparate);\n end = indexOfNextSeparator (tags, start, true, true, slashToSeparate);\n wordCount++;\n if (wordCount < wordIndex) {\n i = end + 1;\n }\n }\n return end;\n }", "public static int lastIndexOf(StringBuffer buf, String find)\r\n {\r\n return lastIndexOf(buf, find, buf.length() - 1);\r\n }", "public static String getEnd(String town){\n\t\treturn Character.toString(town.charAt(1));\n\t}", "public char charAt(int charOffset);", "public int maxSentenceOffset();", "private static int getLastIndex(String[] source, int start, int howMany, int size) {\n for (int i = start; i < start + howMany; i++) {\n size += source[i].length() + 1; // +1 for omitted space\n }\n\n return size - 1; // -1 for last extra space\n }", "private int getOffsetLength(final String message, final ResourceText text,\n\t\t\tfinal int offset) {\n\t\tint length = 1;\n\t\tif (isUnunsedVariable(message) //\n\t\t\t\t|| isUnunsedMacro(message) //\n\t\t\t\t|| isLowerCase(message)) {\n\t\t\tfinal int start = message.indexOf(QUOTE_CHAR);\n\t\t\tfinal int end = message.indexOf(QUOTE_CHAR, start + 1);\n\t\t\tif (start != -1 && end != -1) {\n\t\t\t\tlength = end - start - 1;\n\t\t\t}\n\t\t} else if (isNoSpace(message)) {\n\t\t\tint end = offset;\n\t\t\tfinal byte[] content = text.getContent();\n\t\t\twhile (isWhitespace(content, end)) {\n\t\t\t\tend++;\n\t\t\t}\n\t\t\tlength = end - offset;\n\t\t} else if (isOneSpace(message) || isEndLineSpace(message)) {\n\t\t\tint end = offset + 1;\n\t\t\tfinal byte[] content = text.getContent();\n\t\t\twhile (isWhitespace(content, end)) {\n\t\t\t\tend++;\n\t\t\t}\n\t\t\tlength = end - offset;\n\t\t}\n\n\t\treturn Math.max(length, 1);\n\t}", "public static void main(String[] args) { \n\t\tString strOrig =\"Hello world,Hello Reader\";\n\t int lastIndex = strOrig.lastIndexOf(\"x\");\n\t \n\t if(lastIndex == - 1){\n\t System.out.println(\"Not found\");\n\t } else {\n\t System.out.println(\"Last occurrence of Hello is at index \"+ lastIndex);\n\t }\n\t\t\n\t}", "public int lastIndexOfObject(Object obj);", "public static String getWordLeftOfOffset(CharSequence text, int cursorOffset) {\n\t\treturn grabWord(text, cursorOffset - 1, false);\n\t}", "public static int getWordStart(JTextComponent c, int offset)\n throws BadLocationException {\n return getWordStart((BaseDocument)c.getDocument(), offset);\n }", "String getWordIn(String schar, String echar);", "public int getEndOffset() {\n return endOffset;\n }", "public int getIndex(double offset)\n {\n double length = 0;\n int index = 0;\n while (index < _totalPoints)\n {\n length += getUnitWidth(index);\n // At slice boundary, return the next index\n if (isEqual(length, offset, Ring.DELTA))\n {\n return (index + 1) % _totalPoints;\n }\n else if (length > offset)\n {\n return index;\n }\n index++;\n }\n return 0;\n }", "public static int lastIndexOf (TextFragment textFragment,\r\n \t\tString findWhat)\r\n \t{\r\n \t\tif (textFragment == null)\r\n \t\t\treturn -1;\r\n \t\tif (Util.isEmpty(findWhat))\r\n \t\t\treturn -1;\r\n \t\tif (Util.isEmpty(textFragment.getCodedText()))\r\n \t\t\treturn -1;\r\n \r\n \t\treturn (textFragment.getCodedText()).lastIndexOf(findWhat);\r\n \t}", "int locationOffset(Location location);", "private int advanceToLastComponentContainingOffset(int index, int offset) {\n\t\tDataTypeComponentDB dtc = components.get(index);\n\t\twhile (index < (components.size() - 1) && dtc.isBitFieldComponent()) {\n\t\t\tDataTypeComponentDB next = components.get(index + 1);\n\t\t\tif (!next.containsOffset(offset)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdtc = next;\n\t\t\t++index;\n\t\t}\n\t\treturn index;\n\t}", "public static void main(String[] args) {\n String name = \"Georgesa\";\n int charCount = name.length();\n int lastCharIndex = charCount - 1;\n\n\n // System.out.println( name.substring (0,2));\n // System.out.println( name.substring (2,4));\n // System.out.println( name.substring (4,6));\n //System.out.println( name.substring (6,8));\n\n\n }", "private int getEndNodeIndex(int validStartIndexOfStr, int len) {\n\t\treturn (validStartIndexOfStr + len - 2) / 2;\n\t}", "public int mo131899b(String str) {\n return super.lastIndexOf(str);\n }", "int lengthLastWord(String input) {\n int len = input.length();\n int lastLen = 0;\n int pastLen = 0;\n for (int index = 0;index < len;index++) {\n lastLen ++;\n if(input.charAt(index) == ' ') {\n pastLen = lastLen;\n lastLen = 0;\n \n }\n }\n \n return pastLen;\n \n}", "private int huntLeft(String in, int offset) {\n char temp = 0;\n for(int i = offset - 1; i >= 0; i--) {\n temp = in.charAt(i);\n if(temp == '\\n' || temp == '\\r')\n return i;\n }\n return 0; //eof counts\n }", "public int getWordOffset() {\n\t\treturn wordOffset;\n\t}", "char getChar(int offset) throws BadLocationException;", "public Integer getEndOffset() {\n return this.endOffset;\n }", "public IRegion findWordRegion(int offset) {\r\n \t\tint start = -2;\r\n \t\tint end = -1;\r\n \t\ttry {\r\n \t\t\tint pos = offset;\r\n \t\t\tchar c;\r\n \r\n \t\t\twhile (pos >= 0) {\r\n \t\t\t\tc = this.getChar(pos);\r\n \t\t\t\tif (!language().isValidIdentifierCharacter(c))\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t--pos;\r\n \t\t\t}\r\n \t\t\tstart = pos;\r\n \r\n \t\t\tpos = offset;\r\n \t\t\tint length = this.getLength();\r\n \r\n \t\t\twhile (pos < length) {\r\n \t\t\t\tc = this.getChar(pos);\r\n \t\t\t\tif (!language().isValidIdentifierCharacter(c))\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t++pos;\r\n \t\t\t}\r\n \t\t\tend = pos;\r\n \r\n \t\t} catch (BadLocationException x) {\r\n \t\t}\r\n \r\n \t\tif (start >= -1 && end > -1) {\r\n \t\t\tif (start == offset && end == offset) {\r\n \t\t\t\treturn new Region(offset, 0);\r\n \t\t\t}\r\n \t\t\telse if (start == offset) {\r\n \t\t\t\treturn new Region(start, end - start);\r\n \t\t\t}\r\n \t\t\telse {\r\n \t\t\t\treturn new Region(start + 1, end - start - 1);\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn null;\r\n \t}", "public int parseString(String string,\n int offset,\n int end)\n throws XMLParseException {\n return this.parseCharArray(string.toCharArray(), offset, end, 1);\n }", "public static void main(String[] args) {\n String s = \"zazb\";\n// String s = \"zbza\";\n String subStr = lastSubstring(s);\n System.out.println(subStr);\n }", "private int locate(String str, String substr, int pos) {\n if (substr.length() == 0) {\n if (pos <= (str.length() + 1)) {\n return pos;\n }\n else {\n return 0;\n }\n }\n int idx = StringUtils.indexOf(str, substr, pos - 1);\n if (idx == -1) {\n return 0;\n }\n return idx + 1;\n }", "@Test \r\n public void shouldFindOneWordAtTheEnd() {\r\n \r\n String inputWord = \"bxxxxxxxe\";\r\n String[] dictionary =\r\n new String[] {\"able\", \"be\", \"ale\", \"apple\", \"bale\", \"kangaroo\"};\r\n \r\n assertEquals(\"be\", wordSeeker.lookFor(inputWord, dictionary));\r\n }", "@Override\n\tpublic int getEndOffset() {\n\t\treturn 0;\n\t}", "protected final int indexFromOffset(final int offset) {\n\t\tassert isValidRange(offset) : \" offset=\" + offset;\n\t\treturn head + offset;\n\t}", "private int getLineNumber(@NonNull String contents, int offset) {\n String preContents = contents.substring(0, offset);\n String remContents = preContents.replaceAll(\"\\n\", \"\");\n return preContents.length() - remContents.length();\n }", "private static int codePointToStringIndex(String string, int index, int cpLength) {\n if ( index < 0 )\n return 0;\n\n return (index > cpLength)\n ? string.length()\n : string.offsetByCodePoints(0, index);\n }", "public int lastIndexOf(Object arg0) {\n\t\treturn 0;\n\t}", "public int find(String string) {\n\t\tif (string==null) {\n\t\t\treturn -1;\n\t\t}\n\t\tfor (int i=0;i!=m_stringOffsets.length;++i) {\n\t\t\tint offset=m_stringOffsets[i];\n\t\t\tint length=getShort(m_strings,offset);\n\t\t\tif (length!=string.length()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint j=0;\n\t\t\tfor (;j!=length;++j) {\n\t\t\t\toffset+=2;\n\t\t\t\tif (string.charAt(j)!=getShort(m_strings,offset)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (j==length) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "static int lastIndexOf(char[] source, int sourceOffset, int sourceCount, char[] target, int targetOffset, int targetCount, int fromIndex) {\n\t\t/*\n\t\t * Check arguments; return immediately where possible. For consistency, don't check for null str.\n\t\t */\n\t\tint rightIndex = sourceCount - targetCount;\n\t\tif (fromIndex < 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (fromIndex > rightIndex) {\n\t\t\tfromIndex = rightIndex;\n\t\t}\n\t\t/* Empty string always matches. */\n\t\tif (targetCount == 0) {\n\t\t\treturn fromIndex;\n\t\t}\n\n\t\tint strLastIndex = targetOffset + targetCount - 1;\n\t\tchar strLastChar = target[strLastIndex];\n\t\tint min = sourceOffset + targetCount - 1;\n\t\tint i = min + fromIndex;\n\n\t\tstartSearchForLastChar: while (true) {\n\t\t\twhile (i >= min && source[i] != strLastChar) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i < min) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tint j = i - 1;\n\t\t\tint start = j - (targetCount - 1);\n\t\t\tint k = strLastIndex - 1;\n\n\t\t\twhile (j > start) {\n\t\t\t\tif (source[j--] != target[k--]) {\n\t\t\t\t\ti--;\n\t\t\t\t\tcontinue startSearchForLastChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn start - sourceOffset + 1;\n\t\t}\n\t}", "public OptionalInt getEndOffset() {\n return endOffset >= 0 ? OptionalInt.of(endOffset) : OptionalInt.empty();\n }", "public static int getRowLastNonWhite(BaseDocument doc, int offset)\n throws BadLocationException {\n \n checkOffsetValid(doc, offset);\n\n Element lineElement = doc.getParagraphElement(offset);\n return getFirstNonWhiteBwd(doc,\n lineElement.getEndOffset() - 1,\n lineElement.getStartOffset()\n );\n }", "int indexOf(ASCIIString str, int fromIndex);", "public static int getLetterIndex(String word, byte startFrom) {\r\n int i, j;\r\n if (startFrom == head) // start checking from beginning\r\n {\r\n for (i = 0; i < word.length(); i++) {\r\n if (word.charAt(i) >= 'a' && word.charAt(i) <= 'z')\r\n return i;\r\n }\r\n return -1; // cannot found any letter in the string\r\n } else if (startFrom == tail) // start check from the ed\r\n {\r\n for (j = word.length() - 1; j >= 0; j--) {\r\n if (word.charAt(j) >= 'a' && word.charAt(j) <= 'z')\r\n return j;\r\n }\r\n return -1; // cannot found any letter in the string\r\n }\r\n return 0;\r\n }", "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n System.out.println(\"Enter the word:\");\n String word= scan.next();\n\n char lastChar=word.charAt(word.length()-1);\n System.out.println(lastChar);\n\n\n }", "public Entry getLastNodeOfSearch(String word, int i, Entry currNode){\n if(i == word.length() || currNode==null){\n return currNode;\n }\n\n char ch = word.charAt(i);\n return getLastNodeOfSearch(word, i+1, currNode.getChildNode(ch));\n }", "public void setEndOffset(int offset) {\n this.endOffset = offset;\n }", "private int lastIndexOfLowUpper(String text, String search, int pos) {\n int lower = text.lastIndexOf(search.toLowerCase(), pos);\n int upper = text.lastIndexOf(search.toUpperCase(), pos);\n if (lower == -1) {\n return upper;\n } else if (upper == -1) {\n return lower;\n }\n return Math.min(lower, upper);\n }", "int getCommentEndOffset(CharSequence commentText);", "protected final int getRawOffset(int paramInt, char paramChar) {\n/* 264 */ return (this.m_index_[paramInt + (paramChar >> 5)] << 2) + (paramChar & 0x1F);\n/* */ }", "String get(int offset, int length) throws BadLocationException;", "static int safeLastIndexOf(String src, String sub, int start, boolean caseSensitive) throws UnexpectedFormatException {\n if (caseSensitive) {\n int pos = src.lastIndexOf(sub, start);\n if (pos<0)\n throw new UnexpectedFormatException();\n return pos;\n } else {\n for (int pos=start; pos>=0; --pos) {\n boolean match = true;\n for (int i=0; i<sub.length(); ++i) {\n if (Character.toLowerCase(src.charAt(pos+i))!=Character.toLowerCase(sub.charAt(i))) {\n match = false;\n break;\n }\n }\n if (match)\n return pos;\n }\n throw new UnexpectedFormatException();\n }\n }", "Location offsetLocation(int offset);", "int getStartCharIndex();", "protected final int clueFromOffset(final int offset) {\n\t\tfinal int size = length();\n\t\tfinal int mark = this.mark;\n\t\tassert isValidRange(mark) : \" mark=\" + mark;\n\t\tassert isValidRange(offset) : \" offset=\" + offset;\n\t\tint clue = mark + offset;\n\t\tif (clue >= size) {\n\t\t\tclue -= size;\n\t\t}\n\t\tassert isValidRange(clue) : \" clue=\" + clue;\n\t\treturn clue;\n\t}", "public int getEndOffset() {\n return endPosition.getOffset();\n }", "public static void main(String[] args) {\n String Data=\"The generations of our family changing\";\nSystem.out.println(Data.indexOf(\"The\")); //Index ==== displays \"the\" position in the string\nSystem.out.println(Data.indexOf(\"family\"));\nSystem.out.println(Data.indexOf(\"Family\")); //case sensitive ====== for index thats the reason -1 is printing.\n\t}", "public int getEndOffset(int childViewIndex);", "public int parseString(String string,\n int offset)\n throws XMLParseException {\n return this.parseCharArray(string.toCharArray(), offset,\n string.length(), 1);\n }", "public static int indexOfOutOfString(String string, char find) {\r\n\t\tboolean inJavaString = false;\r\n\t\tint numBackSlashes = 0;\r\n\t\tfor (int i = 0; i < string.length(); i++) {\r\n\t\t\tchar cur = string.charAt(i);\r\n\t\t\tif (!inJavaString) {\r\n\t\t\t\tif (cur == find) {\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t\tif (cur == '\\\"') {\r\n\t\t\t\t\tinJavaString = true;\r\n\t\t\t\t\tnumBackSlashes = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (cur == '\\\\') {\r\n\t\t\t\t\tnumBackSlashes++;\r\n\t\t\t\t}\r\n\t\t\t\tif (cur == '\\\"' && numBackSlashes % 2 == 0) {\r\n\t\t\t\t\tinJavaString = false;\r\n\t\t\t\t\tif (cur == find) {\r\n\t\t\t\t\t\treturn i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "private int parseWord(Token token, char[] buffer, int offset, int type){\nfromStart:\n for(int i=offset; i<buffer.length; ++i){\n for(int x=0; x < characters[type].length; ++x){\n if(buffer[i] == characters[type][x]){\n token.identifier += buffer[i];\n continue fromStart;\n }\n }\n // If it gets here, the character currently parsed isn't of the same type \n return i;\n }\n // Found end of file\n return offset+buffer.length;\n }", "public int lastIndexOf(Object o) {\n\t\treturn getLastOccurrence(o).index;\n\t}", "static int findEndOfString(String sb) {\n/* */ int result;\n/* 216 */ for (result = sb.length(); result > 0 && \n/* 217 */ Character.isWhitespace(sb.charAt(result - 1)); result--);\n/* */ \n/* */ \n/* */ \n/* 221 */ return result;\n/* */ }", "String getFirstIndex();", "public List<Word> getWordsEndingAt(int end);", "private int getSpanEnd(int i,List<Span> spans) {\n return (i + 1 == spans.size() ? mText.length() : spans.get(i + 1).startIndex);\n }", "protected final int getLeadOffset(char paramChar) {\n/* 294 */ return getRawOffset(0, paramChar);\n/* */ }", "public static int indexOfNextWordStart (\n StringBuilder str, \n int fromIndex, \n boolean slashToSeparate) {\n int i = fromIndex;\n if (i < str.length() && \n (isLevelSeparator (str.charAt(i), slashToSeparate) \n || isTagSeparator (str.charAt(i)))) {\n i++;\n }\n while (i < str.length() && Character.isWhitespace (str.charAt(i))) {\n i++;\n }\n return i;\n }", "public static int getPosition(String word, int indicator) {\n ListIterator list_Iter = dict.get(indicator).listIterator(0);\n int result =0;\n while(list_Iter.hasNext()){\n\n String word_2 = list_Iter.next().toString();\n if (word.compareTo(word_2) < 0){\n return result;\n }\n result++;\n }\n return -1;\n }", "public static String getLastMatch(String str) {\n String[] ls= str.split(\" \\\\- \",2);\n\n /* Matcher matcher = match_numbers.matcher(str);\n if (matcher.find()) {\n return matcher.group(1);\n }*/\n return ls[ls.length-1];\n }", "@Test\n public void shouldReturnLastIndexOfFirstWhitespace(){\n Assert.assertThat(\"match any digits\",CharMatcher.DIGIT\n .lastIndexIn(\"123TT T4\"),is(7));\n }", "private int nextSuffix() {\r\n\t\t\tint unsignedByte = suffixes[index] & 0xFF;\r\n\r\n\t\t\tint suffix = unsignedByte + 1;\r\n\t\t\tsuffix += (256 * (offset));\r\n\r\n\t\t\tif (index < 255) {\r\n\t\t\t\tindex++;\r\n\t\t\t} else {\r\n\t\t\t\tindex = 0;\r\n\t\t\t\toffset++;\r\n\t\t\t}\r\n\t\t\treturn suffix;\r\n\t\t}", "public synchronized String getLastWord() {\n\t\treturn lastWord;\n\t}", "private static int labelEnd(String s) {\n\t\tint colonIndex = s.indexOf(\":\");\n\t\tint semicolonIndex = s.indexOf(\";\");\n\t\tif ((semicolonIndex == -1) || (colonIndex < semicolonIndex)) {\n\t\t\treturn colonIndex;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "private static String grabWord(CharSequence text, int cursorOffset, boolean expandWordBoundaryRight) {\n\t\tif(\ttext.length() == 0 || cursorOffset >= text.length()) return null;\n\n\t\twhile (cursorOffset > 0 && cursorOffset < text.length()-1\n\t\t\t\t&& !Character.isJavaIdentifierPart(text.charAt(cursorOffset))\n\t\t\t\t&& Character.isJavaIdentifierPart(text.charAt(cursorOffset - 1))\n\t\t\t\t) {\n\t\t\tcursorOffset--;\n\t\t}\n\n\t\tif( cursorOffset >= 0 && Character.isJavaIdentifierPart(text.charAt(cursorOffset)) ) {\n\t\t\tint start\t= cursorOffset;\n\t\t\tint end\t\t= cursorOffset;\n\n\n\t\t\twhile (start > 0 && Character.isJavaIdentifierPart(text.charAt(start - 1))) {\n\t\t\t\tstart--;\n\t\t\t}\n\n\t\t\tif( expandWordBoundaryRight ) {\n\t\t\t\t\t// Find ending of word by expanding boundary until first non-whitespace to the right\n\t\t\t\twhile (end < text.length() && !Character.isWhitespace(text.charAt(end))) {\n\t\t\t\t\tend++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn text.subSequence(start, end).toString();\n\t\t}\n\n\t\treturn null;\n\t}", "private int getOffset(final String message, final ResourceText text,\n\t\t\tfinal int line, final int column) {\n\t\tint offset = text.getOffset(line - 1) + column;\n\t\tif (isEndLineSpace(message)) {\n\t\t\tfinal byte[] content = text.getContent();\n\t\t\twhile (offset > 0 && isWhitespace(content, offset - 1)) {\n\t\t\t\toffset--;\n\t\t\t}\n\t\t} else if (isOneSpace(message)) {\n\t\t\tfinal byte[] content = text.getContent();\n\t\t\tif (isWhitespace(content, offset)) {\n\t\t\t\toffset++;\n\t\t\t}\n\t\t}\n\t\treturn offset;\n\t}", "public static String getLastWord(ArrayList<String> s) {\n int i = s.size();\n return s.get(i - 1);\n }", "public static String getIdentifierBefore(BaseDocument doc, int offset)\n throws BadLocationException {\n int wordStart = getWordStart(doc, offset);\n if (wordStart != -1) {\n String word = new String(doc.getChars(wordStart,\n offset - wordStart), 0, offset - wordStart);\n if (doc.getSyntaxSupport().isIdentifier(word)) {\n return word;\n }\n }\n return null;\n }", "public int getEnd() {\n switch(getType()) {\n case Insertion:\n case SNP:\n case InterDup:\n case TandemDup:\n case TransDup:\n return pos;\n default:\n return pos + maxLen() - 1;\n }\n }" ]
[ "0.6710235", "0.6622486", "0.6435917", "0.640514", "0.6367231", "0.6361095", "0.6358843", "0.62697047", "0.6268536", "0.6224099", "0.6130291", "0.60736966", "0.59317344", "0.59293926", "0.5922854", "0.58876944", "0.5840098", "0.579861", "0.57175875", "0.57003963", "0.56727105", "0.56475353", "0.56279665", "0.5613269", "0.56008923", "0.5594724", "0.5591761", "0.55646056", "0.54848826", "0.5478923", "0.5453404", "0.5441166", "0.54305255", "0.5426057", "0.54125625", "0.54076314", "0.5375019", "0.53687024", "0.53644824", "0.5345869", "0.5339322", "0.5333767", "0.5333467", "0.5322084", "0.5318101", "0.5311397", "0.5304928", "0.5294743", "0.52832603", "0.52806836", "0.5280048", "0.52799904", "0.52771944", "0.5274371", "0.5261453", "0.5259909", "0.5257238", "0.52536595", "0.52517676", "0.52499557", "0.5241937", "0.52348", "0.523153", "0.52225953", "0.5212008", "0.52118915", "0.52114785", "0.5204022", "0.51841086", "0.5180729", "0.5179151", "0.51778287", "0.51751864", "0.51724833", "0.5161414", "0.5142526", "0.514126", "0.51406884", "0.51404065", "0.51394486", "0.5112224", "0.5108267", "0.50706387", "0.50649893", "0.5054806", "0.50514597", "0.5044688", "0.5033172", "0.50296", "0.50242466", "0.50148505", "0.5011829", "0.50033647", "0.5000565", "0.49983522", "0.4990381", "0.4990331", "0.49855572", "0.49850866", "0.4979809" ]
0.75445235
0
Returns true if the passed string is a number
public boolean isNumber(String str) { return str.matches("-?\\d+(\\.\\d+)?"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n Integer d = Integer.parseInt(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "public boolean isNumeric(String str){\r\n\t Pattern pattern = Pattern.compile(\"[0-9]*\");\r\n\t return pattern.matcher(str).matches(); \r\n\t}", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "public static boolean isNumber(String string) {\n\n\t\ttry {\n\t\t\tLong.parseLong(string);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }", "public boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String strNum) {\r\n if (strNum == null) {\r\n return true;\r\n }\r\n try {\r\n Integer.parseInt(strNum);\r\n } catch (NumberFormatException nfe) {\r\n return true;\r\n }\r\n return false;\r\n }", "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isNumeric(String str) {\n try {\n Double.parseDouble(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }", "public boolean isNum(String x) {\n\t\tfor (int i = 0; i < x.length(); i++) {\n\t\t\tchar c = x.charAt(i);\n\t\t\tif ((c == '-' || c == '+') && x.length() > 1)\n\t\t\t\tcontinue;\n\t\t\tif ((int) c > 47 && (int) c < 58)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isNumeric(String input) {\n\t\ttry {\n\t\t\tInteger.parseInt(input);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\t// string is not numeric\n\t\t\treturn false;\n\t\t}\n\t}", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isNumeric(String cadena) {\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException nfe) {\r\n return false;\r\n }\r\n }", "private static boolean isNumeric(String str)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdouble d = Double.parseDouble(str);\n\t\t}\n\t\tcatch (NumberFormatException nfe)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isNum() \n\t{ \n\t try \n\t { \n\t int d = Integer.parseInt(numeric); \n\t } \n\t catch(NumberFormatException nfe) \n\t { \n\t return false; \n\t } \n\t return true; \n\t}", "public static boolean isNumeric(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }", "public static boolean isNumericString(String value) {\n\t try {\n\t\t if (Double.parseDouble(value) > 0) {\n\t\t return true;\n\t\t }\n\t } catch (NumberFormatException nfe) {\n\t return false;\n\t }\n\t return false;\n\t}", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public static boolean isNumeric(String str) {\n\t\ttry {\n\t\t\tInteger.parseInt(str.trim().substring(0, 1));\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumber(String str){\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "public static boolean isNumericRegex(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNumeric(String num) {\n\t\ttry {\n\t\t\tdouble d = Double.parseDouble(num);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isNumber(final String s) {\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif (!Character.isDigit(s.charAt(i))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "private boolean isNumeric(String s)\n {\n for (int i = 0; i < s.length(); ++i)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public boolean isNumber(String s)\r\n {\r\n if (s == null)\r\n {\r\n return false;\r\n }\r\n s = s.trim();\r\n ValidNumberStateMachine vnsm = new ValidNumberStateMachine(s);\r\n return vnsm.isValid();\r\n }", "public static boolean isNumber(String text)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInteger.parseInt(text);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean isNumeric(String str)\n {\n return str.chars().allMatch( Character::isDigit );\n }", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "public static boolean isNumber(String text) {\n try {\n Double.parseDouble(text);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public static boolean isNumber(String text) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(text);\r\n\t\t} catch(NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isNumber(String str){\n return str != null && numberPattern.matcher(str).matches();\n }", "public static boolean IsNumber(String par_Number) {\n\n java.util.regex.Pattern p = java.util.regex.Pattern.compile(\"^\\\\-?\\\\d*.?\\\\d+$\");\n java.util.regex.Matcher m = p.matcher(par_Number);\n\n return m.matches() || IsInteger(par_Number);\n }", "private static boolean isNumeric(String str) {\n // The regular expression can match all numbers, including negative numbers\n Pattern pattern = Pattern.compile(\"-?[0-9]+(\\\\.[0-9]+)?\");\n String bigStr;\n try {\n bigStr = new BigDecimal(str).toString();\n } catch (Exception e) {\n return false;\n }\n // matcher是全匹配\n Matcher isNum = pattern.matcher(bigStr);\n return isNum.matches();\n }", "public static final boolean isNumber(String str) {\n\t\treturn isNumber(str,true);\n\t}", "public static boolean isNumber(String s) \r\n{ \r\n for (int i = 0; i < s.length(); i++) \r\n if (Character.isDigit(s.charAt(i)) \r\n == false) \r\n return false; \r\n\r\n return true; \r\n}", "public boolean isNumber(String str)\r\n\t{\r\n\t\tfor(int i = 0; i < str.length(); i++)\r\n\t\t{\r\n\t\t\tif(!Character.isDigit(str.charAt(i)))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean numbersCheck(String num)\r\n\t{\r\n\t\treturn num.matches(\"[0-9]+\");\r\n\t}", "public static boolean isNumeric(String str) {\n if (isBlank(str)) {\n return false;\n }\n\n char[] charArray = str.toCharArray();\n\n for (char c : charArray) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n\n return true;\n }", "private boolean isNumber(final String number) {\n try {\n Integer.parseInt(number);\n return true;\n } catch (Exception e) {\n LOGGER.error(\"Not a number \" + number, e);\n return false;\n }\n }", "public static boolean isNumeric(final String input) {\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn false;\n\n\t\tfor (int i = 0; i < input.length(); i++)\n\t\t\tif (!Character.isDigit(input.charAt(i)))\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private boolean isNumber(String str) {\r\n int ASCII_0 = 48;\r\n int ASCII_9 = 57;\r\n if (str.equals(\"\")) {\r\n return false;\r\n }\r\n for (int i = 0; i < str.length(); i++) {\r\n int chr = str.charAt(i);\r\n if (chr < ASCII_0 || chr > ASCII_9) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static boolean isNumber(String s, int radix) {\n try {\n new BigDecimal(new BigInteger(s, radix));\n\n return true;\n } catch (Exception e) {\n }\n\n return false;\n }", "private boolean stringIsNumeric(String str) {\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tif(!Character.isDigit(c)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "public static boolean isNumeric(String aString) {\r\n if (aString == null) {\r\n return false;\r\n } else if (aString.isEmpty()) {\r\n return false;\r\n } else if (aString.indexOf(\".\") != aString.lastIndexOf(\".\")) {\r\n return false;\r\n } else {\r\n int counter = 0;\r\n for ( char c : aString.toCharArray()) {\r\n if ( Character.isDigit(c)) {\r\n counter++;\r\n }\r\n }\r\n return counter == aString.length();\r\n// if (counter == aString.length()) {\r\n// return true;\r\n// }\r\n// return false;\r\n }\r\n }", "protected boolean isNumeric(final String id) {\n\t\tfinal NumberFormat formatter = NumberFormat.getInstance();\n\t\tfinal ParsePosition pos = new ParsePosition(0);\n\t\tformatter.parse(id, pos);\n\t\treturn id.length() == pos.getIndex();\n\t}", "public static boolean isNumber(String input) {\n boolean hasDecimal = false;\n for (int i = 0; i < input.length(); i++) {\n char test = input.charAt(i);\n if (test == '-' && i == 0)\n continue; // Allow negative indicator.\n\n if (test == '.') {\n if (!hasDecimal) {\n hasDecimal = true;\n continue;\n } else {\n return false; // Multiple decimal = invalid number.\n }\n }\n\n if (!Character.isDigit(test))\n return false; // Character isn't a digit, so it can't be a number.\n }\n\n return true;\n }", "public static boolean isDigits(String value) {\n return value.matches(\"[0-9]+\");\n }", "private boolean containsOnlyNumbers(String inputString)\r\n {\r\n inputString = inputString.trim();\r\n if (inputString.equals(null))\r\n return false;\r\n else\r\n for (int i = 0; i < inputString.length(); i++)\r\n if (!(inputString.charAt(i) >= '0' && inputString.charAt(i) <= '9'))\r\n return false;\r\n return true;\r\n }", "private boolean checkForNumber(String field) {\n\n\t\tPattern p = Pattern.compile(\"[0-9].\");\n\t\tMatcher m = p.matcher(field);\n\n\t\treturn (m.find()) ? true : false;\n\t}", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "public static boolean ComprobarNumero(String str) {\n try {\n double d = Double.parseDouble(str);\n return true;\n } catch (NumberFormatException nfe) {\n \treturn false;\n }\n }", "public static Boolean isNumeric(String text)\n {\n //This checks for negative numbers...\n if (text.startsWith(\"-\"))\n {\n text = text.substring(1, text.length());\n }\n\n for (char c : text.toCharArray())\n {\n if (!Character.isDigit(c))\n {\n return false;\n }\n }\n return true;\n }", "public static boolean isInt(String strNum) {\n try {\n int d = Integer.parseInt(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "public static boolean isNumber(String token) {\n boolean toret = true;\n\n try {\n Double.parseDouble(token);\n }\n catch(Exception e)\n {\n toret = false;\n }\n\n return toret;\n }", "public static boolean isNumericInternational(String str)\n {\n try\n {\n double d = Double.parseDouble(str);\n }\n catch(NumberFormatException nfe)\n {\n return false;\n }\n return true;\n }", "public static boolean isNumber(String string) {\n if (string == null || string.isEmpty()) {\n return false;\n }\n int i = 0;\n if (string.charAt(0) == '-') {\n if (string.length() > 1) {\n i++;\n } else {\n return false;\n }\n }\n for (; i < string.length(); i++) {\n if (!Character.isDigit(string.charAt(i))) {\n return false;\n }\n }\n return true;\n}", "public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }", "public boolean isNumber(String num)\t{\n\t\tfor(int i=0;i<13;i++)\t{\n\t\t\tif(Integer.parseInt(num)==i)\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isNumeric(String sNumericString) {\n try {\n for (char c : sNumericString.toCharArray()) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "private boolean isInt(String num) {\n boolean isInt;\n try {\n Integer.parseInt(num);\n isInt = true;\n } catch (Exception e) {\n isInt = false;\n }\n return isInt;\n }", "private boolean isNotNumeric(String s) {\n return s.matches(\"(.*)\\\\D(.*)\");\n }", "public abstract boolean isNumeric();", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "private boolean isNumber(String number){\n\t\ttry{\r\n\t\t\tFloat.parseFloat(number);\r\n\t\t}catch(Exception e){\r\n\t\t\treturn false;// if the user input is not number it throws flase\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean stringContainsNumber( String userName ) {\n return Pattern.compile( \"[0-9]\" ).matcher( userName).find();\n }", "private boolean isInteger(String s)\n{\n\t boolean isNumber = true;\n\ttry{\n\t\t\tint n = Integer.parseInt(s);\n\t }catch(NumberFormatException n)\n\t {\n\t\t isNumber = false;\n\t }\n\n\treturn isNumber;\n}", "public static boolean isDigit(final String str) {\n if (str == null || str.length() == 0) {\n return false;\n }\n\n for (var i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i)) && str.charAt(i) != '.') {\n return false;\n }\n }\n return true;\n }", "private static boolean areNumbers(String s) {\n boolean isADigit = false;//only changed once everything has been checked\n //checks if places 0-2 are numbers and 3 is a \"-\"\n for(int i = 0; i < 3; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(3) == '-') {\n isADigit = true;\n }\n }\n //checks if places 4-5 are numbers and 6 is a \"-\"\n for(int i = 4; i < 6; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(6) == '-') {\n isADigit = true;\n }\n }\n //checks if places 7-10 are numbers\n for(int i = 7; i < 11; i++) {\n if(Character.isDigit(s.charAt(i))) {\n isADigit = true;\n }\n }\n return isADigit;\n }", "private boolean isInteger(String str)\r\n {\r\n try\r\n {\r\n int i = Integer.parseInt(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }", "public static boolean isNumeric(String userInput) {\n return Pattern.matches(Constants.ID_VALIDATION, userInput);\n }", "public boolean isInteger(String x){\n try{\n Integer.parseInt(x);\n \n }\n catch(NumberFormatException e){\n return false;\n }\n return true;\n }", "public static boolean isNumber(String val){\n\t\t\n\t\tfor(int i=0;i<val.length();i++){\n\t\t\tif((val.charAt(i) >= '0' && val.charAt(i) <= '9') || (val.charAt(i) >= 'A' && val.charAt(i) <= 'F') || (val.charAt(i) >= 97 && val.charAt(i) <= 102)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isNumber(String input) {\r\n\t\tif (input == null || input.isEmpty())\r\n\t\t\treturn false;\r\n\t\tif (input.charAt(0) == '-')\r\n\t\t\treturn false;\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tif (Character.isDigit(input.charAt(i)) == false)\r\n\t\t\t\treturn false;\r\n\t\t\tif (Integer.parseInt(input) < 1 || Integer.parseInt(input) > 7)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean isInteger(String a) {\n try \n {\n Integer.parseInt(a);\n return true;\n }\n catch(Exception e) {\n return false;\n }\n }", "public static boolean isInteger(String str){\n try {\n int d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumber(String val) {\n boolean flag = true;\n try {\n if (val != null) {\n if (!\"\".equals(val.trim())) {\n Integer.parseInt(val);\n\n }\n\n }\n } catch (NumberFormatException nfe) {\n flag = false;\n }\n return flag;\n }", "public boolean isNumber(String s) {\n\t\tif (s==null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t s = s.trim(); \n\t //avoid \"3e\" which is false\n\t if (s.length() > 0 && s.charAt(s.length() - 1) == 'e') {\n\t \treturn false; \n\t }\n\t \n\t String[] parts = s.split(\"e\");\n\t if (parts.length == 0 || parts.length > 2) {\n\t \treturn false;\n\t }\n\t //check the part before e\n\t boolean res = isValid(parts[0], false); \n\t \n\t //check the part after e, and second half can not have any dot\n\t if (parts.length > 1) {\n\t \tres = res && isValid(parts[1], true);\n\t }\n\t \n\t return res;\n\t}", "public boolean isNumber(String stringItem) {\n Float floatItem = (float) 0.0;\n try {\n floatItem = Float.valueOf(stringItem);\n } // try\n catch (NumberFormatException IOError) {\n return false;\n } // catch\n return true;\n }", "public static boolean isnumber(char c) {\n\t\tif (c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9') {\n\t\t\treturn true;// return true if that char is number\n\t\t}\n\t\telse { //else return false\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean esNumero(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }", "public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isContainNumericalDigits(String password) {\n\t\treturn password.matches(\".*[0-9].*\");\n\t}", "private static boolean isInteger(String s) {\r\n try {\r\n Integer.parseInt(s);\r\n return true;\r\n } catch (Exception ex) {\r\n return false;\r\n }\r\n }", "public static boolean isInteger(String s) {\n\t try { \n\t Integer.parseInt(s); \n\t } catch(NumberFormatException e) { \n\t return false; \n\t }\n\t return true;\n\t}" ]
[ "0.8185783", "0.81450176", "0.80482", "0.80454266", "0.7989678", "0.7940366", "0.7940158", "0.7939291", "0.7929306", "0.7902319", "0.7897434", "0.78849155", "0.78808594", "0.78620577", "0.785922", "0.7858195", "0.7848942", "0.7840908", "0.7835716", "0.78008807", "0.7769692", "0.7761959", "0.77448505", "0.77403224", "0.7736723", "0.7726538", "0.77209806", "0.7704158", "0.77001226", "0.7699638", "0.7693997", "0.7662332", "0.7660649", "0.7658457", "0.7618651", "0.76182306", "0.76013875", "0.75916", "0.7586451", "0.7569319", "0.7563801", "0.75468516", "0.754134", "0.7534137", "0.75238204", "0.75214046", "0.74975204", "0.7481149", "0.74707377", "0.7470586", "0.746901", "0.74077314", "0.7397188", "0.7392721", "0.73922026", "0.7381501", "0.7378991", "0.7362937", "0.736218", "0.7356356", "0.73506564", "0.7330461", "0.73277515", "0.73164713", "0.73016363", "0.728346", "0.7263092", "0.7246761", "0.7240182", "0.7219383", "0.7208393", "0.714888", "0.7147442", "0.7140134", "0.71360505", "0.71257704", "0.7103928", "0.7098059", "0.7088446", "0.7063006", "0.7053609", "0.70254755", "0.7017727", "0.7010742", "0.6998129", "0.69943273", "0.6974339", "0.6966212", "0.696502", "0.69566804", "0.69435966", "0.69304305", "0.69269395", "0.69257253", "0.6915023", "0.6899742", "0.6894392", "0.6872957", "0.68660897", "0.6861221" ]
0.78448474
17
File loader method, loadfile command will grab the defined variables and functions from a specified file and put them in the interpreter variable maps.
public void fileLoaderMethod(String filename) { String fileloc = ""; if(!prf.foldername.getText().equals("")) fileloc += prf.foldername.getText()+"/"; fileloc += filename; File fl = new File(fileloc); String code = ""; if(!fl.exists()) { JOptionPane.showMessageDialog(null, "The specified file doesnt exist at the given location."); } else { try { FileReader flrd = new FileReader(fileloc); BufferedReader bufread = new BufferedReader(flrd); String str; while((str = bufread.readLine()) != null) { code += str + "\n"; } bufread.close(); flrd.close(); } catch (IOException e) { e.printStackTrace(); } } interpretorMainMethod(code, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void load (String argFileName) throws IOException;", "void load(File file);", "public void load(File source);", "public void load (File file) throws Exception;", "@Test\n\tpublic void testLoad() {\n\t\tWriter writer = null ;\n\t\t\n\t\tString sourceFilePath = \"testLoad1.lisp\" ;\n\t\t\n\t\t//create the test source file\n\t\ttry {\n\t\t\twriter = new BufferedWriter(\n\t\t\t\t\t\tnew OutputStreamWriter(\n\t\t\t\t\t\t\t\tnew FileOutputStream(sourceFilePath), \"utf-8\")) ;\n\t\t\twriter.write(\"(define foo 37)\\n\");\n\t\t} catch (IOException except){\n\t\t\t\n\t\t} finally {\n\t\t\ttry {writer.close();} catch (Exception ex) {}\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tLispObject result = LispReader.load(sourceFilePath, env) ;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tenv.dump() ;\n\t\t//check that the environment contains the bindings as stated in the source file.\n\t\t\n\t\tSystem.out.println(\"testLoad(): got \" + env.get(\"BAR\")) ;\n\n\t\tassertTrue(env.get(\"FOO\").toString().equals(\"37\"));\n\t}", "public Varargs loadFile(String filename) {\r\n\t\tFile f = FileManager.get(filename, computer.getID());\r\n\t\tInputStream is = null;\r\n\t\tif ( f == null )\r\n\t\t\treturn LuaValue.varargsOf(LuaValue.NIL, LuaValue.valueOf(\"cannot open \"+filename+\": No such file or directory\"));\r\n\t\ttry {\r\n\t\t\tis = new FileInputStream(f);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\treturn LuaValue.varargsOf(LuaValue.NIL, LuaValue.valueOf(\"cannot open \"+filename+\": No such file or directory\"));\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\treturn loadStream(is, \"@\"+filename);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tis.close();\r\n\t\t\t} catch ( Exception e ) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void loadFile(File p_file) throws IOException;", "default void load(String file) {\n load(new File(file));\n }", "private void loadEnvironment(String filename){\n try (BufferedReader reader = new BufferedReader(new FileReader(filename))) {\n String line;\n while ((line = reader.readLine()) != null) {\n String[] info = line.split(\",\");\n String type = info[TYPE_INDEX];\n type = type.replaceAll(\"[^a-zA-Z0-9]\", \"\"); // remove special characters\n Point coordinate = new\n Point(Double.parseDouble(info[POS_X_INDEX]), Double.parseDouble(info[POS_Y_INDEX]));\n\n switch (type) {\n case \"Player\" -> this.player = new Player(coordinate, Integer.parseInt(info[ENERGY_INDEX]));\n case \"Zombie\" -> {\n entityList.add(new Zombie(coordinate, type));\n zombieCounter++;\n }\n case \"Sandwich\" -> {\n entityList.add(new Sandwich(coordinate, type));\n sandwichCounter++;\n }\n case \"Treasure\" -> this.treasure = new Treasure(coordinate, type);\n default -> throw new BagelError(\"Unknown type: \" + type);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n }", "private void loadEnvironment(String filename){\n // Code here to read from the file and set up the environment\n try (BufferedReader br = new BufferedReader(new FileReader(filename))) {\n String line;\n while((line = br.readLine()) != null) {\n String[] values = line.split(\",\");\n String type = values[0].replaceAll(\"[^a-zA-Z0-9]\", \"\"); // remove special characters\n double x = Double.parseDouble(values[1]);\n double y = Double.parseDouble(values[2]);\n switch (type) {\n case \"Zombie\":\n Zombie zombie = new Zombie(x, y);\n this.zombies.put(zombie.getPosition(), zombie);\n break;\n case \"Sandwich\":\n Sandwich sandwich = new Sandwich(x, y);\n this.sandwiches.put(sandwich.getPosition(), sandwich);\n break;\n case \"Player\":\n this.player = new Player(x, y, Integer.parseInt(values[3]));\n break;\n case \"Treasure\":\n this.treasure = new Treasure(x, y);\n break;\n default:\n throw new BagelError(\"Unknown type: \" + type);\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public static void loadFromFile() {\n\t\tloadFromFile(Main.getConfigFile(), Main.instance.getServer());\n\t}", "public void load (IFile file) throws Exception;", "public void loadFile(String file) {\n\t\ttry {\n\t\t\tabd_realize.getProxy().loadFile(file);\n\t\t}\n\t\tcatch (FileReadErrorException ex) {\n\t\t\tlog(\"file read error: \" + ex.filename);\n\t\t}\n\t\tcatch (SyntaxErrorException ex) {\n\t\t\tlog(\"syntax error: \" + ex.error + \" in \" + ex.filename + \" on line \" + ex.line);\n\t\t}\n\t}", "public void doIt(File f) throws Exception\n {\n LuaParser parser=new LuaParser();\n Map<String,Object> data=parser.read(f);\n useData(data);\n }", "public static void load() {\n }", "public boolean load(String file);", "void load();", "void load();", "private static void load(){\n }", "public void loadFromFile(String file) throws IOException {\n loadFromFile(file,DEFAULT_CHAR_SET);\n }", "public static void load(FileIO fileIO) \r\n\t{\n\t\t\r\n\t}", "void load(final File file) {\n this.file = Preconditions.checkNotNull(file);\n this.gameModelPo = gameModelPoDao.loadFromFile(file);\n visibleAreaService.setMapSize(getMapSize());\n initCache();\n }", "public void load() ;", "public Interpreter(String fileName) throws FileNotFoundException {\n super(fileName);\n instructionsStack.push(new ArrayList<>());\n }", "public boolean readVariables(String _filename, java.net.URL _codebase, String _varList) {\r\n\t\treturn readVariables(_filename, toArrayList(_varList));\r\n// return readVariables (_filename,_codebase,toArrayList(_varList));\r\n\t}", "public boolean readVariables(String _filename, java.net.URL _codebase, List<String> _varList) {\r\n\t\treturn readVariables(_filename, _varList);\r\n\t}", "public void load();", "public void load();", "public void load(){\n\t\t\tArrayList<String> entries = readEntriesFromFile(FILENAME);\n\t\t\t\n\t\t\tfor(int i = 1; i < entries.size(); i++){\n\t\t\t\tString entry = entries.get(i);\n\t\t\t\tString[] entryParts = entry.split(\",\");\n\t\t\t\tString name = entryParts[0];\n\t\t\t\tString power = entryParts[1];\n\t\t\t\tString gold = entryParts[2];\n\t\t\t\tString xp = entryParts[3];\n\t\t\t\tString location = entryParts[4];\n\t\t\t\tint powerInt = Integer.parseInt(power);\n\t\t\t\tint goldInt = Integer.parseInt(gold);\n\t\t\t\tint XPInt = Integer.parseInt(xp);\n\t\t\t\tRegion regionR = RM.getRegion(location);\n\t\t\t\tTrap trap = new Trap(name, powerInt, goldInt, XPInt, regionR);\n\t\t\t\ttrapList[i-1] = trap;\n\t\t\t}\n\t}", "public Load(String[] args) {\n\n\t\ttry {\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(args[0]), \"rw\");\n\t\t\tthis.sfMap = raf.getChannel();\n\t\t\tthis.stataFile = sfMap.map(FileChannel.MapMode.READ_WRITE, 0, sfMap.size());\n\t\t\tthis.fileHeader = checkVersion(this.stataFile);\n\t\t\tif (this.release >= 113 && this.release <= 115) {\n\t\t\t\tthis.headerData = OldFormats.readHeader(stataFile, fileHeader);\n\t\t\t} else {\n\t\t\t\tthis.headerData = NewFormats.readHeader(stataFile, fileHeader);\n\t\t\t}\n\t\t\tparseHeader();\n\t\t\tif (this.release == 118) {\n\t\t\t\tthis.versionedFile = FileFormats.getVersion(this.sfMap, this.release,\n\t\t\t\t\t\tthis.endian, this.K, (Long) this.headerData.get(3),\n\t\t\t\t\t\tthis.datasetLabel, this.datasetTimeStamp, this.mapOffset);\n\t\t\t} else {\n\t\t\t\tthis.versionedFile = FileFormats.getVersion(this.sfMap, this.release,\n\t\t\t\t\t\tthis.endian, this.K, (Integer) this.headerData.get(3),\n\t\t\t\t\t\tthis.datasetLabel, this.datasetTimeStamp, this.mapOffset);\n\t\t\t}\n\t\t} catch (IOException | DtaCorrupt e) {\n\t\t\tSystem.out.println(String.valueOf(e));\n\t\t}\n\n\t}", "private boolean justReadVariables(String _filename, List<String> _varList) {\n\t\ttry {\r\n\t\t\t// Check if the file exists\r\n\t\t\tboolean exists = true;\r\n\t\t\tjava.net.URLConnection urlConnection = null;\r\n\t\t\tReader reader = null;\r\n\t\t\tif (_filename.startsWith(\"ejs:\")) {\r\n\t\t\t\texists = (memory.get(_filename) != null);\r\n\t\t\t} else if (_filename.startsWith(\"url:\")) {\r\n\t\t\t\tString urlStr = _filename.substring(4);\r\n// System.err.println (\"Trying to read from Reso Load URL \"+urlStr);\r\n\t\t\t\ttry {\r\n\t\t\t\t\turlConnection = new java.net.URL(urlStr).openConnection();\r\n\t\t\t\t} catch (Exception _exc) {\r\n\t\t\t\t\t_exc.printStackTrace();\r\n\t\t\t\t\texists = false;\r\n\t\t\t\t} // Do complain\r\n// reader = ResourceLoader.openReader(urlStr);\r\n// exists = reader!=null;\r\n\t\t\t} else {\r\n\t\t\t\t// System.err.println (\"Trying to read \"+_filename);\r\n\t\t\t\treader = ResourceLoader.openReader(_filename);\r\n\t\t\t\texists = reader != null;\r\n\t\t\t}\r\n\t\t\tif (!exists) {\r\n\t\t\t\terrorMessage(\"File does not exist \" + _filename);\r\n\t\t\t\treturn false; // But do it silently\r\n\t\t\t}\r\n\t\t\t// errorMessage (\"File does exist \"+_filename);\r\n\t\t\t// Previous to changing the variables of the model\r\n\t\t\t// errorMessage (\"File does exist \"+_filename);\r\n\t\t\t// Previous to changing the variables of the model\r\n\t\t\tXMLControlElement control = null; // Used to read XML\r\n\t\t\tjava.io.ObjectInputStream din = null; // Used to read binary\r\n\t\t\tif (_filename.toLowerCase().endsWith(\".xml\")) { // Read XML\r\n\t\t\t\tString xmlString = null;\r\n\t\t\t\tjava.io.Reader in = null;\r\n\t\t\t\tif (urlConnection != null) {\r\n\t\t\t\t\tin = new InputStreamReader((java.io.InputStream) urlConnection.getContent());\r\n\t\t\t\t} else { // Either memory or a file\r\n\t\t\t\t\tif (_filename.startsWith(\"ejs:\"))\r\n\t\t\t\t\t\tin = new java.io.CharArrayReader((char[]) memory.get(_filename));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tin = reader;\r\n\t\t\t\t}\r\n\t\t\t\tif (in != null) {\r\n\t\t\t\t\tjava.io.LineNumberReader l = new java.io.LineNumberReader(in);\r\n\t\t\t\t\tStringBuffer txt = new StringBuffer();\r\n\t\t\t\t\tString sl = l.readLine();\r\n\t\t\t\t\twhile (sl != null) {\r\n\t\t\t\t\t\ttxt.append(sl + \"\\n\");\r\n\t\t\t\t\t\tsl = l.readLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tin.close();\r\n\t\t\t\t\txmlString = txt.toString();\r\n\t\t\t\t}\r\n\r\n// if (!xmlContainsData (xmlString)) return true; // Why not? I read it, but data was irrelevant.\r\n\r\n\t\t\t\tcontrol = new XMLControlElement(this.getClass());\r\n\t\t\t\tif (!control.readXMLForClass(xmlString, this.getClass()))\r\n\t\t\t\t\treturn true; // Why not? I read it, but data was irrelevant.\r\n\t\t\t\t// control.readXML(xmlString);\r\n// return true; // Why not? I read it, but data was irrelevant.\r\n\t\t\t} else { // Prepare to read binary\r\n\t\t\t\tjava.io.InputStream in;\r\n\t\t\t\tif (urlConnection != null)\r\n\t\t\t\t\tin = urlConnection.getInputStream();\r\n\t\t\t\telse if (_filename.startsWith(\"ejs:\"))\r\n\t\t\t\t\tin = new java.io.ByteArrayInputStream((byte[]) memory.get(_filename));\r\n\t\t\t\telse\r\n\t\t\t\t\tin = ResourceLoader.openInputStream(_filename);\r\n\t\t\t\tif (in == null)\r\n\t\t\t\t\treturn false;// FKH20060413 no data in state byte array\r\n\t\t\t\tdin = new java.io.ObjectInputStream(new java.io.BufferedInputStream(in));\r\n\t\t\t}\r\n\t\t\t// Now modify the model variables\r\n\t\t\tjava.lang.reflect.Field[] fields = model.getClass().getFields();\r\n\t\t\tif (_varList == null) { // read all variables in the order they appear\r\n\t\t\t\tfor (int i = 0; i < fields.length; i++) {\r\n\t\t\t\t\tObject objectToRead = fields[i].get(model);\r\n// System.err.print (\"Reading variable \"+fields[i].getName());\r\n\t\t\t\t\tif (objectToRead != null && !(objectToRead instanceof java.io.Serializable)) {\r\n// System.err.println (\" Ignoring it! \"+fields[i].getName());\r\n\t\t\t\t\t\tcontinue; // Ignore these\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (control != null) { // read xml\r\n\t\t\t\t\t\tObject object = control.getObject(fields[i].getName());\r\n\t\t\t\t\t\tif (object != null)\r\n\t\t\t\t\t\t\tfields[i].set(model, object);\r\n\t\t\t\t\t} else if (din != null) {\r\n\t\t\t\t\t\tObject objectRead = din.readObject();\r\n// System.err.println (\" Value read = \"+objectRead+ \" (type = \"+fields[i].getType()+\")\");\r\n\t\t\t\t\t\tfields[i].set(model, objectRead); // read binary\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} // End of reading all variables\r\n\t\t\telse { // read only variables in the list in the same order\r\n\t\t\t\tfor (int j = 0, n = _varList.size(); j < n; j++) {\r\n\t\t\t\t\tString varName = _varList.get(j).trim();\r\n\t\t\t\t\tfor (int i = 0; i < fields.length; i++) {\r\n\t\t\t\t\t\tObject objectToRead = fields[i].get(model);\r\n\r\n\t\t\t\t\t\tif (objectToRead != null && !(objectToRead instanceof java.io.Serializable))\r\n\t\t\t\t\t\t\tcontinue; // Ignore these\r\n\t\t\t\t\t\tif (fields[i].getName().equals(varName)) { // Found\r\n\t\t\t\t\t\t\tif (control != null) {\r\n\t\t\t\t\t\t\t\tObject object = control.getObject(varName);\r\n\t\t\t\t\t\t\t\tif (object != null)\r\n\t\t\t\t\t\t\t\t\tfields[i].set(model, object);\r\n\t\t\t\t\t\t\t} else if (din != null)\r\n\t\t\t\t\t\t\t\tfields[i].set(model, din.readObject());\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} // End of reading for each variable in the list\r\n\t\t\t\t// Finalize\r\n\t\t\tif (din != null)\r\n\t\t\t\tdin.close();\r\n\t\t\t// errorMessage (\"File read OK \"+_filename);\r\n\t\t\treturn true;\r\n\t\t} catch (java.lang.Exception ioe) {\r\n\t\t\terrorMessage(\"Error when trying to read \" + _filename);\r\n\t\t\tioe.printStackTrace(System.err);\r\n\t\t\tjavax.swing.JOptionPane.showMessageDialog(getParentComponent(), ioe.getLocalizedMessage());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "File getLoadLocation();", "private void load(Path fileName) throws IOException {\n try(BufferedReader reader = Files.newBufferedReader(fileName)) {\n String line = \"\";\n\n // Matches lines with the format:\n // key=value\n // where the key is any sequence of lowercase letters. (a to z)\n // where value may be any letters from a to z (case insensitive) 0 to 9 or the letters '-' and '.'.\n Pattern validLine = Pattern.compile(\"^(?<key>[a-z]+)=(?<value>[a-zA-Z0-9-.]+)$\");\n\n // Read the file line by line\n while((line = reader.readLine()) != null) {\n if(line.startsWith(\";\")) { // Ignore lines that start with ;\n continue;\n }\n\n // Remove any whitespace\n line = line.trim();\n\n // Continue if our line is empty\n if(\"\".equals(line)) {\n continue;\n }\n\n Matcher matcher = validLine.matcher(line);\n\n if(!matcher.matches() || matcher.groupCount() != 2) {\n System.err.println(\"Unable to parse line: \" + line);\n continue;\n }\n\n String key = matcher.group(\"key\");\n String value = matcher.group(\"value\");\n\n map.put(key, value);\n }\n }\n }", "public void\tload(String fileName) throws IOException;", "public void load() {\n\t}", "public void loadWorkflow(String filename);", "public void load() {\n }", "public void loadGame(File fileLocation, boolean replay);", "public void loadObjectData(String datafile) {\n\t\tProperties databaseAddData = new Properties();\n\t\ttry {\n\t\t\tdatabaseAddData.load(new FileInputStream(langFile));\n\t\t} catch (Exception e) {}\n\t\t//put values from the properties file into hashmap\n\t\tthis.properties.put(\"PROPERTY\", databaseAddData.getProperty(\"PROPERTY\"));\n\t}", "@Test\n\tpublic void testLoadMultipleExpression() {\n\t\tWriter writer = null ;\n\t\t\n\t\tString sourceFilePath = \"testLoad2.lisp\" ;\n\t\t\n\t\t//create the test source file\n\t\ttry {\n\t\t\twriter = new BufferedWriter(\n\t\t\t\t\t\tnew OutputStreamWriter(\n\t\t\t\t\t\t\t\tnew FileOutputStream(sourceFilePath), \"utf-8\")) ;\n\t\t\twriter.write(\"(define foo 37)\\n\");\n\t\t\twriter.write(\"(define bar 95)\\n\");\n\t\t} catch (IOException except){\n\t\t\t\n\t\t} finally {\n\t\t\ttry {writer.close();} catch (Exception ex) {}\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tLispObject result = LispReader.load(sourceFilePath, env) ;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\n\t\t//check that the environment contains the bindings as stated in the source file.\n\t\t\n\t\tSystem.out.println(\"testLoad(): got \" + env.get(\"BAR\")) ;\n\n\t\t//env.dump() ;\n\t\tassertTrue(env.get(\"BAR\").toString().equals(\"95\"));\n\t}", "public Cmdline(String file) {\n \n try {\n File selectedFile = new File(file);\n Model m = loadModel( selectedFile );\n if( m != null )\n models.add( m );\n } catch (FileNotFoundException fnfe) {\n System.out.println(\"File not found\");\n } catch( ParseException pe ) {\n System.out.println(\"Parse Error: \" + pe.getMessage());\n } catch( LemException le ) {\n System.out.println(\"Parse Error: \" + le.getMessage());\n } catch( IOException ioe ) {\n System.out.println(\"I/OO Error: \" + ioe.getMessage());\n }\n \n/* metamodel.Procedure p = m.getDomain( \"Publications\" ).getClass( \"Manuscript\" ).getStateMachine().getState(\"Adding\").getProcedure();\n runtime.ModelInstance i = new runtime.ModelInstance();\n \n p.execute(i); */\n }", "private void initializeFile() {\n\t\twriter.println(\"name \\\"advcalc\\\"\");\n\t\twriter.println(\"org 100h\");\n\t\twriter.println(\"jmp start\");\n\t\tdeclareArray();\n\t\twriter.println(\"start:\");\n\t\twriter.println(\"lea si, \" + variables);\n\t}", "@Override\n\tpublic Object load(String file) {\n\t\treturn null;\n\t}", "public Map executeFileLoader(String propertyFile) {\r\n\t\t\r\n\t\tProperties propertyVals = new Properties();\r\n\t\ttry {\r\n\t\t\tInputStream inputStream = getClass().getClassLoader().getResourceAsStream(propertyFile);\r\n\t\t\tpropertyVals.load(inputStream);\r\n\t\t\t\t\r\n\t\t\tString URL =\tpropertyVals.getProperty(\"URL\");\r\n\t\t\tString Depth =\tpropertyVals.getProperty(\"Depth\");\r\n\t\t\tfactorVals = new HashMap<String, String>();\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<2; i++)\r\n\t\t\t{\r\n\t\t\t\tif(i==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfactorVals.put(\"URL\", URL);\r\n\t\t\t\t\t}\t\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfactorVals.put(\"Depth\", Depth);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"File not Found.\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn factorVals;\t\r\n\t}", "public void loadFile() {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tString filename = JOptionPane.showInputDialog(null,\"Enter the filename.\");\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\n\t\t\tMinLFile nminl = new MinLFile(filename);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\n\t\t\t\t\n\t\t\t\tnminl.CodeArea.setText(\"\");\n\t\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tDocument doc = nminl.CodeArea.getDocument();\n\t\t\t\t\ttry {\n\t\t\t\t\tdoc.insertString(doc.getLength(), str, null);\n\t\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\n\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t\t\t\n\t\t\tJComponent panel = nminl;\n\t\t\t\n\t\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\t\tfilename);\t\t\n\t\t\ttabbedPane.setMnemonicAt(0, 0);\n\t\t}\t\n\t}", "public void loadSaveGameFromFile(File file) {\r\n\t\t//TODO\r\n\t}", "private void loadSpaceObjects(String file){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tloadFactory(sc);\n\t\t\tloadPlanets(sc);\n\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramPlanets.txt\");\n\t\t}\n\t}", "public void loadShow(File f) {\n \n }", "public abstract void load();", "public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}", "private void loadDataFromFile(File file) {\n\t\tString fileName = file.getName();\n\t\tQuickParser test = new QuickParser();\n\n\t\tif(fileName.trim().toUpperCase().startsWith(\"INV\")) {\n\t\t\tfileType = FileType.INVENTORY;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInventoryData.clear();\n\t\t\tmasterInventoryData = test.Parse(file, fileType);\n\t\t\tpresentationInventoryData.clear();\n\t\t\tpresentationInventoryData.addAll(masterInventoryData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End if statement\n\t\telse if(fileName.toUpperCase().startsWith(\"INI\")) {\n\t\t\tfileType = FileType.INITIAL;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInitialData.clear();\n\t\t\tmasterInitialData = test.Parse(file, fileType);\n\t\t\tpresentationInitialData.clear();\n\t\t\tpresentationInitialData.addAll(masterInitialData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End else if statement \n\t\telse {\n\t\t\tfileType = FileType.UNASSIGNED;\n\t\t} // End else statement\n\t\tchangeToScanTable();\n\t}", "private void loadParameters() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new BufferedInputStream(Files.newInputStream(path))));\n\n\t\tdo {\n\t\t\tString line = reader.readLine();\n\t\t\tif (line == null || line.equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (line.startsWith(\"--\") || line.startsWith(\" \")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString[] tokens = line.trim().split(\"\\\\s+\");\n\t\t\tparameters.put(Parameter.valueOf(tokens[0]), tokens[1]);\n\t\t} while (true);\n\n\t}", "public void load(String filePath){\r\n File loadFile = new File(filePath);\r\n if (!loadFile.exists()){\r\n System.out.println(\"I failed. There are no saved games.\");\r\n return;\r\n }\r\n FileInputStream fis = null;\r\n ObjectInputStream in = null;\r\n try {\r\n fis = new FileInputStream(filePath);\r\n in = new ObjectInputStream(fis);\r\n long versionUID = (long) in.readObject();\r\n if (versionUID != this.serialVersionUID) {\r\n throw new UnsupportedClassVersionError(\"Version mismatch for save game!\");\r\n }\r\n this.p = (Character) in.readObject();\r\n this.map = (SpecialRoom[][]) in.readObject();\r\n\r\n } catch (FileNotFoundException ex){\r\n System.out.println(\"The saved game was not found!\");\r\n ex.printStackTrace();\r\n } catch (IOException ex) {\r\n System.out.println(\"There was an error reading your save game :(\");\r\n ex.printStackTrace();\r\n System.out.println(\")\");\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"The version of the save game is not compatible with this game!\");\r\n ex.printStackTrace();\r\n } catch (UnsupportedClassVersionError ex) {\r\n System.out.println(ex.getMessage());\r\n ex.printStackTrace();\r\n } catch (Exception ex) {\r\n System.out.println(\"An unknown error occurred!\");\r\n }\r\n\r\n }", "public void init(String file) {\n\t\tif (file == null) {\n\t\t\tfile = Controller.getSourceFile();\n\t\t}\n\t\tthis.satelliteList = JSONLoader.getSatelliteList(file);\n\t\tthis.initModules();\n\t}", "private void load(FileInputStream input) {\n\t\t\r\n\t}", "private void loadScheme(File file)\n\t{\n\t\tString name = file.getName();\n\n\t\ttry\n\t\t{\n\t\t\tBedrockScheme particle = BedrockScheme.parse(FileUtils.readFileToString(file, Charset.defaultCharset()));\n\n\t\t\tthis.presets.put(name.substring(0, name.indexOf(\".json\")), particle);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void load(File configFile) {\n try {\n this.getProperties().load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void readFromFile() {\n\n\t}", "public static void load(String filename, Supervisor k) throws FileNotFoundException{\n String source = \"\";\n try {\n Scanner in = new Scanner(new FileReader(filename));\n while(in.hasNext()){\n source = source + in.next();\n }\n } catch (FileNotFoundException ex) {\n //throw ex;\n System.out.println(\"Could not read config file: \" + ex);\n System.out.println(\"trying to create a new one...\");\n String stsa = \"Done!\\n\";\n try (\n Writer writer = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(filename), \"utf-8\"))) {\n writer.write(\"\");\n writer.close();\n }\n \n catch (IOException ex1) {\n stsa = \"\";\n System.out.println(\"FAILED, SKIPPING CONFIG READ BECOUSE:\");\n Logger.getGlobal().warning(ex1.toString());\n System.out.println(\"Console version: \" + ex1.toString());\n }\n System.out.print(stsa);\n }\n LinkedList<String[]> raw = fetch(source);\n \n if(k.Logic == null){\n Logger.getGlobal().warning(\"ENGINE NOT INITIALIZED PROPERLY, ABORTING APPLYING CONFIG\");\n return;\n }\n if(k.Logic.Vrenderer == null){\n Logger.getGlobal().warning(\"ENGINE RENDERER NOT INITIALIZED PROPERLY, ABORTING APPLYING CONFIG\");\n return;\n }\n \n for(String[] x: raw){\n String value = x[1];\n if(!k.features_overrideAllStandard)\n switch(x[0]){\n case \"nausea\":\n int numValue = 0;\n try{\n numValue = Integer.parseInt(value);\n }\n catch(Exception e){\n quickTools.alert(\"configReader\", \"invalid nausea value\");\n break;\n }\n if(numValue > 0){\n k.Logic.Vrenderer.dispEffectsEnabled = true;\n }\n //k.Logic.Vrenderer.di\n break;\n default:\n\n break;\n }\n customFeatures(x[0], x[1], k);\n }\n }", "private static void parseDropinsFilesVariables(File file)\n throws SAXException, IOException, XPathExpressionException {\n Document doc = parseDropinsXMLFile(file);\n if (doc != null) {\n parseVariables(doc);\n parseIncludeVariables(doc);\n }\n }", "public void loadFromFile(String filename, boolean verbose) throws IOException {\n\t\t\n\t\tInputStream input = new FileInputStream(filename);\n\t\ttry {\n\t\t\tdefinitionsProperties.load(input);\n\t\t}\n\t\tfinally {\n\t\t\tinput.close();\n\t\t}\n\t\tthis.verbose = verbose;\n\t}", "private void loadGame(String fileName){\n\n }", "public abstract void loadFile(Model mod, String fn) throws IOException;", "public interface LoadFile {\n public String loadFile();\n}", "public void onEnable(){\n new File(getDataFolder().toString()).mkdir();\n playerFile = new File(getDataFolder().toString() + \"/playerList.txt\");\n commandFile = new File(getDataFolder().toString() + \"/commands.txt\");\n blockFile = new File(getDataFolder().toString() + \"/blockList.txt\");\n deathFile = new File(getDataFolder().toString() + \"/deathList.txt\");\n startupFile = new File(getDataFolder().toString() + \"/startupCommands.txt\");\n \n //Load the player file data\n playerCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(playerFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n playerCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player command file\");\n }\n \n //Load the block file data\n blockCommandMap = new HashMap<Location, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(blockFile));\n StringTokenizer st;\n String input;\n String command;\n Location loc = null;\n \n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Block Location> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n loc = new Location(getServer().getWorld(UUID.fromString(st.nextToken())), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));\n command = st.nextToken();\n blockCommandMap.put(loc, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original block command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading block command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted block command file\");\n }\n \n //Load the player death file data\n deathCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(deathFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n deathCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player death command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player death command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player death command file\");\n }\n \n //Load the start up data\n startupCommands = \"\";\n try{\n BufferedReader br = new BufferedReader(new FileReader(startupFile));\n String input;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Command>\") == 0){\n continue;\n }\n startupCommands += \":\" + input;\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original start up command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading start up command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted start up command file\");\n }\n \n //Load the command file data\n commandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(commandFile));\n StringTokenizer st;\n String input;\n String args;\n String name;\n \n //Assumes that the name is only one token long\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Identifing name> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n args = st.nextToken();\n while(st.hasMoreTokens()){\n args += \" \" + st.nextToken();\n }\n commandMap.put(name, args);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted command file\");\n }\n \n placeBlock = false;\n startupDone = false;\n blockCommand = \"\";\n playerPosMap = new HashMap<String, Location>();\n \n //Set up the listeners\n PluginManager pm = this.getServer().getPluginManager();\n pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Event.Priority.Normal, this);\n \n log.info(\"Autorun Commands v2.3 is enabled\");\n }", "public static void load(Context context) throws IOException {\n // read the file\n String raw = File.readFile(\"vaccine.txt\", context);\n\n // clear the map and load contents of file into the map\n map.clear();\n for (String line : raw.split(\"\\n\")) {\n if (line.equals(\"\")) {\n continue;\n }\n String[] data = line.split(\",\");\n if (data[0].equals(\"\") || data.length != 3) {\n continue;\n }\n map.put(data[0], Boolean.getBoolean(data[1]));\n dateMap.put(data[0], data[2]);\n }\n }", "public void loadMemory(String inputFile){\n\t\tint pc = 0;\n\t\ttry{\n\t\t\tRandomAccessFile raf = new RandomAccessFile(new File(inputFile),\"rw\");\n\t\t\tString strLine;\n\t\t\tint decimalNumber;\n\t\t\twhile ((strLine = raf.readLine())!=null){\n\t\t\t\tstrLine = strLine.substring(0, 8); //get the first 8 char(hex instruction)\n\t\t\t\tdecimalNumber = new BigInteger(strLine, 16).intValue(); //decode the hex into integer\n\t\t\t\tloadInstructionInMemory(pc, decimalNumber);\n\t\t\t\tpc += 4;\n\t\t\t}\n\t\t\traf.close();\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tSystem.out.println(\"Error:\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void assemble(String filePath) throws Exception {\n\n System.out.println(\"Starting\");\n System.out.println(\"Loading Parser . . .\");\n File inputFile= new File(filePath);\n Parser parser = new Parser(inputFile);\n\n System.out.println(\"Loading SymbolTable . . . \");\n SymbolTable symbolTable = new SymbolTable();\n\n System.out.println(\"Parser first pass . . . \");\n parser.firstPass(symbolTable);\n System.out.println(\"Parser second pass . . . \");\n parser.secondPass(symbolTable);\n\n System.out.println(\"Complete\");\n\n }", "public void loadFile(String fname) \n\t{\n\t\t// use Scanner used to read the file\n\t\ttry{\n\t\t\tScanner scan = new Scanner(new FileReader(fname));\n\t\t\t//read in number of row and column in the first line\n\t\t\treadRC(scan);\n\t\t\treadMaze(scan);\n\t\t\t//close the scanner\n\t\t\tscan.close();\t\t\t\t\t\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"FileNotFound\"+e.getMessage());\n\t\t}\n\t}", "public void executeLoad(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString pcOffset = mIR.substring(7, 9);\n\t\tBitString wantedVal = mMemory[mPC.getValue() + pcOffset.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t\t//now I just need to set the conditional codes.\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic VariableMapReader(String sdgFile) throws IOException {\n\t\tObjectInputStream defStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_def\")));\n\t\tObjectInputStream useStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_use\")));\n\t\tObjectInputStream modStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_mod\")));\n\t\tObjectInputStream refStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_ref\")));\n\t\tObjectInputStream ptoStream = new ObjectInputStream(new FileInputStream(new File(sdgFile+\"_pto\")));\n\n\t\ttry {\n\t\t\tdef = (Map<Integer, Set<Integer>>) defStream.readObject();\n\t\t\tuse = (Map<Integer, Set<Integer>>) useStream.readObject();\n\t\t\tmod = (Map<Integer, Set<Integer>>) modStream.readObject();\n\t\t\tref = (Map<Integer, Set<Integer>>) refStream.readObject();\n\t\t\tpto = (Map<Integer, Set<Integer>>) ptoStream.readObject();\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tdefStream.close();\n\t\tuseStream.close();\n\t\tmodStream.close();\n\t\trefStream.close();\n\t\tptoStream.close();\n\t}", "public void init(String inputFile) \n\t{\t\t\n\t\tif (instance != null)\n\t\t{\n\t\t\ttry {\n\t\t\t\ts = new Scanner(new FileReader(inputFile));\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"\\nnot a valid inputFile\");\n\t\t\t}\n\t\t\t//load mapping of reserved words and special symbols\n\t\t\tLoadCoreValues();\n\t\t\tinstance = new Tokenizer();\n\t\t}\n\t}", "void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}", "protected void loadKeys() {\n\t\tArrayList<String> lines = ContentLoader.getAllLinesOptList(this.keyfile);\n\t\tfor (String line : lines) {\n\t\t\tString[] parts = line.split(\"=\");\n\t\t\ttry {\n\t\t\t\tint fileID = Integer.parseInt(parts[0].trim());\n\t\t\t\tString restLine = parts[1].trim();\n\t\t\t\tString ccMethodName = restLine;\n\t\t\t\tif (restLine.indexOf('/') > 0) {\n\t\t\t\t\tint leftHashIndex = restLine.indexOf('/');\n\t\t\t\t\tccMethodName = restLine.substring(0, leftHashIndex).trim();\n\t\t\t\t}\n\t\t\t\t// String key = parts[0] + \".java\";\n\t\t\t\tkeyMap.put(fileID, ccMethodName);\n\t\t\t} catch (Exception exc) {\n\t\t\t\tSystem.err.println(line);\n\t\t\t}\n\t\t}\n\t}", "protected Program(String fileName, \n Map<FunctionSignature,FunctionLike> fileFunctions,\n Map<Type, DataDeclaration> structDecs,\n List<Expr> exprList) {\n \n this.fileName = fileName;\n this.fileFunctions = fileFunctions;\n this.structDecs = structDecs;\n this.exprList = exprList;\n }", "@Override\n public void load(String keyWord, String fileName){\n FileReader loadDetails;\n String record;\n try{\n loadDetails=new FileReader(fileName);\n BufferedReader bin=new BufferedReader(loadDetails);\n while (((record=bin.readLine()) != null)){\n if ((record).contentEquals(keyWord)){\n setUsername(record);\n setPassword(bin.readLine());\n setFirstname(bin.readLine());\n setLastname(bin.readLine());\n setDoB((Date)DMY.parse(bin.readLine()));\n setContactNumber(bin.readLine());\n setEmail(bin.readLine());\n setSalary(Float.valueOf(bin.readLine()));\n setPositionStatus(bin.readLine());\n homeAddress.load(bin);\n }//end if\n }//end while\n bin.close();\n }//end try\n catch (IOException ioe){}//end catch\n catch (ParseException ex) {\n Logger.getLogger(Product.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public abstract Source load(ModuleName name);", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public void load(String filePath) throws GTFException {\n\n\t\tString exceptionPrefix = \"The argument file '\" + filePath + \"' \";\n\n\t\ttry {\n\t\t\tprops.load(new FileInputStream(filePath));\n\n\t\t\t//\n\t\t\t// Validate the arguments (to fail early if something is wrong)\n\t\t\t//\n\n\t\t\t// Configuration directory\n\t\t\tString configurationDirectory = getConfigurationDirectory();\n\t\t\tvalidateDirectoryEntry(configurationDirectory, ARGUMENT_CONFIGURATION_DIRECTORY, exceptionPrefix);\n\n\t\t\t// Testsuite directory\n\t\t\tString testsuiteDirectory = getTestsuiteDirectory();\n\t\t\tvalidateDirectoryEntry(testsuiteDirectory, ARGUMENT_TESTSUITE_DIRECTORY, exceptionPrefix);\n\n\t\t\t// Backup directory\n\t\t\tString backupDirectory = getBackupDirectory();\n\t\t\tif (StringUtils.isNotEmpty(backupDirectory)) {\n\t\t\t\tvalidateDirectoryEntry(backupDirectory, ARGUMENT_BACKUP_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t\t// Mapping directory\n\t\t\tString mappingDirectory = getMappingDirectory();\n\t\t\tif (StringUtils.isNotEmpty(mappingDirectory)) {\n\t\t\t\tvalidateDirectoryEntry(mappingDirectory, ARGUMENT_MAPPING_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t\t// Input Type\n\t\t\tString inputType = StringUtils.upperCase(props.getProperty(ARGUMENT_INPUT_TYPE));\n\t\t\tif (inputType != null) {\n\t\t\t\tif (!StringUtils.equals(inputType, INPUT_TYPE_XLS)) {\n\t\t\t\t\tthrow new GTFException(exceptionPrefix + \"contains an entry for '\" + ARGUMENT_INPUT_TYPE\n\t\t\t\t\t\t\t+ \"' that is not supported. Supported values are: \" + SUPPORTED_INPUT_TYPES);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// XLS-Directory\n\t\t\tif (StringUtils.equals(getInputType(), INPUT_TYPE_XLS)) {\n\t\t\t\tString xlsDirectory = getXLSDirectory();\n\t\t\t\tvalidateDirectoryEntry(xlsDirectory, ARGUMENT_XLS_DIRECTORY, exceptionPrefix);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new GTFException(exceptionPrefix + \"could not be found.\", e.getCause());\n\t\t} catch (IOException e) {\n\t\t\tthrow new GTFException(exceptionPrefix + \"could not be loaded.\", e.getCause());\n\t\t}\n\t}", "private String[] loadFile(String filename) {\n\t\treturn loadFile(filename, new String[0], System.lineSeparator());\n\t}", "public void loadGame(String p_FileName) {\n GameEngine l_GE = d_GameSaveLoad.runLoadGame(p_FileName);\n if (Objects.nonNull(l_GE)) {\n this.d_LoadedMap = l_GE.getD_LoadedMap();\n this.d_CurrentPlayer = l_GE.getD_CurrentPlayer();\n this.d_PlayerList = l_GE.getD_PlayerList();\n this.d_Console = l_GE.getD_Console();\n this.d_MapEditor = l_GE.getD_MapEditor();\n this.d_AdminCommandsBuffer = l_GE.getD_AdminCommandsBuffer();\n this.d_OrderBuffer = l_GE.getD_OrderBuffer();\n this.d_OrderStrBuffer = l_GE.getD_OrderStrBuffer();\n this.d_LogEntryBuffer = l_GE.getD_LogEntryBuffer();\n this.d_CurrentPhase = l_GE.getD_CurrentPhase();\n this.d_PreMapLoadPhase = l_GE.getD_PreMapLoadPhase();\n this.d_PostMapEditLoadPhase = l_GE.getD_PostMapEditLoadPhase();\n this.d_StartupPhase = l_GE.getD_StartupPhase();\n this.d_IssueOrdersPhase = l_GE.getD_IssueOrdersPhase();\n this.d_ExecuteOrdersPhase = l_GE.getD_ExecuteOrdersPhase();\n this.d_GameOverPhase = l_GE.getD_GameOverPhase();\n this.d_GameSaveLoad = l_GE.getD_GameSaveLoad();\n }\n }", "public void LoadBinaryFile(String filename) throws RuntimeException\n {\n byte bytepair[];\n int memPtr = 0;\n\n bytepair = new byte[2];\n File theFile = new File(filename);\n if (!theFile.exists())\n throw new RuntimeException(Constants.Error(Constants.FILE_NOT_FOUND) + \" \" + filename);\n try\n {\n FileInputStream is = new FileInputStream(theFile);\n int readingdata = is.read(bytepair);\n while (readingdata > 0)\n {\n if (memPtr >= PROGRAM_MEMORY_SIZE)\n throw new RuntimeException(Constants.Error(Constants.OUT_OF_MEMORY));\n this.setProgramMemory(memPtr++,Utils.unsigned_byte(bytepair[0]) + (Utils.unsigned_byte(bytepair[1]) << 8));\n readingdata = is.read(bytepair);\n }\n is.close();\n }\n catch (IOException e)\n {\n System.err.println(\"Error reading in binary file \" + filename);\n System.err.println(e.toString());\n System.exit(-1);\n }\n return;\n }", "private static void populateDataStructures(\r\n final String filename,\r\n final Map<String, List<String>> sessionsFromCustomer,\r\n Map<String, List<View>> viewsFromSessions,\r\n Map<String, List<Buy>> buysFromSessions\r\n\r\n /* add parameters as needed */\r\n )\r\n throws FileNotFoundException\r\n {\r\n try (Scanner input = new Scanner(new File(filename)))\r\n {\r\n processFile(input, sessionsFromCustomer,\r\n viewsFromSessions, buysFromSessions\r\n /* add arguments as needed */ );\r\n }\r\n }", "public void LoadBoard(String strFilePath){\n\t\t_TEST stack = new _TEST();\t\t\t\t\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"strFilePath:String\", \"\");\t/* TEST */\n\t\tParseFile(strFilePath);\n\t\tstack.PrintTail(ID,\"strFilePath:String\", \"\"); \t\t/* TEST */\n\n\t}", "public static void main(String[] args)\r\n {\r\n\r\n if (args.length < 1) {\r\n System.out.println(\"\\n\\njava mylang file.txt\");//to give error if less than 1\r\n return;\r\n }\r\n\r\n String contents = readFile(args[0]);//read file is a methode not only this remember that arg[0] contains the path of the file because you write java mylang try.txt\r\n\r\n mylang mylob = new mylang();\r\n mylob.interpret(contents);\r\n\r\n }", "protected static void loadFromFile(File worldsFile, Server server) {\n\t\tfinal FileConfiguration configuration = YamlConfiguration.loadConfiguration(worldsFile);\n\t\t\n\t\tfor (final String worldName : configuration.getStringList(\"worlds\")) {\n\t\t\tworlds.add(server.getWorld(worldName));\n\t\t}\n\t}", "private void loadGameFiles(){\n\t}", "public abstract void readFromFile(String key, String value);", "public void loadMem(final File file) {\r\n TempMem.clearNamdAddresses();\r\n TempMem.setText(Input.loadFile(file));\r\n }", "public final void loadDict() {\r\n try {\r\n FileInputStream inf = new FileInputStream(dictionary);\r\n char let;\r\n String str = \"\";\r\n int n = 0;\r\n while ((n = inf.read()) != -1) {\r\n let = (char) n;\r\n if (Character.isLetter(let)) {\r\n str += Character.toLowerCase(let);\r\n }\r\n if ((Character.isWhitespace(let) || let == '-') && !str.isEmpty()) { \r\n dictList[str.charAt(0) - 97].add(str);\r\n str = \"\";\r\n\r\n }\r\n\r\n }\r\n inf.close();\r\n\r\n } catch (IOException e) {\r\n\r\n e.printStackTrace();\r\n\r\n }\r\n }", "public void execfile(String filename) {\n }", "public MutableTextLabels loadOps(TextBase base,File file) throws IOException,FileNotFoundException\n\t{\n\t\tMutableTextLabels labels = new BasicTextLabels(base);\n\t\timportOps(labels,base,file);\n\t\treturn labels;\n\t}", "private void loadDescriptor(File descriptorFile) throws IOException, InvalidXMLException,\n ResourceInitializationException {\n XMLInputSource in = new XMLInputSource(descriptorFile);\n ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);\n ResourceManager manager = UIMAFramework.newDefaultResourceManager();\n\n this.ae = UIMAFramework.produceAnalysisEngine(specifier, manager, null);\n this.cas = this.ae.newCAS();\n\n }", "private void loadButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadButtonMouseClicked\n // open file dialog\n FileDialog dialog = new FileDialog(this, \"Choisir le fichier dictionnaire\", FileDialog.LOAD);\n dialog.setFile(\"*.txt\");\n dialog.setVisible(true);\n \n String filename = dialog.getFile();\n if(filename != null) // if user selected a file\n {\n filename = dialog.getDirectory() + filename;\n lexiNodeTrees = DictioFileOperations.loadListFromFile(filename);\n \n if(lexiNodeTrees != null) // if list was successfully retrieved\n {\n loadedDictionaryFilename = filename;\n refreshAllWordsList();\n \n // clear text area and search suggestion\n searchSuggestionList.setModel(new DefaultListModel());\n definitionTextArea.setText(\"\");\n searchField.setText(\"\");\n }\n \n else // if file could not be loaded, show error dialog\n JOptionPane.showMessageDialog(this, \"ERREUR: Le fichier n'a \"\n + \"pas pu être chargé!\\n\\nVérifiez que le fichier est \"\n + \"valid est contient <<mot & définition>> sur toutes \"\n + \"les lignes\\n\\n\", \"ERREUR\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void loadFile(File file) {\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\t\n\t\t\t// read the column names\n\t\t\tList<String> first = stringToList(in.readLine());\n\t\t\tcolNames = first;\n\t\t\t\n\t\t\t// each line makes a row in the data model\n\t\t\tString line;\n\t\t\tdata = new ArrayList<List>();\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tdata.add(stringToList(line));\n\t\t\t}\n\t\t\t\n\t\t\tin.close();\n\t\t\t\n\t\t\t// Send notifications that the whole table is now different\n\t\t\tfireTableStructureChanged();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n protected void loadStrings() {\r\n \r\n mfile = settings.getProperty( \"mfile\" );\r\n rmode = settings.getProperty( \"rmode\" );\r\n cmap = settings.getProperty( \"cmap\" );\r\n cmapMin = Double.parseDouble( settings.getProperty( \"cmapMin\" ) );\r\n cmapMax = Double.parseDouble( settings.getProperty( \"cmapMax\" ) );\r\n \r\n }", "void load ()\n {\n String name = this.getName();\n try\n {\n\tObject value = Class.forName (className).newInstance ();\n if (value instanceof Syntax)\n\t {\n\t loaded = (Syntax) value;\t\n\t if (name != null && loaded.getName() == null)\n\t loaded.setName(name);\n\t }\n\telse\n\t throw_error (\"failed to autoload valid syntax object \");\n }\n catch (ClassNotFoundException ex)\n {\tthrow_error (\"failed to find class \"); }\n catch (InstantiationException ex)\n { throw_error (\"failed to instantiate class \"); }\n catch (IllegalAccessException ex)\n { throw_error (\"illegal access in class \"); }\n catch (UnboundLocationException e)\n { throw_error (\"missing symbol '\" + e.getMessage () + \"' \"); }\n catch (WrongArguments ex)\n { throw_error (\"type error\"); }\n }", "public void enterFile(CymbolParser.FileContext ctx) {\n globals = new GlobalScope(null);\n currentScope = globals;\n }", "public void runFile(String filename) {\n }", "public Main()\r\n\t{\r\n\t\tload=new Load();\r\n\t\tmyMap=new MyMap();\r\n\t\tload.myMap=myMap;\r\n\t}" ]
[ "0.66969824", "0.6603991", "0.6471524", "0.62926555", "0.62102365", "0.61848927", "0.61703527", "0.6166354", "0.6055925", "0.60468316", "0.59584194", "0.5945343", "0.5903939", "0.5861531", "0.58580875", "0.5781122", "0.5768547", "0.5768547", "0.57673156", "0.5735967", "0.569172", "0.5686234", "0.56744367", "0.5673719", "0.5658446", "0.5625664", "0.561071", "0.561071", "0.5593093", "0.55871004", "0.55747515", "0.5553558", "0.5547126", "0.55350345", "0.55323404", "0.55196124", "0.55180234", "0.5516327", "0.5506771", "0.54965806", "0.54959875", "0.54917055", "0.54789096", "0.547573", "0.54737365", "0.5468215", "0.5449094", "0.543694", "0.54314435", "0.5431374", "0.54064614", "0.54050153", "0.5404923", "0.53803545", "0.53725904", "0.5346291", "0.5332148", "0.533098", "0.53223664", "0.53004944", "0.5298321", "0.5295689", "0.52749455", "0.5273372", "0.52498955", "0.52474767", "0.5240394", "0.52329123", "0.52324", "0.5228057", "0.5226757", "0.5215703", "0.5212605", "0.5206107", "0.5193143", "0.5189284", "0.5177062", "0.5175336", "0.5174349", "0.51710683", "0.51640475", "0.5163257", "0.51554304", "0.51547945", "0.51501715", "0.51372105", "0.5133252", "0.51279956", "0.5123012", "0.51230013", "0.5111163", "0.510395", "0.5096114", "0.5086732", "0.5084683", "0.50796807", "0.5079152", "0.50767833", "0.50673634", "0.5065171" ]
0.60550463
9
===========================================================================================// Creates a new tab
public void newFile() { String filename = "untitled"; filename = JOptionPane.showInputDialog(null, "Enter the new file name"); addTab(filename+".minl"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createTabs() {\r\n\t\ttabbedPane = new JTabbedPane();\r\n\t\t\r\n\t\t//changes title and status bar \r\n\t\ttabbedPane.addChangeListener((l) -> { \r\n\t\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\t\tif (index < 0) {\r\n\t\t\t\tcurrentFile = \"-\";\r\n\t\t\t} else {\r\n\t\t\t\tcurrentFile = tabbedPane.getToolTipTextAt(index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (currentFile.isEmpty()) {\t//file not yet saved\r\n\t\t\t\tcurrentFile = tabbedPane.getTitleAt(tabbedPane.getSelectedIndex());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTitle(currentFile + \" - JNotepad++\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tJTextArea current = getSelectedTextArea();\r\n\t\t\tif (current == null) return;\r\n\t\t\tCaretListener[] listeners = current.getCaretListeners();\r\n\t\t\tlisteners[0].caretUpdate(new CaretEvent(current) {\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Serial UID.\r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getMark() {\r\n\t\t\t\t\treturn 0;\t//not used\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getDot() {\r\n\t\t\t\t\treturn current.getCaretPosition();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t\tcreateSingleTab(null, null);\r\n\t\tgetContentPane().add(tabbedPane, BorderLayout.CENTER);\t\r\n\t}", "public void addNewTab() {\n int count = workspaceTabs.getComponentCount() + 1;\n String title = \"Workspace \" + count;\n WorkspacePanel panel = new WorkspacePanel(title);\n DropHandler dropHandler = searchMenu.createDropHandler(panel.getBaseLayout());\n panel.setDropHandler(dropHandler);\n workspaceTabs.addTab(panel).setCaption(title);\n }", "private void initTabs() {\n\t\tJPanel newTab = new JPanel();\r\n\t\taddTab(\"\", newTab); //$NON-NLS-1$\r\n\t\tsetTabComponentAt(0, new NewPaneButton());\r\n\t\tsetEnabledAt(0, false);\r\n\t\t// Add a new pane\r\n\t\taddPane();\r\n }", "private void addNewTab(SingleDocumentModel model) {\n\t\tString title = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().getFileName().toString();\n\t\tImageIcon icon = createIcon(\"icons/green.png\");\n\t\tJScrollPane component = new JScrollPane(model.getTextComponent());\n\t\tString toolTip = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().toAbsolutePath().toString();\n\t\taddTab(title, icon, component, toolTip);\n\t\tsetSelectedComponent(component);\n\t}", "@Override\n\tpublic Tab newTab() {\n\t\treturn null;\n\t}", "public static void new_tab(By locator) throws CheetahException {\n\t\ttry {\n\t\t\tWebElement element = CheetahEngine.getDriverInstance().findElement(locator);\n\t\t\tdriverUtils.highlightElement(element);\n\t\t\tdriverUtils.unHighlightElement(element);\n\t\t\telement.sendKeys(Keys.CONTROL, \"t\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new CheetahException(e);\n\t\t}\n\n\t}", "private void createTabsDiv() {\n tabsDiv = new Block(Block.Div, \"id='tabs'\");\n page.add(tabsDiv);\n }", "public void onCreateTabClicked(View view) {\n if (mAdapter.isEmpty()) {\n Toast.makeText(this, R.string.you_must_create_at_least_one_tab, Toast.LENGTH_LONG).show();\n return;\n }\n ArrayList<TabInformation> list = new ArrayList<>(mAdapter.getTabInformation());\n startActivity(new Intent(this, DisplayTabsActivity.class).putExtra(TAB_CONTENT, list));\n }", "public Scene createScene() {\n\t\tmyRoot = new AnchorPane();\n\t\tmyTabs = new TabPane();\n\t\tButton newTab = new Button(CREATE_NEW_TAB);\n\t\tnewTab.setOnAction(event -> createNewTab());\n\t\t\n\t\tTabMainScreen mainScreen = new TabMainScreen(myResources.getString(WORKSPACE) + (myTabs.getTabs().size()));\n\t\tTabHelp help1 = new TabHelp(myResources.getString(BASIC_COMMANDS), HELP_TAB_TEXT1);\n\t\tTabHelp help2 = new TabHelp(myResources.getString(EXTENDED_COMMANDS), HELP_TAB_TEXT2);\n\t\t\n\t\tmyTabs.getTabs().addAll(mainScreen.getTab(myStage), help1.getTab(), help2.getTab());\n\t\t\n\t\tAnchorPane.setTopAnchor(myTabs, TABS_OFFSET);\n\t\tAnchorPane.setTopAnchor(newTab, NEWTAB_OFFSET);\n\t\t\n\t\tmyRoot.getChildren().addAll(myTabs, newTab);\n\t\n\t\tmyScene = new Scene(myRoot, windowHeight, windowWidth, Color.WHITE);\n\t\treturn myScene;\n\t}", "public void openTab(String tabName){\r\n\r\n\t\tTabView selectedTabView = new TabView(this);\r\n\t\ttabViews.add(selectedTabView);\r\n\t\t\r\n\t\t\r\n\t\tif(tabName == null){ // If a new tab..\r\n\t\t\t// Ensure that there isn't already a model with that name\r\n\t\t\twhile(propertiesMemento.getTabNames().contains(tabName) || tabName == null){\r\n\t\t\t\ttabName = \"New Model \" + newModelIndex;\r\n\t\t\t\tnewModelIndex++;\r\n\t\t\t}\r\n\t\t}\r\n logger.info(\"Adding tab:\" + tabName);\r\n\r\n\t\t// Just resizes and doesn't scroll - so don't need the scroll pane\r\n\t\t/*JScrollPane scrollPane = new JScrollPane(selectedTabView, \r\n \t\t\t\t\t\t\t\t JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, \r\n \t\t\t\t\t\t\t\t JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\r\n scrollPane.getVerticalScrollBar().setUnitIncrement(20);\r\n tabbedPane.addTab(tabName, scrollPane);*/\r\n\r\n\t\ttabbedPane.addTab(tabName, selectedTabView);\r\n\r\n currentView = selectedTabView;\r\n tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);\r\n setTabName(tabName);\r\n\t\t\t\t\r\n tabbedPane.setTabComponentAt(tabbedPane.getSelectedIndex(), \r\n\t\t\t\t new TabButtonComponent(propertiesMemento.getImageDir(), this, currentView));\r\n \r\n // Add Mouse motion Listener \r\n currentView.addMouseMotionListener(currentView);\r\n currentView.addMouseListener(currentView);\r\n\r\n // Record the tab in the memento\r\n propertiesMemento.addTabRecord(tabName);\r\n \r\n setTabButtons(true);\r\n \r\n setStatusBarText(\"Ready\");\r\n\r\n requestFocusInWindow();\r\n\t}", "protected void openNewTab(WebElement el) {\n\t\taguardaElemento(ExpectedConditions.visibilityOf(el));\n\t\taguardaElemento(ExpectedConditions.elementToBeClickable(el));\n\t\tActions actions = new Actions(Capabilities.getDriver()); \n\t\tactions.moveToElement(el);\n\t\tactions.keyDown(Keys.CONTROL).click(el).keyUp(Keys.CONTROL).build().perform();\n\t}", "public void buttonNewTab(ActionEvent actionEvent) {\n }", "private static void AddTab(MenuActivity activity, TabHost tabHost,\n TabHost.TabSpec tabSpec, TabInfo tabInfo) {\n tabSpec.setContent(activity.new TabFactory(activity));\n tabHost.addTab(tabSpec);\n Log.i(\"LOG\",\"Cria Aba\");\n }", "public TabPane createTabPane(TableauFrame parent) {\n\t\t\tTabPaneExtensionExample tpee = new TabPaneExtensionExample();\n\n\t\t\t/*\n\t\t\t * Optionally you can create a method called setTabName and use the\n\t\t\t * \"name\" value from the configuration.xml file by calling\n\t\t\t * this.getName(). For Example if you have <property\n\t\t\t * name=\"randomTestTab\"\n\t\t\t * class=\"org.kepler.gui.TabPaneExtensionExample$Factory\" /> in\n\t\t\t * configuration.xml then the name of the tab in the GUI becomes\n\t\t\t * randomTestTab\n\t\t\t */\n\t\t\ttpee.setTabName(this.getName());\n\n\t\t\treturn tpee;\n\t\t}", "private void addTab(String title, File file, String contents) {\n \tTextPane newTextPane = new TextPane(parentFrame,TextPane.getProperties(false), false);\r\n\r\n \t// 2nd create the tab\r\n \tStyledTab tab = new StyledTab(title);\r\n \tTextPaneTab paneTab = new TextPaneTab(file, newTextPane, tab);\r\n\r\n \t// 3rd add contents if any\r\n \tif (contents != null) {\r\n \t\tnewTextPane.getBuffer().insert(0, contents);\r\n \t\tnewTextPane.setCaretPosition(0);\r\n \t\tpaneTab.setModified(false);\r\n \t}\r\n\r\n \t// 4th add new TextPaneTab\r\n \tpanes.add(paneTab);\r\n\r\n \t// 5th create the pane and add it to manager\r\n \tJPanel pane = new JPanel();\r\n \tpane.setLayout(new BorderLayout());\r\n\t\tJPanel textPaneContainer = new JPanel();\r\n\t\ttextPaneContainer.setBorder(BorderFactory.createLineBorder(new Color(102, 102, 102), 1));\r\n\t\ttextPaneContainer.setLayout(new BorderLayout());\r\n\t\ttextPaneContainer.add(newTextPane, BorderLayout.CENTER);\r\n \tpane.add(textPaneContainer, BorderLayout.CENTER);\r\n \tpane.add(makePrgButtonPanel(), BorderLayout.EAST);\r\n \tint index = getTabCount()-1;\r\n \tinsertTab(title, null, pane, null, index);\r\n \tsetTabComponentAt(index,tab);\r\n \tif (!file.isDirectory())\r\n \t\tsetToolTipTextAt(index, file.getAbsolutePath());\r\n }", "public void createPage3(){\n tabAbout = new JPanel();\n tabAbout.setLayout( null );\n \n\n JLabel lblGuidText_syn = new JLabel( \"<html><h1>Useless Dictionary</h1><p>Sulochana Kodituwakku<br>2014/CS/066<br>14000662</p></html>\" ); //html can be used in JLables\n lblGuidText_syn.setHorizontalAlignment(JLabel.LEFT);\n lblGuidText_syn.setVerticalAlignment(JLabel.TOP);\n lblGuidText_syn.setBounds( 10, 200, 750, 380 );\n tabAbout.add( lblGuidText_syn );\n \n btnImport.setBounds(10,10,125,25);\n tabAbout.add(btnImport);\n \n \n //set conlick event for Import button\n event_buttonImport ebd = new event_buttonImport();\n btnImport.addActionListener(ebd);\n }", "public void createTabs(ILaunchConfigurationDialog dialog, String mode) {\n setTabs(new ILaunchConfigurationTab[] { new JavaArgumentsTab(),\n new JavaJRETab(), new JavaClasspathTab(), new CommonTab() });\n }", "public AutomatedTestingTabbedPane()\r\n\t{\r\n\t\tsuper();\r\n\t\t\r\n\t\tthis.setBackground(Constants.WHITE);\r\n\t\tthis.setForeground(Constants.BLUE);\r\n\t\t\r\n\t\tthis.setFont(new Font(\"sans-serif\", Font.PLAIN, 16));\r\n\t\tthis.addTab(\"CXCParticipant\", participantPanel);\r\n\t\tthis.setMnemonicAt(0, KeyEvent.VK_1);\r\n\t\t\r\n\t\tthis.addTab(\"CXCToken\", tokenPanel);\r\n\t\tthis.setMnemonicAt(1, KeyEvent.VK_2);\r\n\t\t\r\n\t\tthis.addTab(\"CXCRecipient\", recipientPanel);\r\n\t\tthis.setMnemonicAt(2, KeyEvent.VK_3);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPayment\", paymentPanel);\r\n\t\tthis.setMnemonicAt(3, KeyEvent.VK_4);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPaymentRequest\", paymentRequestPanel);\r\n\t\tthis.setMnemonicAt(4, KeyEvent.VK_5);\r\n\t\t\r\n//\t\tthis.addTab(\"Export\", exportPanel);\r\n//\t\tthis.setMnemonicAt(5, KeyEvent.VK_6);\r\n\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\t\tshell.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\t\t\r\n\t\tfinal TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\r\n\t\ttabFolder.setToolTipText(\"\");\r\n\t\t\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"欢迎使用\");\r\n\t\t\r\n\t\tTabItem tabItem_1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem_1.setText(\"员工查询\");\r\n\t\t\r\n\t\tMenu menu = new Menu(shell, SWT.BAR);\r\n\t\tshell.setMenuBar(menu);\r\n\t\t\r\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.NONE);\r\n\t\tmenuItem.setText(\"系统管理\");\r\n\t\t\r\n\t\tMenuItem menuItem_1 = new MenuItem(menu, SWT.CASCADE);\r\n\t\tmenuItem_1.setText(\"员工管理\");\r\n\t\t\r\n\t\tMenu menu_1 = new Menu(menuItem_1);\r\n\t\tmenuItem_1.setMenu(menu_1);\r\n\t\t\r\n\t\tMenuItem menuItem_2 = new MenuItem(menu_1, SWT.NONE);\r\n\t\tmenuItem_2.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tTabItem tbtmNewItem = new TabItem(tabFolder,SWT.NONE);\r\n\t\t\t\ttbtmNewItem.setText(\"员工查询\");\r\n\t\t\t\t//创建自定义组件\r\n\t\t\t\tEmpQueryCmp eqc = new EmpQueryCmp(tabFolder, SWT.NONE);\r\n\t\t\t\t//设置标签显示的自定义组件\r\n\t\t\t\ttbtmNewItem.setControl(eqc);\r\n\t\t\t\t\r\n\t\t\t\t//选中当前标签页\r\n\t\t\t\ttabFolder.setSelection(tbtmNewItem);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tmenuItem_2.setText(\"员工查询\");\r\n\r\n\t}", "private void setupTabs() {\n }", "public void addTab (String tabname, boolean closeable, Widget widget, final String key) {\n\n\n\t\tPanel localTP = new Panel();\n\t\tlocalTP.setClosable(closeable);\n\t\tlocalTP.setTitle(tabname);\n\t\tlocalTP.setId(key + id);\n\t\tlocalTP.setAutoScroll(true);\n\t\tlocalTP.add(widget);\n\n\t\ttp.add(localTP, this.centerLayoutData);\n\n\t\tlocalTP.addListener(new PanelListenerAdapter() {\n\n\t\t\tpublic void onDestroy(Component component) {\n\t\t\t\topenedTabs.remove(key);\n\t\t\t}\n\t\t});\n\n\n\t\ttp.activate(localTP.getId());\n\n\n\n\n\t\topenedTabs.put(key, localTP);\n\t}", "public Tab openTab(UrlData urlData) {\n Tab tab = showPreloadedTab(urlData);\n if (tab == null) {\n tab = createNewTab(false, true, true);\n if ((tab != null) && !urlData.isEmpty()) {\n loadUrlDataIn(tab, urlData);\n }\n }\n return tab;\n }", "public KonTabbedPane() {\n // Initialize the ArrayList\n graphInterfaces = new ArrayList<DrawingLibraryInterface>();\n\n DirectedGraph<String, DefaultEdge> graph = CreateTestGraph();\n\n /*\n * Adds a tab\n */\n DrawingLibraryInterface<String, DefaultEdge> graphInterface =\n DrawingLibraryFactory.createNewInterface(graph);\n \n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n addTab(\"First Tab\", graphInterface.getPanel());\n\n /*\n * Adds a tab\n */\n graphInterface = DrawingLibraryFactory.createNewInterface(graph);\n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n\n graphInterface.getGraphManipulationInterface().highlightNode(graph\n .vertexSet().iterator().next(), true);\n\n addTab(\"Second Tab\", graphInterface.getPanel());\n }", "private void addTab(String label, int drawableId, Intent i) {\n \tTabHost.TabSpec spec = tabHost.newTabSpec(label);\r\n \tView tabIndicator = LayoutInflater.from(this).inflate(R.layout.tabs, getTabWidget(), false);\r\n \tTextView title = (TextView) tabIndicator.findViewById(R.id.title);\r\n \ttitle.setText(label);\r\n// \tImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);\r\n// \ticon.setImageResource(drawableId);\r\n \tspec.setIndicator(tabIndicator).setContent(i);\r\n \ttabHost.addTab(spec);\r\n }", "public void addTab(String filename) {\n\t\t\n\t\tMinLFile nminl = new MinLFile(filename);\n\t\tJComponent panel = nminl;\n\t\t\n\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\tfilename);\t\t\n\t\ttabbedPane.setMnemonicAt(0, 0);\n\t}", "public boolean newTabOpener() {\n\t\tString selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL, \"t\");\n\t\tdriver.findElement(By.tagName(\"html\")).sendKeys(selectLinkOpeninNewTab);\n\t\treturn true;\n\t}", "private void createTab() {\n tab = new char[tabSize];\n for (int i = 0; i < tabSize; i++) {\n tab[i] = tabChar;\n }\n }", "private void createTabFolder() {\r\n\t\tGridData gridData1 = new GridData();\r\n\t\tgridData1.grabExcessHorizontalSpace = true;\r\n\t\tgridData1.heightHint = 500;\r\n\t\tgridData1.grabExcessVerticalSpace = true;\r\n\t\tgridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;\r\n\t\tgridData1.widthHint = 600;\r\n\t\ttabFolder = new TabFolder(sShell, SWT.NONE);\r\n\t\ttabFolder.setLayoutData(gridData1);\r\n\t\tcreateCompositeRoomMange();\r\n\t\tcreateCompositeGoodsMange();\r\n\t\tcreateCompositeStaffMange();\r\n\t\tcreateCompositeUserMange();\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"房间管理\");\r\n\t\ttabItem.setControl(compositeRoomMange);\r\n\t\tTabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem1.setText(\"商品管理\");\r\n\t\ttabItem1.setControl(compositeGoodsMange);\r\n\t\tTabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem2.setText(\"员工管理\");\r\n\t\ttabItem2.setControl(compositeStaffMange);\r\n\t\tTabItem tabItem3 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem3.setText(\"系统用户管理\");\r\n\t\ttabItem3.setControl(compositeUserMange);\r\n\t}", "private void createTabList() throws UnsupportedEncodingException {\n\n org.mortbay.html.List tabList =\n new org.mortbay.html.List(org.mortbay.html.List.Unordered);\n tabsDiv.add(tabList);\n Integer tabCount = 1;\n for (Map.Entry letterPairs : startLetterList.entrySet()) {\n Character startLetter = (Character) letterPairs.getKey();\n Character endLetter = (Character) letterPairs.getValue();\n Link tabLink = new Link(\"DisplayContentTab?start=\" + startLetter + \"&amp;end=\" + endLetter + \"&amp;group=\"\n + grouping + \"&amp;type=\" + type + \"&amp;filter=\" + filterKey +\n \"&amp;timeKey=\" + timeKey, startLetter + \" - \" + endLetter);\n Composite tabListItem = tabList.newItem();\n tabListItem.add(tabLink);\n Block loadingDiv = new Block(Block.Div, \"id='ui-tabs-\" + tabCount++ + \"'\");\n Image loadingImage = new Image(LOADING_SPINNER);\n loadingImage.alt(\"Loading...\");\n loadingDiv.add(loadingImage);\n loadingDiv.add(\" Loading...\");\n tabsDiv.add(loadingDiv);\n }\n }", "public void makeNew() {\n\t\towner.switchMode(WindowMode.ITEMCREATE);\n\t}", "@Override\r\n protected Control createContents( final Composite parent ) {\r\n TabFolder folder = new TabFolder( parent, SWT.NONE );\r\n\r\n Tab appearanceTab = new AppearanceTab( overlayStore );\r\n createTab( folder, \"Appeara&nce\", appearanceTab.createControl( folder ) );\r\n\r\n Tab syntaxTab = new SyntaxTab( overlayStore );\r\n createTab( folder, \"Synta&x\", syntaxTab.createControl( folder ) );\r\n\r\n Tab annotationsTab = new AnnotationsTab( overlayStore );\r\n createTab( folder, \"Annotation&s\", annotationsTab.createControl( folder ) );\r\n\r\n Tab typingTab = new TypingTab( overlayStore );\r\n createTab( folder, \"T&yping\", typingTab.createControl( folder ) );\r\n\r\n return folder;\r\n }", "public CreateTab(PetriDishApp app) {\r\n\t\tsetText(\"Create\");\r\n\t\tsetClosable(false);\r\n\r\n\t\t// organized in a single VBox\r\n\t\tVBox createTabBox = new VBox();\r\n\t\tcreateTabBox.setPadding(new Insets(10, 5, 10, 5));\r\n\t\tcreateTabBox.setSpacing(10);\r\n\t\tcreateTabBox.setAlignment(Pos.TOP_CENTER);\r\n\t\tsetContent(createTabBox);\r\n\t\t// done setting up box\r\n\r\n\t\t// organized into HBoxes, with separators\r\n\t\tcreateTabBox.getChildren().add(new Separator());\r\n\t\t// each section labeled\r\n\t\tcreateTabBox.getChildren().add(new Label(\"New Simulation Size\"));\r\n\r\n\t\tHBox topBox = new HBox();\r\n\t\tcreateTabBox.getChildren().add(topBox);\r\n\t\ttopBox.setSpacing(10);\r\n\t\ttopBox.setAlignment(Pos.CENTER_LEFT);\r\n\r\n\t\tcreateTabBox.getChildren().add(new Separator());\r\n\t\tcreateTabBox.getChildren().add(new Label(\"New Simulation Cell Pops\"));\r\n\r\n\t\tHBox secondBox = new HBox();\r\n\t\tcreateTabBox.getChildren().add(secondBox);\r\n\t\tsecondBox.setSpacing(10);\r\n\t\tsecondBox.setAlignment(Pos.CENTER_LEFT);\r\n\r\n\t\tcreateTabBox.getChildren().add(new Separator());\r\n\t\t// finished setting up organization\r\n\r\n\t\t// begin adding GUI elements to their HBoxes\r\n\r\n\t\t// width input box\r\n\t\tBoundedIntField simDimWidthMsg = new BoundedIntField(PetriDishApp.MIN_PETRI_DISH_DIM,\r\n\t\t\t\tPetriDishApp.MAX_PETRI_DISH_DIM);\r\n\t\tsimDimWidthMsg.setMaxWidth(75);\r\n\r\n\t\tsimDimWidthMsg.integerProperty().bindBidirectional(app.newSimulationWidth);\r\n\r\n\t\t// height input box\r\n\t\tBoundedIntField simDimHeightMsg = new BoundedIntField(PetriDishApp.MIN_PETRI_DISH_DIM,\r\n\t\t\t\tPetriDishApp.MAX_PETRI_DISH_DIM);\r\n\t\tsimDimHeightMsg.setMaxWidth(75);\r\n\r\n\t\tsimDimHeightMsg.integerProperty().bindBidirectional(app.newSimulationHeight);\r\n\r\n\t\ttopBox.getChildren().add(simDimWidthMsg);\r\n\t\ttopBox.getChildren().add(simDimHeightMsg);\r\n\r\n\t\t// input fields for starting cell populations\r\n\t\t\r\n\t\t// agar\r\n\t\tBoundedIntField simAgarPopMsg = new BoundedIntField();\r\n\t\tsimAgarPopMsg.setMaxWidth(50);\r\n\r\n\t\tsimAgarPopMsg.integerProperty().bindBidirectional(app.newSimulationAgarPop);\r\n\t\t\r\n\t\t// grazer\r\n\t\tBoundedIntField simGrazerPopMsg = new BoundedIntField();\r\n\t\tsimGrazerPopMsg.setMaxWidth(50);\r\n\r\n\t\tsimGrazerPopMsg.integerProperty().bindBidirectional(app.newSimulationGrazerPop);\r\n\t\t\r\n\t\t// pred\r\n\t\tBoundedIntField simPredPopMsg = new BoundedIntField();\r\n\t\tsimPredPopMsg.setMaxWidth(50);\r\n\r\n\t\tsimPredPopMsg.integerProperty().bindBidirectional(app.newSimulationPredPop);\r\n\t\t\r\n\t\t// plant\r\n\t\tBoundedIntField simPlantPopMsg = new BoundedIntField();\r\n\t\tsimPlantPopMsg.setMaxWidth(50);\r\n\r\n\t\tsimPlantPopMsg.integerProperty().bindBidirectional(app.newSimulationPlantPop);\r\n\t\t\r\n\t\t// add those input boxes to the second box\r\n\t\t// with their own labels in VBoxes\r\n\t\t\r\n\t\tArrayList<VBox> labelContainers = new ArrayList<VBox>();\r\n\t\t\r\n\t\t// make the boxes\r\n\t\t\r\n\t\tVBox simAgarPopMsgContainer = new VBox();\r\n\t\tVBox simGrazerPopMsgContainer = new VBox();\r\n\t\tVBox simPredPopMsgContainer = new VBox();\r\n\t\tVBox simPlantPopMsgContainer = new VBox();\r\n\t\t\r\n\t\t// configure the boxes\r\n\t\t\r\n\t\tlabelContainers.add(simAgarPopMsgContainer);\r\n\t\tlabelContainers.add(simGrazerPopMsgContainer);\r\n\t\tlabelContainers.add(simPredPopMsgContainer);\r\n\t\tlabelContainers.add(simPlantPopMsgContainer);\r\n\t\t\r\n\t\tfor (VBox v : labelContainers) {\r\n\t\t\tv.setPadding(new Insets(10, 5, 10, 5));\r\n\t\t\tv.setSpacing(10);\r\n\t\t\tv.setAlignment(Pos.TOP_CENTER);\r\n\t\t}\r\n\t\t\r\n\t\tsimAgarPopMsgContainer.getChildren().add(new Label(\"Agar\"));\r\n\t\tsimAgarPopMsgContainer.getChildren().add(simAgarPopMsg);\r\n\t\t\r\n\t\tsimGrazerPopMsgContainer.getChildren().add(new Label(\"Grazer\"));\r\n\t\tsimGrazerPopMsgContainer.getChildren().add(simGrazerPopMsg);\r\n\t\t\r\n\t\tsimPredPopMsgContainer.getChildren().add(new Label(\"Predator\"));\r\n\t\tsimPredPopMsgContainer.getChildren().add(simPredPopMsg);\r\n\t\t\r\n\t\tsimPlantPopMsgContainer.getChildren().add(new Label(\"Plant\"));\r\n\t\tsimPlantPopMsgContainer.getChildren().add(simPlantPopMsg);\r\n\t\t\r\n\t\tfor (VBox v : labelContainers) {\r\n\t\t\tsecondBox.getChildren().add(v);\r\n\t\t}\r\n\t\t\r\n\t}", "private void createTabs(){\n canvasPanel = new JPanel();\n canvasPanel.setLayout(new BorderLayout());\n canvasPanel.add(mCanvas, BorderLayout.CENTER);\n canvasPanel.setMinimumSize(new Dimension(100,50));\n \n // Create the options and properties panel\n optionPanel = new JPanel();\n optionPanel.setLayout(new FlowLayout());\n\n // Set the size\n optionPanel.setMinimumSize(new Dimension(30,30));\t\n optionPanel.setPreferredSize(new Dimension(200,10));\n\n // Create the log area\n mLogArea = new JTextArea(5,20);\n mLogArea.setMargin(new Insets(5,5,5,5));\n mLogArea.setEditable(false);\n JScrollPane logScrollPane = new JScrollPane(mLogArea);\n \n // Das SplitPanel wird in optionPanel (links) und canvasPanel (rechts) unterteilt\n JSplitPane split = new JSplitPane();\n split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n split.setLeftComponent(canvasPanel);\n split.setRightComponent(optionPanel);\n \n JSplitPane splitLog = new JSplitPane();\n splitLog.setOrientation(JSplitPane.VERTICAL_SPLIT);\n splitLog.setBottomComponent(logScrollPane);\n splitLog.setTopComponent(split);\n splitLog.setResizeWeight(1);\n \n mMainFrame.add(splitLog, BorderLayout.CENTER); \n }", "private void createSingleTab(String text, Path path) {\r\n\t\tif (text == null) {\r\n\t\t\ttext = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tJTextArea txtArea = new JTextArea(text);\r\n\t\ttxtArea.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprivate void changeIcon() {\r\n\t\t\t\ttabbedPane.setIconAt(tabbedPane.getSelectedIndex(), redIcon);\r\n\t\t\t}\r\n\t\t});\r\n\t\ttxtArea.addCaretListener(new CaretListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void caretUpdate(CaretEvent e) {\r\n\t\t\t\tlengthLab.setText(\"Length: \"+txtArea.getText().length());\r\n\t\t\t\t\r\n\t\t\t\tint offset = txtArea.getCaretPosition();\r\n\t int line= 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tline = txtArea.getLineOfOffset(offset);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tlnLab.setText(\"Ln: \"+(line+1));\r\n\t\t\t\t\r\n\t\t\t\tint col = 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcol = offset - txtArea.getLineStartOffset(line);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tcolLab.setText(\"Col: \"+ (col+1));\r\n\t\t\t\t\r\n\t\t\t\tint sel = Math.abs(txtArea.getSelectionStart() - txtArea.getSelectionEnd());\t\r\n\t\t\t\tselLab.setText(\"sel: \"+sel);\r\n\t\t\t\tfor (JMenuItem i : toggable) {\r\n\t\t\t\t\tboolean enabled;\r\n\t\t\t\t\tenabled = sel != 0;\r\n\t\t\t\t\ti.setEnabled(enabled);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJScrollPane scrPane = new JScrollPane(txtArea);\r\n\t\tif (path == null) {\t//create empty tab\t\r\n\t\t\tString name = \"New \" + (count +1);\r\n\t\t\ttabbedPane.addTab(name, greenIcon, scrPane, \"\");\r\n\t\t\tcount++;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttabbedPane.addTab(path.getFileName().toString(), greenIcon, scrPane, path.toString());\r\n\t\tcount++;\r\n\t}", "private void addScheduleTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_VISIBLE_TRACKS);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_SCHEDULE);\n spec.setIndicator(mResources.getString(R.string.schedule), mResources\n .getDrawable(R.drawable.ic_tab_schedule));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private void createView() {\n\t\tTabWidget tWidget = (TabWidget) findViewById(android.R.id.tabs);\r\n\t\tshowLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView = (ImageView) showLayout.getChildAt(0);\r\n\t\tTextView textView = (TextView) showLayout.getChildAt(1);\r\n\t\timageView.setImageResource(R.drawable.main_selector);\r\n\t\ttextView.setText(R.string.show);\r\n\r\n\t\taddLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView1 = (ImageView) addLayout.getChildAt(0);\r\n\t\tTextView textView1 = (TextView) addLayout.getChildAt(1);\r\n\t\timageView1.setImageResource(R.drawable.add_selector);\r\n\t\ttextView1.setText(R.string.add_record);\r\n\r\n\t\tchartLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView2 = (ImageView) chartLayout.getChildAt(0);\r\n\t\tTextView textView2 = (TextView) chartLayout.getChildAt(1);\r\n\t\timageView2.setImageResource(R.drawable.chart_selector);\r\n\t\ttextView2.setText(R.string.chart_show);\r\n\t}", "private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}", "@Override\n\tpublic void addTab(Tab tab) {\n\t\t\n\t}", "private void createContents() {\r\n\t\tshell = new Shell(getParent(), SWT.TITLE);\r\n\r\n\t\tgetParent().setEnabled(false);\r\n\r\n\t\tshell.addShellListener(new ShellAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void shellClosed(ShellEvent e) {\r\n\t\t\t\tgetParent().setEnabled(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tshell.setImage(SWTResourceManager.getImage(LoginInfo.class, \"/javax/swing/plaf/metal/icons/ocean/warning.png\"));\r\n\r\n\t\tsetMidden(397, 197);\r\n\r\n\t\tshell.setText(this.windows_name);\r\n\t\tshell.setLayout(null);\r\n\r\n\t\tLabel label = new Label(shell, SWT.NONE);\r\n\t\tlabel.setFont(SWTResourceManager.getFont(\"Microsoft YaHei UI\", 11, SWT.NORMAL));\r\n\t\tlabel.setBounds(79, 45, 226, 30);\r\n\t\tlabel.setAlignment(SWT.CENTER);\r\n\t\tlabel.setText(this.label_show);\r\n\r\n\t\tButton button = new Button(shell, SWT.NONE);\r\n\t\tbutton.setBounds(150, 107, 86, 30);\r\n\t\tbutton.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tshell.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\tbutton.setText(\"确定\");\r\n\r\n\t}", "@Test\r\n\tpublic void TC004() {\r\n\t\t// 1. User Opens the JBrick application\r\n\t\t// => The Code Frame has only one tab opened, \"New File 1\"\r\n\t\t\r\n\t\tMainWindow jbricks = StartupFunctions.newJBricksInstance(\"JBricks - TC004\");\r\n\t\tString fileName = FileFunctions.getFileName(jbricks);\r\n\t\tassertTrue(fileName.equals(\"New File 1\"));\r\n\t\t\r\n\t\t// 2. User creates a new file using File>New menu option\r\n\t\t// => A new tab is generated in the code frame, labeled \"New File 2\"\r\n\t\t\r\n\t\tMenuFunctions.newFile(jbricks);\r\n\t\tint tabCount = FileFunctions.getTabCount(jbricks);\r\n\t\tassertTrue(tabCount == 2);\r\n\t\tfileName = FileFunctions.getCurrentFile(jbricks);\r\n\t\tassertTrue(fileName.equals(\"New File 2\"));\r\n\t}", "public AccidentFrame(){\r\n super(\"Motor Vehicle Registration Application\");\r\n accidentPanel = new AccidentPanel();\r\n JTabbedPane tabbedPane = new JTabbedPane();\r\n tabbedPane.addTab(\"Add new accident\", accidentPanel); \r\n tabbedPane.addTab(\"View all accidents\", new DisplayAccident());\r\n JLabel titleLabel=new JLabel(\"Queensland Road and Transport Authority\");\r\n \r\n this.add(tabbedPane);\r\n \r\n }", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\r\n\t}", "public JTabbedPane createPanel()\r\n {\r\n\r\n /** LoadTabPaneData Thread - Inner class that will load the historic data on the AWT\r\n * Thread as to not muck up things on the GUI thread\r\n * The Thread will die after it loads everything.\r\n */\r\n class LoadTabPaneDataTask extends TimerTask\r\n {\r\n // Handle to main outer class\r\n WatchListTableModule watchListTableModule = null;\r\n\r\n /** \r\n * LoadTabPaneDataTask constructor\r\n */\r\n public LoadTabPaneDataTask(WatchListTableModule watchListTableModule)\r\n {\r\n this.watchListTableModule = watchListTableModule;\r\n }\r\n\r\n /** \r\n * LoadTabPaneDataTask::run() this method simply invokes. \r\n * WatchListTableModule::loadPersistantWatchLists() method.\r\n * The method will populate all watchlists to be loaded on\r\n * the JTabbedPane then it dies off\r\n */\r\n public void run()\r\n {\r\n debug(\"LoadTabPaneDataTask::run() - calling watchListTableModule.loadPersistantWatchLists()\");\r\n watchListTableModule.loadPersistantWatchLists();\r\n this.cancel();\r\n }\r\n }\r\n\r\n // Create an Application Properties instance\r\n appProps = new AppProperties(getString(\"WatchListTableModule.application_ini_filename\"));\r\n // Setup our Time Delays\r\n standardDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.standard_time_delay\"), ONE_MINUTE);\r\n extendedDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.extended_time_delay\"), ONE_HOUR);\r\n\r\n // Create our Basic Tabbed Pane and Listener ( inner class )\r\n tabPane = new JTabbedPane();\r\n tabPane.addChangeListener(new TabPaneListener());\r\n\r\n // Load the Tab Pane Data on the Util Event Thread as \r\n // to get our screen up and going as fast as possible\r\n // So we can get out of here - This Inner class thread\r\n // invokes method\r\n // loadPersistantWatchLists();\r\n TimerTask tabPaneTask = new LoadTabPaneDataTask(this);\r\n Timer timer = new Timer(true); // Deamon\r\n timer.schedule(tabPaneTask, ONE_SECOND);\r\n\r\n return tabPane;\r\n }", "@Override\n\tprotected void createShell() {\n\t\tString shellText = \"Add a New Pharmacy\";\n\t\tRectangle bounds = new Rectangle(25, 0, 800, 680);\n\t\tbuildShell(shellText, bounds);\n\t}", "public void add(TabLike tab){\n TabLabel btn = tabLabelCreator.create(tab.getName(), this);\n\n tab.setVisible(tabs.isEmpty());\n btn.setDisable(tabs.isEmpty());\n if (tabs.isEmpty()){\n selected = btn;\n }\n\n tabs.add(tab);\n nameTab.getChildren().add(btn);\n tabContent.getChildren().add(tab);\n tab.setContainer(this);\n }", "@Override\n public void addTab(String title, Component component) {\n this.addTab(title, null, component, null, null);\n }", "public void createCompareWindowTabItem() {\r\n\t\tif (this.compareTabItem == null || this.compareTabItem.isDisposed()) {\r\n\t\t\tfor (int i = 0; i < this.displayTab.getItemCount(); ++i) {\r\n\t\t\t\tCTabItem tabItem = this.displayTab.getItems()[i];\r\n\t\t\t\tif (tabItem instanceof FileCommentWindow) {\r\n\t\t\t\t\tthis.compareTabItem = new GraphicsWindow(this.displayTab, SWT.NONE, GraphicsType.COMPARE, Messages.getString(MessageIds.GDE_MSGT0144), i);\r\n\t\t\t\t\tthis.compareTabItem.create();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.connect);\n tabLayout.getTabAt(1).setIcon(R.drawable.speak);\n tabLayout.getTabAt(2).setIcon(R.drawable.walk);\n tabLayout.getTabAt(3).setIcon(R.drawable.camera);\n tabLayout.getTabAt(4).setIcon(R.drawable.moves);\n }", "@Then(\"^user clicks on new customer tab$\")\n\tpublic void user_clicks_on_new_customer_tab() {\n\t driver.findElement(By.xpath(\"//a[@href='addcustomerpage.php']\")).click();\n\t \n\t}", "public void createAndShowGUI() {\n frame= new JFrame(\"TabAdmin\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setLocation(200,50);\n //Create and set up the content pane.\n \n addComponentToPane(frame.getContentPane());\n \n //Display the window.\n frame.pack();\n frame.setVisible(true);\n //create admin to operate \n \n }", "private void createNewListSection() {\n\t\tImageIcon image10 = new ImageIcon(sURLFCL1);\n\t\tImageIcon image11 = new ImageIcon(sURLFCL2);\n\t\tImageIcon image12 = new ImageIcon(sURLFCL3);\n\t\tjbCreateLists = new JButton(\"New PlayList\");\n\t\tjbCreateLists.setFont(new java.awt.Font(\"Century Gothic\",0, 15));\n\t\tjbCreateLists.setForeground(new Color(150,100,100));\n\t\tjbCreateLists.setIcon(image10);\n\t\tjbCreateLists.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tjbCreateLists.setVerticalTextPosition(SwingConstants.CENTER);\n\t\tjbCreateLists.setRolloverIcon(image11);\n\t\tjbCreateLists.setRolloverSelectedIcon(image12);\t\n\t\tjbCreateLists.setContentAreaFilled(false);\n\t\tjbCreateLists.setFocusable(false);\n\t\tjbCreateLists.setBorderPainted(false);\n\t}", "public ICurrentPage openNewWindow(String url);", "Page createPage();", "private void createNetworksPanel() {\n\t\ttabs = new ArrayList<>();\n\t\tnetworksPanel = new JTabbedPane();\n\t\tthis.add(networksPanel, BorderLayout.CENTER);\n\t}", "private void createContents() {\n shell = new Shell(getParent(), SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);\n shell.setSize(FORM_WIDTH, 700);\n shell.setText(getText());\n shell.setLayout(new GridLayout(1, false));\n\n TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\n tabFolder.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n // STRUCTURE PARAMETERS\n\n TabItem tbtmStructure = new TabItem(tabFolder, SWT.NONE);\n tbtmStructure.setText(\"Structure\");\n\n Composite grpStructure = new Composite(tabFolder, SWT.NONE);\n tbtmStructure.setControl(grpStructure);\n grpStructure.setLayout(TAB_GROUP_LAYOUT);\n grpStructure.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n ParmDialogText.load(grpStructure, parms, \"meta\");\n ParmDialogText.load(grpStructure, parms, \"col\");\n ParmDialogText.load(grpStructure, parms, \"id\");\n ParmDialogChoices.load(grpStructure, parms, \"init\", Activation.values());\n ParmDialogChoices.load(grpStructure, parms, \"activation\", Activation.values());\n ParmDialogFlag.load(grpStructure, parms, \"raw\");\n ParmDialogFlag.load(grpStructure, parms, \"batch\");\n ParmDialogGroup cnn = ParmDialogText.load(grpStructure, parms, \"cnn\");\n ParmDialogGroup filters = ParmDialogText.load(grpStructure, parms, \"filters\");\n ParmDialogGroup strides = ParmDialogText.load(grpStructure, parms, \"strides\");\n ParmDialogGroup subs = ParmDialogText.load(grpStructure, parms, \"sub\");\n if (cnn != null) {\n if (filters != null) cnn.setGrouped(filters);\n if (strides != null) cnn.setGrouped(strides);\n if (subs != null) cnn.setGrouped(subs);\n }\n ParmDialogText.load(grpStructure, parms, \"lstm\");\n ParmDialogGroup wGroup = ParmDialogText.load(grpStructure, parms, \"widths\");\n ParmDialogGroup bGroup = ParmDialogText.load(grpStructure, parms, \"balanced\");\n if (bGroup != null && wGroup != null) {\n wGroup.setExclusive(bGroup);\n bGroup.setExclusive(wGroup);\n }\n\n // SEARCH CONTROL PARAMETERS\n\n TabItem tbtmSearch = new TabItem(tabFolder, SWT.NONE);\n tbtmSearch.setText(\"Training\");\n\n ScrolledComposite grpSearch0 = new ScrolledComposite(tabFolder, SWT.V_SCROLL);\n grpSearch0.setLayout(new FillLayout());\n grpSearch0.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n tbtmSearch.setControl(grpSearch0);\n Composite grpSearch = new Composite(grpSearch0, SWT.NONE);\n grpSearch0.setContent(grpSearch);\n grpSearch.setLayout(TAB_GROUP_LAYOUT);\n grpSearch.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n Enum<?>[] preferTypes = (this.modelType == TrainingProcessor.Type.CLASS ? RunStats.OptimizationType.values()\n : RunStats.RegressionType.values());\n ParmDialogChoices.load(grpSearch, parms, \"prefer\", preferTypes);\n ParmDialogChoices.load(grpSearch, parms, \"method\", Trainer.Type.values());\n ParmDialogText.load(grpSearch, parms, \"bound\");\n ParmDialogChoices.load(grpSearch, parms, \"lossFun\", LossFunctionType.values());\n ParmDialogText.load(grpSearch, parms, \"weights\");\n ParmDialogText.load(grpSearch, parms, \"iter\");\n ParmDialogText.load(grpSearch, parms, \"batchSize\");\n ParmDialogText.load(grpSearch, parms, \"testSize\");\n ParmDialogText.load(grpSearch, parms, \"maxBatches\");\n ParmDialogText.load(grpSearch, parms, \"earlyStop\");\n ParmDialogChoices.load(grpSearch, parms, \"regMode\", Regularization.Mode.values());\n ParmDialogText.load(grpSearch, parms, \"regFactor\");\n ParmDialogText.load(grpSearch, parms, \"seed\");\n ParmDialogChoices.load(grpSearch, parms, \"start\", WeightInit.values());\n ParmDialogChoices.load(grpSearch, parms, \"gradNorm\", GradientNormalization.values());\n ParmDialogChoices.load(grpSearch, parms, \"updater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"learnRate\");\n ParmDialogChoices.load(grpSearch, parms, \"bUpdater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"updateRate\");\n\n grpSearch.setSize(grpSearch.computeSize(FORM_WIDTH - 50, SWT.DEFAULT));\n\n // BOTTOM BUTTON BAR\n\n Composite grpButtonBar = new Composite(shell, SWT.NONE);\n grpButtonBar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));\n grpButtonBar.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n Button btnSave = new Button(grpButtonBar, SWT.NONE);\n btnSave.setText(\"Save\");\n btnSave.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n Button btnClose = new Button(grpButtonBar, SWT.NONE);\n btnClose.setText(\"Cancel\");\n btnClose.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n shell.close();\n }\n });\n\n Button btnOK = new Button(grpButtonBar, SWT.NONE);\n btnOK.setText(\"Save and Close\");\n btnOK.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n shell.close();\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n }", "private void createNewWebView()\n {\n //Remove the webView from it's parent if the webView exists\n if(webView != null) {\n ViewGroup parent = (ViewGroup) webView.getParent();\n parent.removeView(webView);\n }\n\n //Create a new WebView\n webView = new WebView(getContext());\n webView.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));\n\n //Add the new WebView to the webViewContainer\n webViewContainer.addView(webView);\n }", "public JTabbedPaneDemo() {\n\t\ttabbedPane = new JTabbedPane(JTabbedPane.TOP);\n\t\t// panel=new Panel();\n\t\t// panel.setBackground(Color.RED);\n\t\t// music=new JPanel();\n\t\t// music.setBackground(Color.green);\n\t\ttabbedPane.addTab(\"panel\", new JLabel(\"标签\"));\n\t\ttabbedPane.addTab(\"music\", new Button(\"按钮\"));\n\t\tadd(tabbedPane);\n\t\tsetBounds(500, 100, 500, 500);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}", "NewAccountPage openNewAccountPage();", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "private VTabSheet initTabLayout() {\r\n VTabSheet tabs = new VTabSheet();\r\n Map<Component, Integer> tabComponentMap = new HashMap<Component, Integer>();\r\n Binder<Report> binder = new Binder<>(Report.class);\r\n fireEventTypeComponent = new FireEventTypeDataTab(report,userNeedToPrepare, binder, tabComponentMap);\r\n boolean basicEditRight = !report.getStatus().equals(ReportStatus.APPROVED) && (organizationIsCreator || userNeedToPrepare);\r\n tabs.addTab(getTranslation(\"reportView.tab.basicData.label\"), new ReportBasicDataTab(report, binder, basicEditRight, tabComponentMap, addressServiceRef.get(), this));\r\n tabs.addTab(getTranslation(\"reportView.tab.forcesData.label\"), new ReportForcesTab(report, userNeedToPrepare, organizationServiceRef.get(), vechileServiceRef.get(), reportServiceRef.get()));\r\n fireEventTab = tabs.addTab(getTranslation(\"reportView.tab.fireEventData.label\"), fireEventTypeComponent);\r\n tabs.addTab(getTranslation(\"reportView.tab.authorizationData.label\"), new ReportAuthorizationTab(report, binder, userNeedToPrepare, (userNeedToPrepare || userNeedToApprove), tabs, tabComponentMap, organizationServiceRef.get(), reportServiceRef.get(), notificationServiceRef.get()));\r\n return tabs;\r\n }", "protected abstract void doAddTab(GridTab tab, JPiereIADTabpanel tabPanel);", "public void switchToCreateAccount() {\r\n\t\tlayout.show(this, \"createPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "private void initTab()\n {\n \n }", "public void newWindow() {\n\t\tJMenuTest frame1 = new JMenuTest();\n\t\tframe1.setBounds(100, 100, 400, 400);\n\t\tframe1.setVisible(true);\n\t}", "@Override\n\tpublic void addTab(Tab tab, int position) {\n\t\t\n\t}", "public Tabs() {\n initComponents();\n }", "private JTabbedPane getJTabbedPane() {\r\n\t\tif (jTabbedPane == null) {\r\n\t\t\tjTabbedPane = new JTabbedPane();\r\n\t\t\tjTabbedPane.addTab(\"Basic Info\", null, getBasicInfo(), null);\r\n\t\t\tjTabbedPane.addTab(\"Configuration Info\", null, getConfigurationInfo(), null);\r\n\t\t}\r\n\t\treturn jTabbedPane;\r\n\t}", "public RSMLGUI() {\r\n\t super(\"RSML Exporter\");\r\n\t instance = this;\r\n\t tp = new JTabbedPane();\r\n\t tp.setFont(font);\r\n\t tp.setSize(300, 600);\r\n\t getContentPane().add(tp);\r\n\t tp.addTab(\"Data transfer\", getDataTransfersTab()); \r\n\t \t\r\n\t pack();\r\n\t setVisible(true);\r\n }", "public void applyTab();", "public NewPageWizard(IXWikiSpace sapce)\n {\n super();\n setWindowTitle(\"Add New Page...\");\n setNeedsProgressMonitor(false);\n this.space = sapce;\n }", "private void addTabs(List<TemplateAttribute> templateAttributes, TemplateRelation tr) {\n ObjectGroupTab otv = null;\n int prevTgId = 0;\n for (TemplateAttribute ta : templateAttributes) {\n if (ta.getTgId() != prevTgId) {\n prevTgId = ta.getTgId();\n if (ta.getTg().getSubRank() == 0) {\n otv = tr == null ? new ObjectGroupTab(this, ta.getTg())\n : new ObjectRelationGroupTab(this, tr, ta.getTg());\n add(otv, ta.getTg().getName());\n final int iTab = getTabBar().getTabCount() - 1;\n getTabBar().getTab(iTab).addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n getModel().setTemplateRelation(null);\n }\n });\n }\n otv.displayGroupLabel(ta.getTg());\n }\n\n TemplateWidget tw = otv.display(ta);\n if (tw != null)\n tw.initialize();\n }\n if (getTabBar().getTabCount() > 0)\n selectTab(0);\n }", "private void addTracksTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n //intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n // SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_TWITTER);\n spec.setIndicator(mResources.getString(R.string.tracks), mResources\n .getDrawable(R.drawable.ic_menu_archive));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "@Override\r\n public void create() {\r\n super.create();\r\n setTitle(title);\r\n }", "void openCustomTab(String url) {\n CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();\n // set toolbar color and/or setting custom actions before invoking build()\n builder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));\n builder.addDefaultShareMenuItem();\n // Once ready, call CustomTabsIntent.Builder.build() to create a CustomTabsIntent\n CustomTabsIntent customTabsIntent = builder.build();\n // and launch the desired Url with CustomTabsIntent.launchUrl()\n customTabsIntent.launchUrl(this, Uri.parse(url));\n }", "public CloseableTabbedPane(String name, JPanel component, Supplier<Void> addListener) {\n super();\n this.addListener = addListener;\n super.addTab(name, new JScrollPane(component, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER));\n JPanel empty = new JPanel();\n iconCallback.put(empty, addListener);\n super.addTab(\"\", null, empty, \"Click here to create new script\");\n initializeMouseListener();\n setEnabledAt(1, false);\n setDisabledIconAt(1, new NewTabIcon());\n /*addChangeListener((l)->{\n if (getTabCount() -1 == getSelectedIndex()) {\n addListener.get();\n }\n });*/\n }", "public void addMainTab(String label, String historyToken, String contentUrl, TabOptions options) {\n addTab(MainTabPanelPresenter.TYPE_RequestTabs,\n MainTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, true, contentUrl, options);\n }", "public Tab createOpenEditorTab(long fileId, boolean useSearch) {\n Tab retTab = new Tab();\n long ref = 0;\n StringBuilder tabId = new StringBuilder();\n for (Tab tab : editorTabSet.getTabs()) {\n if (tab.getAttributeAsLong(\"ref\") == fileId) {\n ref = tab.getAttributeAsLong(\"ref\");\n tabId.append(tab.getAttributeAsString(\"UniqueId\"));\n editorTabSet.selectTab(tabId.toString());\n if (useSearch) {\n search.selectSearchResultModel(tab);\n return null;\n } else {\n return tab;\n }\n }\n }\n\n if (ref == 0) {\n editResourceService.getVMFile(fileId, new AsyncCallback<VMFile>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(VMFile result) {\n if (result == null) {\n SC.warn(\"File not found.\");\n return;\n }\n\n tabId.append(HTMLPanel.createUniqueId().replaceAll(\"-\", \"_\"));\n String tabName = result.getName();\n retTab.setTitle(getTabImgTitle(tabName, result.getExtension()));\n retTab.setCanClose(true);\n retTab.setID(tabId.toString());\n String path = result.getFullPath().replaceAll(\"(.*)/\" + result.getName() + \"\\\\.\" + result.getExtensionStr() + \"$\", \"$1\");\n retTab.setPrompt(path);\n retTab.setPane(new Layout());\n retTab.setAttribute(\"ref\", fileId);\n retTab.setAttribute(\"UniqueId\", tabId.toString());\n retTab.setAttribute(\"Extension\", result.getExtension().getValue());\n retTab.setAttribute(\"TabName\", tabName);\n createView(retTab, result, new PostProcessHandler() {\n @Override\n public void execute() {\n if (useSearch) {\n search.selectSearchResultModel(retTab);\n }\n }\n });\n }\n });\n return retTab;\n }\n return retTab;\n }", "public CategoryNew(JTabbedPane tabs,JPanel parent) {\n this.parent=parent;\n this.tabs=tabs;\n initComponents();\n ErrorLabel.setVisible(false);\n }", "private void createTabMenu(Tab tab, MenuItem saveItemTab) {\n Menu tabMenu = new Menu();\n MenuItem closeItem = new MenuItem(\"Close\");\n closeItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n tabCloseEvent(tab);\n }\n });\n MenuItem closeOtersItem = new MenuItem(\"Close Others\");\n closeOtersItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) != editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeLeftItem = new MenuItem(\"Close Tabs to the Left\");\n closeLeftItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) < editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeRightItem = new MenuItem(\"Close Tabs to the Right\");\n closeRightItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) > editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeAllItem = new MenuItem(\"Close All\");\n closeAllItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n tabCloseEvent(closeTab);\n }\n }\n });\n MenuItemSeparator sep = new MenuItemSeparator();\n if (saveItemTab != null) {\n MenuItemIfFunction enableCondition = new MenuItemIfFunction() {\n public boolean execute(Canvas target, Menu menu, MenuItem item) {\n return tab == editorTabSet.getSelectedTab();\n }\n };\n\n saveItemTab.setEnableIfCondition(enableCondition);\n saveItemTab.setKeyTitle(\"Ctrl + S\");\n\n // If you use addItem, the association with the shortcut key is lost.\n tabMenu.setItems(saveItemTab, sep, closeItem, closeOtersItem, closeLeftItem, closeRightItem, sep, closeAllItem);\n } else {\n tabMenu.setItems(closeItem, closeOtersItem, closeLeftItem, closeRightItem, sep, closeAllItem);\n }\n tab.setContextMenu(tabMenu);\n }", "@Override\n\tpublic void addTab(Tab tab, int position, boolean setSelected) {\n\t\t\n\t}", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n createTabs();\n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public TestGeneratorGui(boolean create, JFrame frame, JTabbedPane tabbedPane) {\n\t\tthis.create = create;\n\t\ttutorControlFrame = frame;\n\t\ttutorControl = tabbedPane;\n\t}", "public void buildStagingPanel() {\n if (tabbedPane == null) {\n tabbedPane = new JTabbedPane(SwingConstants.TOP);\n tabbedPane.addTab(\"Query\", _widgetPanel);\n tabbedPane.addTab(om.getProgramName(), om.getTreePanel());\n tabbedPane.addTab(\"Calibrations\", calibrationMenu);\n tabbedPane.setVisible(true);\n } else {\n tabbedPane.setTitleAt(1, om.getProgramName());\n }\n\n tabbedPane.setSelectedIndex(1);\n }", "@Override\n\tpublic void addTab(Tab tab, boolean setSelected) {\n\t\t\n\t}", "public TabPaneLike(TabSide side, TabLabelCreator tabLabelCreator){\n BorderPane bp = new BorderPane();\n\n this.tabLabelCreator = tabLabelCreator;\n\n getChildren().add(bp);\n\n bp.maxWidthProperty().bind(widthProperty());\n bp.minWidthProperty().bind(widthProperty());\n bp.prefWidthProperty().bind(widthProperty());\n\n bp.maxHeightProperty().bind(heightProperty());\n bp.minHeightProperty().bind(heightProperty());\n bp.prefHeightProperty().bind(heightProperty());\n\n\n tabContent = new StackPane();\n tabs = new LinkedList<>();\n\n switch(side){\n case TOP -> {\n nameTab = new HBox();\n tabLabelCreator.setHeights(nameTab);\n bp.setTop(nameTab);\n }\n case BOTTOM -> {\n nameTab = new HBox();\n tabLabelCreator.setHeights(nameTab);\n bp.setBottom(nameTab);\n }\n case RIGHT -> {\n nameTab = new VBox();\n tabLabelCreator.setWidths(nameTab);\n bp.setRight(nameTab);\n }\n case LEFT -> {\n nameTab = new VBox();\n tabLabelCreator.setWidths(nameTab);\n bp.setLeft(nameTab);\n }\n default -> nameTab = new VBox();\n\n }\n\n bp.setCenter(tabContent);\n\n nameTab.setStyle(\"-fx-background-color: lightgrey\");\n }", "private void initialiseTabHost(Bundle args) {\n\t\tmTabHost = (TabHost)findViewById(android.R.id.tabhost);\n mTabHost.setup();\n TabInfo tabInfo = null;\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab1\").setIndicator(\"Waveform\"), ( tabInfo = new TabInfo(\"Tab1\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab2\").setIndicator(\"FFT\"), ( tabInfo = new TabInfo(\"Tab2\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab3\").setIndicator(\"AC\"), ( tabInfo = new TabInfo(\"Tab3\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab4\").setIndicator(\"Pitch\"), ( tabInfo = new TabInfo(\"Tab4\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n // Default to first tab\n this.onTabChanged(\"Tab1\");\n //\n mTabHost.setOnTabChangedListener(this);\n\t}", "public MainFrame(){\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t} catch (ClassNotFoundException | IllegalAccessException | UnsupportedLookAndFeelException | InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tnbRules = 1;\n \tnbTabs = 0;\n \tbasePanel = new JPanel();\n \tbasePanel.setLayout(new FlowLayout(FlowLayout.CENTER));\n \ttabs = new JTabbedPane(SwingConstants.TOP);\n\n \tJToolBar toolBar = new JToolBar();\n newGen = new JButton(\"Nouvelle génération\");\n newGen.addActionListener(new Listener(\"Tab\",this));\n toolBar.add(newGen);\n example = new JButton(\"Exemples\");\n example.addActionListener(new Listener(\"Example\", this));\n toolBar.add(example);\n help = new JButton(\"Aide\");\n help.addActionListener(new Listener(\"Help\",this));\n toolBar.add(help);\n\n this.setTitle(\"L-system interface\");\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tDimension windowDimension = new Dimension(Constants.INITIAL_WIDTH, Constants.INITIAL_HEIGHT);\n this.setSize(windowDimension);\n this.setLocationRelativeTo(null);\n this.add(tabs);\n this.add(toolBar, BorderLayout.NORTH);\n this.setPreferredSize(windowDimension);\n newComponent((byte)1);\n\t\trenameTabs();\n\t\tthis.setResizable(false);\n }", "public void addCompositeToTab(String tabName){\r\n\t\tTabItem item = new TabItem(folderReference, SWT.NONE);\r\n\t\titem.setText(tabName);\r\n\t\t\r\n\t\tfolderReference.getItem(compositeIndex).setControl(compositeMap.get(compositeIndex));\r\n\t\t++compositeIndex;\r\n\t}", "private void addStarredTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_STARRED);\n spec.setIndicator(mResources.getString(R.string.starred), mResources\n .getDrawable(R.drawable.ic_tab_starred));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "public static void AddTab(EventActivity activity, TabHost tabHost, TabHost.TabSpec tabSpec, TabInfo tabInfo) {\n\t\t// Attach a Tab view factory to the spec\n\t\ttabSpec.setContent(new Utils.TabFactory(activity));\n tabHost.addTab(tabSpec);\n\t}", "private void challengeStartNew() {\n FragmentManager fm = getSupportFragmentManager();\n FragmentNewChallenge newChallenge = FragmentNewChallenge.newInstance(\"Titel\");\n newChallenge.show(fm, \"fragment_start_new_challenge\");\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tLog.e(tag,tag+\"=>onCreate \");\n\t\t// Define the Tab structure\n\t\tsetContentView(R.layout.main);\n\t\t// Retrieve the ressource to access to the icon\n\t\tResources resources = getResources(); // Resource object to get Drawables\n\t\t// Set the tabHost (set it has final to use it in the OnTabChangeListener)\n\t\tfinal TabHost tabHost = getTabHost();\n\t\t// Define the tabSpec that can be thought has the content of the TabPanel\n\t\tTabHost.TabSpec tabSpec;\n\t\t// Define the intent that is used to populate the tabSpec\n\t\tIntent intent;\n\n\t\t// Create an Intent to launch an Activity for the tab\n\t\tintent = new Intent().setClass(this, Android2eeWebSTI.class);\n\n\t\t// Initialize a TabSpec for each tab and add it to the TabHost\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"Android2ee\");\n\t\t// Define its indicator the label displayed (it should be\n\t\t// ressources.getString(R.string.stringId)\n\t\ttabSpec.setIndicator(\"Android2EE\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\n\t\t// Do the same with the tab that displays a simple TextView:\n\t\t// Define the intent that will be displayed\n\t\tintent = new Intent().setClass(this, TextViewActivity.class);\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"textView\");\n\t\t// Define its indicator the label displayed (it should be\n\t\t// ressources.getString(R.string.stringId)\n\t\ttabSpec.setIndicator(\"TextView\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\t\t\n\t\t// Do the same with the tab that displays a simple Clock (analogic and digital):\n\t\t// Define the intent that will be displayed\n\t\tintent = new Intent().setClass(this, ClockAD.class);\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"clock\");\n\t\t// Define its indicator the label displayed\n\t\ttabSpec.setIndicator(\"Clock\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\t\t\n\t\t\n\t\t//Define the current tab displayed (here the clock)\n\t\ttabHost.setCurrentTab(2);\n\t\t//Add a listener that just displays a Toast with the tag of the new selected tab\n\t\ttabHost.setOnTabChangedListener(new OnTabChangeListener() {\n\t\t\t@Override\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"New tab selection : \" + tabHost.getCurrentTabTag(),\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\n\t}", "private void addMenuItems() {\n menuBar.setLayout(new FlowLayout(FlowLayout.CENTER));\n menuBar.setBackground(Color.BLUE);\n JMenuItem newTabButton = new JMenuItem(\"New Tab\");\n newTabButton.addActionListener(e ->\n {\n String tabName = \"Space \";\n Random rand = new Random();\n float r = (float) (rand.nextFloat() / 2f + 0.5);\n float g = (float) (rand.nextFloat() / 2f + 0.5);\n float b = (float) (rand.nextFloat() / 2f + 0.5);\n Color backgroundColor = new Color(r, g, b);\n tabName += tabIndex;\n tabIndex += 1;\n WorkingPanel workingPanel = new WorkingPanel();\n workingPanel.setBackground(backgroundColor);\n jTabbedPane.add(tabName, workingPanel);\n addIconToTab(workingPanel, \"(\");\n addIconToTab(workingPanel, \")\");\n });\n JMenuItem saveButton = new JMenuItem(\"Save\");\n fileManager = new FileManager(this);\n saveButton.addActionListener(e -> {\n try {\n fileManager.saveFile();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n } catch (NullPointerException nullPointerException){\n JOptionPane.showMessageDialog(null, \"No file selected\");\n }\n });\n JMenuItem loadButton = new JMenuItem(\"Load\");\n loadButton.addActionListener(e -> {\n try {\n fileManager.loadFile();\n } catch (IOException | ClassNotFoundException ioException) {\n ioException.printStackTrace();\n }\n });\n JMenuItem compileButton = new JMenuItem(\"Compile\");\n compileButton.addActionListener(e -> {\n visited = new HashSet<>();\n boolean compileFlag = true;\n for (int idx = 0; idx < jTabbedPane.getTabCount(); idx++) {\n WorkingPanel workingPanel = (WorkingPanel) jTabbedPane.getComponent(idx);\n boolean isSuccessfullyCompiled = compileTab(workingPanel.getConnections(), workingPanel, idx);\n if (!isSuccessfullyCompiled) {\n compileFlag = false;\n }\n }\n if (compileFlag) {\n generateGraphCode();\n }\n });\n newTabButton.setPreferredSize(new Dimension(150, 40));\n loadButton.setPreferredSize(new Dimension(150, 40));\n saveButton.setPreferredSize(new Dimension(150, 40));\n compileButton.setPreferredSize(new Dimension(150, 40));\n menuBar.add(newTabButton);\n menuBar.add(saveButton);\n menuBar.add(loadButton);\n menuBar.add(compileButton);\n }", "public void addTab(Tab tab)\n\t{\n\t\ttabs.add(tab);\n\t}", "protected void createContents() {\n\t\tshlMenu = new Shell();\n\t\tshlMenu.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/File-delete-icon.png\"));\n\t\tshlMenu.setBackground(SWTResourceManager.getColor(255, 102, 0));\n\t\tshlMenu.setSize(899, 578);\n\t\tshlMenu.setText(\"MENU\");\n\t\t\n\t\tMenu menu = new Menu(shlMenu, SWT.BAR);\n\t\tshlMenu.setMenuBar(menu);\n\t\t\n\t\tMenuItem mnętmBookLists = new MenuItem(menu, SWT.NONE);\n\t\tmnętmBookLists.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t//call booklist frame \n\t\t\t\tBookListFrame window = new BookListFrame();\n\t\t\t\twindow.open();\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tmnętmBookLists.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Business-Todo-List-icon.png\"));\n\t\tmnętmBookLists.setText(\"Book Lists\");\n\t\t\n\t\tMenuItem mnętmMemberList = new MenuItem(menu, SWT.NONE);\n\t\tmnętmMemberList.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t//call memberlistframe\n\t\t\t\tMemberListFrame window = new MemberListFrame();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tmnętmMemberList.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Misc-User-icon.png\"));\n\t\tmnętmMemberList.setText(\"Member List\");\n\t\t\n\t\tMenuItem mnętmNewItem = new MenuItem(menu, SWT.NONE);\n\t\tmnętmNewItem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t//call rent list\n\t\t\t\tRentListFrame rlf=new RentListFrame();\n\t\t\t\trlf.open();\n\t\t\t}\n\t\t});\n\t\tmnętmNewItem.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Time-And-Date-Calendar-icon.png\"));\n\t\tmnętmNewItem.setText(\"Rent List\");\n\t\t\n\t\tButton btnNewButton = new Button(shlMenu, SWT.NONE);\n\t\tbtnNewButton.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t//call booksettingsframe\n\t\t\t\tBookSettingsFrame window = new BookSettingsFrame();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setForeground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));\n\t\tbtnNewButton.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Printing-Books-icon.png\"));\n\t\tbtnNewButton.setBounds(160, 176, 114, 112);\n\t\t\n\t\tButton btnNewButton_1 = new Button(shlMenu, SWT.NONE);\n\t\tbtnNewButton_1.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t//call membersettingsframe\n\t\t\t\tMemberSettingsFrame window = new MemberSettingsFrame();\n\t\t\t\twindow.open();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_1.setForeground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));\n\t\tbtnNewButton_1.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Add-User-icon.png\"));\n\t\tbtnNewButton_1.setBounds(367, 176, 114, 112);\n\t\t\n\t\tButton btnNewButton_2 = new Button(shlMenu, SWT.NONE);\n\t\tbtnNewButton_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tRentingFrame rf=new RentingFrame();\n\t\t\t\trf.open();\n\t\t\t}\n\t\t});\n\t\tbtnNewButton_2.setForeground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));\n\t\tbtnNewButton_2.setImage(SWTResourceManager.getImage(MainMenu.class, \"/ikons/Business-Statistics-icon.png\"));\n\t\tbtnNewButton_2.setBounds(567, 176, 114, 112);\n\n\t}", "void createWindow();", "@AutoGenerated\r\n\tprivate TabSheet buildTabSheet_1() {\n\t\ttabSheet_1 = new TabSheet();\r\n\t\ttabSheet_1.setWidth(\"100.0%\");\r\n\t\ttabSheet_1.setHeight(\"100.0%\");\r\n\t\ttabSheet_1.setImmediate(true);\r\n\t\t\r\n\t\t// generalPanel\r\n\t\tgeneralPanel = buildGeneralPanel();\r\n\t\ttabSheet_1.addTab(generalPanel, \"General settings\", null);\r\n\t\t\r\n\t\t// videoPanel\r\n\t\tvideoPanel = buildVideoPanel();\r\n\t\ttabSheet_1.addTab(videoPanel, \"Video settings\", null);\r\n\t\t\r\n\t\t// audioPanel\r\n\t\taudioPanel = buildAudioPanel();\r\n\t\ttabSheet_1.addTab(audioPanel, \"Audio settings\", null);\r\n\t\t\r\n\t\treturn tabSheet_1;\r\n\t}", "private void initDraftTab() throws IOException {\n // THESE ARE THE CONTROLS FOR THE BASIC SCHEDULE PAGE HEADER INFO\n // WE'LL ARRANGE THEM IN A VBox\n draftTab = new Tab();\n draftWorkspacePane = new VBox();\n draftWorkspacePane.getStyleClass().add(CLASS_DRAFT_PANE);\n \n // ADD PAGE LABEL & BUTTON\n Label draftLabel = new Label();\n draftLabel = initChildLabel(draftWorkspacePane, DraftKit_PropertyType.DRAFT_HEADING_LABEL, CLASS_HEADING_LABEL);\n \n PropertiesManager props = PropertiesManager.getPropertiesManager();\n String imagePath = \"file:\" + PATH_IMAGES + props.getProperty(DraftKit_PropertyType.DRAFT_ICON);\n Image buttonImage = new Image(imagePath);\n draftTab.setGraphic(new ImageView(buttonImage));\n \n // ADD BUTTONS TO THE DRAFT PAGE\n HBox draftButtons = new HBox();\n \n pickPlayer = initHBoxButton(draftButtons, PICK_ICON, PICK_PLAYER_TOOLTIP, false);\n autoPickPlayer = initHBoxButton(draftButtons, PLAY_ICON, AUTO_DRAFT_TOOLTIP, false);\n autoPickPause = initHBoxButton(draftButtons, PAUSE_ICON, AUTO_PAUSE_TOOLTIP, false);\n \n pickPlayer.setMinHeight(10);\n autoPickPlayer.setMinHeight(34);\n autoPickPause.setMinHeight(34);\n pickPlayer.setMinWidth(8);\n autoPickPlayer.setMinWidth(38);\n autoPickPause.setMinWidth(38);\n \n ToolBar draftToolBar = new ToolBar(\n pickPlayer,\n autoPickPlayer,\n autoPickPause\n );\n \n // CREATE THE DRAFT TABLE\n draftTable = new TableView();\n\n draftPick = new TableColumn<>(\"Pick #\");\n draftPick.setCellValueFactory(new Callback<CellDataFeatures<Player, Integer>, ObservableValue<Integer>>() {\n @Override\n public ObservableValue<Integer> call(CellDataFeatures<Player, Integer> p) {\n return new ReadOnlyObjectWrapper(draftTable.getItems().indexOf(p.getValue()) + 1);\n }\n }); \n draftPick.setSortable(false);\n draftFirst = new TableColumn<>(\"First\");\n draftFirst.setCellValueFactory(new PropertyValueFactory<>(\"FirstName\"));\n draftLast = new TableColumn<>(\"Last\");\n draftLast.setCellValueFactory(new PropertyValueFactory<>(\"LastName\"));\n draftTeam = new TableColumn<>(\"Team\");\n draftTeam.setCellValueFactory(new PropertyValueFactory<>(\"ChosenTeam\"));\n draftContract = new TableColumn<>(\"Contract\");\n draftContract.setCellValueFactory(new PropertyValueFactory<>(\"Contract\"));\n draftSalary = new TableColumn<>(\"Salary ($)\");\n draftSalary.setCellValueFactory(new PropertyValueFactory<>(\"Salary\"));\n \n draftTable.getColumns().addAll(draftPick, draftFirst, draftLast, draftTeam, draftContract, draftSalary);\n \n // NEED TO CREATE THE WAY TO ADD THE TABLE (REFRESH IT)\n \n // SET TOOLTIP\n Tooltip t = new Tooltip(\"Draft Summary Page\");\n draftTab.setTooltip(t);\n \n // PUT IN TAB PANE\n draftWorkspacePane.getChildren().add(draftToolBar);\n draftWorkspacePane.getChildren().add(draftTable);\n draftTab.setContent(draftWorkspacePane);\n mainWorkspacePane.getTabs().add(draftTab);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\n\t\ttabHost = getTabHost();\n\t\t\n\t\tcreateTab(\"abaHistorico\", \"histórico\", new Intent(getApplicationContext(), HistoricoList.class));\n\t\tcreateTab(\"abaLivro\", \"livros\", new Intent(getApplicationContext(), LivroList.class));\n\t\tcreateTab(\"abaBusca\", \"buscar\", new Intent(getApplicationContext(), Busca.class));\n\t}" ]
[ "0.7661875", "0.7048672", "0.69150656", "0.6863676", "0.68272007", "0.66255814", "0.657628", "0.6574239", "0.65608287", "0.6535196", "0.65319335", "0.6452988", "0.6439763", "0.6387159", "0.6384567", "0.6323327", "0.63040954", "0.62873936", "0.6281589", "0.6233724", "0.623251", "0.62163377", "0.62161046", "0.62039775", "0.62039244", "0.6158559", "0.61581594", "0.61469954", "0.61312544", "0.6099661", "0.60866535", "0.6084371", "0.6062504", "0.60317445", "0.6031643", "0.6024296", "0.60027885", "0.59908175", "0.5918813", "0.5908967", "0.589335", "0.58895326", "0.5866101", "0.5854862", "0.58251697", "0.5822133", "0.5819492", "0.5815778", "0.5800065", "0.5767393", "0.57608616", "0.57439196", "0.57235134", "0.5720034", "0.5717613", "0.57099336", "0.5706583", "0.57030433", "0.5697991", "0.5697769", "0.569329", "0.5689315", "0.56869704", "0.5684077", "0.5669941", "0.56670135", "0.5662937", "0.56624854", "0.566198", "0.56574565", "0.5638686", "0.5634799", "0.56128776", "0.55992144", "0.55977154", "0.5596333", "0.5594901", "0.55862653", "0.55801314", "0.5565158", "0.55610174", "0.5546861", "0.5544694", "0.553506", "0.553382", "0.553184", "0.5530635", "0.5528743", "0.5521052", "0.5512796", "0.54902637", "0.5489141", "0.5484354", "0.5481533", "0.54775816", "0.5474674", "0.5473085", "0.5470729", "0.5470205", "0.5464103" ]
0.60355276
33
Save the contents of the selected tab into a file
public void saveFile() { String fileloc = ""; if(!prf.foldername.getText().equals("")) fileloc += prf.foldername.getText()+"/"; fileloc += ((MinLFile) tabbedPane.getSelectedComponent()).filename;; File fl = new File(fileloc); try { if(fl.exists()) { int option = JOptionPane.showConfirmDialog(null, "The file with this name already exists, do you want to overwrite it?", "Save File", JOptionPane.YES_NO_OPTION); if(option == 0) { Files.delete(fl.toPath()); try { FileWriter fw = new FileWriter(fileloc); BufferedWriter bw = new BufferedWriter(fw); bw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText()); bw.close(); fw.close(); ((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false; } catch (IOException e1) { e1.printStackTrace(); } } } else { try { FileWriter fw = new FileWriter(fileloc); BufferedWriter bw = new BufferedWriter(fw); bw.write(((MinLFile) tabbedPane.getSelectedComponent()).CodeArea.getText()); bw.close(); fw.close(); ((MinLFile) tabbedPane.getSelectedComponent()).filechanged = false; } catch (IOException e1) { JOptionPane.showMessageDialog(null, "The specified folder doesnt exist."); e1.printStackTrace(); } } } catch (IOException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveCurrentFile(String file) {\r\n\t\tJTextArea editor = getSelectedTextArea();\r\n\t\tPath path = Paths.get(file);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFiles.write(path, editor.getText().getBytes(StandardCharsets.UTF_8));\r\n\t\t} catch (Exception ex) {\r\n\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\tJNotepadApp.this,\r\n\t\t\t\t\tflp.getString(\"saveError\"),\r\n\t\t\t\t\tflp.getString(\"error\"),\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\tJNotepadApp.this,\r\n\t\t\t\tflp.getString(\"saved\"),\r\n\t\t\t\t\"Info\",\r\n\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\r\n\t\tchangeCurrentIcon(greenIcon);\r\n\t\t\r\n\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\ttabbedPane.setToolTipTextAt(index, path.toString());\r\n\t\ttabbedPane.setTitleAt(index, path.getFileName().toString());\r\n\t\t\r\n\t\tfor (ChangeListener l : tabbedPane.getChangeListeners()) {\r\n\t\t\tl.stateChanged(new ChangeEvent(tabbedPane));\r\n\t\t}\r\n\t}", "void saveSet() {\n if( file==null ) {\n int returnVal = fc.showSaveDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n }\n System.out.println(\"Saving to: \" + file.getName());\n try {\n int count = tabbedPane.getTabCount();\n ArrayList l = new ArrayList();\n for(int i=0; i< count; i++) {\n rrpanel= (RoombaRecorderPanel)tabbedPane.getComponentAt(i);\n l.add(rrpanel.copy());\n }\n FileOutputStream fos = new FileOutputStream(file);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n //oos.writeObject(loopButton);\n //oos.writeObject(\n oos.writeObject(l);\n oos.close();\n } catch( Exception e ) {\n System.out.println(\"Save error \"+e);\n }\n }", "private void saveOutputFile() {\n FileChooser fileChooser = new FileChooser();\n if (textMergeScript.hasCurrentDirectory()) {\n fileChooser.setInitialDirectory (textMergeScript.getCurrentDirectory());\n }\n chosenOutputFile = fileChooser.showSaveDialog (ownerWindow);\n if (fileChooser != null) {\n writeOutput();\n openOutputDataName.setText (tabNameOutput);\n }\n }", "@FXML\n\tpublic void saveFile() {\n\t\tif (file == null) {\n\t\t\tFileChooser saveFileChooser = new FileChooser();\n\t\t\tsaveFileChooser.setInitialDirectory(userWorkspace);\n\t\t\tsaveFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\t\tfile = saveFileChooser.showSaveDialog(ap.getScene().getWindow());\n\t\t}\n\n\t\tif (file.getName().endsWith(\".txt\")) {\n\t\t\ttry {\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\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\n\t\t\t\tPrintWriter output = new PrintWriter(writer);\n\t\t\t\toutput.write(userText.getText());\n\t\t\t\toutput.flush();\n\t\t\t\toutput.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(file.getName() + \" has no valid file-extenstion.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "public void saveAs() {\n\t\tJFileChooser fc = new JFileChooser(\"./\");\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\tint returnValue = fc.showSaveDialog(contentPane);\n\t\t\n\t\tif(returnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\ttry {\n\t\t\t\tString path = fc.getCurrentDirectory().getAbsolutePath();\n\t\t\t\tString name = fc.getSelectedFile().getName();\n\t\t\t\tif(!name.endsWith(\".txt\")) {\n\t\t\t\t\tname += \".txt\";\n\t\t\t\t}\n\t\t\t\tFile file = new File(path,name);\n\t\t\t\t\n\t\t\t\tfw = new FileWriter(file);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\t//string to hold each line to write on new file\n\t\t\t\tString text = textArea.getText();\n\t\t\t\t//write file\n\t\t\t\tif (text != null) {\n\t\t\t\t\tbw.write(text);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie) {\n\t\t\t\tie.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null) {\n\t\t\t\t\t\tbw.close();\n\t\t\t\t\t\tfw.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ie2) {\n\t\t\t\t\tie2.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void clickSaveFile(Editor editor, Tab tab) {\n editor.addSaveHandler(createClickSavaHandler(editor, tab));\n }", "void exporter(JTable tab, File file) {\n try {\r\n\r\n TableModel model = tab.getModel();\r\n FileWriter out = new FileWriter(file);\r\n for (int i = 0; i < model.getColumnCount(); i++) {\r\n out.write(model.getColumnName(i) + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n\r\n for (int i = 0; i < model.getRowCount(); i++) {\r\n for (int j = 0; j < model.getColumnCount(); j++) {\r\n out.write(model.getValueAt(i, j).toString() + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n }\r\n\r\n out.close();\r\n } catch (Exception err) {\r\n err.printStackTrace();\r\n }\r\n }", "void writeToFile() throws IOException{\n\t\tString fileName = f.getTitle() + \".txt\";\n\t\tfileWrite = new BufferedWriter( new FileWriter(fileName));\n\t\tfileWrite.write(history);\n\t\tSystem.out.println(fileName + \" File Writing Successful!!\");\n\t\tSystem.out.println(\"Data in file :\\n\" + history);\n\t\tfileWrite.flush();\n\t\tFile file = new File(fileName);\n\t\tjava.awt.Desktop.getDesktop().open(file);\n\n\t}", "private void saveFile() {\n\t\ttry {\n\t\t\tFile file = jfc.getSelectedFile();\n\t\t\tint c = -1;\n\t\t\tif(file==null)\n\t\t\t{\n\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t}\n\t\t\t\n\n\t\t\tif(file!= null || c ==0)\n\t\t\t{\t\n\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\tfw.write(jta.getText());\n\t\t\t\tfw.close();\n\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.println(e2.getMessage());\n\t\t}\n\t}", "public void save(){\n\tif(currentFile == null){\n\t // TODO: add popup to select where to save file and file name\n\t // currentFile = new TextFile(os, title, null);\n\t}else{\n\t currentFile.setBody(textArea.getText());\n\t}\n }", "public void save() {\n\t\tWriteFile data = new WriteFile( this.name + \".txt\" );\n\t\ttry {\n\t\t\t data.writeToFile(this.toString());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Couldn't print to file\");\n\t\t}\n\t}", "private void exportTabDelim() {\n boolean modOK = modIfChanged();\n int exported = 0;\n if (modOK) {\n fileChooser.setDialogTitle (\"Export to Tab-Delimited\");\n fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n File selectedFile = fileChooser.showSaveDialog (this);\n if (selectedFile != null) {\n TabDelimFile tabs = new TabDelimFile(selectedFile);\n try {\n tabs.openForOutput(ClubEvent.getRecDef());\n for (int i = 0; i < clubEventList.size(); i++) {\n ClubEvent nextClubEvent = clubEventList.get(i);\n if (nextClubEvent != null) {\n tabs.nextRecordOut(nextClubEvent.getDataRec());\n exported++;\n }\n }\n tabs.close();\n JOptionPane.showMessageDialog(this,\n String.valueOf(exported) + \" Club Events exported successfully to\"\n + GlobalConstants.LINE_FEED\n + selectedFile.toString(),\n \"Export Results\",\n JOptionPane.INFORMATION_MESSAGE,\n Home.getShared().getIcon());\n logger.recordEvent (LogEvent.NORMAL, String.valueOf(exported) \n + \" Club Events exported in tab-delimited format to \" \n + selectedFile.toString(),\n false);\n statusBar.setStatus(String.valueOf(exported) \n + \" Club Events exported\");\n } catch (java.io.IOException e) {\n logger.recordEvent (LogEvent.MEDIUM,\n \"Problem exporting Club Events to \" + selectedFile.toString(),\n false);\n trouble.report (\"I/O error attempting to export club events to \" \n + selectedFile.toString(),\n \"I/O Error\");\n statusBar.setStatus(\"Trouble exporting Club Events\");\n } // end if I/O error\n } // end if user selected an output file\n } // end if were able to save the last modified record\n }", "private void saveToFile(){\n this.currentMarkovChain.setMarkovName(this.txtMarkovChainName.getText());\n saveMarkovToCSVFileInformation();\n \n //Save to file\n Result result = DigPopGUIUtilityClass.saveDigPopGUIInformationSaveFile(\n this.digPopGUIInformation,\n this.digPopGUIInformation.getFilePath());\n }", "public void save()\r\n {\r\n \tfc=new JFileChooser();\r\n\t fc.setCurrentDirectory(new File(\"\"));\r\n\t if(fc.showSaveDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t \t//Try-Catch Block\r\n\t try\r\n\t {\r\n\t pw=new PrintWriter(new FileWriter(fc.getSelectedFile()+\".txt\")); //Print to the user-selected file\r\n\t\t \tfor(Organism o: e.getTree()) //IN PROGESS\r\n\t\t \t{\r\n\t\t\t\t\tint[] genes=o.getGenes(); //Getting genes from \r\n\t\t\t\t\tfor(int i=0; i<genes.length; i++)\r\n\t\t\t\t\t\tpw.print(genes[i]+\" \"); //Print each gene value in a line\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tpw.println(); //Starts printing on a new line\r\n\t\t\t\t}\r\n\t\t\t\tpw.close(); //Closes the File\r\n\t }\r\n\t catch (Exception ex) //Catch Any Exception\r\n\t {\r\n\t ex.printStackTrace();\r\n\t }\r\n }", "private void saveFile() {\n if (fileExisted == false) {\n JFileChooser fChoice = new JFileChooser();\n int choice = fChoice.showSaveDialog(this);\n if (choice == JFileChooser.APPROVE_OPTION) {\n File f = fChoice.getSelectedFile();\n //\n if(!f.getName().contains(\".txt\")){\n File fN=new File(f.getParent(), f.getName()+\".txt\");\n FileDAO.writeFile(fN, txtContent);\n fMain = fN;\n fileExisted = true;\n lastSave=true;\n this.setTitle(fN.getName());\n }\n else{\n \n FileDAO.writeFile(f, txtContent);\n fMain = f;\n fileExisted = true;\n lastSave=true;\n this.setTitle(f.getName());\n } \n \n }\n } else if (fileExisted == true) {\n FileDAO.writeFile(fMain, txtContent);\n lastSave=true;\n }\n\n }", "public void executeSaveAction(Editor editor, Tab tab, PostProcessHandler handler) {\n Long ref = tab.getAttributeAsLong(\"ref\");\n editResourceService.getVMFile(ref, new AsyncCallback<VMFile>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(VMFile result) {\n if (result == null) {\n SC.warn(\"File not found.\");\n return;\n }\n if (result.getExtension() == Extension.TXT || result.getExtension() == Extension.LSC || result.getExtension() == Extension.CSC) {\n editResourceService.saveTextFile(result.getId(), ((TextEditor) editor).getValue(), projectId, new AsyncCallback<Void>() {\n @Override\n public void onSuccess(Void result) {\n editor.setSavedPosition();\n setDirtyFlagToTabTitle(tab);\n if (handler != null) {\n handler.execute();\n }\n }\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n });\n } else if (result.getExtension() != null) {\n AbstractRootElement root = editor.getRoot();\n BinaryResourceImpl r = new BinaryResourceImpl();\n r.getContents().add(root);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n try {\n r.save(outputStream, null);\n } catch (IOException e) {\n throw new IllegalArgumentException(e);\n }\n byte[] bytes = outputStream.toByteArray();\n editResourceService.saveFile(result.getId(), bytes, new AsyncCallback<Void>() {\n @Override\n public void onSuccess(Void result) {\n editor.setSavedPosition();\n setDirtyFlagToTabTitle(tab);\n if (handler != null) {\n handler.execute();\n }\n }\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n });\n } else {\n editResourceService.saveTextFile(result.getId(), ((TextEditor) editor).getValue(), projectId, new AsyncCallback<Void>() {\n @Override\n public void onSuccess(Void result) {\n editor.setSavedPosition();\n setDirtyFlagToTabTitle(tab);\n if (handler != null) {\n handler.execute();\n }\n }\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n });\n }\n }\n });\n }", "public void saveCurrentFile(File file) {\n\t\tPrintWriter writer;\n\t\ttry {\n\t\t\twriter = new PrintWriter(file);\n\t\t\twriter.write(frame.textArea.getText());\n\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public void exportResultsToFile(){\r\n\t\t\t\t\r\n\t\t// This if clause shouldn't fire as the icon is grayed out if there is no tab open\r\n\t\tif(currentView == null \r\n\t\t\t\t|| currentView.getDynamicModelView() == null \r\n\t\t\t\t|| currentView.getDynamicModelView().getModel() == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A tab must be open, and a model and table must be present before results can be exported\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(currentView.getDynamicModelView().getModel().getDefaultHistory() == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A table must be present before results can be exported\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tDynamicModelHistory history = currentView.getDynamicModelView().getModel().getDefaultHistory();\r\n\r\n\t\tStringBuffer buffer = new StringBuffer(30000);\r\n\r\n\t\tif(history != null && history.getTimePointCount() > 0 && history.getSnapshot(0) != null){\r\n\t\t\r\n\t\t\t// Get the filename\r\n\t\t\tYorkGUIUtils guiUtils = new YorkGUIUtils();\r\n\t\t\tString selectedFile = guiUtils.getUserToDefineFilename(this, propertiesMemento.getBaseDir(), \"txt csv\", \"Results files (.txt, .csv)\", JFileChooser.SAVE_DIALOG);\r\n\r\n\t\t\tif(selectedFile == null || guiUtils.wasCancelled()){\r\n\t\t\t\trequestFocusInWindow();\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\t\r\n\t\t\tlogger.info(\"Selected file for exporting results:\" + selectedFile);\r\n\t\t\r\n\t\t\tbuffer.append(\"time point\").append(\"\\t\");\r\n\t\t\tfor(int t = 0; t < history.getTimePointCount(); t++){\r\n\t\t\t\tbuffer.append(t).append(\"\\t\");\r\n\t\t\t}\r\n\t\t\tbuffer.append(\"\\n\");\r\n\t\t\t\r\n\t\t\tfor(Iterator<String> it = history.getSnapshot(0).keySet().iterator(); it.hasNext();){\r\n\t\t\t\tString name = it.next();\r\n\t\t\t\tbuffer.append(name).append(\"\\t\");\r\n\t\t\t\t// For all time points\r\n\t\t\t\tfor(int t = 0; t < history.getTimePointCount(); t++){\r\n\t\t\t\t\tbuffer.append(history.getSnapshot(t).get(name).getOutputValue()).append(\"\\t\");\r\n\t\t\t\t}\r\n\t\t\t\tbuffer.append(\"\\n\");\r\n\t\t\t}\r\n\t\t\tFileLoader.save(selectedFile, buffer.toString());\r\n\t\t}\r\n\t\telse{\r\n\t\t\tJOptionPane.showMessageDialog(this, \"No results available in the selected tab. Run the model first.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void fileSave()\n {\n try\n {\n // construct the default file name using the instance name + current date and time\n StringBuffer currentDT = new StringBuffer();\n try {\n currentDT = new StringBuffer(ConnectWindow.getDatabase().getSYSDate());\n }\n catch (Exception e) {\n displayError(e,this) ;\n }\n\n // construct a default file name\n String defaultFileName;\n if (ConnectWindow.isLinux()) {\n defaultFileName = ConnectWindow.getBaseDir() + \"/Output/RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n else {\n defaultFileName = ConnectWindow.getBaseDir() + \"\\\\Output\\\\RichMon \" + instanceName + \" \" + currentDT.toString() + \".html\";\n }\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setSelectedFile(new File(defaultFileName));\n File saveFile;\n BufferedWriter save;\n\n // prompt the user to choose a file name\n int option = fileChooser.showSaveDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n\n // force the user to use a new file name if the specified filename already exists\n while (saveFile.exists())\n {\n JOptionPane.showConfirmDialog(this,\"File already exists\",\"File Already Exists\",JOptionPane.ERROR_MESSAGE);\n option = fileChooser.showOpenDialog(this);\n if (option == JFileChooser.APPROVE_OPTION)\n {\n saveFile = fileChooser.getSelectedFile();\n }\n }\n save = new BufferedWriter(new FileWriter(saveFile));\n saveFile.createNewFile();\n\n // create a process to format the output and write the file\n try {\n OutputHTML outputHTML = new OutputHTML(saveFile,save,\"Database\",databasePanel.getResultCache());\n outputHTML.savePanel(\"Performance\",performancePanel.getResultCache(),null);\n// outputHTML.savePanel(\"Scratch\",scratchPanel.getResultCache(),scratchPanel.getSQLCache());\n\n JTabbedPane scratchTP = ScratchPanel.getScratchTP();\n \n for (int i=0; i < scratchTP.getComponentCount(); i++) {\n try {\n System.out.println(\"i=\" + i + \" class: \" + scratchTP.getComponentAt(i).getClass());\n if (scratchTP.getComponentAt(i) instanceof ScratchDetailPanel) {\n ScratchDetailPanel t = (ScratchDetailPanel)scratchTP.getComponentAt(i);\n System.out.println(\"Saving: \" + scratchTP.getTitleAt(i));\n outputHTML.savePanel(scratchTP.getTitleAt(i), t.getResultCache(), t.getSQLCache());\n }\n } catch (Exception e) {\n // do nothing \n }\n }\n }\n catch (Exception e) {\n displayError(e,this);\n }\n\n // close the file\n save.close();\n }\n }\n catch (IOException e)\n {\n displayError(e,this);\n }\n }", "private void openSavedTabs(){\n\t\tList<String> filenames = new ArrayList<String>();\r\n\t\tint i = 0;\t\t\r\n\t\twhile(propertiesMemento.get(\"tab\" + i) != null){\r\n\t\t\tfilenames.add((String) propertiesMemento.get(\"tab\" + i));\r\n\t\t\ti++;\t\t\t\r\n\t\t}\r\n\r\n\t\tfor(String filename: filenames){\r\n\t\t\tlogger.info(\"Looking for:\" + filename);\r\n\t\t\tFile file = new File(filename);\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\t//JOptionPane.showMessageDialog(null, \"Cannot find \" + filename, \"Warning\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t// Simply ignore KIS\r\n\t\t\t\tlogger.info(\"Cannot find file \" + filename + \" so not load it as tab\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tString content = FileLoader.loadFile(filename);\r\n\t\t\t\t// If the application can't open one of the recorded tabs then drop out trying to load them.\r\n\t\t\t\tif(!openSavedTab(content)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void Save(){\n\tJFileChooser j = new JFileChooser(\"\"); \n\t// Invoke the showsSaveDialog function to show the save dialog \n\tint r = j.showSaveDialog(null);\n \n\tif (r == JFileChooser.APPROVE_OPTION) { \n\n\t// Set the label to the path of the selected directory \n File fi = new File(j.getSelectedFile().getAbsolutePath()); \n\n try { \n\t\t// Create a file writer \n\t\tFileWriter wr = new FileWriter(fi, false); \n\n\t\t// Create buffered writer to write \n\t\tBufferedWriter w = new BufferedWriter(wr); \n\n\t\t// Write\n\t\tw.write(t.getText()); \n\n\t\tw.flush(); \n\t\tw.close(); \n } \n catch (Exception evt) { \n\t\tJOptionPane.showMessageDialog(f, evt.getMessage()); \n } \n\t} \n\t// If the user cancelled the operation \n\telse\n JOptionPane.showMessageDialog(f, \"the user cancelled the operation\"); \n\t\t\n }", "public void save() {\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\t\ttry {\n\t\t\tFile file = new File(\"fileSave.txt\");\n\t\t\tif(!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tfw = new FileWriter(file);\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t//string to hold text to write on new file\n\t\t\tString text = textArea.getText();\n\t\t\t//write file\n\t\t\tif (text != null) {\n\t\t\t\tbw.write(text);\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tie.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (bw != null) {\n\t\t\t\t\tbw.close();\n\t\t\t\t\tfw.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException ie2) {\n\t\t\t\tie2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public abstract void saveToFile(PrintWriter out);", "private void save()\n {\n String saveFile = FileBrowser.chooseFile( false );\n try{\n PrintWriter output = new PrintWriter( new File( saveFile ) );\n \n output.println( numRows + \" \" + numCols );\n\n for( int r=0; r<numRows; r++ )\n output.println( rowLabels[r] );\n\n for( int c=0; c<numCols; c++ )\n output.println( colLabels[c] );\n\n for( int r=0; r<numRows; r++ )\n {\n for( int c=0; c<numCols; c++ )\n output.print( a[r][c] + \" \" );\n output.println();\n }\n output.close();\n }\n catch(Exception e)\n {\n System.out.println(\"Uh-oh, save failed for some reason\");\n e.printStackTrace();\n }\n }", "private void jButtonBrowseOutputFileActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldOutputFile.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void saveFile() {\r\n File savedFile = new File(fileName);\r\n\r\n try (FileWriter fw = new FileWriter(savedFile)) {\r\n fw.write(workSpace.getText());\r\n\r\n fw.close();\r\n } catch (IOException ex) {\r\n JOptionPane.showMessageDialog(null, \"There was an error saving the file\");\r\n }\r\n }", "private void saveAs ()\n {\n\tJFileChooser chooser = new JFileChooser ();\n\tchooser.setFileSelectionMode (chooser.FILES_ONLY);\n\tint result = chooser.showSaveDialog (this);\n\tif (result == chooser.CANCEL_OPTION)\n\t{\n\t return;\n\t}\n\n\tFile f = chooser.getSelectedFile ();\n\tif (f.exists ())\n\t{\n\t try\n\t {\n\t\tresult = \n\t\t JOptionPane.showConfirmDialog (\n this,\n\t\t\t\"Overwrite existing file \\\"\" + f.getCanonicalPath () + \n\t\t\t\"\\\"?\",\n\t\t\t\"File Exists\",\n\t\t\tJOptionPane.YES_NO_OPTION);\n\n\t\tif (result != JOptionPane.YES_OPTION)\n\t\t{\n\t\t return;\n\t\t}\n\n\t\tf.delete ();\n\t }\n\t catch (IOException ex)\n\t {\n\t\tthrow new ShouldntHappenException (ex);\n\t }\n\t}\n\n\tString text;\n\tsynchronized (myDocument)\n\t{\n\t int len = myDocument.getLength ();\n\t try\n\t {\n\t\ttext = myDocument.getText (0, len);\n\t }\n\t catch (BadLocationException ex)\n\t {\n\t\tthrow new ShouldntHappenException (ex);\n\t }\n\t}\n\n\ttry\n\t{\n\t FileWriter fw = new FileWriter (f);\n\t fw.write (text);\n\t fw.flush ();\n\t fw.close ();\n\t}\n\tcatch (IOException ex)\n\t{\n\t JOptionPane.showMessageDialog (null,\n\t\t\t\t\t ex.getMessage (),\n\t\t\t\t\t \"Write Error\",\n\t\t\t\t\t JOptionPane.ERROR_MESSAGE);\n\t}\n }", "public void saveFile(){\n returnValue = this.showSaveDialog(null);\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n new CustomerFileWriter(new File(this.getSelectedFile().getAbsolutePath())).saveCustomer(Bank.customer);\n }\n }", "public void saveAs() {\n editorManager.currentFileManager().saveAs();\n mimaUI.fileChanged();\n }", "public void saveHistory(OperatorSelectionHistory history,String filename){\n try(ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(filename));){\n os.writeObject(history);\n os.close();\n } catch (IOException ex) {\n Logger.getLogger(IOSelectionHistory.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void saveFile() {\n\t\tJFileChooser fileChooser = new JFileChooser(desktopPath);\n\t\tint returnVal = fileChooser.showSaveDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile filePath = fileChooser.getSelectedFile();\n\t\t\ttry {\n\t\t\t\tPrintWriter writer = new PrintWriter(filePath);\n\t\t\t\tScanner out = new Scanner(textEditor.getText());\n\t\t\t\twhile(out.hasNextLine()) {\n\t\t\t\t\twriter.println(out.nextLine());\n\t\t\t\t}\n\t\t\t\tout.close();\n\t\t\t\twriter.close();\n\t\t\t\ttextAreaChanged =false;\n\t\t\t\tsavedFilePath = filePath.getPath();\n\t\t\t\terrorTextArea.setText(\"\");\n\t\t\t} catch (Exception ex) {\n\t\t\t\terrorTextArea.setForeground(Color.RED);\n\t\t\t\terrorTextArea.setText(\"Error saving file\");\n\t\t\t}\n\t\t}\n\t}", "private static void saveActionPerformed(){\r\n JFileChooser chooser = new JFileChooser();\r\n chooser.setDialogType(JFileChooser.OPEN_DIALOG);\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\r\n chooser.setFileFilter(filter);\r\n int returnVal = chooser.showOpenDialog(frame);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) { \r\n try(BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(chooser.getSelectedFile()), \"UTF-8\"))){\r\n writeChosenSchedule(bw); \r\n \r\n JOptionPane.showMessageDialog(null, \"The schedule was successfully saved.\",\r\n \"Info\", JOptionPane.INFORMATION_MESSAGE);\r\n }\r\n catch(IOException e){\r\n Logger.getLogger(\"File saving\").log(Level.WARNING, \"Could not write to the file\", e);\r\n JOptionPane.showMessageDialog(null, \"Failed to save the schedule to the chosen file!\",\r\n \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }\r\n }", "static String save() {\n JFileChooser fileChooser;\n String path = FileLoader.loadFile(\"path.txt\");\n if (path != null) {\n fileChooser = new JFileChooser(path);\n } else {\n fileChooser = new JFileChooser((FileSystemView.getFileSystemView().getHomeDirectory()));\n }\n\n fileChooser.setDialogTitle(\"Save text file\");\n fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);\n\n if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {\n FileLoader.saveFile(\"path.txt\", fileChooser.getSelectedFile().getParent(), false);\n return fileChooser.getSelectedFile().getAbsolutePath() + \".mytxt\" ;\n }\n return null;\n }", "void saveAs() {\n writeFile.Export();\n }", "public void saveHistory() {\r\n\t\tJFileChooser jfc = new JFileChooser();\r\n\t\tjfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\r\n\t\tjfc.setDialogTitle(\"Save \" + curveName + \" history\");\r\n\t\tjfc.setSelectedFile(new File(\".txt\"));\r\n\t\tint returnVal = jfc.showSaveDialog(getRootPane());\r\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tif (!cancelBecauseFileExist(jfc.getSelectedFile())) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\thistory.save(jfc.getSelectedFile());\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(getRootPane(), \"Error while saving the history\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void saveFile(final FileMessage fm) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setInitialFileName(fm.getFilename());\n FileChooser.ExtensionFilter extFilter;\n extFilter = new FileChooser.ExtensionFilter(\"Any files (*.*)\", \"*.*\");\n fileChooser.getExtensionFilters().add(extFilter);\n File dest = fileChooser.showSaveDialog(this);\n if (dest != null) {\n try {\n Files.write(\n Paths.get(\n String.valueOf(dest)),\n fm.getData(),\n StandardOpenOption.CREATE);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "@Override\n public void exportToFile(SpreadsheetTable focusOwner) {\n try {\n File dire = new File(dir);\n File file = new File(dire, filename);\n\n FileWriter writer = new FileWriter(file, false);\n int start = 0;\n if (this.header) {\n start++;\n }\n\n this.selectedCells = focusOwner.getSelectedCells();\n\n for (int i = start; i < selectedCells.length; i++) {\n for (int j = 0; j < selectedCells[i].length; j++) {\n if (j != 0) {\n writer.append(delimiter);\n }\n writer.append(selectedCells[i][j].getContent());\n }\n writer.append('\\r');\n writer.append('\\n');\n }\n writer.flush();\n writer.close();\n } catch (IOException e) {\n System.out.println(\"Error exporting file!\");\n }\n }", "protected void actionPerformedExport ()\n {\n Preferences root = Preferences.userRoot ();\n Preferences node = root.node (OpenMarkovPreferences.OPENMARKOV_NODE_PREFERENCES);\n System.out.println (\"Export selected\");\n if (chooser.showSaveDialog (PreferencesDialog.this) == JFileChooser.APPROVE_OPTION)\n {\n try\n {\n OutputStream out = new FileOutputStream (chooser.getSelectedFile ());\n node.exportSubtree (out);\n out.close ();\n }\n catch (Exception e)\n {\n e.printStackTrace ();\n JOptionPane.showMessageDialog (this, stringDatabase.getString (e.getMessage ()),\n stringDatabase.getString (e.getMessage ()),\n JOptionPane.ERROR_MESSAGE);\n }\n }\n }", "void save(String fileName);", "@FXML\r\n\tpublic void save() {\r\n\t\ttry {\r\n\t\t\tFile copy = new File(fileName.getText());\r\n\t\t\tScanner fileIn = new Scanner(result.getText());\r\n\t\t\tPrintStream fileOut = new PrintStream(copy);\r\n\r\n\t\t\twhile (fileIn.hasNextLine()) {\r\n\t\t\t\tfileOut.print(fileIn.nextLine());\r\n\t\t\t}\r\n\r\n\t\t\tfileIn.close();\r\n\t\t\tfileOut.close();\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.getMessage();\r\n\t\t}\r\n\t}", "@FXML\n public void saveFile(Event e) {\n String outputData = output.getText();\n\n File file = chooser.showSaveDialog(save.getScene().getWindow());\n\n if(file != null) {\n createFile(outputData, file);\n }\n }", "private final void exportAll() {\n\t\tfinal JFileChooser chooser = new JFileChooser(System.getProperty(\"user.home\"));\n\t\tint returnVal = chooser.showSaveDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = chooser.getSelectedFile();\n\t\t\tserializeToFile(file);\n\t }\t\n\t}", "public void saveFile(String pathOfFileSelected, String content){\n FileOutputStream fos = null;\n try {\n final File myFile = new File(pathOfFileSelected);\n\n myFile.createNewFile();\n\n fos = new FileOutputStream(myFile);\n\n fos.write(content.getBytes());\n fos.close();\n Log.d(TAG, \"saveFile: Saved Successfully\");\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.w(TAG, \"saveFile: Unable to save\",e);\n }\n }", "public void save(String fileName) throws IOException;", "public void save(String filename) {\n\n PrintWriter out = null;\n\n try {\n out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n out.println(undoCommands);\n out.close();\n }", "public void doSaveAs() {\n\t\tif (activePage == 0 && introEditor.isUpdated() || introEditor.isDirty())\n\t\t\tupdateIntroEditor();\n\t\tif (activePage == 1 && (pageMainEditor.isUpdated() || pageMainEditor.isDirty()))\n\t\t\tupdateFile();\n\t\tIEditorPart editor = getTextEditor();\n\t\teditor.doSaveAs();\n\t\tsetPageText(getTextEditorIndex(), editor.getTitle());\n\t\tsetInput(editor.getEditorInput());\n\t}", "@FXML\n\tprivate void onSaveClicked(){\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\tFile file = new File(\"log.txt\");\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\t\t\tFileWriter fw = new FileWriter(file, true);\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\twriter = new PrintWriter(bw);\n\t\t\twriter.println(\"New record\");\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\n\t\t\t\twriter.println(list.get(i) +\" & \"+ (dat.get(i)));\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\ttextArea.setText(\"Exception occurred:\" + ioe.getMessage());\n\t\t} finally {\n\t\t\tif (writer != null) {\n\t\t\t\twriter.close();\n\t\t\t}\n\t\t}\n\n\t}", "void save_to_file() {\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a save directory\", FileDialog.SAVE);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"save path: \" + file_withpath);\n\t\t\t \n\t\ttry {\n\t\t\tObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file_withpath));\n\n\t\t\tout.writeObject(Key_Lists);\n\t\t\t\n\t\t\tout.close();\n\t\t\t\n\t\t\tinfo_label.setForeground(green);\n\t\t\tinfo_label.setText(\"file saved :D\");\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tint opt = chooser.showSaveDialog(null);\r\n\t\t\t\tif (opt == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(user)) {\r\n\t\t\t\t\t\t// filename is OK as-is\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfile = new File(file.toString() + \".\"+user);\r\n\t\t\t\t\t\tfile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + \".\"+user);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tFileOutputStream fo = new FileOutputStream(file);\r\n\t\t\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fo);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.writeUTF(user);\r\n\t\t\t\t\t\toos.writeObject(StudentArray);\r\n\t\t\t\t\t\toos.writeObject(tab);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.close();\r\n\t\t\t\t\t\tfo.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te1.printStackTrace();\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}", "public void saveNewFile() {\n\t\tJFileChooser choose = new JFileChooser();\n\t\tif(choose.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\ttry {\n\t\t\t\tdir=choose.getCurrentDirectory().toString();\n\t\t\t\tString fileName =dir+ \"\\\\\" + choose.getSelectedFile().getName();\n\t\t\t File file = new File(fileName);\n\t\t\t if(file.exists()) {\n\t\t\t \tint confirm = JOptionPane.showConfirmDialog(null, \n\t\t\t \t\t\t\"File already exists. Do you want to overwrite it?\",\n\t\t\t \t\t\t\"Choose one\",JOptionPane.YES_NO_OPTION);\n\t\t\t \tif(confirm == JOptionPane.NO_OPTION)return;\n\t\t\t }\n\t\t\t\tPrintWriter writer = new PrintWriter(file);\n\t\t\t\twriter.write(frame.textArea.getText());\n\t\t\t\twriter.close();\n\t\t\t\tframe.setTitle(choose.getSelectedFile().getName()+\"-Text Editor\");\n\t\t\t\tframe.originalText=frame.textArea.getText();\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void writeTextAreaToFile() {\n PrintWriter pwriter;\n try {\n pwriter = new PrintWriter(new FileWriter(textFile));\n pwriter.print(textArea.getText());\n pwriter.close();\n } catch (IOException e) {\n System.err.println(\"Could not open file '\" + textFile + \"' for writing.\");\n }\n originalContent = textArea.getText();\n updateWriteButton();\n }", "public void saveFile() {\n\t\tPrintWriter output = null;\n\t\ttry {\n\t\t\toutput = new PrintWriter(\"/Users/katejeon/Documents/Spring_2020/CPSC_35339/avengers_project/game_result.txt\");\n\t\t\toutput.println(textArea.getText());\n\t\t\toutput.flush();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"File doesn't exist.\");\n\t\t} finally {\n\t\t\toutput.close();\n\t\t}\n\t}", "private void saveTextToFile(String content, File file) {\n try {\n PrintWriter writer;\n writer = new PrintWriter(file);\n writer.println(content);\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void saveAs() {\n\t\tJFileChooser chooser = new JFileChooser();\n\t\tchooser.setDialogTitle(\"Schaltung speichern...\");\n\t\tchooser.setMultiSelectionEnabled(false);\n\t\tchooser.setAutoscrolls(true);\n\t\tchooser.setFileFilter(new FileFilter() {\n\t\t\t@Override\n\t\t\tpublic String getDescription() {\n\t\t\t\treturn \"Schaltung (*.digi)\";\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean accept(File f) {\n\t\t\t\treturn f.isDirectory() || f.getName().toLowerCase().endsWith(\".digi\");\n\t\t\t}\n\t\t});\n\t\tif (chooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION || chooser.getSelectedFile() == null) {\n\t\t\treturn;\n\t\t}\n\t\tString path = removeExtension(chooser.getSelectedFile().getPath());\n\t\tFile f = new File(path + \".digi\");\n\t\tif (f.exists()) {\n\t\t\tWindowManager.getDialogs().showMsgBox(\"Datei \\u00FCberschreiben?\",\n\t\t\t\t\t\"M\\u00F6chtest du die Datei \\\"\" + f.getName() + \"\\\" \\u00FCberschreiben?\", EnumDialogType.QUESTION,\n\t\t\t\t\tnew IButton() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic String getDisplayName() {\n\t\t\t\t\t\t\treturn \"Ja, \\u00FCberschreiben\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onClick() {\n\t\t\t\t\t\t\tWorkPanel panel = Management.getWorkPanel();\n\t\t\t\t\t\t\tpanel.setCurrentFile(f);\n\t\t\t\t\t\t\tsave(panel, f);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, new IButton() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic String getDisplayName() {\n\t\t\t\t\t\t\treturn \"Nein\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onClick() {\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tManagement.getWorkPanel().setCurrentFile(f);\n\t\t\tonClick(); // save the selected file\n\t\t}\n\t}", "void saveOption()\n{\n if(fname==null)\n saveFile();\n else\n { try{\n fname1=fname;\n int l=fname1.lastIndexOf(\"\\\\\");\n fname1= fname1.substring(l+1, fname1.length()-5);\n \n FileWriter fw= new FileWriter(fname);\n String s=textArea.getText();\n PrintWriter p =new PrintWriter(fw);\n p.println(s);\n p.flush();\n }\n catch(Exception e9)\n {\n System.out.println(e9);}\n \n \n\n }\n}", "private void toSave() {\n File file4=new File(\"trial.txt\");\n try\n {\n String row;\n BufferedWriter bw=new BufferedWriter(new FileWriter(file4));\n for(int i=0;i<jt.getRowCount();i++)\n {\n row = \"\";\n for(int j=0;j<jt.getColumnCount();j++)\n {\n row += (jt.getValueAt(i, j) +\",\");\n }\n row = row.substring(0, row.length()-1);\n //System.out.println(row);\n bw.write(row);\n bw.newLine();\n }\n bw.close();\n \n \n JOptionPane.showMessageDialog(rootPane,\"Details saved succesfully\");\n }\n \n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Exception occured\");\n }\n }", "private void saveFile(File file){\r\n\t\ttry {\r\n\t\t\tlocal.saveFile(file);\r\n\t\t\topenFile = file;\r\n\t\t\tpopulateRecentMenu();\r\n\t\t\tframe.setTitle(openFile.getName());\r\n\t\t\tedit = false;\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void saveTermText() {\n String jTermText = jTerm.read();\n if (jTermText != null && jTermText.length() > 0) {\n JFileChooser fileChooser = new JFileChooser();\n File path = new File(Settings.get(\"Terminal_SavePath\"));\n if (!path.exists()) {\n path = new File(MobydroidStatic.MOBY_DATA_PATH);\n }\n fileChooser.setCurrentDirectory(path);\n fileChooser.setSelectedFile(new File(\"TerminalText_\" + (new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\")).format(new Date()) + \".txt\"));\n fileChooser.setDialogTitle(\"Save Terminal Text\");\n fileChooser.setFileFilter(new FileNameExtensionFilter(\"*.txt\", \"txt\"));\n File file;\n do {\n if (fileChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) {\n return;\n }\n file = fileChooser.getSelectedFile();\n if (!file.exists()) {\n break;\n }\n if (JOptionPane.showConfirmDialog(this, \"Are you sure?\", \"Replace File\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, ResourceLoader.MaterialIcons_WARNING) == JOptionPane.YES_OPTION) {\n break;\n }\n } while (true);\n\n // save file\n try (FileOutputStream fos = new FileOutputStream(file)) {\n fos.write(jTermText.getBytes());\n } catch (IOException ex) {\n }\n // save last directory to settings ..\n Settings.set(\"Terminal_SavePath\", fileChooser.getSelectedFile().getParent());\n Settings.save();\n }\n }", "private void saveCSV(ActionEvent actionEvent) {\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n int result = fileChooser.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n String selectedFile = fileChooser.getSelectedFile().getAbsolutePath();\n StatisticsFile statisticsFile = new StatisticsFile(selectedFile);\n try{\n statisticsFile.writeInCvs(my_map.getSettlements());\n }catch(IOException ioException){\n ioException.printStackTrace();\n }\n }\n }", "void save(String filename);", "@FXML\n void exportFile(ActionEvent event) {\n \tFileChooser chooser = new FileChooser();\n\t\tchooser.setTitle(\"Open Target File for the Export\");\n\t\tchooser.getExtensionFilters().addAll(new ExtensionFilter(\"Text Files\", \"*.txt\"),\n\t\t\t\tnew ExtensionFilter(\"All Files\", \"*.*\"));\n\t\tStage stage = new Stage();\n\t\t\n\t\t//get the reference of the target file\n\t\tFile targeFile = chooser.showSaveDialog(stage); \n\t\t\n\t\t\n\t\t//writes accounts to text file and exports\n\t\ttry {\n\t\t\t\n\t\t\tBufferedWriter bf = new BufferedWriter(new FileWriter(targeFile));\n\t\t\tbf.write(db.printFormattedAccounts());\n\t\t\tbf.flush();\n\t\t\tbf.close();\n\t\t\t\n\t\t\tmessageArea.appendText(\"File successfully exported.\\n\");\n\t\t\t\n\t\t} catch (IOException e) {\n \t\tmessageArea.appendText(\"Unable to export transactions to file.\\n\");\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\tmessageArea.appendText(\"File not selected, unable to export transactions to file.\\n\");\n\t\t}\n\t\t\n\t\t\n }", "public static void writeToFile(JPanel owner) {\n\n boolean proceed = true;\n JFileChooser fileChooser = new JFileChooser(new File(\".\"));\n fileChooser.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Text files\", \"txt\");\n fileChooser.addChoosableFileFilter(filter);\n\n int returnValue = fileChooser.showSaveDialog(owner);\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n \n // Need to add extension; not done automatically\n File fileToSave = fileChooser.getSelectedFile();\n if (!fileToSave.getAbsolutePath().endsWith(\".txt\")) {\n fileToSave = new File(fileToSave + \".txt\");\n }\n \n // Handle overwrite scenario\n if (fileToSave.exists()) {\n proceed = false;\n int confirm = JOptionPane.showConfirmDialog(owner, \"File exists, overwrite?\", \"File exists\", JOptionPane.YES_NO_OPTION);\n if (confirm == JOptionPane.YES_OPTION) {\n proceed = true;\n }\n }\n\n try {\n // Collect information to write\n String contents = \"\";\n if (canvasListModel.getSize() != 0) {\n contents += canvasListModel.get(0) + \"\\n\"; // only one item\n }\n if (drawListModel.getSize() != 0) {\n for(int instrIdx = 0; instrIdx < drawListModel.size(); instrIdx++) {\n contents += drawListModel.get(instrIdx) + \"\\n\";\n }\n }\n\n // Write information to the file\n PrintStream ps = new PrintStream(fileToSave);\n ps.print(contents);\n ps.close();\n }\n catch (FileNotFoundException e) {\n JOptionPane.showMessageDialog(owner, \"File could not be written; check permissions\");\n }\n }\n }", "public static void saveAs(){\n\t\tFile saveFile;\n\t\tJFileChooser saveChooser = new JFileChooser();\n\t\tFileNameExtensionFilter saveFilter = new FileNameExtensionFilter(\"Sensormap Files (.stuff)\", \"stuff\");\n\t\tFileNameExtensionFilter saveFilter2 = new FileNameExtensionFilter(\"Gzipped Sensormap Files (.stuff.gz)\", \"stuff.gz\");\n\t\tsaveChooser.setFileFilter(saveFilter);\n\t\tsaveChooser.setFileFilter(saveFilter2);\n\t\tint saveReturnVal = saveChooser.showSaveDialog(ControlPanelFrame.getFrame());\n\t\tif(saveReturnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tif(saveChooser.getFileFilter() == saveFilter && saveChooser.getSelectedFile().getName().endsWith(\".stuff\")==false){\n\t\t\t\tsaveFile = new File(saveChooser.getSelectedFile().getAbsolutePath()+\".stuff\");\n\t\t\t} else if(saveChooser.getFileFilter() == saveFilter2 && saveChooser.getSelectedFile().getName().endsWith(\".stuff.gz\")==false){\n\t\t\t\tsaveFile = new File(saveChooser.getSelectedFile().getAbsolutePath()+\".stuff.gz\");\n\t\t\t} else {\n\t\t\t\tsaveFile = saveChooser.getSelectedFile();\n\t\t\t}\n\t\t\tXMLSaver.saveSensorList(saveFile);\n\t\t\tGUIReferences.viewPort.halfTitle = saveFile.getName();\n\t\t\tGUIReferences.viewPort.setTitle(saveFile.getName());\n\t\t\tGUIReferences.currentFile = saveFile;\n\t\t\tGUIReferences.saveMenuItem.setEnabled(false);\n\t\t}\n\t}", "public void saveFile()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString newLine = System.getProperty(\"line.separator\");\n\t\t\n\t\tfor(CSVItem cItem : itemList)\n\t\t{\n\t\t\tsb.append(cItem.buildCSVString()).append(newLine);\n\t\t\t\n\t\t}\n\t\tString fileString = sb.toString();\n\t\t\n\t\t File newTextFile = new File(filePath);\n\n FileWriter fw;\n\t\ttry {\n\t\t\tfw = new FileWriter(newTextFile);\n\t\t\t fw.write(fileString);\n\t\t fw.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \n\n\t}", "protected void exportScriptToFile() {\n\t\ttry {\n\t\t\tfinal MigrationConfiguration cfg = getMigrationWizard()\n\t\t\t\t\t.getMigrationConfig();\n\t\t\tprepare4SaveScript();\n\t\t\tExportScriptDialog.exportScript(cfg, isSaveSchema());\n\t\t} catch (Exception e) {\n\t\t\t// MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),\n\t\t\t// Messages.msgWarning, Messages.setOptionPageErrMsg);\n\t\t}\n\t}", "@FXML\n void saveButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n file.setTitle(\"Save your To Do List (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n // Pass all the info of the current list info this file\n File selectedFile = file.showOpenDialog(listView.getScene().getWindow());\n\n if(this.status != null)\n {\n status.setText(\"List saved! \");\n }\n\n try(PrintWriter writer = new PrintWriter(selectedFile))\n {\n // For each item, write down all its info\n // Seperate by comma, and copy info to table\n for(Item item : Item.getToDoList())\n {\n writer.println(item.getTask() + \",\" + item.getCompletionDate() + \",\" + item.getFinished());\n }\n } catch(FileNotFoundException exception)\n {\n // If error, let user know\n if(this.status != null)\n {\n status.setText(\"File not found. \");\n }\n }\n\n }", "private void savePressed(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showSaveDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t\t//make sure file has the right extention\n\t\t\tif(file.getAbsolutePath().contains(\".scalcsave\"))\n\t\t\t\tfile = new File(file.getAbsolutePath());\n\t\t\telse\n\t\t\t\tfile = new File(file.getAbsolutePath()+\".scalcsave\");\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\t\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\t\toutput.close();\n\t\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void exportSettings() {\n\t\t\tfinal JFileChooser chooser = new JFileChooser(System.getProperty(\"user.home\"));\n\t\t\tint returnVal = chooser.showSaveDialog(null);\n\t\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\tFile saved = chooser.getSelectedFile();\n\t\t\t\ttry {\n\t\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(saved));\n\t\t\t\t\twriter.write(mySettings);\n\t\t\t\t\twriter.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t }\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tFile file;\n\t\tfile = jfc.getSelectedFile();\n\t\tswitch (cmd) {\n\t\tcase \"저장\":\n\t\t\tsaveFile();\n\t\t\tbreak;\n\t\tcase \"열기\":\n\t\t\t\n\t\t\topenFile();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"새파일\":\n\t\t\tjta.setText(\"\");\n\t\t\tbreak;\n\t\tcase \"종료\":\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}\n\t\t/*if(cmd.equals(\"저장\"))\n\t\t{\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"c:/output/notepad.txt\");\n\t\t\tfw.write(jta.getText());\n\t\t\tfw.close();\n\t\t\tSystem.out.println(\"파일을 생성하였습니다\");\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.println(e2.getMessage());\n\t\t}\n\t\t}\n\t\t*/\n\t}", "void saveToFile(String filename) throws IOException;", "void saveBookMark(){\n File dotFile = new File( bmFile);\n FileWriter fw;\n BufferedWriter bw;\n PrintWriter pw;\n String str;\n\n // open dotFile\n try{\n // if there is not dotFile, create new one\n fw = new FileWriter( dotFile );\n bw = new BufferedWriter( fw );\n pw = new PrintWriter( bw );\n //write\n for(int i=0;i<MAX_BOOKMARK;i++){\n str = miBookMark[i].getText();\n pw.println(str);\n }\n pw.close();\n bw.close();\n fw.close();\n }catch(IOException e){\n }\n }", "private void saveAs() {\n\t\tFileChooser fileChooser = new FileChooser();\n\n\t\t// Set extension filter\n\t\tFileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter(\n\t\t\t\t\"XML files (*.xml)\", \"*.xml\");\n\t\tfileChooser.getExtensionFilters().add(extFilter);\n\n\t\t// Show save file dialog\n\t\tFile file = fileChooser.showSaveDialog(mainApp.getPrimaryStage());\n\n\t\tif (file != null) {\n\t\t\t// Make sure it has the correct extension\n\t\t\tif (!file.getPath().endsWith(\".xml\")) {\n\t\t\t\tfile = new File(file.getPath() + \".xml\");\n\t\t\t}\n\t\t\tmainApp.saveFilmDataToFile(file);\n\t\t}\n\t}", "private void saveProject()\n\t{\n\t\t\n\t\tint fileChooserReturnValue =\n\t\t\twindowTemplate\n\t\t\t\t.getFileChooser()\n\t\t\t\t.showSaveDialog(windowTemplate);\n\t\t\n\t\tif(fileChooserReturnValue == JFileChooser.APPROVE_OPTION) {\n\t\t\t\n\t\t\t// Get the file that the user selected\n\t\t\tFile file = windowTemplate.getFileChooser().getSelectedFile();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// Open the output streams\n\t\t\t\tFileOutputStream fileOutput = new FileOutputStream(file.getAbsolutePath());\n\t\t\t\tObjectOutputStream objectOutput = new ObjectOutputStream(fileOutput);\n\t\t\t\n\t\t\t\t// Write the objects\n\t\t\t\tfor(int i = 0; i < cards.size(); i++) {\n\t\t\t\t\tobjectOutput.writeObject(cards.get(i));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Close the output streams\n\t\t\t\tobjectOutput.close();\n\t\t\t\tfileOutput.close();\n\t\t\t\t\n\t\t\t\t// Update the title of the frame to reflect the file name\n\t\t\t\twindowTemplate.setTitle(file.getName());\n\t\t\t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\tJOptionPane.showMessageDialog(windowTemplate, \"Could not save the file.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (\"导出\".equals(e.getActionCommand())) {\n\t\t\tjavax.swing.JFileChooser chooser = new javax.swing.JFileChooser();\n\t\t\tchooser.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY);\n\t\t\tint returnVal = chooser.showOpenDialog(null);\n\t\t\tif (returnVal == javax.swing.JFileChooser.APPROVE_OPTION) {\n\t\t\t\tSystem.out.println(\"You chose to open this file: \" + chooser.getSelectedFile().getPath());\n\t\t\t\tString path = chooser.getSelectedFile().getAbsolutePath() + \"/备份.txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"memory.txt\"));\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(path));\n\t\t\t\t\tSystem.out.println(path);\n\t\t\t\t\tString line;\n\t\t\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t\t\tbw.write(line);\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t}\n\t\t\t\t\tbr.close();\n\t\t\t\t\tbw.close();\n\t\t\t\t\tTools.tip(\"导出成功\");\n\n\t\t\t\t} catch (Exception ex) {\n\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tjavax.swing.JFileChooser chooser = new javax.swing.JFileChooser();\n\t\t\tchooser.setFileSelectionMode(javax.swing.JFileChooser.FILES_ONLY);\n\t\t\tint returnVal = chooser.showOpenDialog(null);\n\t\t\tif (returnVal == javax.swing.JFileChooser.APPROVE_OPTION) {\n\t\t\t\tSystem.out.println(\"You chose to open this file: \" + chooser.getSelectedFile().getPath());\n\t\t\t\tString path = chooser.getSelectedFile().getAbsolutePath();\n\n\t\t\t\tif (!path.endsWith(\"备份.txt\")) {\n\t\t\t\t\tTools.tip(\"文件名称或类型有误\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(path));\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(\"memory.txt\"));\n\t\t\t\t\tString line;\n\t\t\t\t\tString regex = \"\\\\d+[#][\\\\d]{4}[-][\\\\d]{2}[-][\\\\d]{2}[#][^#]+[#][^#]+[#]\\\\d+\";\n\n\t\t\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t\t\tif (!line.matches(regex)) {\n\t\t\t\t\t\t\tbr.close();\n\t\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\t\t\tTools.tip(\"文件内容有误\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\t\t\tbw.write(line);\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t}\n\t\t\t\t\tbr.close();\n\t\t\t\t\tbw.close();\n\n\t\t\t\t\tTools.tip(\"导入成功\");\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tTools.tip(\"文件导入出错\");\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}", "public void saveToFile()\n\t{\t\n\t\tsetCourseToFileString(courseToFileString);\n\t\t\ttry \n\t {\n\t FileWriter fw = new FileWriter(fileName);\n\t fw.write (this.getCourseToFileString ( ));\n\t for(Student b : this.getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t}", "public void saveNewFile() {\r\n JFileChooser fileChooser = new JFileChooser();\r\n\r\n int status = fileChooser.showSaveDialog(null);\r\n\r\n if (status == JFileChooser.APPROVE_OPTION) {\r\n\r\n fileName = fileChooser.getSelectedFile().toString();\r\n\r\n saveFile();\r\n }\r\n }", "private static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void saveJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveJMenuItemActionPerformed\n //save the current points\n myWriter.saveToFile(FILE_PATH, namesArray, tempArray);\n }", "public void saveFileAs(String text) {\r\n\r\n\t\tFile tempFile;\r\n\t\ttempFile = fileChooser.showSaveDialog(fileChooserDialog);\r\n\t\tsaveFile(tempFile, text);\r\n\t\t\r\n\t\r\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsaveFile();\n\t\t\t}", "@Override\n\tpublic void actionPerformed (ActionEvent e)\n\t{\n\t\n\t\t// Create the File Save dialog.\n\t\tFileDialog fd = new FileDialog(\n\t\t\tAppContext.cartogramWizard, \n\t\t\t\"Save Computation Report As...\", \n\t\t\tFileDialog.SAVE);\n\n\t\tfd.setModal(true);\n\t\tfd.setBounds(20, 30, 150, 200);\n\t\tfd.setVisible(true);\n\t\t\n\t\t// Get the selected File name.\n\t\tif (fd.getFile() == null)\n\t\t\treturn;\n\t\t\n\t\tString path = fd.getDirectory() + fd.getFile();\n\t\tif (path.endsWith(\".txt\") == false)\n\t\t\tpath = path + \".txt\";\n\t\t\n\t\t\n\t\t// Write the report to the file.\n\t\ttry\n\t\t{\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(path));\n\t\t\tout.write(AppContext.cartogramWizard.getCartogram().getComputationReport());\n\t\t\tout.close();\n\t\t} \n\t\tcatch (IOException exc)\n\t\t{\n\t\t}\n\n\t\t\n\t\n\t}", "@FXML\n void exportToFile() {\n generalTextArea.clear();\n clearEverything();\n\n try{\n FileChooser chooser = new FileChooser();\n chooser.setTitle(\"Open Target File for the Export\");\n chooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n Stage stage = new Stage();\n File targetFile = chooser.showSaveDialog(stage); //get the reference of the target file\n\n Writer wr = new FileWriter(targetFile);\n String exportDatabaseResult = company.exportDataBase();\n if(exportDatabaseResult.equals(\"Employee database is empty.\")){\n generalTextArea.appendText(\"Employee database is empty. Export did not occur.\");\n wr.flush();\n wr.close();\n return;\n }\n wr.write(exportDatabaseResult);\n wr.flush();\n wr.close();\n }catch (IOException | NullPointerException e) {\n generalTextArea.appendText(\"There was an error with accessing your export file. Please try with a valid file. \\n\");\n return;\n }\n }", "public void saveArena() {\n //pick name and location\n Thread t1 = new Thread(new Runnable() {\n @Override\n public void run() {\n JFileChooser chooser = new JFileChooser();\n int approve = chooser.showSaveDialog(null);\n if (approve == JFileChooser.APPROVE_OPTION) {\t\t\t//if possible\n File selFile = chooser.getSelectedFile();\t\t\t//get output file\n File currDir = chooser.getCurrentDirectory();\t\t//get directory to save to\n\n //save\n try {\n FileWriter outFileWriter = new FileWriter(selFile);\t\t//create filewriter for selected file\n PrintWriter writer = new PrintWriter(outFileWriter);\n writer.println(saveArenaData());\t\t\t\t\t\t//save arena info to file\n writer.close();\n }\n catch (FileNotFoundException e) {\t\t\t\t\t\t\t\t//if can't find file\n e.printStackTrace();\n }\n catch (IOException e) {\t\t\t\t\t\t\t\t\t\t//if input/output error\n e.printStackTrace();\n }\n }\n }\n });\n t1.start();\n\n\n }", "@Override\n\tpublic void doSaveAs() {\n\t\tMessageDialog.openInformation(Display.getCurrent().getActiveShell(), null,\"doSaveAs\");\n\t}", "private void export(ActionEvent actionEvent) {\n if (this.totalCycles == -1) {\n var result = JOptionPane.showConfirmDialog(this, \"The run is not finished yet. Are you sure you want to proceed?\",\n \"Unfinished run\", JOptionPane.YES_NO_CANCEL_OPTION);\n\n if (result == JOptionPane.NO_OPTION) {\n return;\n }\n }\n\n // File dialog to save the history\n var fileChooser = new JFileChooser();\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getName().endsWith(\".json\");\n }\n\n @Override\n public String getDescription() {\n return \"*.json\";\n }\n });\n\n fileChooser.setAcceptAllFileFilterUsed(false);\n fileChooser.setCurrentDirectory(new File(Variables.OUTPUT_PATH));\n var resultDialog = fileChooser.showSaveDialog(this);\n\n if (resultDialog == JFileChooser.APPROVE_OPTION) {\n var file = fileChooser.getSelectedFile();\n\n if (!file.getName().endsWith(\".json\")) {\n file = new File(file.getAbsolutePath() + \".json\");\n }\n if (file.exists()) {\n var sure = JOptionPane.showConfirmDialog(this, \"File already exists. Overwrite?\",\n \"Overwrite file?\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\n\n if (sure != JOptionPane.YES_OPTION) {\n return;\n }\n }\n\n this.saveHistoryToFile(file);\n }\n }", "void save(File file);", "public void saveFile() throws FileNotFoundException {\r\n try {\r\n PrintWriter out = new PrintWriter(FILE_NAME);\r\n //This puts back the labels that the loadFile removed\r\n out.println(\"date,cust_email,cust_location,product_id,product_quantity\");\r\n int i = 0;\r\n\r\n while (i < orderInfo.size()) {\r\n String saved = orderInfo.get(i).toString();\r\n out.println(saved);\r\n i++;\r\n }\r\n out.close();\r\n } catch (FileNotFoundException e) {\r\n }\r\n\r\n }", "public void xuLyLuuHoaHoaDon(){\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".txt\");\n }\n\n @Override\n public String getDescription() {\n return \".txt\";\n }\n });\n fileChooser.setFileFilter(new FileFilter() {\n @Override\n public boolean accept(File file) {\n return file.getAbsolutePath().endsWith(\".doc\");\n }\n\n @Override\n public String getDescription() {\n return \".doc\";\n }\n });\n int flag = fileChooser.showSaveDialog(null);\n if(flag == JFileChooser.APPROVE_OPTION){\n File file = fileChooser.getSelectedFile();\n try {\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), Charset.forName(\"UTF-8\"));\n PrintWriter printWriter = new PrintWriter(outputStreamWriter);\n String lineTieuDe1 = \"----------------Phiếu Thanh Toán-----------------------\";\n String lineMaPTT = \"+Mã Phiếu Thanh Toán: \" + txtMaPTT.getText();\n String lineMaPDK = \"+Mã Phiếu Đăng Ký: \" + cbbMaPDK.getSelectedItem().toString();\n String lineSoThang = \"+Số Tháng: \" + txtSoThang.getText()+\"|\";\n String lineNgayTT = \"+Ngày Thanh Toán: \" + txtNgayTT.getText();\n String lineTienPhong = \"+Tiền Phòng: \" + txtTongTien.getText();\n String lineTienDV = \"+Tiền Dịch Vụ: \"+txtThanhToanTongCong.getText();\n String lineTieuDe2 = \"--------------------------------------------------------\";\n String lineTienPhaiTra =\"+Tiền Phải Trả: \" + txtTienPhaiTra.getText()+\" \";\n String lineTieuDe3 = \"--------------------------------------------------------\";\n \n printWriter.println(lineTieuDe1);\n printWriter.println(lineMaPTT);\n printWriter.println(lineMaPDK);\n printWriter.println(lineSoThang);\n printWriter.println(lineNgayTT);\n printWriter.println(lineTienPhong);\n printWriter.println(lineTienDV);\n printWriter.println(lineTieuDe2);\n printWriter.println(lineTienPhaiTra);\n printWriter.println(lineTieuDe3);\n \n printWriter.close();\n outputStreamWriter.close();\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Đã lưu\");\n }\n \n }", "public final void saveToFile() {\n\t\tWrite.midi(getScore(), getName()+\".mid\"); \n\t}", "public void store (String fileName) throws IOException {\n\t\tBufferedWriter out = new BufferedWriter\n\t\t\t(new OutputStreamWriter\n\t\t\t (new FileOutputStream(fileName), JetTest.encoding));\n\t\tannotator.writeTagTable (out);\n\t\tout.write (\"endtags\");\n\t\tout.newLine ();\n\t\tmene.store (out);\n\t}", "private void saveFile(boolean showWindow) {\n\n\t\tFormDef form = controller.getSelectedForm();\n\t\tif(form == null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tString xml = FormHandler.writeToXML(form);\n\n\t\t\n\t\titextWidget.loadItext(Context.getItextList());\n\n\t\txformsWidget.setXform(xml);\n\t\tif (showWindow) {\n\t\t\txformsWidget.showWindow();\n\t\t}\n\t}", "private void save()\n\t{\n\t\t//get the text\n\t\tString spssTxt = spssText.getText();\n\t\t//save it to a JS place where Java can find it\n\t\tsaveToJS(spssTxt);\n\t\t//make up a file name\n\t\tString fileName = form.getText().replace(\" \", \"_\").replace(\"\\\\\", \"\").replace(\"/\",\"\").replace(\"*\", \"\").replace(\"\\\"\", \"\")\n\t\t\t\t.replace(\"<\", \"\").replace(\">\", \"\").replace(\"#\", \"\").replace(\"'\", \"\") + \".spss\";\t\t\n\t\t\n\t\t\n\t\t\n\t\tappletHtml.setHTML(\"<APPLET codebase=\\\"fileioapplets/\\\"+\" +\n\t\t\t\t\" archive=\\\"kobo_fileIOApplets.jar, plugin.jar\\\" \"+\n\t\t\t\t\" code=\\\"org.oyrm.kobo.fileIOApplets.ui.FileSaveApplet.class\\\" \"+\n\t\t\t\t\" width=\\\"5\\\" HEIGHT=\\\"5\\\" MAYSCRIPT> \"+\n\t\t\t\t\"<param name=\\\"formName\\\" value=\\\"\"+fileName+\"\\\"/>\"+\n\t\t\t\t\"<param name=\\\"save\\\" value=\\\"\"+LocaleText.get(\"SaveSPSSFile\")+\"\\\"/>\"+\n\t\t\t\t\"</APPLET>\");\n\t}", "String savedFile();", "public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }", "private void selectTXTFile() {\n JFileChooser jfc = new JFileChooser();\n File curDir;\n if (readFile != null) curDir = new File(readFile.getParent()); else curDir = new File(System.getProperty(\"user.home\"));\n jfc.setCurrentDirectory(curDir);\n jfc.setFileFilter(new TXTFilter());\n jfc.setMultiSelectionEnabled(false);\n int ret = jfc.showDialog(this, \"Save\");\n if (ret == 0) {\n outputField.setText(jfc.getSelectedFile().getAbsolutePath() + \".txt\");\n }\n }", "public void run() {\r\n\t\tif (window != null) {\r\n\t\t\tIEditorPart part = window.getActivePage().getActiveEditor();\r\n\t\t\t\r\n\t\t\tboolean write = false;\r\n\t\t\tGraphEditorInput input = null;\r\n\t\t\tString defaultFileName = sdf.format(new Date()) + getDefaultExtension();\r\n\t\t\tif (part != null) {\r\n\t\t\t\tinput = (GraphEditorInput) part.getEditorInput();\r\n\t\t\t\twrite = input != null;\r\n\t\t\t\tif (!GraphEditorInput.LIVE_EDITOR_NAME.equals(part.getTitle())) {\r\n\t\t\t\t\tdefaultFileName = part.getTitle();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tFile f = chooseSaveFile(window.getShell(), defaultFileName);\r\n\t\t\t\r\n\t\t\tif (f != null) {\r\n\t\t\t\tif (write) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlog.debug(\"writing file..\");\r\n\t\t\t\t\t\tinput.getGXLDocument().write(f);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\t\tMessageDialog.openError(window.getShell(), \"Error\", \"Error saving to file:\" + e.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tMessageDialog.openInformation(window.getShell(), \"File saving failed!\",\r\n\t\t\t\t\t\t\t\"Could not save the file, editor contains no data!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void saveAsImage(){\n\t\tif(currentView == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A tab must be open before an image can be saved\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcurrentView.saveAsImage();\r\n\t}", "public void exportPuzzle (Puzzle puzzle) {\n if (puzzle != null && puzzle.getNumWords () > 0) {\n if (chooser.showSaveDialog (null) == JFileChooser.APPROVE_OPTION) {\n File newFile = chooser.getSelectedFile ();\n try {\n FileWriter writer = new FileWriter (newFile + \" puzzle.html\");\n writer.write (puzzle.export (true));\n writer.close ();\n writer = new FileWriter (newFile + \" solution.html\");\n writer.write (puzzle.export (false));\n writer.close ();\n } catch (IOException e) {\n JOptionPane.showMessageDialog (null, \"File IO Exception\\n\" + e.getLocalizedMessage (), \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }\n } else {\n JOptionPane.showMessageDialog (null, \"Please Generate a Puzzle before Exporting\", \"Error!\", JOptionPane.ERROR_MESSAGE);\n }\n }", "@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}", "private void saveDialog() {\n JFileChooser chooser = new JFileChooser();\n \n FileFilter ff = new FileFilter() {\n\n @Override\n public boolean accept(File f) {\n // TODO Auto-generated method stub\n return f.getName().endsWith(FILE_EXTENSION);\n }\n\n @Override\n public String getDescription() {\n return \"CSV\";\n }\n\n };\n chooser.addChoosableFileFilter(ff);\n chooser.setAcceptAllFileFilterUsed(true);\n chooser.setFileFilter(ff);\n chooser.showSaveDialog(null);\n this.file = chooser.getSelectedFile();\n //this.file = new File(chooser.getSelectedFile().getName() + INSTANCE.FILE_EXTENSION);\n\n\n try {\n\n if (file != null) {\n this.saveData();\n this.isModifed = false;\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage(), \"Error Saving File\", JOptionPane.ERROR_MESSAGE);\n\n }\n\n }" ]
[ "0.68775046", "0.6743666", "0.66710544", "0.66687644", "0.65634286", "0.6533992", "0.6510273", "0.6389216", "0.6322492", "0.63184875", "0.62749153", "0.62454164", "0.6192423", "0.61851996", "0.61459494", "0.6122406", "0.6112422", "0.60582197", "0.6054573", "0.6036405", "0.6034151", "0.6025407", "0.60246325", "0.6014759", "0.59989643", "0.5995483", "0.5974324", "0.59637064", "0.5955883", "0.59538376", "0.5944045", "0.59297454", "0.591873", "0.5916077", "0.5911009", "0.5878872", "0.5855681", "0.58436537", "0.5842638", "0.58255565", "0.58246845", "0.57987636", "0.57907706", "0.57904905", "0.5788008", "0.57866734", "0.5767797", "0.57575417", "0.57553697", "0.57489127", "0.57361776", "0.5731386", "0.57303864", "0.57286435", "0.57097906", "0.57074845", "0.56973743", "0.5660278", "0.56458557", "0.5639442", "0.56284654", "0.56132174", "0.56092864", "0.5608139", "0.5606986", "0.56064355", "0.560286", "0.5599678", "0.55905765", "0.55882996", "0.5572988", "0.5564401", "0.5556695", "0.5555542", "0.55533296", "0.55434436", "0.5536408", "0.55272865", "0.55198246", "0.5514657", "0.55004025", "0.5487783", "0.54757446", "0.5463506", "0.545716", "0.54538554", "0.544828", "0.5447701", "0.54459506", "0.54381406", "0.54280716", "0.54188585", "0.5416449", "0.5413095", "0.54100096", "0.5402789", "0.5401967", "0.53936124", "0.5388164", "0.5387846" ]
0.6092724
17
Loads a file into a tab
public void loadFile() { String fileloc = ""; if(!prf.foldername.getText().equals("")) fileloc += prf.foldername.getText()+"/"; String filename = JOptionPane.showInputDialog(null,"Enter the filename."); fileloc += filename; File fl = new File(fileloc); if(!fl.exists()) { JOptionPane.showMessageDialog(null, "The specified file doesnt exist at the given location."); } else { MinLFile nminl = new MinLFile(filename); try { FileReader flrd = new FileReader(fileloc); BufferedReader bufread = new BufferedReader(flrd); nminl.CodeArea.setText(""); String str; while((str = bufread.readLine()) != null) { Document doc = nminl.CodeArea.getDocument(); try { doc.insertString(doc.getLength(), str, null); } catch (BadLocationException e) { e.printStackTrace(); } } bufread.close(); flrd.close(); } catch (IOException e) { e.printStackTrace(); } JComponent panel = nminl; tabbedPane.addTab(filename, null, panel, filename); tabbedPane.setMnemonicAt(0, 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void loadSet() {\n int returnVal = fc.showOpenDialog(this);\n if (returnVal != JFileChooser.APPROVE_OPTION) {\n System.out.println(\"Open command cancelled by user.\");\n return;\n }\n file = fc.getSelectedFile();\n System.out.println(\"Opening: \" + file.getName());\n closeAllTabs();\n try {\n FileInputStream fis = new FileInputStream(file);\n ObjectInputStream ois = new ObjectInputStream(fis);\n //loopButton.setSelected( ois.readObject() ); \n ArrayList l = (ArrayList) ois.readObject();\n System.out.println(\"read \"+l.size()+\" thingies\");\n ois.close();\n for(int i=0; i<l.size(); i++) {\n HashMap m = (HashMap) l.get(i);\n openNewTab();\n getCurrentTab().paste(m);\n }\n } catch(Exception e) {\n System.out.println(\"Open error \"+e);\n }\n }", "void load(File file);", "public void loadFile(File p_file) throws IOException;", "private void loadDataFromFile(File file) {\n\t\tString fileName = file.getName();\n\t\tQuickParser test = new QuickParser();\n\n\t\tif(fileName.trim().toUpperCase().startsWith(\"INV\")) {\n\t\t\tfileType = FileType.INVENTORY;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInventoryData.clear();\n\t\t\tmasterInventoryData = test.Parse(file, fileType);\n\t\t\tpresentationInventoryData.clear();\n\t\t\tpresentationInventoryData.addAll(masterInventoryData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End if statement\n\t\telse if(fileName.toUpperCase().startsWith(\"INI\")) {\n\t\t\tfileType = FileType.INITIAL;\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t\tmasterInitialData.clear();\n\t\t\tmasterInitialData = test.Parse(file, fileType);\n\t\t\tpresentationInitialData.clear();\n\t\t\tpresentationInitialData.addAll(masterInitialData);\n\t\t\tswitch (fileType) {\n\t\t\tcase INVENTORY:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INVENTORY;\n\t\t\t\tbreak;\n\t\t\tcase INITIAL:\n\t\t\t\tcurrentTabScreen = CurrentTabScreen.INITIAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t} // End switch statement \n\t\t} // End else if statement \n\t\telse {\n\t\t\tfileType = FileType.UNASSIGNED;\n\t\t} // End else statement\n\t\tchangeToScanTable();\n\t}", "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}", "public void load (File file) throws Exception;", "public void load(File source);", "public void loadFile(File file) {\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\t\n\t\t\t// read the column names\n\t\t\tList<String> first = stringToList(in.readLine());\n\t\t\tcolNames = first;\n\t\t\t\n\t\t\t// each line makes a row in the data model\n\t\t\tString line;\n\t\t\tdata = new ArrayList<List>();\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tdata.add(stringToList(line));\n\t\t\t}\n\t\t\t\n\t\t\tin.close();\n\t\t\t\n\t\t\t// Send notifications that the whole table is now different\n\t\t\tfireTableStructureChanged();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void addTab(String filename) {\n\t\t\n\t\tMinLFile nminl = new MinLFile(filename);\n\t\tJComponent panel = nminl;\n\t\t\n\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\tfilename);\t\t\n\t\ttabbedPane.setMnemonicAt(0, 0);\n\t}", "public void loadFile(File f) {\n Controller.INSTANCE.run(() -> {\n int iterations = 0;\n StringBuffer buffer = new StringBuffer();\n\n\n try (FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis) ) {\n while ( (bis.available() > 0) && (iterations < charThreshold)) {\n iterations++;\n buffer.append((char)bis.read());\n }\n fullContent.add(buffer.toString());\n loadBlock(0);\n //System.out.println(\"Finished first set at \"+ iterations + \" iterations\");\n myEstimatedLoad = EstimatedLoad.MEDIUM;\n while (bis.available() > 0) {\n iterations = 0;\n buffer = new StringBuffer();\n while ((bis.available() > 0) && (iterations < charThreshold)) {\n iterations++;\n buffer.append((char) bis.read());\n }\n fullContent.add(buffer.toString());\n //System.out.println(\"Finished another set at \"+iterations+ \" iterations\");\n synchronized (mine) {\n if (mine.getParentEditor().isClosed())\n return Unit.INSTANCE; //check if this tab is closed. if it is, wrap up\n }\n }\n }\n catch ( Exception e ) {\n System.out.println(\"Failed to load file\");\n e.printStackTrace();\n }\n return Unit.INSTANCE;\n });\n }", "public void\tload(String fileName) throws IOException;", "public void loadFile(){\n returnValue = this.showOpenDialog(null);\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n selected = new File(this.getSelectedFile().getAbsolutePath());\n Bank.customer=(new CustomerFileReader(selected)).readCustomer();\n }\n }", "public void readtabs(File f) {\r\n \tString str = new String();\r\n try{\r\n BufferedReader br = new BufferedReader(new FileReader(f.getAbsolutePath()));\r\n str = br.readLine();\r\n \r\n while((str = br.readLine()) != null){\r\n //str = str.replaceAll(\";\", \"\");\r\n String info[] = str.split(\";\");\r\n if(f.getName().equals(\"mdl_chat_messages.txt\")){\r\n \t//chat message id; chatid; userid; groupid; system; message; timestamp;\r\n \tmobileact ma = new mobileact(info[2].trim(), info[6].trim(), \"Chat Message\", info[5]);\r\n \tmobact.add(ma);\r\n }else if(f.getName().equals(\"mdl_forum_posts.txt\")){\r\n \t//id; discussion; parent; userid; created; modified; mailed; subject; message; \r\n \t//messageformat; messagetrust; attachment; totalscore; mailnow; \r\n \tmobileact ma = new mobileact(info[3].trim(), info[5].trim(), \"Forum Posts\", info[8].trim());\r\n \tmobact.add(ma);\r\n }else if(f.getName().equals(\"mdl_quiz_attempts.txt\")){\r\n \t//id; quiz; userid; attempt; uniqueid; layout; currentpage; \r\n \t//preview; state; timestart; timefinish; timemodified; timecheckstate; \r\n \t//sumgrades; needsupgradetonewqe; \r\n \tmobileact ma = new mobileact(info[2].trim(), info[11].trim(), \"Attempt Quiz\", info[8].trim());\r\n \tmobact.add(ma);\r\n }\r\n }\r\n br.close();\r\n }catch(Exception e){\r\n JOptionPane.showMessageDialog(null, \"read moodle log file failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "public void loadFile(File file1){\n\n\t\ttry{\n\t\t\tFileReader reader = new FileReader(file1);\n\t\t\tBufferedReader BR = new BufferedReader(reader);\n\n fname = file1.getName();\n pathname = file1.getParent();\n\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"error\");\n\t\t}\n\n\n repaint();\n\n\t}", "public void load (IFile file) throws Exception;", "public void loadFile(String fname) \n\t{\n\t\t// use Scanner used to read the file\n\t\ttry{\n\t\t\tScanner scan = new Scanner(new FileReader(fname));\n\t\t\t//read in number of row and column in the first line\n\t\t\treadRC(scan);\n\t\t\treadMaze(scan);\n\t\t\t//close the scanner\n\t\t\tscan.close();\t\t\t\t\t\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"FileNotFound\"+e.getMessage());\n\t\t}\n\t}", "public abstract void loadFile(Model mod, String fn) throws IOException;", "public void loadShow(File f) {\n \n }", "private void openSavedTabs(){\n\t\tList<String> filenames = new ArrayList<String>();\r\n\t\tint i = 0;\t\t\r\n\t\twhile(propertiesMemento.get(\"tab\" + i) != null){\r\n\t\t\tfilenames.add((String) propertiesMemento.get(\"tab\" + i));\r\n\t\t\ti++;\t\t\t\r\n\t\t}\r\n\r\n\t\tfor(String filename: filenames){\r\n\t\t\tlogger.info(\"Looking for:\" + filename);\r\n\t\t\tFile file = new File(filename);\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\t//JOptionPane.showMessageDialog(null, \"Cannot find \" + filename, \"Warning\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t// Simply ignore KIS\r\n\t\t\t\tlogger.info(\"Cannot find file \" + filename + \" so not load it as tab\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tString content = FileLoader.loadFile(filename);\r\n\t\t\t\t// If the application can't open one of the recorded tabs then drop out trying to load them.\r\n\t\t\t\tif(!openSavedTab(content)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void fromFile(String fileName)\n {\n //definir dados\n int i;\n int j;\n int lin;\n int col;\n String linha;\n FILE arquivo;\n\n arquivo = new FILE(FILE.INPUT, fileName);\n\n //obter dimensoes\n lin = lines();\n col = columns();\n\n //verificar se dimensoes validas\n if( lin <= 0 || col <= 0 )\n {\n IO.println(\"ERRO: Tamanho invalido. \");\n } //end\n else\n {\n //verificar se arquivo e' valido\n if( arquivo == null )\n {\n IO.println(\"ERRO: Arquivo invalido. \");\n } //end\n else\n {\n //ler a primeira linha do arquivo\n linha = arquivo.readln();\n\n //verificar se ha' dados\n if( linha == null )\n {\n IO.println(\"ERRO: Arquivo vazio. \");\n } //end\n else\n {\n linha = arquivo.readln();\n for( i = 0; i < lin; i++)\n {\n for( j = 0; j < col; j++)\n {\n //ler linha do arquivo\n linha = arquivo.readln();\n table[ i ][ j ] = linha;\n } //end repetir\n } //end repetir\n //fechar arquivo (indispensavel)\n arquivo.close();\n } //end se\n } //end se\n } //end se\n }", "public void load (String argFileName) throws IOException;", "public void importFileClick() {\n\n //Lets the user choose a file location\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open Resource File\");\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Run-length encoding\",\n \"*.rle\"));\n File file = fileChooser.showOpenDialog(new Stage());\n\n //If a file was chosen, will stop the game and set the generation to 0 and try to load the file.\n if (file != null) {\n timeline.stop();\n gOL.resetGenCounter();\n generationLabel.setText(Integer.toString(gOL.getGenCounter()));\n try {\n fileHandler.readGameBoardFromDisk(file);\n } catch (IOException ie) {\n //Produces a warning if unsuccessful\n PopUpAlerts.ioAlertFromDisk();\n }\n }\n\n aliveLabel.setText(Integer.toString(board.getCellsAlive()));\n ruleLabel.setText(gOL.getRuleString().toUpperCase());\n isMovable = true;\n canvasArea.requestFocus();\n setFocusTraversable(false);\n\n //Resets offset to accommodate for the new pattern and calls draw().\n canvasDrawer.resetOffset(board, canvasArea);\n draw();\n }", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "public void openFile(File file) {\n// new FileSystem().readFile(addressBook, file);\n// addressBook.fireTableDataChanged();\n }", "private void loadFile(){\n\tint returnVal = fileChooser.showOpenDialog(this);\n\n\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t File file = fileChooser.getSelectedFile();\n\t SAXParserFactory spf = SAXParserFactory.newInstance();\n\t try {\n\t\tInputStream xmlInput = new FileInputStream(file);\n\t\tSAXParser saxParser = spf.newSAXParser();\n\t\tRoomXMLParser rxp = new RoomXMLParser();\n\t\tsaxParser.parse(xmlInput, rxp);\n\n\t\trooms = rxp.getRooms();\n\t\tnumPlayers = rxp.getPlayers();\n\t\tnumNPCs = rxp.getNPCs();\n\t\trevalidate();\n\t }\n\t catch(SAXException|ParserConfigurationException|IOException e){\n\t\te.printStackTrace();\n\t }\n\t}\n }", "private static void fillTableFromFile(HashTable table) {\n Scanner in;\n try {\n in = new Scanner(new FileInputStream(\"File.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"File 'File.txt' not found\");\n return;\n }\n while (in.hasNext()) {\n table.add(in.next());\n }\n }", "void load_from_file(){\n\t\tthis.setAlwaysOnTop(false);\n\t\t\n\t\t/**\n\t\t * chose file with file selector \n\t\t */\n\t\t\n\t\tFileDialog fd = new FileDialog(this, \"Choose a file\", FileDialog.LOAD);\n\t\t\n\t\t//default path is current directory\n\t\tfd.setDirectory(System.getProperty(\"user.dir\"));\n\t\tfd.setFile(\"*.cmakro\");\n\t\tfd.setVisible(true);\n\t\t\n\t\t\n\t\t\n\t\tString filename = fd.getFile();\n\t\tString path = fd.getDirectory();\n\t\tString file_withpath = path + filename;\n\t\t\n\t\t\n\t\tif (filename != null) {\n\t\t\t System.out.println(\"load path: \" + file_withpath);\t\n\t\t\n\t\t\t \n\t\t\t /**\n\t\t\t * read object from file \n\t\t\t */\n\t\t\t\ttry {\n\t\t\t\t\tObjectInputStream in = new ObjectInputStream(new FileInputStream(file_withpath));\n\n\t\t\t\t\tKey_Lists = Key_Lists.copy((key_lists) in.readObject());\n\n\t\t\t\t\tkeys_area.setText(Key_Lists.arraylist_tostring());\t\t\n\t\t\t\t\t\n\t\t\t\t\tin.close();\n\t\t\t\t\t\n\t\t\t\t\tinfo_label.setForeground(green);\n\t\t\t\t\tinfo_label.setText(\"file loaded :D\");\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tinfo_label.setForeground(white);\n\t\t\t\t\tinfo_label.setText(\"wrong file format\");\n\t\t\t\t\tSystem.out.println(\"io exception\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tthis.setAlwaysOnTop(true);\n\t\n\t}", "public void loadFile(File file) throws FileNotFoundException\n {\n FileReader reader = new FileReader(file);\n\n // Clear table to make sure it only shows tasks from file\n Item.getToDoList().clear();\n if(this.listView != null)\n {\n listView.getItems().clear();\n }\n\n index = 0;\n\n try(BufferedReader temp = new BufferedReader(reader))\n {\n String info;\n boolean check;\n\n while((info = temp.readLine()) != null)\n {\n // Make an array of values\n String[] values = info.split(\",\");\n\n //Array length is 3, since 3 columns. If not that then incorrect file\n if(values.length != 3)\n {\n if(this.status != null)\n {\n status.setText(\"Incompatible File. \");\n }\n break;\n }\n\n // If correct, add information from file to list\n else\n {\n check = !values[2].equals(\"false\");\n Item.getToDoList().add(new Item(values[0], values[1], check));\n }\n }\n\n } catch (IOException exception)\n {\n // If error, let user know\n if(this.status != null)\n {\n status.setText(\"File not found. \");\n }\n\n exception.printStackTrace();\n }\n }", "private String readFile(File file){\n StringBuilder stringBuffer = new StringBuilder();\n BufferedReader bufferedReader = null;\n\n try {\n\n bufferedReader = new BufferedReader(new FileReader(file));\n\n String text;\n while ((text = bufferedReader.readLine()) != null) {\n stringBuffer.append(text.replaceAll(\"\\t\", miTab) + \"\\n\");\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n try {\n bufferedReader.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n return stringBuffer.toString();\n }", "private void loadFromDisk(String filename) throws IOException {\n Reader r = new FileReader(filename);\r\n load(r);\r\n }", "public void loadFile(View view) {\n // start the background file loading task\n LoadFileTask task = new LoadFileTask();\n task.execute();\n }", "public void loadWorkflow(String filename);", "public void readFromFile() {\n\n\t}", "private void openFile(File file){\r\n\t\ttry {\r\n\t\t\tlocal.openFile(file);\r\n\t\t\topenFile = file;\r\n\t\t\tframe.setTitle(file.getName());\r\n\t\t\tedit = false;\r\n\t\t\tBibtexPrefs.addOpenedFile(file);\r\n\t\t\tpopulateRecentMenu();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\terrorDialog(e.toString());\r\n\t\t} catch (IllegalArgumentException e){\r\n\t\t\terrorDialog(\"The bibtex file \" +file.getPath()+ \" appears to be invalid.\\n\"\r\n\t\t\t\t\t+ \"Parsing error occured because you have the following in your file:\\n\"\r\n\t\t\t\t\t+e.getMessage());\r\n\t\t}\r\n\t}", "public void load() ;", "@Override\n protected void onLoad(File file) {\n if (file.getName().endsWith(\".txt\")) {\n scene = Scene.loadFromFile(file);\n camera = new Camera(new Vector3D(0f,0f,0f), new Vector3D(0f,0f,0f), new Vector3D(1f,1f,1f));\n } else {\n JOptionPane.showMessageDialog(null, \"Error: Invalid file type.\\nExpected '*.txt'\", \"Invalid File type\", JOptionPane.ERROR_MESSAGE);\n System.out.println(\"Invalid file format\");\n }\n }", "@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}", "public boolean load(String file);", "public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}", "public abstract void load() throws IOException;", "private void createView(Tab tab, VMFile file, PostProcessHandler handler) {\n editResourceService.getFileContent(file.getId(), new AsyncCallback<byte[]>() {\n\n @Override\n public void onFailure(Throwable caught) {\n SC.warn(caught.getMessage());\n }\n\n @Override\n public void onSuccess(byte[] result) {\n BinaryResourceImpl r = new BinaryResourceImpl();\n ByteArrayInputStream bi = new ByteArrayInputStream(result);\n AbstractRootElement root = null;\n try {\n if (file.getExtension() != Extension.TXT && file.getExtension() != Extension.LSC && file.getExtension() != Extension.CSC) {\n r.load(bi, EditOptions.getDefaultLoadOptions());\n root = (AbstractRootElement) r.getContents().get(0);\n }\n } catch (IOException e) {\n SC.warn(e.getMessage());\n }\n Editor editor;\n if (file.getExtension() == null) {\n editor = new TextEditor(tab, file, editResourceService);\n editor.create();\n } else\n switch (file.getExtension()) {\n\n case ARC:\n editor = new ARCEditor((ARCRoot) root, projectId, editResourceService);\n editor.create();\n clickNewStateMachine((ARCEditor) editor, file);\n clickOpenFile((ARCEditor) editor);\n break;\n case FM:\n editor = new FMEditor((FMRoot) root, projectId, file.getId(), editResourceService);\n editor.create();\n clickOpenFile((FMEditor) editor);\n clickCreateChildModel((FMEditor) editor, file);\n setFileNameToReferenceNode((FMEditor) editor);\n break;\n case FMC:\n editor = new FMCEditor((FMCRoot) root, file.getId(), projectId, editResourceService);\n editor.create();\n break;\n case FSM:\n editor = new FSMEditor((FSMDStateMachine) root, file.getId());\n editor.create();\n break;\n case SCD:\n editor = new SCDEditor((SCDRoot) root, tab, projectId, ModelingProjectView.this, editResourceService);\n editor.create();\n clickOpenFile((SCDEditor) editor);\n break;\n case SPQL:\n editor = new SPQLEditor((SPQLRoot) root, tab, projectId, editResourceService);\n editor.create();\n clickOpenFile((SPQLEditor) editor);\n break;\n case TC:\n editor = new TCEditor((TCRoot) root, projectId, file.getName(), editResourceService);\n editor.create();\n break;\n case BPS:\n editor = new BPSEditor((BPSRoot) root, ModelingProjectView.this, projectId, file.getId(), editResourceService);\n editor.create();\n break;\n case BP:\n editor = new BPEditor((BPRoot) root, projectId, file, editResourceService);\n editor.create();\n break;\n case FPS:\n editor = new TPSEditor((TPSRoot) root, ModelingProjectView.this, projectId, file.getId(), editResourceService);\n editor.create();\n break;\n case FP:\n editor = new TPViewer((TPRoot) root, projectId, file, editResourceService);\n editor.create();\n break;\n case CSC:\n editor = new CSCEditor(tab, file, editResourceService);\n editor.create();\n break;\n case SCSS:\n editor = new CBEditor((CBRoot) root, ModelingProjectView.this, projectId, file.getId(), editResourceService);\n editor.create();\n break;\n case SCS:\n editor = new SCSEditor((SCSRoot) root, ModelingProjectView.this, projectId, file, editResourceService);\n editor.create();\n break;\n case CSCS:\n editor = new CSCSEditor((CSCSRoot) root, projectId, file);\n editor.create();\n break;\n default:\n editor = new TextEditor(tab, file, editResourceService);\n editor.create();\n }\n createTabMenu(tab, editor.getSaveItem());\n clickSaveFile(editor, tab);\n\n if (editor instanceof NodeArrangeInterface) {\n NodeArrange.add((NodeArrangeInterface) editor);\n }\n tab.setPane(editor.getLayout());\n tab.setAttribute(EDITOR, editor);\n editorTabSet.addTab(tab);\n editorTabSet.selectTab(tab.getAttributeAsString(\"UniqueId\"));\n if (handler != null) {\n handler.execute();\n }\n }\n });\n }", "public void openFile(@NotNull final CheckedConsumer<FileManager, IOException> loadAction) {\n try {\n final var pair = editorManager.createEditor();\n final Editor editor = pair.getFirst();\n final var fm = pair.getSecond();\n loadAction.accept(fm);\n editorManager.openEditor(editor, fm);\n mimaUI.fileChanged();\n App.logger.log(\"loaded: \" + FileName.shorten(fm.getLastFile()));\n } catch (@NotNull final IOException | IllegalStateException e) {\n App.logger.error(\"Could not load file: \" + e.getMessage());\n }\n }", "public void loadFromFile(String file) throws IOException {\n loadFromFile(file,DEFAULT_CHAR_SET);\n }", "public void load() {\n\t\tif (jfc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)\n\t\t\tload(jfc.getSelectedFile().getAbsolutePath());\n\t}", "public TabbedLineReader(File inFile) throws IOException {\n this.openFile(inFile, '\\t');\n this.readHeader();\n }", "public void load (String fileName) throws IOException {\n\t\tBufferedReader in = new BufferedReader\n\t\t\t(new InputStreamReader\n\t\t\t (new FileInputStream(fileName), JetTest.encoding));\n\t\tannotator.readTagTable(in);\n\t\tmene.load(in);\n\t}", "public static void load(FileIO fileIO) \r\n\t{\n\t\t\r\n\t}", "private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void openLab(File lab) throws IOException{ \n // Load data\n currentLab = lab;\n labName = lab.toString().substring(lab.toString().lastIndexOf(File.separator)+1);\n labDataCurrent = new LabData(this, lab, labName); \n\n // Load UI\n closeAllDialogs(); \n resetWindow();\n loadLab();\n }", "private void load(FileInputStream input) {\n\t\t\r\n\t}", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Sub>>(){}.getType();\n subList = gson.fromJson(in, listType);\n\n } catch (FileNotFoundException e) {\n subList = new ArrayList<Sub>();\n }\n }", "private void loadGame(String fileName){\n\n }", "@Override\n public void loadUrl(Tab tab, String url) {\n loadUrl(tab, url, null);\n }", "public void load()\r\n {\r\n \tfc.setAcceptAllFileFilterUsed(false);\r\n\t\tfc.setDialogTitle(\"Select the text file representing your organism!\");\r\n\t\tfc.setFileFilter(new FileNameExtensionFilter(\"Text Files (Organism)\", new String[]{\"txt\"}));\r\n\t\tif(fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION)\r\n\t\t\t//Try-Catch Block\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tbr=new BufferedReader(new FileReader(fc.getSelectedFile()));\r\n\t\t\t\tArrayList<Organism> treeTemp=new ArrayList<Organism>();\r\n\t\t \tString line=br.readLine();\r\n\t\t \tint x=0;\r\n\t\t \twhile(line!=null)\r\n\t\t \t{\r\n\t\t \t\t\tString[] genesSt=line.split(\" \");\r\n\t\t \t\t\tint[] genes=new int[genesSt.length];\r\n\t\t \t\t\tfor(int y=0; y<genesSt.length; y++)\r\n\t\t \t\t\t\tgenes[y]=Integer.parseInt(genesSt[y]);\r\n\t\t \t\t\t\t\r\n\t\t \t\t\ttreeTemp.add(new Organism(genes,x));\r\n\t\t \t\tline=br.readLine();\r\n\t\t \t\tx++;\r\n\t\t \t}\r\n\t\t \tbr.close();\r\n\t\t \te.setTree(treeTemp);\r\n\t\t \te.setParent(treeTemp.get(treeTemp.size()-1));\r\n\t\t\t\trepaint();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(Exception ex)\r\n\t\t\t{\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n }", "public void load();", "public void load();", "public void loadData() {\n Path path= Paths.get(filename);\n Stream<String> lines;\n try {\n lines= Files.lines(path);\n lines.forEach(ln->{\n String[] s=ln.split(\";\");\n if(s.length==3){\n try {\n super.save(new Teme(Integer.parseInt(s[0]),Integer.parseInt(s[1]),s[2]));\n } catch (ValidationException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }else\n System.out.println(\"linie corupta in fisierul teme.txt\");});\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void addTab(String title, File file, String contents) {\n \tTextPane newTextPane = new TextPane(parentFrame,TextPane.getProperties(false), false);\r\n\r\n \t// 2nd create the tab\r\n \tStyledTab tab = new StyledTab(title);\r\n \tTextPaneTab paneTab = new TextPaneTab(file, newTextPane, tab);\r\n\r\n \t// 3rd add contents if any\r\n \tif (contents != null) {\r\n \t\tnewTextPane.getBuffer().insert(0, contents);\r\n \t\tnewTextPane.setCaretPosition(0);\r\n \t\tpaneTab.setModified(false);\r\n \t}\r\n\r\n \t// 4th add new TextPaneTab\r\n \tpanes.add(paneTab);\r\n\r\n \t// 5th create the pane and add it to manager\r\n \tJPanel pane = new JPanel();\r\n \tpane.setLayout(new BorderLayout());\r\n\t\tJPanel textPaneContainer = new JPanel();\r\n\t\ttextPaneContainer.setBorder(BorderFactory.createLineBorder(new Color(102, 102, 102), 1));\r\n\t\ttextPaneContainer.setLayout(new BorderLayout());\r\n\t\ttextPaneContainer.add(newTextPane, BorderLayout.CENTER);\r\n \tpane.add(textPaneContainer, BorderLayout.CENTER);\r\n \tpane.add(makePrgButtonPanel(), BorderLayout.EAST);\r\n \tint index = getTabCount()-1;\r\n \tinsertTab(title, null, pane, null, index);\r\n \tsetTabComponentAt(index,tab);\r\n \tif (!file.isDirectory())\r\n \t\tsetToolTipTextAt(index, file.getAbsolutePath());\r\n }", "public void onLoadButtonCLick(ActionEvent e){\n\t\tloadFile();\n\t}", "private void loadHTMLFile(File file) {\n\t\ttry {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\tBufferedInputStream bis = new BufferedInputStream(fis);\n\t\t\twhile (bis.available() > 0) {\n\t\t\t\tsb.append((char) bis.read());\n\t\t\t}\n\t\t\tbis.close();\n\n\t\t\tString htmlContent = sb.toString();\n\n\t\t\twebEngineLoadContent(htmlContent, false);\n\t\t\thtmlEditor.setHtmlText(htmlContent);\n\n\t\t} catch (Exception e) { // catches ANY exception\n\t\t\tDialogs.create()\n\t\t\t\t\t.title(\"Error\")\n\t\t\t\t\t.masthead(\n\t\t\t\t\t\t\t\"Could not load data from file:\\n\" + file.getPath())\n\t\t\t\t\t.showException(e);\n\t\t}\n\t}", "public FileLoader(File file)throws IOException{\n rows =new Vector<String>();\n _file = file;\n loadTSPTWFile();\n }", "public void openFile(String file) {\n try {\n FileReader fr = new FileReader(file);\n in = new BufferedReader(fr);\n } catch (IOException e) {\n System.out.println(\"Filen kan ikke åbnes\");\n }\n }", "private void initTabComponent(DocumentWrapper file, int i) {\n\t\tpane.setTabComponentAt(i,\n\t\t\t\tnew ButtonTabComponent(pane, file, this));\n\t}", "public void loadFile()\n {\n\n FileDialog fd = null; //no value\n fd = new FileDialog(fd , \"Pick up a bubble file: \" , FileDialog.LOAD); //create popup menu \n fd.setVisible(true); // make visible manu\n String directory = fd.getDirectory(); // give the location of file\n String name = fd.getFile(); // give us what file is it\n String fullName = directory + name; //put together in one sting \n \n File rideNameFile = new File(fullName); //open new file with above directory and name\n \n Scanner nameReader = null;\n //when I try to pick up it read as scanner what I choose\n try\n {\n nameReader = new Scanner(rideNameFile);\n }\n catch (FileNotFoundException fnfe)//if dont find return this message below\n {\n return; // immedaitely exit from here\n }\n \n //if load button pressed, it remove all ride lines in the world\n if(load.getFound()){\n removeAllLines();\n } \n \n //read until is no more stings inside of file and until fullfill max rides\n while(nameReader.hasNextLine()&&currentRide<MAX_RIDES)\n {\n \n String rd= nameReader.nextLine();//hold and read string with name of ride\n RideLines nova =new RideLines(rd);\n rides[currentRide]=nova;\n \n //Create a RideLine with string given from file\n addObject(rides[currentRide++], 650, 20 + 40*currentRide);\n }\n \n //when is no more strings inside it close reader\n nameReader.close();\n }", "public void loadFile(String fileName) {//Retrieves name of file\r\n\t\tString line = null;\r\n\t\ttry{\r\n\t\t\tFileReader open = new FileReader(fileName);\r\n\t\t\tBufferedReader read = new BufferedReader(open);\r\n\t\t\twhile((line = read.readLine()) != null) {\r\n String[] parts = line.split(\" \");\r\n String part1 = parts[0];\r\n String part2 = parts[1];\r\n System.out.println(part1 + part2);\r\n \r\n\t\t\t\r\n\t\t\t}read.close();}\r\n\t\tcatch(FileNotFoundException ex) {\r\n System.out.println(\r\n \"Unable to open file '\" + \r\n fileName + \"'\"); } \r\n\t\tcatch(IOException ex) {\r\n System.out.println(\r\n \"Error reading file '\" \r\n + fileName + \"'\"); }\r\n\t}", "@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 }", "public void openFile() {\n\t\tfc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n\t\tint returnVal = fc.showOpenDialog(null);\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fc.getSelectedFile();\n\t filename.setText(file.getName());\n\t try {\n\t\t\t\tmodel.FileContent(file);\t//read the content of the input file\n\t\t\t\tplotContent.repaint();\t//repaint the JComponent\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public Tab loadUrl(String url) {\n return loadUrl(url, null);\n }", "private void addNewTab(SingleDocumentModel model) {\n\t\tString title = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().getFileName().toString();\n\t\tImageIcon icon = createIcon(\"icons/green.png\");\n\t\tJScrollPane component = new JScrollPane(model.getTextComponent());\n\t\tString toolTip = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().toAbsolutePath().toString();\n\t\taddTab(title, icon, component, toolTip);\n\t\tsetSelectedComponent(component);\n\t}", "protected void loadFile(String s) {\n\t\tpush();\n\t\tfile.load(s, curves);\n\t\trecalculateCurves();\n\t\tpushNew();\n\t}", "private void load(File toLoad) {\n\t\tif (toLoad.getName().endsWith(\".ics\")) {\n\t\t\ttry {\n\t\t\t\tthis.calendar = new TCalendar(toLoad);\n\t\t\t\tthis.showWeek(new GregorianCalendar());\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t} catch (CorruptedCalendarFileException e) {\n\t\t\t\tnew JErrorFrame(e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tnew JErrorFrame(\n\t\t\t\t\t\"The file type is incorrect, only .ics files are accepted\");\n\t\t}\n\t}", "public Tab load(String url, Map<String, String> headers) {\n if (delayLoad(url, headers)) {\n return null;\n }\n\n mFactory.setNextHeaders(headers);\n\n Tab tab = createNewTab(false, true, false);\n\n loadUrl(tab, url, headers);\n return tab;\n }", "public Tab loadUrl(String url, Map<String, String> headers) {\n return load(url, headers);\n }", "public void open() {\r\n\t\tFile f = getOpenFile(\"Map Files\", \"tilemap\");\r\n\t\tif (f == null) return;\r\n\t\tfile = f;\r\n\t\tframe.setTitle(\"Tile Mapper - \"+file.getName());\r\n\t\tSystem.out.println(\"Opening \"+file.getAbsolutePath());\r\n\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(\"tilemapper/Map.xsd\");\r\n\t\t\tfactory.setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(is)));\r\n\r\n\t\t\tDocument dom = factory.newDocumentBuilder().parse(file);\r\n\r\n\t\t\t// we have a valid document\r\n\t\t\t//printNode(dom, \"\");\r\n\t\t\tNode mapNode = null;\r\n\t\t\tNodeList nodes = dom.getChildNodes();\r\n\t\t\tfor (int i=0; i<nodes.getLength(); i++) {\r\n\t\t\t\tNode node = nodes.item(i);\r\n\t\t\t\tif (node.getNodeName() == \"Map\") mapNode = node;\r\n\t\t\t}\r\n\t\t\tif (mapNode == null) return;\r\n\t\t\tmapPanel.parseDOM((Element)mapNode);\r\n\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\tSystem.out.println(\"The underlying parser does not support the requested features.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (FactoryConfigurationError e) {\r\n\t\t\tSystem.out.println(\"Error occurred obtaining Document Builder Factory.\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void LoadBoard(String strFilePath){\n\t\t_TEST stack = new _TEST();\t\t\t\t\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"strFilePath:String\", \"\");\t/* TEST */\n\t\tParseFile(strFilePath);\n\t\tstack.PrintTail(ID,\"strFilePath:String\", \"\"); \t\t/* TEST */\n\n\t}", "private void loadGame() {\r\n\t\tJFileChooser fileChooser = new JFileChooser();\r\n\t\tArrayList<String> data = new ArrayList<String>();\r\n\t\tFile file = null;\r\n\t\tif (fileChooser.showOpenDialog(gameView) == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tfile = fileChooser.getSelectedFile();\r\n\t\t}\r\n\r\n\t\tif (file != null) {\r\n\t\t\tmyFileReader fileReader = new myFileReader(file);\r\n\t\t\ttry {\r\n\t\t\t\tdata = fileReader.getFileContents();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\t// TODO: allow writing of whose turn it is!\r\n\t\t\tParser parse = new Parser();\r\n\t\t\tint tempBoard[][] = parse.parseGameBoard(data);\r\n\t\t\tgameBoard = new GameBoardModel(tempBoard, parse.isBlackTurn(), parse.getBlackScore(), parse.getRedScore());\r\n\t\t}\r\n\t}", "private void loadScheme(File file)\n\t{\n\t\tString name = file.getName();\n\n\t\ttry\n\t\t{\n\t\t\tBedrockScheme particle = BedrockScheme.parse(FileUtils.readFileToString(file, Charset.defaultCharset()));\n\n\t\t\tthis.presets.put(name.substring(0, name.indexOf(\".json\")), particle);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic Object load(String file) {\n\t\treturn null;\n\t}", "public void loadGame(File f) {\n clearGame();\n loadgame = new LoadGame(f, chessboard, this, gamelog);\n System.out.println(\"Gamed Loaded.\");\n \n frame.update(frame.getGraphics());\n\n }", "void load();", "void load();", "public static void reading(String fileName)\n {\n\n }", "public void loadMem(final File file) {\r\n TempMem.clearNamdAddresses();\r\n TempMem.setText(Input.loadFile(file));\r\n }", "public static void loadGrid(Window owner) {\n File file = GridLoaderSaver.fileChooser.showOpenDialog(owner);\n\n if (file != null) {\n String[] game = null;\n\n try (BufferedReader bufferedReader = Files.newBufferedReader(file.toPath())) {\n game = bufferedReader.readLine().split(\" \");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n if (game != null) {\n int rows = Integer.parseInt(game[0]);\n int columns = Integer.parseInt(game[1]);\n int width = Integer.parseInt(game[2]);\n int height = Integer.parseInt(game[3]);\n int maxNumberOfStarts = Integer.parseInt(game[4]);\n int maxNumberOfEnds = Integer.parseInt(game[5]);\n int ends = 0;\n\n MouseGestures mouseGestures = new MouseGestures(game[6].equals(\"true\"));\n HashSet<Cell> starts = new HashSet<>();\n\n Grid grid = new Grid(starts, rows, columns, width, height, ends, maxNumberOfStarts, maxNumberOfEnds, mouseGestures, file);\n\n String[] stringCells = game[7].split(\"\");\n\n for (int i = 0, r = 0; r < rows; r++) {\n for (int c = 0; c < columns; c++, i++) {\n Point type = Point.values()[Integer.parseInt(stringCells[i])];\n\n grid.getCells()[r][c].setPoint(type);\n\n if (type != Point.EMPTY)\n grid.getCells()[r][c].getStyleClass().add(type.name().toLowerCase() + \"-cell\");\n\n if (type == Point.END)\n ends++;\n\n else if (type == Point.START)\n starts.add(grid.getCells()[r][c]);\n }\n }\n\n grid.setEnds(ends);\n\n Tab tab = new Tab(file.getName(), grid);\n\n ((TabPane) owner.getScene().getRoot()).getTabs().add(tab);\n\n\n }\n }\n }", "private void loadFromFile(String fileName) {\n try {\n InputStream inputStream = this.openFileInput(fileName);\n if (inputStream != null) {\n ObjectInputStream input = new ObjectInputStream(inputStream);\n boardManager = (BoardManager) input.readObject();\n inputStream.close();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n } catch (ClassNotFoundException e) {\n Log.e(\"login activity\", \"File contained unexpected data type: \" + e.toString());\n }\n }", "public void addFile() \n {\n try {\n //JFileChooser jf=new JFileChooser();\n //jf.showOpenDialog(null);\n // String fp=jf.getSelectedFile().getAbsolutePath();\n File file2=new File(\"trial.txt\");\n BufferedReader br=new BufferedReader(new FileReader (file2));\n Object[] tableLines=br.lines().toArray();\n for (Object tableLine : tableLines) {\n String line = tableLine.toString().trim();\n String[] dataRow=line.split(\",\");\n jtModel.addRow(dataRow);\n jtModel.setValueAt(Integer.valueOf(dataRow[2]), jtModel.getRowCount()-1, 2);\n }\n br.close();\n }\n catch(Exception ex) {\n JOptionPane.showMessageDialog(rootPane,\"Nothing was selected\");\n }\n }", "public TabbedFrame() throws IOException\r\n\t{\r\n\t\tDatabase data = new Database(\"studenti.txt\", \"predmeti.txt\", \"UpisaniPredmeti.txt\");\r\n\t\tstudents = new StudentsPanel(data);\r\n\t\tsubjects = new SubjectsPanel(data);\r\n\t\tsubjectList = new SubjectListPanel(data);\r\n\t\ttabbedPane = new JTabbedPane();\r\n\t\ttabbedPane.addTab(\"Studenti\", students);\r\n\t\ttabbedPane.addTab(\"Predmeti\", subjects);\r\n\t\ttabbedPane.addTab(\"Svi predmeti\", subjectList);\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n\t\tadd(tabbedPane, BorderLayout.CENTER);\r\n\t\tpack();\r\n\t\tsetVisible(true);\r\n\t}", "public static void loadTabContent(String fxml, Node tabBorderPane, Initializable i) {\n\n try {\n FXMLLoader loader = new FXMLLoader();\n loader.setController(i);\n loader.setLocation(ApplicationNavigator.class.getResource(fxml));\n Node centerContent = loader.load();\n\n controller.setTabScreen(centerContent, tabBorderPane);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void load(File filename) throws IOException {\n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream ois = new ObjectInputStream(fis);\n HighScoresTable table = (HighScoresTable) ois.readObject();\n ois.close();\n this.capacity = table.size();\n this.highScores = table.getHighScores();\n } catch (IOException e) {\n throw e;\n } catch (ClassNotFoundException e2) {\n System.out.println(e2);\n this.capacity = HighScoresTable.DEFAULT_CAPACITY;\n this.highScores.clear();\n System.out.println(\"table has been cleared. new size is: \" + HighScoresTable.DEFAULT_CAPACITY);\n }\n }", "public void load() {\n }", "default void load(String file) {\n load(new File(file));\n }", "public void newFile() {\n\t\tString filename = \"untitled\";\n\t\tfilename = JOptionPane.showInputDialog(null,\n\t\t\t\t\"Enter the new file name\");\n\t\taddTab(filename+\".minl\");\n\t}", "public void loadSaveGameFromFile(File file) {\r\n\t\t//TODO\r\n\t}", "void loadProducts(String filename);", "private void loadSpaceObjects(String file){\n\t\ttry{\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tScanner sc = new Scanner(br);\n\t\t\t\n\t\t\tloadFactory(sc);\n\t\t\tloadPlanets(sc);\n\n\t\t\tsc.close();\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"File not found: SpaceProgramPlanets.txt\");\n\t\t}\n\t}", "void buildTabFromSelection(GralFileSelector.FavorPath info, GralPanelContent tabPanel)\n { assert(false);\n /*\n tabPanel.addGridPanel(info.tabName1, info.tabName1,1,1,10,10);\n mng.setPosition(0, 0, 0, -0, 1, 'd'); //the whole panel.\n FileSelector fileSelector = new FileSelector(\"fileSelector-\"+info.tabName1, mng);\n fileSelector.setActionOnEnterFile(main.executer.actionExecute);\n main.idxFileSelector.put(info.tabName1, fileSelector);\n fileSelector.setToPanel(mng, info.tabName1, 5, new int[]{2,20,5,10}, 'A');\n fileSelector.fillIn(new File(info.path));\n */\n }", "void load(final File file) {\n this.file = Preconditions.checkNotNull(file);\n this.gameModelPo = gameModelPoDao.loadFromFile(file);\n visibleAreaService.setMapSize(getMapSize());\n initCache();\n }", "private void openTreeML()\r\n {\r\n// // Create the file filter.\r\n// SimpleFileFilter[] filters = new SimpleFileFilter[] {\r\n// new SimpleFileFilter(\"xml\", \"Tree ML (*.xml)\")\r\n// };\r\n// \r\n// // Open the file.\r\n// String file = openFileChooser(true, filters);\r\n// \r\n// // Process the file. \r\n// if (file != null)\r\n// {\r\n// m_gtree = Loader.loadTreeML(file);\r\n// TreeDisplay disp = new TreeDisplay(m_gtree,0);\r\n// TreePanel panel = new TreePanel(disp, LEGEND, ORIENTATION_CONTROL_WIDGET);\r\n// m_tabbedPane.setComponentAt(1, panel);\r\n// }\r\n }", "public void load(String filename) throws IOException\n {\n DataInputStream input;\n\n try\n {\n input = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(filename))));\n }\n catch (Exception e)\n {\n throw new IOException(\"Cannot open input file \" + filename + \":\" + e.getMessage());\n }\n load(input);\n input.close();\n }", "public static HighScoresTable loadFromFile(File filename) {\n HighScoresTable newScoresTable = new HighScoresTable(4);\n ObjectInputStream inputStream = null;\n try {\n inputStream = new ObjectInputStream(new FileInputStream(filename));\n List<ScoreInfo> scoreFromFile = (List<ScoreInfo>) inputStream.readObject();\n if (scoreFromFile != null) {\n //scoreFromFile.clear();\n newScoresTable.scoreInfoList.addAll(scoreFromFile);\n }\n } catch (FileNotFoundException e) { // Can't find file to open\n System.err.println(\"Unable to find file: \" + filename);\n //return scoresTable;\n } catch (ClassNotFoundException e) { // The class in the stream is unknown to the JVM\n System.err.println(\"Unable to find class for object in file: \" + filename);\n //return scoresTable;\n } catch (IOException e) { // Some other problem\n System.err.println(\"Failed reading object\");\n e.printStackTrace(System.err);\n //return scoresTable;\n } finally {\n try {\n if (inputStream != null) {\n inputStream.close();\n }\n } catch (IOException e) {\n System.err.println(\"Failed closing file: \" + filename);\n }\n }\n return newScoresTable;\n\n\n }" ]
[ "0.6724137", "0.66382444", "0.6466505", "0.6387585", "0.6370532", "0.6343823", "0.6252861", "0.6235504", "0.6201247", "0.619695", "0.6193581", "0.61204195", "0.61121106", "0.61053866", "0.60996705", "0.60788333", "0.60531455", "0.6011371", "0.59982", "0.5986307", "0.59510595", "0.5943989", "0.58786595", "0.58654726", "0.58303654", "0.5821436", "0.5749698", "0.57465404", "0.5736691", "0.5732598", "0.57042164", "0.5702939", "0.5700004", "0.5698979", "0.56945413", "0.5692292", "0.5676714", "0.56723666", "0.56698674", "0.5665958", "0.5656642", "0.5651904", "0.5646067", "0.56426674", "0.5633957", "0.56100905", "0.56079334", "0.5607267", "0.5584045", "0.5569844", "0.5566977", "0.55522376", "0.5551928", "0.5544097", "0.5515424", "0.5515424", "0.55101764", "0.5500477", "0.5494197", "0.5490591", "0.5479938", "0.5478242", "0.54676557", "0.54670197", "0.54641163", "0.5438982", "0.54335356", "0.54297316", "0.54225415", "0.5421103", "0.542101", "0.5420684", "0.540612", "0.5403867", "0.53951824", "0.5392496", "0.53863233", "0.5384929", "0.538259", "0.53773403", "0.53773403", "0.5375134", "0.53740144", "0.53726274", "0.53721607", "0.5361429", "0.5357451", "0.5353282", "0.5352752", "0.5350897", "0.5350425", "0.53452104", "0.53365237", "0.5336455", "0.5336175", "0.53183645", "0.5314733", "0.5303449", "0.53001535", "0.5297149" ]
0.7202795
0
Runs the code in the selected tab
public void runProgram() { JTextPane code = ((MinLFile) tabbedPane.getSelectedComponent()).CodeArea; minc.consolearea.setText(""); interpretorMainMethod(code.getText(), 0); double_variables.clear(); string_variables.clear(); functions.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void tabSelected();", "public void applyTab();", "public void runEditorNew()\r\n\t{\r\n\t\tmainFrame.runEditorNew();\r\n\t}", "@Override\n\tpublic void selectTab(Tab tab) {\n\t\t\n\t}", "public void runEditorExisting()\r\n\t{\r\n\t\tmainFrame.runEditorExisting();\r\n\t}", "public void tabChange() {\r\n\t}", "@And(\"^I clicked on \\\"([^\\\"]*)\\\" tab$\")\r\n\tpublic void clickonTab(String Acttab) throws Exception {\r\n\t\tenduser.click_Tab(Acttab);\r\n\t\tSystem.out.println(Acttab);\r\n\t \r\n\t}", "public void run() \n\t\t\t{\n\t\t\t\tUIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n\t\t\t\tJFileChooser fc = new JFileChooser();\n\t\t\t\t// Only allow the selection of files with an extension of .asm.\n\t\t\t\tfc.setFileFilter(new FileNameExtensionFilter(\"ASM files\", \"asm\"));\n\t\t\t\t// Uncomment the following to allow the selection of files and\n\t\t\t\t// directories. The default behavior is to allow only the selection\n\t\t\t\t// of files.\n\t\t\t\tfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n\t\t\t\tif (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)\n\t\t\t\t\tnew Assembler(fc.getSelectedFile().getPath());\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"No file selected; terminating.\");\n\t\t\t}", "@Override\r\n public void run() {\n ax.browserPane.setTitleAt(0,ax.browser.getTitle());\r\n String stringToken1 = null; \r\n try {\r\n stringToken1 = (\"<Navigate Home>::\" + getHome());\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n ax.consoleTextArea.setText(stringToken1);\r\n //Put the current html address in the addressbar\r\n ax.addressBar.setText(ax.browser.getCurrentLocation());\r\n \r\n }", "public void doButtonRunter() {\n\t\tint sel = this.anzeige.getSelectedRow();\n\t\tif ((sel >= 0) & (sel < this.tabellenspalten.size() - 1)) {\n\t\t\tObject o = this.tabellenspalten.get(sel);\n\t\t\tthis.tabellenspalten.remove(sel);\n\t\t\tthis.tabellenspalten.add(sel + 1, o);\n\t\t\tthis.doRepaint();\n\t\t\tthis.anzeige.setRowSelectionInterval(sel + 1, sel + 1);\n\t\t}\n\t}", "public void run() {\n\t\tISelection selection = _typesViewer.getSelection();\n\t\tObject obj = ((IStructuredSelection) selection).getFirstElement();\n\t\tif (obj instanceof EClass) {\n\t\t\t// TODO find the right one! \n\t\t\tEmfaticEditor editor = _tv.getActiveEmfaticEditor();\n\t\t\tif (editor != null) {\n\t\t\t\tEmfaticASTNode landingPlace = EmfaticHyperlinkDetector\n\t\t\t\t\t\t.getLandingPlace((EClass) obj, editor);\n\t\t\t\tif (landingPlace != null) {\n\t\t\t\t\teditor.setSelection(landingPlace, true);\n\t\t\t\t\teditor.setFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void Run(){\n\t\t_TEST stack = new _TEST();\t\t/* TEST */\n\t\tstack.PrintHeader(ID,\"\", \"\");\t/* TEST */\n\t\t\n\t\tSetStatus(Status.RUNNING);\n\t\t\n\t\tstack.PrintTail(ID,\"\", \"\"); \t/* TEST */\n\t\t\n\t}", "public void run(){\n int selection = -1;\n super.myConsole.listOptions(menuOptions);\n selection = super.myConsole.getInputOption(menuOptions);\n branchMenu(selection);\n }", "public void setSelectedTab(int arg0) {\n\n\t}", "public void runProgram() {\n if (isSyntaxChecked()) {\n // panelDebugArea1.getTextArea().setText(\"\");\n this.setPause(false);\n try {\n // Precisa adicionar o Swingworker em uma nova thread para que ele execute!!\n // Vai entender.\n // Duas instâncias de Swingworker diferentes não estavam rodando ao mesmo mesmo. O código abaixo solucionou o problema.\n new Thread(this.getWorker()).start();\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, this.errorWhileRunningText + \"\\n\" + ex);\n }\n }\n }", "public void run(IViewPart view) {\n\t\tIWorkbenchPage page = view.getSite().getPage();\n\t\trunBrowser(page);\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tIWorkbenchPage page = getPage();\n\t\t\t\t\tJasmineEditorInput input = new JasmineEditorInput(specRunner, name);\n\t\t\t\t\tpart.add(page.openEditor(input, ID));\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\texception.add(e);\n\t\t\t\t}\n\t\t\t}", "public native void selectTab(GInfoWindow self, int index)/*-{\r\n\t\tself.selectTab(index);\r\n\t}-*/;", "protected abstract void doTabSelectionChanged(int oldIndex, int newIndex);", "private void showTab(int tab) {\n switch (tab) {\n case OUTING_TAB_EXPENSES:\n switchToExpensesTab();\n break;\n case OUTING_TAB_BUDDIES:\n switchToBuddiesTab();\n break;\n }\n\n this.activeTab = tab;\n }", "public void run() {\n\t\t\t\tviewer.collapseToLevel(root, 2); // TODO: does not, it always collapse to level 1\n//\t\t\t\tshowSelection(par, sel);\n//\t\t\t\tif (actionCollapsAll.isChecked()) {\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t}", "private void setupTabs() {\n }", "@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n \tint pos = tab.getPosition();\n mViewPager.setCurrentItem(pos);\n String result = null;\n \n Log.i(TAG, \"onTabSelected: \" + pos + \"\\r\\n\");\n\n\t\tString sCmds[] = {\n\t\t \t\"/system/bin/dumpsys media.audio_policy\",\n\t\t\t\"/system/bin/dumpsys media.audio_flinger\",\n\t\t\t\"/system/bin/dumpsys audio\",\n\t\t\t\"/system/bin/cat /proc/asound/cards\",\n\t\t\t\"/system/bin/getevent /dev/input/event10\"};\n\t\n\t\tif(mRunners[pos]!=null && !mRunners[pos].isAlive()){\n\t\t\tmSectionsPagerAdapter.clearText(pos);\n\t\t\tmRunners[pos].exit();\n\t\t\tLog.i(TAG, \"Recreate the worker Thread\");\n\t\t}else\n\t\t\tLog.i(TAG, \"Create the worker Thread\");\n\t\t\n\t\tmRunners[pos] = new CmdRunner(sCmds[pos], pos);\n\t\tmRunners[pos].start();\n }", "void onTabSelectionChanged(int tabIndex);", "@NotNull\n TabResult onConsoleTab(@NotNull ConsoleCommandSender console,\n @NotNull String[] params);", "public void run(int choice) {\n\t\tswitch(choice) {\n\t\tcase 0:\n\t\t\tthis.startBook();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tthis.home();\n\t\t\tbreak;\n\t\t}\n\t}", "void startScript() {\n\n\t\tif (UIHANDLER_WS_NAME.equalsIgnoreCase((String) core.readDataPool(\n\t\t\t\tDP_ACTUAL_UIHANDLER, preferences.getString(\n\t\t\t\t\t\tPropName_UIHander, UIHANDLER_WS_NAME)))) {\n\n\t\t\t// startButtonLabel.setIcon(resourceMap.getIcon(\"startButtonLabel.icon\"));\n\t\t\tcore.getSystemIF().openBrowser();\n\t\t} else {\n\t\t\tArchive ActiveArchive = (Archive) mSourceSpinner.getSelectedItem();\n\t\t\tif (ActiveArchive == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpreferences\n\t\t\t\t\t.edit()\n\t\t\t\t\t.putString(PropName_ScriptName,\n\t\t\t\t\t\t\tActiveArchive.getFileName()).commit();\n\t\t\tcore.writeDataPool(DP_ACTIVE_ARCHIVE, ActiveArchive);\n\t\t\tcore.startScriptArchive(ActiveArchive);\n\n\t\t\t// ----------------------------------------------------------\n\t\t\t// prepare the \"load Script\" message\n\t\t\tDiagnose.showDialog = true;\n\t\t\t// the following trick avoids a recreation of the Diagnose\n\t\t\t// TapActivity as long as the previous created one is still\n\t\t\t// in memory\n\t\t\tIntent i = new Intent();\n\t\t\ti.setClass(MainActivity.this, DiagnoseTab.class);\n\t\t\ti.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\t\tstartActivity(i);\n\n\t\t}\n\n\t}", "public void runGame()\r\n\t{\r\n\t\tmainFrame.runGame();\r\n\t}", "public void execute() {\n _plugin.openNavigator();\n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void runState() {\n\t\tp.displaySheet();\n\t\tcurState.run();\n\t}", "public void run() {\r\n\t\tif (window != null) {\r\n\t\t\tIEditorPart part = window.getActivePage().getActiveEditor();\r\n\t\t\t\r\n\t\t\tboolean write = false;\r\n\t\t\tGraphEditorInput input = null;\r\n\t\t\tString defaultFileName = sdf.format(new Date()) + getDefaultExtension();\r\n\t\t\tif (part != null) {\r\n\t\t\t\tinput = (GraphEditorInput) part.getEditorInput();\r\n\t\t\t\twrite = input != null;\r\n\t\t\t\tif (!GraphEditorInput.LIVE_EDITOR_NAME.equals(part.getTitle())) {\r\n\t\t\t\t\tdefaultFileName = part.getTitle();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tFile f = chooseSaveFile(window.getShell(), defaultFileName);\r\n\t\t\t\r\n\t\t\tif (f != null) {\r\n\t\t\t\tif (write) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlog.debug(\"writing file..\");\r\n\t\t\t\t\t\tinput.getGXLDocument().write(f);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (Exception e) {\r\n\t\t\t\t\t\tMessageDialog.openError(window.getShell(), \"Error\", \"Error saving to file:\" + e.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tMessageDialog.openInformation(window.getShell(), \"File saving failed!\",\r\n\t\t\t\t\t\t\t\"Could not save the file, editor contains no data!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract void executeRunButton();", "public void keyTab(){\n\n try {\n driver.switchTo().activeElement().sendKeys(Keys.TAB);\n\t\t\tLOGGER.info(\"Step : \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": Pass \");\n\n }catch(Exception e)\n {\n\t\t\tLOGGER.error(\"Step : \"+Thread.currentThread().getStackTrace()[2].getMethodName()+\": Fail \");\n\t\t\t//e.printStackTrace();\n\t\t\tthrow new NotFoundException(\"Exception while clicking on Tab button\");\n\t\t\n }\n }", "public void run() {\n\t\t\t\t\tif (currentViewer != null) {\r\n\t\t\t\t\t\tcurrentViewer.setSelection(new StructuredSelection(\r\n\t\t\t\t\t\t\t\ttheSelection.toArray()), true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\tpublic void run() {\n\t\tregisterTab(\"chat\");\n\t\tregisterListener(\"COMMAND\");\n\t}", "private void initTab()\n {\n \n }", "@Override\n public void execute(final SimInfo object) {\n SimulatorConfig config = object.getSimulatorConfig();\n defaultEditTabAction(config);\n\n\n }", "public void run(){\t\t\n\t\tSystem.out.println(\"Welcome to Tic Tac Toe!\");\n\t\tdo{\n\t\t\tSystem.out.printf(\"\\n>\");\n\t\t\tchooseFunction();\n\t\t}while(true);\t\t\n\t}", "default void run() {\n\t\tSystem.out.println(\"run\");\r\n\t}", "@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tNoteInJson[] pattern=gpt.getPattern();\r\n\t\t\t\t\t\t\t\t\t\t\tgotoLiveView(pattern,gst.resultFile);\r\n\t\t\t\t\t\t\t\t\t\t}", "public void actionPerformed(ActionEvent event) {\n teacherTabMethod();\r\n }", "private static void OnQueryStatusTabForward(Object sender, CanExecuteRoutedEventArgs args)\r\n { \r\n TextEditor This = TextEditor._GetTextEditor(sender); \r\n if (This != null && This.AcceptsTab)\r\n { \r\n args.CanExecute = true;\r\n }\r\n else\r\n { \r\n args.ContinueRouting = true;\r\n } \r\n }", "Out (FoilBoard target) { \n app = target;\n\n // layout = new CardLayout();\n // setLayout(layout);\n\n probe = new Probe(app);\n geometry = new Geometry(app);\n data = new Data(app);\n \n // TODO: regen this on update (if active)\n // perfweb = new PerfWeb(app);\n addTab(\"Summary\", null, perfweb, \"Shape and Performance Summary\");\n addTab(\"Geometry\", null, geometry, \"Hydrofoil components geometry,\\nfoil/profile geometry tables or links\");\n addTab(\"Data\", null, data, \"Hydrofoil components data,\\nincluding size, shape etc\");\n addTab(\"Probe\", null, probe, \"Fluid Flow Probe Display\");\n // old: addTab(\"Plot\", null, pp, \"Show Plot\");\n\n\n // phazing out this.... (still works). instead, copy&past \"summary\" tab into\n // html tool such as https://html-online.com/editor/ and done!\n //\n // perfwebsrc = new PerfWebSrc(app);\n // addTab(\"<h1>Summary...\", null, perfwebsrc, \"Shape and Performance Summary,\\n html codes for embedding\");\n\n //setSelectedComponent(perfweb);\n\n // adding actions to tabs: following \"whoa\" ideas from stackoverflow work but I use\n // overloaded paint() instead, seem simple.\n\n // JLabel label = new JLabel(\"XXX\");\n // label.addMouseListener(new java.awt.event.MouseAdapter() {\n // public void mouseClicked(MouseEvent e) {\n // System.out.println(\"woah! \");\n // setSelectedIndex(0);\n // }});\n // \n // setTabComponentAt(0, label);\n\n //setModel(new javax.swing.DefaultSingleSelectionModel() {\n //\n // @Override\n // public void setSelectedIndex(int index) {\n // System.out.println(\"woah! \" + index);\n // setSelectedIndex(index);\n // }\n // });\n\n // can be used to attach aux logic here..\n this.addChangeListener(new javax.swing.event.ChangeListener() {\n @Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n // e.getSource();\n // System.out.println(\"-- e: \" + e);\n //System.out.println(\"Selected paneNo : \" + .getSelectedIndex());\n } });\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t((EventListenerTab) FragmentUtil.getActivity(discoverFragmentTab)).onEventSelected(event, \n\t\t\t\t\t\tholder.imgEvt, holder.txtEvtTitle);\n\t\t\t\tholder.rltLytBtm.setPressed(false);\n\t\t\t}", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.main_ll_xw:\n setTabSelection(0);\n break;\n case R.id.main_ll_rili:\n setTabSelection(1);\n break;\n case R.id.main_ll_hq:\n setTabSelection(2);\n break;\n case R.id.main_ll_wd:\n setTabSelection(3);\n break;\n\n case R.id.main_ll_self:\n setTabSelection(4);\n break;\n }\n }", "@Override\n public void run() {\n try{\n //System.out.println(\"make method\");\n java.lang.reflect.Method method;\n //System.out.println(\"get DwenguinoBlocklyArduinoPlugin class\");\n Class ed = DwenguinoBlocklyArduinoPlugin.editor.getClass();\n //System.out.println(\"get args\");\n Class[] cArg = new Class[1];\n //System.out.println(\"set first arg as string\");\n cArg[0] = String.class;\n //System.out.println(\"get setText method\");\n method = ed.getMethod(\"setText\", cArg);\n //System.out.println(\"invoke method\");\n method.invoke(editor, code);\n }catch(NoSuchMethodException e) {\n //System.out.println(\"nosuchmethod\");\n \t\t\tDwenguinoBlocklyArduinoPlugin.editor.getCurrentTab().setText(code);\n \t\t} catch (IllegalAccessException e) {\n //System.out.println(\"illegalaccess\");\n \t\t\tDwenguinoBlocklyArduinoPlugin.editor.getCurrentTab().setText(code);\n \t\t} catch (SecurityException e) {\n //System.out.println(\"security\");\n \t\t\tDwenguinoBlocklyArduinoPlugin.editor.getCurrentTab().setText(code);\n \t\t} catch (InvocationTargetException e) {\n //System.out.println(\"invocationtarget\");\n \t\t\tDwenguinoBlocklyArduinoPlugin.editor.getCurrentTab().setText(code);\n \t\t}\n \n //System.out.println(\"handleExport\");\n\n DwenguinoBlocklyArduinoPlugin.editor.handleExport(false);\n\n //System.out.println(\"Done handling export\");\n }", "public void run()\n {\n getMenuChoice();\n }", "public void run() {\n\t\toutput.println(\"This is a tic-tac-toe game\\n\");\r\n\t\t\r\n\t\t//output.println(\"REQUEST 1. PvP 2.PvE\");\r\n\t\t//mode = input.nextInt();\t\t\r\n\t\tgameMode(2);\r\n\t\t\r\n\t\t\r\n\t}", "public void run(){\n ArrayList<String> menuItems = new ArrayList<>();\n menuItems.add(\"Play the Game\");\n menuItems.add(\"Close the Program\");\n menuItems.add(\"Show the highest score\");\n String menu = CollectionTools.collectionPrinter('S', menuItems);\n runMenu(menu);\n }", "@Override\n public void run() {\n Frame parentFrame = getParentFrame(IFrameSource.FULL_CONTEXT);\n if (parentFrame != null) {\n getFrameList().gotoFrame(parentFrame);\n }\n }", "@Override\n\tpublic void run() {\n\t\tinitMode();\n\t\t\n\t\tdisplayStartMsg();\n\t\t\n\t\tdisplayMsgBeforeRun();\n\t\tint resultGame = runMode();\n\t\t\n\t\tdisplayEndMsg(resultGame);\n\t}", "public ExecScriptCallback()\n {\n\tchooserTitle = DragonUI.textSource.getI18NText(TextKeys.SPTFILE,\n\t\t\t\t\t\t \"SCRIPT FILE TO RUN\");\n\t}", "public static void setActiveTab(Tab tab) {\n\n try {\n controller.tabPane.getTabs().add(controller.appointmentTab);\n controller.tabPane.getTabs().add(controller.bookingTab);\n controller.tabPane.getTabs().add(controller.customerTab);\n controller.tabPane.getTabs().add(controller.employeeTab);\n controller.tabPane.getTabs().add(controller.malfunctionTab);\n controller.tabPane.getTabs().add(controller.statisticTab);\n controller.tabPane.getTabs().add(controller.vehicleTab);\n\n SingleSelectionModel<Tab> selectionModel = controller.tabPane.getSelectionModel();\n\n selectionModel.select(tab);\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void run() {\n TextActionsProvider actionsProvider = textpage.getActionsProvider();\n Object object = actionsProvider.getTextActions().get(\"Edit/Edit_Undo\");\n if (object != null) {\n actionsProvider.invokeAction(object);\n editor.save();\n }\n }", "public static void openTab(ClientContext ctx, Game.Tab tab) {\n if (ctx.game.tab() != tab) {\n\n if (tab == Game.Tab.INVENTORY) {\n ctx.input.send(\"{VK_F2 down}\");\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n ctx.input.send(\"{VK_F2 up}\");\n\n } else if (tab == Game.Tab.MAGIC) {\n ctx.input.send(\"{VK_F4 down}\");\n\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n ctx.input.send(\"{VK_F4 up}\");\n } else {\n ctx.game.tab(tab);\n\n Condition.wait(new Callable<Boolean>() {\n @Override\n public Boolean call() throws Exception {\n return ctx.game.tab() == tab;\n }\n }, 250, 10);\n }\n }\n }", "private void openSavedTabs(){\n\t\tList<String> filenames = new ArrayList<String>();\r\n\t\tint i = 0;\t\t\r\n\t\twhile(propertiesMemento.get(\"tab\" + i) != null){\r\n\t\t\tfilenames.add((String) propertiesMemento.get(\"tab\" + i));\r\n\t\t\ti++;\t\t\t\r\n\t\t}\r\n\r\n\t\tfor(String filename: filenames){\r\n\t\t\tlogger.info(\"Looking for:\" + filename);\r\n\t\t\tFile file = new File(filename);\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\t//JOptionPane.showMessageDialog(null, \"Cannot find \" + filename, \"Warning\", JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t// Simply ignore KIS\r\n\t\t\t\tlogger.info(\"Cannot find file \" + filename + \" so not load it as tab\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tString content = FileLoader.loadFile(filename);\r\n\t\t\t\t// If the application can't open one of the recorded tabs then drop out trying to load them.\r\n\t\t\t\tif(!openSavedTab(content)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run(){ \n \t//sets up the GUI and performs operations based on ActionListeners\n \tpackageGUI();\n \toperate();\n }", "public void navigateToTab(String tabName) {\n if (tabName.equals(\"File\") || tabName.equals(\"Appreciation\") ||\n tabName.equals(\"Announcement\") || tabName.equals(\"Workflow\")) {\n WebElement more = driver.findElement(By.xpath(\"//span[@id='feed-add-post-form-link-text' and contains(text(),'More')]\"));\n more.click();\n BrowserUtils.wait(3);\n WebElement subModule=driver.findElement(By.xpath(\"//span[@class='menu-popup-item-text' and contains(text(),'\"+tabName+\"')]\"));\n subModule.click();\n } else {\n String tabXpath = \"//span[@class='feed-add-post-form-link']//span[text()='\" + tabName + \"']\";\n WebElement tab = driver.findElement(By.xpath(tabXpath));\n\n tab.click();\n }\n }", "public void openTab(String tabName){\r\n\r\n\t\tTabView selectedTabView = new TabView(this);\r\n\t\ttabViews.add(selectedTabView);\r\n\t\t\r\n\t\t\r\n\t\tif(tabName == null){ // If a new tab..\r\n\t\t\t// Ensure that there isn't already a model with that name\r\n\t\t\twhile(propertiesMemento.getTabNames().contains(tabName) || tabName == null){\r\n\t\t\t\ttabName = \"New Model \" + newModelIndex;\r\n\t\t\t\tnewModelIndex++;\r\n\t\t\t}\r\n\t\t}\r\n logger.info(\"Adding tab:\" + tabName);\r\n\r\n\t\t// Just resizes and doesn't scroll - so don't need the scroll pane\r\n\t\t/*JScrollPane scrollPane = new JScrollPane(selectedTabView, \r\n \t\t\t\t\t\t\t\t JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, \r\n \t\t\t\t\t\t\t\t JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\r\n scrollPane.getVerticalScrollBar().setUnitIncrement(20);\r\n tabbedPane.addTab(tabName, scrollPane);*/\r\n\r\n\t\ttabbedPane.addTab(tabName, selectedTabView);\r\n\r\n currentView = selectedTabView;\r\n tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);\r\n setTabName(tabName);\r\n\t\t\t\t\r\n tabbedPane.setTabComponentAt(tabbedPane.getSelectedIndex(), \r\n\t\t\t\t new TabButtonComponent(propertiesMemento.getImageDir(), this, currentView));\r\n \r\n // Add Mouse motion Listener \r\n currentView.addMouseMotionListener(currentView);\r\n currentView.addMouseListener(currentView);\r\n\r\n // Record the tab in the memento\r\n propertiesMemento.addTabRecord(tabName);\r\n \r\n setTabButtons(true);\r\n \r\n setStatusBarText(\"Ready\");\r\n\r\n requestFocusInWindow();\r\n\t}", "public static void main(String[] args) {\n\n\n Editor e = new Editor();\n e.launch(Editor.class);\n\n }", "List<String> tab(CommandSender sender, List<String> args);", "public void run(IStructuredSelection selection) {\r\n\t\t\r\n\t\tif (!canOperateOn(selection))\r\n\t\t\treturn;\r\n\t\trun(selection.toArray());\r\n\t}", "@Override\r\n\tpublic void run(IAction action) {\n\t\ttry {\r\n\t\t\twindow.getActivePage().showView(JFreeChartView.ID);\r\n\t\t} catch (PartInitException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void runAllUnits(String path){\n\t\t\n\t\tint tabCount = tabbedPane.getTabCount();\n\t\tfor (int i =0; i < tabCount; i++){\n\t\t\tString keyString = tabbedPane.getTitleAt(i);\n\t\t\tif(i == LOCAL_UNIT){\n\t\t\t\trunTest(path,i);\n\t\t\t}else{\n\t\t\t\tint key = Integer.parseInt(keyString.split(\" \")[2]);\n\t\t\t\trunTest(path,key);\n\t\t\t}\n\t\t}\n\t}", "private void openCodeGen(IWorkbenchWindow window) {\n\n\t\tlog.info(\"Trying to open CodeGen wizard.\");\n\t\tShell[] shell = ShellLookup.getInstance().getShells();\n\t\tfor (Shell sh : shell) {\n\t\t\tif (sh.getText() == CodeGenWizard.WIZZARD_NAME)\n\t\t\t\treturn;\n\t\t}\n\t\tINewWizard wizard = new CodeGenWizard();\n\t\tWizardDialog dialog = new WizardDialog(window.getShell(), wizard);\n\t\tdialog.setMinimumPageSize(150, 350);\n\n\t\tdialog.addPageChangedListener(new IPageChangedListener() {\n\n\t\t\t@Override\n\t\t\tpublic void pageChanged(PageChangedEvent event) {\n\t\t\t\tlog.info(\"Page changed listener was started.\");\n\t\t\t\tObject selected = event.getSelectedPage();\n\t\t\t\tif (selected instanceof PreviewPage) {\n\t\t\t\t\tPreviewPage prev = ((PreviewPage) selected);\n\t\t\t\t\tlog.debug(\"Active page -> 'PreviewPage'.\");\n\t\t\t\t\tdialog.updateButtons();\n\t\t\t\t} else if (selected instanceof MethodsPage) {\n\t\t\t\t\tlog.debug(\"Active page -> 'MethodsPage'.\");\n\t\t\t\t} else if (selected instanceof FirstPage) {\n\t\t\t\t\tlog.debug(\"Active page -> 'FirstPage'.\");\n\t\t\t\t\t((FirstPage) selected).dialogChanged();\n\t\t\t\t\tdialog.updateButtons();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tdialog.addPageChangingListener(new IPageChangingListener() {\n\n\t\t\t@Override\n\t\t\tpublic void handlePageChanging(PageChangingEvent event) {\n\t\t\t\tlog.info(\"Page changing listener was started.\");\n\t\t\t\tObject current = event.getCurrentPage();\n\t\t\t\tObject target = event.getTargetPage();\n\t\t\t\tif (current instanceof MethodsPage && target instanceof PreviewPage) {\n\t\t\t\t\tlog.debug(\"Switching between 'MethodsPage' -> 'PreviewPage'.\");\n\t\t\t\t\tMethodsPage meth = ((MethodsPage) current);\n\t\t\t\t\tPreviewPage prev = ((PreviewPage) target);\n\t\t\t\t\tlog.info(\"Trying to generate code.\");\n\t\t\t\t\tCodeGenerator g = new CodeGenerator(meth.getClassBuilder().getClassName(),\n\t\t\t\t\t\t\tmeth.getClassBuilder().getPackageName(), meth.getSelectedOptional());\n\t\t\t\t\tlog.info(\"Trying to update text area in 'PreviewPage'.\");\n\t\t\t\t\tg.setLastActiveShell(lastActiveShell);\n\t\t\t\t\tprev.updateAreaContent(g.generateCode());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tlog.info(\"Opening WizardDialog -> \" + wizard.getWindowTitle() + \"...\");\n\t\tdialog.open();\n\t}", "public void run() {\r\n\r\n // Load the templates from the templates directory inside the ireport module...\r\n File templatesDirectory = new File(MainFrame.IREPORT_TMP_TEMPLATE_DIR);\r\n if (templatesDirectory != null && templatesDirectory.exists())\r\n {\r\n loadTemplatesFromFile(templatesDirectory);\r\n }\r\n\r\n // Load all the templates from the templates directories (is set...)\r\n String pathsString = MainFrame.IREPORT_TMP_TEMPLATE_DIR; //LIMAO :..\r\n\r\n // All the paths are separated by an end line...\r\n if (pathsString.length() > 0)\r\n {\r\n String[] paths = pathsString.split(\"\\\\n\");\r\n for (int i=0; i<paths.length; ++i)\r\n {\r\n File f = new File(paths[i]);\r\n loadTemplatesFromFile(f);\r\n }\r\n }\r\n\r\n\r\n if (((DefaultListModel)jList1.getModel()).getSize() > 0)\r\n {\r\n Mutex.EVENT.readAccess(new Runnable() {\r\n\r\n public void run() {\r\n jList1.setSelectedIndex(0);\r\n }\r\n });\r\n }\r\n\r\n }", "private void editScriptButtonActionPerformed() {\n // DEBUG CODE load the test script script\n String script = \"\";\n\n try {\n script = ScriptsDAO.getTextForBuiltInScript(\"utils/aspace/\", \"mapper.bsh\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n // if we running in standalone mode in pre update 15\n if (mainFrame == null || mainFrame.getAtVersionNumber().contains(\"15\") || mainFrame.getAtVersionNumber().contains(\"16\")) {\n if (cvd == null) {\n cvd = new CodeViewerDialog(this, SyntaxConstants.SYNTAX_STYLE_JAVA, script, true, false);\n }\n\n cvd.setTitle(\"Mapper Script Editor\");\n cvd.pack();\n cvd.setVisible(true);\n } else {\n // check to see if we have a viewer dialog, if not initialize one\n if (svd == null) {\n svd = new ScriptViewerDialog(this, \"Mapper Script Editor\");\n }\n\n svd.setCurrentScript(script);\n svd.pack();\n svd.setVisible(true);\n }\n }", "public void run() {\r\n _btnPreviewStop.setText(\"Preview\"); // I18N\r\n }", "public void runFile(String filename) {\n }", "public void selectTab(Predicate<? super CTabItem> tabFilter) {\r\n\t\tthis.displayTab.setSelection(Arrays.stream(this.getTabFolder().getItems()).filter(tabFilter).findFirst().orElseThrow(() -> new UnsupportedOperationException()));\r\n\t\tthis.displayTab.showSelection();\r\n\t}", "private static void doUserRequestedStepType(String stepType) {\n dvm.setStepType(stepType);\n dvm.executeProgram();\n //When focus returns back to the UI, print out the sourcecode again.\n displayXCode();\n }", "public void run(IAction action) {\n\t\tMessageDialog.openInformation(window.getShell(), \"AccTrace\",\n\t\t\t\t\"Hello, Eclipse world\");\n\t}", "private void runRefactoring() {\r\n Refactoring refactoring = createRefactoring();\r\n\r\n // Update the code\r\n try {\r\n refactoring.run();\r\n } catch (RefactoringException re) {\r\n JOptionPane.showMessageDialog(null, re.getMessage(), \"Refactoring Exception\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n\r\n updateSummaries();\r\n\r\n // Update the GUIs\r\n ReloaderSingleton.reload();\r\n }", "@Override\n\tpublic void perform() {\n\t\tcontrol.openSkillEditor();\n\t}", "public void selectTab(int index) {\r\n\t\tthis.displayTab.setSelection(index);\r\n\t\tthis.displayTab.showSelection();\r\n\t}", "public void run() {\n\t\t\t\tif (actionShowOutputs.isChecked()) {\n\t\t\t\t\torg.openmodelica.modelicaml.common.instantiation.TreeUtls.classInstantiation = null;\n\t\t\t\t\torg.openmodelica.modelicaml.common.instantiation.TreeUtls.componentsTreeRoot = null;\n\t\t\t\t\tshowSelection(par, sel);\n\t\t\t\t}\n\t\t\t}", "void runCode() throws IOException, InterruptedException {\n String[] cmd = {\n \"/bin/sh\",\n \"-c\",\n \"gnome-terminal --command=\\\"bash -c \\'cd \" + currentDirectory.getPath() + \" && g++ -o \" + currentFile.getName().substring(0, currentFile.getName().lastIndexOf('.')) + \" \" + currentFile.getName() + \" && \" + \"./main; $SHELL\\'\\\"\"\n };\n Process p = new ProcessBuilder(cmd).start();\n\n StringBuilder output = new StringBuilder();\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\n String line;\n while ((line = reader.readLine()) != null) {\n output.append(line + \"\\n\");\n }\n\n int exitVal = p.waitFor();\n if (exitVal == 0) {\n System.out.println(\"Success!\");\n } else {\n System.out.println(\"Fail!\");\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String[] tokens = {\"next_month\"};\n try {\n caseScanner.processInstructions(tokens);\n } catch (IOException ioException) {\n ioException.printStackTrace();\n } catch (ClassNotFoundException classNotFoundException) {\n classNotFoundException.printStackTrace();\n }\n /* Close current panel*/\n currentDate.setText(\"Current Time: \" + TestCaseReader.getMonthTimeStamp() + \"/\" + TestCaseReader.getYearTimeStamp());\n }", "public void run() {\n List<Node> selNodes = new ArrayList<Node>(selectedPaths.size());\n\n for (Object path : selectedPaths) {\n selNodes.add(findPath(root, (String[]) path));\n }\n\n // set the selection\n Node[] newSelection = selNodes.toArray(new Node[selNodes.size()]);\n\n if (exploredCtx != null) {\n setExploredContext(findPath(root, exploredCtx), newSelection);\n } else {\n setSelectedNodes0(newSelection);\n }\n }", "public void run() {\n super.executeStep();\n }", "private void selectFirstTab() {\n Tab tab = view\n .getNationsTabPane()\n .getTabs().get(0);\n\n tabChanged(tab, tab);\n }", "@Override\r\n\tpublic void launch(ISelection arg0, String arg1) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSystem.out.println(\"Ok launch\");\r\n\t\tMessageBox dialog = new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK\r\n\t\t\t\t| SWT.CANCEL);\r\n\t\tdialog.setText(\"ZCWeb Running Application\");\r\n\t\tdialog.setMessage(\"You choosed to run/debug ---- \"\r\n\t\t\t\t+ sampleGetSelectedProject() + \" ---- as a Web Application\");\r\n\t\tdialog.open();\r\n\t\tLaunchWebApp.main(args);\r\n\r\n\t}", "public void executeScript() throws Exception {\n\t\tnav.SearchFor(\"\");\n\t\tnav.ClickNavigationLinks(TopNavLinks.WOMENSAPPAREL);\n\t\tprp.RefineByColor(\"Black\");\n\t\tprp.RefineBySize(\"Medium\");\n\t\tprp.ClickFirstItem();\n\t}", "public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); \n String str = FileChooserDemo.selectFile();\n if (str == null){\n \t\n }else{\n \ttext_field.setText(str);\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tRun();\n\t}", "public void tabChanged()\n {\n super.tabChanged();\n }", "private static void OnQueryStatusTabBackward(Object sender, CanExecuteRoutedEventArgs args)\r\n { \r\n TextEditor This = TextEditor._GetTextEditor(sender);\r\n if (This != null && This.AcceptsTab) \r\n { \r\n args.CanExecute = true;\r\n } \r\n else\r\n {\r\n args.ContinueRouting = true;\r\n } \r\n }", "public void Inter() throws InterruptedException {\n\t\t//Adv.click();\n\t\tJavascriptExecutor js = (JavascriptExecutor)driver;\n\t\t//js.executeScript(\"arguments[0].click()\", Elemnt);\n\t\t//Thread.sleep(3000);\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\", Interactiontab);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Interaction tab has opened successfully\");\n\t\t\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\", Sortable);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Sortable tab has opened successfully\");\n\t\t\n\t\tGrid.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has opened successfully\");\n\n\t\tGridThree.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has selected firstnumber successfully\");\n\n\t\tGridNine.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has selected Second number successfully\");\n\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\", Selectable);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Selectable tab has opened successfully\");\n\t\t\n\t\tList3.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"List tab has selected first number successfully \");\n\t\t\n\t\tList1.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"List tab has selected second number successfully \");\n\t\t\n\t\t\n\t\tGridSelect.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has opened successfully in Selectable tab\");\n\n\t\tGridSeven.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has selected firstnumber successfully\");\n\t\t\n\t\tGridfive.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Grid tab has selected firstnumber successfully\");\n\t\t\n\t\t\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\",Resize);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Resize tab has opened successfully\");\n\t\t\n\t\tActions act= new Actions(driver);\n\t\tact.dragAndDropBy(arrow, 20, 15).perform();;\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Size has been changed successfully\");\n\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\",drop);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Dropable tab has opened successfully\");\n\t\t\n\t\tActions action=new Actions(driver);\n\t\taction.dragAndDrop(drag, drop1).perform();\n\t\tLogger5.log(Status.PASS, \"Simple drag has performed successfully\");\n\n\t\t\n\t\taccept.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Accept tab has opened successfully\");\n\t\t\n\t\tActions a =new Actions(driver);\n\t\ta.dragAndDrop(aceptable, drop2);\n\t\tThread.sleep(5000);\n\t\tLogger5.log(Status.PASS, \"Accept drag has performed successfully\");\n\n\t\tjs.executeScript(\"window.scrollBy(0,360)\");\n\t\tThread.sleep(2000);\n\t\tjs.executeScript(\"arguments[0].click()\",dragable);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Draggable tab has opened successfully\");\n\t\t\n\t\tAxis.click();\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Axis restricted tab has opened successfully\");\n\t\t\t\n\t\n\t\tPoint p=xaxis.getLocation();\n\t\tSystem.out.println(\"Position of X-axis is :-\" +p.getX());\n\t\tSystem.out.println(\"Position of Y-axis is :-\" +p.getY());\n\t\tActions x=new Actions(driver);\n\t\tx.dragAndDropBy(xaxis, -100, p.getY());\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"X Axis has moved successfully\");\n\t\n\t\tActions y=new Actions(driver);\n\t\ty.dragAndDropBy(yaxis, 0, 900);\n\t\tThread.sleep(3000);\n\t\tLogger5.log(Status.PASS, \"Y Axis has moved successfully\");\n\t}", "public boolean clicktab(String tabname) throws Exception {\r\n\t\t\ttry {\r\n\t\t\t\tBy tab = By.xpath(\"//div[@class='ds_jobheader']//div[contains(.,'\"+tabname+\"')]\");\r\n\t\t\t\tSystem.out.println(tab);\r\n\t\t\t\telement = driver.findElement(tab);\r\n\t\t\t\tflag = element.isDisplayed() && element.isEnabled();\r\n\t\t\t\tAssert.assertTrue(flag, \"Tab Not present\");\r\n\t\t\t\telement.click();\r\n\t\t\t\tThread.sleep(3000);\r\n\t\t\t\ttxt = element.getAttribute(\"class\");\r\n\t\t\t\tSystem.out.println(txt);\r\n\t\t\t\tif (txt.contains(\"active\")){\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t\tSystem.out.println(\"Tab \" + tabname +\" is selected\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"Tab \" + tabname +\" is not selected\");\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t}\r\n\t\t\t\tAssert.assertTrue(flag, \"Tab can not be selected\");\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Tab \"+tabname +\" NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\treturn flag;\r\n\t\t\t\r\n\t\t}", "@Test\r\n\tpublic void TC004() {\r\n\t\t// 1. User Opens the JBrick application\r\n\t\t// => The Code Frame has only one tab opened, \"New File 1\"\r\n\t\t\r\n\t\tMainWindow jbricks = StartupFunctions.newJBricksInstance(\"JBricks - TC004\");\r\n\t\tString fileName = FileFunctions.getFileName(jbricks);\r\n\t\tassertTrue(fileName.equals(\"New File 1\"));\r\n\t\t\r\n\t\t// 2. User creates a new file using File>New menu option\r\n\t\t// => A new tab is generated in the code frame, labeled \"New File 2\"\r\n\t\t\r\n\t\tMenuFunctions.newFile(jbricks);\r\n\t\tint tabCount = FileFunctions.getTabCount(jbricks);\r\n\t\tassertTrue(tabCount == 2);\r\n\t\tfileName = FileFunctions.getCurrentFile(jbricks);\r\n\t\tassertTrue(fileName.equals(\"New File 2\"));\r\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\texecutable.feedbackExecutionProcessRunning();\r\n\t\t\t}", "private void tabContainerMouseClicked(java.awt.event.MouseEvent evt) {\n \n if (tabContainer.getSelectedIndex() == 0) {\n \n PostTableUpdate();\n } // stats\n else if (tabContainer.getSelectedIndex() == 1) {\n genTop5Gov();\n genTop5User();\n moreStats();\n } // news letter\n else if (tabContainer.getSelectedIndex() == 2) {\n } // gestion utilisateurs\n else if (tabContainer.getSelectedIndex() == 3) {\n UserTableUpdate();\n } // mon compte \n else if (tabContainer.getSelectedIndex() == 4) {\n }\n\n\n }", "public void run() {\n if (this.gui.getPauseState()) {\n this.gui.goHome();\n }\n }", "public void run()\n {\n mkdStack = translateMacroStack(mkdStack);\n //translate mkd to html\n translateMkdToHtml();\n //send html string to global variable\n Compiler.htmlString = htmlStackToString();\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(context, MainActivity.class);\n intent.putExtra(MainActivity.SELECTED_TAB_EXTRA_KEY, MainActivity.EARNINGS_TAB);\n context.startActivity(intent);\n// Intent intent = new Intent(context, TvBetaActivity.class);\n// context.startActivity(intent);\n\n }", "public static void run(Project project){\n\t\tproject.executeTarget(project.getDefaultTarget());\n\t}", "@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\tvp.setCurrentItem(tab.getPosition());\n\t}", "protected abstract void updateTabState();", "public native int getSelectedTab(GInfoWindow self)/*-{\r\n\t\treturn self.getSelectedTab();\r\n\t}-*/;" ]
[ "0.6423287", "0.6242049", "0.62088233", "0.6146969", "0.6100849", "0.6079502", "0.60616183", "0.5989334", "0.590393", "0.58471394", "0.58374846", "0.5833371", "0.5824643", "0.5803829", "0.5756774", "0.5746572", "0.57462364", "0.57452893", "0.5732637", "0.57268536", "0.5717815", "0.56936413", "0.5672393", "0.56643915", "0.56605494", "0.5631805", "0.56218624", "0.5621748", "0.5619986", "0.55881673", "0.55791247", "0.5560042", "0.5546833", "0.55444896", "0.5539862", "0.5533481", "0.55133355", "0.5512528", "0.5489129", "0.54870206", "0.5469147", "0.5453939", "0.5436422", "0.54194766", "0.54111737", "0.5408494", "0.5405703", "0.5402559", "0.5401827", "0.5398329", "0.5390665", "0.5390197", "0.5387401", "0.53843987", "0.5373117", "0.53676456", "0.53671163", "0.53645664", "0.53525454", "0.5340564", "0.53142697", "0.53108966", "0.5298833", "0.52986276", "0.529762", "0.529741", "0.52970254", "0.52966416", "0.5294244", "0.5293649", "0.5291106", "0.528613", "0.5278473", "0.5269769", "0.5263949", "0.5256853", "0.525094", "0.52500254", "0.5246268", "0.5242521", "0.523827", "0.5232197", "0.5228073", "0.5225503", "0.52224743", "0.5221225", "0.52201647", "0.5216371", "0.5214893", "0.52066666", "0.5205749", "0.5204455", "0.51990384", "0.5198368", "0.51962805", "0.5195483", "0.5194293", "0.51940435", "0.5192343", "0.51901275" ]
0.689814
0
return super.onJsPrompt(view, "", message, defaultValue, result);
@Override public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, final JsPromptResult result) { final EditText textbox = new EditText(view.getContext()); textbox.setText(defaultValue); AlertDialog dialog = new AlertDialog.Builder(view.getContext()). setTitle(""). setMessage(message). setCancelable(true). setView(textbox). setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { result.confirm(String.valueOf(textbox.getText())); } }). setNeutralButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { result.cancel(); } }). setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { result.cancel(); } }).create(); dialog.show(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPrompt(){ return _prompt ; }", "protected abstract void fillPromptText();", "protected abstract JTextComponent createPromptComponent();", "public String getPrompt() { return prompt; }", "abstract void mainPrompt();", "public abstract void printPromptMessage();", "public void setPrompt(Prompt prmpt) {\n this.prompt = prmpt;\n }", "public JTextComponent getPromptComponent(JTextComponent txt)\n/* */ {\n/* 190 */ if (this.promptComponent == null) {\n/* 191 */ this.promptComponent = createPromptComponent();\n/* */ }\n/* 193 */ if ((txt.isFocusOwner()) && (PromptSupport.getFocusBehavior(txt) == PromptSupport.FocusBehavior.HIDE_PROMPT))\n/* */ {\n/* 195 */ this.promptComponent.setText(null);\n/* */ } else {\n/* 197 */ this.promptComponent.setText(PromptSupport.getPrompt(txt));\n/* */ }\n/* */ \n/* 200 */ this.promptComponent.getHighlighter().removeAllHighlights();\n/* 201 */ if ((txt.isFocusOwner()) && (PromptSupport.getFocusBehavior(txt) == PromptSupport.FocusBehavior.HIGHLIGHT_PROMPT))\n/* */ {\n/* 203 */ this.promptComponent.setForeground(txt.getSelectedTextColor());\n/* */ try {\n/* 205 */ this.promptComponent.getHighlighter().addHighlight(0, this.promptComponent.getText().length(), new DefaultHighlighter.DefaultHighlightPainter(txt.getSelectionColor()));\n/* */ }\n/* */ catch (BadLocationException e)\n/* */ {\n/* 209 */ e.printStackTrace();\n/* */ }\n/* */ } else {\n/* 212 */ this.promptComponent.setForeground(PromptSupport.getForeground(txt));\n/* */ }\n/* */ \n/* 215 */ if (PromptSupport.getFontStyle(txt) == null) {\n/* 216 */ this.promptComponent.setFont(txt.getFont());\n/* */ } else {\n/* 218 */ this.promptComponent.setFont(txt.getFont().deriveFont(PromptSupport.getFontStyle(txt).intValue()));\n/* */ }\n/* */ \n/* */ \n/* 222 */ this.promptComponent.setBackground(PromptSupport.getBackground(txt));\n/* 223 */ this.promptComponent.setHighlighter(new PainterHighlighter(PromptSupport.getBackgroundPainter(txt)));\n/* */ \n/* 225 */ this.promptComponent.setEnabled(txt.isEnabled());\n/* 226 */ this.promptComponent.setOpaque(txt.isOpaque());\n/* 227 */ this.promptComponent.setBounds(txt.getBounds());\n/* 228 */ Border b = txt.getBorder();\n/* */ \n/* 230 */ if (b == null) {\n/* 231 */ this.promptComponent.setBorder(txt.getBorder());\n/* */ } else {\n/* 233 */ Insets insets = b.getBorderInsets(txt);\n/* 234 */ this.promptComponent.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));\n/* */ }\n/* */ \n/* */ \n/* 238 */ this.promptComponent.setSelectedTextColor(txt.getSelectedTextColor());\n/* 239 */ this.promptComponent.setSelectionColor(txt.getSelectionColor());\n/* 240 */ this.promptComponent.setEditable(txt.isEditable());\n/* 241 */ this.promptComponent.setMargin(txt.getMargin());\n/* */ \n/* 243 */ return this.promptComponent;\n/* */ }", "public String getPrompt() {\r\n\t\treturn \"oui/non\";\r\n\t}", "protected abstract void hidePrompt();", "@Override\n public <T> T promptUser(Prompt<T> prompt) {\n return null;\n }", "public boolean displayPrompt(String msg);", "public Prompt getPrompt() {\n return prompt;\n }", "private String promptLoadOrNew(){\r\n Object[] options = {\"Start A New Game!\", \"Load A Previous Game.\"};\r\n String result = (String) JOptionPane.showInputDialog(\r\n null,\r\n \"What would you like to do?\",\r\n \"Welcome!\",\r\n JOptionPane.PLAIN_MESSAGE,\r\n null,\r\n options,\r\n 1);\r\n return result;\r\n \r\n }", "public DialogPrompt(String title)\n {\n value = new PromptValueString(\"\",\"\");\n initUI(title,10);\n }", "public Scene deliverPrompt()\n {\n System.out.println(prompt);\n deliverOptions();\n return takeResponse();\n }", "public String getPrompt() {\n return prompt;\n }", "public String getPrompt(){\n\t\treturn getString(KEY_PROMPT);\n\t}", "@Override\n public void messagePrompt(String message) {\n JOptionPane.showMessageDialog(lobbyWindowFrame,message+\" is choosing the gods\");\n }", "public void showPasswordPrompt();", "@Override\r\n\t\tpublic boolean promptYesNo(String message) {\n\t\t\treturn true;\r\n\t\t}", "@Override\n public String getUnansweredPromptText() {\n return (\"Please select an item or add your own.\");\n }", "protected abstract void highLightPrompt();", "@Test\n public void basicPromptConfirmHandlingChangeAndDismissTest(){\n\n WebElement promptButton = driver.findElement(By.id(\"promptexample\"));\n WebElement promptResult = driver.findElement(By.id(\"promptreturn\"));\n\n assertEquals(\"pret\", promptResult.getText());\n promptButton.click();\n\n String alertMessage = \"I prompt you\";\n Alert promptAlert = driver.switchTo().alert();\n assertEquals(alertMessage,promptAlert.getText());\n\n promptAlert.sendKeys(\"Hello\");\n promptAlert.dismiss();\n assertEquals(\"pret\", promptResult.getText());\n }", "@Test\n public void basicPromptConfirmHandlingChangeAndAcceptTest(){\n\n WebElement promptButton = driver.findElement(By.id(\"promptexample\"));\n WebElement promptResult = driver.findElement(By.id(\"promptexample\"));\n\n assertEquals(\"pret\", promptResult.getText());\n promptButton.click();\n\n String alertMessage = \"I prompt you\";\n Alert promptAlert = driver.switchTo().alert();\n assertEquals(alertMessage,promptAlert.getText());\n\n promptAlert.sendKeys(\"Hello\");\n promptAlert.accept();\n assertEquals(\"Hello\", promptResult.getText());\n }", "public abstract void promptForInput(final String msg);", "public String getPrompt() {\n\t\treturn prompt;\n\t}", "@Override\n\t\t\tpublic boolean onJsConfirm(WebView view, String url,\n\t\t\t\t\tString message, JsResult result) {\n\t\t\t\treturn super.onJsConfirm(view, url, message, result);\n\t\t\t}", "@Override\n public void onPromptAndCollectUserInformationResponse(PromptAndCollectUserInformationResponse arg0) {\n\n }", "private void promptForSomething() {\n userInputValue = prompt(\"Please enter something: \", true);\n System.out.println(\"Thank you. You can see your input by choosing the Display Something menu\");\n }", "InputPromptTransmitter getInputPromptTransmitter();", "DialogResult show();", "@Override\n public void handle(ActionEvent event) {\n alert = new Alert(AlertType.CONFIRMATION);\n //Optional title. If not used the standard title \"Confiramation\" will be displayed\n //To remove the title use alert.setTitle(null);\n alert.setTitle(\"Confirmation Dialog\");\n //Optional header.If not used the standard header \"Confiramation\" will be displayed\n //To remove the title use alert.setHeaderText(null); \n alert.setHeaderText(\"Please answer the question!\");\n alert.setContentText(initText);\n //Display the dialog and get the result from the user action\n Optional<ButtonType> result = alert.showAndWait();\n if (result.get() == ButtonType.OK){\n // the user clicked OK\n alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(\"Important message for you!\");\n alert.setContentText(\"Happiness is ephemeral!\");\n alert.showAndWait(); \n //the user clocked Cancel\n } else {\n // ... user chose CANCEL or closed the dialog\n //Warning Dialog\n alert = new Alert(AlertType.WARNING);\n alert.setTitle(\"Warning Dialog\");\n alert.setHeaderText(\"Read the Warning!\");\n alert.setContentText(\"You must like Java - Shall make you Happy!\");\n alert.showAndWait(); \n }\n }", "int promptOption(IMenu menu);", "public interface PromptListener {\n /**\n * On Prompt\n * @param promptText String\n */\n void OnPrompt(String promptText);\n}", "@Test\n public void basicPromptConfirmHandlingDismissTest(){\n\n WebElement promptButton = driver.findElement(By.id(\"promptexample\"));\n WebElement promptResult = driver.findElement(By.id(\"promptreturn\"));\n\n assertEquals(\"pret\", promptResult.getText());\n promptButton.click();\n\n String alertMessage = \"I prompt you\";\n Alert promptAlert = driver.switchTo().alert();\n\n // In IE the alert always used to return \"Script Prompt:\" and not the\n // actual prompt text but now it works fine\n assertEquals(alertMessage,promptAlert.getText());\n\n promptAlert.dismiss();\n assertEquals(\"pret\", promptResult.getText());\n }", "@Override\r\n\t\tpublic void setPromptSymbol(Character symbol) {\n\r\n\t\t}", "public void setPrompt(String prompt){\n\t\tsetValue(KEY_PROMPT, prompt);\n\t}", "void drawPrompt(String message);", "@Test\n public void basicPromptConfirmHandlingAcceptTest(){\n\n WebElement promptButton = driver.findElement(By.id(\"promptexample\"));\n WebElement promptResult = driver.findElement(By.id(\"promptreturn\"));\n\n assertEquals(\"pret\", promptResult.getText());\n promptButton.click();\n String alertMessage = \"I prompt you\";\n Alert promptAlert = driver.switchTo().alert();\n\n // IE prompt now shows the correct message so no need for any caveat\n assertEquals(alertMessage,promptAlert.getText());\n promptAlert.accept();\n assertEquals(\"change me\", promptResult.getText());\n }", "public void onClick(DialogInterface dialog, int id) {\n promptName = (userInput.getText()).toString();\n if(promptName==null || promptName.equals(\"\"))\n {\n starterPrompt();\n }\n }", "@Override\n public boolean onJsAlert(WebView view, String url, String message, JsResult result) {\n return super.onJsAlert(view, url, message, result);\n }", "public void setPrompt(String prompt) {\n\t\tthis.prompt = prompt;\n\t}", "public Boolean getPromptType() {\n\t\treturn this.isPromptKeyWord;\n\t}", "public void generatePrompt(View view) {\n String prompt;\n\n int i = generator.nextInt(prompts.size());\n prompt = prompts.get(i);\n\n displayPrompt(prompt);\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void onSuccess(String result) {\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tWindow.alert(\"Thank you for selecting\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}", "public void set(String msg) {\n \teingabeString = msg;\r\n JOptionPane.showMessageDialog(null, \"nashorn -> java: \" + msg);\r\n }", "@Override\r\n\t\tpublic Character getPromptSymbol() {\n\t\t\treturn null;\r\n\t\t}", "private void aplicarTextPrompt() {\n TextPrompt textPrompt = new TextPrompt(\"jdbc:mysql://localhost:3306/mydb\", urlJTF);\n TextPrompt textPrompt1 = new TextPrompt(\"root\", usernameJTF);\n TextPrompt textPrompt2 = new TextPrompt(\"*********\", passwordJPF);\n }", "@Override\n\tpublic String answer() {\n\t\treturn null;\n\t}", "public void setPrompt() {\n\t\tcommandLine.append(\"$ \");\n\t}", "String prompt(String message) throws IOException;", "@Override\r\n\t\tpublic boolean promptPassword(String message) {\n\t\t\treturn false;\r\n\t\t}", "public void OnOkClick()\r\n {\r\n\r\n }", "public abstract void newPromptType(long ms, PromptType type);", "public static void showPrompt() {\r\n \r\n System.out.print(\"> \");\r\n \r\n }", "private void basicInfoDialogPrompt() {\n if(!prefBool){\n BasicInfoDialog dialog = new BasicInfoDialog();\n dialog.show(getFragmentManager(), \"info_dialog_prompt\");\n }\n }", "public void promptSubmitReview() {\n ZenDialog.builder().withBodyText(C0880R.string.prompt_submit_review).withDualButton(C0880R.string.cancel, 0, C0880R.string.submit, DIALOG_REQ_SUBMIT).create().show(getFragmentManager(), (String) null);\n }", "private boolean promptCommand() {}", "public abstract String chooseAnswer();", "public void generalPrompt() {\n System.out.println(\"What would you like to do?\");\n }", "String promptString();", "@Override\n public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {\n new AlertDialog.Builder(UrlActivity.this)\n .setTitle(\"JsConfirm\")\n .setMessage(message)\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n result.confirm();\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n result.cancel();\n }\n })\n .setCancelable(false)\n .show();\n // 返回布尔值:判断点击时确认还是取消\n // true表示点击了确认;false表示点击了取消;\n return true;\n\n\n }", "@Nullable\r\n protected abstract Prompt acceptValidatedInput(@NotNull ConversationContext context, @NotNull String input);", "String prompt(String message, Color color) throws IOException;", "public PromptValue getValue()\n {\n return value;\n }", "public void printPrompt() {\r\n\t\tif (!promptVisible) {\r\n\t\t\tsetPromptVisible(true);\r\n\t\t}\r\n\t\tprompt(rPrompt);\r\n\t}", "public void clearPrompt()\n\t{\n\t\tpromptTarget = \"\";\n\t\tpromptType = \"\";\n\t\ttempPrompt = \"\";\n\t\tshowPrompt = true;\n\t}", "protected void dialog() {\n TextInputDialog textInput = new TextInputDialog(\"\");\n textInput.setTitle(\"Text Input Dialog\");\n textInput.getDialogPane().setContentText(\"Nyt bord nr: \");\n textInput.showAndWait()\n .ifPresent(response -> {\n if (!response.isEmpty()) {\n newOrderbutton(response.toUpperCase());\n }\n });\n }", "@Override\r\n public void confirmDialogPositive(int callbackFunctionID) {\n \r\n }", "private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }", "private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }", "private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }", "private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }", "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.showAndWait();\n \n\n}", "public HomePage() {\n this.tp7 = new TextPrompt( \"I'm Looking To Borrow...\", jTextField1);\n this.tp7.setShow(TextPrompt.Show.FOCUS_LOST);\n initComponents();\n }", "private void answerResultAlert(String feedback){\n AlertDialog.Builder showResult = new AlertDialog.Builder(this);\n\n showResult.setTitle(feedback);\n showResult.setMessage(currentQuestion.getExplanation());\n showResult.setCancelable(false); //if this is not set, the user may click outside the alert, cancelling it. no cheating this way\n showResult.setNeutralButton(\"ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n //only when the ok is clicked will continue to run the program\n setUpQuestions();\n }\n });\n showResult.create();\n showResult.show();\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n postTaskState(\"\", 13 + \"\");\n }", "private void promptSpeechInput() {\n Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,\n RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\n intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, \"us-US\");\n intent.putExtra(RecognizerIntent.EXTRA_PROMPT,\n getString(R.string.speech_prompt));\n try {\n startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);\n } catch (ActivityNotFoundException a) {\n Toast.makeText(getApplicationContext(),\n getString(R.string.speech_not_supported),\n Toast.LENGTH_SHORT).show();\n }\n }", "public String askOriginOrReturn();", "public void resultIsNull(){\n if(alertDialog.isShowing()){\n return;\n }\n if(inActive){\n return;\n }\n }", "@Nullable\n/* */ protected abstract Prompt acceptValidatedInput(@NotNull ConversationContext paramConversationContext, @NotNull Number paramNumber);", "public String getPromptRegex() {\r\n\t\treturn null;\r\n\t}", "public void alert(String message);", "@Override\r\npublic void afterAlertAccept(WebDriver arg0) {\n\t\r\n\tSystem.out.println(\"as\");\r\n}", "public static String inputBox(String promptMsg) {\n return JOptionPane.showInputDialog(promptMsg);\n }", "private void usernameTakenDialog() {\n Dialog dialog = new Dialog(\"Username taken\", cloudSkin, \"dialog\") {\n public void result(Object obj) {\n System.out.println(\"result \" + obj);\n }\n };\n dialog.text(\"This username has already been taken, try a new one.\");\n dialog.button(\"OK\", true);\n dialog.show(stage);\n }", "@FXML\n private void handleOk() {\n if (isInputValid()) {\n gem.setGemName(gemNameField.getText());\n gem.setGemValue(Integer.parseInt(gemValueField.getText()));\n gem.setDescription(gemDescripField.getText());\n\n okClicked = true;\n dialogStage.close();\n }\n }", "public PlaySourceInternal getPlayPrompt() {\n return this.playPrompt;\n }", "public boolean shouldPaintPrompt(JTextComponent txt)\n/* */ {\n/* 295 */ return (txt.getText() == null) || (txt.getText().length() == 0);\n/* */ }", "private static void showPrompt(Activity activity, PermissionHandler permissionHandler,\n String permission, int requestCode, boolean isDeniedPermanently) {\n AlertDialog alertDialog = new AlertDialog.Builder(activity).create();\n alertDialog.setMessage(activity.getString(R.string.permissionPromptMsg));\n alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, activity.getString(R.string.denyBtnText),\n (dialogInterface, i) -> alertDialog.dismiss());\n alertDialog.setButton(AlertDialog.BUTTON_POSITIVE,\n isDeniedPermanently ? activity.getString(R.string.settingsBtnTxt)\n : activity.getString(R.string.allowBtnTxt),\n (dialog, which) -> {\n if (isDeniedPermanently) {\n Intent intent = new Intent();\n intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n Uri uri = Uri.fromParts(\"package\", activity.getPackageName(), null);\n intent.setData(uri);\n activity.startActivity(intent);\n } else {\n permissionHandler.firstTimeAsking(permission, false);\n ActivityCompat.requestPermissions(activity, new String[]{permission},\n requestCode);\n }\n\n });\n alertDialog.show();\n }", "@Override\r\n\tpublic void afterAlertAccept(WebDriver arg0) {\n\t\t\r\n\t}", "boolean hasInitialPromptFulfillment();", "void showAddParameterDialog();", "@Override\n public void askQuestion(final EJQuestion question)\n {\n final EJQuestionButton[] optionsButtons = getOptions(question);\n String[] options = new String[optionsButtons.length];\n for (int i = 0; i < optionsButtons.length; i++)\n {\n options[i] = question.getButtonText(optionsButtons[i]);\n }\n MessageDialog dialog = new MessageDialog(manager.getShell(), question.getTitle(), null, question.getMessageText(), MessageDialog.QUESTION, options, 2)\n {\n\n @Override\n public boolean close()\n {\n boolean close = super.close();\n\n int answer = getReturnCode();\n\n try\n {\n \n if (answer > -1)\n {\n question.setAnswer(optionsButtons[answer]);\n question.getActionProcessor().questionAnswered(question);\n \n }\n \n }\n catch (EJApplicationException e)\n {\n handleException(e);\n }\n\n return close;\n }\n\n };\n dialog.setBlockOnOpen(false);\n\n dialog.open();\n }", "public void setPromptSymbol(Character symbol);", "@Override\n\tpublic void handleJs(JavaScriptObject message) {\n\t\t\n\t}", "public String printNewEmailPrompt() {\n return \"Please enter new email: \";\n }", "@Override\n\tpublic void askReset() {\n\t}", "void okButtonClicked();" ]
[ "0.70921147", "0.65109074", "0.6470889", "0.63873833", "0.6370502", "0.6368333", "0.63443", "0.6332751", "0.626014", "0.6257403", "0.6223207", "0.6152803", "0.6114776", "0.6067822", "0.60319644", "0.6030865", "0.60238075", "0.5950126", "0.59331363", "0.5929675", "0.58919823", "0.58560276", "0.5791728", "0.5780003", "0.57775944", "0.57717663", "0.5767506", "0.5767453", "0.5743181", "0.573183", "0.5728633", "0.56960255", "0.5647396", "0.56091356", "0.55971026", "0.5594754", "0.5587526", "0.5577513", "0.5564797", "0.5557535", "0.55525506", "0.55485195", "0.5538609", "0.55345327", "0.55288696", "0.55283743", "0.55136937", "0.5504539", "0.55007434", "0.548511", "0.5482262", "0.54798067", "0.5469274", "0.54623777", "0.54320484", "0.5424802", "0.5418688", "0.5411336", "0.5410019", "0.5404313", "0.54022425", "0.5396569", "0.5383254", "0.537896", "0.5373769", "0.53645164", "0.53634185", "0.5342329", "0.5339664", "0.5339401", "0.5320535", "0.5320535", "0.5320535", "0.5320535", "0.5304253", "0.5299213", "0.5287474", "0.52854806", "0.52852225", "0.5284341", "0.52792525", "0.5271417", "0.5261478", "0.52537894", "0.52528447", "0.5239305", "0.5236374", "0.52361727", "0.5228735", "0.5224931", "0.5216675", "0.52071905", "0.52054083", "0.52027196", "0.5197754", "0.5195369", "0.5194085", "0.51884747", "0.5188243", "0.5186255" ]
0.76263815
0
Creates a WordNet using files form SYNSETFILENAME and HYPONYMFILENAME
public WordNet(String synsetFilename, String hyponymFilename) { synsets = new TreeMap<Integer, TreeSet<String>>(); numVertices = 0; In syns = new In(synsetFilename); while (syns.hasNextLine()) { numVertices++; String line = syns.readLine(); String[] split1 = line.split(","); String[] split2 = split1[1].split(" "); TreeSet<String> hs = new TreeSet<String>(); for (String s: split2) { hs.add(s); } synsets.put(Integer.parseInt(split1[0]), hs); } dg = new Digraph(numVertices); In hyms = new In(hyponymFilename); while (hyms.hasNextLine()) { String line = hyms.readLine(); String[] split = line.split("[, ]+"); int v = Integer.parseInt(split[0]); for (int i = 1; i < split.length; i++) { dg.addEdge(v, Integer.parseInt(split[i])); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsets = new In(synsetFilename);\n In hyponyms = new In(hyponymFilename);\n int count = 0;\n while (synsets.hasNextLine()) {\n String line = synsets.readLine();\n String[] linesplit = line.split(\",\");\n String[] wordsplit = linesplit[1].split(\" \");\n Set<String> synset = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n for (int i = 0; i < wordsplit.length; i += 1) {\n synset.add(wordsplit[i]);\n if (wnetsi.containsKey(wordsplit[i])) {\n wordIndexes = wnetsi.get(wordsplit[i]);\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n } else {\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n }\n }\n wnetis.put(Integer.parseInt(linesplit[0]), synset);\n count += 1;\n }\n \n \n \n String[] allVerts = hyponyms.readAllLines();\n g = new Digraph(count);\n for (int i = 0; i < allVerts.length; i += 1) {\n String[] linesplit = allVerts[i].split(\",\");\n for (int j = 0; j < linesplit.length; j += 1) {\n g.addEdge(Integer.parseInt(linesplit[0]), Integer.parseInt(linesplit[j]));\n }\n }\n \n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsetScanner = new In(synsetFilename);\n\n synsetNouns = new HashMap<Integer, ArrayList<String>>();\n nouns = new HashSet<String>();\n\n while (synsetScanner.hasNextLine()) {\n ArrayList<String> synsetArrayList = new ArrayList<String>();\n String row = synsetScanner.readLine();\n String[] tokens = row.split(\",\");\n String[] synset = tokens[1].split(\" \");\n for (int i = 0; i < synset.length; i++) {\n synsetArrayList.add(synset[i]);\n nouns.add(synset[i]);\n }\n synsetNouns.put(Integer.parseInt(tokens[0]), synsetArrayList);\n }\n\n In hyponymScanner = new In(hyponymFilename);\n hyponym = new Digraph(synsetNouns.size());\n while (hyponymScanner.hasNextLine()) {\n String row = hyponymScanner.readLine();\n String[] tokens = row.split(\",\");\n for (int i = 1; i < tokens.length; i++) {\n hyponym.addEdge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[i]));\n }\n }\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n File hyponymPath = new File(hyponymFilename);\n Scanner s;\n try {\n s = new Scanner(hyponymPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n hyponymParse(currLine);\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + hyponymFilename);\n } \n File synsetPath = new File(synsetFilename);\n try {\n s = new Scanner(synsetPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n synsetParse(currLine);\n numberOfSynsets += 1;\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + synsetFilename);\n } \n g = new Digraph(numberOfSynsets);\n Set<Integer> keys = hyponymMap.keySet();\n for (Integer k : keys) {\n ArrayList<Integer> al = hyponymMap.get(k);\n for (Integer i : al) {\n g.addEdge(k, i);\n }\n }\n }", "public static void main(String[] args){\n In fileSynset = new In(args[0]);\n In fileHypernyms = new In(args[1]);\n String Hypernyms = fileHypernyms.readAll();\n String Synset = fileSynset.readAll();\n WordNet Net = new WordNet(Synset, Hypernyms);\n }", "public WordNet(String synsets, String hypernyms) {\n synsetStream = new In(synsets);\n hypernymStream = new In(hypernyms);\n\n // go through all synsets\n while (synsetStream != null && synsetStream.hasNextLine()) {\n synsetString = synsetStream.readLine();\n String[] synsetStrLine = synsetString.split(\",\");\n Integer id = Integer.parseInt(synsetStrLine[0]);\n String[] synsetsArray = synsetStrLine[1].split(\"\\\\s+\");\n sFile.put(id, synsetsArray);\n }\n for (String[] nounSet : sFile.values()) {\n for (String str : nounSet) {\n sNounSet.add(str);\n }\n }\n while (hypernymStream != null && hypernymStream.hasNextLine()) {\n hypernymString = hypernymStream.readLine();\n String[] hyponymArray = hypernymString.split(\",\");\n Integer synsetID = Integer.parseInt(hyponymArray[0]);\n TreeSet hyponymSet = new TreeSet();\n for (int i = 1; i < hyponymArray.length; i++) {\n Integer hyponymID = Integer.parseInt(hyponymArray[i]);\n if (hFile.containsKey(synsetID)) {\n hFile.get(synsetID).add(hyponymID);\n } else {\n hyponymSet.add(hyponymID);\n hFile.put(synsetID, hyponymSet);\n }\n }\n\n }\n theDigraph = new Digraph(sFile.size());\n for (Integer key : hFile.keySet()) {\n for (Object curr : hFile.get(key)) {\n theDigraph.addEdge(key, (int) curr);\n }\n }\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n synset = new HashMap<Integer, ArrayList<String>>();\n synsetRev = new HashMap<ArrayList<String>, Integer>();\n hyponym = new ArrayList<ArrayList<Integer>>();\n // hyponym = new HashMap<Integer,ArrayList<Integer>>();\n\n In syn = new In(synsetFilename);\n In hypo = new In(hyponymFilename);\n\n while (!syn.isEmpty()) {\n String line = syn.readLine();\n String[] split1 = line.split(\",\");\n int stempkey = Integer.parseInt(split1[0]);\n String syns = split1[1];\n String[] temps = syns.split(\" \");\n ArrayList<String> stempval = new ArrayList<String>();\n for (String s : temps) {\n stempval.add(s);\n }\n synset.put(stempkey, stempval);\n synsetRev.put(stempval, stempkey);\n }\n\n while (!hypo.isEmpty()) {\n String line = hypo.readLine();\n String[] arrayOfStrings = line.split(\",\");\n ArrayList<Integer> integersAL = new ArrayList<Integer>();\n for (int i = 0; i < arrayOfStrings.length; i++) {\n integersAL.add(Integer.parseInt(arrayOfStrings[i]));\n }\n hyponym.add(integersAL);\n\n // ArrayList<Integer> valuesAL = new ArrayList<Integer>();\n // for (Integer i : integersAL) {\n // valuesAL.add(i);\n // }\n // int comma1 = line.indexOf(\",\");\n // int htempkey = Integer.parseInt(line.substring(0,comma1));\n // String sub = line.substring(comma1 + 1);\n // String[] arrayOfStrings = sub.split(\",\");\n // hyponym.put(htempkey, integersAL);\n }\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) {\n throw new IllegalArgumentException(\"synsets and hypernyms can't be empty\");\n }\n int lineCount = 0;\n In inputFile = new In(synsets);\n while (inputFile.hasNextLine()) {\n String aLine = inputFile.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n String[] nounSyn = splitArr[1].split(\" \");\n nouns.put(synID, nounSyn);\n for (String word : nounSyn) {\n LinkedList<Integer> nounList = synsetList.get(word);\n if (nounList == null) {\n nounList = new LinkedList<Integer>();\n }\n nounList.add(synID);\n synsetList.put(word, nounList);\n\n }\n lineCount += 1;\n\n }\n inputFile.close();\n aDigraph = new Digraph(lineCount);\n In hyperInput = new In(hypernyms);\n while (hyperInput.hasNextLine()) {\n String aLine = hyperInput.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n for (int i = 1; i < splitArr.length; i++) {\n aDigraph.addEdge(synID, Integer.parseInt(splitArr[i]));\n }\n }\n hyperInput.close();\n shortestCA = new ShortestCommonAncestor(aDigraph);\n\n\n }", "public WordNet(String synsets, String hypernyms) throws IOException {\n\n this.synsetsMap = new HashMap<Integer, ArrayList<String>>();\n this.nounsMap = new HashMap<String, ArrayList<Integer>>();\n this.edgesMap = new HashMap<Integer, ArrayList<Integer>>();\n int graphNodes = 0; \n \n // Process synsets.txt\n BufferedReader br = new BufferedReader(new FileReader(synsets));\n String line;\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int synsetID = Integer.parseInt(items[0]);\n String[] nouns = items[1].split(\" \");\n \n for (String noun : nouns) {\n if (!nounsMap.containsKey(noun)) {\n nounsMap.put(noun, new ArrayList<Integer>());\n }\n nounsMap.get(noun).add(synsetID);\n }\n \n if (!synsetsMap.containsKey(synsetID)) {\n synsetsMap.put(synsetID, new ArrayList<String>());\n }\n \n for (String noun : nouns) {\n synsetsMap.get(synsetID).add(noun);\n }\n graphNodes++; \n }\n br.close();\n\n // Process hypernyms.txt\n br = new BufferedReader(new FileReader(hypernyms));\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int hypernymID = Integer.parseInt(items[0]);\n \n if (!edgesMap.containsKey(hypernymID)) {\n edgesMap.put(hypernymID, new ArrayList<Integer>());\n }\n \n for (int i = 1; i < items.length; i++) {\n edgesMap.get(hypernymID).add(Integer.parseInt(items[i]));\n }\n }\n br.close();\n \n // Construct Graph\n this.G = new Digraph(graphNodes);\n for (Map.Entry<Integer, ArrayList<Integer>> entry : edgesMap.entrySet()) {\n for (int edge : entry.getValue()) {\n this.G.addEdge(entry.getKey(), edge);\n }\n }\n \n // Check if there's a cycle\n DirectedCycle cycle = new DirectedCycle(this.G);\n if (cycle.hasCycle()) {\n throw new java.lang.IllegalArgumentException();\n }\n \n // Construct SAP \n this.sap = new SAP(this.G);\n }", "public WordNet(String synsetsFile, String hypernymsFile){\n if(synsetsFile == null || hypernymsFile == null){\n throw new IllegalArgumentException();\n }\n this.nounToIdMap = new HashMap<String, ArrayList<Integer>>();\n this.IdToNounMap = new HashMap<Integer, ArrayList<String>>();\n this.IdToSynsetMap = new HashMap<Integer, String>();\n this.numberOfSynsets = 0;\n processSynsetFile(synsetsFile);\n this.wordNetDigraph = new Digraph(this.numberOfSynsets);\n \n In hypernymsIn = new In(hypernymsFile);\n while(hypernymsIn.hasNextLine()){\n String line = hypernymsIn.readLine();\n String[] list = line.split(\",\");\n int synsetId = Integer.parseInt(list[0]);\n for(int i=1; i<list.length; i++){\n int hypernym = Integer.parseInt(list[i]);\n this.wordNetDigraph.addEdge(synsetId, hypernym);\n }\n }\n checkIfRootedDigraph();\n }", "public WordNet(String synsets, String hypernyms)\n {\n if (synsets==null || hypernyms==null) throw new IllegalArgumentException();\n h=new TreeMap<>();\n In i1=new In(synsets);\n int i=0;\n h2=new ArrayList<>();\n while(!i1.isEmpty())\n {\n String[] temp=i1.readLine().split(\",\");\n String[] temp2=temp[1].trim().split(\"\\\\s+\");\n String t=\"\";\n for (String s:temp2)\n {\n if (h.containsKey(s))\n {\n h.get(s).add(i);\n }\n else\n {\n ArrayList<Integer> a=new ArrayList<>();\n a.add(i);\n h.put(s,a);\n }\n\n t=t+s+\" \";\n }\n h2.add(t);\n i++;\n }\n\n g=new Digraph(i);\n In i2=new In(hypernyms);\n while (!i2.isEmpty())\n {\n String[] temp=i2.readLine().split(\",\");\n int j=Integer.parseInt(temp[0].trim());\n for (int k=1;k<temp.length;k++)\n g.addEdge(j, Integer.parseInt(temp[k].trim()));\n }\n\n sap=new SAP(g);\n\n //All the below lines check for Illegal Arguments\n DirectedCycle obj=new DirectedCycle(g);\n boolean b=obj.hasCycle();\n if (b) throw new IllegalArgumentException();\n\n int numberOfRoots=0;\n for (int j=0;j<g.V() && numberOfRoots < 2;j++)\n if (g.outdegree(j)==0) numberOfRoots++;\n\n //System.out.println(\"The number of roots is \"+numberOfRoots);\n if (numberOfRoots!=1) throw new IllegalArgumentException();\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) throw new IllegalArgumentException();\n In synsetsFile = new In(synsets);\n synsetsNumToStr = new HashMap<>();\n synsetsStrToNum = new HashMap<>();\n while (!synsetsFile.isEmpty()) {\n String read = synsetsFile.readLine();\n String[] item = read.split(\",\");\n int id = Integer.parseInt(item[0]);\n String[] str = item[1].split(\" \");\n Queue<String> strStack = new Queue<>();\n for (String ss : str) {\n strStack.enqueue(ss);\n Queue<Integer> si;\n if (!synsetsStrToNum.containsKey(ss)) {\n si = new Queue<>();\n si.enqueue(id);\n synsetsStrToNum.put(ss, si);\n }\n else synsetsStrToNum.get(ss).enqueue(id);\n }\n synsetsNumToStr.put(id, strStack);\n }\n In hypernymsFile = new In(hypernyms);\n Digraph wnDigraph = new Digraph(synsetsNumToStr.size());\n while (!hypernymsFile.isEmpty()) {\n String[] hypID = hypernymsFile.readLine().split(\",\");\n int rootID = Integer.parseInt(hypID[0]);\n for (int i = 1; i < hypID.length; i++)\n wnDigraph.addEdge(rootID, Integer.parseInt(hypID[i]));\n }\n Stack<Integer> root = new Stack<>();\n for (int v = 0; v < wnDigraph.V(); v++)\n if (wnDigraph.outdegree(v) == 0) {\n root.push(v);\n }\n if (root.size() > 1) throw new IllegalArgumentException(\"More than 1 roots in DAG\");\n DirectedCycle dcGraph = new DirectedCycle(wnDigraph);\n if (dcGraph.hasCycle()) throw new IllegalArgumentException(\"Cycles detected in the graph\");\n wnSAP = new SAP(wnDigraph);\n }", "public WordNet(String synsets, String hypernyms)\n {\n In text = new In(synsets);\n synsetList = new ArrayList<String>();\n synsetHash = new HashMap<String, ArrayList<Integer>>();\n // parse words into array synsetList\n synsetNum = 0;\n while (!text.isEmpty())\n {\n String temp = text.readLine().split(\",\")[1];\n synsetList.add(temp);\n synsetNum++;\n }\n //initialize synsetHash with word:list of integers\n for (int i = 0; i < synsetNum; i++)\n {\n String[] stringArray = synsetList.get(i).split(\" \");\n for (String s : stringArray)\n {\n if (synsetHash.containsKey(s))\n {\n ArrayList<Integer> temp = synsetHash.get(s);\n temp.add(i);\n }\n else\n {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(i);\n synsetHash.put(s, temp);\n }\n }\n }\n\n wordGraph = new Digraph(synsetNum);\n text = new In(hypernyms);\n while (!text.isEmpty())\n {\n String[] edges = text.readLine().split(\",\");\n int mainEdge = Integer.parseInt(edges[0]);\n for (int i = 1; i < edges.length; i++)\n {\n wordGraph.addEdge(mainEdge, Integer.parseInt(edges[i]));\n }\n }\n // check if input is a rooted DAG\n int count = 0;\n for (int v = 0; v < synsetNum; v++)\n {\n if (wordGraph.outdegree(v) == 0) count++;\n if (count > 1) throw new IllegalArgumentException();\n }\n // may be redundant check, but wanna make sure\n if (count != 1) throw new IllegalArgumentException();\n\n DirectedCycle cycle = new DirectedCycle(wordGraph);\n if (cycle.hasCycle()) throw new IllegalArgumentException();\n\n shortestPath = new SAP(wordGraph);\n \n }", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "public WordNet(String synsets, String hypernyms) {\n\n\t\tString[] vw;\n\t\tInteger synset = 0;\n\n\t\t// step1: build noun TreeSet\n\t\tIn br = new In(synsets);\n\t\tif (!br.hasNextLine())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tdo {\n\t\t\tString line = br.readLine();\n\t\t\tsize++;\n\t\t\tvw = line.split(\",\");\n\t\t\tsynset = new Integer(vw[0]);\n\t\t\t// save the set\n\t\t\tsets.put(Integer.parseInt(vw[0]), vw[1]);\n\t\t\t// save the nouns\n\t\t\tvw = vw[1].split(\" \");\n\t\t\n\t\t\tfor (String noun: vw) {\n\t\t\t\tif (nouns.containsKey(noun))\n\t\t\t\t\tnouns.get(noun).add(synset);\n\t\t\t\telse {\n\t\t\t\t\tArrayList<Integer> al = new ArrayList<Integer>();\n\t\t\t\t\tal.add(synset);\n\t\t\t\t\tnouns.put(noun, al);\n\t\t\t\t}\n\t\t\t}\n\t\t} while (br.hasNextLine());\n\t\tbr.close();\n\n\t\t// step2: build graph\n\t\tbr = new In(hypernyms);\n\t\tDigraph dg = new Digraph(size);\n\t\tdo {\n\t\t\tString line = br.readLine();\n\t\t\tvw = line.split(\",\");\n\t\t\tfor (int i = 1; i < vw.length; i++)\n\t\t\t\tdg.addEdge(Integer.parseInt(vw[0].trim()),\n\t\t\t\t\t\tInteger.parseInt(vw[i].trim()));\n\n\t\t}while (br.hasNextLine());\n\t\t\t\n\t\tbr.close();\n\t\tDirectedCycle dc = new DirectedCycle(dg);\n\t\tif (dc.hasCycle())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tcheck(dg);\n\t\tsap = new SAP(dg);\n\n\t}", "public WordNet(String synsets, String hypernyms) {\n\t\tif (synsets == null || hypernyms == null)\n\t\t\tthrow new IllegalArgumentException();\n\t\t\n\t\tidToNouns = new HashMap<Integer, String>();\n\t\tnounToId = new HashMap<String, ArrayList<Integer>>();\n\n\t\tIn in1 = new In(synsets);\n\t\tIn in2 = new In(hypernyms);\n\n\t\twhile (in1.hasNextLine()) {\n\t\t\tString line = in1.readLine();\n\t\t\tString[] parts = line.split(\",\");\n\t\t\tint id = Integer.parseInt(parts[0]);\n\t\t\tidToNouns.put(id, parts[1]);\n\n\t\t\tString[] nouns = parts[1].split(\" \");\n\t\t\tfor (String s : nouns) {\n\t\t\t\tif (nounToId.containsKey(s))\n\t\t\t\t\tnounToId.get(s).add(id);\n\t\t\t\telse {\n\t\t\t\t\tnounToId.put(s, new ArrayList<Integer>());\n\t\t\t\t\tnounToId.get(s).add(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tgraph = new Digraph(idToNouns.size());\n\n\t\twhile (in2.hasNextLine()) {\n\t\t\tString line = in2.readLine();\n\t\t\tString[] parts = line.split(\",\");\n\t\t\tfor (int i = 1; i < parts.length; i++) {\n\t\t\t\tgraph.addEdge(Integer.parseInt(parts[0]), Integer.parseInt(parts[i]));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!isRootedDAG(graph))\n\t\t\tthrow new IllegalArgumentException(); \n\t\t\n\t\tsap = new SAP(graph);\n\t}", "public WordNet(String synsets, String hypernyms) {\n boolean RootedDAG = false;\n String[] sets = synsets.split(\"\\n\");\n SynSets= new String[sets.length][2];\n Wordnet = new Digraph(sets.length);\n for (int i =0; i< sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n SynSets[i][0] = Delimiter[1];\n SynSets[i][1] = Delimiter[2];\n }\n sets = hypernyms.split(\"\\n\");\n for(int i = 0; i < sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n int Above = Integer.parseInt(Delimiter[0]);\n if(Delimiter.length==1) {\n if(!RootedDAG) RootedDAG = true;\n else throw new IllegalArgumentException();\n }\n for(int j = 1; j< Delimiter.length; j++){\n Wordnet.addEdge(Above, Integer.parseInt(Delimiter[j]));\n }\n }\n //if(!RootedDAG) throw new IllegalArgumentException();\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) {\n throw new IllegalArgumentException();\n }\n\n In in = new In(synsets);\n int vcnt = 0;\n while (in.hasNextLine()) {\n vcnt++;\n String line = in.readLine();\n String[] splited = line.split(\",\");\n int num = Integer.parseInt(splited[0]);\n String synset = splited[1];\n synMap.put(num, synset);\n String[] nouns = synset.split(\" \");\n for (String noun : nouns) {\n nounMap.computeIfAbsent(noun, k -> new Bag<>()).add(num);\n }\n }\n in.close();\n\n in = new In(hypernyms);\n Digraph digraph = new Digraph(vcnt);\n while (in.hasNextLine()) {\n String line = in.readLine();\n String[] splited = line.split(\",\");\n int child = Integer.parseInt(splited[0]);\n for (int i = 1; i < splited.length; i++) {\n digraph.addEdge(child, Integer.parseInt(splited[i]));\n }\n }\n in.close();\n\n DirectedCycle cycle = new DirectedCycle(digraph);\n if (cycle.hasCycle()) {\n throw new IllegalArgumentException();\n }\n DepthFirstOrder dfo = new DepthFirstOrder(digraph);\n int root = dfo.post().iterator().next();\n if (digraph.outdegree(root) != 0) {\n throw new IllegalArgumentException();\n }\n\n Digraph reversed = digraph.reverse();\n DepthFirstDirectedPaths dfs = new DepthFirstDirectedPaths(reversed, root);\n for (int i = 0; i < reversed.V(); i++) {\n if (!dfs.hasPathTo(i)) {\n throw new IllegalArgumentException();\n }\n }\n\n this.sap = new SAP(digraph);\n }", "public static void initializeToolsAndResourcesForDemo(IDictionary dict) throws MalformedURLException, IOException {\n wordnet_dict = dict;\n wordnet_dict.open();\n\n // Choose wordnet sources to be used\n wordnetResources.add(\"synonyms\");\n //wordnetResources.add(\"antonyms\");\n //wordnetResources.add(\"hypernyms\");\n\n Properties split_props = new Properties();\n //Properties including lemmatization\n //props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n //Properties without lemmatization\n split_props.put(\"annotators\", \"tokenize, ssplit, pos\");\n split_props.put(\"tokenize.language\", \"en\");\n split_pipeline = new StanfordCoreNLP(split_props);\n\n Properties lemma_props = new Properties();\n lemma_props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n lemma_props.put(\"tokenize.language\", \"en\");\n lemma_pipeline = new StanfordCoreNLP(lemma_props);\n\n Properties entityMentions_props = new Properties();\n entityMentions_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, lemma, ner, entitymentions\");\n entityMentions_props.put(\"tokenize.language\", \"en\");\n entityMentions_props.put(\"truecase.overwriteText\", \"true\");\n entityMentions_pipeline = new StanfordCoreNLP(entityMentions_props);\n\n Properties compound_props = new Properties();\n compound_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, parse\");\n compound_props.put(\"tokenize.language\", \"en\");\n compound_props.put(\"truecase.overwriteText\", \"true\");\n compounds_pipeline = new StanfordCoreNLP(compound_props);\n\n spotlight = new Spotlight();\n\n chanel = new LODSyndesisChanel();\n\n }", "public static void initializeToolsAndResources(String wordnetPath) throws MalformedURLException, IOException {\n\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.INFO, \"...Generating stop-words lists...\");\n StringUtils.generateStopListsFromExternalSource(filePath_en, filePath_gr);\n\n Properties split_props = new Properties();\n //Properties without lemmatization\n split_props.put(\"annotators\", \"tokenize, ssplit, pos\");\n split_props.put(\"tokenize.language\", \"en\");\n split_pipeline = new StanfordCoreNLP(split_props);\n\n Properties lemma_props = new Properties();\n lemma_props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n lemma_props.put(\"tokenize.language\", \"en\");\n lemma_pipeline = new StanfordCoreNLP(lemma_props);\n\n Properties entityMentions_props = new Properties();\n entityMentions_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, lemma, ner, entitymentions\");\n entityMentions_props.put(\"tokenize.language\", \"en\");\n entityMentions_props.put(\"truecase.overwriteText\", \"true\");\n entityMentions_pipeline = new StanfordCoreNLP(entityMentions_props);\n\n Properties compound_props = new Properties();\n compound_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, parse\");\n compound_props.put(\"tokenize.language\", \"en\");\n compound_props.put(\"truecase.overwriteText\", \"true\");\n compounds_pipeline = new StanfordCoreNLP(compound_props);\n\n spotlight = new Spotlight();\n\n chanel = new LODSyndesisChanel();\n\n }", "private void initOntology() {\n\n\tontology = ModelFactory.createDefaultModel();\n\t\t\t\n\ttry \n\t{\n\t\t//ontology.read(new FileInputStream(\"ontology.ttl\"),null,\"TTL\");\n\t\tontology.read(new FileInputStream(\"Aminer-data.ttl\"),null,\"TTL\");\n\t\t//ontology.read(new FileInputStream(\"SO data.ttl\"),null,\"TTL\");\n\t} \n\tcatch (FileNotFoundException e) \n\t{\n\t\tSystem.out.println(\"Error creating ontology model\" +e.getMessage());\n\t\te.printStackTrace();\n\t}\n\t\t\t\n\t\t\n\t}", "public static void main(final String[] args)\r\n {\r\n // Set the path to the data files\r\n Dictionary.initialize(\"c:/Program Files/WordNet/2.1/dict\");\r\n \r\n // Get an instance of the Dictionary object\r\n Dictionary dict = Dictionary.getInstance();\r\n \r\n // Declare a filter for all terms starting with \"car\", ignoring case\r\n TermFilter filter = new WildcardFilter(\"car*\", true);\r\n \r\n // Get an iterator to the list of nouns\r\n Iterator<IndexTerm> iter = \r\n dict.getIndexTermIterator(PartOfSpeech.NOUN, 1, filter);\r\n \r\n // Go over the list items\r\n while (iter.hasNext())\r\n {\r\n // Get the next object\r\n IndexTerm term = iter.next();\r\n \r\n // Write out the object\r\n System.out.println(term.toString());\r\n \r\n // Write out the unique pointers for this term\r\n int nNumPtrs = term.getPointerCount();\r\n if (nNumPtrs > 0)\r\n {\r\n // Print out the number of pointers\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumPtrs) +\r\n \" pointers\");\r\n \r\n // Print out all of the pointers\r\n String[] ptrs = term.getPointers();\r\n for (int i = 0; i < nNumPtrs; ++i)\r\n {\r\n String p = Pointer.getPointerDescription(term.getPartOfSpeech(), ptrs[i]);\r\n System.out.println(ptrs[i] + \": \" + p);\r\n }\r\n }\r\n \r\n // Get the definitions for this term\r\n int nNumSynsets = term.getSynsetCount();\r\n if (nNumSynsets > 0)\r\n {\r\n // Print out the number of synsets\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumSynsets) +\r\n \" synsets\");\r\n \r\n // Print out all of the synsets\r\n Synset[] synsets = term.getSynsets();\r\n for (int i = 0; i < nNumSynsets; ++i)\r\n {\r\n System.out.println(synsets[i].toString());\r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Demo processing finished.\");\r\n }", "private void createDocWords() {\n\t\tArrayList<DocWords> docList=new ArrayList<>();\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\docWords.txt\"));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tString parts[] = line.split(\" \");\n\t\t\t\tDocWords docWords=new DocWords();\n\t\t\t\tdocWords.setDocName(parts[0].replace(\".txt\", \"\"));\n\t\t\t\tdocWords.setCount(Float.parseFloat(parts[1]));\n\t\t\t\tdocList.add(docWords);\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDBUtil.insertDocWords(docList);\n\t}", "private WordNet() {\n }", "public static void main(String[] args) {\n\n System.out.println(\"\\n... MakeNetworks Arguments :<rootFileName> \"\n +\":<inputDirectory>+ :<outputDirectory> +:<extractGCC>\"\n + \":<year> :<weightType> :<useWhat> :<infoLevel>\");\n System.out.println(\"Fieldname types are:- Bus for Business and International Management\");\n System.out.println(\" - Phy for Physics & astronomy\");\n for (int i=0; i<weightTypeDescription.length; i++) {\n System.out.println(\"... weightType \"+i+\" = \"+weightTypeDescription[i]);\n } \n System.out.println(\"... useWhat: 1,3= use title, 2,3=use keywords\");\n for(int a=0; a<args.length; a++) {\n System.out.print((a==0?\"... Arguments: \":\" \")+args[a]);\n }\n System.out.println();\n \n HashSet<Integer> yearSet = new HashSet();\n HashSet<String> fieldnameSet = new HashSet();\n HashSet<Integer> weightTypeSet = new HashSet();\n HashSet<Integer> useWhatSet = new HashSet();\n \n \n int ano=0;\n //String rootFileName = \"ebrp_03_set_01_documentsTEST\";\n //String rootFileName = \"ebrp_03_set_01_documentsHARDTEST\";\n String rootFileName = \"ebrp_03_set_01_documents\";\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) {\n rootFileName=args[ano].substring(1);\n }\n System.out.println(\"--- Root of file name is \"+rootFileName);\n \n final String fileSep=System.getProperty(\"file.separator\");\n String dirBase=System.getProperty(\"user.dir\")+fileSep;\n \n //String inputDirectory =\"C:\\\\PRG\\\\JAVA\\\\Elsevier\\\\input\\\\\";\n String inputDirectory =\"C:\\\\DATA\\\\Elsevier\\\\input\\\\\";\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) inputDirectory=args[ano].substring(1); \n System.out.println(\"--- Input directory is \"+inputDirectory);\n \n String outputDirectory =\"C:\\\\DATA\\\\Elsevier\\\\output\\\\\";\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) outputDirectory=args[ano].substring(1); \n System.out.println(\"--- Output directory is \"+outputDirectory);\n \n \n boolean extractGCC=true;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) extractGCC=(StringAsBoolean.isTrue(args[ano].charAt(1))?true:false); \n System.out.println(\"--- extracting GCC - \"+(extractGCC?\"yes\":\"no\"));\n \n int minDegreeIn=3;\n int minDegreeOut=3;\n double minWeight=0;\n System.out.println(\"--- extracting simplified GCC with min in degree - \"\n +minDegreeIn+\", min out degree - \"+minDegreeOut+\", and min weight \"+minWeight);\n \n // set up filter\n int minChar=2;\n int minL=3;\n boolean keepRejectList=true;\n ElsevierPapersFilter ipf = new ElsevierPapersFilter(minChar, minL, keepRejectList);\n \n \n if (rootFileName.equalsIgnoreCase(\"ALL\")){\n //rootFileName = \"ebrp_03_set_01_documentsHARDTEST\"; \n rootFileName = \"ebrp_03_set_01_documents\";\n yearSet.add(2002);\n yearSet.add(2006);\n yearSet.add(2010);\n fieldnameSet.add(\"Bus\"); //Business and International Management\n fieldnameSet.add(\"Phy\"); //Physics & astronomy\n weightTypeSet.add(0);\n weightTypeSet.add(1);\n useWhatSet.add(1);\n useWhatSet.add(2);\n useWhatSet.add(3);\n int infoLevelAll=-1;\n process(rootFileName, inputDirectory, outputDirectory,\n yearSet, fieldnameSet,\n weightTypeSet,\n useWhatSet,\n ipf,\n extractGCC,\n minDegreeIn, minDegreeOut, minWeight,\n infoLevelAll);\n System.exit(0);\n }\n System.out.println(\"--- file name root \"+rootFileName);\n\n int year = 2002;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) year=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n System.out.println(\"--- Year used \"+year);\n yearSet.add(year);\n\n // Bus= Business and International Management\n // Phy= Physics & astronomy\n String fieldname = \"Phy\"; \n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) fieldname=args[ano].substring(1, args[ano].length()); System.out.println(\"--- fieldname used \"+fieldname);\n fieldnameSet.add(fieldname);\n\n // 1 = total weight one for each paper, terms have equal weight, P1 in file name\n int weightType=1;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) weightType=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n if ((weightType<0) || (weightType>=weightTypeShort.length)) throw new RuntimeException(\"illegal weightType of \"+weightType+\", must be between 0 and \"+(weightTypeShort.length-1)+\" inclusive\");\n System.out.println(\"--- Weight Type \"+weightType+\" = \"+weightTypeDescription[weightType]);\n weightTypeSet.add(weightType);\n \n\n // 1,3= use title, 2,3=use keywords\n int useWhat=1;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) useWhat=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n boolean useTitle=((useWhat&1)>0);\n boolean useKeywords=((useWhat&2)>0);\n System.out.println(\"--- \"+(useTitle?\"U\":\"Not u\")+\"sing titles\");\n System.out.println(\"--- \"+(useKeywords?\"U\":\"Not u\")+\"sing keywords\");\n useWhatSet.add(useWhat);\n\n // 0 for normal, 1 for some, 2 for all debugging info, -1 for minimal\n int infoLevel=0;\n ano++;\n if ( (args.length>ano ) && (timgraph.isOtherArgument(args[ano]) )) infoLevel=Integer.parseInt(args[ano].substring(1, args[ano].length())); \n System.out.println(\"--- infoLevel=\"+infoLevel);\n boolean infoOn=(infoLevel>1);\n\n// if (args.length>ano ) if (timgraph.isOtherArgument(args[ano])) graphMLOutput=StringFilter.trueString(args[ano].charAt(1));\n\n\n process(rootFileName, inputDirectory, outputDirectory,\n yearSet, fieldnameSet,\n weightTypeSet,\n useWhatSet,\n ipf,\n extractGCC,\n minDegreeIn, minDegreeOut, minWeight,\n infoLevel);\n }", "public static void main(String[] args)\n {\n WordNet obj=new WordNet(\"synsets.txt\", \"hypernyms.txt\");\n System.out.println(obj.g.V()+\" \"+obj.g.E());\n System.out.println(obj.h2.size());\n System.out.println(obj.distance(\"American_water_spaniel\", \"histology\"));\n }", "public static void runExample() {\n\t\tString wnhome = \"C:\\\\bdaduy\\\\Software\\\\Wordnet3.1\\\\WordNet-3.0\";\n\t\tString path = wnhome + File.separator + \"dict\";\n\t\tURL url = null;\n\t\ttry {\n\t\t\turl = new URL(\"file\", null, path);\n\t\t} catch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (url == null)\n\t\t\treturn;\n\n\t\t// construct the dictionary object and open it\n\t\tIDictionary dict = new Dictionary(url);\n\t\ttry {\n\t\t\tdict.open();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// look up first sense of the word \"dog\"\n\t\tWordnetStemmer s=new WordnetStemmer(dict);\n\t\tList<String> stems=s.findStems(\"food\", POS.NOUN);\n\t\tDebug.print(stems);\n\t\tIIndexWord idxWord = dict.getIndexWord(\"food\", POS.NOUN);\n\t\tIWordID wordID = idxWord.getWordIDs().get(0);\n\t\tIWord word = dict.getWord(wordID);\n\t\tSystem.out.println(\"Id = \" + wordID);\n\t\tSystem.out.println(\"Lemma = \" + word.getLemma());\n\t\tSystem.out.println(\"Gloss = \" + word.getSynset().getGloss());\n\t\tSystem.out.println(\"test = \" + word.getSynset().getLexicalFile());\n\n\n\t}", "public WBzard(String fileName) throws OWLOntologyCreationException, IOException {\n /*Read the ontology from the disk*/\n // final \n//\t\t URL fileURL = ClassLoader.getSystemResource(fileName);\n//\t\tphysicalURI = fileURL.toString();\n physicalURI = fileName;\n\n loader = OntologyManager.getInstance(physicalURI);\n }", "private void getWordNet(String wordnetPath) {\n\t\ttry {\n\t\t\twordnet = new WordNet(wordnetPath);\n\t\t} catch(NullPointerException | IOException ex) {\n\t\t\tString retryPath = JOptionPane.showInputDialog(frame, \"Path to local WordNet dict directory: \");\n\t\t\tif(retryPath == null)\n\t\t\t\tSystem.exit(0);\n\t\t\telse\n\t\t\t\tgetWordNet(retryPath);\n\t\t}\n\t}", "private static void demo_WordNetOps() throws Exception {\n\n RoWordNet r1, r2, result;\n Synset s;\n Timer timer = new Timer();\n String time = \"\";\n\n IO.outln(\"Creating two RoWN objects R1 and R2\");\n timer.start();\n r1 = new RoWordNet();\n r2 = new RoWordNet();\n\n // adding synsets to O1\n s = new Synset();\n s.setId(\"S1\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L1\"))));\n r1.addSynset(s, false); // adding synset S1 to O2;\n\n s = new Synset();\n s.setId(\"S2\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L2\"))));\n r1.addSynset(s, false); // adding synset S2 to O1;\n\n // adding synsets to O2\n s = new Synset();\n s.setId(\"S1\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L1\"))));\n r2.addSynset(s, false); // adding synset S1 to O2;\n\n s = new Synset();\n s.setId(\"S2\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L4\"))));\n r2.addSynset(s, false); // adding synset S2 to O2, but with literal L4\n // not L2;\n\n s = new Synset();\n s.setId(\"S3\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L3\"))));\n r2.addSynset(s, false); // adding synset S3 to O2;\n time = timer.mark();\n\n // print current objects\n IO.outln(\"\\n Object R1:\");\n for (Synset syn : r1.synsets) {\n IO.outln(syn.toString());\n }\n\n IO.outln(\"\\n Object R2:\");\n for (Synset syn : r2.synsets) {\n IO.outln(syn.toString());\n }\n IO.outln(\"Done: \" + time);\n\n // DIFFERENCE\n IO.outln(\"\\nOperation DIFFERENCE(R1,R2) (different synsets in R1 and R2 having the same id):\");\n timer.start();\n String[] diff = Operation.diff(r1, r2);\n time = timer.mark();\n\n for (String id : diff) {\n IO.outln(\"Different synset having the same id in both RoWN objects: \" + id);\n }\n\n IO.outln(\"Done: \" + time);\n\n // UNION\n IO.outln(\"\\nOperation UNION(R1,R2):\");\n timer.start();\n try {\n result = new RoWordNet(r1);// we copy-construct the result object\n // after r1 because the union and merge\n // methods work in-place directly on the\n // first parameter of the methods\n result = Operation.union(result, r2);\n IO.outln(\" Union object:\");\n for (Synset syn : result.synsets) {\n IO.outln(syn.toString());\n }\n } catch (Exception ex) {\n IO.outln(\"Union operation failed (as it should, as synset S2 is in both objects but has a different literal and are thus two different synsets having the same id that cannot reside in a single RoWN object). \\nException message: \" + ex\n .getMessage());\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // MERGE\n IO.outln(\"\\nOperation MERGE(R1,R2):\");\n\n result = new RoWordNet(r1);\n timer.start();\n result = Operation.merge(result, r2);\n time = timer.mark();\n\n IO.outln(\" Merged object (R2 overwritten on R1):\");\n for (Synset syn : result.synsets) {\n IO.outln(syn.toString());\n }\n IO.outln(\"Done: \" + time);\n\n // COMPLEMENT\n IO.outln(\"\\nOperation COMPLEMENT(R2,R1) (compares only synset ids):\");\n timer.start();\n String[] complement = Operation.complement(r2, r1);\n time = timer.mark();\n IO.outln(\" Complement ids:\");\n for (String id : complement) {\n IO.outln(\"Synset that is in R2 but not in R1: \" + id);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // INTERSECTION\n IO.outln(\"\\nOperation INTERSECTION(R1,R2) (fully compares synsets):\");\n timer.start();\n String[] intersection = Operation.intersection(r1, r2);\n time = timer.mark();\n IO.outln(\" Intersection ids:\");\n for (String id : intersection) {\n IO.outln(\"Equal synset in both R1 and R2: \" + id);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // IO.outln(((Synset) r1.getSynsetById(\"S1\")).equals((Synset)\n // r2.getSynsetById(\"S1\")));\n\n }", "public static void main(String[] args) {\n\t\tWordNet deneme = new WordNet(\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\synsets.txt\",\n\t\t\t\t\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\hypernyms.txt\");\n\t\tSystem.out.println(deneme.sap(\"arm\", \"leg\"));\n\t\tSystem.out.println(deneme.distance(\"arm\", \"eyes\"));\n\t\tSystem.out.println(deneme.distance(\"eyes\", \"mouth\"));\n\t}", "public void setupDuc2002Documents(String duc2002DocsWithSentenceBreaksDirPath, String outputDirPath) throws Exception {\n\t\tthis.replaceAmpersand(duc2002DocsWithSentenceBreaksDirPath);\n\t\tFile dir=new File(duc2002DocsWithSentenceBreaksDirPath);\n\t\tFile[] listDirectories=dir.listFiles();\n\t\tBufferedWriter bw;\n\t\tString docDirPath=outputDirPath;\n\t\tfor(int i=0;i<listDirectories.length;i++) {\n\t\t\tFile[] listFiles=listDirectories[i].listFiles();\n\t\t\tfor(int j=0;j<listFiles.length;j++) {\n\t\t\t\tDocument doc=this.parse(listFiles[j].toString());\n\t\t\t\tDuc2002Document ducDoc=this.getParsedDocument(doc);\n\t\t\t\tString docNo=ducDoc.getDocNo().replaceAll(\"\\n\",\"\");\n\t\t\t\tbw=new BufferedWriter(new FileWriter(new File(docDirPath+docNo+\".doc\")));\n\t\t\t\tString text=ducDoc.getText().replaceAll(\"\\n\",\"\");\n\t\t\t\tbw.write(text);\n\t\t\t\tbw.close();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n WordNet tester = new WordNet(\"synsets.txt\", \"hypernyms.txt\");\n StdOut.println(\n \"isNoun test: This should return true and it returns \" + tester.isNoun(\"mover\"));\n StdOut.println(\"distance test: This should return 3 and it returns \" + tester\n .distance(\"African\", \"renegade\"));\n StdOut.println(\n \"sca test: This should return person individual someone somebody mortal soul and it returns \"\n + tester\n .sca(\"African\", \"renegade\"));\n\n // Commented because output is large\n //StdOut.println(\"nouns test: This should return all of the nouns and it returns \" + tester.nouns());\n\n }", "public static void main(String[] args) {\n\n\t\tWordNet wn = new WordNet(args[0], args[1]);\n\t\tassert (wn.sap(\"'hood\", \"1780s\").compareTo(\"entity\") == 0);\n\t\tassert (wn.distance(\"1530s\", \"1530s\") == 0);\n\t\tassert (wn.distance(\"collar_blight\", \"top\") == 11);\n\n\t\ttry {\n\t\t\tWordNet wn1 = new WordNet(\"syntest.txt\", \"2rootsnym.txt\");\n\t\t\tassert (wn1.distance(\"1840s\", \"'hood\") == -1);\n\t\t\twn1.sap(\"1840s\", \"'hood\");\n\n\t\t\t// wn1.distance(\"1830s\", \"'hood\");\n\t\t\t// wn1.sap(\"1830s\", \"'hood\");\n\t\t\tassert false : \"A graph with 2 roots should throw exception\";\n\n\t\t} catch (java.lang.IllegalArgumentException e) {\n\t\t\tSystem.out.println(\"2 Roots detected: \" + e);\n\t\t}\n\n\t\ttry {\n\t\t\tWordNet wn2 = new WordNet(\"syntest.txt\", \"cycnym.txt\");\n\t\t\tassert false : \"A cyclic graph should throw exception\";\n\n\t\t} catch (java.lang.IllegalArgumentException e) {\n\t\t\tSystem.out.println(\"Cycle detected: \" + e);\n\t\t}\n\n\t}", "private void setCorpus(){\n URL u = Converter.getURL(docName);\n FeatureMap params = Factory.newFeatureMap();\n params.put(\"sourceUrl\", u);\n params.put(\"markupAware\", true);\n params.put(\"preserveOriginalContent\", false);\n params.put(\"collectRepositioningInfo\", false);\n params.put(\"encoding\",\"windows-1252\");\n Print.prln(\"Creating doc for \" + u);\n Document doc = null;\n try {\n corpus = Factory.newCorpus(\"\");\n doc = (Document)\n Factory.createResource(\"gate.corpora.DocumentImpl\", params);\n } catch (ResourceInstantiationException ex) {\n ex.printStackTrace();\n }\n corpus.add(doc);\n annieController.setCorpus(corpus);\n params.clear();\n }", "public static void main(String[] args) {\n String s1 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/synsets.txt\";\n String s2 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/hypernyms.txt\";\n WordNet wordnet = new WordNet(s1, s2);\n Outcast outcast = new Outcast(wordnet);\n for (int t = 0; t < args.length; t++) {\n In in = new In(args[t]);\n String[] nouns = in.readAllStrings();\n StdOut.println(args[t] + \": \" + outcast.outcast(nouns));\n }\n }", "private void createDocs() {\n\t\t\n\t\tArrayList<Document> docs=new ArrayList<>();\n\t\tString foldername=\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\input\";\n\t\tFile folder=new File(foldername);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tfor (File file : listOfFiles) {\n\t\t\ttry {\n\t\t\t\tFileInputStream fisTargetFile = new FileInputStream(new File(foldername+\"\\\\\"+file.getName()));\n\t\t\t\tString fileContents = IOUtils.toString(fisTargetFile, \"UTF-8\");\n\t\t\t\tString[] text=fileContents.split(\"ParseText::\");\n\t\t\t\tif(text.length>1){\n\t\t\t\t\tString snippet=text[1].trim().length()>100 ? text[1].trim().substring(0, 100): text[1].trim();\n\t\t\t\t\tDocument doc=new Document();\n\t\t\t\t\tdoc.setFileName(file.getName().replace(\".txt\", \"\"));\n\t\t\t\t\tdoc.setUrl(text[0].split(\"URL::\")[1].trim());\n\t\t\t\t\tdoc.setText(snippet+\"...\");\n\t\t\t\t\tdocs.add(doc);\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t}\t\n\t\tDBUtil.insertDocs(docs);\n\t}", "public Stemmer ()\n {\n AllWords = new HashMap<String,String>();\n dictionary = Dictionary.getInstance();\n p = PointerUtils.getInstance();\n\n try\n {\n // JWNL.initialize(new FileInputStream(\"file_properties.xml\"));\n JWNLConnecter.initializeJWNL();\n dic = Dictionary.getInstance();\n morph = dic.getMorphologicalProcessor();\n // ((AbstractCachingDictionary)dic).\n //\tsetCacheCapacity (10000);\n IsInitialized = true;\n }\n catch (Exception e){\n System.err.println(e.getMessage());\n }\n /*catch ( FileNotFoundException e )\n {\n System.out.println ( \"Error initializing Stemmer: JWNLproperties.xml not found\" );\n }\n catch ( JWNLException e )\n {\n System.out.println ( \"Error initializing Stemmer: \"\n + e.toString() );\n }*/\n\n }", "public Main() {\r\n\t\t\t// TODO Auto-generated constructor stub\r\n\t OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM, null );\r\n\r\n\t // we have a local copy of the wine ontology\r\n/*\t m.getDocumentManager().addAltEntry( \"http://www.w3.org/2001/sw/WebOnt/guide-src/wine\",\r\n\t \"file:testing/reasoners/bugs/wine.owl\" );\r\n\t m.getDocumentManager().addAltEntry( \"http://www.w3.org/2001/sw/WebOnt/guide-src/food\",\r\n\t \"file:testing/reasoners/bugs/food.owl\" );*/\r\n\r\n//\t m.read( \"http://www.w3.org/2001/sw/WebOnt/guide-src/wine\" );\r\n\t m = loadOntModelFromOwlFile(\"C:\\\\Documents and Settings\\\\Administrador\\\\Escritorio\\\\Tesis\\\\Ontologias\\\\turismo2.owl\");\r\n\t ClassHierarchy classh = new ClassHierarchy();\r\n\t classh.showHierarchy2( System.out, m );\r\n\t classh.creoInd(m);\r\n\t classh.showHierarchy( System.out, m );\r\n\t\t}", "private void GeneratePutativeOntology(String sOntologyName,\n\t\t\tString sOutputFile, RDB2OntMatcher mat) {\n\t\t\t\n\t\tString basePrefix = baseUri + sOntologyName + \".owl#\";\t\n \t\n\t\tSystem.out.println(\"1: Creating putative ontology: \"+basePrefix);\n\n\t\tontPutative = new OntologyTools();\n\t\tontPutative.createOntology(basePrefix, basePrefix);\n\n\t\tDatabaseStructure db = mat.getDatabaseStructure();\n\t\t\n\t\tfor(TableStructure table : db.getTables())\n\t\t{\n\t\t\tClassMatch match = new ClassMatch(table.getNormalizedName(), table.name, table.getOnePrimaryKey());\n\t\t\t\t\t\n\t\t\tontPutative.addClass(table.getNormalizedName(), table.name);\n\n\t\t\tfor(ColumnStructure column : table.getColumns())\n\t\t\t{\n\t\t\t\t// Each column is a datatype\n\t\t\t\tontPutative.addDatatype(\t\n\t\t\t\t\t\t\t\ttable.getNormalizedName(), \n\t\t\t\t\t\t\t\tcolumn.getNormalizedName(), \n\t\t\t\t\t\t\t\tcolumn.type);\n\t\t\t\t\n\t\t\t\tmatch.addDataPropertyMatch(new DataPropertyMatch(column.getNormalizedName(), table.name, column.name, column.type));\n\n\t\t\t\t// Each foreign key is an object property\n\t\t\t\tif(column.isForeignkey) {\n\t\t\t\t\tontPutative.addObjectproperty(\t\n\t\t\t\t\t\t\t\t\"has\"+column.getNormalizedName(), \n\t\t\t\t\t\t\t\ttable.getNormalizedName(),\n\t\t\t\t\t\t\t\tcolumn.getNormalizedForeigntable());\n\t\t\t\t\t\n\t\t\t\t\t// Checking if the columns of the foreign table are a subset of the columns of the table\n\t\t\t\t\tif(db.CheckAttributeSubset(table.name, column.foreigntable)) {\n\t\t\t\t\t\tontPutative.addClass(\n\t\t\t\t\t\t\t\ttable.getNormalizedName(), \n\t\t\t\t\t\t\t\tcolumn.getNormalizedForeigntable(), \n\t\t\t\t\t\t\t\ttable.name);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//If attributes as classes is enabled, each column is a class\n\t\t\t\tif(mbAttributesAsClasses){\n\t\t\t\t\tontPutative.addClass(\n\t\t\t\t\t\t\t column.getNormalizedName(), \n\t\t\t\t\t\t\t \"From_\"+table.name+\"-\"+column.getNormalizedName());\n\t\t\t\t\tontPutative.addObjectproperty(\n\t\t\t\t\t\t\t \"has\"+column.getNormalizedName(), \n\t\t\t\t\t\t\t table.getNormalizedName(), \n\t\t\t\t\t\t\t column.getNormalizedName());\n\t\t\t\t\tontPutative.addDatatype(\n\t\t\t\t\t\t\t column.getNormalizedName(), \n\t\t\t\t\t\t\t column.getNormalizedName(), \n\t\t\t\t\t\t\t column.type);\n\t\t\t\t\t\n\t\t\t\t\tClassMatch matchAttr = new ClassMatch(column.getNormalizedName(), table.name, column.name);\n\n\t\t\t\t\tmatchAttr.isAttributesAsClasses = true;\n\t\t\t\t\t\n\t\t\t\t\tmatchAttr.addDataPropertyMatch(new DataPropertyMatch(column.getNormalizedName(), table.name, column.name, column.type));\n\t\t\t\t\t// We add the match to the matcher's lists\n\t\t\t\t\tmat.addMatch(matchAttr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// We add the match to the matcher's lists\n\t\t\tmat.addMatch(match);\n\t\t}\n\t\t\n\t\tontPutative.saveOntology(sOutputFile + \"_automap4obda.owl\");\n\t\t\n\t\tSystem.out.println(\" # class: \"+ontPutative.getClasses().size());\n\t\tSystem.out.println(\"\");\n\t}", "private BasicNetwork generateBrain(int numTags, int numShelfs) {\n\tSOMPattern pattern = new SOMPattern();\n\tpattern.setInputNeurons(numTags);\n\tpattern.setOutputNeurons(numShelfs);\n\n\treturn pattern.generate();\n }", "public static void main(String arg[]) {\n \tFile wordListFile = new File(\"WordList.txt\");\r\n \tFile definitionsFile = new File (\"DefinitionsAndSentences.txt\"); \t\r\n \tFile outputFile = new File (\"debug.txt\"); \r\n \t\r\n \tInputStream inputStreamOne;\r\n \tInputStreamReader readerOne;\r\n \tBufferedReader binOne;\r\n \t\r\n \tInputStream inputStreamTwo;\r\n \tInputStreamReader readerTwo;\r\n \tBufferedReader binTwo;\r\n \t\r\n \tOutputStream outputStream;\r\n \tOutputStreamWriter writerTwo;\r\n \tBufferedWriter binThree;\r\n \t \t\r\n \t\r\n \t// Lists to store data to write to database\r\n \tArrayList<TermItem>databaseTermList = new ArrayList<TermItem>();\r\n \tArrayList<DefinitionItem>databaseDefinitionList = new ArrayList<DefinitionItem>();\r\n \tArrayList<SentenceItem>databaseSampleSentenceList = new ArrayList<SentenceItem>();\r\n \t\r\n \t// Create instance to use in main()\r\n \tDictionaryParserThree myInstance = new DictionaryParserThree();\r\n \t\r\n \tint totalTermCounter = 1;\r\n \tint totalDefinitionCounter = 1;\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tmyInstance.createDatabase();\r\n\t\t\t// Open streams for reading data from both files\r\n\t\t\tinputStreamOne = new FileInputStream(wordListFile);\r\n\t \treaderOne= new InputStreamReader(inputStreamOne);\r\n\t \tbinOne= new BufferedReader(readerOne);\r\n\t \t\r\n\t \tinputStreamTwo = new FileInputStream(definitionsFile);\r\n\t \treaderTwo= new InputStreamReader(inputStreamTwo);\r\n\t \tbinTwo= new BufferedReader(readerTwo);\r\n\t \t\r\n\t \toutputStream = new FileOutputStream(outputFile);\r\n\t \twriterTwo= new OutputStreamWriter(outputStream);\r\n\t \tbinThree= new BufferedWriter(writerTwo);\r\n\r\n\t \tString inputLineTwo;\r\n\t \tString termArray[] = new String[NUM_SEARCH_TERMS];\r\n\t \t\r\n\t \t// Populate string array with all definitions.\r\n\t \tfor (int i = 0; (inputLineTwo = binTwo.readLine()) != null; i++) {\r\n\t\t \t termArray[i] = inputLineTwo; \r\n\t \t}\t \t\r\n\t \t\r\n\t \t// Read each line from the input file (contains top gutenberg words to be used)\r\n\t \tString inputLineOne;\r\n\t \tint gutenbergCounter = 0;\r\n\t \twhile ((inputLineOne = binOne.readLine()) != null) {\r\n\t \t\t\r\n\t \t\t\r\n\t \t\t// Each line contains three or four words. Grab each word inside double brackets.\r\n\t\t \tString[] splitString = (inputLineOne.split(\"\\\\[\\\\[\")); \t\t \t\r\n\t \t\tfor (String stringSegment : splitString) {\r\n\t \t\t\t\r\n\t \t\t\tif (stringSegment.matches((\".*\\\\]\\\\].*\")))\r\n\t \t\t\t{\r\n\t \t\t\t\t// Increment counter to track Gutenberg rating (already from lowest to highest)\r\n\t \t\t\t\tgutenbergCounter++;\r\n\t \t \t\t\r\n\t \t\t\t\tboolean isCurrentTermSearchComplete = false;\r\n\t \t\t \tint lowerIndex = 0;\r\n\t \t\t \tint upperIndex = NUM_SEARCH_TERMS - 1;\r\n\t \t\t \t\r\n\t \t\t \tString searchTermOne = stringSegment.substring(0, stringSegment.indexOf(\"]]\"));\r\n\t \t\t \tsearchTermOne = searchTermOne.substring(0, 1).toUpperCase() + searchTermOne.substring(1);\r\n\t \t\t \t\r\n\t \t\t\t\twhile (!isCurrentTermSearchComplete) {\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\t// Go to halfway point of lowerIndex and upperIndex.\r\n\t \t\t\t\t\tString temp = termArray[(lowerIndex + upperIndex)/2];\r\n\t \t\t\t\t\tString currentTerm = temp.substring(temp.indexOf(\"<h1>\") + 4, temp.indexOf(\"</h1>\"));\r\n\t \t\t\t\t\t\t \t\t\t\t\t\r\n\t \t \t \t\t\t\t\t\r\n\t \t\t\t\t\t// If definition term is lexicographically lower, need to increase lower Index\r\n\t \t\t\t\t\t// and search higher.\r\n\t \t\t\t\t\t// If definition term is lexicographically higher, need decrease upper index\r\n\t \t\t\t\t\t// and search higher.\r\n\t \t\t\t\t\t// If a match is found, need to find first definition, and record each definition\r\n\t \t\t\t\t\t// in case of duplicates.\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\tif (currentTerm.compareTo(searchTermOne) < 0) {\t \t\t\t\t\t\t\r\n\t \t\t\t\t\t\tlowerIndex = (lowerIndex + upperIndex)/2;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\telse if (currentTerm.compareTo(searchTermOne) > 0) {\r\n\t \t\t\t\t\t\tupperIndex = (lowerIndex + upperIndex)/2; \t\t\t\t\t\t\r\n\t \t\t\t\t\t} \t\t\t\t\t\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\telse {\t\r\n\t \t\t\t\t\t\t// Backtrack row-by-row until we reach the first term in the set. Once we reach the beginning,\r\n\t \t\t\t\t\t\t// cycle through each match in the set and obtain each definition until we reach the an unmatching term.\r\n\r\n\t \t\t\t\t\t\t//else {\r\n\t \t\t\t\t\t\t\tSystem.out.println(searchTermOne);\r\n\t\t \t\t\t\t\t\tint k = (lowerIndex + upperIndex)/2;\r\n\t\t \t\t\t\t\t\tboolean shouldIterateAgain = true;\r\n\t\t \t\t\t\t\t\twhile (shouldIterateAgain) {\r\n\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\tif (k <= 0 || k >= NUM_SEARCH_TERMS) {\r\n\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t\telse {\r\n\t\t\t\t \t\t\t\t\t\tString current = termArray[k].substring(termArray[k].indexOf(\"<h1>\") + 4, termArray[k].indexOf(\"</h1>\"));\r\n\t\t\t\t \t\t\t\t\t\tString previous = termArray[k - 1].substring(termArray[k - 1].indexOf(\"<h1>\") + 4, termArray[k - 1].indexOf(\"</h1>\"));\r\n\t\t\t\t\t \t\t\t\t\t\r\n\t\t\t\t \t\t\t\t\t\tif (current.compareTo(previous) == 0) {\t\t\t\r\n\t\t\t\t \t\t\t\t\t\t\tk--;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t\t\t\t\t \t\t\t\t\telse {\r\n\t\t\t\t\t \t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t} \r\n\t\t \t\t\t\t\t\tshouldIterateAgain = true;\r\n\t\t \t\t\t\t\t\twhile (shouldIterateAgain) {\r\n\t\t \t\t\t\t\t\t\t\t\t \t\r\n\t\t \t\t\t\t\t\t\t// Used to store data to later pass to DB\r\n\t\t \t\t\t\t\t DictionaryParserThree.TermItem tempTermItem = myInstance.new TermItem();\r\n\r\n\t\t \t\t\t\t\t // Determine unique ID (which will be written to DB later)\r\n\t\t \t\t\t\t\t // Add current term and gutenberg rating.\r\n\t\t \t\t\t\t\t tempTermItem.ID = totalTermCounter;\t\t \t\t\t\t\t \t \t\t\t\t\t \r\n\t\t \t\t\t\t\t \ttempTermItem.theWord = searchTermOne; // same as termArray[k]'s term\r\n\t\t \t\t\t\t\t \r\n\t\t \t\t\t\t\t\t\ttempTermItem.gutenbergRating = gutenbergCounter;\r\n\t\t \t\t\t\t\t\t\tdatabaseTermList.add(tempTermItem);\r\n\t\t \t\t\t\t\t\t\tbinThree.write(\"Term ID \" + tempTermItem.ID + \" \" + tempTermItem.theWord + \" guten rank is \" + tempTermItem.gutenbergRating);\r\n\t\t \t\t\t\t\t\t\tbinThree.newLine();\t\t\t\t\t\t\t\r\n\t\t \t\t\t\t \t\tsplitString = termArray[k].split(\"<def>\");\r\n\t\t \t\t\t\t \t\t\r\n\t\t \t\t\t\t \t\tint m = 0;\r\n\t \t\t\t\t\t \t\tfor (String stringSegment2 : splitString) {\r\n\t \t\t\t\t\t \t\t\tif (stringSegment2.matches(\".*</def>.*\") && m > 0) {\r\n\t \t\t\t\t\t \t\t\t\t\r\n\t \t\t\t\t\t \t\t\t\t// Determine unique ID (which will be written to DB later)\r\n\t \t\t\t\t\t \t\t\t\t// Add definition, as well as term ID it is associated with.\r\n\t \t\t\t\t\t \t\t\t\tDictionaryParserThree.DefinitionItem tempDefinitionItem = myInstance.new DefinitionItem();\r\n\t \t\t\t\t\t \t\t\t\ttempDefinitionItem.ID = totalDefinitionCounter;\r\n\t \t\t\t\t\t \t\t\t\ttempDefinitionItem.theDefinition = stringSegment2.substring(0, stringSegment2.indexOf(\"</def>\"));\r\n\t \t\t\t\t\t\t \t\t\ttempDefinitionItem.termID = totalTermCounter;\r\n\t \t\t\t\t\t\t \t\t\tdatabaseDefinitionList.add(tempDefinitionItem);\r\n\r\n\t \t\t\t\t\t\t \t\t\tint n = 0;\r\n\t \t\t\t\t\t\t \t\t\tString[] splitString2 = (stringSegment2.split(\"<blockquote>\")); \r\n\t \t \t\t\t\t\t \t\tfor (String stringSegment3 : splitString2) {\r\n\t \t \t\t\t\t\t \t\t\tif (stringSegment3.matches(\".*</blockquote>.*\") && n > 0) {\r\n\t \t \t\t\t\t\t \t\t\t\t// Add data which will be added to DB later.\r\n\t \t \t\t\t\t\t \t\t\t\t// Add sample sentence as well as the definition ID it is associated with.\r\n\t \t \t\t\t\t\t \t\t\t\tDictionaryParserThree.SentenceItem tempSentenceItem = myInstance.new SentenceItem();\t\r\n\t \t \t\t\t\t\t \t\t\t\ttempSentenceItem.definitionID = totalDefinitionCounter;\r\n\t \t \t\t\t\t\t \t\t\t\ttempSentenceItem.theSampleSentence = stringSegment3.substring(0, stringSegment3.indexOf(\"</blockquote>\"));\r\n\t \t \t\t\t\t\t \t\t\t\tdatabaseSampleSentenceList.add(tempSentenceItem);\t \t \t\t\t\t\t \t\t\t\t\r\n\t \t \t \t\t\t\t\t \t\t\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.write(\"Definition is\" + tempDefinitionItem.theDefinition);\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.newLine();\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.write(\" and sample sentence is \" + tempSentenceItem.theSampleSentence);\r\n\t \t \t\t \t\t\t\t\t\t\tbinThree.newLine();\t\r\n\t \t \t\t\t\t\t \t\t\t}\r\n\t \t \t\t\t\t\t \t\t\t// Increment counter for split string (for this line's sample sentence)\r\n\t \t \t\t\t\t\t \t\t\tn++;\r\n\t \t \t\t\t\t\t \t\t}\r\n\t \t \t\t\t\t\t \t\ttotalDefinitionCounter++;\r\n\t \t\t\t\t\t \t\t\t}\r\n\t \t\t\t\t\t \t\t\t// Increment counter for split string (for this line's definition)\r\n\t \t\t\t\t \t\t\t\tm++;\r\n\t \t\t\t\t \t\t\t\t\r\n\t \t\t\t\t\t \t\t}\t \t \t\t\t\t\t \t\t\r\n\t \t\t\t\t\t \t\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\ttotalTermCounter++;\r\n\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\t// Compare next definition and see if duplicate exists.\r\n\t\t \t\t\t\t\t\t\t// If so, add to string array.\r\n\t \t\t\t\t\t \t\tif (k < 0 || k >= NUM_SEARCH_TERMS - 1) {\r\n\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t \t\telse { \t \t\t\t\t\t \t\t\r\n\t\t\t \t\t\t\t\t\t\tString current = termArray[k].substring(termArray[k].indexOf(\"<h1>\") + 4, termArray[k].indexOf(\"</h1>\"));\r\n\t\t\t\t \t\t\t\t\t\tString next = termArray[k + 1].substring(termArray[k + 1].indexOf(\"<h1>\") + 4, termArray[k + 1].indexOf(\"</h1>\"));\r\n\t\t\t\t\t \t\t\t\t\tif (current.compareTo(next) == 0) {\t\r\n\t\t\t\t \t\t\t\t\t\t\tk++;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t\t\t\t \t\t\t\t\t\telse {\r\n\t\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t \t\t}\r\n\t\t\t \t\t\t\t\t\t//}\t \t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\tisCurrentTermSearchComplete = 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\t\r\n\t \t\t\t\t\t// If the term does not exist in the database.\r\n\t \t\t\t\t\tif (Math.abs(upperIndex) - Math.abs(lowerIndex) <= 1)\r\n\t \t\t\t\t\t{\r\n \t\t\t\t\t\t\t isCurrentTermSearchComplete = true;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t}\r\n\t \t\t} \t \t\t\r\n\t \t}\r\n\t \t\r\n\t \t \t\r\n\t \tSystem.out.println(\"ended search.\");\t\r\n\t \tmyInstance.writeAllItemsToDatabase(databaseTermList, databaseDefinitionList, databaseSampleSentenceList);\t\r\n\t \tSystem.out.println(\"ended write.\");\r\n\t \t\r\n\t \tbinOne.close();\r\n\t \treaderOne.close();\r\n\t \tinputStreamOne.close();\t \t\r\n\t \t\r\n\t \tbinTwo.close();\r\n\t \treaderTwo.close();\r\n\t \tinputStreamTwo.close();\t \t\r\n\t \t\r\n\t \tbinThree.close(); \r\n\t \twriterTwo.close();\r\n\t \toutputStream.close();\r\n\t \tSystem.exit(0);\r\n\r\n\r\n\t \t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \t\r\n }", "public ArrayList<Ngram> getNgramsFromFileWithStopwordsListOnly(String content) {\n HashMap<String, Integer> ngramsTable = new HashMap<>();\n InputStream modelIn = null; //rules_POS = null;\n if (content != null) {\n try {\n\n modelIn = new FileInputStream(\"resources/en-token.bin\");\n TokenizerModel model = new TokenizerModel(modelIn);\n Tokenizer tokenizer = new TokenizerME(model);\n String paras[] = tokenizer.tokenize(content);\n\n //create the first ngram\n String[] ngram = new String[nrGrams];\n int i = 0, count = 0;\n while (count < nrGrams && i < paras.length) {\n if (paras[i].trim().length() > 0 && !paras[i].matches(\"[\\\\p{Punct}\\\\p{Digit}]+|'s\")) {\n String word = paras[i].toLowerCase();\n if (word.trim().length() > 0) {\n ngram[count] = word;\n count++;\n }\n }\n i++;\n }\n\n StringBuilder sb = new StringBuilder();\n for (int j = 0; j < ngram.length - 1; j++) {\n sb.append(ngram[j]).append(\"<>\");\n }\n sb.append(ngram[ngram.length - 1]);\n\n //adding to the frequencies table\n ngramsTable.put(sb.toString(), 1);\n\n //creating the remaining ngrams\n String word;\n while (i < paras.length) {\n if (paras[i].trim().length() > 0 && !paras[i].matches(\"[\\\\p{Punct}\\\\p{Digit}']+|'s\")) {\n word = paras[i].toLowerCase();\n\n if (word.trim().length() > 0) {\n String ng = addNextWord(ngram, word);\n\n //verify if the ngram already exist on the document\n if (ngramsTable.containsKey(ng)) {\n ngramsTable.put(ng, ngramsTable.get(ng) + 1);\n } else {\n ngramsTable.put(ng, 1);\n }\n }\n }\n i++;\n }\n } catch (IOException e) {\n Logger.getLogger(AbstractDatabaseImporter.class.getName()).log(Level.SEVERE, null, e);\n } finally {\n if (modelIn != null) {\n try {\n modelIn.close();\n } catch (IOException e) {\n }\n }\n }\n }\n\n\n\n\n ArrayList<Ngram> ngrams = new ArrayList<>();\n for (Entry<String, Integer> entry : ngramsTable.entrySet()) {\n ngrams.add(new Ngram(entry.getKey(), entry.getValue()));\n }\n Collections.sort(ngrams);\n return ngrams;\n }", "public void load(String typ, String souborMilnik, String souborNaplanovane, String souborVysledek) {\r\n\t\t/* cteni dat */\r\n\t\tISourceReader reader = SourceReaderFactory.getReader(typ);\r\n\t\tif(reader == null) return;\r\n\t\tList<Data> dataMilniky = reader.read(DocType.MILNIK, souborMilnik);\r\n\t\tList<Data> dataNaplanovane = reader.read(DocType.NAPLANOVANE, souborNaplanovane);\r\n\t\tList<Data> dataVysledky = reader.read(DocType.VYSLEDKY, souborVysledek);\r\n\t\tif((dataMilniky == null) || (dataNaplanovane == null) || (dataVysledky == null)) return;\r\n\r\n\t\t/* mapovani dat */\r\n\t\tIMapper mapper;\r\n\t\tmapper = MapperFactory.getMapper(DocType.MILNIK);\r\n\t\tList<OutData> dataMilnikyOut = mapper.map(dataMilniky);\r\n\t\tmapper = MapperFactory.getMapper(DocType.NAPLANOVANE);\r\n\t\tList<OutData> dataNaplanovaneOut = mapper.map(dataNaplanovane);\r\n\t\tmapper = MapperFactory.getMapper(DocType.VYSLEDKY);\r\n\t\tList<OutData> dataVysledkyOut = mapper.map(dataVysledky);\r\n\t\tif((dataMilnikyOut == null) || (dataNaplanovaneOut == null) || (dataVysledkyOut == null)) return;\r\n\r\n\t\t/* slouceni dat */\r\n\t\tMerger merger = new Merger();\r\n\t\tmerger.mergeData(dataMilnikyOut, dataNaplanovaneOut, dataVysledkyOut);\r\n\r\n\t\t/* zapis dat do databaze */\r\n\t\tMongoWriter writer = new MongoWriter();\r\n\t\tSystem.out.println(\"Zadej URI: \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString uri = sc.nextLine();\r\n\t\tsc.close();\r\n\t\tMongoDatabase db = writer.connectToDB(uri);\r\n\t\tif(db == null) return;\r\n\t\twriter.write(dataMilnikyOut, db);\r\n\t}", "private void _generate(int versions) {\n\t \n\t \n\t \n\t _generate(); //V0\n\t \n\t File[] files = new File(System.getProperty(\"user.dir\")).listFiles();\n\t Model model = ModelFactory.createDefaultModel();\n\t //model.set\n\t\tfor(File file : files){\n\t\t\tif(!file.getName().contains(\"owl\")) continue;\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\tFileInputStream in = new FileInputStream(file);\n\t\t\t\tmodel.read(in, \"http://example.com\", \"RDF/XML\");\t\t\t\n\t\t\t\tin.close();\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tlong startingSize = model.size();\n\t\tmodel.close();\n\t double desSize = startingSize*(1+evoChange);\n\t int schemaEvol = (int)(strict*10);\n\t int schemaEvol2 = schemaEvol / (evoVersions-1);\n\t System.out.println(\"schema evol param: \" + schemaEvol2);\n\t int howManyDepts = (int) Math.floor(totalDeptsV0*evoChange);\n\t HashMap<Integer, String> newClasses = new HashMap<Integer, String>();\n\t for(int i = 0; i < schemaEvol; i++)\n\t\t newClasses.put(i,\"\");\n\n\t double evoChangeOriginal = evoChange;\n\t boolean pub = false, conf = false, journ = false, tech = false, \n\t\t\t book = false, thes = false, proj = false, even = false;\n\t HashMap<String, HashMap<Integer, Double>> initialWeightsMap = new HashMap<String, HashMap<Integer,Double>>();\n\t for(String key : fileWeightsMap.keySet()){\n\t\t HashMap<Integer, Double> innerClone = new HashMap<Integer, Double>();\n\t\t for(Integer innerKey : fileWeightsMap.get(key).keySet()){\n\t\t\t innerClone.put(innerKey, fileWeightsMap.get(key).get(innerKey));\n\t\t }\n\t\t initialWeightsMap.put(key, innerClone);\n\t }\n\t for(int vi = 0 ; vi < evoVersions-1; vi++){\n\t \t\n\t\t globalVersionTrigger = true;\n\t\t File dir = new File(System.getProperty(\"user.dir\")+\"/v\"+vi);\n dir.mkdirs();\n\t\t //assignFilters(classFilters);\n\t\t //System.out.println(\"current filters: \" + currentFilters.toString());\n\t \tint classForChange ;\n\t \n\t \t//the number of depts (files) to evolve, based on the defined evoChange parameter\t \n\t \n\t List<String> asList = new ArrayList<String>(fileWeightsMap.keySet());\n\t \n\t writer_log = new OwlWriter(this);\t \n writer_log.startLogFile(dir.getAbsolutePath()+\"/changes.rdf\");\n writer_log.start();\n\t for(int d = 0 ; d < howManyDepts ; d++){\n\t \t\n\t \t//System.out.println(\"aslist: \" + asList.size());\n\t \tif(asList.size() == 0) break;\n\t String randomFile = asList.get(random_.nextInt(asList.size()));\n\t instances_ = fileInstanceMap.get(randomFile);\n\t \n\t asList.remove(randomFile);\n\t \t\n\t //System.out.println(\"Selected file: \" + randomFile);\n\t writer_ = new OwlWriter(this);\n\t \n\t writer_.startFile(dir.getAbsolutePath()+\"/\"+randomFile);\n\t writer_.start();\n\t for(Integer nextClass : fileWeightsMap.get(randomFile).keySet()){\n\t \t\n\t \tclassForChange = nextClass;\n\t \t\n\t \tif(classForChange < 2) {\n\t \t\t\tcontinue;\n\t \t}\n\t \t\n\t \tif(classForChange == 4) continue;\n\t \tint totalIter = (int) Math.floor(2*initialWeightsMap.get(randomFile).get(classForChange))/howManyDepts;\n\t \t\n\t for(int i = 0; i < totalIter ; i++){\n\t \t\n\t \t_generateASection(classForChange, \n\t \t\t\tinstances_[classForChange].count ); \t \t\t\t\n\t }\n\t \n\t if(nextClass == 21 ){\n\t \twriter_log.addTypeClass(ontology+\"WebCourse\");\n\t \twriter_log.addSuperClass(ontology+\"WebCourse\", ontology+\"Course\");\n\t }\n\t else if(nextClass == 20 ){\n\t \twriter_log.addTypeClass(ontology+\"VisitingStudent\");\n\t \twriter_log.addSuperClass(ontology+\"VisitingStudent\", ontology+\"Student\");\n\t }\n\t else if(nextClass == 19 ){\n\t \twriter_log.addTypeClass(ontology+\"VisitingProfessor\");\n\t \twriter_log.addSuperClass(ontology+\"VisitingProfessor\", ontology+\"Professor\");\n\t }\n\t \n\t }\n\t \n\t for(int k = 0; k < schemaEvol2+1; k++){\n\t \t\n\t \tif(newClasses.isEmpty()) break;\n\t \tint newClass = _getRandomFromRange(0, newClasses.keySet().size()+1);\n\t \tint index = 0;\n\t \tfor(Integer s : newClasses.keySet()){\n\t \t\tif(index == newClass){\n\t \t\t\tnewClass = s;\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tindex++;\n\t \t}\n\t \t/*if(newClass == 1){\n\t \t_generatePublications();\n\t \tnewClasses.remove(newClass);\n\t }*/\n\t if(newClass == 2){\n\t \t_generateConferencePublications();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"ConferencePublication\");\n\t \twriter_log.addSuperClass(ontology+\"ConferencePublication\", ontology+\"Publication\");\n\t }\n\t if(newClass == 3){\n\t \t_generateJournalPublications();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"JournalArticle\");\n\t \twriter_log.addSuperClass(ontology+\"JournalArticle\", ontology+\"Publication\");\n\t }\n\t if(newClass == 4 ){\n\t \t_generateTechnicalReports();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"TechnicalReport\");\n\t \twriter_log.addSuperClass(ontology+\"TechnicalReport\", ontology+\"Publication\");\n\t }\n\t if(newClass == 5 ){\n\t \t_generateBooks();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Book\");\n\t \twriter_log.addSuperClass(ontology+\"Book\", ontology+\"Publication\");\n\t }\n\t if(newClass == 6 ){\n\t \t_generateThesis();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Thesis\");\n\t \twriter_log.addSuperClass(ontology+\"Thesis\", ontology+\"Publication\");\n\t }\n\t if(newClass == 7 ){\n\t \t_generateProjects();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Project\");\n\t }\n\t if(newClass == 8){\n\t \t_generateEvents();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Event\");\n\t }\n\t }\n\t \n\t writer_.end();\n\t writer_.endFile();\n\t //correction\n\t //remainingUnderCourses_.\n\t remainingUnderCourses_.clear();\n\t \n\t for (int i = 0; i < UNDER_COURSE_NUM + (int) (UNDER_COURSE_NUM*evoChange); i++) {\n\t remainingUnderCourses_.add(new Integer(i));\n\t }\n\t remainingGradCourses_.clear();\n\t for (int i = 0; i < GRAD_COURSE_NUM + (int) (GRAD_COURSE_NUM*evoChange); i++) {\n\t remainingGradCourses_.add(new Integer(i));\n\t }\n\t remainingWebCourses_.clear();\n\t for (int i = 0; i < WEB_COURSE_NUM + (int) (WEB_COURSE_NUM*evoChange); i++) {\n\t remainingWebCourses_.add(new Integer(i));\n\t }\n\t \n\t assignWeights(randomFile);\t \t \n\t \n\t }\t\n\t evoChange = evoChange + evoVersions*evoChangeOriginal*evoChangeOriginal;\n\t \n\t writer_log.end();\n\t writer_log.endLogFile();\n\t \n\t \t\n\t }\n\t \n\t \n }", "public static void main(String[] args){\n WordNet wordNet = new WordNet(args[0], args[1]);\n System.out.println(wordNet.sap(\"c\", \"b\"));\n }", "private File createModelInput(String fileName) throws IOException {\n\t\tLineIterator it = null;\n\t\tFile newFile = new File(INPUT_TWEETS_REMOVED_STOPWORDS_TXT);\n\t\tFileOutputStream fos = null;\n\t\ttry {\n\n\t\t\tfos = new FileOutputStream(newFile);\n\t\t\tit = FileUtils.lineIterator(new File(fileName), \"UTF-8\");\n\t\t\tit.nextLine(); // Skip header\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString line = it.nextLine();\n\n\t\t\t\tString tweet = removeStopWords(line.split(TAB_SEPARATOR)[1]);\n\n\t\t\t\tif (tweet == null || \"\".equals(tweet)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tIOUtils.write(line.split(TAB_SEPARATOR)[2] + \"\\t\" + tweet\n\t\t\t\t\t\t+ \"\\n\", fos);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (it != null) {\n\t\t\t\tit.close();\n\t\t\t}\n\t\t\tif (fos != null) {\n\t\t\t\tfos.close();\n\t\t\t}\n\t\t}\n\t\treturn newFile;\n\t}", "private static void createSeededFiles(String type, int seedNum, int trainNum, int testNum, File sourceDirectory,\n File destinationDirectory) {\n\n File trainDirectory = new File(destinationDirectory.getAbsolutePath() + \"/train\");\n if(trainNum > 0 && !trainDirectory.exists()) {\n trainDirectory.mkdir();\n }\n File testDirectory = new File(destinationDirectory.getAbsolutePath() + \"/test\");\n if(testNum > 0 && !testDirectory.exists()) {\n testDirectory.mkdir();\n }\n\n //for each language, we want to create a directory for that language, then parse trees/sentences through each of the novels listed there\n File[] languages = sourceDirectory.listFiles();\n File[] trainDirectoryLanguages = new File[languages.length];\n File[] testDirectoryLanguages = new File[languages.length];\n for (int i = 0; i < languages.length; i++) {\n if (languages[i].getName().startsWith(\".\")) {\n continue;\n }\n trainDirectoryLanguages[i] = new File(trainDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n testDirectoryLanguages[i] = new File(testDirectory.getAbsolutePath() + \"/\" + languages[i].getName());\n if (trainNum > 0)\n makeNewDirectoryIfNotExists(trainDirectoryLanguages[i]);\n if (testNum > 0)\n makeNewDirectoryIfNotExists(testDirectoryLanguages[i]);\n\n File[] novels = languages[i].listFiles();\n for (int j = 0; j < novels.length; j++) {\n if (novels[j].getName().startsWith(\".\")) {\n continue;\n }\n try {\n BufferedReader read = new BufferedReader(new FileReader(novels[j]));\n //name w/o .txt\n String fileShortName = novels[j].getName().substring(0, novels[j].getName().length()-4);\n String line;\n //max number of stuff we want to read is based on our inputs\n int maxFiles = testNum + trainNum;\n long maxLines = (long) maxFiles * (long) seedNum;\n int lineCount = 0;\n int fileCount = 1;\n //File currentFile = createNewNumberedFile(trainDirectoryLanguages[i].getAbsolutePath() + \"/\" + fileShortName, fileCount);\n String pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n File currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n PrintWriter pw = new PrintWriter(currentFile);\n\n //this is the part that varies based on calling for text or trees.\n switch (type) {\n case \"text\":\n while ((line = read.readLine()) != null && lineCount < maxLines ) {\n pw.println(line);\n lineCount++;\n //when our lineCount mod seedNum is 0, we want to create another PrintWriter\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n case \"tree\":\n //need to build a Treebank... lifting code from HW 3 to aid in this.\n Options op = new Options();\n op.doDep = false;\n op.doPCFG = true;\n op.setOptions(\"-goodPCFG\", \"-evals\", \"tsv\");\n Treebank treeBank = op.tlpParams.diskTreebank();\n treeBank.loadPath(novels[j]);\n Iterator<Tree> it = treeBank.iterator();\n while((it.hasNext()) && lineCount < maxLines) {\n lineCount++;\n Tree t = it.next();\n t.pennPrint(pw);\n if (lineCount % seedNum == 0) {\n fileCount++;\n //put in train or test, depending on our current file count.\n if (fileCount <= maxFiles) {\n pathToUse = (fileCount <= trainNum) ? trainDirectoryLanguages[i].getAbsolutePath() :\n testDirectoryLanguages[i].getAbsolutePath();\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n pw.flush();\n pw.close();\n pw = new PrintWriter(currentFile);\n }\n }\n }\n break;\n }\n pw.flush();\n pw.close();\n //if numlines is not equal to maxlines then we'll remove the last file.\n if (lineCount != maxLines) {\n currentFile = createNewNumberedFile(pathToUse + \"/\" + fileShortName, fileCount);\n currentFile.delete();\n }\n } catch (IOException e) {\n System.err.println(\"Exception caught while reading \" + novels[j] + \":\");\n e.printStackTrace();\n }\n }\n\n\n }\n\n\n }", "public static opCode createDocument(String name, int nsection)\n {\n Operation request = new Operation(username);\n request.setPassword(password);\n request.setCode(opCode.CREATE);\n\n request.setFilename(name);\n request.setSection(nsection);\n\n sendReq(clientSocketChannel,request);\n\n return getAnswer();\n }", "WordLadderSolver(String dictionaryFile) {\n \tdictionary = new Dictionary(dictionaryFile); //Set up the words from the file\n }", "public void CreatFileXML(HashMap<String, List<Detail>> wordMap, String fileName ) throws ParserConfigurationException, TransformerException {\n\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n\t\tDocument doc = dBuilder.newDocument();\n\t\t\n\t\t//root element\n\t\tElement rootElement = doc.createElement(\"Words\");\n\t\tdoc.appendChild(rootElement);\n\t\t\n\t\tSet<String> keyset = wordMap.keySet();\n\t\tfor(String key : keyset) {\n\t\t\t\n\t\t\t// Load List of detail from HashMap\n\t\t\tList<Detail> values = wordMap.get(key);\n\t\t\t\n\t\t\tfor (Detail detail : values) {\n\t\t\t\n\t\t\t\t//LexicalEntry element\n\t\t\t\tElement LexicalEntry = doc.createElement(\"LexicalEntry\");\n\t\t\t\trootElement.appendChild(LexicalEntry);\n\t\t\t\t\n\t\t\t\t//HeadWord element\n\t\t\t\tElement HeadWord = doc.createElement(\"HeadWord\");\n\t\t\t\tHeadWord.appendChild(doc.createTextNode(key));\n\t\t\t\tLexicalEntry.appendChild(HeadWord);\n\t\t\t\t\n\t\t\t\t//Detail element\n\t\t\t\tElement Detail = doc.createElement(\"Detail\");\n\t\t\t\t\n\t\t\t\t// WordType element\n\t\t\t\tElement WordType = doc.createElement(\"WordType\");\n\t\t\t\tWordType.appendChild(doc.createTextNode(detail.getTypeWord()));\n\t\t\t\t\n\t\t\t\t// CateWord element\n\t\t\t\tElement CateWord = doc.createElement(\"CateWord\");\n\t\t\t\tCateWord.appendChild(doc.createTextNode(detail.getCateWord()));\n\t\t\t\t\n\t\t\t\t// SubCateWord element\n\t\t\t\tElement SubCateWord = doc.createElement(\"SubCateWord\");\n\t\t\t\tSubCateWord.appendChild(doc.createTextNode(detail.getSubCateWord()));\n\t\t\t\t\n\t\t\t\t// VerbPattern element\n\t\t\t\tElement VerbPattern = doc.createElement(\"VerbPattern\");\n\t\t\t\tVerbPattern.appendChild(doc.createTextNode(detail.getVerbPattern()));\n\t\t\t\t\n\t\t\t\t// CateMean element\n\t\t\t\tElement CateMean = doc.createElement(\"CateMean\");\n\t\t\t\tCateMean.appendChild(doc.createTextNode(detail.getCateMean()));\n\t\t\t\t\n\t\t\t\t// Definition element\n\t\t\t\tElement Definition = doc.createElement(\"Definition\");\n\t\t\t\tDefinition.appendChild(doc.createTextNode(detail.getDefinition()));\n\t\t\t\t\n\t\t\t\t// Example element\n\t\t\t\tElement Example = doc.createElement(\"Example\");\n\t\t\t\tExample.appendChild(doc.createTextNode(detail.getExample()));\n\t\t\t\t\n\t\t\t\t// Put in Detail Element\n\t\t\t\tDetail.appendChild(WordType);\n\t\t\t\tDetail.appendChild(CateWord);\n\t\t\t\tDetail.appendChild(SubCateWord);\n\t\t\t\tDetail.appendChild(VerbPattern);\n\t\t\t\tDetail.appendChild(CateMean);\n\t\t\t\tDetail.appendChild(Definition);\n\t\t\t\tDetail.appendChild(Example);\n\t\t\t\t\n\t\t\t\t// Add Detail into LexicalEntry\n\t\t\t\tLexicalEntry.appendChild(Detail);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// write the content into xml file\n\t\tTransformerFactory tfmFactory = TransformerFactory.newInstance();\n\t\tTransformer transformer = tfmFactory.newTransformer();\n\t\tDOMSource source = new DOMSource(doc);\n\t\tStreamResult result = new StreamResult(new File(\"F://GitHUB/ReadXML/data/\" + fileName));\n\t\ttransformer.transform(source, result);\n\t\t\n//\t\t// output testing\n//\t\tStreamResult consoleResult = new StreamResult(System.out);\n// transformer.transform(source, consoleResult);\n\t}", "public static void main(String []args){\n\t\tString format = \"TURTLE\";\n\t\tInputStream is = Thread.currentThread().getContextClassLoader().\n\t\t\t\tgetResourceAsStream(\"test_ontologies/cp-11.ttl\");\n\t\tOntDocumentManager dm = OntDocumentManager.getInstance();\n\t\tdm.setProcessImports(false);\n\t\tOntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_DL_MEM);\n\t\tspec.setDocumentManager(dm); \n\t\t//spec.setReasoner(reasoner);\n\t\tOntModel ontModel = ModelFactory.createOntologyModel( spec, null );\n\t\tontModel.read(is,\"\",format);\n\t\ttry {\n\t\t\tStmtIterator it = ontModel.listStatements();\n\t\t\tSystem.out.println(\"STATEMENTS\");\n\t\t\tStatement st;\n\t\t\twhile(it.hasNext()){\n\t\t\t\tst = it.next();\n\t\t\t\tif(st.getSubject().isAnon() || st.getObject().isAnon()){\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(it.next());\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"REIFIED STATEMENTS\");\n\t\t\tRSIterator it2 = ontModel.listReifiedStatements();\n\t\t\twhile(it2.hasNext()){\n\t\t\t\tSystem.out.println(it2.next());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e);\n\t\t}\n\n\t}", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\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\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\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\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\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\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \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\tif (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\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\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\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\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\t\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\t\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\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\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\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// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\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\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\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\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\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\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "public void description() throws Exception {\n PrintWriter pw = new PrintWriter(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \n \n // BufferedReader for obtaining the description files of the ontology & ODP\n BufferedReader br1 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/ontology_description\")); \n BufferedReader br2 = new BufferedReader(new FileReader(System.getProperty(\"user.dir\")+ \"/resources/odps_description.txt\")); \n String line1 = br1.readLine(); \n String line2 = br2.readLine(); \n \n // loop is used to copy the lines of file 1 to the other \n if(line1==null){\n\t \tpw.print(\"\\n\");\n\t }\n while (line1 != null || line2 !=null) \n { \n if(line1 != null) \n { \n pw.println(line1); \n line1 = br1.readLine(); \n } \n \n if(line2 != null) \n { \n pw.println(line2); \n line2 = br2.readLine(); \n } \n } \n pw.flush(); \n // closing the resources \n br1.close(); \n br2.close(); \n pw.close(); \n \n // System.out.println(\"Merged\"); -> for checking the code execution\n /* On obtaining the merged file, Doc2Vec model is implemented so that vectors are\n * obtained. And the, similarity ratio of the ontology description with the ODPs \n * can be found using cosine similarity \n */\n \tFile file = new File(System.getProperty(\"user.dir\")+ \"/resources/merged_file.txt\"); \t\n SentenceIterator iter = new BasicLineIterator(file);\n AbstractCache<VocabWord> cache = new AbstractCache<VocabWord>();\n TokenizerFactory t = new DefaultTokenizerFactory();\n t.setTokenPreProcessor(new CommonPreprocessor()); \n LabelsSource source = new LabelsSource(\"Line_\");\n ParagraphVectors vec = new ParagraphVectors.Builder()\n \t\t.minWordFrequency(1)\n \t .labelsSource(source)\n \t .layerSize(100)\n \t .windowSize(5)\n \t .iterate(iter)\n \t .allowParallelTokenization(false)\n .workers(1)\n .seed(1)\n .tokenizerFactory(t) \n .build();\n vec.fit();\n \n //System.out.println(\"Check the file\");->for execution of code\n PrintStream p=new PrintStream(new File(System.getProperty(\"user.dir\")+ \"/resources/description_values\")); //storing the numeric values\n \n \n Similarity s=new Similarity(); //method that checks the cosine similarity\n s.similarityCheck(p,vec);\n \n \n }", "public WordGenerator()\n {\n adjective1a = new ArrayList<String>();\n adjective1b = new ArrayList<String>();\n adjective1c = new ArrayList<String>();\n adjective2a = new ArrayList<String>();\n adjective2b = new ArrayList<String>();\n adjective2c = new ArrayList<String>();\n fillAdjectives();\n noun = \"\";\n adj1 = \"\";\n adj2 = \"\";\n }", "private boolean SetWordNetDB(URL url) {\r\n\t\tdict = new Dictionary(url);\r\n\t\ttry {\r\n\t\t\tdict.open();\r\n\t\t} catch (IOException e) {\t\t\t\t\r\n\t\t\tSystem.err.println(\"ERROR: Cannot open WordNet library. Please check the WordNet's Path.\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void readWordNetDomain16(String filePath) {\n WordNetDomainsParser parser = new WordNetDomainsParser();\n System.out.println(\"DOMAIN filePath = \" + filePath);\n parser.readWnDomainFile(filePath);\n pwn16domains = parser.WORDNETDOMAINS;\n }", "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 static void main(String[] args) {\n\t\tif (args.length != 3) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Please enter: ngramSize, inputFile, outputFile\");\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tint ngramSize = Integer.parseInt(args[0]);\n\t\t\tString inFile = args[1];\n\t\t\tString outFile = args[2];\n\n\t\t\tBerkeleyKNLanguageModel.makeKneserNeyBinaryFromText(ngramSize,\n\t\t\t\t\tinFile, outFile);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void addContentHMetisInFilePath() {\n\t\tPTNetlist ptNetlist = this.getNetlister().getPTNetlist();\n\t\tString newline = System.lineSeparator();\n\t\tMap<PTNetlistNode, Integer> vertexIntegerMap = this.getVertexIntegerMap();\n\t\tList<String> fileContent = new ArrayList<String>();\n\t\t// vertices\n\t\tPTNetlistNode src = null;\n\t\tPTNetlistNode dst = null;\n\t\tInteger srcInteger = null;\n\t\tInteger dstInteger = null;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < ptNetlist.getNumEdge(); i++){\n\t\t\tPTNetlistEdge edge = ptNetlist.getEdgeAtIdx(i);\n\t\t\tif (PTNetlistEdgeUtils.isEdgeConnectedToPrimary(edge)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttemp ++;\n\t\t\tsrc = edge.getSrc();\n\t\t\tdst = edge.getDst();\n\t\t\tsrcInteger = vertexIntegerMap.get(src);\n\t\t\tdstInteger = vertexIntegerMap.get(dst);\n\t\t\tfileContent.add(srcInteger + \" \" + dstInteger + newline);\n\t\t}\n\t\ttry {\n\t\t\tOutputStream outputStream = new FileOutputStream(this.getHMetisInFile());\n\t\t\tWriter outputStreamWriter = new OutputStreamWriter(outputStream);\n\t\t\t// Format of Hypergraph Input File\n\t\t\t// header lines are: [number of edges] [number of vertices] \n\t\t\t//\t\tsubsequent lines give each edge, one edge per line\n\t\t\toutputStreamWriter.write(temp + \" \" + vertexIntegerMap.size() + newline);\n\t\t\tfor (int i = 0; i < fileContent.size(); i++) {\n\t\t\t\toutputStreamWriter.write(fileContent.get(i));\n\t\t\t}\t\t\t\n\t\t\toutputStreamWriter.close();\n\t\t\toutputStream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void init(Simulation simulation) {\n // create RDF model\n model = ModelFactory.createDefaultModel();\n provOutputFileURI = simulation.getProvLocation()\n .resolve(simulation.getName() + \".ttl\").toString();\n // set prefixes for...\n // RDF syntax\n model.setNsPrefix(\"rdf\", ProvOntology.getRDFNameSpaceURI());\n // RDF schema\n model.setNsPrefix(\"rdfs\", ProvOntology.getRDFSNameSpaceURI());\n // w3 Prov Ontology\n model.setNsPrefix(\"prov\", ProvOntology.getPROVNameSpaceURI());\n // XML schema\n model.setNsPrefix(\"xsd\", ProvOntology.getXSDNameSpaceURI());\n localNameSpaceURI = getLocalNameSpaceURI();\n // Graphitti Prov\n model.setNsPrefix(LOCAL_NS_PREFIX, localNameSpaceURI);\n }", "public NetworkLoader(GraphDatabaseService neo, String filename) {\r\n initialize(\"Network\", neo, filename, null);\r\n initializeKnownHeaders();\r\n luceneInd = NeoServiceProviderUi.getProvider().getIndexService();\r\n addNetworkIndexes();\r\n }", "public static void main(String[] args) {\r\n int argc = args.length;\r\n\r\n // Given only the words file\r\n if(argc == 2 && args[0].charAt(0) == '-' && args[0].charAt(1) == 'i'){\r\n String fileName = args[1];\r\n int size = 1;\r\n ArrayList<String> wordList = new ArrayList<String>();\r\n\r\n // Get data from file\r\n ArrayList<String> dataList = new ArrayList<String>();\t\r\n try {\r\n File myObj = new File(fileName);\r\n Scanner myReader = new Scanner(myObj);\r\n while (myReader.hasNextLine()) {\r\n String data = myReader.nextLine(); \r\n dataList.add(data);\r\n }\r\n myReader.close();\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"An error occurred.\");\r\n e.printStackTrace();\r\n }\r\n\r\n // Get words from data \r\n for(int s = 0 ; s < dataList.size() ; s++) {\r\n String[] arrOfStr = dataList.get(s).split(\"[,\\\\;\\\\ ]\");\t// check same line words\r\n for(int i = 0 ; i < arrOfStr.length ; i++) {\r\n if(arrOfStr[i].equals(arrOfStr[i].toUpperCase())){\r\n System.out.println(\"Words not only in lowercase or mixed\");\r\n //termina o programa\r\n return;\r\n }\r\n if(!(arrOfStr[i].matches(\"[a-zA-Z]+\"))){\r\n System.out.println(\"Words have non alpha values\");\r\n //termina o programa\r\n return;\r\n }\r\n if(arrOfStr[i].length() > size) size = arrOfStr[i].length();\r\n wordList.add(arrOfStr[i].toUpperCase());\t// add words discovered and turn upper case\r\n }\r\n }\r\n if(wordList.size() > size) size = wordList.size();\r\n char[][] wordSoup = wsGen( wordList, size + 2);\r\n saveData(dataList,wordSoup);\r\n return;\r\n }\r\n\r\n // Given all args\r\n if(argc == 4 && args[0].charAt(0) == '-' && args[0].charAt(1) == 'i' && args[2].charAt(0) == '-' && args[2].charAt(1) == 's'){\r\n String fileName = args[1];\r\n int size = Integer.parseInt(args[3]);\r\n // Check max size\r\n if(size > 40){\r\n System.out.print(\"Max size 40\");\r\n return;\r\n }\r\n\r\n ArrayList<String> wordList = new ArrayList<String>();\r\n\r\n // Get data from file\r\n ArrayList<String> dataList = new ArrayList<String>();\t\r\n try {\r\n File myObj = new File(fileName);\r\n Scanner myReader = new Scanner(myObj);\r\n while (myReader.hasNextLine()) {\r\n String data = myReader.nextLine(); \r\n dataList.add(data);\r\n }\r\n myReader.close();\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"An error occurred.\");\r\n e.printStackTrace();\r\n }\r\n\r\n // Get words from data \r\n for(int s = 0 ; s < dataList.size() ; s++) {\r\n String[] arrOfStr = dataList.get(s).split(\"[,\\\\;\\\\ ]\");\t// check same line words\r\n for(int i = 0 ; i < arrOfStr.length ; i++) {\r\n if(arrOfStr[i].equals(arrOfStr[i].toUpperCase())){\r\n System.out.println(\"Words not only in lowercase or mixed\");\r\n //termina o programa\r\n return;\r\n }\r\n if(!(arrOfStr[i].matches(\"[a-zA-Z]+\"))){\r\n System.out.println(\"Words have non alpha values\");\r\n //termina o programa\r\n return;\r\n }\r\n if(arrOfStr[i].length() > size){\r\n System.out.println(\"At least one word given doesn't fit in the size provided.\");\r\n return;\r\n }\r\n wordList.add(arrOfStr[i].toUpperCase());\t// add words discovered and turn upper case\r\n }\r\n }\r\n char[][] wordSoup = wsGen( wordList, size);\r\n saveData(dataList,wordSoup);\r\n return;\r\n }\r\n // Help message\r\n System.out.println(\"usage: -i file # gives file with word soup words\");\r\n System.out.println(\" -s size # gives size for the word soup\");\r\n return;\r\n }", "protected GrammarNode createGrammar() throws IOException {\n languageModel.allocate();\n Timer.start(\"LMGrammar.create\");\n GrammarNode firstNode = null;\n if (languageModel.getMaxDepth() > 2) {\n System.out.println(\"Warning: LMGrammar limited to bigrams\");\n }\n int identity = 0;\n List nodes = new ArrayList();\n Set words = languageModel.getVocabulary();\n // create all of the word nodes\n for (Iterator i = words.iterator(); i.hasNext();) {\n String word = (String) i.next();\n GrammarNode node = createGrammarNode(identity++, word);\n if (node != null && !node.isEmpty()) {\n if (node.getWord().equals(\n getDictionary().getSentenceStartWord())) {\n firstNode = node;\n } else if (node.getWord().equals(\n getDictionary().getSentenceEndWord())) {\n node.setFinalNode(true);\n }\n nodes.add(node);\n }\n }\n if (firstNode == null) {\n throw new Error(\"No sentence start found in language model\");\n }\n for (Iterator i = nodes.iterator(); i.hasNext();) {\n GrammarNode prevNode = (GrammarNode) i.next();\n // don't add any branches out of the final node\n if (prevNode.isFinalNode()) {\n continue;\n }\n for (Iterator j = nodes.iterator(); j.hasNext();) {\n GrammarNode nextNode = (GrammarNode) j.next();\n String prevWord = prevNode.getWord().getSpelling();\n String nextWord = nextNode.getWord().getSpelling();\n Word[] wordArray = {getDictionary().getWord(prevWord),\n getDictionary().getWord(nextWord)};\n float logProbability = languageModel\n .getProbability(WordSequence.getWordSequence(wordArray));\n prevNode.add(nextNode, logProbability);\n }\n }\n Timer.stop(\"LMGrammar.create\");\n languageModel.deallocate();\n return firstNode;\n }", "public void newFileCreated(OpenDefinitionsDocument doc) { }", "public void newFileCreated(OpenDefinitionsDocument doc) { }", "private static void addAllSynset(ArrayList<String> synsets, String chw, IDictionary dictionary) {\n\t\tWordnetStemmer stemmer = new WordnetStemmer(dictionary);\n\t\tchw = stemmer.findStems(chw, POS.NOUN).size()==0?chw:stemmer.findStems(chw, POS.NOUN).get(0);\n\t\t\n\t\tIIndexWord indexWord = dictionary.getIndexWord(chw, POS.NOUN);\n\t\tList<IWordID> sensesID = indexWord.getWordIDs();\n\t\tList<ISynsetID> relaWordID = new ArrayList<ISynsetID>();\n\t\tList<IWord> words;\n\t\t\n\t\tfor(IWordID set : sensesID) {\n\t\t\tIWord word = dictionary.getWord(set);\n\t\t\t\n\t\t\t//Add Synonym\n\t\t\trelaWordID.add(word.getSynset().getID());\n\n\t\t\t//Add Antonym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.ANTONYM));\n\t\t\t\n\t\t\t//Add Meronym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_MEMBER));\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_PART));\n\t\t\t\n\t\t\t//Add Hypernym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPERNYM));\n\t\t\t\n\t\t\t//Add Hyponym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPONYM));\n\t\t}\n\t\t\n\t\tfor(ISynsetID sid : relaWordID) {\n\t\t\twords = dictionary.getSynset(sid).getWords();\n\t\t\tfor(Iterator<IWord> i = words.iterator(); i.hasNext();) {\n\t\t\t\tsynsets.add(i.next().getLemma());\n\t\t\t}\n\t\t}\n\t}", "public void makeIndex(String docsFile, String noiseWordsFile)\n throws FileNotFoundException {\n // load noise words to hash table\n Scanner sc = new Scanner(new File(noiseWordsFile));\n while (sc.hasNext()) {\n String word = sc.next();\n noiseWords.put(word, word);\n }\n\n // index all keywords\n sc = new Scanner(new File(docsFile));\n while (sc.hasNext()) {\n String docFile = sc.next();\n HashMap<String, Occurrence> kws = loadKeyWords(docFile);\n mergeKeyWords(kws);\n }\n\n }", "public void makeIndex(String docsFile, String noiseWordsFile) \n\tthrows FileNotFoundException {\n\t\t// load noise words to hash table\n\t\tScanner sc = new Scanner(new File(noiseWordsFile));\n\t\twhile (sc.hasNext()) {\n\t\t\tString word = sc.next();\n\t\t\tnoiseWords.add(word);}\n\t\t// index all keywords\n\t\tsc = new Scanner(new File(docsFile));\n\t\twhile (sc.hasNext()) {\n\t\t\tString docFile = sc.next();\n\t\t\tHashMap<String,Occurrence> kws = loadKeywordsFromDocument(docFile);\n\t\t\tmergeKeywords(kws);}\n\t\tsc.close();\n\t}", "public void createTrainingData(String dirName, String processName, int fold, ArrayList<FoldInstance> instances) throws FileNotFoundException {\n PrintWriter writer = new PrintWriter(dirName + \"/\" + processName + \".jointtrain.cv.\" + fold);\n for (int i = 0; i < instances.size(); i++) {\n FoldInstance inst = instances.get(i);\n if (inst.getName().equalsIgnoreCase(processName)) {\n if (inst.getFold() == fold) {\n writer.println(inst.getSentences());\n writer.flush();\n }\n } else {\n writer.println(inst.getSentences());\n writer.flush();\n }\n\n }\n writer.close();\n }", "public static void main(String[] args) throws ParserConfigurationException, TransformerException, IOException {\n\t\tString[] nomeid={\"primo\",\"secondo\",\"terzo\",\"quarto\",\"quinto\",\"sesto\",\"settimo\",\"ottavo\",\"nono\",\"decimo\",\"undicesimo\",\"dodicesimo\",\"tredicesimo\",\"quattordicesimo\",\"quindicesimo\",\"sedicesimo\",\"diciassettesimo\",\"diciottesimo\",\"diciannovesimo\"};\r\n\r\n\t\t\r\n\t\t\r\n\t//for(int j=0;j<19;j++){\t\r\n\t\t\r\n\t\t//int nomefile=j+1;\r\n\t\tFile f=new File(\"C:\\\\Users\\\\Windows\\\\Desktop\\\\corpus\\\\corpus artigianale\\\\corpus2.xml\");\r\n\t\tString content = readFile(\"C:\\\\Users\\\\Windows\\\\Desktop\\\\corpus\\\\corpus artigianale\\\\corpus2.txt\", StandardCharsets.UTF_8);\t\r\n\t\tString[] frase=content.split(\"\\\\.\");\r\n\t\tString nome=nomeid[4];\t\r\n\t\t\t\r\n\t\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\r\n\t \r\n\t\t\t// root elements\r\n\t\t\tDocument doc = docBuilder.newDocument();\r\n\t\t\tElement rootElement = doc.createElement(\"add\");\r\n\t\t\tdoc.appendChild(rootElement);\r\n\t\t\t\r\n\t\t\r\n\t\t\tint count=0;\r\n\t\t\t\r\n\t\t\tfor (int i=0;i<frase.length;i++){\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//if(frase[i].length()>150)\r\n\t\t\t\t//{// doc elements\r\n\t\t\t\t\tElement documento = doc.createElement(\"doc\");\r\n\t\t\t\t\trootElement.appendChild(documento);\r\n\t\t\t\t\r\n\t\t\t\t// id elements\r\n\t\t\t\t\t\tElement id = doc.createElement(\"field\");\r\n\t\t\t\t\t\tid.setAttribute(\"name\",\"id\");\r\n\t\t\t\t\t\tid.appendChild(doc.createTextNode(nome+i));\r\n\t\t\t\t\t\tdocumento.appendChild(id);\r\n\t\t\t\t//name element\r\n\t\t\t\t\t\tElement name = doc.createElement(\"field\");\r\n\t\t\t\t\t\tname.setAttribute(\"name\", \"name\");\r\n\t\t\t\t\t\tname.appendChild(doc.createTextNode(frase[i]));\r\n\t\t\t\t\t\tdocumento.appendChild(name);\r\n\t\t\t\t count++;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(count);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// write the content into xml file\r\n\t\t\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\r\n\t\t\t\t\tTransformer transformer = transformerFactory.newTransformer();\r\n\t\t\t\t\tDOMSource source = new DOMSource(doc);\r\n\t\t\t\t\tStreamResult result = new StreamResult(f);\r\n\t\t\t \r\n\t\t\t\t\t// Output to console for testing\r\n\t\t\t\t\t// StreamResult result = new StreamResult(System.out);\r\n\t\t\t \r\n\t\t\t\t\ttransformer.transform(source, result);\r\n\t\t\t \r\n\t\t\t\t\tSystem.out.println(\"File saved!\");\r\n\t\t\r\n\t //}\r\n\t\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\n BufferedReader reader = new BufferedReader(new FileReader(\"src/main/resources/example/ontologytemp.owl\"));\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"src/main/resources/example/test.owl\"));\n\t\t\n\t\t\n\t\t/*File owl = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology5.owl\");\n File obda = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology-conf.obda\");\n\t\tString baseUri = \"http://www.semanticweb.org/user/ontologies/\";\n\t\tString jdbcUrl = \"jdbc:mysql://localhost/conference10\";\n\t\tString jdbcUserName = \"root\";\n\t\tString jdbcPassword = \"root\";\n\t\tString jdbcDriverClass = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\tDirectMappingBootstrapper dm = new DirectMappingBootstrapper(baseUri, jdbcUrl, jdbcUserName, jdbcPassword, jdbcDriverClass);\n\t\tOBDAModel model = dm.getModel();\n\t\tOWLOntology onto = dm.getOntology();\n\t\tModelIOManager mng = new ModelIOManager(model);\n\t\tmng.save(obda);\n onto.getOWLOntologyManager().saveOntology(onto,\n new FileDocumentTarget(owl));*/\n\t\t\n\t\t\n\t\t/*\n\t\tXFactoryBufferedImpl factory = new XFactoryBufferedImpl();\t\n\t\t\n\t\tXAttribute attr = factory.createAttributeLiteral(\"concept:name\", \"tracevalue\", null); // create attribute for trace\n\t\tXAttributeMap attrMapTrace = new XAttributeMapImpl(); // create a new map attribute\n\t\tattrMapTrace.put(\"concept:name\", attr);\t// put attribute to the map attribute\n\t\tXTrace xtrace = factory.createTrace(attrMapTrace); // create xtrace\n\t\t\n\t\tXAttributeMap attrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent = factory.createEvent(attrMap); // create xevent\n\t\txtrace.insertOrdered(xevent); // insert event in correct order in a trace\n\t\t\n\t\tattrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent2 = factory.createEvent(attrMap); // create xevent\n\t\t\n\t\tSystem.out.println(xtrace.contains(xevent2));\n\t\t*/\n\t}", "public void makeIndex(String docsFile, String noiseWordsFile) \n\tthrows FileNotFoundException {\n\t\t// load noise words to hash table\n\t\tScanner sc = new Scanner(new File(noiseWordsFile));\n\t\twhile (sc.hasNext()) {\n\t\t\tString word = sc.next();\n\t\t\tnoiseWords.add(word);\n\t\t}\n\t\t\n\t\t// index all keywords\n\t\tsc = new Scanner(new File(docsFile));\n\t\twhile (sc.hasNext()) {\n\t\t\tString docFile = sc.next();\n\t\t\tHashMap<String,Occurrence> kws = loadKeywordsFromDocument(docFile);\n\t\t\tmergeKeywords(kws);\n\t\t}\n\t\tsc.close();\n\t}", "private void createOntologyResources(String conceptName, String conditionName, \r\n\t\t\t\t\t\t\t\t\t\tVector<String> syndromeSensDefNames, Vector<String> syndromeSpecDefNames, \r\n\t\t\t\t\t\t\t\t\t\tString relation, String inclusionKeywords, String exclusionKeywords, \r\n\t\t\t\t\t\t\t\t\t\tVector<Coding> codes) throws Exception{\n\t\tOWLDatatypeProperty codeIDProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODE_ID);\r\n\t\tOWLDatatypeProperty codeTitleProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODE_TITLE);\r\n\t\tOWLDatatypeProperty codingSystemProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODESYSTEM_NAME);\r\n\t\tOWLDatatypeProperty nameProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_HAS_NAME);\r\n\t\tOWLObjectProperty externalCodingsProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_EXTERNAL_CODES);\r\n\r\n\t\tOWLNamedClass newConcept = null;\r\n\t\tif (conceptName == null) {\r\n\t\t\t// We need to have at least one concept associated with a condition (exact concept),\r\n\t\t\t// so if there isn't one, we need to create it.\r\n\t\t\tSystem.out.println(\"WARNING: Missing concept for condition \" + conditionName + \". A concept with the same name will be created.\");\r\n\r\n\t\t\tconceptName = conditionName.toLowerCase();\r\n\t\t\trelation = \"concept name\";\r\n\t\r\n\t\t\t// check if such concept already exists:\r\n\t\t\tnewConcept = owlModel.getOWLNamedClass(conceptName.replace(' ', '_'));\r\n\t\t}\r\n\t\t\r\n\t\tif (newConcept == null) {\r\n\t\t\t\r\n\t\t\t// 1. Create new subclass(instance) of Concept:\r\n\t\t\tOWLNamedClass conceptClass = owlModel.getOWLNamedClass(Constants.CLASS_CONCEPT);\r\n\t\t\tOWLNamedClass conceptMetaClass = owlModel.getOWLNamedClass(Constants.METACLASS_CONCEPT);\r\n\t\t\tnewConcept = (OWLNamedClass) conceptMetaClass.createInstance(conceptName.replace(' ', '_'));\r\n\t\t\tnewConcept.addSuperclass(conceptClass);\r\n\t\t\tnewConcept.removeSuperclass(owlModel.getOWLThingClass());\r\n\t\t\tnewConcept.setPropertyValue(nameProperty, conceptName);\r\n\t\t\t\r\n\t\t\t// 2. Add external codes:\r\n\t\t\tCoding c = null;\r\n\t\t\tString codeName = null;\r\n\t\t\tOWLIndividual code = null;\r\n\t\t\tOWLNamedClass codeClass = null;\r\n\r\n\t\t\tfor (int i=0; i<codes.size(); i++){\r\n\t\t\t\tc = codes.get(i);\r\n\t\t\t\tcodeName = c.system + \"_\" + c.codeID.trim().replace(' ', '_');\r\n\t\t\t\tcode = owlModel.getOWLIndividual(codeName);\r\n\t\t\t\tif (code == null) {\r\n\t\t\t\t\tcodeClass = owlModel.getOWLNamedClass(c.system);\r\n\t\t\t\t\tcode = codeClass.createOWLIndividual(codeName);\r\n\t\t\t\t\tcode.setPropertyValue(codingSystemProperty, c.system);\r\n\t\t\t\t\tcode.setPropertyValue(codeIDProperty, c.codeID);\r\n\t\t\t\t\tif (c.codeTitle != null) code.setPropertyValue(codeTitleProperty, c.codeTitle);\r\n\t\t\t\t}\r\n\t\t\t\tnewConcept.addPropertyValue(externalCodingsProperty, code);\r\n\t\t\t}\r\n\r\n\t\t\t// 3. Process keywords:\r\n\t\t\tprocessKeywordString(inclusionKeywords, newConcept, Constants.PROPERTY_HAS_INCLUSION_KEYWORDS);\r\n\t\t\tprocessKeywordString(exclusionKeywords, newConcept, Constants.PROPERTY_HAS_EXCLUSION_KEYWORDS);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"WARNING: Non-unique concept '\" + conceptName + \"' resulting from artificially creating an exact concept for a condition that did not have any associated concepts listed.\");\r\n\t\t}\r\n\t\t \t\t\r\n\t\t// 4. Check if ClinicalCondition exists, if not, create new subclass:\r\n\t\tOWLNamedClass conditionClass = owlModel.getOWLNamedClass(Constants.CLASS_CONDITION);\r\n\t\tOWLNamedClass conditionMetaClass = owlModel.getOWLNamedClass(Constants.METACLASS_CONDITION);\r\n\t\tOWLNamedClass condition = owlModel.getOWLNamedClass(conditionName.replace(' ', '_'));\r\n\r\n\t\tif (condition == null) {\r\n\t\t\tcondition = (OWLNamedClass) conditionMetaClass.createInstance(conditionName.replace(' ', '_'));\r\n\t\t\tcondition.addSuperclass(conditionClass);\r\n\t\t\tcondition.removeSuperclass(owlModel.getOWLThingClass());\r\n\t\t\tcondition.setPropertyValue(nameProperty, conditionName);\r\n\t\t\t\r\n\t\t\t// 5. Add new condition to syndrome definition(s):\r\n\t\t\tOWLObjectProperty sensitiveDefinitionProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SENSITIVE_DEFINITION);\r\n\t\t\tOWLObjectProperty specificDefinitionProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SPECIFIC_DEFINITION);\r\n\t\t\tOWLNamedClass syndromeSens = null; \r\n\t\t\tOWLNamedClass syndromeSpec = null; \r\n\t\t\tif (syndromeSensDefNames != null && syndromeSensDefNames.size() > 0) {\r\n\t\t\t\tfor (int i=0; i<syndromeSensDefNames.size(); i++){\r\n\t\t\t\t\tsyndromeSens = owlModel.getOWLNamedClass(syndromeSensDefNames.get(i));\r\n\t\t\t\t\tsyndromeSens.addPropertyValue(sensitiveDefinitionProperty, condition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (syndromeSpecDefNames != null && syndromeSpecDefNames.size() > 0) {\r\n\t\t\t\tfor (int i=0; i<syndromeSpecDefNames.size(); i++){\r\n\t\t\t\t\tsyndromeSpec = owlModel.getOWLNamedClass(syndromeSpecDefNames.get(i));\r\n\t\t\t\t\tsyndromeSpec.addPropertyValue(specificDefinitionProperty, condition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 6. Add Concept to one of the slots of ClinicalCondition\r\n\t\tOWLObjectProperty p = null;\r\n\t\tif (relation.equalsIgnoreCase(\"concept name\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_EXACT_CONCEPT);\r\n\t\t} \r\n\t\telse if (relation.substring(0, 7).equalsIgnoreCase(\"related\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_RELATED_CONCEPTS);\r\n\t\t} \r\n\t\telse if (relation.equalsIgnoreCase(\"synonym\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SYNONYMOUS_CONCEPTS);\r\n\t\t}\r\n\t\telse throw new Exception(\"Cannot determine the relation of a concept to clinical condition! Relation specified is '\" + relation + \"'.\");\r\n\t\tcondition.addPropertyValue(p, newConcept);\r\n\t}", "public void makeCustomChallengesFile() {\n customChallengeData = new File(wnwData, \"custom_challenges.dat\");\n try {\n customChallengeData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n makeSessionFile();\n }", "private void createDOCDocument(String from, File file) throws Exception {\n\t\tPOIFSFileSystem fs = new POIFSFileSystem(Thread.currentThread().getClass().getResourceAsStream(\"/poi/template.doc\"));\n\t\tHWPFDocument doc = new HWPFDocument(fs);\n\t\n\t\tRange range = doc.getRange();\n\t\tParagraph par1 = range.getParagraph(0);\n\t\n\t\tCharacterRun run1 = par1.insertBefore(from, new CharacterProperties());\n\t\trun1.setFontSize(11);\n\t\tdoc.write(new FileOutputStream(file));\n\t}", "private void createNeuralNet() {\n\t\tMSimulationConfig simConfig;\n\t\tHashMap<Integer, MNeuron> neuronMap = new HashMap<Integer, MNeuron>();\n\t\tArrayList<MNeuron> neurons = new ArrayList<MNeuron>();\n\t\tArrayList<MSynapse> synapses = new ArrayList<MSynapse>();\n\n\t\tNeatGenome genome = (NeatGenome) geneticObject;\n\t\t/* Create neurons. */\n\t\tfor (NeatNode nn : genome.getNodes()) {\n\t\t\tint id = nn.getId();\n\t\t\tMNeuronParams params = nn.getParams();\n\t\t\tMNeuronState state =\n\t\t\t\t\tMFactory.createInitialRSNeuronState();\n\n\t\t\t/* Create a neuron. */\n\t\t\tMNeuron neuron = new MNeuron(params, state, id);\n\n\t\t\t/* Add it to temporary NID->Neuron map. */\n\t\t\tneuronMap.put(id, neuron);\n\n\t\t\t/* Add neuron to the list. */\n\t\t\tneurons.add(neuron);\n\t\t}\n\n\t\t/* Create synapses. */\n\t\tfor (GenomeEdge<NeatNode> g : genome.getGene()) {\n\t\t\t/* Get the synapse information. */\n\t\t\tNeatNode preNode = g.getIn();\n\t\t\tNeatNode postNode = g.getOut();\n\t\t\tdouble weight = g.getWeight();\n\t\t\tint delay = g.getDelay();\n\t\t\tInteger preNid = new Integer(preNode.getId());\n\t\t\tInteger postNid = new Integer(postNode.getId());\n\n\t\t\t/* Find the pre and post neurons. */\n\t\t\tMNeuron preNeuron = neuronMap.get(preNid);\n\t\t\tMNeuron postNeuron = neuronMap.get(postNid);\n\n\t\t\t/* Create the synapse. */\n\t\t\tMSynapse synapse = new MSynapse(preNeuron, postNeuron,\n\t\t\t\t\tweight, delay);\n\t\t\t/*\n\t\t\tAdd the synapse to the pre and post neuron synapse list\n\t\t\t */\n\t\t\tArrayList<MSynapse> postSynapses\n\t\t\t= preNeuron.getPostSynapses();\n\t\t\tArrayList<MSynapse> preSynapses\n\t\t\t= postNeuron.getPreSynapses();\n\n\t\t\tpostSynapses.add(synapse);\n\t\t\tpreSynapses.add(synapse);\n\n\t\t\tpreNeuron.setPostSynapses(postSynapses);\n\t\t\tpostNeuron.setPreSynapses(preSynapses);\n\n\t\t\t/* Add the synapse to the list. */\n\t\t\tsynapses.add(synapse);\n\t\t}\n\n\t\t/* Create the network. */\n\t\tthis.mnetwork = new MNetwork(neurons, synapses);\n\n\t\t/* Create and set the simulation configuration parameters. */\n\t\tsimConfig = new MSimulationConfig(20);\n\n\t\t/* Create the simulation instance with our network. */\n\t\tthis.msimulation = new MSimulation(this.mnetwork, simConfig);\n\t}", "public void makeWord(String inputText,String pageId,createIndex createindex,String contentType)\n {\n int length,i;\n char c;\n boolean linkFound=false;\n int count1,count2,count3,count4,count5,count6,count7,count8,count9;\n\n\n\n StringBuilder word=new StringBuilder();\n // String finalWord=null,stemmedWord=null;\n docId=Integer.parseInt(pageId.trim());\n\n ci=createindex;\n // Stemmer st=new Stemmer();\n //createIndex createindex=new createIndex();\n\n length=inputText.length();\n\n for(i=0;i<length;i++)\n {\n c=inputText.charAt(i);\n if(c<123 && c>96)\n {\n word.append(c);\n }\n\n else if(c=='{')\n {\n if ( i+9 < length && inputText.substring(i+1,i+9).equals(\"{infobox\") )\n {\n\n StringBuilder infoboxString = new StringBuilder();\n\n count1 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n infoboxString.append(c);\n if ( c == '{') {\n count1++;\n }\n else if ( c == '}') {\n count1--;\n }\n if ( count1 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {infoboxString.deleteCharAt(infoboxString.length()-1);}\n break;\n }\n }\n\n processInfobox(infoboxString);\n\n }\n\n else if ( i+8 < length && inputText.substring(i+1,i+8).equals(\"{geobox\") )\n {\n\n StringBuilder geoboxString = new StringBuilder();\n\n count2 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n geoboxString.append(c);\n if ( c == '{') {\n count2++;\n }\n else if ( c == '}') {\n count2--;\n }\n if ( count2 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {geoboxString.deleteCharAt(geoboxString.length()-1);}\n break;\n }\n }\n\n // processGeobox(geoboxString);\n }\n\n else if ( i+6 < length && inputText.substring(i+1,i+6).equals(\"{cite\") )\n {\n\n /*\n * Citations are to be removed.\n */\n\n count3 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '{') {\n count3++;\n }\n else if ( c == '}') {\n count3--;\n }\n if ( count3 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n else if ( i+4 < length && inputText.substring(i+1,i+4).equals(\"{gr\") )\n {\n\n /*\n * {{GR .. to be removed\n */\n\n count4 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '{') {\n count4++;\n }\n else if ( c == '}') {\n count4--;\n }\n if ( count4 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n else if ( i+7 < length && inputText.substring(i+1,i+7).equals(\"{coord\") )\n {\n\n /**\n * Coords to be removed\n */\n\n count5 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n\n if ( c == '{') {\n count5++;\n }\n else if ( c == '}') {\n count5--;\n }\n if ( count5 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n //System.out.println(\"process infobox\");\n }\n else if(c=='[')\n {\n // System.out.println(\"process square brace\");\n\n if ( i+11 < length && inputText.substring(i+1,i+11).equalsIgnoreCase(\"[category:\"))\n {\n\n StringBuilder categoryString = new StringBuilder();\n\n count6 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n categoryString.append(c);\n if ( c == '[') {\n count6++;\n }\n else if ( c == ']') {\n count6--;\n }\n if ( count6 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n if ( c == '=' ) {categoryString.deleteCharAt(categoryString.length()-1);}\n break;\n }\n }\n\n // System.out.println(\"category string=\"+categoryString.toString());\n processCategories(categoryString);\n\n }\n else if ( i+8 < length && inputText.substring(i+1,i+8).equalsIgnoreCase(\"[image:\") ) {\n\n /**\n * Images to be removed\n */\n\n count7 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n if ( c == '[') {\n count7++;\n }\n else if ( c == ']') {\n count7--;\n }\n if ( count7 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n else if ( i+7 < length && inputText.substring(i+1,i+7).equalsIgnoreCase(\"[file:\") ) {\n\n /**\n * File to be removed\n */\n\n count8 = 0;\n for ( ; i < length ; i++ ) {\n\n c = inputText.charAt(i);\n\n if ( c == '[') {\n count8++;\n }\n else if ( c == ']') {\n count8--;\n }\n if ( count8 == 0 || (c == '=' && i+1 < length && inputText.charAt(i+1) == '=')) {\n break;\n }\n }\n\n }\n\n }\n else if(c=='<')\n {\n //System.out.println(\"Process < >\");\n\n if ( i+4 < length && inputText.substring(i+1,i+4).equalsIgnoreCase(\"!--\") ) {\n\n /**\n * Comments to be removed\n */\n\n int locationClose = inputText.indexOf(\"-->\" , i+1);\n if ( locationClose == -1 || locationClose+2 > length ) {\n i = length-1;\n }\n else {\n i = locationClose+2;\n }\n\n }\n else if ( i+5 < length && inputText.substring(i+1,i+5).equalsIgnoreCase(\"ref>\") ) {\n\n /**\n * References to be removed\n */\n int locationClose = inputText.indexOf(\"</ref>\" , i+1);\n if ( locationClose == -1 || locationClose+5 > length ) {\n i = length-1;\n }\n else {\n i = locationClose+5;\n }\n\n }\n else if ( i+8 < length && inputText.substring(i+1,i+8).equalsIgnoreCase(\"gallery\") ) {\n\n /**\n * Gallery to be removed\n */\n int locationClose = inputText.indexOf(\"</gallery>\" , i+1);\n if ( locationClose == -1 || locationClose+9 > length) {\n i = length-1;\n }\n else {\n i = locationClose+9;\n }\n }\n\n }\n else if ( c == '=' && i+1 < length && inputText.charAt(i+1) == '=')\n {\n\n linkFound = false;\n i+=2;\n while ( i < length && ((c = inputText.charAt(i)) == ' ' || (c = inputText.charAt(i)) == '\\t') )\n {\n i++;\n }\n\n if ( i+14 < length && inputText.substring(i , i+14 ).equals(\"external links\") )\n {\n //System.out.println(\"External link found\");\n linkFound = true;\n i+= 14;\n }\n\n }\n else if ( c == '*' && linkFound == true )\n {\n\n //System.out.println(\"Link found\");\n count9 = 0;\n boolean spaceParsed = false;\n StringBuilder link = new StringBuilder();\n while ( count9 != 2 && i < length )\n {\n c = inputText.charAt(i);\n if ( c == '[' || c == ']' )\n {\n count9++;\n }\n if ( count9 == 1 && spaceParsed == true)\n {\n link.append(c);\n }\n else if ( count9 != 0 && spaceParsed == false && c == ' ')\n {\n spaceParsed = true;\n }\n i++;\n }\n\n StringBuilder linkWord = new StringBuilder();\n for ( int j = 0 ; j < link.length() ; j++ )\n {\n char currentCharTemp = link.charAt(j);\n if ( (int)currentCharTemp >= 'a' && (int)currentCharTemp <= 'z' )\n {\n linkWord.append(currentCharTemp);\n }\n else\n {\n\n // System.out.println(\"link : \" + linkWord.toString());\n processLink(linkWord);\n linkWord.setLength(0);\n }\n }\n if ( linkWord.length() > 1 )\n {\n //System.out.println(\"link : \" + linkWord.toString());\n processLink(linkWord);\n linkWord.setLength(0);\n }\n\n }\n else\n {\n if(word.length()>1)\n filterAndAddWord(word,contentType);\n\n word.setLength(0);\n }\n }\n\n\n if(word.length()>1)\n filterAndAddWord(word,contentType);\n\n word.setLength(0);\n /*\n if(word.length()>0)\n {\n finalWord=new String(word);\n if(!(checkStopword(finalWord)))\n {\n st.add(finalWord.toCharArray(),finalWord.length());\n stemmedWord=st.stem();\n\n createindex.addToTreeSet(stemmedWord,docId);\n\n }\n\n word.delete(0, word.length());\n } */\n\n }", "private void openNlpSentSplitter(String source) throws InvalidFormatException, IOException {\n\t\tString paragraph = \"Hi. How are you? This is Mike. This is Elvis A. A cat in the hat. The type strain is KOPRI 21160T (= KCTC 23670T= JCM 18092T), isolated from a soil sample collected near the King Sejong Station on King George Island, Antarctica. The DNA G+ C content of the type strain is 30.0 mol%.\";\r\n\r\n\t\tInputStream modelIn = new FileInputStream(source);\r\n\r\n\t\ttry {\r\n\t\t // SentenceModel model = new SentenceModel(modelIn);\r\n\t\t\t// InputStream is = new FileInputStream(myConfiguration.getOpenNLPTokenizerDir());\r\n\t\t\t\r\n\t\t\tSentenceModel model = new SentenceModel(modelIn);\r\n\t\t\tSentenceDetectorME sdetector = new SentenceDetectorME(model);\r\n\t\t\tString sentences[] = sdetector.sentDetect(paragraph);\r\n\t\t\tfor ( int i = 0; i < sentences.length; i++ ) {\r\n\t\t\t\tSystem.out.println(sentences[i]);\r\n\t\t\t}\r\n\t\t\tmodelIn.close();\t\t \r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t if (modelIn != null) {\r\n\t\t try {\r\n\t\t modelIn.close();\r\n\t\t }\r\n\t\t catch (IOException e) {\r\n\t\t }\r\n\t\t }\r\n\t\t}\r\n\t}", "static TreeSet<Noun> parse3rdNouns(Scanner data){\n\n\t\tint declension = 3;\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\t\t\ttry{\n\t\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD;\n\t\t\t\t\t//System.out.println(\"No i-stem\");\n\t\t\t\t} catch(NumberFormatException e){ //I-Stem.\n\t\t\t\t\tchapter = Integer.parseInt(current[0].substring(0, 2));\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD_I;\n\t\t\t\t\t//System.out.println(\"i-stem\");\n\t\t\t\t}\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}", "Network createNetwork(String[] rules, String name) {\n NetworkFactory nf = null;\n //constructs the whole L-K network from rules with support of grounded classes and element mappers, return LAST line rule's literal(=KL)!\n Network network = null;\n\n if (rules.length == 0) {\n Glogger.err(\"network template -\" + name + \"- is empty, may try to load manually if GUI is on...\");\n if (Global.isManualLoadNetwork()) {\n network = Network.loadNetwork();\n return network;\n }\n return null;\n }\n nf = new NetworkFactory();\n network = nf.construct(rules);\n\n network.exportTemplate(name);\n network.exportWeightMatrix(name);\n return network;\n }", "public void makeCampaignChallengesFile() {\n campaignChallengeData = new File(wnwData, \"campaign_challenges.dat\");\n try {\n campaignChallengeData.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n campaignChallengeData.setWritable(true);\n }", "public void buildModel(String wordFileName) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(new File(wordFileName)));\n\n String str;\n while ((str = br.readLine()) != null) {\n List<String> tokens = StanfordParser.stanfordTokenize(str).stream().map(CoreLabel::originalText).collect(Collectors.toList());\n for (String word : tokens) {\n double count = model.wordProbability.containsKey(word) ? model.wordProbability.get(word) : 0;\n count++;\n model.wordProbability.put(word, count);\n }\n }\n br.close();\n\n // Remove Empty prob.\n model.wordProbability.remove(StringUtils.EMPTY);\n model.normalizeWordProbability();\n }", "public void generateWordDocument(String directory, String nameOfTheDocument) throws Exception{\n\t\t\n\t\t//Create empty document (instance of Document classe from Apose.Words)\n\t\tDocument doc = new Document();\n\t\t\n\t\t//Every word document have section, so now we are creating section\n\t\tSection section = new Section(doc);\n\t\tdoc.appendChild(section);\n\t\t\n\t\tsection.getPageSetup().setPaperSize(PaperSize.A4);\n\t\tsection.getPageSetup().setHeaderDistance (35.4); // 1.25 cm\n\t\tsection.getPageSetup().setFooterDistance (35.4); // 1.25 cm\n\t\t\n\t\t//Crating the body of section\n\t\tBody body = new Body(doc);\n\t\tsection.appendChild(body);\n\t\t\n\t\t//Crating paragraph\n\t\tParagraph paragraph = new Paragraph(doc);\n\t\t\n\t\tparagraph.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\tparagraph.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);\n\t\t//Crating styles\n\t\tStyle style = doc.getStyles().add(StyleType.PARAGRAPH, \"Style1\");\n\t\tstyle.getFont().setSize(24);\n\t\tstyle.getFont().setBold(true);\n\t\tstyle.getFont().setColor(Color.RED);\n\t\t//paragraph.getParagraphFormat().setStyle(style);\n\t\tbody.appendChild(paragraph);\n\t\t\n\t\tStyle styleForIntroduction = doc.getStyles().add(StyleType.PARAGRAPH, \"Style2\");\n\t\tstyle.getFont().setSize(40);\n\t\tstyle.getFont().setBold(false);\n\t\tstyle.getFont().setItalic(true);\n\t\tstyle.getFont().setColor(Color.CYAN);\n\t\t\n\t\tStyle styleForText = doc.getStyles().add(StyleType.PARAGRAPH, \"Style3\");\n\t\tstyle.getFont().setSize(15);\n\t\tstyle.getFont().setBold(false);\n\t\tstyle.getFont().setItalic(false);\n\t\tstyle.getFont().setColor(Color.BLACK);\n\t\t\n\t\t//Crating run of text\n\t\tRun textRunHeadin1 = new Run(doc);\n\t\ttry {\n\t\t\ttextRunHeadin1.setText(\"Probni test fajl\" + \"\\r\\r\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tparagraph.appendChild(textRunHeadin1);\n\t\t\n\t\t\n\t\t//Creating paragraph1 for every question in list\n\t\tfor (Question question : questions) {\n\t\t\t\n\t\t\t\n\t\t\t\t//Paragraph for Instruction Question\n\t\t\t\tParagraph paragraphForInstruction = new Paragraph(doc);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setAlignment(ParagraphAlignment.LEFT);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyle(styleForIntroduction);\n\t\t\t\tparagraphForInstruction.getParagraphFormat().setStyleName(\"Heading 3\");\n\t\t\t\t\n\t\t\t\tRun runIntroduction = new Run(doc);\n\t\t\t\t\n\t\t\t\trunIntroduction.getFont().setColor(Color.BLUE);\n\t\t\t\ttry {\n\t\t\t\t\trunIntroduction.setText(((Question)question).getTextInstructionForQuestion()+\"\\r\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tparagraphForInstruction.appendChild(runIntroduction);\n\t\t\t\tbody.appendChild(paragraphForInstruction);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Paragraph for Question\n\t\t\t\tParagraph paragraphForQuestion = new Paragraph(doc);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyleName(\"Heading 1\");\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setAlignment(ParagraphAlignment.LEFT);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyle(styleForText);\n\t\t\t\tparagraphForQuestion.getParagraphFormat().setStyleName(\"Normal\");\n\t\t\t\t\n\t\t\t\tRun runText = new Run(doc);\n\t\t\t\tif(question instanceof QuestionBasic){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionBasic)question).toStringForDocument()+\"\\r\");\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionFillTheBlank){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionFillTheBlank)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionMatching){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionMatching)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tif(question instanceof QuestionTrueOrFalse){\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\trunText.setText(((QuestionTrueOrFalse)question).toStringForDocument());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tparagraphForQuestion.appendChild(runText);\n\t\t\t\tbody.appendChild(paragraphForQuestion);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tdoc.save(directory + nameOfTheDocument +\".doc\");\n\t}", "public static void main(String args[]) throws IOException {\n\r\n\r\n\r\n launch(args);\r\n\r\n/*\r\n String stemmer = \"Stemmer\";\r\n\r\n\r\n FileInputStream inputStream = new FileInputStream(\"d:\\\\documents\\\\users\\\\talmormi\\\\Downloads\\\\finalStemmer\\\\marge89.txt\");\r\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\r\n String line = bufferedReader.readLine();\r\n String[] splitLine1={};\r\n //splitLine1 = line.split(\"~\");\r\n while (line!=null){\r\n splitLine1 = line.split(\"~\");\r\n char firstLetter = splitLine1[0].charAt(0);\r\n if (!(firstLetter >= 'A' && firstLetter <= 'Z') && !(firstLetter >= 'a' && firstLetter <= 'z')) {\r\n FileOutputStream outputStream = new FileOutputStream(\"d:\\\\documents\\\\users\\\\talmormi\\\\Downloads\\\\finalStemmer\\\\postings\" + \"\\\\\" +stemmer+\"numbers.txt\", true);\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(outputStream));\r\n while (!(firstLetter >= 'A' && firstLetter <= 'Z') && !(firstLetter >= 'a' && firstLetter <= 'z') && line!=null) {\r\n bw.write(line);\r\n bw.newLine();\r\n line = bufferedReader.readLine();\r\n if (line!=null) {\r\n splitLine1 = line.split(\"~\");\r\n firstLetter = splitLine1[0].charAt(0);\r\n }\r\n }\r\n bw.flush();\r\n bw.close();\r\n outputStream.close();\r\n }\r\n else {\r\n //FileOutputStream outputStream = new FileOutputStream(path + \"\\\\\" +stemmer + \"\" +firstLetter + \".txt\", true);\r\n //BufferedWriter bw1= new BufferedWriter(new OutputStreamWriter(outputStream));\r\n while (line!=null && ((firstLetter >= 'A' && firstLetter <= 'Z') || (firstLetter >= 'a' && firstLetter <= 'z'))){\r\n firstLetter = splitLine1[0].toUpperCase().charAt(0);\r\n char nextLetter = splitLine1[0].toUpperCase().charAt(0);\r\n // FileOutputStream outputStream = new FileOutputStream(path + \"\\\\\"+stemmer + \"\" +firstLetter+\".txt\", true);\r\n // BufferedWriter bw1 = new BufferedWriter(new OutputStreamWriter(outputStream));\r\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(new File(\"d:\\\\documents\\\\users\\\\talmormi\\\\Downloads\\\\finalStemmer\\\\postings\" + \"\\\\\"+stemmer + \"\" +firstLetter+\".txt\"))));\r\n while (line!=null && firstLetter==nextLetter) {\r\n out.println(line);\r\n line = bufferedReader.readLine();\r\n if (line!=null){\r\n splitLine1 = line.split(\"~\");\r\n nextLetter = splitLine1[0].toUpperCase().charAt(0);\r\n }\r\n }\r\n out.close();\r\n }\r\n\r\n }\r\n }\r\n bufferedReader.close();\r\n inputStream.close();\r\n */\r\n\r\n //Searcher searcher = new Searcher();\r\n //searcher.pathQuery(\"D:\\\\לימודים\\\\שנה ג\\\\סמסטר א\\\\אחזור\\\\מנוע חיפוש\\\\queries.txt\");\r\n\r\n /* String s = \"0512\";\r\n String firstWord=s.substring(0,2);\r\n String secondWord=\":\"+ s.substring(2);\r\n\r\n String time = firstWord +secondWord;\r\n double firstnumber = Double.parseDouble(firstWord);\r\n DecimalFormat df = new DecimalFormat(\"#.###\");\r\n firstWord =df.format(firstnumber);\r\n*/\r\n\r\n\r\n /* Parse p = new Parse();\r\n String[] words = {\"1\" , \"Mar\" , \"1994\",};\r\n p.parser(words,\"s\",\"s\");\r\n*/\r\n /* String s= \"4\";\r\n String g =s.substring(s.length()-1);\r\n //if((s.substring(s.length()-1))== null) {\r\n g = s.substring(0, s.length() - 1);\r\n System.out.println(g);\r\n //}\r\n*/\r\n // ReadFile r = new ReadFile(\"C:\\\\Users\\\\USER\\\\Desktop\\\\לימודים\\\\'שנה ג\\\\אחזור מידע\\\\corpus\");\r\n // ReadFile r = new ReadFile(\"d:\\\\documents\\\\users\\\\shamaid\\\\Downloads\\\\corpus\\\\corpus\");\r\n // r.ReadAndSplitFile();\r\n\r\n\r\n /* long \t\t\t\t\tfinishTime \t= System.nanoTime();\r\n System.out.println(\"Time: \" + (finishTime - startTime)/1000000.0 + \" ms\");\r\n long\t\t\ttotalTime = 0;\r\n totalTime += (finishTime - startTime)/1000000.0;\r\n System.out.println(\"Total time: \" + totalTime/60000.0 + \" min\");\r\n*/\r\n/*\r\n Parse parser = new Parse();\r\n\r\n String[] test = {\"Michal\", \"Talmor\", \"Af\", \"bdfa\", \"cadf\", \"Michal\", \"Talmor\", \"ijre\", \"Talmor\", \"Af\"};\r\n\r\n\r\n //parser.parseRange(test,0,\"text\",\"doc1\");\r\n parser.parser(test,\"text\", \"doc1\");\r\n*/\r\n\r\n }", "private void inToTrinhv3(HttpServletRequest request, HttpServletResponse reponse, GiaHanForm giaHanForm, ApplicationContext appConText) throws Exception {\r\n\r\n\t\tString fileIn = request.getRealPath(\"/docin\") + \"\\\\TTNB10.doc\";\r\n\t\tString fileOut = request.getRealPath(\"/docout\") + \"\\\\TTNB10_Out\" + System.currentTimeMillis() + request.getSession().getId() + \".doc\";\r\n\r\n\t\tString fileTemplate = null;\r\n\t\tfileTemplate = \"ttnb10\"; // (ngon, chuan)\r\n\t\tString idCuocTtkt = giaHanForm.getIdCuocTtKt();\r\n\t\tTtktKhCuocTtkt cuocTtkt = CuocTtktService.getCuocTtktWithoutNoiDung(appConText, idCuocTtkt);\r\n\r\n\t\tTtktCbQd cbQd = TtktService.getQuyetDinh(idCuocTtkt, appConText);\r\n\t\tString hinhThuc = (cuocTtkt.getHinhThuc().booleanValue()) ? \"ki\\u1EC3m tra\" : \"thanh tra\";\r\n\t\tStringBuffer sb = new StringBuffer(hinhThuc);\r\n\r\n\t\tMsWordUtils word = new MsWordUtils(fileIn, fileOut);\r\n\t\ttry {\r\n\t\t\tword.put(\"[ten_cqt]\", KtnbUtil.getTenCqtCapTrenTt(appConText).toUpperCase());\r\n\t\t\t// hinh thuc thanh tra kiem tra\r\n\t\t\tif (Formater.isNull(giaHanForm.getSoQd())) {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0......\");\r\n\t\t\t} else {\r\n\t\t\t\tsb.append(\" Q\\u0110 S\\u1ED0 \" + giaHanForm.getSoQd());\r\n\t\t\t}\r\n\t\t\tword.put(\"[doan_ttkt_so]\", sb.toString().toUpperCase());\r\n\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tif (Formater.isNull(cbQd.getSoQuyetDinh())) {\r\n\t\t\t\tword.put(\"[qd_so]\", \"............\");\r\n\t\t\t} else {\r\n\t\t\t\tword.put(\"[qd_so]\", cbQd.getSoQuyetDinh());\r\n\t\t\t}\r\n\r\n\t\t\tString ngayxet = Formater.date2str(cbQd.getNgayRaQuyetDnh());\r\n\t\t\tString[] arrngayxet = ngayxet.split(\"/\");\r\n\t\t\tword.put(\"[ngay_qd]\", \"ng\\u00E0y \" + arrngayxet[0] + \" th\\u00E1ng \" + arrngayxet[1] + \" n\\u0103m \" + arrngayxet[2]);\r\n\t\t\tword.put(\"[thu_truong_cqt]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText));\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi());\r\n\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[dv_dc_ttkt]\", cuocTtkt.getTenDonViBi().toString());\r\n\t\t\tword.put(\"[ngay_lv]\", giaHanForm.getSoNgayRaHan());\r\n\t\t\tString tungay = giaHanForm.getRaHanTuNgay();\r\n\t\t\tString[] arrtungay = tungay.split(\"/\");\r\n\t\t\tword.put(\"[tu_ngay]\", \"ng\\u00E0y \" + arrtungay[0] + \" th\\u00E1ng \" + arrtungay[1] + \" n\\u0103m \" + arrtungay[2]);\r\n\t\t\t// den ngay\r\n\t\t\tString denngay = giaHanForm.getRaHanDenNgay();\r\n\t\t\tString[] arrdenngay = denngay.split(\"/\");\r\n\t\t\tword.put(\"[den_ngay]\", \"ng\\u00E0y \" + arrdenngay[0] + \" th\\u00E1ng \" + arrdenngay[1] + \" n\\u0103m \" + arrdenngay[2]);\r\n\t\t\tword.put(\"[ly_do]\", giaHanForm.getLyDoRaHan());\r\n\t\t\tword.put(\"[thu_truong_cqt_ra_qd]\", KtnbUtil.getTenThuTruongCqtForMauin(appConText).toUpperCase());\r\n\t\t\tword.put(\"[noi_duyet]\", giaHanForm.getNoiPheDuyet());\r\n\t\t\t// ngay duyet\r\n\t\t\tString ngayduyet = giaHanForm.getNgayPheDuyet();\r\n\t\t\tString[] arrngayduyet = ngayduyet.split(\"/\");\r\n\t\t\tif (arrngayduyet.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_duyet]\", \"ng\\u00E0y \" + arrngayduyet[0] + \" th\\u00E1ng \" + arrngayduyet[1] + \" n\\u0103m \" + arrngayduyet[2]);\r\n\t\t\t}\r\n\t\t\tword.put(\"[noi_lap]\", giaHanForm.getNoiTrinh());\r\n\t\t\t// ngay lap to trinh\r\n\t\t\tString ngaylaptotrinh = giaHanForm.getNgayTrinh();\r\n\t\t\tString[] arrngaylaptotrinh = ngaylaptotrinh.split(\"/\");\r\n\t\t\tif (arrngaylaptotrinh.length >= 2) {\r\n\t\t\t\tword.put(\"[ngay_lap_to_trinh]\", \"ng\\u00E0y \" + arrngaylaptotrinh[0] + \" th\\u00E1ng \" + arrngaylaptotrinh[1] + \" n\\u0103m \" + arrngaylaptotrinh[2]);\r\n\t\t\t}\r\n\t\t\tword.put(\"[ttkt]\", hinhThuc);\r\n\t\t\tword.put(\"[y_kien_phe_duyet]\", giaHanForm.getKienPheDuyet());\r\n\t\t\tword.put(\"[ten_truong_doan]\", cuocTtkt.getTenTruongDoan());\r\n\t\t\tword.put(\"[chuc_danh_thu_truong]\", KtnbUtil.getChucVuThuTruongByMaCqt(appConText.getMaCqt()).toUpperCase());\r\n\t\t\t// if (Formater.isNull(appConText.getTenThuTruong())) {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", \"\");\r\n\t\t\t// } else {\r\n\t\t\t// word.put(\"[ten_thu_truong]\", appConText.getTenThuTruong());\r\n\t\t\t// }\r\n\t\t\tword.saveAndClose();\r\n\t\t\tword.downloadFile(fileOut, \"Mau TTNB10\", \".doc\", reponse);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// ex.printStackTrace();\r\n\t\t\tSystem.out.println(\"Download Error: \" + ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tword.saveAndClose();\r\n\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public SDefOntologyWriter(String templateURI) throws OntologyLoadException {\r\n\t\towlModel = ProtegeOWL.createJenaOWLModelFromURI(templateURI);\r\n\t\tinstanceCounter = 0;\r\n\t\texistingKeywords = new Hashtable<String,String>();\r\n\t\texistingRegex = new Hashtable<String,String>();\r\n\t}", "public static void createNewTable(String fileName) {\n connect(fileName);\n String sqlUrl = \"CREATE TABLE IF NOT EXISTS urls (\\n\"\n + \" id integer PRIMARY KEY AUTOINCREMENT,\\n\"\n + \" url text NOT NULL\\n\"\n + \");\";\n\n String sqlDesc = \"CREATE TABLE IF NOT EXISTS descriptions (\\n\"\n + \" id integer,\\n\"\n + \" shifts text NOT NULL\\n\"\n + \");\";\n\n try (Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sqlUrl);\n stmt.execute(sqlDesc);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public static void Pubmed() throws IOException \n\t{\n\t\t\n\t\tMap<String,Map<String,List<String>>> trainset = null ; \n\t\t//Map<String, List<String>> titles = ReadXMLFile.ReadCDR_TestSet_BioC() ;\n\t File fFile = new File(\"F:\\\\TempDB\\\\PMCxxxx\\\\articals.txt\");\n\t List<String> sents = readfiles.readLinesbylines(fFile.toURL()); \n\t\t\n\t\tSentinfo sentInfo = new Sentinfo() ; \n\t\t\n\t\ttrainset = ReadXMLFile.DeserializeT(\"F:\\\\eclipse64\\\\eclipse\\\\TrainsetTest\") ;\n\t\tLinkedHashMap<String, Integer> TripleDict = new LinkedHashMap<String, Integer>();\n\t\tMap<String,List<Integer>> Labeling= new HashMap<String,List<Integer>>() ;\n\t\t\n\t\tMetaMapApi api = new MetaMapApiImpl();\n\t\tList<String> theOptions = new ArrayList<String>();\n\t theOptions.add(\"-y\"); // turn on Word Sense Disambiguation\n\t theOptions.add(\"-u\"); // unique abrevation \n\t theOptions.add(\"--negex\"); \n\t theOptions.add(\"-v\");\n\t theOptions.add(\"-c\"); // use relaxed model that containing internal syntactic structure, such as conjunction.\n\t if (theOptions.size() > 0) {\n\t api.setOptions(theOptions);\n\t }\n\t \n\t\t\n\t\tif (trainset == null )\n\t\t{\n\t\t\ttrainset = new HashMap<String, Map<String,List<String>>>();\n\t\t}\n\t\t\n\t\t\n\t\t/************************************************************************************************/\n\t\t//Map<String, Integer> bagofwords = semantic.getbagofwords(titles) ; \n\t\t//trainxmllabeling(trainset,bagofwords); \n\t\t/************************************************************************************************/\n\t\t\n\t\t\n\t\tint count = 0 ;\n\t\tint count1 = 0 ;\n\t\tModel candidategraph = ModelFactory.createDefaultModel(); \n\t\tMap<String,List<String>> TripleCandidates = new HashMap<String, List<String>>();\n\t\tfor(String title : sents)\n\t\t{\n\t\t\t\n\t\t\tModel Sentgraph = sentInfo.graph;\n\t\t\tif (trainset.containsKey(title))\n\t\t\t\tcontinue ; \n\t\t\t//8538\n\t\t\tcount++ ; \n\n\t\t\tMap<String, List<String>> triples = null ;\n\t\t\t// get the goldstandard concepts for current title \n\t\t\tList<String> GoldSndconcepts = new ArrayList<String> () ;\n\t\t\tMap<String, Integer> allconcepts = null ; \n\t\t\t\n\t\t\t// this is optional and not needed here , it used to measure the concepts recall \n\t\t\tMap<String, List<String>> temptitles = new HashMap<String, List<String>>(); \n\t\t\ttemptitles.put(title,GoldSndconcepts) ;\n\t\t\t\t\t\t\n\t\t\t// get the concepts \n\t\t\tallconcepts = ConceptsDiscovery.getconcepts(temptitles,api);\n\t\t\t\n\t\t\tArrayList<String> RelInstances1 = SyntaticPattern.getSyntaticPattern(title,allconcepts,FILE_NAME_Patterns) ;\n\t\t\t//Methylated-CpG island recovery assay: a new technique for the rapid detection of methylated-CpG islands in cancer\n\t\t\tif (RelInstances1 != null && RelInstances1.size() > 0 )\n\t\t\t{\n\t\t\t\tcount1++ ;\n\t\t\t\tTripleCandidates.put(title, RelInstances1) ;\n\t\t\t\t\n\t\t\t\tif (count1 == 30)\n\t\t\t\t{\n\t\t\t\t\tReadXMLFile.Serialized(TripleCandidates,\"F:\\\\eclipse64\\\\eclipse\\\\Relationdisc1\") ;\n\t\t\t\t\tcount1 = 0 ;\n\t\t\t\t}\n\t\t\t}\n \n\t\t}\n\t\t\n\t\tint i = 0 ;\n\t\ti++ ; \n\t}", "public Thesaurus(String fileName, String queriesFile, int n) throws FileNotFoundException {\n this.vec = generateWord2Vec(fileName);\n neighbourCache = loadNeighbourCache(queriesFile, n);\n }", "public void constructOntologyVocabulary() {\n ontologyOwlClassVocabulary = new HashMap<>();\n ontologyOWLDataPropertyVocabulary = new HashMap<>();\n ontologyOWLNamedIndividualVocabulary = new HashMap<>();\n ontologyOWLObjectPropertylVocabulary = new HashMap<>();\n\n Set<OWLClass> classes = domainOntology.getClassesInSignature();\n Set<OWLNamedIndividual> individualPropertyAtom = domainOntology.getIndividualsInSignature();\n Set<OWLDataProperty> dataProperty = domainOntology.getDataPropertiesInSignature();\n Set<OWLObjectProperty> OWLObjectPropertyAtom = domainOntology.getObjectPropertiesInSignature();\n String tempName = null;\n\n for (OWLClass c : classes) {\n tempName = c.toString();\n tempName = tempName.substring(tempName.lastIndexOf(\"/\") + 1);\n tempName = TextUtil.formatName(tempName);\n ontologyOwlClassVocabulary.put(tempName, c);\n }\n for (OWLDataProperty d : dataProperty) {\n tempName = d.toString();\n tempName = tempName.substring(tempName.lastIndexOf(\"/\") + 1);\n tempName = TextUtil.formatName(tempName);\n ontologyOWLDataPropertyVocabulary.put(tempName, d);\n }\n for (OWLNamedIndividual i : individualPropertyAtom) {\n tempName = i.toString();\n tempName = tempName.substring(tempName.lastIndexOf(\"/\") + 1);\n tempName = TextUtil.formatName(tempName);\n ontologyOWLNamedIndividualVocabulary.put(tempName, i);\n }\n for (OWLObjectProperty o : OWLObjectPropertyAtom) {\n tempName = o.toString();\n tempName = tempName.substring(tempName.lastIndexOf(\"/\") + 1);\n tempName = TextUtil.formatName(tempName);\n ontologyOWLObjectPropertylVocabulary.put(tempName, o);\n }\n }", "private static void GenerateBaseline(String path, ArrayList<String> aNgramChar, Hashtable<String, TruthInfo> oTruth, String outputFile, String classValues) {\n FileWriter fw = null;\n int nTerms = 1000;\n \n try {\n fw = new FileWriter(outputFile);\n fw.write(Weka.HeaderToWeka(aNgramChar, nTerms, classValues));\n fw.flush();\n\n ArrayList<File> files = getFilesFromSubfolders(path, new ArrayList<File>());\n\n assert files != null;\n int countFiles = 0;\n for (File file : files)\n {\n System.out.println(\"--> Generating \" + (++countFiles) + \"/\" + files.size());\n try {\n Hashtable<String, Integer> oDocBOW = new Hashtable<>();\n Hashtable<String, Integer> oDocNgrams = new Hashtable<>();\n\n String sFileName = file.getName();\n\n //File fJsonFile = new File(path + \"/\" + sFileName);\n //Get name without extension\n String sAuthor = sFileName.substring(0, sFileName.lastIndexOf('.'));\n\n Scanner scn = new Scanner(file, \"UTF-8\");\n String sAuthorContent = \"\";\n //Reading and Parsing Strings to Json\n while(scn.hasNext()){\n JSONObject tweet= (JSONObject) new JSONParser().parse(scn.nextLine());\n\n String textTweet = (String) tweet.get(\"text\");\n\n sAuthorContent += textTweet + \" \" ;\n\n StringReader reader = new StringReader(textTweet);\n\n NGramTokenizer gramTokenizer = new NGramTokenizer(reader, MINSIZENGRAM, MAXSIZENGRAM);\n CharTermAttribute charTermAttribute = gramTokenizer.addAttribute(CharTermAttribute.class);\n gramTokenizer.reset();\n\n gramTokenizer.reset();\n\n while (gramTokenizer.incrementToken()) {\n String sTerm = charTermAttribute.toString();\n int iFreq = 0;\n if (oDocBOW.containsKey(sTerm)) {\n iFreq = oDocBOW.get(sTerm);\n }\n oDocBOW.put(sTerm, ++iFreq);\n }\n\n gramTokenizer.end();\n gramTokenizer.close();\n }\n \n Features oFeatures = new Features();\n oFeatures.GetNumFeatures(sAuthorContent);\n\n if (oTruth.containsKey(sAuthor)) {\n TruthInfo truth = oTruth.get(sAuthor);\n String sGender = truth.gender.toUpperCase();\n //If gender is unknown, this author is not interesting\n if (sGender.equals(\"UNKNOWN\")) continue;\n String sCountry = truth.country.toUpperCase();\n\n if (classValues.contains(\"MALE\")) {\n fw.write(Weka.FeaturesToWeka(aNgramChar, oDocBOW, oDocNgrams, oFeatures, nTerms, sGender));\n } else {\n fw.write(Weka.FeaturesToWeka(aNgramChar, oDocBOW, oDocNgrams, oFeatures, nTerms, sCountry));\n }\n fw.flush();\n }\n\n } catch (Exception ex) {\n System.out.println(\"ERROR: \" + ex.toString());\n }\n }\n } catch (Exception ex) {\n System.out.println(\"ERROR: \" + ex.toString());\n } finally {\n if (fw!=null) { try { fw.close(); } catch (Exception ignored) {} }\n }\n }", "public KnowledgePacket getNounKnowledge(String noun) throws UnknownThingException\n\t{\n\t\tKnowledgePacket packet = new KnowledgePacket(KnowledgeType.THING);\n\t\ttry(FileReader reader = new FileReader(new File(thingMap.get(noun))))\n\t\t{\n\t\t\tJsonParser parser = new JsonParser();\n\t\t\tJsonObject json = (JsonObject) parser.parse(reader);\n\t\t\tList<String> elements = gson.fromJson(json.get(\"ELEMENTS\"), new TypeToken<List<String>>(){}.getType());\n\t\t\tList<String> categories = gson.fromJson(json.get(\"CATEGORIES\"), new TypeToken<List<String>>(){}.getType());\n\t\t\tMap<String, String> attributes = gson.fromJson(json.get(\"ATTRIBUTES\"), new TypeToken<Map<String, String>>(){}.getType());\n\t\t\tMap<String, Model> models = gson.fromJson(json.get(\"MODELS\"), new TypeToken<Map<String, Model>>(){}.getType());\n\t\t\tString primaryModelName = json.get(\"PRIMARY_MODEL_NAME\").getAsString();\n\t\t\tInstructionInterpreter interpreter = null;\n\t\t\ttry \n\t\t\t{\n\t\t\t\tinterpreter = loadInterpreter(new File(json.get(\"INTERPRETER\").getAsString()));\n\t\t\t} catch (InstructionInterpreterLoadException e) {}\n\t\t\tdouble confidence = json.get(\"CONFIDENCE\").getAsDouble();\n\t\t\t\n\t\t\tpacket.setElements(elements);\n\t\t\tpacket.setCategories(categories);\n\t\t\tpacket.setAttributes(attributes);\n\t\t\tpacket.setModels(models);\n\t\t\tpacket.setPrimaryModelName(primaryModelName);\n\t\t\tpacket.setInstructionInterpreter(interpreter);\n\t\t\tpacket.setConfidence(confidence);\n\t\t} catch (FileNotFoundException e) \n\t\t{\n\t\t\tthrow new UnknownThingException(noun);\n\t\t} catch (IOException e) \n\t\t{\n\t\t\tthrow new UnknownThingException(noun);\n\t\t} catch (NullPointerException e)\n\t\t{\n\t\t\tthrow new UnknownThingException(noun);\n\t\t}\n\t\treturn packet;\n\t}", "public static void processOneYear(TreeSet<ebrpPublication> pubSet,\n String rootFileName, \n String outputDirectory, String inputDirectory,\n int year, String fieldname,\n int weightType,\n ElsevierPapersFilter ipf,\n boolean useTitle, boolean useKeywords,\n boolean extractGCC,\n int minDegreeIn, int minDegreeOut, double minWeight, \n int infoLevel){\n // now process titles into keywords\n //boolean showProcess=false;\n System.out.println(\"\\n--- now processing \"\n +(useTitle?\"titles\":\"\")\n +(useTitle&&useKeywords?\" and \":\"\")\n +(useKeywords?\"keywords\":\"\")+\" into keywords\");\n System.out.println(\"--- year \"+year);\n System.out.println(\"--- fieldname \"+fieldname);\n System.out.println(\"--- weight type \"+weightTypeDescription[weightType]);\n boolean showProcess=(infoLevel>1?true:false);\n TreeMap<String,String> stemMap = new TreeMap();\n// int minChar=2;\n// int minL=3;\n// boolean keepRejectList=true;\n// ElsevierPapersFilter ipf = new ElsevierPapersFilter(minChar, minL, \n// StopWords.MySQL_STOP_WORDS_EDITED, ElsevierStopStems.PHYSICS, keepRejectList);\n setUserKeywords(pubSet, stemMap, ipf, useTitle, useKeywords, showProcess);\n \n //String fileRootName=\"ebrp\";\n String sep=\"\\t\";\n String outputFileName = outputDirectory+rootFileName+\"_\"+year+\"_\"+fieldname+\"_\"+(useTitle?\"t\":\"\")+(useKeywords?\"k\":\"\")+\"_\"+ipf.abbreviation()+\"ptStemMap.dat\";\n TimUtilities.FileUtilities.FileOutput.FileOutputMap(outputFileName, sep, stemMap, true);\n outputFileName = outputDirectory+rootFileName+\"_\"+year+\"_\"+fieldname+\"_\"+(useTitle?\"t\":\"\")+(useKeywords?\"k\":\"\")+\"_\"+ipf.abbreviation()+\"ptRejectList.dat\";\n ipf.FileOutputRejectedList(outputFileName, showProcess);\n\n // now build network\n System.out.println(\"--- now building network \");\n \n stemMap.clear(); // no longer needed so free up memory\n timgraph tg=makePublicationKeywordGraph(pubSet, weightType);\n\n String subDir=\"\";\n String networkType=\"PT\"+(useTitle?\"t\":\"\")+(useKeywords?\"k\":\"\"); // P=Publication T=Term from title\n String fileRootName=rootFileName+\"_\"+year+\"_\"+fieldname+\"_\"+networkType+\"_\"+weightTypeShort[weightType];\n tg.inputName.setFileName(inputDirectory, subDir, fileRootName, \"\");\n tg.outputName.setFileName(outputDirectory, subDir, fileRootName, \"\");\n// public boolean degreeDistributionOn; // 1\n// public boolean distancesOn; // 2\n// public boolean clusteringOn; // 4\n// public boolean triangleSquareOn; // 8\n// public boolean componentsOn; // 16\n// public boolean rankingOn; // 32\n// public boolean structuralHolesOn; // 64\n// public boolean graphMLFileOn; // 128\n// public boolean pajekFileOn; // 256\n// public boolean adjacencyFileOn; // 512\n //1+2+16\n tg.outputControl.set(\"19\");\n BasicAnalysis.analyse(tg);\n \n// // create list of degree zero or one vertices\n// TreeMap<Integer,Integer> oldToNewVertexMap = new TreeMap();\n// int nextVertex=0;\n// for (int v=0; v<tg.getNumberVertices(); v++){\n// oldToNewVertexMap.put(v, (tg.getVertexDegree(v)<2)?-1:nextVertex++) ; // 0 partition to retain\n// }\n// System.out.println(\"--- keeping \"+\" vertices, eliminating \"+(tg.getNumberVertices()-nextVertex));\n// // use Projections routine which makes copy of tg with given list of vertices\n// timgraph rtg = Projections.eliminateVertexSet(tg, addToRoot, partition, numberPartitions, forceUndirected, makeUnweighted); \n \n \n // now find and produce GCC\n if (!extractGCC) {return;}\n timgraph gcc = GCC.extractGCC(tg);\n gcc.outputName.setDirectory(tg.outputName.getDirectoryFull());\n BasicAnalysis.analyse(gcc);\n \n // now simplify GCC\n if (minDegreeIn<=0 && minDegreeOut<=0 && minWeight<=0) {return;}\n boolean makeLabelled=gcc.isVertexLabelled();\n boolean makeWeighted=gcc.isWeighted();\n boolean makeVertexEdgeList=gcc.isVertexEdgeListOn();\n timgraph gccsimple = TimGraph.algorithms.Projections.minimumDegreeOrWeight(gcc, \n minDegreeIn, minDegreeOut, minWeight, \n makeLabelled, makeWeighted, makeVertexEdgeList);\n gccsimple.outputName.setDirectory(tg.outputName.getDirectoryFull());\n gccsimple.outputName.appendToNameRoot(\"MINkin\"+minDegreeIn+\"kin\"+minDegreeOut+\"w\"+String.format(\"%06.3f\", minWeight));\n BasicAnalysis.analyse(gccsimple); \n }", "Definition createDefinition();", "@ChangeSet(order = \"001\", id = \"initialWordType\", author = \"zdoh\", runAlways = true)\n public void initWordType(MongoTemplate template) {\n partOfSpeechMap.putIfAbsent(\"num\", template.save(PartOfSpeech.builder()\n .shortName(\"num\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"числительное\"), new TranslateEntity(languageMap.get(\"en\"), \"numeral\")))\n .japanName(\"数詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"n\", template.save(PartOfSpeech.builder()\n .shortName(\"n\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"существительное\"), new TranslateEntity(languageMap.get(\"en\"), \"noun (common)\")))\n .japanName(\"名詞\")\n .kuramojiToken(\"名詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"pn\", template.save(PartOfSpeech.builder()\n .shortName(\"pn\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"местоимение\"), new TranslateEntity(languageMap.get(\"en\"), \"pronoun\")))\n .japanName(\"代名詞\")\n .kuramojiToken(\"代名詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n // no kuramoji\n partOfSpeechMap.putIfAbsent(\"hon\", template.save(PartOfSpeech.builder()\n .shortName(\"hon\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"вежливая речь\"), new TranslateEntity(languageMap.get(\"en\"), \"honorific or respectful (sonkeigo) language\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"mr-suf\", template.save(PartOfSpeech.builder()\n .shortName(\"mr-suf\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"суффикс обращения к кому-то: мистер, миссис и тд, используемый в японском языке\")))\n .build()));\n\n\n partOfSpeechMap.putIfAbsent(\"adv\", template.save(PartOfSpeech.builder()\n .shortName(\"adv\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"наречие\"), new TranslateEntity(languageMap.get(\"en\"), \"adverb\")))\n .japanName(\"副詞\")\n .kuramojiToken(\"副詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.OTHER)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"int\", template.save(PartOfSpeech.builder()\n .shortName(\"int\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"междометие\"), new TranslateEntity(languageMap.get(\"en\"), \"interjection\")))\n .japanName(\"感動詞\")\n .kuramojiToken(\"感動詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.OTHER)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"adj-na\", template.save(PartOfSpeech.builder()\n .shortName(\"adj-na\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"na-прилагательное (предикативное)\"), new TranslateEntity(languageMap.get(\"en\"), \"adjectival nouns or quasi-adjectives\")))\n .japanName(\"な形容詞\")\n .kuramojiToken(\"形容動詞語幹\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"adj-i\", template.save(PartOfSpeech.builder()\n .shortName(\"adj-i\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"i-прилагательное (полупредикативное)\"), new TranslateEntity(languageMap.get(\"en\"), \"adjective\")))\n .japanName(\"い形容詞\")\n .kuramojiToken(\"形容詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v\", template.save(PartOfSpeech.builder()\n .shortName(\"v\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол\"), new TranslateEntity(languageMap.get(\"en\"), \"verb\")))\n .japanName(\"動詞\")\n .kuramojiToken(\"動詞\")\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.MAIN)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5b\", template.save(PartOfSpeech.builder()\n .shortName(\"v5b\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -ぶ\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'bu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5g\", template.save(PartOfSpeech.builder()\n .shortName(\"v5g\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -ぐ\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'gu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5k\", template.save(PartOfSpeech.builder()\n .shortName(\"v5k\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -く\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'ku' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5k-s\", template.save(PartOfSpeech.builder()\n .shortName(\"v5k-s\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -す (специальный клаас)\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'su' ending (special class)\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5m\", template.save(PartOfSpeech.builder()\n .shortName(\"v5m\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -む\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'mu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5n\", template.save(PartOfSpeech.builder()\n .shortName(\"v5n\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -ぬ\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'nu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5r\", template.save(PartOfSpeech.builder()\n .shortName(\"v5r\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -る\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'ru' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5s\", template.save(PartOfSpeech.builder()\n .shortName(\"v5s\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -す\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'su' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5t\", template.save(PartOfSpeech.builder()\n .shortName(\"v5t\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -つ\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'tu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5u\", template.save(PartOfSpeech.builder()\n .shortName(\"v5u\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -う\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'u' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v5z\", template.save(PartOfSpeech.builder()\n .shortName(\"v5z\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол I-спряжение, -ず\"), new TranslateEntity(languageMap.get(\"en\"), \"Godan verb with 'zu' ending\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"vi\", template.save(PartOfSpeech.builder()\n .shortName(\"vi\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"непереходный глагол\"), new TranslateEntity(languageMap.get(\"en\"), \"intransitive verb\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"prefix\", template.save(PartOfSpeech.builder()\n .shortName(\"prefix\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"префикс\"), new TranslateEntity(languageMap.get(\"en\"), \"prefix\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"v1\", template.save(PartOfSpeech.builder()\n .shortName(\"v1\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"глагол II-спряжение\"), new TranslateEntity(languageMap.get(\"en\"), \"ichidan verb\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"vt\", template.save(PartOfSpeech.builder()\n .shortName(\"vt\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"переходный глагол\"), new TranslateEntity(languageMap.get(\"en\"), \"transitive verb\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"n-adv\", template.save(PartOfSpeech.builder()\n .shortName(\"n-adv\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"отглагольное существительное\"), new TranslateEntity(languageMap.get(\"en\"), \"adverbial noun\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"n-t\", template.save(PartOfSpeech.builder()\n .shortName(\"n-t\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"существительное (временное)\"), new TranslateEntity(languageMap.get(\"en\"), \"noun (temporal)\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"vk\", template.save(PartOfSpeech.builder()\n .shortName(\"vk\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"специальный глагол 来る\"), new TranslateEntity(languageMap.get(\"en\"), \"来る verb - special class\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"vs\", template.save(PartOfSpeech.builder()\n .shortName(\"vs\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"существительное, которое используется с する\"), new TranslateEntity(languageMap.get(\"en\"), \"noun or participle which takes the aux. verb suru\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"ctr\", template.save(PartOfSpeech.builder()\n .shortName(\"ctr\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"счетчик\"), new TranslateEntity(languageMap.get(\"en\"), \"counter\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"n-suf\", template.save(PartOfSpeech.builder()\n .shortName(\"n-suf\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"существительное, котором может использоваться как суффикс\"), new TranslateEntity(languageMap.get(\"en\"), \"noun, used as a suffix\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"n-pref\", template.save(PartOfSpeech.builder()\n .shortName(\"n-pref\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"существительное, котором может использоваться как префикс\"), new TranslateEntity(languageMap.get(\"en\"), \"noun, used as a prefix\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"suf\", template.save(PartOfSpeech.builder()\n .shortName(\"suf\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"суффикс\"), new TranslateEntity(languageMap.get(\"en\"), \"suffix\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"exp\", template.save(PartOfSpeech.builder()\n .shortName(\"exp\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"выражение\"), new TranslateEntity(languageMap.get(\"en\"), \"expressions (phrases, clauses, etc.)\")))\n .build()));\n\n /// part of speech for grammar\n\n partOfSpeechMap.putIfAbsent(\"は\", template.save(PartOfSpeech.builder()\n .shortName(\"は\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"частица は\"), new TranslateEntity(languageMap.get(\"en\"), \"particle は\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"です\", template.save(PartOfSpeech.builder()\n .shortName(\"です\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"связка です\"), new TranslateEntity(languageMap.get(\"en\"), \".... です\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"じゃありません\", template.save(PartOfSpeech.builder()\n .shortName(\"じゃありません\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"разговорная отрицательная форма связки です\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"ではありません\", template.save(PartOfSpeech.builder()\n .shortName(\"ではありません\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"отрицательная форма связки です\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"か\", template.save(PartOfSpeech.builder()\n .shortName(\"か\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"вопросительная частица か\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"も\", template.save(PartOfSpeech.builder()\n .shortName(\"も\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"частица も\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"の\", template.save(PartOfSpeech.builder()\n .shortName(\"の\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"частица の\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"さん\", template.save(PartOfSpeech.builder()\n .shortName(\"さん\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"суффикс さん\")))\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.SUFFIX)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"ちゃん\", template.save(PartOfSpeech.builder()\n .shortName(\"ちゃん\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"суффикс ちゃん\")))\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.SUFFIX)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"くん\", template.save(PartOfSpeech.builder()\n .shortName(\"くん\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"суффикс くん\")))\n .kuramojiTypeOfSpeech(KuramojiTypeOfSpeech.SUFFIX)\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"これ\", template.save(PartOfSpeech.builder()\n .shortName(\"これ\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"предметно-указательное местоимение これ\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"それ\", template.save(PartOfSpeech.builder()\n .shortName(\"それ\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"предметно-указательное местоимение それ\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"あれ\", template.save(PartOfSpeech.builder()\n .shortName(\"あれ\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"предметно-указательное местоимение あれ\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"この\", template.save(PartOfSpeech.builder()\n .shortName(\"この\")\n .translateName( List.of(new TranslateEntity(languageMap.get(\"ru\"), \"относительно-указательное местоимение この\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"その\", template.save(PartOfSpeech.builder()\n .shortName(\"その\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"относительно-указательное местоимение その\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"あの\", template.save(PartOfSpeech.builder()\n .shortName(\"あの\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"относительно-указательное местоимение あの\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"文\", template.save(PartOfSpeech.builder()\n .shortName(\"文\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"показатель предложения\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"、\", template.save(PartOfSpeech.builder()\n .shortName(\"、\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"символ запятой\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"。\", template.save(PartOfSpeech.builder()\n .shortName(\"。\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"символ точки\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"お\", template.save(PartOfSpeech.builder()\n .shortName(\"お\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"показатель вежливости, префикс к существительному\")))\n .build()));\n\n partOfSpeechMap.putIfAbsent(\"name\", template.save(PartOfSpeech.builder()\n .shortName(\"name\")\n .translateName(List.of(new TranslateEntity(languageMap.get(\"ru\"), \"имя, фамилия и тд\")))\n .build()));\n\n/*\n wordTypeMap.putIfAbsent(\"\", template.save(new WordType(\"\",\n List.of(new TranslateEntity(languageMap.get(\"ru\"), \"\"), new TranslateEntity(languageMap.get(\"en\"), \"\")), \"\")));\n*/\n\n }", "private void init() {\n\t\tthis.model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);\n\t\tthis.model.setNsPrefixes(INamespace.NAMSESPACE_MAP);\n\n\t\t// create classes and properties\n\t\tcreateClasses();\n\t\tcreateDatatypeProperties();\n\t\tcreateObjectProperties();\n\t\t// createFraktionResources();\n\t}", "public void createFileObjects() {\n List<String> externalFiles = abbreviationsPreferences.getExternalJournalLists();\n externalFiles.forEach(name -> openFile(Paths.get(name)));\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tString newline = System.lineSeparator();\n\t\tFileReader fr = new FileReader(\"dictonary_english_special.txt\");\n\t\tBufferedReader br = new BufferedReader(fr);\n\t\tString holder = \"\";\n\t\tString temp;\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\ttemp = br.readLine();\n\t\t\t\tif(temp == null)\n\t\t\t\t\tbreak;\n\t\t\t\tif(temp.length() < 4)\n\t\t\t\t\tcontinue;\n\t\t\t\t//System.out.println(temp);\n\t\t\t\tholder += temp + newline;\n\t\t\t} catch (IOException e) {break;}\n\t\t}\n\t\t\tFileWriter fw;\n\t\t\ttry {\n\t\t\t\tfw = new FileWriter(\"dictonary_english_hangman.txt\");\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\t\tbw.write(holder);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Done!\");\n\t}", "@Test\n public void createFile(){\n try\n {\n URI uri = new URI(\"http://www.yu.edu/documents/doc390\");//given the complete uri\n String path = uri.getAuthority() + this.disectURI(uri);//get the Path which is www.yu.edu\\documents\n File file = new File(baseDir.getAbsolutePath() + File.separator + path);//make a File with the full class path and with the \"URI Path\"\n Files.createDirectories(file.toPath());//create the directories we didn't have before, ie not apart of the baseDir\n\n File theFile = new File(file.getAbsolutePath() + File.separator + \"doc390.txt\");//create a new File with the document as the last piece\n //wrap in a try because if the file is already there than we don't need to create a file\n if(!theFile.exists())Files.createFile(theFile.toPath());//create this file in the computer\n\n //write to the file -- in the real application this is the writing of the json\n FileWriter fileWriter = new FileWriter(theFile);\n fileWriter.write(\"HaYom sishi BShabbos\");\n fileWriter.flush();\n fileWriter.close();\n\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }", "public MyNLP()\n\t{\n\t\t//create StanfordNLP\n\t\tsnlp = new StanfordNLP();\n\t\t//create Recognizer\n\t\trec = new MyRecognizer();\n\t\t//build recognizers\n\t\trec.build();\n\t\t//create SentimentalAnalysis\n\t\tsa = new SentimentalAnalysis();\n\t}" ]
[ "0.711729", "0.7034695", "0.69543165", "0.6637254", "0.6558143", "0.651431", "0.6410576", "0.63448477", "0.61656743", "0.5998935", "0.5988623", "0.59797305", "0.592662", "0.58192426", "0.5804029", "0.5794396", "0.5755277", "0.5743108", "0.5711886", "0.5706388", "0.5635108", "0.56183076", "0.55836713", "0.551444", "0.5502413", "0.545857", "0.5439799", "0.5388637", "0.5355501", "0.531764", "0.52785915", "0.5270921", "0.5197677", "0.51605624", "0.51245576", "0.5023879", "0.4994967", "0.49596527", "0.48971742", "0.4887508", "0.48703542", "0.48629585", "0.4853407", "0.4804357", "0.47811735", "0.47763616", "0.47735968", "0.47665474", "0.4766537", "0.47544107", "0.47418445", "0.47320774", "0.47284058", "0.47204027", "0.47158474", "0.47118682", "0.47114804", "0.4703734", "0.46891245", "0.46754706", "0.46540976", "0.4620906", "0.46206114", "0.46157873", "0.46157873", "0.46112812", "0.4605096", "0.46040347", "0.46013755", "0.46003875", "0.45888135", "0.4576855", "0.45647833", "0.45544255", "0.45484778", "0.45435777", "0.45403492", "0.45351276", "0.4534655", "0.4531595", "0.45298874", "0.4525802", "0.45230561", "0.4516873", "0.4512536", "0.4494132", "0.44897732", "0.4481555", "0.44804168", "0.44797313", "0.4478942", "0.44516408", "0.444947", "0.44490293", "0.4438112", "0.4424979", "0.44239616", "0.44207603", "0.44149396", "0.4411793" ]
0.6955885
2
/ Returns true if NOUN is a word in some synset.
public boolean isNoun(String noun) { for (TreeSet<String> hs: synsets.values()) { for (String s: hs) { if (noun.equals(s)) { return true; } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isNoun (String word){\n for(int i = 0; i< SynSets.length; i++){\n if(SynSets[0][1].contains(\" \"+word+\" \")) return true;\n }\n return false;\n }", "public boolean isNoun(String word) {\n return synsetList.containsKey(word);\n }", "public boolean isNoun(String word)\n {\n if (word == null) throw new NullPointerException();\n return synsetHash.containsKey(word);\n }", "public boolean isNoun(String word) {\n return sNounSet.contains(word);\n }", "public boolean isNoun(String word) {\n if (word == null) throw new IllegalArgumentException();\n return synsetsStrToNum.containsKey(word);\n }", "public boolean isNoun(String word){\n return this.nounToIdMap.containsKey(word);\n }", "public boolean isNoun(String word) {\n\n\t\treturn nouns.containsKey(word);\n\t}", "public boolean isNoun(String word) {\n\t\tif (word == null)\n\t\t\tthrow new IllegalArgumentException(); \n\t\treturn nounToId.containsKey(word);\n\t}", "public boolean isNoun(String word) {\n return nounsMap.containsKey(word);\n }", "public boolean isNoun(String word) {\n if (word == null) throw new IllegalArgumentException();\n return (data.containsKey(word));\n }", "public boolean isNoun(String word)\n {\n if (word==null) throw new IllegalArgumentException();\n return h.containsKey(word);\n }", "public boolean isNoun(String word) {\n if (word == null) {\n throw new IllegalArgumentException();\n }\n return nounMap.containsKey(word);\n }", "public boolean isNoun(String noun) {\n return wnetsi.containsKey(noun);\n }", "public boolean isNoun(String noun) {\n return nounSet.contains(noun);\n }", "boolean hasWord();", "private boolean isNoun(String string){\n \t\tif (noun.contains(string))\n \t\t\treturn true;\n \t\treturn false;\n \t}", "private boolean isNoun(int i)\n\t{\n\t\tif (text.get(i).length() > 1) // Ensures word is more than one character\n\t\t{\n\t\t\tString prior = text.get(i-1);\n\t\t\tif (prior.charAt(0) == '\\\"' || prior.charAt(0) == '-' || prior.charAt(0) == '“') // Checks if \" or - is the char next to the word\n\t\t\t{\n\t\t\t\tif (text.get(i-2).charAt(0) == 10) // Checks if the char 2 spaces before the word is a newline character\n\t\t\t\t{\n\t\t\t\t\tfullStops.add(i); // Saves location for second pass\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (text.get(i-2).length() == 1 && text.get(i-3).length() == 1) // Checks if there is a one letter word before the space before the word\n\t\t\t\t{\n\t\t\t\t\tfullStops.add(i); // Saves location for second pass\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (text.get(i-3).charAt(0) == 13)\n\t\t\t\t{\n\t\t\t\t\tfullStops.add(i); // Saves location for second pass\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\tif (prior.charAt(0) == ' ' && text.get(i-2).length() == 1 && text.get(i-2).charAt(0) != 'I') // Checks that word prior to word is not a type of full stop\n\t\t{\n\t\t\tfullStops.add(i); // Saves location for second pass\n\t\t\treturn false;\n\t\t}\n\t\tif (prior.charAt(0) == 10) //If char before word is a newline character then it is saved for another iteration\n\t\t{\n\t\t\tfullStops.add(i);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (text.get(i).charAt(0) > 64 && text.get(i).charAt(0) < 91) // If starting character is uppercase then it is assumed to be a noun\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isNoun(String noun) {\n return nouns.contains(noun);\n }", "boolean isNotKeyWord(String word);", "public static boolean isUncountable(String word)\n {\n for (String w : uncountable)\n {\n if (w.equalsIgnoreCase(word))\n {\n return true;\n }\n }\n return false;\n }", "private boolean isWord(String word) {\n\t\treturn dict.isWord(word);\n\t}", "public boolean isWord2ignore(String word);", "public boolean containsWord(TrieNode n, String word, boolean tf) {\n\t\tfor (TrieEdge e : n.edgesOutOf) {\n\t\t\tif (e.getEdgeName() == word.charAt(0)) {\n\t\t\t\t// if the word is longer than one character, check if there is\n\t\t\t\t// an edge leading out of the node that has the same first\n\t\t\t\t// character\n\t\t\t\tif (word.length() > 1) {\n\t\t\t\t\tint adjustedIndex = indexAfterCleanup(e.getTo());\n\t\t\t\t\ttf = containsWord(nodes.get(adjustedIndex),\n\t\t\t\t\t\t\tword.substring(1), tf);\n\t\t\t\t}\n\t\t\t\t// Base case, indicating that the word is in the trie, as long\n\t\t\t\t// as the following node is marked as terminal\n\t\t\t\telse {\n\t\t\t\t\tint adjustedIndex = indexAfterCleanup(n\n\t\t\t\t\t\t\t.getNextNodeFromEdge(word.charAt(0)));\n\t\t\t\t\tif (nodes.get(adjustedIndex).isTerminal()) {\n\t\t\t\t\t\ttf = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn tf;\n\t}", "boolean isWord(String potentialWord);", "public boolean isExcludedWord() {\n return StringUtils.startsWith(word, \"-\");\n }", "public static String isNSW(String word)\n\t{\n\t\tif (sw.contains(word))\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\treturn word;\n\t}", "boolean checkPronoun(String headWord, Token token){\n\t\tif (Pronoun.isSomePronoun(headWord)){\n\t\t\tPronoun pn = Pronoun.valueOrNull(headWord);\n\t\t\tif (pn==null)\n\t\t\t\treturn false;\n\t\t\tif (pn.speaker == Pronoun.Speaker.FIRST_PERSON || pn.speaker == Pronoun.Speaker.SECOND_PERSON)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t} \n\t\treturn false;\n\t}", "public boolean isInSingularPluralPair(String word) {\n\t\tIterator<SingularPluralPair> iter = this.singularPluralTable.iterator();\n\n\t\twhile (iter.hasNext()) {\n\t\t\tSingularPluralPair spp = iter.next();\n\t\t\tif ((spp.getSingular().equals(word))\n\t\t\t\t\t|| (spp.getPlural().equals(word))) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(String word) {\n Signature sig = new Signature(word);\n RadixTree node = find(sig);\n\n if (node != null) {\n return node.words.contains(word);\n } else {\n return false;\n }\n }", "public boolean ignoreWord(String word) {\n\t\t// By default we ignore all keywords that are defined in the syntax\n\t\treturn org.emftext.sdk.concretesyntax.resource.cs.grammar.CsGrammarInformationProvider.INSTANCE.getKeywords().contains(word);\n\t}", "default boolean isStopWord() {\n return meta(\"nlpcraft:nlp:stopword\");\n }", "public static boolean areWords(Set<String> toBeChecked)\n\t{\n\t\tfor (String word : toBeChecked)\n\t\t{\n\t\t\tif (! dictionary.contains(word))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean containsWord(String word) {\n\t\tTrieNode node = searchPrefix(word);\n\t\treturn node != null && node.isEnd();\n\t}", "@Override\n public boolean isWord(String s) {\n // TODO: Implement this method\n char[] c = s.toLowerCase().toCharArray();\n TrieNode predptr = root;\n for (int i = 0, n = c.length; i < n; i++) {\n TrieNode next = predptr.getChild(c[i]);\n if (next != null) {\n predptr = next;\n } else {\n return false;\n }\n\n }\n return predptr.endsWord();\n }", "public String isOne(String[] words) {\n \t for(int k=0; k<words.length; k++) \n \t {\n \t\t String prefix = words[k];\n \t\t for(String s : words) \n \t\t {\n \t\t\t \n \t\t\t if(s.length()>=prefix.length()) \n \t\t\t {\n \t\t\t\t if(!prefix.equals(s) && s.substring(0, prefix.length()).equals(prefix)) \n \t\t\t\t {\n \t\t\t\t\t return \"No, \" + k;\n \t\t\t\t }\n \t\t\t }\n \t\t }\n \t }\n \t return \"Yes\";\n }", "public boolean contains(String word) {\n return indexOf(word) > -1;\n }", "default boolean isFreeWord() {\n return meta(\"nlpcraft:nlp:freeword\");\n }", "private boolean checkWord(String str)\n\t{\n\t\tfor (int i = 0; i < words.length(); i++)\n\t\t{\n\t\t\tif (equals(words.get(i), str))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "boolean isSyn();", "public boolean isUnique(String word) {\n String a = getAbbr(word);\n return dict.get(word) == abbr.get(a);\n }", "private static boolean isPronoun(AnalyzedTokenReadings[] tokens, int n) {\n return (tokens[n].getToken().matches(\"(d(e[mnr]|ie|as|e([nr]|ss)en)|welche[mrs]?|wessen|was)\")\n && !tokens[n - 1].getToken().equals(\"sowie\"));\n }", "@Override\n\tpublic boolean containsWord(String word) {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.containsWord(word);\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "public boolean hasWord() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasWord() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@Test\n\tpublic void testIsContainedInSomeWord() {\n\n\t\tString[] words = {\"ne\", \"ned\", \"nes\", \"ning\", \"st\", \"sted\", \"sting\", \"sts\"};\n\t\tList<String> listWords = Arrays.asList(words);\n\n\t\tassertThat(\"Prefix contained\", StringUtils.containsPrefix(listWords, \"sti\"), equalTo(true));\n\t\tassertThat(\"Prefix contained\", StringUtils.containsPrefix(listWords, \"ne\"), equalTo(true));\n\t\tassertThat(\"Prefix contained\", StringUtils.containsPrefix(listWords, \"ni\"), equalTo(true));\n\t\tassertThat(\"Prefix contained\", StringUtils.containsPrefix(listWords, \"s\"), equalTo(true));\n\t\tassertThat(\"Prefix not contained\", StringUtils.containsPrefix(listWords, \"sta\"), equalTo(false));\n\t\tassertThat(\"Prefix not contained\", StringUtils.containsPrefix(listWords, \"a\"), equalTo(false));\n\t\tassertThat(\"Prefix not contained\", StringUtils.containsPrefix(listWords, \"no\"), equalTo(false));\n\t}", "public boolean startsWith(String word) {\n TrieNode tn = root;\n int len = word.length();\n for(int i=0; i<len; i++){\n char c = word.charAt(i);\n TrieNode temp = tn.hm.get(c);\n if(temp == null) return false;\n tn = temp;\n }\n return true;\n }", "private boolean lookupSentiments(Sentence sent) {\n if (selectCovered(NGram.class, sent).size() > 0)\n return true;\n return false;\n }", "boolean containsUtilize(String word)\n {\n return word.contains(\"utilize\");\n }", "public boolean isDeActivationString(String word);", "public boolean hasNE(Sentence sent) {\n if (selectCovered(NamedEntity.class, sent).size() > 0)\n return true;\n return false;\n }", "public boolean isInDictionary(String word) {\n return isInDictionary(word, Language.ENGLISH);\n }", "public boolean isStopWord(String word);", "public static Boolean hasWord(FeatureNode phr)\n\t{\n\t\tFeatureNode fn = phr.get(\"phr-head\");\n\t\twhile (fn != null)\n\t\t{\n\t\t\tFeatureNode word = fn.get(\"phr-word\");\n\t\t\tif (word != null) return true;\n\t\t\tfn = fn.get(\"phr-next\");\n\t\t}\n\t\treturn false;\n\t}", "public static String stemNSW(String word)\n\t{\n\t\treturn isNSW(getRoot(word.toLowerCase()));\n\t}", "public boolean isWord(String word) {\n\t\tSystem.out.println(\"Is Word?: \" + word);\n\t\t// - Use this to test iterative implementation rather than binaryCheck implementation (runs better on small wordlists)\n\t\tfor (int i =1; i < table.size() + 1; i++) {\n\t\t\tif (table.get(i).equals(word)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t/*\n\t\treturn isWordBinaryCheck(word);//the binarysearch version which works poorly on the sets 100 words or less\n\t\t*/\n\t}", "public boolean containsWord(String lemma) {\n checkLemmaIsNotNull(lemma);\n for (Word word : words) {\n if (word.getLemma().equalsIgnoreCase(lemma)) {\n return true;\n }\n }\n return false;\n }", "public boolean hasSecondWord()\r\n {\r\n return this.aSecondWord!=null;\r\n }", "public abstract boolean isStopWord(String term);", "public static boolean isDoubloon (String word) {\n\n // convert to lowercase, set flag:\n word = word.toLowerCase();\n boolean flag = true;\n\n // Check for double pairs:\n for(int i=0; i<word.length(); i++) {\n int count=0;\n for(int j=0; j<word.length(); j++) {\n if(word.charAt(i)==word.charAt(j)) {count++;}\n }\n if (count != 2) {flag = false; break;}\n }\n return flag;\n }", "public boolean isHasSword() {\n return hasSword;\n\t}", "@Override\n\tprotected boolean isStopword(String word) {\n\t\treturn this.stopwords.contains(word);\n\t}", "public boolean contains(String word) {\n word = word.toUpperCase();\n TrieNode node = root;\n for (int i = 0; i < word.length(); i++) {\n char ch = word.charAt(i);\n if (node.get(ch) == null) {\n return false;\n }\n node = node.get(ch);\n }\n return node.isLeaf;\n }", "boolean hasKeyword();", "private static boolean Ncontains(String word, char a) \n {\n \t// return true of false if the String match char a\n for(int x = 0; x < word.length(); x++)\n {\n if(word.charAt(x) == a)\n return false;\n }\n return true;\n }", "public static boolean containToken(String word) {\r\n\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\tif (!Character.isLetter(word.charAt(i))) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isSentiment (String lemma){\n boolean sentimentPresent = false;\n \n sentimentPresent = this.keys.contains(lemma);\n\n return sentimentPresent;\n }", "public boolean updateDataHolderNNConditionHelper(String word) {\n\t\tboolean flag = false;\n\t\t\n\t\tflag = ( (!word.matches(\"^.*\\\\b(\"+myConstant.STOP+\")\\\\b.*$\"))\n\t\t\t\t&& (!word.matches(\"^.*ly\\\\s*$\"))\n\t\t\t\t&& (!word.matches(\"^.*\\\\b(\"+myConstant.FORBIDDEN+\")\\\\b.*$\"))\n\t\t\t\t);\n\t\t\n\t\treturn flag;\n\t}", "public Boolean checkWord (String word,String line){\n return line.contains(word);\n }", "public boolean containsWord(String word) {\n\t\treturn containsWord(root, word, false);\n\t}", "private boolean matchesPlural(final String noun) {\n\t\tfinal boolean hasModernPlural\n\t\t\t\t= modernPlural != null && modernPlural.hasAffix(noun);\n\n\t\treturn hasModernPlural\n\t\t\t\t|| classicalPlural != null && classicalPlural.hasAffix(noun);\n\t}", "public boolean documentContainsMorphologicalInformation(DocTheory dt) {\n for (final SentenceTheory sentenceTheory : dt.sentenceTheories()) {\n if (!sentenceTheory.morphTokenSequences().isEmpty()) {\n return true;\n }\n }\n return false;\n }", "public boolean hasTheSword() {\n\t\treturn hasSword;\n\t}", "private static boolean isKonUnt(AnalyzedTokenReadings token) {\n return (token.hasPosTag(\"KON:UNT\")\n || StringUtils.equalsAnyIgnoreCase(token.getToken(), \"wer\", \"wo\", \"wohin\"));\n }", "public Set<String> nouns() {\n HashSet<String> set = new HashSet<String>();\n for (TreeSet<String> hs: synsets.values()) {\n for (String s: hs) {\n set.add(s);\n }\n }\n return set;\n }", "public boolean exists(String word)\n {\n boolean rtn = false;\n\n if(word.length() > 0)\n {\n StringBuffer buff = new StringBuffer().append(\"^\");\n buff.append(word.toLowerCase()).append(\"_\");\n\n String tmp = searchLexDb(buff.toString(), true);\n if(tmp.length() > 0)\n rtn = true;\n } // fi\n\n return(rtn);\n }", "public boolean search(String word) {\n\t\t\tTrieNode prefix = searchPrefix(word);\n\t\t\treturn prefix == null ? false : prefix.isWord == true;\n\t\t}", "public boolean isAccepted1(String word) {\r\n\t return (tranzition_extended(word)==3) ;\r\n\r\n }", "public Set<String> nouns() {\n return wnetsi.keySet();\n }", "public boolean contains(String word) {\r\n\t\treturn dict.contains(word);\r\n\t}", "boolean isSetNextrun();", "public boolean isAutonym() {\n return flags != null && flags.contains(NameFlag.AUTONYM);\n }", "private boolean isWord(String word) {\n String pattern = \"^[a-zA-Z]+$\";\n if (word.matches(pattern)) {\n return true;\n } else {\n return false;\n }\n }", "public static boolean checkWord(String word) { \n for(String str : wordList) {\n if (word.equals(str)) {\n return true;\n }\n }\n return false;\n }", "private boolean checkWord() {\n \tboolean bl = false;\n \tfor (int i = 0; i < word.length(); i++) {\n \t\tif (letter == word.charAt(i) && list[i] != true) {\n \t\t\tlist[i] = true;\n \t\t\tnumberOfSymbols++;\n \t\t\tbl = true;\n \t\t}\n \t}\n \treturn bl;\n }", "public boolean contains(String word) {\n\t\tif (wordList.contains(word)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t// TODO Add your code here\n\t}", "@Override\r\n\t\t\tpublic boolean containsTerm(Document document, String term) {\n\t\t\t\treturn false;\r\n\t\t\t}", "private boolean isTermAppearInQuery(String term) {\n boolean isTermAppear = false;\n query thisQuery = listDocumentRetrievedForThisQuery.getQuery();\n StringTokenizer token = new StringTokenizer(thisQuery.getQueryContent(), \" %&\\\"*#@$^_<>|`+=-1234567890'(){}[]/.:;?!,\\n\");\n while (token.hasMoreTokens()) {\n String keyTerm = token.nextToken();\n if (invertedFile.isStemmingApplied()) {\n keyTerm = StemmingPorter.stripAffixes(keyTerm);\n }\n if (term.equals(keyTerm.toLowerCase())) {\n isTermAppear = true;\n break;\n }\n }\n return isTermAppear;\n }", "public boolean contains(String word) {\n\t\treturn invertedIndex.containsKey(word);\n\t}", "public boolean containsWord(String word) {\n return wordlist.contains(word);\n }", "public boolean[][] validateWord(String s, Set<String> set) {\n boolean[][] isWord = new boolean[s.length()][s.length()];\n for (int i = 0; i < s.length(); i++) {\n for (int j = i; j < s.length(); j++) {\n isWord[i][j] = set.contains(s.substring(i, j + 1));\n }\n }\n return isWord;\n }", "public static boolean isMixedCase(String word) {\n \t// Mixed case is a word where at least one character after the first is upper case.\n \tif(word.length() < 2)\n \t\treturn false;\n\n \tString word2 = word.substring(1);\n \treturn (!word.equals(word.toLowerCase()) && !word.equals(word.toUpperCase()) && !word2.equals(word2.toLowerCase()) && !word2.equals(word2.toUpperCase()));\n }", "public boolean search(String word) {\n Node node = getNode(word);\n\n return node != null && node.isWord == true;\n }", "public boolean hasWord( String s )\n\t{\n\t\tTrieNode cur = root;\n\t\t\n\t\tfor( int i = 0; i < s.length(); i++ )\n\t\t{\n\t\t\tint letterIndex = (int)s.charAt(i) - 97;\n\t\t\t\n\t\t\tif( cur.getLetters()[ letterIndex ] != null )\n\t\t\t\tcur = cur.getLetters()[ letterIndex ];\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn cur.isEndOfWord();\n\t}", "private boolean SetRootOfSynset() {\t\t\r\n\t\tthis.roots = new ArrayList<ISynsetID>();\r\n\t\tISynset\tsynset = null;\r\n\t\tIterator<ISynset> iterator = null;\r\n\t\tList<ISynsetID> hypernyms =\tnull;\r\n\t\tList<ISynsetID>\thypernym_instances = null;\r\n\t\titerator = dict.getSynsetIterator(POS.NOUN);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\titerator = this.dict.getSynsetIterator(POS.VERB);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( this.roots.size() > 0 );\r\n\t}", "static boolean isEnglishWord(String str) {\r\n return localDictionary.contains(str);\r\n }", "public Set<String> nouns() {\n return nounSet;\n }", "boolean hasHadithText();", "@Override\r\n\t\t\tpublic boolean isStopWord(String term) {\n\t\t\t\treturn false;\r\n\t\t\t}", "public boolean isPerson (String lemma){\n \n if (lemma.equals(\"man\")){\n return true;\n }\n\n if (this.gNet != null){\n\n List < Synset > synsets ;\n synsets = this.gNet.getSynsets(lemma);\n /*\n * check if synsnet is empty, if not empty, just continue with the block below\n * else, run some morphological analysis, and retry synset.\n * \n * This only covers the person filter. Also need to cover what is and is not a subject expression\n */\n for (Synset synset: synsets){\n List<List<Synset>> hypernyms = synset.getTransRelatedSynsets(ConRel.has_hypernym);\n for (List<Synset> hypernym: hypernyms){\n for (Synset s: hypernym){\n // ID for human / person, not living being in general and ID for group\n if (s.getId() == 34063 || s.getId() == 22562){\n return true;\n }\n }\n\n }\n }\n return false;\n }\n return false;\n }", "private boolean isOmimEntry(Term term) {\n for (Dbxref xref : term.getXrefs()) {\n if (xref.getName().startsWith(\"OMIM\"))\n return true;\n }\n return false;\n }" ]
[ "0.8290014", "0.79202", "0.7902828", "0.77591133", "0.76947623", "0.7298236", "0.721588", "0.7198739", "0.717175", "0.7131136", "0.7084117", "0.70650196", "0.7009011", "0.68144184", "0.67348564", "0.67225385", "0.6500637", "0.6331288", "0.6331071", "0.6330925", "0.61894107", "0.6182608", "0.6180524", "0.6165381", "0.6143395", "0.61165065", "0.6104085", "0.6088622", "0.6088059", "0.6046389", "0.60314316", "0.5975315", "0.5970236", "0.5947615", "0.5924342", "0.5923923", "0.59144014", "0.5904695", "0.5872001", "0.5864644", "0.58449036", "0.5817471", "0.5816942", "0.57852054", "0.5773353", "0.5762471", "0.57564884", "0.57337695", "0.57300013", "0.57100993", "0.5709487", "0.57081336", "0.57068735", "0.57021195", "0.5692939", "0.5689775", "0.56831473", "0.56760573", "0.5671744", "0.56711423", "0.566317", "0.5661429", "0.5632323", "0.5625987", "0.5625922", "0.561757", "0.56163454", "0.5616186", "0.56070584", "0.56053114", "0.5600404", "0.5594511", "0.55808586", "0.5573765", "0.5569726", "0.5559849", "0.55489016", "0.5533049", "0.55314064", "0.5521027", "0.55206376", "0.5520438", "0.55180454", "0.55177635", "0.55038184", "0.54778963", "0.54759836", "0.54741406", "0.54645413", "0.54614097", "0.54573864", "0.5446918", "0.54449856", "0.54428756", "0.5441681", "0.54387707", "0.54310155", "0.5424654", "0.5407563", "0.5403844" ]
0.7121415
10
/ Returns the set of all nouns.
public Set<String> nouns() { HashSet<String> set = new HashSet<String>(); for (TreeSet<String> hs: synsets.values()) { for (String s: hs) { set.add(s); } } return set; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> nouns() {\n return nounSet;\n }", "public Set<String> nouns() {\n return sNounSet;\n }", "public Iterable<String> nouns()\n {\n return synsetHash.keySet();\n }", "public Iterable<String> nouns() {\n return synsetList.keySet();\n }", "public Iterable<String> nouns() {\n Stack<String> iter = new Stack<>();\n for (String ss : synsetsStrToNum.keySet())\n iter.push(ss);\n return iter;\n }", "public Iterable<String> nouns() {\n return nounMap.keySet();\n }", "public Iterable<String> nouns() {\n\t\treturn nouns.keySet();\n\t}", "public Iterable<String> nouns() {\n return nounsMap.keySet();\n }", "public Set<String> nouns() {\n return nouns;\n }", "public Iterable<String> nouns() {\n\t\treturn nounToId.keySet();\n\t}", "public Set<String> nouns() {\n return wnetsi.keySet();\n }", "public Iterable<String> nouns() {\n return data.keySet();\n }", "public Iterable<String> nouns(){\n return this.nounToIdMap.keySet();\n }", "public Iterable<String> nouns()\n {\n return h.navigableKeySet();\n }", "public Iterable<String> nouns(){\n List<String> ReturnType = new ArrayList<String>();\n for(int i =0; i< SynSets.length; i++)\n ReturnType.add(SynSets[i][0]);\n return ReturnType;\n }", "public ArrayList<String> getNouns(HashMap<String, String> simplePOSTagged) {\n ArrayList nouns = new ArrayList();\n for(String word: simplePOSTagged.keySet()){\n if (simplePOSTagged.get(word).equals(\"noun\")){\n nouns.add(word);\n }\n }\n return nouns;\n }", "public Set<String> hyponyms(String word) {\n Set<String> hyponyms = new HashSet<String>();\n Set<Integer> ids = new HashSet<Integer>();\n for (Integer key: synsetNouns.keySet()) {\n if (synsetNouns.get(key).contains(word)) {\n ids.add(key);\n }\n }\n Set<Integer> descendants = GraphHelper.descendants(hyponym, ids);\n for (Integer j: descendants) {\n for (String value: synsetNouns.get(j)) {\n hyponyms.add(value);\n }\n }\n return hyponyms;\n }", "public void getNounPhrases(Parse p) {\n if (p.getType().equals(\"NN\") || p.getType().equals(\"NNS\") || p.getType().equals(\"NNP\") \n || p.getType().equals(\"NNPS\")) {\n nounPhrases.add(p.getCoveredText()); //extracting the noun parse\n }\n \n if (p.getType().equals(\"VB\") || p.getType().equals(\"VBP\") || p.getType().equals(\"VBG\")|| \n p.getType().equals(\"VBD\") || p.getType().equals(\"VBN\")) {\n \n verbPhrases.add(p.getCoveredText()); //extracting the verb parse\n }\n \n for (Parse child : p.getChildren()) {\n getNounPhrases(child);\n }\n}", "String getSynonyms();", "protected Iterator getNominationsSet() \n {\n return this.nominations.iterator();\n }", "public Set<String> hyponyms(String word) {\n HashSet<String> allhyponyms = new HashSet<String>();\n int maxV = synset.size();\n // int maxV = 0;\n // for (Integer i : synset.keySet()) {\n // if (maxV < i) {\n // maxV = i;\n // }\n // }\n // maxV += 1;\n Digraph digraph = new Digraph(maxV);\n\n // ArrayList<Integer> hypoKeys = new ArrayList<Integer>();\n // for (int i = 0; i < hyponym.size(); i++) {\n // hypoKeys.add(hyponym.get(0).get(i));\n // }\n \n for (ArrayList<Integer> a : hyponym) {\n int key = a.get(0);\n for (int j = 1; j < a.size(); j++) {\n digraph.addEdge(key, a.get(j));\n }\n }\n\n // get synonyms (in same synset), ex. given \"jump\", will get \"parachuting\" as well as \"leap\"\n ArrayList<String> strArray = new ArrayList<String>();\n for (Integer k : getSynsetKeys(word)) {\n strArray.addAll(synset.get(k));\n }\n for (String str : strArray) {\n allhyponyms.add(str);\n }\n\n // for each int from set<int> with all synset IDS\n for (Integer s : GraphHelper.descendants(digraph, getSynsetKeys(word))) {\n for (String t : synset.get(s)) {\n allhyponyms.add(t);\n }\n }\n return allhyponyms;\n }", "public static void getNounList()throws Exception{\r\n\t\tSystem.out.println(\"Start loading noun dictionary into memory...\");\r\n\t\tBufferedReader nounReader = new BufferedReader(new FileReader(NOUN_DICT));\r\n\t\tString line = null;\r\n\t\twhile((line = nounReader.readLine())!=null){\r\n\t\t\tline = line.toLowerCase();\r\n\t\t\tnounList.add(line);\r\n\t\t\tnounSet.add(line);\r\n\t\t}\r\n\t\tnounReader.close();\r\n\t\tSystem.out.println(\"Noun dictionary loaded.\");\r\n\t}", "public Set<String> hyponyms(String word) {\n HashSet<String> set = new HashSet<String>();\n for (Integer id: synsets.keySet()) {\n TreeSet<String> hs = synsets.get(id);\n if (hs.contains(word)) {\n for (String s: hs) {\n set.add(s);\n }\n TreeSet<Integer> ids = new TreeSet<Integer>();\n ids.add(id);\n Set<Integer> desc = GraphHelper.descendants(dg, ids);\n for (Integer i: desc) {\n for (String s: synsets.get(i)) {\n set.add(s);\n }\n }\n }\n }\n return set;\n }", "public Set<String> getWords() {\n return wordMap.keySet();\n }", "public Set<String> getWords() {\n\t\treturn Collections.unmodifiableSet(this.invertedIndex.keySet());\n\t}", "public boolean isNoun (String word){\n for(int i = 0; i< SynSets.length; i++){\n if(SynSets[0][1].contains(\" \"+word+\" \")) return true;\n }\n return false;\n }", "public Set<String> getWords() {\n return wordsOccurrences.keySet();\n }", "@Override\n\tpublic Set<String> getWordSet() {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getWordSet();\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "public static Set<String> getEnglishWords()\n{\n return english_words;\n}", "public Set<String> hyponyms(String word) {\n Set<Integer> synIDs = new TreeSet<Integer>();\n Set<Integer> synKeys = synsetMap.keySet();\n for (Integer id : synKeys) {\n if (synsetMap.get(id).contains(word)) {\n synIDs.add(id);\n }\n }\n Set<Integer> hypIDs = GraphHelper.descendants(g, synIDs);\n Set<String> result = new TreeSet<String>();\n\n for (Integer i : hypIDs) {\n ArrayList<String> al = synsetMap.get(i);\n result.addAll(al);\n }\n return result;\n }", "public Set<String> hyponyms(String word) {\n hypernymSet = new TreeSet<String>();\n firstsIDset = new HashSet<Integer>();\n for (String[] synStrings : sFile.values()) {\n for (String synset : synStrings) {\n if (synset.equals(word)) {\n for (String synset2 : synStrings) {\n hypernymSet.add(synset2);\n }\n for (Integer key : sFile.keySet()) {\n if (sFile.get(key).equals(synStrings)) {\n firstsIDset.add(key);\n }\n }\n }\n }\n }\n\n sIDset = GraphHelper.descendants(theDigraph, firstsIDset);\n for (Integer id : sIDset) {\n synsetWordStrings = sFile.get(id);\n for (String word2 : synsetWordStrings) {\n hypernymSet.add(word2);\n }\n }\n return hypernymSet;\n }", "public Set<NounPhrase> getEntities(String type){\n\t\tif(type.equals(\"S\") || type.equals(\"s\"))\n\t\t\treturn this.subjectSet;\n\t\telse if(type.equals(\"O\") || type.equals(\"o\"))\n\t\t\treturn this.objectSet;\n\t\telse\n\t\t\treturn null;\n\t}", "static TreeSet<Noun> parseNouns(Scanner data, int declension){\n\t\tassert(declension != Values.INDEX_ENDINGS_DECLENSION_THIRD && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N && declension != Values.INDEX_ENDINGS_DECLENSION_THIRD_I_N); //there's a separate function for these guys.\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\n\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(NumberFormatException e){ //can happen if a chapter isn't specified. Read the noun from a null chapter.\n\t\t\t\tchapter = Values.CHAPTER_VOID;\n\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}", "Collection<? extends Noun> getIsEquivalent();", "public boolean isNoun(String noun) {\n for (TreeSet<String> hs: synsets.values()) {\n for (String s: hs) {\n if (noun.equals(s)) {\n return true;\n }\n }\n }\n return false;\n }", "public Set<String> loadAllSubstanceNames();", "private Set<Integer> getSynsetKeys(String word) {\n HashSet<Integer> kset = new HashSet<Integer>();\n\n for (ArrayList<String> o : synsetRev.keySet()) {\n for (String p : o) {\n if (p.equals(word)) {\n kset.add(synsetRev.get(o));\n }\n }\n }\n return kset;\n }", "public Collection<Term> getAll() {\n\t\treturn terms.values();\n\t}", "public Set<String> honorifics();", "public java.util.List<String> getSynonyms() {\n return synonyms;\n }", "public Collection<String> words() {\n Collection<String> words = new ArrayList<String>();\n TreeSet<Integer> keyset = new TreeSet<Integer>();\n keyset.addAll(countToWord.keySet());\n for (Integer count : keyset) {\n words.addAll(this.countToWord.get(count));\n }\n return words;\n }", "private void fillSet() {\r\n\t\tString regex = \"\\\\p{L}+\";\r\n\t\tMatcher matcher = Pattern.compile(regex).matcher(body);\r\n\t\twhile (matcher.find()) {\r\n\t\t\tif (!matcher.group().isEmpty()) {\r\n\t\t\t\twords.add(matcher.group());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Set<String> hyponyms(String word) {\n Set<Integer> wordIds = revrseSynsetMapper.get(word);\n Set<String> superSet = new HashSet<String>();\n Set<Integer> descendant = GraphHelper.descendants(hypGraph, wordIds);\n Iterator<Integer> iter = descendant.iterator();\n while (iter.hasNext()) {\n Set<String> string_word = synsetMapper.get(iter.next());\n Iterator<String> A = string_word.iterator();\n while (A.hasNext()) {\n superSet.add(A.next());\n }\n }\n return superSet;\n }", "public List<String> getSynonyms() {\n return synonyms;\n }", "public List<String> getAllWords() {\n List<String> words = new ArrayList<>();\n // get the words to the list\n getAllWords(root, \"\", 0, words);\n // and return the list of words\n return words;\n }", "public List<String> findAllSynonyms(String gene){\n\t\tList<String> synonyms = new ArrayList<String> ();\n\t\tif (this.termSet.contains(gene)){\n\t\t\tMap<String,List<String>> geneSynonyms = this.synonymDictionary.get(gene);\n\t\t\tSet<String> keys = geneSynonyms.keySet();\n\t\t\tfor(String k:keys){\n\t\t\t\tList<String> subList = geneSynonyms.get(k);\n\t\t\t\tfor(String s:subList){\n\t\t\t\t\tsynonyms.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn synonyms;\n\t}", "public List<Synset> getSynsets() {\n try {\n return Dictionary.getDefaultResourceInstance()\n .lookupIndexWord(WSDHelper.getPOS(this.getTargetTag()),\n this.getTargetWord())\n .getSenses();\n } catch (JWNLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Set<NounPhrase> getOpSet(){\n\t\tSet<NounPhrase> opSet = this.getEntConsiderPass(\"O\");\n\t\treturn opSet;\n\t}", "Set<String> getNames();", "public ArrayList<String> getPronouns(HashMap<String, String> simplePOSTagged) {\n ArrayList pron = new ArrayList();\n for(String word: simplePOSTagged.keySet()){\n if (simplePOSTagged.get(word).equals(\"pron\")){\n pron.add(word);\n }\n }\n return pron;\n }", "public Set<String> hyponyms(String word) {\n Set<String> toReturn = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n wordIndexes = wnetsi.get(word);\n Set<Integer> toReturnInt = GraphHelper.descendants(g, wordIndexes);\n Object[] returnArray = toReturnInt.toArray();\n for (int i = 0; i < returnArray.length; i += 1) {\n Set<String> stringReturn = wnetis.get(returnArray[i]);\n Iterator<String> strIter = stringReturn.iterator();\n while (strIter.hasNext()) {\n toReturn.add(strIter.next());\n }\n }\n return toReturn;\n }", "public static List<Synset> getAllHyponymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(wordSynset,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public static List<Synset> getAllMeronymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getInheritedMeronyms(wordSynset,4,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "@Override\n\tpublic Set<OWLEntity> getAllConcepts() {\n\t\tSet<OWLEntity> result = new HashSet<OWLEntity>();\n\t\tresult.addAll(ontology.getClassesInSignature());\n\t\tresult.addAll(ontology.getIndividualsInSignature());\n\t\treturn result;\n\t}", "Set<String> tags();", "public Set<String> getWordsFromWordPOSByPOSs(Set<String> POSTags) {\n\t\tSet<String> words = new HashSet<String>();\n\n\t\tif (POSTags == null) {\n\t\t\treturn words;\n\t\t}\n\n\t\tIterator<Entry<WordPOSKey, WordPOSValue>> iter = this\n\t\t\t\t.getWordPOSHolderIterator();\n\n\t\twhile (iter.hasNext()) {\n\t\t\tEntry<WordPOSKey, WordPOSValue> wordPOSEntry = iter.next();\n\t\t\tString POS = wordPOSEntry.getKey().getPOS();\n\t\t\tif (POSTags.contains(POS)) {\n\t\t\t\tString word = wordPOSEntry.getKey().getWord();\n\t\t\t\twords.add(word);\n\t\t\t}\n\t\t}\n\n\t\treturn words;\n\t}", "private static void addAllSynset(ArrayList<String> synsets, String chw, IDictionary dictionary) {\n\t\tWordnetStemmer stemmer = new WordnetStemmer(dictionary);\n\t\tchw = stemmer.findStems(chw, POS.NOUN).size()==0?chw:stemmer.findStems(chw, POS.NOUN).get(0);\n\t\t\n\t\tIIndexWord indexWord = dictionary.getIndexWord(chw, POS.NOUN);\n\t\tList<IWordID> sensesID = indexWord.getWordIDs();\n\t\tList<ISynsetID> relaWordID = new ArrayList<ISynsetID>();\n\t\tList<IWord> words;\n\t\t\n\t\tfor(IWordID set : sensesID) {\n\t\t\tIWord word = dictionary.getWord(set);\n\t\t\t\n\t\t\t//Add Synonym\n\t\t\trelaWordID.add(word.getSynset().getID());\n\n\t\t\t//Add Antonym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.ANTONYM));\n\t\t\t\n\t\t\t//Add Meronym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_MEMBER));\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_PART));\n\t\t\t\n\t\t\t//Add Hypernym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPERNYM));\n\t\t\t\n\t\t\t//Add Hyponym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPONYM));\n\t\t}\n\t\t\n\t\tfor(ISynsetID sid : relaWordID) {\n\t\t\twords = dictionary.getSynset(sid).getWords();\n\t\t\tfor(Iterator<IWord> i = words.iterator(); i.hasNext();) {\n\t\t\t\tsynsets.add(i.next().getLemma());\n\t\t\t}\n\t\t}\n\t}", "public abstract Set<String> getTerms(Document doc);", "SortedSet<String> getNames();", "@ApiOperation(value = \"/get_all_UserNoun\", httpMethod = \"GET\",\n\tnotes = \"special search that gets all values of UserNoun\",\n\tresponse = UserNoun.class)\n @ApiResponses(value = {\n\t\t@ApiResponse(code = 200, message =LoginACTSwaggerUIConstants.SUCCESS),\n\t @ApiResponse(code = 404, message = LoginACTSwaggerUIConstants.NOT_FOUND),\n\t @ApiResponse(code = 500, message = LoginACTSwaggerUIConstants.INTERNAL_SERVER_ERROR),\n\t @ApiResponse(code = 400, message = LoginACTSwaggerUIConstants.BAD_REQUEST),\n\t @ApiResponse(code = 412, message = LoginACTSwaggerUIConstants.PRE_CONDITION_FAILED) })\n\n\n\t@RequestMapping(method = RequestMethod.GET,value = \"/get_all_UserNoun\" ,headers=\"Accept=application/json\")\n @ResponseBody\n\tpublic List<UserNoun> get_all_UserNoun() throws Exception {\n\t\t log.setLevel(Level.INFO);\n\t log.info(\"get_all_UserNoun controller started operation!\");\n\n\t\tList<UserNoun> UserNoun_list = new ArrayList<UserNoun>();\n\n\t\tUserNoun_list = UserNoun_service.get_all_usernoun();\n\t\tlog.info(\"Object returned from get_all_UserNoun method !\");\n\t\treturn UserNoun_list;\n\n\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}", "public Set<Mention> mentions();", "static TreeSet<Noun> parse3rdNouns(Scanner data){\n\n\t\tint declension = 3;\n\t\tArrayList<String[]> raw = parseDataToArray(data);\n\t\tTreeSet<Noun> output = new TreeSet<Noun>();\n\n\t\tfor(String[] current : raw){ //iterate over each line from the original file.\n\n\t\t\tif(current.length != Values.NOUN_DATA_ARRAY_LENGTH_CORRECT){\n\t\t\t\tSystem.err.println(\"Error parsing a line.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//System.out.println(\"Raw: \" + Arrays.toString(current));\n\n\t\t\t//current[] contains a split based on tabs. Generally {chapter, nom/gen/gender, definition}.\n\n\t\t\tint chapter = 0;\n\t\t\tString nominative = null;\n\t\t\tString genitive = null;\n\t\t\tchar gender = '-';\n\t\t\tArrayList<String> definitions = new ArrayList<String>();\n\n\t\t\t//Values.betterStringArrayPrint(current);\n\t\t\ttry{\n\t\t\t\ttry{ //try to read a noun, assuming that the chapter IS specified\n\t\t\t\t\tchapter = Integer.parseInt(current[0]);\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD;\n\t\t\t\t\t//System.out.println(\"No i-stem\");\n\t\t\t\t} catch(NumberFormatException e){ //I-Stem.\n\t\t\t\t\tchapter = Integer.parseInt(current[0].substring(0, 2));\n\t\t\t\t\tnominative = current[1].split(\", \")[0];\n\t\t\t\t\tgenitive = current[1].split(\", \")[1];\n\t\t\t\t\tgender = current[1].split(\", \")[2].charAt(0);\n\t\t\t\t\tList<String> tempDefinitions = Arrays.asList(current[2].split(\",|;\")); //definitions\n\t\t\t\t\tdefinitions.addAll(tempDefinitions);\n\t\t\t\t\tdeclension = Values.INDEX_ENDINGS_DECLENSION_THIRD_I;\n\t\t\t\t\t//System.out.println(\"i-stem\");\n\t\t\t\t}\n\t\t\t} catch(Exception e){\n\t\t\t\tSystem.err.println(\"Could not read a line!\");\n\t\t\t\tcontinue; //We can't make a noun out of the botrked line.\n\t\t\t}\n\t\t\tint genderIndex = Values.getGenderIndex(gender);\n\t\t\ttrimAll(definitions);\n\t\t\tNoun currentNoun = new Noun(nominative, genitive, chapter, genderIndex, declension, definitions);\n\t\t\tSystem.out.println(\"Added: \" + currentNoun);\n\t\t\toutput.add(currentNoun);\n\t\t}\n\n\t\treturn output;\n\t}", "private boolean SetRootOfSynset() {\t\t\r\n\t\tthis.roots = new ArrayList<ISynsetID>();\r\n\t\tISynset\tsynset = null;\r\n\t\tIterator<ISynset> iterator = null;\r\n\t\tList<ISynsetID> hypernyms =\tnull;\r\n\t\tList<ISynsetID>\thypernym_instances = null;\r\n\t\titerator = dict.getSynsetIterator(POS.NOUN);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\titerator = this.dict.getSynsetIterator(POS.VERB);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( this.roots.size() > 0 );\r\n\t}", "Set<String> getDictionary();", "private List<String> findSynonyms(String gene,String scope){\n\t\t\n\t\tList<String> li = new ArrayList<String> ();\n\t\t\n\t\tif (this.termSet.contains(gene)){\n\t\t\tfor (String str:this.synonymDictionary.get(gene).get(scope)){\n\t\t\t\tli.add(str);\n\t\t\t};\n\t\t}\n\t\treturn li;\n\t\n\t}", "private HashSet<String> buildsetofterms(String filename)\r\n\t{\r\n\t\tString readLine, terms[];\r\n HashSet<String> fileTerms = new HashSet<String>();\r\n try \r\n {\r\n BufferedReader reader = new BufferedReader(new FileReader(filename));\r\n while ((readLine = reader.readLine()) != null)\r\n {\r\n terms = (readLine.toLowerCase().replaceAll(\"[.,:;'\\\"]\", \" \").split(\" +\"));\r\n for (String term : terms)\r\n {\r\n if (term.length() > 2 && !term.equals(\"the\"))\r\n fileTerms.add(term);\r\n }\r\n }\r\n }\r\n catch(IOException e){\r\n e.printStackTrace();\r\n }\r\n return fileTerms;\r\n }", "public Set<String> getDistinctTagLabels(){\r\n\t\treturn new HashSet<String>(taggingService.getDistinctTagLabels());\r\n\t}", "public static ArrayList<String> pronouns() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner pronouner;\n try {\n pronouner = new Scanner(new File(\"pronouns.txt\"));\n pronouner.useDelimiter(\", *\");\n while (pronouner.hasNext()){\n temp.add(\" \"+pronouner.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "public String outcast(String[] nouns){\n if (nouns == null) {\n throw new IllegalArgumentException();\n }\n sum = new int[nouns.length];\n int maxIdx = -1;\n for (int i = 0; i < nouns.length; i++) {\n for (int j = 0; j < nouns.length; j++) {\n sum[i] += wn.distance(nouns[i], nouns[j]);\n }\n //System.out.println(sum[i]);\n maxIdx = maxIdx==-1? i : sum[maxIdx] < sum[i] ? i : maxIdx;\n }\n\n return nouns[maxIdx];\n }", "public void setNoms(){\r\n\t\tDSElement<Verbum> w = tempWords.first;\r\n\t\tint count = tempWords.size(); // failsafe counter\r\n\t\twhile(count > 0){\r\n\t\t\tGetNom(w.getItem());\r\n\t\t\t//System.out.println(w.getItem().nom);\r\n\t\t\tw = w.getNext();\r\n\t\t\tif(w == null)\r\n\t\t\t\tw = tempWords.first;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t}", "public Set<String> nGramGenerator(String sentence, int minGram, int maxGram, boolean unigrams) {\n Set<String> out = new HashSet();\n try {\n StringReader reader = new StringReader(sentence);\n StandardTokenizer source = new StandardTokenizer(LUCENE_VERSION, reader);\n TokenStream tokenStream = new StandardFilter(LUCENE_VERSION, source);\n try (ShingleFilter sf = new ShingleFilter(tokenStream, minGram, maxGram)) {\n sf.setOutputUnigrams(unigrams);\n\n CharTermAttribute charTermAttribute = sf.addAttribute(CharTermAttribute.class);\n sf.reset();\n\n while (sf.incrementToken()) {\n out.add(charTermAttribute.toString());\n }\n\n sf.end();\n }\n\n } catch (IOException ex) {\n logger.log(Level.SEVERE, null, ex);\n }\n\n return out;\n }", "Set<Keyword> listKeywords();", "public boolean isNoun(String word) {\n return synsetList.containsKey(word);\n }", "public static Set<String> getPseudos() {\n return pseudos;\n }", "public List<String> findNarrowSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"narrow\");\n\t}", "public Set<Character> distincts() {\n return jumble.keySet();\n }", "static Set<NLMeaning> extractMeanings(NLText nlText) {\n\t\tSet<NLMeaning> meanings = new HashSet();\n\t\t\n\t\tList<NLSentence> sentences = nlText.getSentences();\n\t\tNLSentence firstSentence = sentences.iterator().next();\n\t\tList<NLToken> tokens = firstSentence.getTokens();\n\t\tList<NLMultiWord> multiWords = firstSentence.getMultiWords();\n\t\tList<NLNamedEntity> namedEntities = firstSentence.getNamedEntities();\n\t\t\n\t\t// Add meanings of all tokens that are not part of multiwords or NEs\n\t\tIterator<NLToken> itToken = tokens.iterator();\n\t\twhile (itToken.hasNext()) {\n\t\t\tSet<NLMeaning> tokenMeanings = getTokenMeanings(itToken.next());\n\t\t\tif (tokenMeanings != null) {\n\t\t\t\tmeanings.addAll(tokenMeanings);\t\t\t\n\t\t\t}\n//\t\t\tNLToken token = itToken.next();\n//\t\t\tboolean hasMultiWords = token.getMultiWords() != null && !token.getMultiWords().isEmpty();\n//\t\t\tboolean hasNamedEntities = token.getNamedEntities() != null && !token.getNamedEntities().isEmpty();\n//\t\t\tif (!hasMultiWords && !hasNamedEntities) {\n//\t\t\t\tif (token.getMeanings() == null || token.getMeanings().isEmpty()) {\n//\t\t\t\t\t// This is a hack to handle a bug where the set of meanings\n//\t\t\t\t\t// is empty but there is a selected meaning.\n//\t\t\t\t\t\n//\t\t\t\t\tNLMeaning selectedMeaning = token.getSelectedMeaning();\n//\t\t\t\t\tif (selectedMeaning != null) {\n//\t\t\t\t\t\tmeanings.add(selectedMeaning);\n//\t\t\t\t\t}\n//\t\t\t\t} else {\n//\t\t\t\t\tmeanings.addAll(token.getMeanings());\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\t\n\t\t// Add meanings of multiwords and NEs\n\t\tIterator<NLMultiWord> itMultiWord = multiWords.iterator();\n\t\twhile (itMultiWord.hasNext()) {\n\t\t\tNLMultiWord multiWord = itMultiWord.next();\n\t\t\tmeanings.addAll(multiWord.getMeanings());\n\t\t}\n\t\tIterator<NLNamedEntity> itNamedEntity = namedEntities.iterator();\n\t\twhile (itNamedEntity.hasNext()) {\n\t\t\tNLNamedEntity namedEntity = itNamedEntity.next();\n\t\t\tmeanings.addAll(namedEntity.getMeanings());\n\t\t}\n\t\t\n\t\treturn meanings;\n\t}", "public static Set<String> createSet() {\n Set<String> set = new HashSet<>();\n set.add(\"lesson\");\n set.add(\"large\");\n set.add(\"link\");\n set.add(\"locale\");\n set.add(\"love\");\n set.add(\"light\");\n set.add(\"limitless\");\n set.add(\"lion\");\n set.add(\"line\");\n set.add(\"lunch\");\n set.add(\"level\");\n set.add(\"lamp\");\n set.add(\"luxurious\");\n set.add(\"loop\");\n set.add(\"last\");\n set.add(\"lie\");\n set.add(\"lose\");\n set.add(\"lecture\");\n set.add(\"little\");\n set.add(\"luck\");\n\n return set;\n }", "public Set<OntologyScope> getRegisteredScopes();", "public List getNominations() \n {\n final ArrayList newList = new ArrayList();\n CollectionPerformer aPerformer = new CollectionPerformer()\n {\n public void performBlock(Object listElement, Object keyValue)\n {\n newList.add(listElement);\n }\n };\n aPerformer.perform(this.nominations);\n return Collections.unmodifiableList(newList);\n }", "@ZAttr(id=1073)\n public String[] getPrefSpellIgnoreWord() {\n return getMultiAttr(Provisioning.A_zimbraPrefSpellIgnoreWord);\n }", "public Set<String> asList() {\n\t\treturn this.dictionary;\n\t}", "public List<String> exhaustedSearchSynonyms(String gene){\n\t\tfor(String term:this.termSet){\n\t\t\tif (term.contains(gene)){\n\t\t\t\treturn findAllSynonyms(term);\n\t\t\t}\n\t\t}\n\t\treturn new ArrayList<String> ();\n\t}", "public Set<String> getNLeastDistant(String word, int n) {\n\t\tthis.currentWord = word;\n\t\tSet<String> chosenCandidates = new HashSet<String>();\n\t\tPriorityQueue<String> candidates = new PriorityQueue<String>(dict.size(), new getNLeastDistantComparator());\n\t\tfor (String term : dict.keySet()) {\n\t\t\tcandidates.add(term);\n\t\t}\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tchosenCandidates.add(candidates.poll());\n\t\t}\n\t\treturn chosenCandidates;\n\t}", "private void getSynsets(HashSet<WordProvider.Word> words) {\n HashMap<String, String> synsets_map = new HashMap<>();\n for (WordProvider.Word word: words) {\n ArrayList<String> synsetList = new ArrayList<>(Arrays.asList(word.getSynsets().trim().split(\" \")));\n for (String synset_tag: synsetList)\n synsets_map.put(synset_tag, word.getPos());\n }\n // for each synset load the meanings in the background\n final Object[] params= {synsets_map};\n new FetchRows().execute(params);\n }", "public boolean isNoun(String word) {\n return sNounSet.contains(word);\n }", "@NotNull\n @Generated\n @Selector(\"tags\")\n public native NSSet<String> tags();", "public Set<Note> getNoteSet();", "public List<Ninja> allNinjas() {\n\t\t\t\treturn ninjaRepo.findAll();\n\t\t\t}", "public static void main(final String[] args)\r\n {\r\n // Set the path to the data files\r\n Dictionary.initialize(\"c:/Program Files/WordNet/2.1/dict\");\r\n \r\n // Get an instance of the Dictionary object\r\n Dictionary dict = Dictionary.getInstance();\r\n \r\n // Declare a filter for all terms starting with \"car\", ignoring case\r\n TermFilter filter = new WildcardFilter(\"car*\", true);\r\n \r\n // Get an iterator to the list of nouns\r\n Iterator<IndexTerm> iter = \r\n dict.getIndexTermIterator(PartOfSpeech.NOUN, 1, filter);\r\n \r\n // Go over the list items\r\n while (iter.hasNext())\r\n {\r\n // Get the next object\r\n IndexTerm term = iter.next();\r\n \r\n // Write out the object\r\n System.out.println(term.toString());\r\n \r\n // Write out the unique pointers for this term\r\n int nNumPtrs = term.getPointerCount();\r\n if (nNumPtrs > 0)\r\n {\r\n // Print out the number of pointers\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumPtrs) +\r\n \" pointers\");\r\n \r\n // Print out all of the pointers\r\n String[] ptrs = term.getPointers();\r\n for (int i = 0; i < nNumPtrs; ++i)\r\n {\r\n String p = Pointer.getPointerDescription(term.getPartOfSpeech(), ptrs[i]);\r\n System.out.println(ptrs[i] + \": \" + p);\r\n }\r\n }\r\n \r\n // Get the definitions for this term\r\n int nNumSynsets = term.getSynsetCount();\r\n if (nNumSynsets > 0)\r\n {\r\n // Print out the number of synsets\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumSynsets) +\r\n \" synsets\");\r\n \r\n // Print out all of the synsets\r\n Synset[] synsets = term.getSynsets();\r\n for (int i = 0; i < nNumSynsets; ++i)\r\n {\r\n System.out.println(synsets[i].toString());\r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Demo processing finished.\");\r\n }", "@Override\n public List<DefinitionDTO> findAllWords() {\n List<Word> words = wordRepository.findAll();\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "@Override\n\tpublic List<Nature> findNaturesIn() {\n\t\treturn natureRepository.findNaturesIn();\n\t}", "public ArrayList<String> getWords() {\n return new ArrayList<>(words);\n }", "public static void getSynonyms(ArrayList<String> keywords) {\n final String endpoint = \"http://www.dictionaryapi.com/api/v1/references/collegiate/xml/\";\n final String key = \"79b70eee-858c-486a-b155-a44db036bfe0\";\n try {\n for (String keyword : keywords) {\n String url = endpoint + keyword + \"?key=\" + key;\n System.out.print(\"url--\" + url);\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n\n //print result\n System.out.println(response.toString());\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder;\n InputSource is;\n try {\n builder = factory.newDocumentBuilder();\n is = new InputSource(new StringReader(response.toString()));\n Document doc = builder.parse(is);\n NodeList list = doc.getElementsByTagName(\"syn\");\n System.out.println(\"synonyms\" + list.item(0).getTextContent());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n WordNet tester = new WordNet(\"synsets.txt\", \"hypernyms.txt\");\n StdOut.println(\n \"isNoun test: This should return true and it returns \" + tester.isNoun(\"mover\"));\n StdOut.println(\"distance test: This should return 3 and it returns \" + tester\n .distance(\"African\", \"renegade\"));\n StdOut.println(\n \"sca test: This should return person individual someone somebody mortal soul and it returns \"\n + tester\n .sca(\"African\", \"renegade\"));\n\n // Commented because output is large\n //StdOut.println(\"nouns test: This should return all of the nouns and it returns \" + tester.nouns());\n\n }", "Collection<String> names();", "public List<HunspellAffix> getPrefixes() {\n return prefixes;\n }", "public boolean isNoun(String word)\n {\n if (word == null) throw new NullPointerException();\n return synsetHash.containsKey(word);\n }", "public Iterator getUnparsedEntityNames() {\n return Collections.EMPTY_LIST.iterator();\n }" ]
[ "0.8528092", "0.8400103", "0.8395723", "0.83015823", "0.82666504", "0.8241365", "0.82194054", "0.8215301", "0.8159714", "0.79543096", "0.7915693", "0.79057884", "0.79029936", "0.780659", "0.7699272", "0.61379695", "0.60853493", "0.60579646", "0.6046431", "0.59855473", "0.5943463", "0.5935001", "0.5800195", "0.5788376", "0.5776864", "0.5767606", "0.57383496", "0.57294655", "0.5728603", "0.5719711", "0.5719526", "0.5696814", "0.56964046", "0.5662076", "0.5662041", "0.56310123", "0.5629405", "0.55830956", "0.55700326", "0.5551267", "0.55344814", "0.5532794", "0.55298007", "0.5512109", "0.5509346", "0.5486779", "0.548019", "0.54770863", "0.5465414", "0.5441485", "0.54102665", "0.53976274", "0.5396194", "0.53893596", "0.5372621", "0.535962", "0.5330891", "0.5324507", "0.532156", "0.5300625", "0.5297024", "0.52938116", "0.52879095", "0.5245917", "0.5234006", "0.5208106", "0.5203564", "0.5174728", "0.5166832", "0.5163679", "0.51556027", "0.51403874", "0.5129818", "0.5116882", "0.5116145", "0.51141286", "0.5092042", "0.508544", "0.5085211", "0.50836277", "0.50834376", "0.5082243", "0.50787634", "0.5073768", "0.5072995", "0.5067897", "0.5065639", "0.50633824", "0.5053589", "0.50473183", "0.5043319", "0.5042653", "0.5027576", "0.50242794", "0.50144184", "0.50101614", "0.5009563", "0.50035363", "0.49932835", "0.49913362" ]
0.8832382
0
Returns the set of all hyponyms of WORD as well as all synonyms of WORD. If WORD belongs to multiple synsets, return all hyponyms of all of these synsets. See for an example. Do not include hyponyms of synonyms.
public Set<String> hyponyms(String word) { HashSet<String> set = new HashSet<String>(); for (Integer id: synsets.keySet()) { TreeSet<String> hs = synsets.get(id); if (hs.contains(word)) { for (String s: hs) { set.add(s); } TreeSet<Integer> ids = new TreeSet<Integer>(); ids.add(id); Set<Integer> desc = GraphHelper.descendants(dg, ids); for (Integer i: desc) { for (String s: synsets.get(i)) { set.add(s); } } } } return set; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<String> hyponyms(String word) {\n Set<String> hyponyms = new HashSet<String>();\n Set<Integer> ids = new HashSet<Integer>();\n for (Integer key: synsetNouns.keySet()) {\n if (synsetNouns.get(key).contains(word)) {\n ids.add(key);\n }\n }\n Set<Integer> descendants = GraphHelper.descendants(hyponym, ids);\n for (Integer j: descendants) {\n for (String value: synsetNouns.get(j)) {\n hyponyms.add(value);\n }\n }\n return hyponyms;\n }", "public Set<String> hyponyms(String word) {\n Set<Integer> synIDs = new TreeSet<Integer>();\n Set<Integer> synKeys = synsetMap.keySet();\n for (Integer id : synKeys) {\n if (synsetMap.get(id).contains(word)) {\n synIDs.add(id);\n }\n }\n Set<Integer> hypIDs = GraphHelper.descendants(g, synIDs);\n Set<String> result = new TreeSet<String>();\n\n for (Integer i : hypIDs) {\n ArrayList<String> al = synsetMap.get(i);\n result.addAll(al);\n }\n return result;\n }", "public Set<String> hyponyms(String word) {\n HashSet<String> allhyponyms = new HashSet<String>();\n int maxV = synset.size();\n // int maxV = 0;\n // for (Integer i : synset.keySet()) {\n // if (maxV < i) {\n // maxV = i;\n // }\n // }\n // maxV += 1;\n Digraph digraph = new Digraph(maxV);\n\n // ArrayList<Integer> hypoKeys = new ArrayList<Integer>();\n // for (int i = 0; i < hyponym.size(); i++) {\n // hypoKeys.add(hyponym.get(0).get(i));\n // }\n \n for (ArrayList<Integer> a : hyponym) {\n int key = a.get(0);\n for (int j = 1; j < a.size(); j++) {\n digraph.addEdge(key, a.get(j));\n }\n }\n\n // get synonyms (in same synset), ex. given \"jump\", will get \"parachuting\" as well as \"leap\"\n ArrayList<String> strArray = new ArrayList<String>();\n for (Integer k : getSynsetKeys(word)) {\n strArray.addAll(synset.get(k));\n }\n for (String str : strArray) {\n allhyponyms.add(str);\n }\n\n // for each int from set<int> with all synset IDS\n for (Integer s : GraphHelper.descendants(digraph, getSynsetKeys(word))) {\n for (String t : synset.get(s)) {\n allhyponyms.add(t);\n }\n }\n return allhyponyms;\n }", "public Set<String> hyponyms(String word) {\n hypernymSet = new TreeSet<String>();\n firstsIDset = new HashSet<Integer>();\n for (String[] synStrings : sFile.values()) {\n for (String synset : synStrings) {\n if (synset.equals(word)) {\n for (String synset2 : synStrings) {\n hypernymSet.add(synset2);\n }\n for (Integer key : sFile.keySet()) {\n if (sFile.get(key).equals(synStrings)) {\n firstsIDset.add(key);\n }\n }\n }\n }\n }\n\n sIDset = GraphHelper.descendants(theDigraph, firstsIDset);\n for (Integer id : sIDset) {\n synsetWordStrings = sFile.get(id);\n for (String word2 : synsetWordStrings) {\n hypernymSet.add(word2);\n }\n }\n return hypernymSet;\n }", "public Set<String> hyponyms(String word) {\n Set<Integer> wordIds = revrseSynsetMapper.get(word);\n Set<String> superSet = new HashSet<String>();\n Set<Integer> descendant = GraphHelper.descendants(hypGraph, wordIds);\n Iterator<Integer> iter = descendant.iterator();\n while (iter.hasNext()) {\n Set<String> string_word = synsetMapper.get(iter.next());\n Iterator<String> A = string_word.iterator();\n while (A.hasNext()) {\n superSet.add(A.next());\n }\n }\n return superSet;\n }", "public static List<Synset> getAllHyponymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(wordSynset,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public Set<String> hyponyms(String word) {\n Set<String> toReturn = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n wordIndexes = wnetsi.get(word);\n Set<Integer> toReturnInt = GraphHelper.descendants(g, wordIndexes);\n Object[] returnArray = toReturnInt.toArray();\n for (int i = 0; i < returnArray.length; i += 1) {\n Set<String> stringReturn = wnetis.get(returnArray[i]);\n Iterator<String> strIter = stringReturn.iterator();\n while (strIter.hasNext()) {\n toReturn.add(strIter.next());\n }\n }\n return toReturn;\n }", "public static List<Synset> getAllMeronymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getInheritedMeronyms(wordSynset,4,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "String getSynonyms();", "private static void addAllSynset(ArrayList<String> synsets, String chw, IDictionary dictionary) {\n\t\tWordnetStemmer stemmer = new WordnetStemmer(dictionary);\n\t\tchw = stemmer.findStems(chw, POS.NOUN).size()==0?chw:stemmer.findStems(chw, POS.NOUN).get(0);\n\t\t\n\t\tIIndexWord indexWord = dictionary.getIndexWord(chw, POS.NOUN);\n\t\tList<IWordID> sensesID = indexWord.getWordIDs();\n\t\tList<ISynsetID> relaWordID = new ArrayList<ISynsetID>();\n\t\tList<IWord> words;\n\t\t\n\t\tfor(IWordID set : sensesID) {\n\t\t\tIWord word = dictionary.getWord(set);\n\t\t\t\n\t\t\t//Add Synonym\n\t\t\trelaWordID.add(word.getSynset().getID());\n\n\t\t\t//Add Antonym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.ANTONYM));\n\t\t\t\n\t\t\t//Add Meronym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_MEMBER));\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_PART));\n\t\t\t\n\t\t\t//Add Hypernym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPERNYM));\n\t\t\t\n\t\t\t//Add Hyponym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPONYM));\n\t\t}\n\t\t\n\t\tfor(ISynsetID sid : relaWordID) {\n\t\t\twords = dictionary.getSynset(sid).getWords();\n\t\t\tfor(Iterator<IWord> i = words.iterator(); i.hasNext();) {\n\t\t\t\tsynsets.add(i.next().getLemma());\n\t\t\t}\n\t\t}\n\t}", "public List<String> getSynonyms() {\n return synonyms;\n }", "public java.util.List<String> getSynonyms() {\n return synonyms;\n }", "private void getSynsets(HashSet<WordProvider.Word> words) {\n HashMap<String, String> synsets_map = new HashMap<>();\n for (WordProvider.Word word: words) {\n ArrayList<String> synsetList = new ArrayList<>(Arrays.asList(word.getSynsets().trim().split(\" \")));\n for (String synset_tag: synsetList)\n synsets_map.put(synset_tag, word.getPos());\n }\n // for each synset load the meanings in the background\n final Object[] params= {synsets_map};\n new FetchRows().execute(params);\n }", "public List<String> getRelatedWords(String word) throws IOException {\n List<String> result = new ArrayList<String>();\n IDictionary dict = new Dictionary(new File(WORDNET_LOCATION));\n try {\n dict.open();\n IStemmer stemmer = new WordnetStemmer(dict);\n for (POS pos : EnumSet.of(POS.ADJECTIVE, POS.ADVERB, POS.NOUN, POS.VERB)) {\n List<String> resultForPos = new ArrayList<String>();\n List<String> stems = new ArrayList<String>();\n stems.add(word);\n for (String stem : stemmer.findStems(word, pos)) {\n if (!stems.contains(stem))\n stems.add(stem);\n }\n for (String stem : stems) {\n if (!resultForPos.contains(stem)) {\n resultForPos.add(stem);\n IIndexWord idxWord = dict.getIndexWord(stem, pos);\n if (idxWord == null) continue;\n List<IWordID> wordIDs = idxWord.getWordIDs();\n if (wordIDs == null) continue;\n IWordID wordID = wordIDs.get(0);\n IWord iword = dict.getWord(wordID);\n \n ISynset synonyms = iword.getSynset();\n List<IWord> iRelatedWords = synonyms.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n \n List<ISynsetID> hypernymIDs = synonyms.getRelatedSynsets();\n if (hypernymIDs != null) {\n for (ISynsetID relatedSynsetID : hypernymIDs) {\n ISynset relatedSynset = dict.getSynset(relatedSynsetID);\n if (relatedSynset != null) {\n iRelatedWords = relatedSynset.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n }\n }\n }\n }\n }\n for (String relatedWord : resultForPos) {\n if (relatedWord.length() > 3\n && !relatedWord.contains(\"-\")\n && !result.contains(relatedWord)) {\n // TODO: Hack alert!\n // The - check is to prevent lucene from interpreting hyphenated words as negative search terms\n // Fix!\n result.add(relatedWord);\n }\n }\n }\n } finally {\n dict.close();\n }\n return result;\n }", "public Set<String> nouns() {\n HashSet<String> set = new HashSet<String>();\n for (TreeSet<String> hs: synsets.values()) {\n for (String s: hs) {\n set.add(s);\n }\n }\n return set;\n }", "public Set<String> getHyponyms(String vertex)\r\n\t{\n\t\treturn null;\r\n\t}", "public List<String> findAllSynonyms(String gene){\n\t\tList<String> synonyms = new ArrayList<String> ();\n\t\tif (this.termSet.contains(gene)){\n\t\t\tMap<String,List<String>> geneSynonyms = this.synonymDictionary.get(gene);\n\t\t\tSet<String> keys = geneSynonyms.keySet();\n\t\t\tfor(String k:keys){\n\t\t\t\tList<String> subList = geneSynonyms.get(k);\n\t\t\t\tfor(String s:subList){\n\t\t\t\t\tsynonyms.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn synonyms;\n\t}", "public void setSynonyms(java.util.Collection<String> synonyms) {\n if (synonyms == null) {\n this.synonyms = null;\n return;\n }\n\n this.synonyms = new java.util.ArrayList<String>(synonyms);\n }", "private List<Query> generateSynonymQueries(Analyzer synonymAnalyzer, SolrParams solrParams) {\n\n\tString origQuery = getQueryStringFromParser();\n\tint queryLen = origQuery.length();\n\t\n // TODO: make the token stream reusable?\n TokenStream tokenStream = synonymAnalyzer.tokenStream(Const.IMPOSSIBLE_FIELD_NAME,\n new StringReader(origQuery));\n \n SortedSetMultimap<Integer, TextInQuery> startPosToTextsInQuery = TreeMultimap.create();\n \n \n boolean constructPhraseQueries = solrParams.getBool(Params.SYNONYMS_CONSTRUCT_PHRASES, false);\n \n boolean bag = solrParams.getBool(Params.SYNONYMS_BAG, false);\n List<String> synonymBag = new ArrayList<>();\n \n try {\n tokenStream.reset();\n while (tokenStream.incrementToken()) {\n CharTermAttribute term = tokenStream.getAttribute(CharTermAttribute.class);\n OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class);\n TypeAttribute typeAttribute = tokenStream.getAttribute(TypeAttribute.class);\n \n if (!typeAttribute.type().equals(\"shingle\")) {\n // ignore shingles; we only care about synonyms and the original text\n // TODO: filter other types as well\n \n String termToAdd = term.toString();\n \n if (typeAttribute.type().equals(\"SYNONYM\")) {\n synonymBag.add(termToAdd); \t\n }\n \n //Don't quote sibgle term term synonyms\n\t\t if (constructPhraseQueries && typeAttribute.type().equals(\"SYNONYM\") &&\n\t\t\ttermToAdd.contains(\" \")) \n\t\t {\n\t\t \t//Don't Quote when original is already surrounded by quotes\n\t\t \tif( offsetAttribute.startOffset()==0 || \n\t\t \t offsetAttribute.endOffset() == queryLen ||\n\t\t \t origQuery.charAt(offsetAttribute.startOffset()-1)!='\"' || \n\t\t \t origQuery.charAt(offsetAttribute.endOffset())!='\"')\n\t\t \t{\n\t\t \t // make a phrase out of the synonym\n\t\t \t termToAdd = new StringBuilder(termToAdd).insert(0,'\"').append('\"').toString();\n\t\t \t}\n\t\t }\n if (!bag) {\n // create a graph of all possible synonym combinations,\n // e.g. dog bite, hound bite, dog nibble, hound nibble, etc.\n\t TextInQuery textInQuery = new TextInQuery(termToAdd, \n\t offsetAttribute.startOffset(), \n\t offsetAttribute.endOffset());\n\t \n\t startPosToTextsInQuery.put(offsetAttribute.startOffset(), textInQuery);\n }\n }\n }\n tokenStream.end();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n } finally {\n try {\n tokenStream.close();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n }\n }\n \n List<String> alternateQueries = synonymBag;\n \n if (!bag) {\n // use a graph rather than a bag\n\t List<List<TextInQuery>> sortedTextsInQuery = new ArrayList<>(\n startPosToTextsInQuery.values().size());\n sortedTextsInQuery.addAll(startPosToTextsInQuery.asMap().values().stream().map(ArrayList::new).collect(Collectors.toList()));\n\t \n\t // have to use the start positions and end positions to figure out all possible combinations\n\t alternateQueries = buildUpAlternateQueries(solrParams, sortedTextsInQuery);\n }\n \n // save for debugging purposes\n expandedSynonyms = alternateQueries;\n \n return createSynonymQueries(solrParams, alternateQueries);\n }", "private void populateDictionaryBySynonyms() {\n\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n String tag = dictionaryTerms.get(word);\n\n ArrayList<String> synonyms = PyDictionary.findSynonyms(word);\n\n for (int i = 0; i < synonyms.size(); i++) {\n if (!dictionaryTerms.containsKey(synonyms.get(i))) {\n dictionaryTerms.put(synonyms.get(i), tag);\n }\n }\n }\n }", "public Set<Entity> getHyponyms(Entity vertex)\r\n\t{\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Set<String> getWordSet() {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getWordSet();\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "private List<String> findSynonyms(String gene,String scope){\n\t\t\n\t\tList<String> li = new ArrayList<String> ();\n\t\t\n\t\tif (this.termSet.contains(gene)){\n\t\t\tfor (String str:this.synonymDictionary.get(gene).get(scope)){\n\t\t\t\tli.add(str);\n\t\t\t};\n\t\t}\n\t\treturn li;\n\t\n\t}", "public Set<String> getWords() {\n return wordMap.keySet();\n }", "public Iterable<String> nouns()\n {\n return synsetHash.keySet();\n }", "public List<Synset> getSynsets() {\n try {\n return Dictionary.getDefaultResourceInstance()\n .lookupIndexWord(WSDHelper.getPOS(this.getTargetTag()),\n this.getTargetWord())\n .getSenses();\n } catch (JWNLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Iterable<String> nouns() {\n return synsetList.keySet();\n }", "private Set<Integer> getSynsetKeys(String word) {\n HashSet<Integer> kset = new HashSet<Integer>();\n\n for (ArrayList<String> o : synsetRev.keySet()) {\n for (String p : o) {\n if (p.equals(word)) {\n kset.add(synsetRev.get(o));\n }\n }\n }\n return kset;\n }", "public List<String> findNarrowSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"narrow\");\n\t}", "public Set<String> getWords() {\n\t\treturn Collections.unmodifiableSet(this.invertedIndex.keySet());\n\t}", "public List<String> exhaustedSearchSynonyms(String gene){\n\t\tfor(String term:this.termSet){\n\t\t\tif (term.contains(gene)){\n\t\t\t\treturn findAllSynonyms(term);\n\t\t\t}\n\t\t}\n\t\treturn new ArrayList<String> ();\n\t}", "public ElementDefinitionDt setSynonym(java.util.List<StringDt> theValue) {\n\t\tmySynonym = theValue;\n\t\treturn this;\n\t}", "public void createManufacturerSynonyms() {\n\t\t\n\t\tfor (String m : productsByManufacturer.keySet() ) {\n\t\t\t\n\t\t\tString mWords[] = m.split(\"\\\\s+\");\n\t\t\t\n\t\t\tif (mWords.length > 1) {\n\t\t\t\tSet<Product> products = productsByManufacturer.get(m);\n\t\t\t\tfor (String mw: mWords) {\n\t\t\t\t manufacturerSynonyms.put(mw, products);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void demonstrateTreeOperation(IndexWord word) throws JWNLException {\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(word.getSense(1));\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n Synset rootsynset = rootnode.getSynset();\n System.out.println(rootsynset.getWord(0).getLemma());\n PointerTargetTreeNodeList childList = rootnode.getChildTreeList();\n PointerTargetTreeNode rootnode1=(PointerTargetTreeNode)childList.get(0);\n System.out.println(rootnode1.getSynset().getWord(0).getLemma());\n System.out.println(\"Hyponyms of \\\"\" + word.getLemma() + \"\\\":\");\n hyponyms.print();\n }", "public List<SynonymMap> getSynonymMaps() {\n return this.synonymMaps;\n }", "public java.util.List<StringDt> getSynonym() { \n\t\tif (mySynonym == null) {\n\t\t\tmySynonym = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\treturn mySynonym;\n\t}", "private static List<String> induceSynonims(String word) {\n\t\treturn null;\n\t}", "public static void getSynonyms(ArrayList<String> keywords) {\n final String endpoint = \"http://www.dictionaryapi.com/api/v1/references/collegiate/xml/\";\n final String key = \"79b70eee-858c-486a-b155-a44db036bfe0\";\n try {\n for (String keyword : keywords) {\n String url = endpoint + keyword + \"?key=\" + key;\n System.out.print(\"url--\" + url);\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n\n //print result\n System.out.println(response.toString());\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder;\n InputSource is;\n try {\n builder = factory.newDocumentBuilder();\n is = new InputSource(new StringReader(response.toString()));\n Document doc = builder.parse(is);\n NodeList list = doc.getElementsByTagName(\"syn\");\n System.out.println(\"synonyms\" + list.item(0).getTextContent());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public CellValueSynonym withSynonyms(java.util.Collection<String> synonyms) {\n setSynonyms(synonyms);\n return this;\n }", "public HashSet<String> getHypernymsLexical(String linkedConcept) {\n return getHypernymsLexical(linkedConcept, Language.ENGLISH);\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsetScanner = new In(synsetFilename);\n\n synsetNouns = new HashMap<Integer, ArrayList<String>>();\n nouns = new HashSet<String>();\n\n while (synsetScanner.hasNextLine()) {\n ArrayList<String> synsetArrayList = new ArrayList<String>();\n String row = synsetScanner.readLine();\n String[] tokens = row.split(\",\");\n String[] synset = tokens[1].split(\" \");\n for (int i = 0; i < synset.length; i++) {\n synsetArrayList.add(synset[i]);\n nouns.add(synset[i]);\n }\n synsetNouns.put(Integer.parseInt(tokens[0]), synsetArrayList);\n }\n\n In hyponymScanner = new In(hyponymFilename);\n hyponym = new Digraph(synsetNouns.size());\n while (hyponymScanner.hasNextLine()) {\n String row = hyponymScanner.readLine();\n String[] tokens = row.split(\",\");\n for (int i = 1; i < tokens.length; i++) {\n hyponym.addEdge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[i]));\n }\n }\n }", "public Set<String> getWords() {\n return wordsOccurrences.keySet();\n }", "public List<String> findRelatedSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"related\");\n\t}", "public Iterable<String> nouns(){\n List<String> ReturnType = new ArrayList<String>();\n for(int i =0; i< SynSets.length; i++)\n ReturnType.add(SynSets[i][0]);\n return ReturnType;\n }", "public List<String> findBroadSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"broad\");\n\t}", "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsets = new In(synsetFilename);\n In hyponyms = new In(hyponymFilename);\n int count = 0;\n while (synsets.hasNextLine()) {\n String line = synsets.readLine();\n String[] linesplit = line.split(\",\");\n String[] wordsplit = linesplit[1].split(\" \");\n Set<String> synset = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n for (int i = 0; i < wordsplit.length; i += 1) {\n synset.add(wordsplit[i]);\n if (wnetsi.containsKey(wordsplit[i])) {\n wordIndexes = wnetsi.get(wordsplit[i]);\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n } else {\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n }\n }\n wnetis.put(Integer.parseInt(linesplit[0]), synset);\n count += 1;\n }\n \n \n \n String[] allVerts = hyponyms.readAllLines();\n g = new Digraph(count);\n for (int i = 0; i < allVerts.length; i += 1) {\n String[] linesplit = allVerts[i].split(\",\");\n for (int j = 0; j < linesplit.length; j += 1) {\n g.addEdge(Integer.parseInt(linesplit[0]), Integer.parseInt(linesplit[j]));\n }\n }\n \n }", "public List<String> findExactSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"exact\");\n\t}", "public boolean getAutoGenerateMultiTermSynonymsPhraseQuery() {\n return autoGenerateMultiTermSynonymsPhraseQuery;\n }", "@Override\n public List<DefinitionDTO> findAllWords() {\n List<Word> words = wordRepository.findAll();\n return DTOMapper.mapWordListToDefinitionDTOList(words);\n }", "public final void mT__31() throws RecognitionException {\n try {\n int _type = T__31;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalReqLNG.g:30:7: ( 'Synonyms' )\n // InternalReqLNG.g:30:9: 'Synonyms'\n {\n match(\"Synonyms\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "private boolean SetRootOfSynset() {\t\t\r\n\t\tthis.roots = new ArrayList<ISynsetID>();\r\n\t\tISynset\tsynset = null;\r\n\t\tIterator<ISynset> iterator = null;\r\n\t\tList<ISynsetID> hypernyms =\tnull;\r\n\t\tList<ISynsetID>\thypernym_instances = null;\r\n\t\titerator = dict.getSynsetIterator(POS.NOUN);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\titerator = this.dict.getSynsetIterator(POS.VERB);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( this.roots.size() > 0 );\r\n\t}", "public static LinkedList<String> getSynonym(String word) {\n\t\tLinkedList<String> res = new LinkedList<String>();\n\t\tif (dict.containsKey(word)) {\n\t\t\tres = dict.get(word);\n\t\t}\n\t\treturn res;\n\t}", "public Set<String> nouns() {\n return wnetsi.keySet();\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n synset = new HashMap<Integer, ArrayList<String>>();\n synsetRev = new HashMap<ArrayList<String>, Integer>();\n hyponym = new ArrayList<ArrayList<Integer>>();\n // hyponym = new HashMap<Integer,ArrayList<Integer>>();\n\n In syn = new In(synsetFilename);\n In hypo = new In(hyponymFilename);\n\n while (!syn.isEmpty()) {\n String line = syn.readLine();\n String[] split1 = line.split(\",\");\n int stempkey = Integer.parseInt(split1[0]);\n String syns = split1[1];\n String[] temps = syns.split(\" \");\n ArrayList<String> stempval = new ArrayList<String>();\n for (String s : temps) {\n stempval.add(s);\n }\n synset.put(stempkey, stempval);\n synsetRev.put(stempval, stempkey);\n }\n\n while (!hypo.isEmpty()) {\n String line = hypo.readLine();\n String[] arrayOfStrings = line.split(\",\");\n ArrayList<Integer> integersAL = new ArrayList<Integer>();\n for (int i = 0; i < arrayOfStrings.length; i++) {\n integersAL.add(Integer.parseInt(arrayOfStrings[i]));\n }\n hyponym.add(integersAL);\n\n // ArrayList<Integer> valuesAL = new ArrayList<Integer>();\n // for (Integer i : integersAL) {\n // valuesAL.add(i);\n // }\n // int comma1 = line.indexOf(\",\");\n // int htempkey = Integer.parseInt(line.substring(0,comma1));\n // String sub = line.substring(comma1 + 1);\n // String[] arrayOfStrings = sub.split(\",\");\n // hyponym.put(htempkey, integersAL);\n }\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n synsets = new TreeMap<Integer, TreeSet<String>>();\n numVertices = 0;\n In syns = new In(synsetFilename);\n while (syns.hasNextLine()) {\n numVertices++;\n String line = syns.readLine();\n String[] split1 = line.split(\",\");\n String[] split2 = split1[1].split(\" \");\n TreeSet<String> hs = new TreeSet<String>();\n for (String s: split2) {\n hs.add(s);\n }\n synsets.put(Integer.parseInt(split1[0]), hs);\n }\n dg = new Digraph(numVertices);\n In hyms = new In(hyponymFilename);\n while (hyms.hasNextLine()) {\n String line = hyms.readLine();\n String[] split = line.split(\"[, ]+\");\n int v = Integer.parseInt(split[0]);\n for (int i = 1; i < split.length; i++) {\n dg.addEdge(v, Integer.parseInt(split[i]));\n }\n }\n }", "public ArrayList<String> getWords() {\n return new ArrayList<>(words);\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n File hyponymPath = new File(hyponymFilename);\n Scanner s;\n try {\n s = new Scanner(hyponymPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n hyponymParse(currLine);\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + hyponymFilename);\n } \n File synsetPath = new File(synsetFilename);\n try {\n s = new Scanner(synsetPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n synsetParse(currLine);\n numberOfSynsets += 1;\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + synsetFilename);\n } \n g = new Digraph(numberOfSynsets);\n Set<Integer> keys = hyponymMap.keySet();\n for (Integer k : keys) {\n ArrayList<Integer> al = hyponymMap.get(k);\n for (Integer i : al) {\n g.addEdge(k, i);\n }\n }\n }", "public Iterable<String> nouns() {\n Stack<String> iter = new Stack<>();\n for (String ss : synsetsStrToNum.keySet())\n iter.push(ss);\n return iter;\n }", "public SynonymMapsImpl synonymMaps() {\n return this.synonymMaps;\n }", "public ArrayList<String> getWords() {\n return words;\n }", "public ArrayList <String> getWordList () {\r\n return words;\r\n }", "public static Hashtable<String,Thought> buildWordSet(Vector<Thought> words) {\r\n\t\tHashtable<String,Thought> ret = new Hashtable<String,Thought>();\r\n\t\tfor(Thought word : words) {\r\n\t\t\tret.put(word.representation, word);\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public Set<String> nouns() {\n return nounSet;\n }", "public String get_all_words_and_definitions(){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\t\tfound_words += child.get_all_words_and_definitions();\n\t\t}\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word +\" & \" + definition + \"\\n\" + found_words ;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word +\" & \" + definition + \"\\n\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}", "private List<String> help(String s, Set<String> wordDict) {\n\t\tList<String> ret = new ArrayList<>();\n\n\t\tif (wordDict.contains(s))\n\t\t\tret.add(s);\n\t\telse\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif (wordDict.contains(s.substring(0, i + 1))) {\n\n//\t\t\t\t\tSystem.out.println(s.substring(0, i + 1));\n\n\t\t\t\t\tList<String> tmp = help(s.substring(i + 1), wordDict);\n\t\t\t\t\tif (tmp.size() > 0) {\n\t\t\t\t\t\tret.add(s.substring(0, i + 1));\n\t\t\t\t\t\tret.addAll(tmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\treturn ret;\n\t}", "public ArrayList<MusicalPhrase> getPhrases() {\n ArrayList<MusicalPhrase> copy = new ArrayList<MusicalPhrase>(this.phrases.size());\n for (MusicalPhrase m : this.phrases) \n copy.add(m.clone());\n return copy;\n }", "private static void demonstrateListOperation(IndexWord word) throws JWNLException {\n PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));\n System.out.println(\"Direct hypernyms of \\\"\" + word.getLemma() + \"\\\":\");\n for(int idx = 0; idx < hypernyms.size(); idx++){\n PointerTargetNode nn = (PointerTargetNode)hypernyms.get(idx);\n for(int wrdIdx = 0; wrdIdx < nn.getSynset().getWordsSize(); wrdIdx++){\n System.out.println(\"Syn\" + idx + \" of direct hypernyms of\\\"\" + word.getLemma() + \"\\\" : \" +\n nn.getSynset().getWord(wrdIdx).getLemma());\n }\n }\n hypernyms.print();\n }", "public WordNet(String synsets, String hypernyms) {\n synsetStream = new In(synsets);\n hypernymStream = new In(hypernyms);\n\n // go through all synsets\n while (synsetStream != null && synsetStream.hasNextLine()) {\n synsetString = synsetStream.readLine();\n String[] synsetStrLine = synsetString.split(\",\");\n Integer id = Integer.parseInt(synsetStrLine[0]);\n String[] synsetsArray = synsetStrLine[1].split(\"\\\\s+\");\n sFile.put(id, synsetsArray);\n }\n for (String[] nounSet : sFile.values()) {\n for (String str : nounSet) {\n sNounSet.add(str);\n }\n }\n while (hypernymStream != null && hypernymStream.hasNextLine()) {\n hypernymString = hypernymStream.readLine();\n String[] hyponymArray = hypernymString.split(\",\");\n Integer synsetID = Integer.parseInt(hyponymArray[0]);\n TreeSet hyponymSet = new TreeSet();\n for (int i = 1; i < hyponymArray.length; i++) {\n Integer hyponymID = Integer.parseInt(hyponymArray[i]);\n if (hFile.containsKey(synsetID)) {\n hFile.get(synsetID).add(hyponymID);\n } else {\n hyponymSet.add(hyponymID);\n hFile.put(synsetID, hyponymSet);\n }\n }\n\n }\n theDigraph = new Digraph(sFile.size());\n for (Integer key : hFile.keySet()) {\n for (Object curr : hFile.get(key)) {\n theDigraph.addEdge(key, (int) curr);\n }\n }\n }", "public List<String> getAllWords() {\n List<String> words = new ArrayList<>();\n // get the words to the list\n getAllWords(root, \"\", 0, words);\n // and return the list of words\n return words;\n }", "Set<Keyword> listKeywords();", "private Set<String> replacementHelper(String word) {\n\t\tSet<String> replacementWords = new HashSet<String>();\n\t\tfor (char letter : LETTERS) {\n\t\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\t\treplacementWords.add(word.substring(0, i) + letter + word.substring(i + 1));\n\t\t\t}\n\t\t}\n\t\treturn replacementWords;\n\t}", "public List<String> analogyWords(String w1,String w2,String w3) {\n TreeSet<VocabWord> analogies = analogy(w1, w2, w3);\n List<String> ret = new ArrayList<>();\n for(VocabWord w : analogies) {\n String w4 = cache.wordAtIndex(w.getIndex());\n ret.add(w4);\n }\n return ret;\n }", "HashSet<String> removeDuplicates(ArrayList<String> words) {\n\t\tHashSet<String> keywords = new HashSet<String>();\n\t\tkeywords.addAll(words);\n\t\treturn keywords;\n\t}", "public Set<String> nouns() {\n return sNounSet;\n }", "public Set<String> getLocations(String word) {\n\t\tif (this.invertedIndex.get(word) == null) {\n\t\t\treturn Collections.emptySet();\n\t\t} else {\n\t\t\treturn Collections.unmodifiableSet(this.invertedIndex.get(word).keySet());\n\t\t}\n\t}", "public Collection<String> words() {\n Collection<String> words = new ArrayList<String>();\n TreeSet<Integer> keyset = new TreeSet<Integer>();\n keyset.addAll(countToWord.keySet());\n for (Integer count : keyset) {\n words.addAll(this.countToWord.get(count));\n }\n return words;\n }", "public boolean isNoun (String word){\n for(int i = 0; i< SynSets.length; i++){\n if(SynSets[0][1].contains(\" \"+word+\" \")) return true;\n }\n return false;\n }", "public List<Word> getRelatedWordsSameLanguage() {\n if (this._relatedSameLanguage == null) {\n this._relatedSameLanguage = MainActivity.db.getRelatedWordsByIdAndLanguage(this._id, this._language);\n }\n return this._relatedSameLanguage;\n }", "public HangmanManager(Set<String> words) {\r\n \t//Check Preconditions\r\n \tif (words == null || words.size() <= 0) {\r\n \t\tthrow new IllegalArgumentException(\"pre: words != null, words.size() > 0\");\r\n \t}\r\n \t\r\n \t//Build Dictionary ArrayList using iterator\r\n \tdictionary = new ArrayList <String>();\r\n \tIterator<String> iterator = words.iterator();\r\n \twhile (iterator.hasNext()) {\r\n \t\tdictionary.add(iterator.next());\r\n \t}\r\n }", "public HashSet<String> getHypernymsLexical(String linkedConcept, Language language) {\n String key = linkedConcept + \"_\" + language.toSparqlChar2();\n HashSet<String> result = new HashSet<>();\n if (linkedConcept.startsWith(WikidataLinker.MULTI_CONCEPT_PREFIX)) {\n Set<String> individualLinks = this.linker.getUris(linkedConcept);\n for (String individualLink : individualLinks) {\n result.addAll(getHypernymsLexical(individualLink, language));\n }\n } else {\n String queryString = \"PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\\n\" +\n \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\n\" +\n \"PREFIX wdt: <http://www.wikidata.org/prop/direct/>\\n\" +\n \"SELECT DISTINCT ?l WHERE { \\n\" +\n \" { <\" + linkedConcept + \"> wdt:P31 ?c . \\n\" +\n \" ?c rdfs:label ?l .\\n\" +\n \" }\\n\" +\n \" UNION\\n\" +\n \" { <\" + linkedConcept + \"> wdt:P31 ?c . \\n\" +\n \" ?c skos:altLabel ?l .\\n\" +\n \" }\\n\" +\n \" UNION\\n\" +\n \" { <\" + linkedConcept + \"> wdt:P279 ?c . \\n\" +\n \" ?c rdfs:label ?l .\\n\" +\n \" }\\n\" +\n \" UNION\\n\" +\n \" { <\" + linkedConcept + \"> wdt:P279 ?c . \\n\" +\n \" ?c skos:altLabel ?l .\\n\" +\n \" }\\n\" +\n \" FILTER(LANG(?l) = '\" + language.toSparqlChar2() + \"')\\n\" +\n \"}\";\n //System.out.println(queryString);\n Query query = QueryFactory.create(queryString);\n QueryExecution queryExecution = QueryExecutionFactory.sparqlService(ENDPOINT_URL, query);\n ResultSet resultSet = queryExecution.execSelect();\n while (resultSet.hasNext()) {\n QuerySolution solution = resultSet.next();\n String uri = solution.getLiteral(\"l\").getLexicalForm();\n result.add(uri);\n }\n queryExecution.close();\n }\n hypernymyBuffer.put(key, result);\n commitAll(WIKIDATA_HYPERNYMY_BUFFER);\n return result;\n }", "private ISet<String> getKeySet(IList<String> words) {\n\t\tISet<String> keySet = new ChainedHashSet<String>();\n\t\tfor (String word: words) {\n\t\t\tkeySet.add(word);\n\t\t}\n\t\treturn keySet;\n }", "static private void adjustSynonyms(DataManager manager, SchemaInfo schemaInfo, List<Term> oldTerms, ArrayList<Term> newTerms) throws Exception\r\n\t{\r\n\t\t// Create a hash of all old terms\r\n\t\tHashMap<Integer,Term> oldTermHash = new HashMap<Integer,Term>();\r\n\t\tfor(Term oldTerm : oldTerms) oldTermHash.put(oldTerm.getId(), oldTerm);\r\n\t\t\r\n\t\t// Store the list of new and updated synonyms\r\n\t\tArrayList<AssociatedElement> newElements = new ArrayList<AssociatedElement>();\r\n\t\tArrayList<SchemaElement> updatedSynonyms = new ArrayList<SchemaElement>();\r\n\t\t\r\n\t\t/** Cycle through all terms to examine associated elements */\r\n\t\tfor(Term newTerm : newTerms)\r\n\t\t{\r\n\t\t\t// Get the associated old term\r\n\t\t\tTerm oldTerm = oldTermHash.get(newTerm.getId());\r\n\t\t\t\r\n\t\t\t// Identify which synonyms to add and update\r\n\t\t\tfor(AssociatedElement element : newTerm.getElements())\r\n\t\t\t{\r\n\t\t\t\tif(element.getElementID()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Swap out term names in element already exists\r\n\t\t\t\t\tSchemaElement oldElement = schemaInfo.getElement(element.getElementID());\r\n\t\t\t\t\tString description = element.getDescription()==null ? \"\" : element.getDescription();\r\n\t\t\t\t\tif(!element.getName().equals(oldElement.getName()) || !description.equals(oldElement.getDescription()))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSchemaElement updatedElement = oldElement.copy();\r\n\t\t\t\t\t\tupdatedElement.setName(element.getName());\r\n\t\t\t\t\t\tupdatedElement.setDescription(element.getDescription());\r\n\t\t\t\t\t\tupdatedSynonyms.add(updatedElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\telement.setElementID(newTerm.getId());\r\n\t\t\t\t\tnewElements.add(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Generate a hash map of all new associated elements\r\n\t\t\tHashMap<Integer,AssociatedElement> newElementHash = new HashMap<Integer,AssociatedElement>();\r\n\t\t\tfor(AssociatedElement newElement : newTerm.getElements())\r\n\t\t\t\tnewElementHash.put(newElement.getElementID(), newElement);\r\n\t\t\t\r\n\t\t\t// Delete old synonyms\r\n\t\t\tif(oldTerm!=null)\r\n\t\t\t\tfor(AssociatedElement oldElement : oldTerm.getElements())\r\n\t\t\t\t\tif(!newElementHash.containsKey(oldElement.getElementID()))\r\n\t\t\t\t\t\tif(!manager.getSchemaElementCache().deleteSchemaElement(oldElement.getElementID()))\r\n\t\t\t\t\t\t\tthrow new Exception(\"Failed to delete thesaurus synonym\");\r\n\t\t}\r\n\r\n\t\t// Create the new synonyms\r\n\t\tArrayList<SchemaElement> newSynonyms = new ArrayList<SchemaElement>();\r\n\t\tInteger counter = manager.getUniversalIDs(newElements.size());\r\n\t\tfor(AssociatedElement element : newElements)\r\n\t\t\tnewSynonyms.add(new Synonym(counter++,element.getName(),element.getDescription(),element.getElementID(),schemaInfo.getSchema().getId()));\r\n\t\t\r\n\t\t// Add the new and updated synonyms to the thesaurus schema\r\n\t\tboolean success = manager.getSchemaElementCache().addSchemaElements(newSynonyms);\r\n\t\tif(success) success = manager.getSchemaElementCache().updateSchemaElements(updatedSynonyms);\r\n\t\tif(!success) throw new Exception(\"Failed to update vocabulary schema\");\r\n\t}", "@Override\n\tpublic Set<OWLEntity> getAllConcepts() {\n\t\tSet<OWLEntity> result = new HashSet<OWLEntity>();\n\t\tresult.addAll(ontology.getClassesInSignature());\n\t\tresult.addAll(ontology.getIndividualsInSignature());\n\t\treturn result;\n\t}", "public List<Stem> uniqueStems(char word[], int length) {\n List<Stem> stems = new ArrayList<Stem>();\n CharArraySet terms = new CharArraySet(dictionary.getVersion(), 8, dictionary.isIgnoreCase());\n if (dictionary.lookupWord(word, 0, length) != null) {\n stems.add(new Stem(word, length));\n terms.add(word);\n }\n List<Stem> otherStems = stem(word, length, null, 0);\n for (Stem s : otherStems) {\n if (!terms.contains(s.stem)) {\n stems.add(s);\n terms.add(s.stem);\n }\n }\n return stems;\n }", "public String showSearchSynonym(String searchWord, ArrayList<String> words) {\n StringBuilder stringBuilder = new StringBuilder(\"Your word \\\"\" + searchWord + \"\\\" has \" + words.size()\n + (words.size() == 1 ? \" synonym:\\n\" : \" synonyms:\\n\"));\n for (int i = 0; i < words.size(); i++) {\n stringBuilder.append(words.get(i) + \"\\n\");\n }\n return stringBuilder.toString();\n }", "@ZAttr(id=1073)\n public String[] getPrefSpellIgnoreWord() {\n return getMultiAttr(Provisioning.A_zimbraPrefSpellIgnoreWord);\n }", "public Set<String> getAllKnownWords() throws IOException {\n log.info(\"Reading all data to build known words set.\");\n Set<String> words = new HashSet<>();\n if (this.hasTrain()) {\n for (AnnoSentence sent : getTrainInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasDev()) {\n for (AnnoSentence sent : getDevInput()) {\n words.addAll(sent.getWords());\n }\n }\n if (this.hasTest()) {\n for (AnnoSentence sent : getTestInput()) {\n words.addAll(sent.getWords());\n }\n }\n return words;\n }", "public List<Stem> stem(String word) {\n return stem(word.toCharArray(), word.length());\n }", "public void setAutoGenerateMultiTermSynonymsPhraseQuery(boolean enable) {\n this.autoGenerateMultiTermSynonymsPhraseQuery = enable;\n }", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "@Override\n\tpublic Set<String> getPathSet(String word) {\n\t\tlock.lockReadOnly();\n\t\ttry {\n\t\t\treturn super.getPathSet(word);\n\t\t} finally {\n\t\t\tlock.unlockReadOnly();\n\t\t}\n\t}", "private List<Query> createSynonymQueries(SolrParams solrParams, List<String> alternateQueryTexts) {\n \n String nullsafeOriginalString = getQueryStringFromParser();\n \n List<Query> result = new ArrayList<>();\n for (String alternateQueryText : alternateQueryTexts) {\n if (alternateQueryText.equalsIgnoreCase(nullsafeOriginalString)) { \n // alternate query is the same as what the user entered\n continue;\n }\n \n synonymQueryParser.setString(alternateQueryText);\n try {\n result.add(synonymQueryParser.parse());\n } catch (SyntaxError e) {\n // TODO: better error handling - for now just bail out; ignore this synonym\n e.printStackTrace(System.err);\n }\n }\n \n return result;\n }", "public List<Word> getRelatedWordsOtherLanguage() {\n if (this._relatedOppositeLanguage == null) {\n this._relatedOppositeLanguage = MainActivity.db.getRelatedWordsByIdAndLanguage(this._id, this.getOppositeLanguage());\n }\n return this._relatedOppositeLanguage;\n }", "public Set<String> getStopwords() {\n return stopwords;\n }", "private Set<String> deletionHelper(String word) {\n\t\tSet<String> deletionWords = new HashSet<String>();\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tdeletionWords.add(word.substring(0, i) + word.substring(i + 1));\n\t\t}\n\t\treturn deletionWords;\n\t}", "public static List<TokenCanonic> stemWords(String wordList) {\n List<TokenCanonic> result = new ArrayList<TokenCanonic>(); \n String [] tokens = wordList.split(\"\\\\s+\");\n for (String t : tokens) {\n if (t.trim().equals(\"\")) continue;\n TokenCanonic tc = new TokenCanonic(); \n tc.token = t; tc.canonic = stemWord(t);\n result.add(tc);\n }\n return result;\n }", "public Iterable<String> nouns() {\n return nounMap.keySet();\n }", "public Set<String> getStopWords() throws Exception{\n\tFile file = new File(\"stopWords/stopwords.txt\");\n\tHashSet<String> stopwords = new HashSet<>();\n\tBufferedReader br = new BufferedReader(new FileReader(file));\n\tString line;\n\twhile((line=br.readLine())!=null){\n\t\tString[] tokens = line.split(\" \");\n\t\tfor(String token : tokens){\n\t\t\tif(!stopwords.contains(token)){\n\t\t\t\tstopwords.add(token);\n\t\t\t}\n\t\t}\n\t}\n\tbr.close();\n\treturn stopwords;\n\t}", "public Iterable<String> nouns()\n {\n return h.navigableKeySet();\n }", "public void parseThesaurus() throws IOException {\r\n\t\t\t//We create an object below to read the thesaurus file\r\n\t\t\tFileInputStream fis = new FileInputStream(\"src//ie//gmit//dip//resources//MobyThesaurus3.txt\");\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(fis));\r\n\t\t\t List <List<String>> listOflist= new ArrayList<>();\r\n\t\t\t// HashMap<String,List> tMap = new HashMap<>();\t\t\r\n\t\t\t List <String> individualListOfSynonyms= new ArrayList <String>();\r\n\r\n\t\t\t \r\n\t\t\t //we create a hashmap with the first word being the key value and the rest a list of synonims we will use\r\n\t\t\twhile(br.readLine()!=null) {\r\n\t\t\t\t\r\n\t\t\t\tString somestring = br.readLine();\r\n\t\t\t\tString[] testsplit= somestring.split(\",\");\r\n\t\t\t\tindividualListOfSynonyms=Arrays.asList(testsplit);\r\n\t\t\t\tString indexvalue=individualListOfSynonyms.get(0).toString();\r\n\t\t\t tMap.put(indexvalue, individualListOfSynonyms);\r\n\t\t\t //br.close();\r\n\t\t\t //System.out.println(tMap);\r\n\t\t\t }\r\n\t\t\t}" ]
[ "0.83441776", "0.83020806", "0.8270777", "0.80640244", "0.78625053", "0.77634263", "0.7690462", "0.7248943", "0.67365354", "0.65405685", "0.64929867", "0.6404896", "0.6283472", "0.60986054", "0.60976255", "0.6093662", "0.59597576", "0.5938776", "0.59035957", "0.5893929", "0.58301187", "0.5803035", "0.5796523", "0.5795081", "0.5784414", "0.57797843", "0.5745571", "0.57024586", "0.57021976", "0.5673698", "0.564733", "0.5607527", "0.559844", "0.5579574", "0.5574524", "0.5571807", "0.55589926", "0.5531994", "0.5512469", "0.54587805", "0.5440378", "0.5434709", "0.5433218", "0.54106563", "0.54027724", "0.53282976", "0.5316187", "0.5307962", "0.53076017", "0.52810425", "0.5267333", "0.52617973", "0.5259003", "0.52495867", "0.52368665", "0.5234705", "0.5204391", "0.51617587", "0.5140674", "0.51155084", "0.5098345", "0.5097462", "0.5081336", "0.50756705", "0.50693107", "0.5065702", "0.5049778", "0.50445807", "0.50297076", "0.50293535", "0.5012323", "0.49965656", "0.49895713", "0.4987175", "0.4982515", "0.49745592", "0.49657488", "0.49634108", "0.4957106", "0.49559262", "0.49546418", "0.49417835", "0.49314952", "0.4901308", "0.49003887", "0.4878983", "0.48662102", "0.4861597", "0.484747", "0.48305613", "0.48298147", "0.4828378", "0.48260322", "0.48194978", "0.4818358", "0.48081896", "0.48049274", "0.48047993", "0.480309", "0.4802183" ]
0.85179937
0
Gets the events from the police database given the specified parameters.
public PoliceObject[] getPolice(String type, String startDate, String endDate) { LinkedList<PoliceObject> list = new LinkedList<>(); boolean hasType = (!type.equals("*")); boolean hasStart = (!startDate.equals("*")); boolean hasEnd = (!endDate.equals("*")); boolean hasDate = (hasStart && hasEnd); if (hasType && hasDate) { LocalDate formattedStart = LocalDate.parse(startDate); LocalDate formattedEnd = LocalDate.parse(endDate); this.policeDB.values().forEach(e -> { if (e.getType().equals(type)) { if (checkDate(e, formattedStart, formattedEnd)) { list.add(e); } } }); } else if (hasType) { this.policeDB.values().forEach(e -> { if (e.getType().equals(type)) { list.add(e); } }); } else if (hasDate) { LocalDate formattedStart = LocalDate.parse(startDate); LocalDate formattedEnd = LocalDate.parse(endDate); this.policeDB.values().forEach(e -> { if (checkDate(e, formattedStart, formattedEnd)) { list.add(e); } }); } else { list.addAll(this.policeDB.values()); } PoliceObject[] array = new PoliceObject[list.size()]; for (int i=0; i<list.size(); i++) { array[i] = list.get(i); } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Events> retrieveEvents() {\n Connection conn = null;\n PreparedStatement stmt = null;\n ResultSet rs = null;\n String sql = \"\";\n List<Events> results = new ArrayList<>();\n\n try {\n conn = ConnectionManager.getConnection();\n\n sql = \"SELECT eventID, eventName, eventDate, eventOwner, eventPriority, eventDeadline, eventProcessStatus, eventLocation, comments FROM \" + TBLNAME;\n stmt = conn.prepareStatement(sql);\n\n rs = stmt.executeQuery();\n\n while (rs.next()) {\n //Retrieve by column name\n String eventID = rs.getString(\"eventID\");\n String eventName = rs.getString(\"eventName\");\n Date eventDate = rs.getDate(\"eventDate\");\n String eventOwner = rs.getString(\"eventOwner\");\n String eventPriority = rs.getString(\"eventPriority\");\n Date eventDeadline = rs.getDate(\"eventDeadline\");\n String eventProcessStatus = rs.getString(\"eventProcessStatus\");\n String eventLocation = rs.getString(\"eventLocation\");\n String comments = rs.getString(\"comments\");\n\n Events obj = new Events(eventID, eventName, eventDate, eventOwner, eventPriority, eventDeadline, eventProcessStatus, eventLocation, comments);\n results.add(obj);\n }\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n } finally {\n ConnectionManager.close(conn, stmt, rs);\n\n }\n return results;\n }", "public List<Event> getEvents() {\n List<Event> events = new ArrayList<>();\n\n Query query = new Query(\"Event\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID eventId = UUID.fromString(idString);\n String speaker = (String) entity.getProperty(\"speaker\");\n String organization = (String) entity.getProperty(\"organization\");\n String eventDate = (String) entity.getProperty(\"eventDate\");\n Location location = (Location) entity.getProperty(\"location\");\n List<String> amenities = getAmenities(eventId);\n String externalLink = (String) entity.getProperty(\"externalLink\");\n PublicType publicType = (PublicType) entity.getProperty(\"publicType\");\n long ownerId = (long) entity.getProperty(\"ownerId\");\n List<ThreadComment> thread = getThread(eventId);\n // long timeStamp = (long) entity.getProperty(\"timestamp\");\n\n Event event = new Event(eventId, speaker, organization, eventDate, location, amenities, externalLink,\n publicType, ownerId);\n event.copyThread(thread);\n events.add(event);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading event.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return events;\n }", "private void queryEvents() {\n ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n // include data referred by user key\n query.include(Event.KEY_HOST);\n // limit query to latest 20 items\n query.setLimit(30);\n // order posts by creation date (newest first)\n query.addDescendingOrder(\"createdAt\");\n // start an asynchronous call for events\n query.findInBackground(new FindCallback<Event>() {\n @Override\n public void done(List<Event> events, com.parse.ParseException e) {\n\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n // for debugging purposes let's print every event description to logcat\n for (Event event : events) {\n Log.i(TAG, \"Event: \" + event.getDescription() + \", username: \" + event.getHost().getUsername());\n }\n\n // save received events to list and notify adapter of new data\n allEvents.addAll(events);\n }\n\n });\n }", "public EventList getEvents(String userName) {\n try {\n PreparedStatement s = sql.prepareStatement(\"SELECT userId, eventName, startMonth, startDay, startYear, startHour, startMinute\" +\n \", endMonth, endDay, endYear, endHour, endMinute FROM Events WHERE userId=?\");\n s.setInt(1, getIdOfUser(userName));\n s.execute();\n ResultSet results = s.getResultSet();\n\n EventList events = new EventList();\n if (!results.isBeforeFirst()) {\n return events;\n }\n\n while (!results.isLast()) {\n results.next();\n Event e = new Event(userName, results.getString(2),\n results.getInt(3), results.getInt(4), results.getInt(5),\n results.getInt(6), results.getInt(7), results.getInt(8),\n results.getInt(9), results.getInt(10), results.getInt(11),\n results.getInt(12));\n events.add(e);\n }\n results.close();\n s.close();\n events.sort();\n\n return events;\n } catch (SQLException e) {\n System.err.println(\"SQLE\");\n sqlException(e);\n return null;\n }\n }", "@LogExceptions\n public synchronized List<Event> getEvents(String date) throws SQLException {\n Connection conn = DatabaseConnection.getConnection();\n \n try(PreparedStatement stmt = \n conn.prepareStatement(SELECT_EVENT_DATE))\n {\n stmt.setString(1, date);\n evtList.clear();\n try(ResultSet rs = stmt.executeQuery()) {\n while(rs.next()) {\n Event event = new Event();\n event.setID(rs.getInt(1));\n event.setEvent(rs.getString(2));\n event.setDescription(rs.getString(3));\n event.setLocation(rs.getString(4));\n event.setDate(rs.getString(5));\n event.setStart(rs.getString(9));\n event.setEnd(rs.getString(10));\n evtList.add(event);\n }\n } \n } \n return evtList;\n }", "List<Event> findAllBy();", "private void getDataFromApi() throws IOException {\n DateTime now = new DateTime(System.currentTimeMillis());\n Events events = mService.events().list(\"primary\")\n .setTimeMin(now)\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n List<Event> items = events.getItems();\n ScheduledEvents scheduledEvents;\n EventsList.clear();\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n if (start == null) {\n start = event.getStart().getDate();\n }\n DateTime end = event.getEnd().getDateTime();\n if (end == null) {\n end = event.getStart().getDate();\n }\n scheduledEvents = new ScheduledEvents();\n scheduledEvents.setEventId(event.getId());\n scheduledEvents.setDescription(event.getDescription());\n scheduledEvents.setEventSummery(event.getSummary());\n scheduledEvents.setLocation(event.getLocation());\n scheduledEvents.setStartDate(dateTimeToString(start));\n scheduledEvents.setEndDate(dateTimeToString(end));\n StringBuffer stringBuffer = new StringBuffer();\n if(event.getAttendees()!=null) {\n for (EventAttendee eventAttendee : event.getAttendees()) {\n if(eventAttendee.getEmail()!=null)\n stringBuffer.append(eventAttendee.getEmail() + \" \");\n }\n scheduledEvents.setAttendees(stringBuffer.toString());\n }\n else{\n scheduledEvents.setAttendees(\"\");\n }\n EventsList.add(scheduledEvents);\n }\n }", "public List<Events> getAllSystemEventsListForAll();", "public Event[] getEvents(String userName)\n throws DatabaseException {\n\n PreparedStatement stmt = null;\n ResultSet rs = null;\n try {\n String sql =\n \"select * \" +\n \"from Events \" +\n \"where Descendant = ?\";\n stmt = connection.prepareStatement(sql);\n stmt.setString(1, userName);\n\n rs = stmt.executeQuery();\n\n ArrayList<Event> events = new ArrayList<>();\n\n // if user was found, return model object\n while (rs.next()) {\n events.add(new Event(\n rs.getString(1), // EventID\n rs.getString(2), // Descendant\n rs.getString(3), // PersonID\n rs.getDouble(4), // Latitude\n rs.getDouble(5), // Longitude\n rs.getString(6), // Country\n rs.getString(7), // City\n rs.getString(8), // Type\n rs.getInt(9) // Year\n ));\n }\n\n Object[] array = events.toArray();\n return Arrays.copyOf(array, array.length, Event[].class);\n } catch (SQLException e) {\n throw new DatabaseException(e);\n } finally {\n\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) {\n logger.log(Level.FINEST, e.getMessage(), e);\n }\n }\n\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n logger.log(Level.FINEST, e.getMessage(), e);\n }\n }\n\n }\n }", "public List<Event> getEventsList() {\n List<Event> eventDetails = eventRepository.findAll();\n return eventDetails;\n }", "public String[] getEventsList(){\n Connection con = null;\n PreparedStatement st = null;\n ResultSet rs = null;\n Vector<String> list = new Vector<String>();\n String[] result = null;\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-YY\");\n try{\n //obtain the database connection by calling getConn()\n con = getConn();\n //build sql\n String sql = \"select name,to_date(start_time,'DD-MM-YY'),to_date(end_time,'DD-MM-YY') from event\" ;\n \n //create the PreparedStatement from the Connection object by calling prepareCall\n //method, passing it the sql \n st = con.prepareCall(sql);\n \n //Calls executeQuery and the resulting data is returned in the resultset\n rs = st.executeQuery();\n \n //loop through the result set and save the data in the datamodel objects\n while (rs.next()){\n list.add(sdf.format(rs.getDate(2)) + \",\" + sdf.format(rs.getDate(3)) + \",\" + rs.getString(\"name\"));\n \n }\n \n result = new String[list.size()];\n for (int i = 0 ; i< list.size() ; i++){\n result[i] = list.get(i);\n \n }\n }\n catch (SQLException ex){\n ex.printStackTrace();\n }\n \n //close the resultset,preparedstatement and connection to relase resources \n if (rs != null){\n try{\n rs.close();\n rs = null;\n }\n catch (SQLException e){\n \n }\n }\n if (st != null){\n try{\n st.close();\n st = null;\n }\n catch (SQLException e){\n \n }\n }\n \n if (con != null){\n try{\n con.close();\n con = null;\n }\n catch (SQLException e){\n \n }\n }\n \n return result;\n }", "Collection<CalendarEvent> getActiveEvents(long when)\n{\n List<CalendarEvent> rslt = new ArrayList<CalendarEvent>();\n try {\n getAllEvents(when);\n rslt.addAll(cal_events);\n }\n catch (Exception e) {\n BasisLogger.logE(\"GOOGLECAL: problem getting events\",e);\n }\n return rslt;\n}", "public ArrayList<Event> retriveTableEventDetails() throws SQLException {\n\t\tArrayList<Event> arr = new ArrayList<Event>();\r\n\r\n\t\tarr = dao.getEventDetailsDao();\r\n//\t\tfor (Event a : arr) {\r\n//\t\t\tSystem.out.println(\"service\" + a.getEvent_id());\r\n//\t\t}\r\n\t\treturn arr;\r\n\t}", "public abstract Map<String, Event> getEvents();", "List<Event> getAllEventsByTitle(String title);", "public Vector<Event> getEventsInDay(Date par){\n Connection con = null;\n PreparedStatement st = null;\n ResultSet rs = null;\n Vector<Event> result = new Vector<Event>();\n try {\n //obtain the database connection by calling getConn()\n con = getConn();\n \n SimpleDateFormat format1 = new SimpleDateFormat(\"dd-MM-YY\");\n \n //build the sql statement\n String sql = \"select * from event where to_date('\" + format1.format(par) + \"','DD-MM-YY') \";\n sql+= \"between to_date(start_time,'DD-MM-YY') and to_date(end_time,'DD-MM-YY')\";\n \n \n //System.out.println(sql);\n //create the PreparedStatement from the Connection object by calling prepareCall\n //method, passing it the sql that is constructed using the supplied parameters\n st = con.prepareCall(sql);\n \n \n //Calls executeQuery and the resulting data is returned in the resultset\n rs = st.executeQuery();\n \n //loop through the result set and save the data in the datamodel objects\n while (rs.next()){\n \n Event e = new Event(rs.getLong(\"id\"),rs.getString(\"id\") + \",\" + rs.getString(\"name\"),rs.getDate(\"start_time\"),rs.getDate(\"end_time\"));\n ;\n result.add(e);\n \n }\n \n }\n catch (SQLException e){\n e.printStackTrace();\n }\n //close the resultset,preparedstatement and connection to relase resources \n if (rs != null){\n try{\n rs.close();\n rs = null;\n }\n catch (SQLException e){\n \n }\n }\n if (st != null){\n try{\n st.close();\n st = null;\n }\n catch (SQLException e){\n \n }\n }\n \n \n \n if (con != null){\n try{\n con.close();\n con = null;\n }\n catch (SQLException e){\n \n }\n }\n return result;\n \n \n }", "@RequestMapping(value = \"/EventJour\")\n\t\tpublic List<Events> getEventsParDate() {\n\t\t\treturn eventDAO.getEventsParDate();\n\t\t}", "@WebMethod public List<Event> getAllEvents();", "public Event getEventDetails(String par){\n String[] arr = par.split(\",\");\n SimpleDateFormat format1 = new SimpleDateFormat(\"dd-MM-YY\");\n //build sql\n String sql = \"select e.id,e.name,e.start_time,e.end_time,v.name as vname,v.line_1,v.postcode,v.description\"\n + \",v.id as vid from event e,seating_plan s,venue v where \"\n + \"to_date(start_time,'DD-MM-YY') = to_date('\" + arr[0];\n sql = sql + \"','DD-MM-YY') and to_date(end_time,'DD-MM-YY') = to_date('\" + arr[1] + \"','DD-MM-YY') \";\n sql += \"and e.seating_plan_id = s.id and s.venue_id = v.id\";\n \n \n Connection con = null;\n PreparedStatement st = null;\n ResultSet rs = null;\n \n PreparedStatement stbill = null;\n ResultSet rsbill = null;\n \n Event result = null;\n \n try{\n //obtain the database connection by calling getConn()\n con = getConn();\n \n //create the PreparedStatement from the Connection object by calling prepareCall\n //method, passing it the sql that is constructed using the supplied parameters\n st = con.prepareCall(sql);\n \n //Calls executeQuery and the resulting data is returned in the resultset\n rs = st.executeQuery();\n Calendar cal1 = Calendar.getInstance();\n Calendar cal2 = Calendar.getInstance();\n \n //loop through the result set and save the data in the datamodel objects\n while (rs.next()){\n \n result = new Event(rs.getLong(\"id\"),rs.getString(\"name\"),rs.getDate(\"start_time\"),rs.getDate(\"end_time\"));\n Venue v = new Venue(rs.getString(\"vname\"),0d,0d);\n v.setId(rs.getLong(\"vid\"));\n v.setAddr1(rs.getString(\"line_1\"));\n v.setDescription(\"description\");\n v.setPostcode(rs.getString(\"postcode\"));\n result.setVenue(v);\n \n sql = \"select b.lineup_order,a.name,t.name as tname from billing b,artist a,tour t where \"\n + \"b.event_id=\" + rs.getString(\"id\") + \" and b.tour_id = t.id\";\n sql += \" and b.artist_id = a.id\";\n stbill = con.prepareCall(sql);\n rsbill = stbill.executeQuery();\n ArrayList<Billing> billArr = new ArrayList<Billing>();\n \n while (rsbill.next()){\n Artist a = new Artist(0l,rsbill.getString(\"name\") + \",\" + rsbill.getString(\"tname\"),\n null,null,null,null);\n Billing b = new Billing(0l,a,null,rsbill.getInt(\"lineup_order\"));\n billArr.add(b);\n }\n \n result.setBillings(billArr);\n \n }\n \n \n \n }\n catch (SQLException ex){\n ex.printStackTrace();\n }\n //close the resultset,preparedstatement and connection to relase resources \n if (rs != null){\n try{\n rs.close();\n rs = null;\n }\n catch (SQLException e){\n \n }\n }\n if (st != null){\n try{\n st.close();\n st = null;\n }\n catch (SQLException e){\n \n }\n }\n \n if (rsbill != null){\n try{\n rsbill.close();\n rsbill = null;\n }\n catch (SQLException e){\n \n }\n }\n if (stbill != null){\n try{\n stbill.close();\n stbill = null;\n }\n catch (SQLException e){\n \n }\n }\n \n \n if (con != null){\n try{\n con.close();\n con = null;\n }\n catch (SQLException e){\n \n }\n }\n return result;\n \n \n }", "public Observable getEvents(){\n QBRequestGetBuilder requestBuilder = new QBRequestGetBuilder();\n requestBuilder.sortDesc(\"startDate\");\n return makeObservable(requestBuilder);\n }", "private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n List<Event> items = events.getItems();\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n if (start == null) {\n // All-day events don't have start times, so just use\n // the start date.\n start = event.getStart().getDate();\n }\n eventStrings.add(\n String.format(\"%s (%s)\", event.getSummary(), start));\n }\n return eventStrings;\n }", "public List<Events> getAllEventsAndHistoryForUser(long userId);", "@WebMethod\t\r\n\tpublic Vector<Event> getEvents(Date date) {\r\n\t\tDataAccess dbManager=new DataAccess();\r\n\t\tVector<Event> events=dbManager.getEvents(date);\r\n\t\tdbManager.close();\r\n\t\treturn events;\r\n\t}", "public List<Event> getEvents(int orgId) throws SQLException{\n\t\tlogger.info(\"[Organization] getEvents({})\", orgId);\n\t\t\n\n\t\tQueryBuilder<Event, Integer> queryBuilder = DB.eventDao.queryBuilder();\n\t\tWhere<Event, Integer> where = queryBuilder.where();\n\t\twhere.eq(\"organization_id\", orgId);\n\t\n\t\t\n\t\tqueryBuilder.orderBy(\"date\", true);\n\t\t\n\t\tPreparedQuery<Event> preparedQuery = queryBuilder.prepare();\n\n\t\t\n\t\treturn DB.eventDao.query(preparedQuery);\n\t}", "public List<Events> getCourseEventListByCourseId(int courseId);", "public ArrayList<FbEvent> getOngoingEvents() throws SQLException {\n\t\tArrayList<FbEvent> events = new ArrayList<FbEvent>();\n\t\tSQLiteDatabase db = tableHelper.getReadableDatabase();\n\t\ttry {\n\t\t\tCursor cursor = db.query(SQLTablesHelper.MY_EVENT_TABLE_NAME, columns,\n\t\t\t\t\tSQLTablesHelper.MY_EVENT_START_TIME + \" >= ?\",\n\t\t\t\t\tnew String[] {String.valueOf(TimeFrame.getUnixTime(TimeFrame.getTodayDate()))}, \n\t\t\t\t\tnull, null, null);\n\t\t\tcursor.moveToFirst();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\tFbEvent event = cursorToEvent(cursor);\n\t\t\t\tevents.add(event);\n\t\t\t\tcursor.moveToNext();\n\t\t\t}\n\t\t\tcursor.close();\n\t\t} finally {\n\t\t\tdb.close();\n\t\t}\n\t\treturn events;\n\t}", "@Override\n public List<EventNotification> getList() throws EwpException {\n String sql = \"SELECT * From PFEventNotification\";\n return executeSqlAndGetEntityList(sql);\n }", "List<Event> selectByExample(EventExample example);", "public Set<EventTO> getAllEventsByPreference(String preference) {\n Set<Event> events = eventRepository.findallByPreference(preference);\n if (!(events.isEmpty())) {\n LOGGER.info(\"Returning alls events with preference '{}'\", preference);\n return mapperService.convertToEventTO(events);\n }\n else {\n LOGGER.error(\"could not find any events with preference '{}'\", preference);\n throw new ResourceNotFoundException(\"Event not found\");\n }\n }", "@Override\r\n public List<Events> findAllEvents() {\r\n return em.createNamedQuery(\"Events.findAll\").getResultList();\r\n }", "@SuppressWarnings(\"finally\")\n\tpublic Event getEvent(int event_id) throws Exception\n\t{\n\t\tEvent res = null;\n\n\t\tString eve_name=null, eve_type=null, eve_param=null, eve_deviceEP=null;\n\t\tshort eve_deviceId=-1, eve_id=-1, eve_proto=-1, eve_prod_id=-1;\n\t\tchar eve_logicOperator=' ';\n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnection connection = openConnection();\n\t\t\tPreparedStatement queryingStatement;\n\t\t\tResultSet queryResult;\n\t\t\t\n\t\t\tqueryingStatement =connection.prepareStatement(k_selectEvent);\n\t\t\tqueryingStatement.setString(1, Integer.toString(event_id));\n\t\t\tqueryResult = queryingStatement.executeQuery();\n\t\t\t\t\t\n\t\t\tif (!queryResult.next())\n\t\t\t{\n\t\t\t\tthrow new SQLException(\"Wrong tables format - maximum ids fields weren't found!\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\teve_id = Short.parseShort(queryResult.getString(1));\n\t\t\t\teve_deviceId = Short.parseShort(queryResult.getString(2));\n\t\t\t\teve_proto = Short.parseShort(queryResult.getString(3));\n\t\t\t\teve_param = queryResult.getString(4);\n\t\t\t\teve_logicOperator = queryResult.getString(5).charAt(0);\n\t\t\t} \n\t\t\t\n\t\t\tqueryingStatement =connection.prepareStatement(k_selectEventProto);\n\t\t\tqueryingStatement.setString(1, Short.toString(eve_proto));\n\t\t\tqueryResult = queryingStatement.executeQuery();\n\t\t\t\t\t\n\t\t\tif (!queryResult.next())\n\t\t\t{\n\t\t\t\tthrow new SQLException(\"Wrong tables format - maximum ids fields weren't found!\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\teve_prod_id = Short.parseShort(queryResult.getString(2));\n\t\t\t\teve_name = queryResult.getString(3);\n\t\t\t\teve_type = queryResult.getString(5);\n\t\t\t} \n\t\t\t\n\t\t\tboolean isTriggered = false;\n\t\t\tboolean isEvent = true;\n\t\t\t\n\t\t\tActionEventProto eve_prototype = new ActionEventProto(eve_proto, eve_name, description, eve_type, supportedValues, min, max, eve_prod_id, eve_deviceEP, isEvent);\n\t\t\t//Action eveWithParamAndDevID = new Action(eve_id, eve_deviceId, eve_param, eve_prototype);\n\t\t\tEvent completeEvent = new Event(eve_id, eve_deviceId, eve_param, eve_prototype, eve_logicOperator, isTriggered);\n\t\t\tres = completeEvent;\n\t\t\t//res = new Event(eve_name, eve_type, eve_param, eve_logicOperator, eve_deviceEP, eve_deviceId);\n\t\t\t/*\n\t\t\t * NOTES:\n\t\t\t * 1. no need to create action and then deliver it to event.\n\t\t\t * 2. need to fetch isTriggered from DB in case that the event has already happened.\n\t\t\t * 3. need to fetch isEvent from DB to place in isEvent.\n\t\t\t * watch booleans isTriggered, and boolean isEvent in c'tors lines 747, 749.\n\t\t\t */\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseConnection();\n\t\t\treturn res;\n\t\t}\n\t}", "public ObservableList<Event> ReadEvent(){\n ObservableList <Event> list = FXCollections.observableArrayList();\n\n String req=\"SELECT * FROM event \";\n try{\n Statement st=cnx.createStatement();\n ResultSet rs=st.executeQuery(req);\n while(rs.next()){\n list.add(new Event(rs.getInt(1),rs.getString(2),rs.getDate(3),rs.getDate(4),rs.getString(5),rs.getString(6),rs.getString(7),rs.getInt(8),rs.getString(9),rs.getString(10),rs.getFloat(11),rs.getFloat(13),rs.getFloat(14)));\n \n }\n\n }catch(SQLException ex){\n System.out.println(ex.getMessage());\n }\n return list; \n }", "public ArrayList<CampusEvent> fetchEvents() {\n SQLiteDatabase dbObj = getReadableDatabase();\n ArrayList<CampusEvent> entryList = new ArrayList<CampusEvent>();\n\n Cursor cursor = dbObj.query(TABLE_EVENT_ENTRIES, mColumnList, null,\n null, null, null, null);\n\n while (cursor.moveToNext()) {\n CampusEvent event = cursorToEvent(cursor);\n entryList.add(event);\n }\n\n cursor.close();\n dbObj.close();\n\n return entryList;\n }", "@Path(\"/showAll\")\n\t@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<EventData> getAllEvent() throws JSONException {\n\t\tString today_frm = DateUtil.getNow(DateUtil.SHORT_FORMAT_TYPE);\n\t\tList<Event> list = eventService.getEventsByType(today_frm,\n\t\t\t\tEventType.EVENTTODAY);\n\t\tList<EventData> d = null;\n\t\tif (null != list && list.size() > 0) {\n\t\t\td = getEventsByDateList(list);\n\t\t} else {\n\t\t\td = new ArrayList<EventData>();\n\t\t}\n\t\treturn d;\n\t}", "public static List<Event> loadPubs() throws JSONException {\n \t\t\n \t\tString data = getJSON(Constants.PUBEVENTS);\n \t\t\n \t\tJSONObject json_obj = new JSONObject(data).getJSONObject(\"feed\");\n \t\tJSONArray json_arr = json_obj.getJSONArray(\"entry\");\n \t\t\t\n \t\tList<Event> events = new ArrayList<Event>();\n \t\t\t\n \t\t\t\n \t\tfor (int i = 0; i < json_arr.length(); i++){\n \t\t\tString title = json_arr.getJSONObject(i).getJSONObject(\"title\").optString(\"$t\");\n \t\t\tString description = json_arr.getJSONObject(i).getJSONObject(\"content\").optString(\"$t\");\n \t\t\tString time = json_arr.getJSONObject(i).getJSONArray(\"gd$when\").getJSONObject(0).optString(\"startTime\");\n \t\t\tString where = json_arr.getJSONObject(i).getJSONArray(\"gd$where\").getJSONObject(0).optString(\"valueString\");\n \t\t\t\n \t\t\t//If time is not an all day event\n \t\t\tif(time.length() > \"1967-09-03\".length()){\n \t\t\t\ttime = fromDate(time) + \" - SENT. \";\n \t\t\t}\n \t\t\t\n \n \t\t\tif (!title.equals(\"\")){\n \t\t\t\tevents.add(new Event(title, description, where, time));\n \t\t\t}\n \t\t}\n \t\t\t\n \t\treturn events;\n \t}", "public List<Event> getEvents(int offset, int limit) throws DBException {\n DBTransaction transaction = dbService.getTransaction();\n List<Event> result =\n transaction.getObjects(Event.class, \"select e from Event e\", null, offset, limit);\n\n transaction.close();\n return result;\n }", "List<EventDetail> selectByExample(EventDetail eventDetail);", "AbstractList<Event> getEventByName(String eventName) {\r\n\t\treturn events;\r\n\t}", "AbstractList<Event> getEventByCreateDate(Date d){\r\n\t\treturn events;\r\n\t}", "@Override\n\tpublic List<Evento> getAll() throws HibernateException {\n\t\treturn null;\n\t}", "private void LoadEvent() {\n final String DB_NAME = \"testDB\";\n final String EVENT_TABLE = \"EVENT\";\n try (Connection con = ConnectionTest.getConnection(DB_NAME);\n Statement stmt = con.createStatement();) {\n String query = \"SELECT * FROM \" + EVENT_TABLE;\n try (ResultSet resultSet = stmt.executeQuery(query)) {\n while (resultSet.next()) {\n String date1 = resultSet.getString(\"eventDate\");\n LocalDate eventDate = LocalDate.parse(date1);\n String imageName = resultSet.getString(\"imageName\");\n Image image = new Image(\"file:Images/\" + imageName, 70, 70, false, false);\n String stat = resultSet.getString(\"status\");\n Status status = Status.valueOf(stat);\n Post evOb = new Event(resultSet.getString(\"postID\"), image, resultSet.getString(\"title\"),\n resultSet.getString(\"description\"), resultSet.getString(\"creatorID\"),\n status, resultSet.getString(\"eventVenue\"), eventDate, resultSet.getInt(\"eventCapacity\"),\n resultSet.getInt(\"eventAttendCount\")); // Creating a new object\n // Adding it to the list\n events.add((Event) evOb);\n\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public List<EvenementDto> getAll() {\n DataAccess dataAccess = DataAccess.begin();\n List<EvenementEntity> li = dataAccess.getAllEvents();\n dataAccess.closeConnection(true);\n return li.stream().map(EvenementEntity::convertToDto).collect(Collectors.toList());\n }", "DescribeEventsResult describeEvents(DescribeEventsRequest describeEventsRequest);", "public List<Event> getAllEventsByResponder(String responder_name) {\n List<Event> events = new ArrayList<Event>();\n\n String selectQuery = \"SELECT * FROM \" + EVENTS_TABLE_NAME + \" evt, \"\n + EVENTS_TABLE_NAME + \" resp, \" + RESPONDERS_EVENTS_TABLE_NAME + \" resp_evt WHERE resp.\"\n + EVENT_NAME + \" = '\" + responder_name + \"'\" + \" AND resp.\" + KEY_ID\n + \" = \" + \"resp_evt.\" + RESPONDERS_EVENTS_EVENTS_ID + \" AND evt.\" + KEY_ID + \" = \"\n + \"resp_evt.\" + RESPONDERS_EVENTS_RESPONDERS_ID;\n\n Log.e(LOG, selectQuery);\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (c.moveToFirst()) {\n do {\n Event evt = new Event();\n evt.setId(c.getInt((c.getColumnIndex(KEY_ID))));\n evt.setEventName((c.getString(c.getColumnIndex(EVENT_NAME))));\n evt.setDate(c.getString(c.getColumnIndex(EVENT_DATE)));\n\n events.add(evt);\n } while (c.moveToNext());\n }\n\n return events;\n }", "public ArrayList<Event> getAllEvents()\r\n\t{\r\n\t\treturn dataService.getAllEvents();\r\n\t}", "public interface EventsDao {\n\n //ADMIN EVENTS LIST\n public List<Events> getAllSystemEvents();\n\n\n //ADMIN DASHBOARD\n public String addEvent(Events event);\n\n //ADMIN\n public String updateEvent(Events event);\n\n //ADMIN\n public String deleteEvent(int eventId);\n\n\n //ADMIN\n public List<Events> displayAdminUpcomingEvent(long userId);\n\n\n //ADMIN\n public List<Events> displayAllAdminUpcomingEvents(long userId);\n\n //ADMIN\n public List<Events> displayAdminCalenderEvent(long userId);\n\n //STUDENT CALENDER EVENTS\n public List<Events> getStudentCalenderEvents(long userId);\n\n //ADMIN\n public List<Events> getLastAddedEvents();\n\n //STUDENT\n public List<Events> displayStudentUpcomingEvent();\n\n //STUDENT\n public List<Events> displayAllStudentUpcomingEvents();\n\n //STUDENT\n public List<Events> displayStudentCalenderEvent();\n\n // ADMIN ADD COURSE EVENT\n public String addCourseEvent(Events events);\n\n // ADMIN UPDATE COURSE EVENT\n public String editCourseEvent(Events events);\n\n //ADMIN GET SINGLE EVENT DATA BY EVENT ID\n public Events getEventDetailsByEventId(int eventId);\n\n //ADMIN GET COURSE EVENT LIST\n public List<Events> getCourseEventListByCourseId(int courseId);\n\n //STUDENT GET MOST UPCOMING EVENTS LIMIT 2\n public List<Events> getMostUpcomingUserEvents(long userId);\n\n //STUDENT GET COUNT FOR UPCOMING EVENTS FOR USER\n public int getCountOfMostUpcomingUserEvents(long userId);\n\n //STUDENT GET COURSE EVENT LIT FOR USER\n public List<Events> getAllCoursesEventsListForUser(long userId);\n\n //STUDENT GET SYSTEM EVENTS LIST FOR USER\n public List<Events> getAllSystemEventsListForAll();\n\n\n //GET ALL UPCOMING EVENTS AND HISTORY FOR USER\n public List<Events> getAllEventsAndHistoryForUser(long userId);\n\n\n\n}", "public ArrayList<Event> getEventsForUser(String uid) {\r\n // Gets the events collection and creates a query string for host ID\r\n MongoCollection<Document> events = mongoDB.getCollection(\"Events\");\r\n Document query = new Document(\"hostID\", new ObjectId(uid));\r\n ArrayList<Event> list = new ArrayList<>();\r\n for (Event e : events.find(query, Event.class)) {\r\n list.add(e);\r\n }\r\n return list;\r\n }", "@Override\n public Collection<CoreEventInfo> getEvents(final Collection<BwCalendar> calendars,\n final FilterBase filter,\n final BwDateTime startDate, final BwDateTime endDate,\n final List<String> retrieveList,\n RecurringRetrievalMode recurRetrieval,\n final boolean freeBusy) throws CalFacadeException {\n recurRetrieval = defaultRecurringRetrieval(recurRetrieval,\n startDate, endDate);\n\n if (debug) {\n trace(\"getEvents for start=\" + startDate + \" end=\" + endDate);\n }\n\n Collection<String> colPaths = null;\n\n if (calendars != null) {\n colPaths = new ArrayList<String>();\n for (BwCalendar c: calendars) {\n colPaths.add(c.getPath());\n\n if (debug) {\n trace(\" calendar:\" + c.getPath());\n }\n }\n }\n\n FieldnamesList retrieveListFields = null;\n\n if (retrieveList != null) {\n // Convert property names to field names\n retrieveListFields = new FieldnamesList(retrieveList.size() +\n FieldNamesMap.reqFlds.size());\n\n for (String pname: retrieveList) {\n FieldNamesEntry fent = FieldNamesMap.getEntry(pname);\n\n if ((fent == null) || (fent.getMulti())) {\n // At this stage it seems better to be inefficient\n retrieveListFields = null;\n break;\n }\n\n retrieveListFields.add(fent);\n }\n\n if (retrieveListFields != null) {\n retrieveListFields.addAll(FieldNamesMap.reqFlds);\n }\n }\n\n /* eventsQuery covers some of what is outlined here.\n *\n * 1. Get events and annotations in range and satisfying the filter.\n * If there is a date range exclude the recurring master events as they\n * turn up later attached to the instances.\n *\n * If there is no date range we will not expand recurrences so we need\n * to send master events and overrrides.\n *\n * We also exclude overrides to recurring instances.\n *\n * If no date range was supplied we now have all the master events.\n * Otherwise we have all the non-recurring events\n * (XXX or recurring reference by an annotation???)\n *\n * 2. If there is a date range supplied, get all instances in date range and\n * add their masters to the set.\n *\n * 3. If there is a date range supplied, get all overrides in date range and\n * add their masters to the set.\n *\n * 4. For each event\n * 4a. if not recurring add to result\n * 4b. if recurring {\n * if expanding\n * find all instances (in range) and add to result set\n * else {\n * find all overrides (in override range if supplied)\n * find all instances (IF instance range)\n * attach them to the master\n * add master to set.\n * }\n * }\n *\n * Some points to remind ourselves. We have to fetch overides and instances\n * because the master may be out of the range of a date limited query - usually\n * is, but we need the master to construct a proxy.\n *\n * We could probably just use the overrides and instances obtained in\n * steps 2 and 3 except for the CalDAV complications which allow a different\n * date range for overrides and instances.\n */\n\n int desiredAccess = privRead;\n if (freeBusy) {\n // DORECUR - freebusy events must have enough info for expansion\n desiredAccess = privReadFreeBusy;\n }\n\n EventsQueryResult eqr = new EventsQueryResult();\n eqr.flt = new Filters(filter);\n eqr.colPaths = colPaths;\n\n eventsQuery(eqr, startDate, endDate,\n retrieveListFields,\n freeBusy,\n null, // master\n null, // masters\n null, // uids\n getEvents);\n\n Collection<CoreEventInfo> ceis = postGetEvents(eqr.es, desiredAccess,\n returnResultAlways,\n null);\n\n /* Now get the annotations - these are not overrides */\n eventsQuery(eqr, startDate, endDate,\n retrieveListFields,\n freeBusy,\n null, // master\n null, // masters\n null, // uids\n getAnnotations);\n\n if (!eqr.es.isEmpty()) {\n ceis.addAll(postGetEvents(eqr.es, desiredAccess, returnResultAlways,\n eqr.flt));\n }\n\n ceis = getRecurrences(eqr, ceis,\n startDate, endDate,\n retrieveListFields, recurRetrieval, desiredAccess,\n freeBusy);\n\n return buildVavail(ceis);\n }", "public Collection<SapEvent> getEvents(final SessionContext ctx)\n\t{\n\t\treturn EVENTSHANDLER.getValues( ctx, this );\n\t}", "@RequestMapping(value = \"/allEvent\")\n\tpublic List<Events> getAllEvents() {\n\t\treturn eventDAO.getAllEventsList();\n\t}", "public List<Events> getAllCoursesEventsListForUser(long userId);", "public ArrayList<Event> getEventArray(int year, int month, int day){\n\t\t\tArrayList<Event> events = new ArrayList<Event>();\n\t\t\t\n\t\t\ttry{\n\t\t\t\tresultSet = statement.executeQuery(\"select eid, uid, name, startTime, endTime, description from Calendar where day=\"+day+\" and month=\"+month+\" and year=\"+year);\n\t\t\t\twhile (resultSet.next()){\n\t\t\t\t\tevents.add(new Event(resultSet.getString(3),month,day,year,resultSet.getString(4),resultSet.getString(5),resultSet.getString(6),Integer.parseInt(resultSet.getString(1)), Integer.parseInt(resultSet.getString(2))));\n\t\t\t\t}\n\t\t\t} catch (SQLException e1){\n\t\t\t\tSystem.out.println(\"SQL Exception.\");\n\t\t\t\te1.printStackTrace();\n\t\t\t} catch (Exception e2){\n\t\t\t\tSystem.out.println(\"I hope this doesn't happen\");\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\treturn events;\n\t\t}", "public Event getEvent(String personID, String eventType)\n throws DatabaseException {\n\n PreparedStatement stmt = null;\n ResultSet rs = null;\n try {\n String sql =\n \"select * \" +\n \"from Events \" +\n \"where PersonID = ? and EventType = ?\";\n stmt = connection.prepareStatement(sql);\n stmt.setString(1, personID);\n stmt.setString(2, eventType);\n\n rs = stmt.executeQuery();\n\n // if event was found, return model object\n if (rs.next()) {\n return new Event(\n rs.getString(1), // EventID\n rs.getString(2), // Descendant\n rs.getString(3), // PersonID\n rs.getDouble(4), // Latitude\n rs.getDouble(5), // Longitude\n rs.getString(6), // Country\n rs.getString(7), // City\n rs.getString(8), // Type\n rs.getInt(9) // Year\n );\n }\n // no event found\n return null;\n } catch (SQLException e) {\n throw new DatabaseException(e);\n } finally {\n\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) {\n logger.log(Level.FINEST, e.getMessage(), e);\n }\n }\n\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n logger.log(Level.FINEST, e.getMessage(), e);\n }\n }\n\n }\n }", "@Override\r\n public Collection<EventBean> findAllEvents(String idTxoko) throws BusinessLogicException{\n return null;\r\n }", "DataFrameEvents events();", "public static List<Event> loadEvents() throws JSONException {\n \t\t\n \t\tString data = getJSON(Constants.GOOGLEEVENTS);\n \t\t\n \t\tJSONObject json_obj = new JSONObject(data).getJSONObject(\"feed\");\n \t\tJSONArray json_arr = json_obj.getJSONArray(\"entry\");\n \t\t\t\n \t\tList<Event> events = new ArrayList<Event>();\n \t\t\t\n \t\t//Collection the right content from JSON\n \t\tfor (int i = 0; i < json_arr.length(); i++){\n \t\t\tString title = json_arr.getJSONObject(i).getJSONObject(\"title\").optString(\"$t\");\n \t\t\tString description = json_arr.getJSONObject(i).getJSONObject(\"content\").optString(\"$t\");\n \t\t\tString time = json_arr.getJSONObject(i).getJSONArray(\"gd$when\").getJSONObject(0).optString(\"startTime\");\n \t\t\tString where = json_arr.getJSONObject(i).getJSONArray(\"gd$where\").getJSONObject(0).optString(\"valueString\");\n \t\t\t\t\n \t\t\t//If time is not an all day event\n \t\t\tif(time.length() > \"1967-09-03\".length()){\n \t\t\t\ttime = fromDate(time);\n \t\t\t}\n \t\t\t\n \t\t\t//Add events if it has i title\n \t\t\tif (!title.equals(\"\")){\n \t\t\t\tevents.add(new Event(title, description, where, time + \". \"));\n \t\t\t}\n \t\t}\t\n \t\treturn events;\n \t}", "public static ArrayList<Event> getEvents(String accessToken) {\n final ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n try {\n JsonObject eventsJson = getWebService(params, EVENTS_URI, accessToken).getAsJsonObject();\n Log.i(Constants.TAG, \"RESULT: \" + eventsJson.toString());\n if (eventsJson != null) {\n GsonBuilder builder = new GsonBuilder();\n builder.registerTypeAdapter(Event.class, new Event.EventDeserializer());\n\n Gson gson = builder.create();\n ArrayList<Event> eventList = gson.fromJson(\n eventsJson.get(\"events\"),\n new TypeToken<ArrayList<Event>>() {\n }.getType());\n return eventList;\n } else {\n return null;\n } // end if-else\n } catch (APICallException e) {\n Log.e(Constants.TAG, \"HTTP ERROR when getting events - STATUS:\" + e.getMessage(), e);\n return null;\n } catch (IOException e) {\n Log.e(Constants.TAG, \"IOException when getting events\", e);\n return null;\n } // end try-catch\n }", "@Override\n public List<Event> searchByInterval(Date leftDate, Date rightDate) {\n TypedQuery<EventAdapter> query = em.createQuery(\n \"SELECT e FROM EventAdapter e \"\n + \"WHERE e.dateBegin BETWEEN :leftDate and :rightDate \"\n + \"ORDER BY e.id\", EventAdapter.class)\n .setParameter(\"leftDate\", leftDate)\n .setParameter(\"rightDate\", rightDate);\n\n return query.getResultList()\n .parallelStream()\n .map(EventAdapter::getEvent)\n .collect(Collectors.toList());\n }", "public static Iterable<AnalyticsResults> getAllEvents(Date start, Date end) {\n\t\ttry {\n\t\t\treturn Common.query(\n\t\t\t\t\t\"{CALL GetAnalyticsForDateRange(?,?)}\",\n\t\t\t\t\tprocedure -> {\n\t\t\t\t\t\tprocedure.setDate(1, start);\n\t\t\t\t\t\tprocedure.setDate(2, end);\n\t\t\t\t\t},\n\t\t\t\t\tAnalyticsResults::listFromResults\n\t\t\t);\n\t\t} catch (SQLException e) {\n\t\t\tlog.error(\"GetAnalyticsForDateRange\");\n\t\t\treturn Collections.emptyList();\n\t\t}\n\t}", "public static List<Pfp> findAll(String eventId) {\n\t\tEvent event=Event.findBySlug(eventId);\n\t\tQuery<Pfp> query = Ebean.createQuery(Pfp.class);\n\t\tquery.select(\"id, name\")\n\t\t\t\t.where().eq(\"event.id\", event.id).eq(\"pfpType\", \"1\");\n\n\t\tif (query != null) {\n\t\treturn query.findList();\n\t\t}\n\t\treturn new ArrayList<Pfp>();\n\t}", "public String arrangeEvents() throws Exception {\n JSONArray scheduledEventList = calObj.retrieveEvents(\"primary\").getJSONArray(\"items\");\n JSONArray unScheduledEventList = calObj.retrieveEvents(this.user.getCalId()).getJSONArray(\"items\");\n\n //Filter events for this week\n\n\n //Make a list of all events\n\n //Prioritise all unscheduled events\n\n\n //Send the list to client to display\n String events = \"\";\n for (int i = 0; i < scheduledEventList.length(); i++) {\n org.json.JSONObject jsonLineItem = scheduledEventList.getJSONObject(i);\n events += jsonLineItem.getString(\"summary\") + \" \" + jsonLineItem.getJSONObject(\"start\").getString(\"dateTime\") + \"\\n\";\n }\n // Unscheduled events set in bot created aPAS calendar\n for (int i = 0; i < unScheduledEventList.length(); i++) {\n org.json.JSONObject jsonLineItem = unScheduledEventList.getJSONObject(i);\n events += jsonLineItem.getString(\"summary\") + \" \" + jsonLineItem.getJSONObject(\"start\").getString(\"dateTime\") + \"\\n\";\n }\n return events;\n }", "public ArrayList<FbEvent> getPastEvents() throws SQLException {\n\t\tArrayList<FbEvent> events = new ArrayList<FbEvent>();\n\t\tSQLiteDatabase db = tableHelper.getReadableDatabase();\n\t\ttry {\n\t\t\tCursor cursor = db.query(SQLTablesHelper.MY_EVENT_TABLE_NAME, columns,\n\t\t\t\t\tSQLTablesHelper.MY_EVENT_START_TIME + \" < ?\",\n\t\t\t\t\tnew String[] {String.valueOf(TimeFrame.getUnixTime(TimeFrame.getTodayDate()))}, \n\t\t\t\t\tnull, null, null);\n\t\t\tcursor.moveToFirst();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\tFbEvent event = cursorToEvent(cursor);\n\t\t\t\tevents.add(event);\n\t\t\t\tcursor.moveToNext();\n\t\t\t}\n\t\t\tcursor.close();\n\t\t} finally {\n\t\t\tdb.close();\n\t\t}\n\t\treturn events;\n\t}", "@Override\r\n\tpublic List<Evento> listar() {\n\t\treturn repository.findAll();\r\n\t}", "IEvent[] getEvents();", "@Override\n\tpublic List<Event> viewEventsOfUserDAO(EventSignUp e) throws SQLException {\n\t\treturn null;\n\t}", "public void getDaysEvents(int userid, int day, int month, int year) {\r\n\t\t// Populate DaysEventsListIDs, DaysEventsListStartHour, DaysEventsListStopHour, DaysEventsListStartMin, DaysEventsListStopMin, DaysEventsListTitles\r\n\t\teventList.clear();\r\n\t\tEventList myEvent = new EventList();\r\n\t\ttry {\r\n\t\t Statement statement = connection.createStatement();\r\n\t\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\t\t ResultSet rs = statement.executeQuery(\r\n\t\t \t\t \"select id, starthour, startmin, stophour, stopmin, title, details from events where userid = \" + userid\r\n\t\t \t\t + \" and day = \" + day\r\n\t\t \t\t + \" and month = \" + month\r\n\t\t \t\t + \" and year = \" + year\r\n\t\t \t\t + \" order by starthour, startmin\");\r\n\t\t while(rs.next())\r\n\t\t {\r\n\t\t \tmyEvent = new EventList();\r\n\t\t // read the result set\r\n\t\t \tmyEvent.eid = rs.getInt(\"id\");\r\n\t\t \tmyEvent.starthour = rs.getInt(\"starthour\");\r\n\t\t \tmyEvent.startmin = rs.getInt(\"startmin\");\r\n\t\t \tmyEvent.stophour = rs.getInt(\"stophour\");\r\n\t\t \tmyEvent.stopmin = rs.getInt(\"stopmin\");\r\n\t\t \tmyEvent.title = rs.getString(\"title\");\r\n\t\t \tmyEvent.details = rs.getString(\"details\");\r\n\t\t \teventList.add(myEvent);\r\n\t\t }\r\n\t\t\t}\r\n\t\t catch(SQLException e)\r\n\t\t {\r\n\t\t // if the error message is \"out of memory\", \r\n\t\t // it probably means no database file is found\r\n\t\t System.err.println(e.getMessage());\r\n\t\t \r\n\t\t }\r\n\t\t\r\n\t\t//Query DB to get those details.\r\n\t}", "public void getEventDetails() {\r\n\t\t// Query DB to get specific event information based on EventID.\r\n\t}", "public String getEvents(int year, int month, int day){\n\t\tString result = \"\";\n\t\ttry{\n\t\t\tresultSet = statement.executeQuery(\"select eid, uid, name, startTime, endTime, description from Calendar where day=\"+day+\" and month=\"+month+\" and year=\"+year);\n\t\t\twhile (resultSet.next()){\n\t\t\t\tresult +=(resultSet.getInt(1)+\"|\"+resultSet.getInt(2)+\"|\"+resultSet.getString(3)+\"|\"+resultSet.getString(4)+\"|\"+resultSet.getString(5)+\"|\"+resultSet.getString(6)+\"\\n\");\n\t\t\t}\n\t\t} catch (SQLException e1){\n\t\t\tSystem.out.println(\"SQL Exception.\");\n\t\t\te1.printStackTrace();\n\t\t} catch (Exception e2){\n\t\t\tSystem.out.println(\"I hope this doesn't happen\");\n\t\t\te2.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public Events getEventDetailsByEventId(int eventId);", "private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n Date nowToday = new Date(System.currentTimeMillis());\n Date now2 = new Date();\n Log.d(\"TIME\", now2.toString()); // Fri Apr 14 11:45:53 GMT-04:00 2017\n String show = DateFormat.getTimeInstance().format(nowToday); // 오후 4:22:40\n String show2 = DateFormat.getDateInstance().format(nowToday); // 2017. 4. 7.\n String show3 = DateFormat.getDateTimeInstance().format(nowToday); // 2017. 4. 7. 오후 4:22:40\n // String show4 = DateFormat.getDateInstance().format(now); 이건 안됌 에러\n\n\n java.text.SimpleDateFormat toDateTime = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssZ\");\n //Date todayDate = new Date();\n // String todayName = dayName.format(todayDate);\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n\n calendar.setTime(nowToday);\n calendar.add(Calendar.HOUR, 2);\n Date twoFromNow = calendar.getTime();\n\n\n\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setTimeMax(new DateTime(twoFromNow, TimeZone.getDefault()))\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n\n\n List<Event> items = events.getItems();\n // List<Map<String, String>> pairList = new ArrayList<Map<String, String>>();\n // String nowDay = now.toString().substring(0, now.toString().indexOf(\"T\"));\n\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n\n // Only get events with exact start time set, exclude all day\n if (start != null) {\n eventStrings.add(\n String.format(\"%s //// %s)\", event.getSummary(), start));\n }\n\n\n }\n\n return eventStrings;\n }", "ArrayList<HabitEvent> getHabitEvents();", "public Set<EventTO> getEvents() {\n\n Iterable<Event> events = eventRepository.findAll();\n LOGGER.info(\"Returning all events\");\n return mapperService.convertToEventTO(events);\n\n }", "public Page<Event> findEventsByAppModuleId(Long moduleId , Pageable pageable);", "@WebMethod public Vector<Event> getEvents(Date date);", "List<EpicsData> getEpicsData(EpicsType epicsType, int run);", "public Set<EventTO> getEventByName(String name) {\n\n Set<Event> events = eventRepository.findByName(name);\n if (!(events.isEmpty())) {\n LOGGER.info(\"returning event with name '{}'\", name);\n return mapperService.convertToEventTO(events);\n }\n else {\n LOGGER.error(\"no event with name '{}' could be found\", name);\n throw new ResourceNotFoundException(\"Event not found\");\n }\n }", "public void getDateEvents(Connection connection, StoreData data){\n\t\t//The following code is used to prepare a sql statement to get all the events\n\t\tdata.resetSingle();\n\t\tPreparedStatement preStmt=null;\n\t\tString stmt = \"SELECT * FROM Event\";\n\t\t//prepares the date given to this method to be used to get the correct events \n\t\tString passedDate = data.getDate();\n\t\tSimpleDateFormat displayDate = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\tSimpleDateFormat dbDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tSimpleDateFormat theDay = new SimpleDateFormat(\"dd\");\n\t\tSimpleDateFormat month = new SimpleDateFormat(\"MM\");\n\t\tSimpleDateFormat year = new SimpleDateFormat(\"yyyy\");\n\t\tString formatSDate = null;\n\t\tString formatEDate = null;\n\t\tString sMonth = null;\n\t\tString eMonth = null;\n\t\tString sDay = null;\n\t\tString eDay = null;\n\t\tString curDay = null;\n\t\tString curMonth = null;\n\t\tint startD = 0;\n\t\tint endD = 0;\n\t\tint curD = 0;\n\t\tint startM = 0;\n\t\tint curM = 0;\n\t\tint endM = 0;\n\t\t\n\t\t//This try catch block is used to get the events that are returned based on\n\t\t//the dates that the event has\n\t\ttry{\n\t\t\tpreStmt = (PreparedStatement) connection.prepareStatement(stmt);\n\t\t\tResultSet rs = preStmt.executeQuery();\n\t\t\tStoreData newDay;\n\t\t\t//loops through all of the events storing the ones that have the matching dates\n\t\t\twhile(rs.next()){\n\t\t\t\tnewDay = new StoreData();\n\t\t\t\tString name = rs.getString(\"Name\");\n\t\t\t\tString description = rs.getString(\"Description\");\n\t\t\t\tString location = rs.getString(\"Location\");\n\t\t\t\tString date = rs.getString(\"Start_Date\");\n\t\t\t\tString endDate = rs.getString(\"End_Date\");\n\t\t\t\t//This try catch formats the dates to be used to check to see if they are correct\n\t\t\t\ttry {\n\n\t\t\t\t\tformatSDate = displayDate.format(dbDate.parse(date));\n\t\t\t\t\tformatEDate = displayDate.format(dbDate.parse(endDate));\n\t\t\t\t\tsDay = theDay.format(dbDate.parse(date));\n\t\t\t\t\teDay = theDay.format(dbDate.parse(endDate));\n\t\t\t\t\tcurDay = theDay.format(displayDate.parse(passedDate));\n\t\t\t\t\tsMonth = month.format(dbDate.parse(date));\n\t\t\t\t\teMonth = month.format(dbDate.parse(endDate));\n\t\t\t\t\tcurMonth = month.format(displayDate.parse(passedDate));\n\t\t\t\t\tstartD = Integer.parseInt(sDay);\n\t\t\t\t\tendD = Integer.parseInt(eDay);\n\t\t\t\t\tcurD = Integer.parseInt(curDay);\n\t\t\t\t\tstartM = Integer.parseInt(sMonth);\n\t\t\t\t\tcurM = Integer.parseInt(curMonth);\n\t\t\t\t\tendM = Integer.parseInt(eMonth);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tString sTime = rs.getString(\"Start_Time\");\n\t\t\t\tString eTime = rs.getString(\"End_Time\");\n\t\t\t\tnewDay.setName(name);\n\t\t\t\tnewDay.setDescription(description);\n\t\t\t\tnewDay.setLocation(location);\n\t\t\t\tnewDay.setDate(date);\n\t\t\t\tnewDay.setEndDate(endDate);\n\t\t\t\tnewDay.setSTime(sTime);\n\t\t\t\tnewDay.setETime(eTime);\n\t\t\t\t//stores the events that match the date that was given\n\t\t\t\tif(curD >= startD && curD <= endD && curM == startM){\n\t\t\t\t\tdata.addDayEvent(newDay);\n\t\t\t\t}else if(startM < curM && curM == endM && curD <= endD){\n\t\t\t\t\tdata.addDayEvent(newDay);\n\t\t\t\t}else if(curD < startD || curD > endD){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Man you got problems now\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void reload() {\n try {\n lstEvents = getEventFromDB();\n } catch (SQLException ex) {\n mLog.error(ex.getMessage(), ex);\n }\n }", "@Query(\"SELECT id, measured_at FROM measurements WHERE measured_at >= :startDate AND measured_at < :endDate\")\n @TypeConverters({DateConverter.class})\n List<MeasurementEvent> findForPeriodTest(Date startDate, Date endDate);", "public Cursor getListAsResultSet() throws EwpException {\n String sql = \"SELECT * From PFEventNotification\";\n return executeSqlAndGetResultSet(sql);\n }", "public GameEvent[] getEvents();", "public Page<Event> findEventsByUserId(Long userId , Pageable pageable);", "public ResponseEvent get(OID oids[]) throws IOException {\n PDU pdu = new PDU();\n for (OID oid : oids) {\n pdu.add(new VariableBinding(oid));\n }\n pdu.setType(PDU.GET);\n ResponseEvent event = mSnmp.send(pdu, getTarget(), null);\n if (event != null) {\n return event;\n }\n throw new RuntimeException(\"GET timed out\");\n }", "ArrayList<Bet> selectAllBetsOnMatch(int eventID) throws DAOException;", "@GetMapping(\"/events\")\n\t\tpublic List<Event> getEvents() {\n\t\t\t\t\treturn theEvents;\n\t\t}", "public final void loadEvents() {\n\n if (selectedUser == null || selectedUser.equals(\"All\")) {\n for (Absence a : AbsenceService.getAllUnacknowledged()) {\n\n AbsenceEvent e = new AbsenceEvent(a.getUser().getUsername() + \" \" + a.getAbsenceType(), TimeConverterService.convertLocalDateTimeToDate(a.getStartTime()), TimeConverterService.convertLocalDateTimeToDate(a.getEndTime()), a);\n\n switch (e.getAbsence().getAbsenceType()) {\n\n case MEDICAL_LEAVE:\n e.setStyleClass(\"medical_leave\");\n break;\n case HOLIDAY:\n e.setStyleClass(\"holiday\");\n e.setAllDay(true);\n break;\n case TIME_COMPENSATION:\n e.setStyleClass(\"time_compensation\");\n break;\n case BUSINESSRELATED_ABSENCE:\n e.setStyleClass(\"business-related_absence\");\n break;\n default:\n }\n\n this.addEvent(e);\n }\n } else {\n for (Absence a : AbsenceService.getAbsenceByUserAndUnacknowledged(BenutzerverwaltungService.getUser(selectedUser))) {\n\n AbsenceEvent e = new AbsenceEvent(a.getUser().getUsername() + \" \" + a.getAbsenceType() + \" \" + a.getReason(), TimeConverterService.convertLocalDateTimeToDate(a.getStartTime()), TimeConverterService.convertLocalDateTimeToDate(a.getEndTime()), a);\n\n switch (e.getAbsence().getAbsenceType()) {\n\n case MEDICAL_LEAVE:\n e.setStyleClass(\"medical_leave\");\n break;\n case HOLIDAY:\n e.setStyleClass(\"holiday\");\n e.setAllDay(true);\n break;\n case TIME_COMPENSATION:\n e.setStyleClass(\"time_compensation\");\n break;\n case BUSINESSRELATED_ABSENCE:\n e.setStyleClass(\"business-related_absence\");\n break;\n default:\n }\n\n this.addEvent(e);\n }\n }\n\n DefaultScheduleEvent holidayevent;\n\n for (Holiday h : HolidayService.getList()) {\n holidayevent = new DefaultScheduleEvent(h.getHolidayComment(), TimeConverterService.convertLocalDateToDate(h.getHolidayDate()), TimeConverterService.convertLocalDateToDate(h.getHolidayDate()));\n holidayevent.setAllDay(true);\n holidayevent.setStyleClass(\"feiertag\");\n\n this.addEvent(holidayevent);\n }\n }", "List<Event> fetchRecentEvents(User user, int limit) throws PersistenceException, InvalidArgumentException;", "private String getSQL() {\n return \" SELECT * FROM PFEventNotification \";\n }", "public List<Evento> listarEventos() throws Exception{\n\t\t// Hibernate.initialize(listaEspecialidades());\n\t\treturn super.findListByQueryDinamica(\" from Evento\");\n\t}", "public ArrayList<Event> getEvents(){return new ArrayList<Event>(events);}", "private List<String> getDataFromApi() throws IOException {\n // List the next 10 events from the primary calendar.\n DateTime now = new DateTime(System.currentTimeMillis());\n Date nowToday = new Date(System.currentTimeMillis());\n Date now2 = new Date();\n Log.d(\"TIME\", now2.toString()); // Fri Apr 14 11:45:53 GMT-04:00 2017\n String show = DateFormat.getTimeInstance().format(nowToday); // 오후 4:22:40\n String show2 = DateFormat.getDateInstance().format(nowToday); // 2017. 4. 7.\n String show3 = DateFormat.getDateTimeInstance().format(nowToday); // 2017. 4. 7. 오후 4:22:40\n // String show4 = DateFormat.getDateInstance().format(now); 이건 안됌 에러\n Log.d(\"@@@@@LOOK HERE TIME@@\", show);\n Log.d(\"@@@@@LOOK HERE DATE@@\", show2);\n Log.d(\"@@@@@LOOK HERE DATETIME\", show3);\n List<String> eventStrings = new ArrayList<String>();\n Events events = mService.events().list(\"primary\")\n .setMaxResults(10)\n .setTimeMin(now)\n .setOrderBy(\"startTime\")\n .setSingleEvents(true)\n .execute();\n\n\n List<Event> items = events.getItems();\n // List<Map<String, String>> pairList = new ArrayList<Map<String, String>>();\n String nowDay = now.toString().substring(0, now.toString().indexOf(\"T\"));\n\n\n for (Event event : items) {\n DateTime start = event.getStart().getDateTime();\n if (start == null) {\n // All-day events don't have start times, so just use\n // the start date.\n start = event.getStart().getDate();\n }\n\n eventStrings.add(\n String.format(\"%s (%s)\", event.getSummary(), start));\n }\n List<String> realStrings = new ArrayList<String>();\n for (String a:eventStrings\n ) {\n // Log.d(\"@@@@\", a);\n String day;\n String korTimeSpeech = null;\n String newSpeech = null;\n day = a.substring(a.indexOf(\"(\"), a.indexOf(\")\"));\n day = day.substring(1);\n\n if(day.length() > 16) {\n int hour = Integer.parseInt(day.substring(11, 13));\n if(hour < 12) {\n korTimeSpeech = \"오전 \";\n } else{\n korTimeSpeech = \"오후 \";\n hour = hour - 12;\n }\n korTimeSpeech = korTimeSpeech + hour + \"시 \" + day.substring(14, 16) + \"분에 \";\n newSpeech = a.substring(0, a.indexOf(\"(\"));\n newSpeech = korTimeSpeech + newSpeech;\n //Make it in day format\n day = day.substring(0, day.indexOf(\"T\"));\n }else {\n // korTimeSpeech = day.substring(11, 13) + \"시 \" + day.substring(14, 16) + \"분에 \";\n newSpeech = a.substring(0, a.indexOf(\"(\"));\n newSpeech = newSpeech;\n }\n\n if (day.equals(nowDay)) {\n realStrings.add(newSpeech);\n }\n }\n\n return realStrings;\n }", "public Eventos fetchEventosById(FetchByIdRequest request);", "public ArrayList<CampusEvent> fetchEvents2() {\n SQLiteDatabase dbObj = getReadableDatabase();\n ArrayList<CampusEvent> entryList = new ArrayList<CampusEvent>();\n\n Cursor cursor = dbObj.query(TABLE_DEVENTS, mColumnList, null,\n null, null, null, null);\n\n while (cursor.moveToNext()) {\n CampusEvent event = cursorToEvent(cursor);\n entryList.add(event);\n }\n\n cursor.close();\n dbObj.close();\n\n return entryList;\n }", "@Override\n public List<Event> searchByTitle(String title) {\n TypedQuery<EventAdapter> query = em.createQuery(\n \"SELECT e FROM EventAdapter e \"\n + \"WHERE e.title = :title \"\n + \"ORDER BY e.id\", EventAdapter.class)\n .setParameter(\"title\", title);\n\n return query.getResultList()\n .parallelStream()\n .map(EventAdapter::getEvent)\n .collect(Collectors.toList());\n }", "public EventDetails getByEventName(String eventName);", "@Override\r\n\t@Transactional\r\n\tpublic List<eventuales> findAll() {\n\t\treturn (List<eventuales>) dao.findAll();\r\n\t}", "public List<Event> getAllResponsesByResponder(String responder_name) {\n List<Event> events = new ArrayList<Event>();\n\n String selectQuery = \"SELECT * FROM \" + EVENTS_TABLE_NAME + \" evt, \"\n + EVENTS_TABLE_NAME + \" resp, \" + RESPONDERS_EVENTS_TABLE_NAME + \" resp_evt WHERE resp.\"\n + EVENT_NAME + \" = '\" + responder_name + \"'\" + \" AND resp.\" + KEY_ID\n + \" = \" + \"resp_evt.\" + RESPONDERS_EVENTS_EVENTS_ID + \" AND evt.\" + KEY_ID + \" = \"\n + \"resp_evt.\" + RESPONDERS_EVENTS_RESPONDERS_ID;\n\n Log.e(LOG, selectQuery);\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (c.moveToFirst()) {\n do {\n Event evt = new Event();\n evt.setId(c.getInt((c.getColumnIndex(KEY_ID))));\n evt.setEventName((c.getString(c.getColumnIndex(EVENT_NAME))));\n evt.setDate(c.getString(c.getColumnIndex(EVENT_DATE)));\n\n events.add(evt);\n } while (c.moveToNext());\n }\n\n return events;\n }", "public Collection<SapEvent> getEvents()\n\t{\n\t\treturn getEvents( getSession().getSessionContext() );\n\t}", "private ArrayList<Item> getEvents() {\n\t\tArrayList<Item> events = Magical.getStorage().getList(\n\t\t\t\tStorage.EVENTS_INDEX);\n\t\treturn events;\n\t}", "public List<JsonEvent> getEvents(final EventQuery query) throws Exception {\n\t\tInputStream result = null;\n\t\tList<JsonEvent> events = null;\n\n\t\ttry {\n\t\t\tresult = UrlUtil.getInputStream(getUrl(query, Format.GEOJSON));\n\t\t\tevents = parseJsonEventCollection(result);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tresult.close();\n\t\t\t} catch (NullPointerException npx) {\n\t\t\t\t// Don't throw null pointer exceptions because they mask the real\n\t\t\t\t// exception, eg, that an error occurred during I/O.\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "List<EventWithBLOBs> selectByExampleWithBLOBs(EventExample example);" ]
[ "0.691039", "0.6501656", "0.64036167", "0.61493075", "0.6134212", "0.61070275", "0.6055644", "0.59988415", "0.5984465", "0.5946987", "0.5922491", "0.5882975", "0.58759594", "0.5870755", "0.5855738", "0.58468056", "0.5842947", "0.5836749", "0.5815223", "0.57916737", "0.5776463", "0.5743524", "0.574316", "0.5737598", "0.57162505", "0.57004553", "0.5693552", "0.5684363", "0.5670842", "0.56590945", "0.56579745", "0.56524813", "0.5647781", "0.5645182", "0.5636492", "0.56043607", "0.5590117", "0.55602545", "0.55580854", "0.55445933", "0.5541601", "0.5522297", "0.55119324", "0.5511406", "0.5508677", "0.5504105", "0.55027306", "0.5496545", "0.5480827", "0.54617274", "0.5453407", "0.5444975", "0.5444945", "0.54413795", "0.5419629", "0.5416987", "0.5403019", "0.53988516", "0.5390219", "0.5385676", "0.538045", "0.5375392", "0.5372806", "0.53677917", "0.53642726", "0.5348275", "0.53475946", "0.53399086", "0.5338827", "0.5337453", "0.5332323", "0.5325618", "0.5323867", "0.5313235", "0.5311245", "0.5309235", "0.53034645", "0.5299588", "0.52918375", "0.5286973", "0.52866125", "0.5276975", "0.52769166", "0.52716243", "0.52684677", "0.52670383", "0.52651757", "0.52627766", "0.5255097", "0.5227852", "0.5227728", "0.5208104", "0.52023673", "0.51988846", "0.5197903", "0.5196009", "0.5193223", "0.5192347", "0.5191373", "0.5187845", "0.51866144" ]
0.0
-1
Checks if the reported time of the supplied police object lies between the two supplied dates or not.
private boolean checkDate(PoliceObject po, LocalDate start, LocalDate end) { LocalDate formattedEvent = LocalDate.parse(po.getDate()); boolean isAfter = formattedEvent.isAfter(start) || formattedEvent.isEqual(start); boolean isBefore = formattedEvent.isBefore(end) || formattedEvent.isEqual(end); return (isAfter && isBefore); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkTimePeriod(String from, String to) throws ParseException{\r\n\t\r\n\tDateFormat df = new SimpleDateFormat (\"yyyy-MM-dd\");\r\n boolean b = true;\r\n // Get Date 1\r\n Date d1 = df.parse(from);\r\n\r\n // Get Date 2\r\n Date d2 = df.parse(to);\r\n\r\n //String relation=\"\";\r\n if (d1.compareTo(d2)<=0){\r\n \t b=true;\r\n // relation = \"the date is less\";\r\n }\r\n else {\r\n b=false;\r\n }\r\n return b;\r\n}", "public boolean checkRoomAvailabilty(String date,String startTime,String endTime ,String confID);", "public boolean checkOverlappingTimes(LocalDateTime startA, LocalDateTime endA,\n LocalDateTime startB, LocalDateTime endB){\n return (endB == null || startA == null || !startA.isAfter(endB))\n && (endA == null || startB == null || !endA.isBefore(startB));\n }", "@Test\r\n public void testReflexivityOverlappingTimePeriods(){\n DateTime startAvailability1 = new DateTime(2021, 7, 9, 10, 30);\r\n DateTime endAvailability1 = new DateTime(2021, 7, 9, 11, 30);\r\n DateTime startAvailability2 = new DateTime(2021, 7, 9, 11, 0);\r\n DateTime endAvailability2 = new DateTime(2021, 7, 9, 12, 0);\r\n Availability availability1 = new Availability(new HashSet<>(Arrays.asList(\"online\", \"in-person\")), startAvailability1, endAvailability1);\r\n Availability availability2 = new Availability(new HashSet<>(Arrays.asList(\"online\", \"in-person\")), startAvailability2, endAvailability2);\r\n assertTrue(availability1.overlapsWithTimePeriod(availability2));\r\n assertTrue(availability2.overlapsWithTimePeriod(availability1));\r\n }", "public boolean isDuringTime() {\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HHmm\");\r\n\t\tint now = Integer.parseInt( sdf.format(new Date()) );\r\n for ( int i = 0; i < openTime.length; i++ )\r\n\t\t\tif ( now >= openTime[i] && now <= closeTime[i])\r\n\t\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public static boolean isBetween(Date begin, Date curr, Date end) {\n if (begin.compareTo(curr) <= 0 && curr.compareTo(end) <= 0) {\n return true;\n }\n return false;\n }", "private boolean CheckAvailableDate(TimePeriod tp)\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\tString query = \"SELECT * FROM Available WHERE available_hid = '\"+hid+\"' AND \"+\n\t\t\t\t\t\t\t\"startDate = '\"+tp.stringStart+\"' AND endDate = '\"+tp.stringEnd+\"'\"; \n\t\t\t\n\t\t\tResultSet rs = con.stmt.executeQuery(query); \n\t\t\t\n\t\t\tcon.closeConnection();\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\treturn true; \n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "public static boolean isDateBetweenSpecifiedDate(Date date, Date from, Date to) {\n return date.compareTo(from) >= 0 && date.compareTo(to) <= 0;\n }", "public boolean checkTime(Calendar from,Calendar to,Calendar time)\n {\n if(time.after(from) && time.before(to))\n {\n return true;\n }\n return false;\n }", "private boolean checkdates(java.util.Date date,java.util.Date date2)\n\t{\n\t\tif (date==null||date2==null) return true;\n\t\tif (!date.after(date2)&&!date.before(date2))return true;\n\t\treturn date.before(date2);\n\t}", "public static Predicate<Sample> isinthetime(Date min , Date max)\n\t{\n\t\treturn p -> p.getDate().after(min)&&p.getDate().before(max);\n\t}", "@NoProxy\n @NoWrap\n public boolean inDateTimeRange(final String start, final String end) {\n if ((getEntityType() == IcalDefs.entityTypeTodo) &&\n getNoStart()) {\n // XXX Wrong? - true if start - end covers today?\n return true;\n }\n\n String evStart = getDtstart().getDate();\n String evEnd = getDtend().getDate();\n\n int evstSt;\n\n if (end == null) {\n evstSt = -1; // < infinity\n } else {\n evstSt = evStart.compareTo(end);\n }\n\n if (evstSt >= 0) {\n return false;\n }\n\n int evendSt;\n\n if (start == null) {\n evendSt = 1; // > infinity\n } else {\n evendSt = evEnd.compareTo(start);\n }\n\n return (evendSt > 0) ||\n (evStart.equals(evEnd) && (evendSt >= 0));\n }", "private static boolean intersect(\n\t\tDateTime start1, DateTime end1,\n\t\tDateTime start2, DateTime end2)\n\t{\n\t\tif (DateTime.op_LessThanOrEqual(end2, start1) || DateTime.op_LessThanOrEqual(end1, start2))\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public static boolean isBetweenTimes(String time1, String time2, String time) {\n if (time1.compareTo(time2) <= 0) {\n return time.compareTo(time1) >= 0 && time.compareTo(time2) < 0;\n } else {\n return time.compareTo(time1) >= 0 || time.compareTo(time2) < 0;\n }\n }", "public Boolean checkPeriod( ){\r\n\r\n Date dstart = new Date();\r\n Date dend = new Date();\r\n Date dnow = new Date();\r\n\r\n\r\n\r\n // this part will read the openndate file in specific formate\r\n try (BufferedReader in = new BufferedReader(new FileReader(\"opendate.txt\"))) {\r\n String str;\r\n while ((str = in.readLine()) != null) {\r\n // splitting lines on the basis of token\r\n String[] tokens = str.split(\",\");\r\n String [] d1 = tokens[0].split(\"-\");\r\n String [] d2 = tokens[1].split(\"-\");\r\n \r\n int a = Integer.parseInt(d1[0]);\r\n dstart.setDate(a);\r\n a = Integer.parseInt(d1[1]);\r\n dstart.setMonth(a);\r\n a = Integer.parseInt(d1[2]);\r\n dstart.setYear(a);\r\n\r\n a = Integer.parseInt(d2[0]);\r\n dend.setDate(a);\r\n a = Integer.parseInt(d2[1]);\r\n dend.setMonth(a);\r\n a = Integer.parseInt(d2[2]);\r\n dend.setYear(a);\r\n\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"File Read Error\");\r\n }\r\n\r\n \r\n\r\n if ( dnow.before(dend) && dnow.after(dstart) )\r\n return true; \r\n\r\n return true;\r\n }", "public static final boolean betweenTimes(Calendar tA, Calendar tB, Calendar tC) {\n return (tB.compareTo(tA) > 0)&&(tB.compareTo(tC) < 0);\n }", "if (payDateTime == adhocTicket.getPaidDateTime()) {\n System.out.println(\"Paid Date Time is passed\");\n }", "private boolean checkValidity(String startTime, String endTime) {\n\t\tDateFormat formatter = null;\n\t\tformatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\tDate startDate = null;\n\t\tDate endDate = null;\n\t\ttry {\n\t\t\tstartDate = (Date)formatter.parse(startTime);\n\t\t\tendDate = (Date)formatter.parse(endTime);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tif(startDate.getTime() >= endDate.getTime())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public boolean validateTime(){\n if(startSpinner.getValue().isAfter(endSpinner.getValue())){\n showError(true, \"The start time can not be greater than the end time.\");\n return false;\n }\n if(startSpinner.getValue().equals(endSpinner.getValue())){\n showError(true, \"The start time can not be the same as the end time.\");\n return false;\n }\n startLDT = convertToTimeObject(startSpinner.getValue());\n endLDT = convertToTimeObject(endSpinner.getValue());\n startZDT = convertToSystemZonedDateTime(startLDT);\n endZDT = convertToSystemZonedDateTime(endLDT);\n\n if (!validateZonedDateTimeBusiness(startZDT)){\n return false;\n }\n if (!validateZonedDateTimeBusiness(endZDT)){\n return false;\n };\n return true;\n }", "private boolean compareWithCurrentDate(LocalDateTime deadline, LocalDateTime assignDate, boolean isLessThanDay) {\n boolean isReadyToNotify=false;\n if(isLessThanDay){\n if(deadline.until(LocalDateTime.now(),HOURS)==HALF_A_DAY){\n isReadyToNotify=true;\n }\n }else{\n // if this time is the mean of deadline and assign date\n if(deadline.until(LocalDateTime.now(),HOURS) == deadline.until(assignDate,HOURS)/2){\n isReadyToNotify=true;\n }\n }\n return isReadyToNotify;\n }", "public static boolean isBetween(final LocalDateTime localDateTime,\n final LocalDateTime from,\n final LocalDateTime to) {\n final LocalDateTime currentFrom = from == null ? LocalDateTime.MIN : from;\n final LocalDateTime currentTo = to == null ? LocalDateTime.MAX : to;\n return (localDateTime.isAfter(currentFrom) || localDateTime.isEqual(currentFrom))\n && (localDateTime.isBefore(currentTo) || localDateTime.isEqual(currentTo));\n }", "public boolean validateOverlap(ObservableList<Appointment> test){\n LocalDateTime A = startLDT;\n LocalDateTime Z = endLDT;\n\n for(Appointment appt : test){\n if(appt.getId() == selectedRow.getId()){\n continue;\n }\n LocalDateTime S = LocalDateTime.parse(appt.getStart(), formatter);\n LocalDateTime E = LocalDateTime.parse(appt.getEnd(), formatter);\n //case 1 - when the start is in the window\n if((A.isAfter(S) || A.isEqual(S)) && A.isBefore(E)){\n return false;\n }\n //case 2 - when the end is in the window\n if(Z.isAfter(S) && (Z.isBefore(E) || Z.isEqual(E))){\n return false;\n }\n //case 3 - when the start and end are outside of the window\n if(((A.isBefore(S) || A.isEqual(S)) && (Z.isAfter(E) || Z.isEqual(E)))){\n return false;\n }\n }\n return true;\n }", "public static boolean verifyApplyDates(final String startDate, final String endDate) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n Date fromDate = sdf.parse(startDate);\n Date toDate = sdf.parse(endDate);\n Date curDate = new Date();\n if (!fromDate.after(curDate)) {\n System.out.println(\"Start Date must be greater than Current Date\");\n return false;\n } else if (!toDate.after(fromDate)) {\n System.out.println(\"End Date must be greater than Start Date\");\n return false;\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n return true;\n }", "public boolean checkMeetingWithinMinutes() throws Exception {\n\n Fetcher fetcher = new Fetcher();\n fetcher.fetchAppointments(appointments);\n\n //is false if there are no appointments within 15 minutes of signing in\n boolean upcoming = false;\n\n for(int i = 0; i < appointments.size(); i++){\n\n //Add 15 minutes to the current time and store in a variable.\n LocalDateTime localPlusFifteen = current.plusMinutes(15);\n\n //Converts string to LocalDateTime and formats it to the provided formatter.\n LocalDateTime date = LocalDateTime.parse(appointments.get(i).getStart(), dateTimeFormatter);\n\n //If the provided date is greater than or equal to the current date AND is less than or equal to the current\n //date plus 15 minutes, a meeting is about to start and an alert box is triggered.\n if((date.isEqual(current) || date.isAfter(current)) && (date.isEqual(localPlusFifteen) || (date.isBefore(localPlusFifteen)))){\n\n upcoming = true;\n alerts.alertBoxInformation(\"An appointment is about to start!\\nID: \" + appointments.get(i).getAppointmentId()\n +\"\\nDate/Time: \" + appointments.get(i).getStart());\n\n }\n }\n\n //If no meetings are about to start an alert box indicates no upcoming appointments and return false.\n if(!upcoming){\n alerts.alertBoxInformation(\"There are no upcoming appointments\");\n return false;\n }\n\n return true;\n }", "protected boolean isValidReturnDate(final Map<String, Map<String, TransportOfferingModel>> transportOfferings)\n\t{\n\t\tif (transportOfferings.size() < NdcservicesConstants.RETURN_FLIGHT_LEG_NUMBER)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tZonedDateTime arrivalUtcTime = TravelDateUtils.getUtcZonedDateTime(getTimeService().getCurrentTime(),\n\t\t\t\tZoneId.systemDefault());\n\n\t\tfor (final Map.Entry<String, TransportOfferingModel> transportOffering : transportOfferings\n\t\t\t\t.get(String.valueOf(NdcservicesConstants.OUTBOUND_FLIGHT_REF_NUMBER)).entrySet())\n\t\t{\n\t\t\tfinal ZonedDateTime offeringDepartureUtc = getNdcTransportOfferingService()\n\t\t\t\t\t.getArrivalZonedDateTimeFromTransportOffering(transportOffering.getValue());\n\t\t\tif (arrivalUtcTime.isBefore(offeringDepartureUtc))\n\t\t\t{\n\t\t\t\tarrivalUtcTime = offeringDepartureUtc;\n\t\t\t}\n\t\t}\n\n\t\tarrivalUtcTime = arrivalUtcTime.plus(TravelfacadesConstants.MIN_BOOKING_ADVANCE_TIME, ChronoUnit.HOURS);\n\n\t\tfor (final Map.Entry<String, TransportOfferingModel> transportOffering : transportOfferings\n\t\t\t\t.get(String.valueOf(NdcservicesConstants.INBOUND_FLIGHT_REF_NUMBER)).entrySet())\n\t\t{\n\t\t\tfinal ZonedDateTime offeringDepartureUtc = getNdcTransportOfferingService()\n\t\t\t\t\t.getDepartureZonedDateTimeFromTransportOffering(transportOffering.getValue());\n\t\t\tif (arrivalUtcTime.isAfter(offeringDepartureUtc))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean isDuring(LocalDateTime startTime, LocalDateTime endTime) {\n if (this.endTime.get().isBefore(startTime)\n || this.endTime.get().isEqual(startTime)) {\n return false;\n }\n\n return !(endTime.isBefore(this.startTime.get())\n || endTime.isEqual(this.startTime.get()));\n }", "private boolean overlaps(ThingTimeTriple a, ThingTimeTriple b)\r\n/* 227: */ {\r\n/* 228:189 */ return (a.from < b.to) && (a.to > b.from);\r\n/* 229: */ }", "private void verifyPeriod(Date start, Date end){\n List dates = logRepositoy.findAllByDateGreaterThanEqualAndDateLessThanEqual(start, end);\n if(dates.isEmpty()){\n throw new ResourceNotFoundException(\"Date range not found\");\n }\n }", "private boolean isInvoiceBetween(ContractsGrantsInvoiceDocument invoice, Timestamp fromDate, Timestamp toDate) {\r\n if (ObjectUtils.isNotNull(fromDate)) {\r\n if (fromDate.after(new Timestamp(invoice.getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis()))) {\r\n return false;\r\n }\r\n }\r\n if (ObjectUtils.isNotNull(toDate)) {\r\n if (toDate.before(new Timestamp(invoice.getDocumentHeader().getWorkflowDocument().getDateCreated().getMillis()))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private boolean checkStartTimeBeforeEndTime(String startTime, String endTime) {\n int startHour = Integer.parseInt(startTime.substring(0,2));\n int startMinute = Integer.parseInt(startTime.substring(2,4));\n int endHour = Integer.parseInt(endTime.substring(0,2));\n int endMinute = Integer.parseInt(endTime.substring(2,4));\n \n if (startHour < endHour) {\n return true;\n } else if (startHour > endHour) {\n return false;\n } else {\n if (startMinute < endMinute) {\n return true;\n } else {\n return false;\n }\n }\n }", "public static boolean dateIsBetween(Date testDate, Date startDate, Date endDate) {\n if((startDate == null || testDate.after(startDate)) && (endDate == null || testDate.before(endDate))) {\n return true;\n }\n return false;\n }", "public boolean isDuring(LocalDateTime localDateTime) {\n return (localDateTime.isAfter(startTime.get()) || localDateTime.isEqual(startTime.get()))\n && (localDateTime.isBefore(endTime.get()) || localDateTime.isEqual(endTime.get()));\n }", "public boolean validDateRange() {\n\t\treturn dateEnd.compareTo(dateStart) > 0;\n\t}", "public boolean checkDoubleBooking(LocalDateTime start, LocalDateTime end, ArrayList<String> eventIds){\n for (String id: eventIds){\n if (checkOverlappingTimes(getEvent(id).getStartTime(), getEvent(id).getEndTime(),\n start, end)){\n return false;\n }}\n return true;\n }", "private void checkDateBounds(PortfolioRecord portRecord) {\n List<DataPoint> history = portRecord.getHistory();\n\n if (!userSetDates) {\n fromDateBound = null;\n toDateBound = null;\n }\n\n if (history.size() > 0) {\n LocalDate minDate = history.get(0).getDate();\n LocalDate maxDate = history.get(history.size() - 1).getDate();\n\n if (fromDateBound == null && toDateBound == null) {\n fromDateBound = minDate;\n toDateBound = maxDate;\n } else if (toDateBound.compareTo(maxDate) < 0) {\n toDateBound = maxDate;\n }\n } else {\n fromDateBound = null;\n toDateBound = null;\n userSetDates = false;\n }\n }", "public boolean overlaps (DayPeriod other) {\n\t\tif (getDate().isEqual(other.getDate()))\n\t\t\treturn getStartTime().isBefore(other.getEndTime()) && other.getStartTime().isBefore(getEndTime());\n\t\treturn false;\n\t}", "public static boolean checkDateConstraints(Task task) {\n if (task.getBeginDate().before(new Date()) ||\n task.getBeginDate().after(task.getEndingDate()) ||\n task.getBeginDate().equals(task.getEndingDate())) {\n return false;\n }\n return true;\n }", "@Override\n public boolean isValid() {\n return dateFrom != null && dateTo != null;\n }", "public boolean validateTimes() {\n if (!allDay) {\n // Convert the time strings to ints\n int startTimeInt = parseTime(startTime);\n int endTimeInt = parseTime(endTime);\n\n if (startTimeInt > endTimeInt) {\n return false;\n }\n }\n return true;\n }", "public static boolean isInBetweenDates(LocalDate startingDate,LocalDate endingDate,LocalDate currentDate) {\n //compareTo is used to compare 2 dates\n if(currentDate.compareTo(startingDate) * currentDate.compareTo(endingDate) <0)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n }", "@Test\n public void is_restaurant_open_should_return_true_if_time_is_between_opening_and_closing_time(){\n LocalTime openingTime = LocalTime.parse(\"10:30:00\");//arrange\n LocalTime closingTime = LocalTime.parse(\"22:00:00\");\n restaurant = new Restaurant(\"Amelie's cafe\",\"Chennai\",openingTime,closingTime);\n\n //act\n Boolean checkRestaurantOpen = restaurant.isRestaurantOpen();\n\n //assert\n assertEquals(true,checkRestaurantOpen);\n }", "public static boolean CheckOverlap(int Customer_ID, LocalDate date, LocalTime start, LocalTime end, int Appointment_ID) {\n\n ObservableList<Appointment> AList = DBAppointments.GetAllAppointment();\n ObservableList<Appointment> FList = AList.filtered(A -> {\n if (A.getAppointment_ID() != Appointment_ID /*&& A.getCustomerid() == Customer_ID*/) {\n return true;\n\n }\n return false;\n });\n\n LocalDateTime ps = LocalDateTime.of(date, start);\n LocalDateTime pe = LocalDateTime.of(date, end);\n for (Appointment a : FList) {\n LocalDateTime as = LocalDateTime.of(a.getDate(), a.getStartTime());\n LocalDateTime ae = LocalDateTime.of(a.getDate(), a.getEndTime());\n\n if ((as.isAfter(ps) || as.isEqual(ps)) && as.isBefore(pe)) {\n return true;\n }\n if (ae.isAfter(ps) && (ae.isBefore(pe) || ae.isEqual(pe))) {\n return true;\n }\n if ((as.isBefore(ps) || as.isEqual(ps)) && (ae.isAfter(pe) || ae.isEqual(pe))) {\n return true;\n }\n }\n\n return false;\n }", "protected boolean isOverdue() {\n\t\t// this might be backwards, go back and check later\n\t\t/*int i = todaysDate.compareTo(returnDate);// returns 0, a positive num, or a negative num\n\t\tif (i == 0) { return false;}\t\t// the dates are equal, not overdue\n\t\telse if (i > 0) { return true; }\t// positive value if the invoking object is later than date\n\t\telse { return false; } */\t\t\t// negative value if the invoking object is earlier than date\n\t\t\n\t\t// can also do\n\t\tif (todaysDate.getTime() > returnDate.getTime() ) { return true; }\n\t\telse { return false; }\t// if the difference in time is less than or equal\n\t}", "public boolean isInPreference(DateTime startTime){\n int startHour = startTime.getHourOfDay();\n int dayNum = startTime.getDayOfWeek();\n\n if (dayPreference[dayNum] < 0 || hourPreference[startHour] < 0)\n return false;\n\n return true;\n }", "public boolean timeValidated(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tLocalTime stime = e.sTime;\n\t\tLocalTime etime = e.eTime;\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\t\tif(map.containsKey(date)) {\n\t\t\tlist = map.get(date);\n\n\t\t\tfor(int i = 0; i<list.size(); i++) {\n\t\t\t\tEvent evnt = list.get(i);\n\n\t\t\t\tif(e.sTime.equals(evnt.sTime) || e.eTime.equals(evnt.eTime)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//check for start times\n\t\t\t\tif(e.sTime.isBefore(evnt.sTime)) {\n\t\t\t\t\tif(!e.eTime.isBefore(evnt.sTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//check for end time\n\t\t\t\tif(e.sTime.isAfter(evnt.sTime)) {\n\t\t\t\t\tif(!e.sTime.isAfter(evnt.eTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "boolean hasVotingStartTime();", "public static boolean isBetween(double a, double b, double c) {\n if (a > c) {\n return a >= b && b >= c;\n } else if (a < c) {\n return a <= b && b <= c;\n } else if (a == c) {\n return a == b;\n } else {\n throw new IllegalArgumentException();\n }\n }", "private boolean validateArrivingTime(StopPoint currentSP) {\n\t\ttry {\n\t\t\tint time = Integer.valueOf(hourComboBox.getValue()) * 60;\n\t\t\ttime += Integer.valueOf(minuteComboBox.getValue());\n\t\t\ttime += timeIndicatorComboBox.getValue().equals(\"PM\") ? 12 * 60 : 0;\n\t\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\t\tif (stopPoint.getTime() != null && !stopPoint.getTime().equals(\"\") && stopPoint != currentSP) {\n\t\t\t\t\tString[] spTimeString = stopPoint.getTime().split(\"[ :]+\");\n\t\t\t\t\tint spTime = Integer.valueOf(spTimeString[0]) * 60;\n\t\t\t\t\tspTime += Integer.valueOf(spTimeString[1]);\n\t\t\t\t\tspTime += spTimeString[2].equals(\"PM\") ? 12 * 60 : 0;\n\n\t\t\t\t\tif (time <= spTime + 5 && time >= spTime - 5) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasDesiredTime();", "public boolean isNowTime_in_period(){\r\n if (isTimeWith_in_Interval((LocalTime.now()).format(formatter),openTime,closeTime)) {\r\n // System.out.println(\"hi this works\");\r\n return true;\r\n } else {\r\n \r\n return false;\r\n }\r\n }", "private boolean checkConflict(Course c1, Course c2) {\n\n\t\tString day1 = c1.getDay1();\n\t\tString day2 = c1.getDay2();\n\t\tString cday1 = c2.getDay1();\n\t\tString cday2 = c2.getDay2();\n\n\t\tfloat startTime = Float.parseFloat(c1.getStarttime());\n\t\tfloat endTime = Float.parseFloat(c1.getEndtime());\n\t\tfloat cstartTime = Float.parseFloat(c2.getStarttime());\n\t\tfloat cendTime = Float.parseFloat(c2.getEndtime());\n\t\t\n\t\tif(day1.equals(cday1) || day1.equals(cday2) || day2.equals(cday2)) {\n\t\t\tif(startTime < cstartTime && endTime < cstartTime) {\n\t\t\t\treturn false;\n\t\t\t} else if(startTime > cstartTime && startTime > cendTime) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static boolean validateRangeDate(String from, String to) {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_FORMAT);\n if (validateDateFormat(from, DATE_FORMAT) && validateDateFormat(to, DATE_FORMAT)) {\n if (LocalDate.parse(from, formatter).isBefore(LocalDate.parse(to, formatter)) ||\n LocalDate.parse(from, formatter).isEqual(LocalDate.parse(to, formatter))) {\n return true;\n }\n }\n return false;\n }", "private boolean checkStartDateBeforeEndDate(String startDate, String endDate) {\n SimpleDateFormat date = new SimpleDateFormat(\"ddMMyy\");\n Date startingDate = null;\n try {\n startingDate = date.parse(startDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n Date endingDate = null;\n try {\n endingDate = date.parse(endDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if (startingDate.before(endingDate)) {\n return true;\n } else {\n return false;\n }\n }", "boolean hasDateTime();", "boolean hasVotingEndTime();", "public void CheckAvail(LocalDate indate, LocalDate outdate)\r\n {\n if (Days.daysBetween(lastupdate, outdate).getDays() > 30)\r\n {\r\n System.out.println(\"more than 30\");\r\n return;\r\n }//Check if checkin date is before today\r\n if (Days.daysBetween(lastupdate, indate).getDays() < 0)\r\n {\r\n System.out.println(\"Less than 0\");\r\n return;\r\n }\r\n int first = Days.daysBetween(lastupdate, indate).getDays();\r\n int last = Days.daysBetween(lastupdate, outdate).getDays();\r\n for (int i = 0; i < roomtypes.size(); i++)\r\n {\r\n boolean ispossible = true;\r\n for (int j = first; j < last; j++)\r\n {\r\n if (roomtypes.get(i).reserved[j] >= roomtypes.get(i).roomcount)\r\n {\r\n ispossible = false;\r\n }\r\n } \r\n \r\n if (ispossible)\r\n System.out.println(roomtypes.get(i).roomname);\r\n }\r\n }", "public static boolean isBetween(final double a, final double b, final double c) {\r\n\t\tfinal double min = Math.min(a, c);\r\n\t\tfinal double max = Math.max(a, c);\r\n\t\treturn (min < b) && (b < max);\r\n\t}", "private boolean hasSetToAndFromDates() {\r\n return (this.fromDateString != null) && (this.toDateString != null);\r\n }", "public boolean isOverlapping(int appointmentId, String start, String end) throws Exception {\n\n //A Fetcher object for getting the appointments from the database. I discovered an error where the Fetcher and\n //DateAndTime class call each other back and forth in a never-ending loop if I declare them outside the methods\n //ie as global variables.\n Fetcher fetcher = new Fetcher();\n //A list of appointments that have been fetched from the database. Used for extracting start/end times\n ObservableList<Appointment> appointments = FXCollections.observableArrayList();\n fetcher.fetchAppointments(appointments);\n\n //Convert the provided start/end strings to LocalDateTime variables\n LocalDateTime startTime = LocalDateTime.parse(start, dateTimeFormatter);\n LocalDateTime endTime = LocalDateTime.parse(end, dateTimeFormatter);\n\n //Loop through the entire appointments list and set each start/end time to a LocalDateTime variable to be\n //compared.\n for(int i = 0; i < appointments.size(); i++){\n\n //If the appointment ID matches an existing ID in the database, continue to the next iteration.\n if(appointments.get(i).getAppointmentId() == appointmentId){\n continue;\n }\n\n //Create LocalDateTimes from start/end strings from the current appointment.\n LocalDateTime appointmentStart = LocalDateTime.parse(appointments.get(i).getStart(), dateTimeFormatter);\n LocalDateTime appointmentEnd = LocalDateTime.parse(appointments.get(i).getEnd(), dateTimeFormatter);\n\n //If the start time is greater than or equal to an existing appointment start time AND the end time is less\n //than that appointment's end time, the appointments overlap and return true.\n if(startTime.equals(appointmentStart) || (startTime.isAfter(appointmentStart) && startTime.isBefore(appointmentEnd)) ) {\n return true;\n }\n\n //If the end time is equal to an existing appointment end OR the end time is after an existing appointment\n //start time AND before the existing appointment end time, they overlap and return true.\n if(endTime.equals(appointmentEnd) || (endTime.isAfter(appointmentStart) && endTime.isBefore(appointmentEnd))){\n return true;\n }\n }\n\n //If none of the conditions apply, the appointments do not overlap and return false.\n return false;\n\n\n }", "boolean hasExchangeTime();", "public boolean containsDomainRange(Date from, Date to) { return true; }", "public static boolean inUseDuringInterval(Facility f, Date d, Time start, Time end)\n {\n Interval comp = new Interval(d, start, end);\n for(Interval i : Database.db.get(f).getFacilityUse().getSchedule().getSchedule().values())\n {\n if(i.timeOverlaps(comp))\n {\n return true;\n }\n }\n return false;\n }", "public static boolean inRange(long quakeTime) throws Exception {\n SimpleDateFormat dayFormatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n String quakeDay = dayFormatter.format(new Date(quakeTime));\n String currentDay = dayFormatter.format(new Date());\n return (quakeDay.equals(currentDay));\n }", "public boolean isValid() {\n\t\tboolean result;\n\t\tDate mySD = this.getStartDate();\n\t\tDate myED = this.getEndDate();\n\t\tTime myST = this.getStartTime();\n\t\tTime myET = this.getEndTime();\n\n\t\tif (myED.isBefore(mySD)) { //end is before start\n\t\t\tresult = false;\n\t\t} else if (myED.isEquals(mySD)) { //start and end same day\n\t\t\tif (myET.compareTo(myST) < 0) { //end time before start time\n\t\t\t\tresult = false;\n\t\t\t} else { result = true;\t}\n\t\t} else { result = true;\t}\n\n\t\treturn result;\n\t}", "public boolean contains(long time) {\n\t\treturn ((start <= time) && (time <= end));\n\t}", "private Boolean TimeInRange(String time){\n \n String[] t = time.split(\":\");\n \n int hours = Integer.parseInt(t[0]);\n int minutes = Integer.parseInt(t[1]);\n int seconds = Integer.parseInt(t[2]);\n \n if(hours == 11 && minutes == 59 && (seconds >= 55)){\n return true;\n }\n \n return false;\n \n }", "public ArePartsAvailableInTimeResponse(ServiceAgent agent) {\n\t\tsuper(agent, MessageTemplate.MatchOntology(\"ArePartsAvailableInTimeResponse\"));\n\t\tthis.agent = agent;\n\t}", "public static boolean isDateWithinRange(Date startDate, Date effectiveDate, Date endDate) {\n if (startDate == null && endDate == null) {\n return true;\n } else {\n if (effectiveDate == null) effectiveDate = new Date();\n \n if (startDate == null) {\n return effectiveDate.before(endDate) || effectiveDate.equals(endDate);\n } else if (endDate == null) {\n return startDate.before(effectiveDate) || startDate.equals(effectiveDate);\n } else {\n return startDate.before(effectiveDate) && effectiveDate.before(endDate);\n }\n }\n }", "public boolean compareTimeRangeInclusive(LocalTime time, LocalTime rangeFrom, LocalTime rangeTo) {\n return (time.compareTo(rangeFrom) == 0 || time.isAfter(rangeFrom)) &&\n (time.compareTo(rangeTo) == 0 || time.isBefore(rangeTo));\n }", "@Test\r\n public void testCalculDureeEffectiveLocation() {\r\n LocalDate date1 = LocalDate.parse(\"2018-04-02\");\r\n LocalDate date2 = LocalDate.parse(\"2018-04-10\");\r\n\r\n int res1 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(7, res1);\r\n\r\n date1 = LocalDate.parse(\"2018-01-10\");\r\n date2 = LocalDate.parse(\"2018-01-17\");\r\n\r\n int res2 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(5, res2);\r\n\r\n date1 = LocalDate.parse(\"2018-04-30\");\r\n date2 = LocalDate.parse(\"2018-05-09\");\r\n\r\n int res3 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(6, res3);\r\n }", "private static boolean isPast(long[][] dates){\n if(dates[0][0] > dates[1][0])\n return true;\n else if(dates[0][0] == dates[1][0]){\n // If the year matches, then check if the month of Start Date is greater than the month of End Date\n // If the month matches, then check if the day of Start Date is greater than the day of End Date\n if(dates[0][1] > dates[1][1])\n return true;\n else if(dates[0][1] == dates[1][1] && dates[0][2] > dates[1][2])\n return true;\n }\n \n // If the Start Date is older than End Date, return false\n return false;\n }", "private boolean isAvailabilityExist(String day, String startTime, String endTime){\n String full = day + \" at \" + startTime + \" to \" + endTime;\n\n String[] start = startTime.split(\":\");\n String[] end = endTime.split(\":\");\n\n //Set the 2 hours\n int hourStart = Integer.parseInt(start[0]);\n int hourEnd = Integer.parseInt(end[0]);\n\n //Set the minutes\n int minuteStart = Integer.parseInt(start[1]);\n int minuteEnd = Integer.parseInt(end[1]);\n\n int dayID = getDay(day).getDayID();\n\n for(Availability av : availabilities){\n int dayIDAV = av.getDayID();\n if(dayID == dayIDAV){\n //Set the 2 hours\n int hourStartAV = av.getStartHour();\n int hourEndAV = av.getEndHour();\n\n //Set the minutes\n int minuteStartAV = av.getStartMinute();\n int minuteEndAV = av.getEndTimeMinute();\n\n if(hourStart<hourStartAV)\n return(false);\n\n if(hourEnd>hourEndAV)\n return(false);\n\n if(hourEnd == hourEndAV && minuteEnd > minuteEndAV)\n return(false);\n\n if(hourStart == hourStartAV && minuteStart<minuteStartAV)\n return(false);\n }\n }\n return(true);\n }", "public boolean validFlight(LocalDateTime startDateTime, LocalDateTime endDateTime, LocalDateTime departureDateTime,\n\t\t\tLocalDateTime arrivalDateTime) {\n\t\tif (departureDateTime.isBefore(startDateTime)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (arrivalDateTime.isAfter(endDateTime)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "default A isBetween(Number firstInclusive, Number lastInclusive) {\n return satisfiesNumberCondition(new NumberCondition<>(firstInclusive, GREATER_THAN_OR_EQUAL)\n .and(new NumberCondition<>(lastInclusive, LESS_THAN_OR_EQUAL)));\n }", "protected void validateDepartureAndArrivalDateTimeRange(final FareFinderForm fareFinderForm, final Errors errors)\n\t{\n\n\t\tif (StringUtils.equalsIgnoreCase(fareFinderForm.getTripType(), TripType.RETURN.name()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfinal SimpleDateFormat formatter = new SimpleDateFormat(TravelservicesConstants.DATE_PATTERN);\n\n\t\t\t\tfinal Date departingDate = formatter.parse(fareFinderForm.getDepartingDateTime());\n\t\t\t\tfinal Date arrivalDate = formatter.parse(fareFinderForm.getReturnDateTime());\n\n\t\t\t\tif (departingDate.after(arrivalDate))\n\t\t\t\t{\n\t\t\t\t\trejectValue(errors, FIELD_DEPARTING_DATE_TIME, ERROR_TYPE_OUT_OF_RANGE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (final ParseException e)\n\t\t\t{\n\t\t\t\tLOGGER.error(\"Unable to pharse String data to Date object:\", e);\n\t\t\t}\n\t\t}\n\t}", "private static boolean isBetween(double start, double middle, double end) {\n if(start > end) {\n return end <= middle && middle <= start;\n }\n else {\n return start <= middle && middle <= end;\n }\n }", "boolean hasDate();", "@Test\n public void testDateRangeValidDate() throws Exception {\n Map<String, String> fields = new HashMap<String, String>();\n fields.put(\"generatedTimestamp\", \"12/31/1981\");\n \n this.addSingleDayDateRange.invoke(this.lockService, fields);\n \n Assert.assertEquals(\"does not contain valid date range \" + fields.get(\"generatedTimestamp\"),\n \"12/31/1981..01/01/1982\", fields.get(\"generatedTimestamp\"));\n }", "@Override\n public boolean isDateAllowed(LocalDate date) {\n \n return startDates.contains(date) || endDates.contains(date);\n }", "public boolean isJourneyInThePast() {\n\t\t\n\t\tlong journeyStartTime = TimeParser.strDateTimeToDate(mDeparture).getTime();\n\t\tlong now = System.currentTimeMillis();\n\t\t//System.out.println(\"DBG isInPast: now:\"+now+\" start:\"+journeyStartTime);\n\t\tif (journeyStartTime >= now) {\n\t\t\treturn false;\n\t\t}\n\t\tif (Constants.useWallClock == false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean hasFromDay();", "public static boolean checkRange(TechnicalData data0, TechnicalData data1, int index0, int index1) {\n\t\tif (data0.timeStamp(index0).equals(data1.timeStamp(index1))) return true;\n\t\treturn false;\n\t}", "List<Map<String, Object>> betweenDateFind(String date1, String date2) throws ParseException;", "boolean endTimeAfter(String start, String end) {\n SimpleDateFormat HHmm = new SimpleDateFormat(\"HH:mm\", Locale.UK);\n Calendar c = Calendar.getInstance();\n try {\n Date startTime = HHmm.parse(start);\n Date endTime = HHmm.parse(end);\n c.setTime(startTime);\n return startTime.compareTo(endTime) <= 0;\n } catch (ParseException e) {\n System.out.println(\"Error occurred parsing Time\");\n }\n return true;\n }", "boolean hasDeliveryDateBefore();", "private boolean inTimeScope(Expression expr, long time) {\n\n String time_start = expr.getTime_start();\n String time_end = expr.getTime_end();\n String day_start = expr.getDay_start();\n String day_end = expr.getDay_end();\n\n if (!StringHelper.isEmpty(day_start) && !StringHelper.isEmpty(day_end)) {\n\n long startTime = DateTimeHelper.dateFormat(day_start, \"yyyy-MM-dd\").getTime();\n long endTime = DateTimeHelper.dateFormat(day_end, \"yyyy-MM-dd\").getTime();\n\n if (time < startTime || time >= endTime + 24 * 3600 * 1000) {\n return false;\n }\n }\n\n if (!StringHelper.isEmpty(time_start) && !StringHelper.isEmpty(time_end)) {\n\n long startTime = DateTimeHelper\n .dateFormat(DateTimeHelper.getToday(\"yyyy-MM-dd\") + \" \" + time_start, \"yyyy-MM-dd HH:mm\").getTime();\n long endTime = DateTimeHelper\n .dateFormat(DateTimeHelper.getToday(\"yyyy-MM-dd\") + \" \" + time_end, \"yyyy-MM-dd HH:mm\").getTime();\n\n if (time < startTime || time >= endTime) {\n return false;\n }\n }\n\n int weekday = DateTimeHelper.getWeekday(new Date(time));\n \n if(expr.getWeekdayLimit()!=null&&!expr.getWeekdayLimit()[weekday]) {\n return false;\n }\n \n return true;\n }", "private void validateDateRange(String startDateStr, String endDateStr) {\n Date startDate = null;\n Date endDate = null;\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n \n try {\n if ((startDateStr != null) && (endDateStr != null)) {\n startDate = dateFormat.parse(startDateStr);\n endDate = dateFormat.parse(endDateStr);\n \n if ((startDate != null) && (endDate != null) && (startDate.after(endDate))) {\n throw new IllegalArgumentException(\n \"The date range is invalid. Start date ('\" + startDateStr + \n \"') should be less than end date ('\" + endDateStr + \"').\"); \t\n }\n }\n }\n catch (ParseException e) {\n logger.warn(\"Couldn't parse date string: \" + e.getMessage());\n }\n \n }", "if (exitDateTime == adhocTicket.getExitDateTime()) {\n System.out.println(\"Exit Date Time is passed\");\n }", "private boolean isTimeOverlap(Item t) {\n\t\treturn t.getEndDate().equals(event.getEndDate());\n\t}", "public void validateEndDateAndTime(String startDate, String endDate) {\n boolean isValid = false;\n if (!validateDateAndTime(startDate)) {\n isValid = validateDateAndTime(endDate); //End date can still be valid if start date isn't\n } else {\n if (validateDateAndTime(endDate)) {\n // If startDate is valid, then End date must be valid and occur after start date\n Calendar startCal = DateUtility.convertToDateObj(startDate);\n Calendar endCal = DateUtility.convertToDateObj(endDate);\n isValid = startCal.before(endCal);\n }\n }\n setEndDateAndTimeValid(isValid);\n }", "private static boolean isMonitoringTimeOver(Properties configuration) {\r\n String monitoringStartTime = configuration.getProperty(Constants.PROPERTY_MONITORING_START_TIME);\r\n if (monitoringStartTime == null) {\r\n return false;\r\n }\r\n DateTimeZone.setDefault(DateTimeZone.UTC);\r\n \r\n DateTime startTime = new DateTime(monitoringStartTime);\r\n String monitoringDuration = configuration.getProperty(Constants.PROPERTY_TIME_MONITORING_DURATION);\r\n \r\n int monitoringDurationMinutes = Integer.parseInt(monitoringDuration);\r\n DateTime endTime = startTime.plusMinutes(monitoringDurationMinutes);\r\n \r\n return endTime.isBeforeNow();\r\n }", "List<Employee> findByJoiningDateBetween(LocalDateTime localDateTime, LocalDateTime localDateTime2);", "private static void isDateTime(String filters[]) throws WrongQueryFormatException {\n\t\tSimpleDateFormat format = new SimpleDateFormat(DateOperations.dateFormat);\n\t\ttry {\n\t\t\tDate startDate = format.parse(filters[3] + \" \" + filters[4]);\n\t\t\tDate endDate = format.parse(filters[5] + \" \" + filters[6]);\n\t\t\tif (startDate.after(endDate)) {\n\t\t\t\tthrow new WrongQueryFormatException(\"Start date,time should be before the end date/time\");\n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\tthrow new WrongQueryFormatException(\"Wrong format of date, format is yyyy-MM-dd HH:MM\");\n\t\t}\n\t}", "public static boolean inUseDuringInterval(Facility f, Week w, Time start, Time end)\n {\n Interval comp = new Interval(w, start, end);\n for(Interval i : Database.db.get(f).getFacilityUse().getSchedule().getSchedule().values())\n {\n if(i.timeOverlaps(comp))\n {\n return true;\n }\n }\n return false;\n }", "boolean hasEndDate();", "boolean hasStartDate();", "private boolean isBetween(float a, float b, float c) {\n return b >= a ? c >= a && c <= b : c >= b && c <= a;\n }", "OffsetDateTime validUntil();", "public static boolean isBetween(int a, int b, int c) {\n if (a > c) {\n return a >= b && b >= c;\n } else if (a < c) {\n return a <= b && b <= c;\n } else {\n assert a == c;\n return a == b;\n }\n }", "private int beforeNowAfter(Date lectureDate, int start, int end){\n Date now = new Date();\n if(lectureDate.getYear()<now.getYear()){\n return 0;\n }else if(lectureDate.getYear()>now.getYear()){\n return 2;\n }else{\n if(lectureDate.getMonth()<now.getMonth()){\n return 0;\n }else if(lectureDate.getMonth()>now.getMonth()){\n return 2;\n }else{\n if(lectureDate.getDate()<now.getDate()){\n return 0;\n }else if(lectureDate.getDate()>now.getDate()){\n return 2;\n }else{\n if(end==now.getHours()&&now.getMinutes()>15){ //Lectures end officially after 15min past the end hour.\n return 0;\n }else if(end<now.getHours()){\n return 0;\n }else if(start>now.getHours()){\n return 2;\n }else{\n return 1;\n }\n }\n }\n }\n }" ]
[ "0.6259377", "0.62017876", "0.6037638", "0.60030377", "0.59966445", "0.5947425", "0.5861621", "0.58605844", "0.58417004", "0.5776901", "0.5732964", "0.5728518", "0.5719886", "0.57061434", "0.57036644", "0.5647284", "0.56151927", "0.5604954", "0.5580536", "0.557718", "0.5576517", "0.557516", "0.55669826", "0.55569386", "0.5555427", "0.5552816", "0.5526373", "0.55204767", "0.5507742", "0.55020684", "0.5482145", "0.5453313", "0.54340845", "0.54297036", "0.542272", "0.5421044", "0.5420147", "0.5413051", "0.5402203", "0.5395938", "0.5388939", "0.53616977", "0.53539836", "0.5340817", "0.53391606", "0.5333039", "0.53106093", "0.53062016", "0.5295371", "0.52940166", "0.52936417", "0.52791435", "0.52790296", "0.5271351", "0.5270896", "0.5253284", "0.5250201", "0.5220373", "0.5217638", "0.519974", "0.519264", "0.5174429", "0.5169627", "0.5167377", "0.5154653", "0.5152765", "0.51527154", "0.5152341", "0.5148594", "0.51382786", "0.51364994", "0.512396", "0.51148826", "0.5095366", "0.5086522", "0.50798315", "0.5077417", "0.5075033", "0.5073747", "0.5073088", "0.5072987", "0.507133", "0.5068374", "0.50647205", "0.5061816", "0.50610137", "0.5058157", "0.5057324", "0.5047991", "0.50451475", "0.50420713", "0.50354034", "0.50297433", "0.5022748", "0.5005938", "0.50052875", "0.5001987", "0.49874482", "0.49823943", "0.49816117" ]
0.6972367
0
Sets the data in the hashmap containing police events to the specified attribute. As the Swedish Police appearently reports events with empty values from time to time, these will be checked and potentially ignored while going into the hashmap.
public void setPolice(PoliceObject[] data) { clearPolice(); for (PoliceObject event : data) { boolean hasID = !event.getId().isEmpty(); boolean hasDateTime = !event.getDate().isEmpty(); boolean hasName = !event.getName().isEmpty(); boolean hasSummary = !event.getSummary().isEmpty(); boolean hasUrl = !event.getUrl().isEmpty(); boolean hasType = !event.getType().isEmpty(); boolean hasLocation = !event.getLocation().isEmpty(); if (hasID && hasDateTime && hasName && hasSummary && hasUrl && hasType && hasLocation) { this.policeDB.put(event.getId(), event); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setEvents(Map<String, Event> events);", "public void setData(Map<E, String> data) {\n\t\tthis.data = data;\n\t}", "public <T> void putAll(Map<String,T> attr) {\r\n attributeMap.putAll(attr);\r\n fireStateChanged();\r\n }", "public abstract HashMap<Integer, ArrayList<TimeSlot>> onNullValue();", "public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}", "void setInternal(ATTRIBUTES attribute, Object iValue);", "public abstract void setData(Map<ID, T> data);", "public void setAttribute(Object key, Object value);", "public void dataWasSet();", "public boolean setPlayerAttribute(P player, String attribute, Long number){\n attribute = \".\" + attribute;\n if(playerMap.containsKey(player)){\n if(playerMap.get(player).hasAttribute(attribute)){\n playerMap.get(player).getPlayerProfile().put(attribute, number);\n return true;\n } else {\n playerMap.get(player).getPlayerProfile().put(attribute, number);\n System.out.println(\"Just set an attribute that isn't loaded on the player\");\n return false;\n }\n } else {\n System.out.println(\"Failed to setPlayerAttribute as player isn't loaded\");\n return false;\n }\n }", "void setPassedHabitEvent(HabitEvent passedHabitEvent);", "public void setMetaData(HashMap pMetaData) ;", "public void \n\tsetData(\n\t\t\tString key, \n\t\t\tObject value) \n\t{\n\t\ttry{\n\t\t\tthis_mon.enter();\n\n\t\t\tif (user_data == null) {\n\t\t\t\tuser_data = new HashMap();\n\t\t\t}\n\t\t\tif (value == null) {\n\t\t\t\tif (user_data.containsKey(key))\n\t\t\t\t\tuser_data.remove(key);\n\t\t\t} else {\n\t\t\t\tuser_data.put(key, value);\n\t\t\t}\n\t\t}finally{\n\t\t\tthis_mon.exit();\n\t\t}\n\t}", "public void setEvent(String population) {\n\t\t// Should really ensure this value is not negative.\n\t\tthis.population = population;\n\t}", "public abstract void setData(Map attributes, Iterator accessPoints);", "public void setData(List<Event> data) {\n this.data = data;\n }", "public abstract void set(String key, T data);", "public EventDataUpdate ()\n\t{\n\t\tm_Fields = new Hashtable<String, String>();\n\t\tm_nType = EVENTDATA_UPDATE_NONE;\n\t}", "@Override\n public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {\n\n }", "void setAttribute(String key, Object value)\n throws ProcessingException;", "public void setEvent(String event) {\n this.event = event;\n }", "public AuditEvent(String principal, String type, Map<String, Object> data) {\n\t\tthis(Instant.now(), principal, type, data);\n\t}", "public void setEvent(String event) {\r\n\t\tthis.event = event;\r\n\t}", "@Nullable\r\n public Object put(String key, @Nullable Object value) {\r\n Object res = attributeMap.put(key, value);\r\n fireStateChanged();\r\n return res;\r\n }", "public void setEventData() {\n siteName.setText(event.getSiteName());\n }", "public void setAttribute(final String attribute) {\n this.attribute = attribute;\n }", "public void handleEvent(Event event)\n {\n Date d = (Date) getValue();\n settings.setAttribute(param,d != null ? HBCI.DATEFORMAT.format(d) : null);\n cache.put(param,d);\n }", "@Override\r\n\tpublic void attributeAdded(ServletRequestAttributeEvent event) {\n\t\tname=event.getName();\r\n\t\tvalue=event.getValue();\r\n\t\tSystem.out.println(event.getServletRequest()+\"范围内添加了名为\"+name+\",值为\"+value+\"的属性!\");\r\n\t}", "AMuonSegmentData(AHashMap p, AEvent e) {\n super(p,e);\n String assocKey = getName() + getStoreGateKey();\n event.getAssociationManager().add(new AAssociation(assocKey, \"MDT\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"RPC\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"TGC\", numHits, hits, event));\n event.getAssociationManager().add(new AAssociation(assocKey, \"CSC\", numHits, hits, event));\n }", "public void setModified(AttributeDefinition attribute)\n throws UnknownAttributeException\n {\n if(builtinAttributes.containsKey(attribute.getName()))\n {\n throw new IllegalArgumentException(\"builtin attribute \"+attribute.getName()+\n \"cannot be modified this way\"); \n }\n else\n {\n throw new UnknownAttributeException(\"not a builtin attribute\");\n }\n }", "public void setAttributeKey(java.lang.String param) {\r\n localAttributeKeyTracker = true;\r\n\r\n this.localAttributeKey = param;\r\n\r\n\r\n }", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "@Override\n protected void initEventAndData() {\n }", "public void setData(E data) {\r\n\t\tthis.data = data;\r\n\t}", "@Override\n public void playerAttributeChange() {\n\n Logger.info(\"HUD Presenter: playerAttributeChange\");\n view.setLives(String.valueOf(player.getLives()));\n view.setMoney(String.valueOf(player.getMoney()));\n setWaveCount();\n }", "@JsonSetter(\"event\")\r\n public void setEvent (String value) { \r\n this.event = value;\r\n }", "@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }", "public void setData(E data)\n {\n this.data = data;\n }", "public void setData(E data){\n\t\t\tthis.data = data;\n\t\t}", "public void setAttribute (GenericAttribute attribute) {\n this.attribute = attribute;\n this.type = TYPE_ATTRIBUTE;\n this.id = attribute.getId();\n }", "public AuditEvent(Instant timestamp, String principal, String type, Map<String, Object> data) {\n\t\tAssert.notNull(timestamp, \"Timestamp must not be null\");\n\t\tAssert.notNull(type, \"Type must not be null\");\n\t\tthis.timestamp = timestamp;\n\t\tthis.principal = (principal != null) ? principal : \"\";\n\t\tthis.type = type;\n\t\tthis.data = Collections.unmodifiableMap(data);\n\t}", "@Override\n public void attributeAdded(ServletContextAttributeEvent event) {\n }", "public void setAttribute(FactAttribute[] param) {\r\n\r\n validateAttribute(param);\r\n\r\n localAttributeTracker = true;\r\n\r\n this.localAttribute = param;\r\n }", "void setEvent(com.walgreens.rxit.ch.cda.EIVLEvent event);", "public abstract Map<String, Event> getEvents();", "public void setData( E data ) {\n\t\tthis.data = data;\n\t}", "@Override\r\n\tpublic void setData(E data) {\n\t\tthis.data=data;\r\n\t}", "@Override\n\tpublic void attributeReplaced(ServletContextAttributeEvent evento_atributo) {\n\t\t// CONTROL DEL NOMBRE DEL ATRIBUTO\n\t\tString nombre_atributo = evento_atributo.getName();\n\t\tif (this.seguir_Proceso(nombre_atributo)) {\n\t\t\tObject valor = evento_atributo.getValue();\n\t\t\tString valor_texto = this.coger_Valor(valor);\n\t\t\tString tipo = null;\n\t\t\ttipo = valor.getClass().getSimpleName();\n\t\t\tregistro(\"*** Modificado el atributo de aplicacion del tipo \" + tipo + \" nombre: \" + nombre_atributo + \" valor modificado: \" + valor_texto);\n\t\t}\n\t}", "public interface Attribute\n{\n /**\n * Attributes common to all events.\n */\n\tpublic interface Event\n\t{\n\t\tpublic static final String EVENT_ID = \"aether.event.id\";\n\t\tpublic static final String TIME = \"aether.event.time\";\n\t\tpublic static final String EVENT_TYPE = \"aether.event.type\";\n\t}\n\n /**\n * Attributes unique to NOTICE events.\n */\n\tpublic interface Notice extends Event\n\t{\n\t\tpublic static final String TOPIC_ID = \"aether.notice.topic.id\";\n\t}\n\n /**\n * Attributes unique to Message events.\n */\n\tpublic interface Message\n\t{\n\t\tpublic static final String LINK_ID = \"aether.message.link.id\";\n }\n\n /**\n * Attributes unique to REQUEST events.\n */\n\tpublic interface Request extends Message\n\t{\n String DESTINATION = \"aether.message.dest\";\n }\n\n /**\n * Attributes unique to RESPONSE events.\n */\n\tpublic interface Response extends Message\n\t{\n public static final String RESPONSE_TO = \"aether.response.response-to\";\n\t}\n}", "public void setEventName(String name);", "public void setAttributeMapEntry(Integer rangeAttribute,\n\t\t\t\t String domainAttributeName,\n\t\t\t\t ValueMapper mapper) {\n\tif (rangeAttribute != null && domainAttributeName != null\n\t && mapper != null) {\n\t rangeToDomainName.put(rangeAttribute,domainAttributeName);\n\t rangeToValueMapper.put(rangeAttribute,mapper);\n\t}\n }", "@attribute(value = \"\", required = false, defaultValue = \"false\")\r\n\tpublic void setAttribute(String attribute) {\r\n\t\tlog.debug(\"att = \" + attribute);\r\n\t\tthis.attribute = attribute;\r\n\t}", "public void setAttrib(gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Attrib attrib) {\r\n this.attrib = attrib;\r\n }", "public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }", "public void Add_event_value(String v)\n {\n\n event_value = new String(v);\t\n }", "public void setEvents(final Collection<SapEvent> value)\n\t{\n\t\tsetEvents( getSession().getSessionContext(), value );\n\t}", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public void attributeReplaced(HttpSessionBindingEvent arg0) {\n System.out.println(\"HttpSessionAttributeListener--attributeReplaced--名:\"+arg0.getName()+\"--值:\"+arg0.getValue()); \r\n }", "private void setUpHashMap(int number)\n {\n switch (number)\n {\n case 1:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n break;\n }\n case 2:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }\n case 3:\n {\n this.hourly.put(\"Today\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Day After Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }default:\n break;\n }\n }", "@Override\n public void onStateUpdate(\n Hashtable<String, String> successAttribute,\n List<PHHueError> errorAttribute) {\n }", "@Override\n\tpublic void addAttributeOnce(Attr key, String value) {\n\t\t\n\t\tif ( transLogModelThreadLocal.get().isTransLoggingOn() ) {\n\t\t\ttransLogModelThreadLocal.get().getAttributesOnce().put(key, value);\n\t\t}\n\t}", "@Override\n protected void onNonKeyAttribute(String attributeName,\n AttributeValue currentValue) {\n if (getLocalSaveBehavior() == DynamoDBMapperConfig.SaveBehavior.APPEND_SET) {\n if (currentValue.getBS() != null\n || currentValue.getNS() != null\n || currentValue.getSS() != null) {\n getAttributeValueUpdates().put(\n attributeName,\n new AttributeValueUpdate().withValue(\n currentValue).withAction(\"ADD\"));\n return;\n }\n }\n /* Otherwise, we do the default \"PUT\" update. */\n super.onNonKeyAttribute(attributeName, currentValue);\n }", "public void setDataPacket(Map<String, List<ICollidable>> dataPacket)\r\n {\r\n _dataPacket = dataPacket;\r\n }", "public void onsetCondition(String condition, String state, long time) {\n if (!onsetConditions.containsKey(condition)) {\n onsetConditions.put(condition, new OnsetCondition(condition));\n }\n OnsetCondition onsetCondition = onsetConditions.get(condition);\n onsetCondition.addNewEntry(time);\n state2conditionMapping.put(state, condition);\n }", "@Override\n public void propertyChange(PropertyChangeEvent pce) {\n if (null == map) {\n return;\n }\n\n map.getOrDefault(pce.getPropertyName(), Collections.emptyList())\n .forEach(pcl -> pcl.propertyChange(pce));\n }", "public void setAttribute(Attribute attribute) \n throws AttributeNotFoundException,\n InvalidAttributeValueException,\n MBeanException, \n ReflectionException {\n if (attribute == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute cannot be null\"), \n \"Cannot invoke a setter of \" + dClassName + \" with null attribute\");\n }\n String name = attribute.getName();\n if (name == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute name cannot be null\"), \n \"Cannot invoke the setter of \" + dClassName + \" with null attribute name\");\n }\n\n name = RunTimeSingleton.decode(name, \"US-ASCII\"); // HtmlAdapter made from info/admin -> info%2Fadmin\n // \"logging/org.xmlBlaster.engine.RequestBroker\"\n if (name.startsWith(\"logging/\"))\n name = name.substring(8); // \"org.xmlBlaster.engine.RequestBroker\"\n\n String value = (String)attribute.getValue();\n log.debug(\"Setting log level of name=\" + name + \" to '\" + value + \"'\");\n\n try {\n Level level = Level.toLevel(value);\n this.glob.changeLogLevel(name, level);\n }\n catch (ServiceManagerException e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.getMessage()));\n }\n catch (Throwable e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.toString()));\n }\n }", "public void setAttribute(String attribute, String value)\n\t{\n\t\tattributes.put(attribute, value);\n\t}", "private void setEventType(String eventType)\n\t{\n\t\tsomethingChanged = true;\n\t\tthis.eventType = eventType;\n\t}", "@Override\n public void attributeReplaced(ServletContextAttributeEvent event) {\n }", "public synchronized void setAttribute(String key, Object value) {\n if (value == null) {\n attributes.remove(key);\n } else {\n attributes.put(key, value);\n }\n }", "@Override\n public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException {\n if (attribute.equals(\"UpTime\")) {\n return upTime();\n }\n return null;\n }", "void setHashMap();", "public void setHour(int newHour) {\n hour = newHour; // sets the appointment's hour to the input in military time\n }", "void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws WrongReferenceAttributeValueException;", "void setProperty(String attribute, String value);", "void setHashData(java.lang.String hashData);", "public void setAllMessageCouldHaveFired(final Map<Language,String> value)\r\n\t{\r\n\t\tsetAllMessageCouldHaveFired( getSession().getSessionContext(), value );\r\n\t}", "private static void setData() {\n attributeDisplaySeq = new ArrayList<String>();\n attributeDisplaySeq.add(\"email\");\n\n signUpFieldsC2O = new HashMap<String, String>();\n signUpFieldsC2O.put(\"Email\",\"email\");\n\n\n signUpFieldsO2C = new HashMap<String, String>();\n signUpFieldsO2C.put(\"email\", \"Email\");\n\n\n }", "public void setData(@NotNull String key, @NotNull Object value) {\n data.put(key, value);\n }", "@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}", "public TimedEvent(String label, Date date, Time time) {\n super(label, date); // using the constructor of its superclass\n this.setTime(time); // assigns the time argument value to the attribute\n }", "public void setAttributeValue(java.lang.String param) {\r\n localAttributeValueTracker = true;\r\n\r\n this.localAttributeValue = param;\r\n\r\n\r\n }", "void setValue(String name,BudaBubble bbl)\n{\n if (name != null) value_map.put(name,bbl);\n}", "protected void onSetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "public abstract void setCustomData(Object data);", "@Override\n public void processBroadcastElement(SocketEvent event, Context ctx, Collector<KeyedDataPoint> out) throws Exception {\n BroadcastState<String, SocketEvent> bcState = ctx.getBroadcastState(amplificationDesc);\n // storing in MapState with null as VOID default value\n bcState.put(event.streamKey, event);\n }", "public void setSPEventID(Long SPEventID)\n/* */ {\n/* 76 */ this.SPEventID = SPEventID;\n/* */ }", "public void data(Element element)\n {\n TimeEntry timeEntry = new TimeEntry(getIntValue(element,\"id\"),\n getIntAttribute(element,\"project\",\"id\"),\n getIntAttribute(element,\"issue\",\"id\"),\n getIntAttribute(element,\"user\",\"id\"),\n getIntAttribute(element,\"activity\",\"id\"),\n getDoubleValue(element,\"hours\"),\n getValue(element,\"comments\"),\n getDateValue(element,\"spent_on\"),\n getDateValue(element,\"created_on\"),\n getDateValue(element,\"updated_on\")\n );\n store(timeEntry);\n }", "public void setEvents(Event[] event) {\n\n setEventID(event[0].getEventID());\n\n //Store keys as EventID for later use to put it all in order\n Map<String, ArrayList<Event>> listMap = new HashMap<>();\n\n for (int i = 0; i < event.length; i++) {\n\n events.put(event[i].getEventID(), event[i]);\n eventTypes.add(event[i].getEventType().toLowerCase());\n\n if(!listMap.containsKey(event[i].getPersonID())) {\n ArrayList<Event> newEventList = new ArrayList<>();\n listMap.put(event[i].getPersonID(), newEventList);\n }\n listMap.get(event[i].getPersonID()).add(event[i]);\n }\n\n // Chronologically order for events\n for (String key : listMap.keySet()) {\n Set birthSet = new HashSet<>(); // birth events come first\n Set deathSet = new HashSet<>(); // death events come last (obviously)\n ArrayList<Event> eventList = new ArrayList<Event>();\n\n // Adding events in chronological order based on events\n for(int i = 0; i < listMap.get(key).size(); i++) {\n Event currEvent = listMap.get(key).get(i);\n\n if(currEvent.getEventType().toLowerCase().equals(\"birth\")) {\n birthSet.add(currEvent);\n } else if (currEvent.getEventType().toLowerCase().equals(\"death\")) {\n deathSet.add(currEvent);\n } else { // get events by year and sort them\n if(eventList.size() > 0) {\n if (currEvent.getYear() < eventList.get(0).getYear()) {\n eventList.add(0, currEvent);\n } else if (currEvent.getYear() >= eventList.get(eventList.size() - 1).getYear()) {\n eventList.add(currEvent);\n } else {\n for (int j = 0; j < eventList.size() - 1; j++) {\n if(eventList.get(j).getYear() <= currEvent.getYear() && eventList.get(j + 1).getYear() > currEvent.getYear()) {\n eventList.add(j + 1, currEvent);\n }\n }\n }\n } else {\n eventList.add(currEvent);\n }\n }\n }\n\n ArrayList<Event> orderedList = new ArrayList<Event>(); // will store ordered list for events\n\n orderedList.addAll(birthSet);\n orderedList.addAll(eventList);\n orderedList.addAll(deathSet);\n\n personEvents.put(key, orderedList);\n }\n }", "protected void populateAttributeValue(final AttributeValue value, final Attribute attribute, final String localizedAttributeKey) {\n\t\tvalue.setAttribute(attribute);\n\t\tvalue.setAttributeType(attribute.getAttributeType());\n\t\tvalue.setLocalizedAttributeKey(localizedAttributeKey);\n\t}", "@Override\n public void processEvent(String path, AttributeSet pathAttributes, AttributeSet oldAttributes,\n GenericKubernetesResource resource, String newState) {\n String existing = map.remove(oldAttributes);\n AttributeSet newAttributes = null;\n if (newState != null) {\n if (resource != null) {\n newAttributes = kubernetesAttributesExtractor.extract(resource);\n } else {\n newAttributes = kubernetesAttributesExtractor.fromResource(newState);\n }\n // corner case - we need to get the plural from the path\n if (!newAttributes.containsKey(KubernetesAttributesExtractor.PLURAL)) {\n newAttributes = AttributeSet.merge(pathAttributes, newAttributes);\n }\n map.put(newAttributes, newState);\n }\n if (!Objects.equals(existing, newState)) {\n AttributeSet finalAttributeSet = newAttributes;\n watchEventListeners.forEach(listener -> {\n boolean matchesOld = oldAttributes != null && listener.attributeMatches(oldAttributes);\n boolean matchesNew = finalAttributeSet != null && listener.attributeMatches(finalAttributeSet);\n if (matchesOld && matchesNew) {\n listener.sendWebSocketResponse(newState, Action.MODIFIED);\n } else if (matchesOld) {\n listener.sendWebSocketResponse(existing, Action.DELETED);\n } else if (matchesNew) {\n listener.sendWebSocketResponse(newState, Action.ADDED);\n }\n });\n\n crdProcessor.process(path, Utils.getNonNullOrElse(newState, existing), newState == null);\n }\n }", "@Override\n\tpublic void setDataCode(java.lang.String dataCode) {\n\t\t_dictData.setDataCode(dataCode);\n\t}", "protected void configEvent(String[] aKey) {}", "@Override\n public void process(HashMap<K, V> tuple)\n {\n for (Map.Entry<K, V> e: tuple.entrySet()) {\n MutableDouble val = basemap.get(e.getKey());\n if (!doprocessKey(e.getKey())) {\n continue;\n }\n if (val == null) { // Only process keys that are in the basemap\n val = new MutableDouble(e.getValue().doubleValue());\n basemap.put(cloneKey(e.getKey()), val);\n continue;\n }\n double change = e.getValue().doubleValue() - val.value;\n double percent = (change/val.value)*100;\n if (percent < 0.0) {\n percent = 0.0 - percent;\n }\n if (percent > percentThreshold) {\n HashMap<V,Double> dmap = new HashMap<V,Double>(1);\n dmap.put(cloneValue(e.getValue()), percent);\n HashMap<K,HashMap<V,Double>> otuple = new HashMap<K,HashMap<V,Double>>(1);\n otuple.put(cloneKey(e.getKey()), dmap);\n alert.emit(otuple);\n }\n val.value = e.getValue().doubleValue();\n }\n }", "public void set(AttributeDefinition attribute, Object value)\n throws UnknownAttributeException, ModificationNotPermitedException\n {\n if(builtinAttributes.containsKey(attribute.getName()))\n {\n throw new IllegalArgumentException(\"builtin attribute \"+attribute.getName()+\n \"cannot be modified with set method\"); \n }\n else\n {\n throw new UnknownAttributeException(\"not a builtin attribute\");\n }\n }", "@Override\n\tpublic void attributeReplaced(ServletContextAttributeEvent event) {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic Attribute handleMapValue(Element parent, FTypeRef src) {\n\t\t\t\t\t\treturn super.handleMapValue(parent, src);\n\t\t\t\t\t}", "private void storeEventAttributes(EventGVO event, UIObject sender, String listenerType, String appId,\n String windowId, String eventSessionId) {\n String srcId = getComponentId(sender);\n String srcName = getComponentName(sender);\n Object srcValue = getComponentValue(sender, appId, windowId, srcId);\n String srcListener = listenerType;\n\n storeData(eventSessionId, event.getSourceId(), srcId);\n storeData(eventSessionId, event.getSourceName(), srcName);\n storeData(eventSessionId, event.getSourceValue(), srcValue);\n storeData(eventSessionId, event.getSourceListenerType(), srcListener);\n }", "private void setMap(final Map map) {\n\t\tthis.map = map;\n\t\tthis.setChanged();\n\t\tthis.notifyObservers();\n\t}", "@Override\r\n\t\tpublic Object setUserData(String key, Object data, UserDataHandler handler)\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}" ]
[ "0.5597", "0.53696567", "0.5224392", "0.514256", "0.4875497", "0.477469", "0.47730732", "0.47714943", "0.4771373", "0.47655746", "0.4755931", "0.47529432", "0.47460148", "0.47391742", "0.47308955", "0.4721371", "0.47129464", "0.47110718", "0.46913707", "0.46825108", "0.46758553", "0.4672673", "0.46645504", "0.46564162", "0.4648322", "0.4638426", "0.46313846", "0.462933", "0.4612837", "0.46081343", "0.4600882", "0.4596539", "0.4579111", "0.45784473", "0.4569507", "0.4566928", "0.45521787", "0.45478716", "0.4542603", "0.4538965", "0.45368248", "0.45361066", "0.45336053", "0.4532263", "0.4530625", "0.45251572", "0.45168072", "0.45042023", "0.4488563", "0.44882733", "0.44872338", "0.447771", "0.44716862", "0.44697163", "0.44653577", "0.4450058", "0.44432786", "0.44431818", "0.44424522", "0.4434005", "0.44316387", "0.4431584", "0.44291788", "0.44286045", "0.44067472", "0.440632", "0.44019347", "0.4399515", "0.43968573", "0.43912977", "0.43888336", "0.4388239", "0.4387886", "0.43789238", "0.43777677", "0.43685764", "0.43667057", "0.43644458", "0.43641537", "0.43641302", "0.43635422", "0.43529496", "0.43426934", "0.4342559", "0.43387496", "0.4335264", "0.4334496", "0.4334394", "0.43334877", "0.4332862", "0.4332716", "0.4332305", "0.4331998", "0.43310484", "0.43282926", "0.43282038", "0.4322412", "0.43168184", "0.43148103", "0.43139806" ]
0.5825813
0
Overwrites the data in the hashmap containing TwitterObjects to the given attribute.
public void setTwitter(TwitterObject[] data) { clearTwitter(); for (int i=0; i<data.length; i++) { this.twitterDB.put(data[i].getId(), data[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <T> void putAll(Map<String,T> attr) {\r\n attributeMap.putAll(attr);\r\n fireStateChanged();\r\n }", "public Object put(String aName, Object anObj)\n{\n // If map shared, clone it for real\n if(_attrMap.isShared())\n _attrMap = _attrMap.cloneX();\n \n // Put value (or remove if null)\n return anObj!=null? _attrMap.put(aName, anObj) : _attrMap.remove(aName);\n}", "public void setAttribute(Object key, Object value);", "@Override\n public void update(String tweet, Long tweetTime) {\n\tuserFeed.add(tweet);\n\tlastUpdateTime = tweetTime;\n }", "public void attach(Object key, Object value);", "public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }", "public void setOtherInfo(Map<String, Object> otherInfo) {\n this.otherInfo = TimelineServiceHelper.mapCastToHashMap(otherInfo);\n }", "@Override\n public void put(Object o, Person person) {\n \n }", "public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}", "public void updateAttributeAddObjectToCollection(String attributeName, Object mapKey, Object value) {\n DatabaseMapping mapping = this.query.getDescriptor().getMappingForAttributeName(attributeName);\n if (mapping == null) {\n throw DescriptorException.mappingForAttributeIsMissing(attributeName, getDescriptor());\n }\n\n Object clone = this.getObject();\n Object cloneValue = value;\n Object original = null;\n\n //only set the original object if we need to update it, ie before the merge takes place\n if ((this.eventCode == DescriptorEventManager.PostCloneEvent) || (this.eventCode == DescriptorEventManager.PostMergeEvent)) {\n original = this.getOriginalObject();\n }\n Object originalValue = value;\n ObjectChangeSet eventChangeSet = this.getChangeSet();\n Object valueForChangeSet = value;\n\n if ((this.query != null) && this.query.isObjectLevelModifyQuery()) {\n clone = ((ObjectLevelModifyQuery)this.query).getObject();\n eventChangeSet = ((ObjectLevelModifyQuery)this.query).getObjectChangeSet();\n }\n ClassDescriptor descriptor = getSession().getDescriptor(value.getClass());\n\n if (descriptor != null) {\n //There is a descriptor for the value being passed in so we must be carefull\n // to convert the value before assigning it.\n if (eventChangeSet != null) {\n valueForChangeSet = descriptor.getObjectBuilder().createObjectChangeSet(value, (UnitOfWorkChangeSet)eventChangeSet.getUOWChangeSet(), getSession());\n }\n if (original != null) {\n // must be a unitOfWork because only the postMerge, and postClone events set this attribute\n originalValue = ((UnitOfWorkImpl)getSession()).getOriginalVersionOfObject(value);\n }\n }\n\n if (clone != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(clone, getSession());\n mapping.getContainerPolicy().addInto(mapKey, cloneValue, collection, getSession());\n }\n if (original != null) {\n Object collection = mapping.getRealCollectionAttributeValueFromObject(original, getSession());\n mapping.getContainerPolicy().addInto(mapKey, originalValue, collection, getSession());\n }\n if (getRecord() != null) {\n AbstractRecord tempRow = getDescriptor().getObjectBuilder().createRecord();\n\n // pass in temp Row because most mappings use row.add() not row.put() for\n // perf reasons. We are using writeFromObjectIntoRow in order to support\n // a large number of types.\n mapping.writeFromObjectIntoRow(clone, tempRow, getSession());\n ((AbstractRecord)getRecord()).mergeFrom(tempRow);\n }\n if (eventChangeSet != null) {\n mapping.simpleAddToCollectionChangeRecord(mapKey, valueForChangeSet, eventChangeSet, getSession());\n }\n }", "public abstract void setData(Map<ID, T> data);", "@Override\r\n\tpublic void updateAccountHashmap(Account acc) {\n\t\tdataMap.put(acc.getAccountNumber(), acc);\r\n\t}", "public abstract void set(String key, T data);", "void bind_attribute(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name, RakudoObject value);", "public synchronized void setAttribute(String key, Object value) {\n if (value == null) {\n attributes.remove(key);\n } else {\n attributes.put(key, value);\n }\n }", "void put(String key, Object obj);", "@Override\n\tpublic boolean update(Eleve o) {\n\t\tmap.replace(o.getId(), o);\n\t\treturn true;\n\t}", "void setAttributes(String path, Map<String, Object> newValue) throws IOException;", "@Nullable\r\n public Object put(String key, @Nullable Object value) {\r\n Object res = attributeMap.put(key, value);\r\n fireStateChanged();\r\n return res;\r\n }", "public void updateAttributeWithObject(String attributeName, Object value) {\n DatabaseMapping mapping = this.query.getDescriptor().getMappingForAttributeName(attributeName);\n if (mapping == null) {\n throw DescriptorException.mappingForAttributeIsMissing(attributeName, getDescriptor());\n }\n\n Object clone = this.getObject();\n Object cloneValue = value;\n Object original = null;\n\n //only set the original object if we need to update it, ie before the merge takes place\n if ((this.eventCode == DescriptorEventManager.PostCloneEvent) || (this.eventCode == DescriptorEventManager.PostMergeEvent)) {\n original = this.getOriginalObject();\n }\n Object originalValue = value;\n ObjectChangeSet eventChangeSet = this.getChangeSet();\n Object valueForChangeSet = value;\n\n if ((this.query != null) && this.query.isObjectLevelModifyQuery()) {\n clone = ((ObjectLevelModifyQuery)this.query).getObject();\n eventChangeSet = ((ObjectLevelModifyQuery)this.query).getObjectChangeSet();\n }\n ClassDescriptor descriptor = getSession().getDescriptor(value.getClass());\n\n if (descriptor != null) {\n //There is a descriptor for the value being passed in so we must be carefull\n // to convert the value before assigning it.\n if (eventChangeSet != null) {\n valueForChangeSet = descriptor.getObjectBuilder().createObjectChangeSet(value, (UnitOfWorkChangeSet)eventChangeSet.getUOWChangeSet(), getSession());\n }\n if (original != null) {\n // must be a unitOfWork because only the postMerge, and postClone events set this attribute\n originalValue = ((UnitOfWorkImpl)getSession()).getOriginalVersionOfObject(value);\n }\n }\n if (clone != null) {\n mapping.setRealAttributeValueInObject(clone, cloneValue);\n }\n if (original != null) {\n mapping.setRealAttributeValueInObject(original, originalValue);\n }\n if (getRecord() != null) {\n AbstractRecord tempRow = getDescriptor().getObjectBuilder().createRecord();\n\n // pass in temp Row because most mappings use row.add() not row.put() for\n // perf reasons. We are using writeFromObjectIntoRow in order to support\n // a large number of types.\n mapping.writeFromObjectIntoRow(clone, tempRow, getSession());\n ((AbstractRecord)getRecord()).mergeFrom(tempRow);\n }\n if (eventChangeSet != null) {\n eventChangeSet.removeChange(attributeName);\n eventChangeSet.addChange(mapping.compareForChange(clone, ((UnitOfWorkImpl)getSession()).getBackupClone(clone), eventChangeSet, getSession()));\n }\n }", "public Map<String, Object> update(Trade obj) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void putObject(Object key, Object value) {\n\t\t\r\n\t}", "void setInternal(ATTRIBUTES attribute, Object iValue);", "public void setMetaData(HashMap pMetaData) ;", "void put(String key, Object value);", "void setAttribute(String key, Object value)\n throws ProcessingException;", "@Override\r\n public void updateEntryValue(Object key, Object value) throws Exception\r\n {\n }", "public Twitter() {\n twitterTweetMap = new HashMap<>();\n reverseTwitterFollowMap = new HashMap<>();\n }", "@Override\n protected void onNonKeyAttribute(String attributeName,\n AttributeValue currentValue) {\n if (getLocalSaveBehavior() == DynamoDBMapperConfig.SaveBehavior.APPEND_SET) {\n if (currentValue.getBS() != null\n || currentValue.getNS() != null\n || currentValue.getSS() != null) {\n getAttributeValueUpdates().put(\n attributeName,\n new AttributeValueUpdate().withValue(\n currentValue).withAction(\"ADD\"));\n return;\n }\n }\n /* Otherwise, we do the default \"PUT\" update. */\n super.onNonKeyAttribute(attributeName, currentValue);\n }", "void put(String name, Object value);", "public void addOtherInfo(String key, Object value) {\n this.otherInfo.put(key, value);\n }", "public void setAttribute (GenericAttribute attribute) {\n this.attribute = attribute;\n this.type = TYPE_ATTRIBUTE;\n this.id = attribute.getId();\n }", "public abstract <T> void update(String id, Map<String, Object> objectMap, Class<T> clazz);", "void set(String key, Object value);", "public void put(T data){\r\n\t\tthis.data = data;\r\n\t}", "<T> void put(String key, T data);", "Object put(Object key, Object value);", "@Override\n\tpublic void setAttributes(AttributeMap arg0) {\n\t\tdefaultEdgle.setAttributes(arg0);\n\t}", "default void putAttribute(ConceptName name, Attribute attribute) {}", "public void updateData(TimingObj timingObj) {\n\n\t\tStatsObject statsObj = data.get(timingObj.getClassName());\n\n\t\tif (statsObj == null) {\n\t\t\tstatsObj = new StatsObject(timingObj.getClassName());\n\t\t\tdata.put(timingObj.getClassName(), statsObj);\n\t\t}\n\t\tstatsObj.addTiming(timingObj.duration());\n\t}", "public void addAttribute(DictionarySimpleAttribute dsa) {\n\t\tif(dsa == null) {\n\t\t\tthrow new IllegalArgumentException(\"Dictionary attribute must not be null\");\n\t\t}\n\n\t\tString prevKey = this.attributes.getKey(dsa);\n\t\tDictionarySimpleAttribute prev = this.attributes.put(dsa.getXmlName(), dsa);\n\n\t\tif(prevKey != null) {\n\t\t\tlog.warn(\"Two attributes with same CBOR mapping: old:\" + prevKey + \", new:\" + dsa.getXmlName());\n\t\t}\n\t\tif(prev != null) {\n\t\t\tlog.warn(\"Previous attribute mapping overridden: \" + dsa.getXmlName() + \", Attribute:\" + prev.toString());\n\t\t}\n\t}", "public void writeTweet(String tweet)\r\n\t{\n\t\ttweets.add(tweet);//adds the tweet to the tweets list\r\n\t\tnotifyObservers(tweet);//notifies observers of the tweet\r\n\t\tupdateTweet(tweet);//updates the tweet\r\n\t}", "void setObject(String id, Object data);", "public void saveOrUpdate(Object obj) throws HibException;", "@Override\n public void put( final K name, final V obj )\n {\n // Call put with a copy of the contained caches default attributes.\n // the attributes are copied by the cacheControl\n put( name, obj, this.getCacheControl().getElementAttributes() );\n }", "final public void setAttr(final String name, final Object value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\tattr.Object = value;\r\n\t\t}\r\n\t}", "@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }", "@Override\n\tpublic void updateArtikUserProfile(HashMap<String, Object> map) {\n\t\tsqlSession.insert(PATH + \"updateArtikUserProfile\", map);\n\t}", "void setHashMap();", "public void bind(NameValue that) {\n for( Entry<String, Object> e: that) {\n String key=e.getKey();\n if (this.containsKey(key))\n this.getStringProperty(key).set(that.getString(key));\n else\n put(key, that.getStringProperty(key));\n }\n }", "@Override\n\t\tpublic void setAttribute(String name, Object o) {\n\t\t\t\n\t\t}", "public void map(Object key, Text value, Context context)\n throws IOException, InterruptedException {\n Scanner line = new Scanner(value.toString());\n line.useDelimiter(\"\\t\");\n author.set(line.next());\n context.write(author, one);\n }", "public abstract void setData(Map attributes, Iterator accessPoints);", "public Twitter() {\n map = new HashMap<>();\n }", "@Override\n public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {\n\n }", "@SuppressWarnings(\"unchecked\")\n public void put(final T object) {\n data.add(object);\n }", "public void setAttribute(String name, String value, Hashtable objectList)\r\n\t{\t\t\r\n\t\r\n\t\t// set attribute with type double\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// convert string value to double\r\n\t\t\tDouble temp = new Double(value);\r\n\t\t\tdouble val = temp.doubleValue();\r\n\t\t\t\t\t\t\r\n\t\t\tif (name.equals(\"influence\")) \t\r\n\t\t\t{ \t\r\n\t\t\t\tm_influence=val;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e) {}\t\t\t\t\r\n\t\r\n\t}", "public void \n\tsetData(\n\t\t\tString key, \n\t\t\tObject value) \n\t{\n\t\ttry{\n\t\t\tthis_mon.enter();\n\n\t\t\tif (user_data == null) {\n\t\t\t\tuser_data = new HashMap();\n\t\t\t}\n\t\t\tif (value == null) {\n\t\t\t\tif (user_data.containsKey(key))\n\t\t\t\t\tuser_data.remove(key);\n\t\t\t} else {\n\t\t\t\tuser_data.put(key, value);\n\t\t\t}\n\t\t}finally{\n\t\t\tthis_mon.exit();\n\t\t}\n\t}", "void addAttribute(String attrName, Attribute<?> newAttr);", "public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }", "public void setData(@NotNull String key, @NotNull Object value) {\n data.put(key, value);\n }", "private void setUser(Map<String, Object> data) {\n this.setUser(ID(), data);\n }", "public void updateByObject()\r\n\t{\n\t}", "public void addAttribute(String key, String value) {\r\n this.mapAttributes.put(key, value);\r\n }", "public boolean setPlayerAttribute(P player, String attribute, Long number){\n attribute = \".\" + attribute;\n if(playerMap.containsKey(player)){\n if(playerMap.get(player).hasAttribute(attribute)){\n playerMap.get(player).getPlayerProfile().put(attribute, number);\n return true;\n } else {\n playerMap.get(player).getPlayerProfile().put(attribute, number);\n System.out.println(\"Just set an attribute that isn't loaded on the player\");\n return false;\n }\n } else {\n System.out.println(\"Failed to setPlayerAttribute as player isn't loaded\");\n return false;\n }\n }", "public void saveOrUpdate(Object aObject);", "public void saveOrUpdate(T o);", "public void addOtherInfo(Map<String, Object> otherInfo) {\n this.otherInfo.putAll(otherInfo);\n }", "@Override\n\tpublic Map<String, Object> update(StoreBase entity) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "void setMap(Map aMap);", "void setUserProfile(Map<String, Object> profile);", "public void addAttribute(String key, Object value) {\n\t\tmyAttributes.put(key, value);\n\t}", "public final synchronized void addAttribute(String name, Object attr) {\n\t if ( m_cache == null)\n\t \tm_cache = new Hashtable<String, Object>();\n\t m_cache.put(name,attr);\n\t}", "public void put(String key, T value);", "public void put(Object key,Object value) {\n map.put(key,value);\n hashtable.put(key,value);\n }", "@Override\n\tpublic Map changeAttributes(Map arg0) {\n\t\treturn defaultEdgle.changeAttributes(arg0);\n\t}", "@PostMapping(\"/modifyAttribute\")\n public String modifyAttribute(String uid, String attribute, String value)\n {\n String returnVal;\n if()\n {\n if() //if object has attribute\n {\n returnVal = \"uid: \"+ uid + \"\\n\";\n } else\n {\n returnVal = \"no such attribute\\n\";\n }\n } else\n {\n returnVal = \"uid not found\\n\";\n }\n return returnVal;\n }", "public void setAttributeKey(java.lang.String param) {\r\n localAttributeKeyTracker = true;\r\n\r\n this.localAttributeKey = param;\r\n\r\n\r\n }", "@Override\n\tpublic void setAttribute(String name, Object o) {\n\t\t\n\t}", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "public void addWinnerAttribute(String attrName, String recordId) {\r\n attributeWinnersMap.put(attrName, recordId);\r\n }", "private void refreshAttributeColumnTemplate(AttributeFormObject attribute) {\n\t\tint index = attributes.indexOf(attribute);\n\t\tattributes.set(index, attribute);\n\t}", "public Twitter() {\n u_map = new HashMap<>();\n }", "public void save(HashMap<Integer, T> data) {\n\t\tthis.data.putAll(data);\n\t}", "public Object putItem (String key, Object item);", "void setData (Object newData) { /* package access */ \n\t\tdata = newData;\n\t}", "public void setOnTheMapXY(IEntity entity, int x, int y) {\r\n\t\tthis.map[x][y] = entity;\r\n\t}", "void putFlyweight(String type, String tag, Object flyweight) {\n\t\t\tcache.put(type + \".\" + tag, flyweight);\n\t\t}", "public Twitter() {\n userToTwitter = new HashMap<>();\n friends = new HashMap<>();\n tweets = new HashMap<>();\n }", "@Override\n\tpublic void setUserId(long userId) {\n\t\t_dictData.setUserId(userId);\n\t}", "public void setData(Map<E, String> data) {\n\t\tthis.data = data;\n\t}", "protected void setAttributeCache(ShibbolethResolutionContext resolutionContext, String query, Map<String,BaseAttribute> resolvedAttributes) {\n String principal = resolutionContext.getAttributeRequestContext().getPrincipalName();\n Map<String, Map<String, BaseAttribute>> cache = dataCache.get(principal);\n if (cache == null) {\n cache = new HashMap<String, Map<String, BaseAttribute>>();\n dataCache.put(principal, cache);\n }\n cache.put(query, resolvedAttributes);\n }", "public Object saveOrUpdateCopy(Object obj) throws HibException;", "void putValue(String key, Object data);", "public void setAttributes(Map<String, String> attributes) {\n if (attributes != null && this.attributes != attributes) {\n this.attributes.putAll(attributes);\n }\n }", "public void postTweet(int userId, int tweetId) {\n List<Integer> userTweetList = twitterTweetMap.getOrDefault(userId, new LinkedList<>());\n userTweetList.add(0,tweetId);\n twitterTweetMap.put(userId, userTweetList);\n for(int followerId : reverseTwitterFollowMap.getOrDefault(userId, new HashSet<>())){\n List<Integer> followeeTweetList = twitterTweetMap.getOrDefault(followerId, new LinkedList<>());\n followeeTweetList.add(0,tweetId);\n twitterTweetMap.put(followerId, followeeTweetList);\n }\n }", "void bind_attribute_with_hint(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name, int hint, RakudoObject Value);", "void put(Object indexedKey, Object key);", "private WSResponse addTwitterData(WSResponse response, TwitterData twData) {\n\t\tif(twData!=null){\n\t\t\tif(twData.getTweets()!=null && twData.getTweets().size()>0){\n\t\t\t\tfor (Tweet tweet : twData.getTweets()) {\n\t\t\t\t\tEvents event=new Events();\n\t\t\t\t\tevent.setMessage(tweet.getMessage());\n\t\t\t\t\tevent.setMood(tweet.getMood().getType());\n\t\t\t\t\tevent.setSource(\"twitter\");\n\t\t\t\t\tevent.setTime(tweet.getTime());\n\t\t\t\t\tresponse.getEvents().add(event);\n\t\t\t\t\tresponse.setTwitter(response.getTwitter()+1);\n\t\t\t\t\tresponse.setScore(response.getScore()+tweet.getMood().getScore());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn response;\n\t}" ]
[ "0.5701668", "0.55454165", "0.552153", "0.54076105", "0.52841717", "0.5206663", "0.5151432", "0.5116065", "0.51080495", "0.51068324", "0.50869757", "0.5078179", "0.5057774", "0.5050461", "0.5049064", "0.50443953", "0.50403476", "0.50190794", "0.5014248", "0.4985396", "0.49852705", "0.49793488", "0.49632338", "0.49542677", "0.4943484", "0.49292836", "0.4919698", "0.49183196", "0.49165845", "0.4914614", "0.4912656", "0.48991406", "0.4894661", "0.48937774", "0.4890643", "0.48897436", "0.48875955", "0.48867866", "0.48771426", "0.48631096", "0.48562667", "0.48253947", "0.4819853", "0.48186475", "0.4812637", "0.480459", "0.4801655", "0.48007163", "0.4786726", "0.47860983", "0.4775934", "0.47756228", "0.47750086", "0.4770851", "0.47695625", "0.47607055", "0.47592038", "0.47524992", "0.47504783", "0.4746638", "0.4744019", "0.47420034", "0.47374558", "0.473546", "0.4729699", "0.47078735", "0.47028977", "0.46956956", "0.4686143", "0.468526", "0.46841118", "0.46787703", "0.4673235", "0.46729818", "0.46652955", "0.46645358", "0.46583062", "0.4656224", "0.4653895", "0.4651373", "0.46480724", "0.46468005", "0.46448433", "0.4635199", "0.4633504", "0.46322614", "0.46310008", "0.462795", "0.46229225", "0.46213683", "0.46190423", "0.46148872", "0.46068692", "0.46039847", "0.4598286", "0.45933166", "0.45913145", "0.45906124", "0.4590522", "0.45881057" ]
0.565011
1
Private Constructor to ensure Singleton
private MovieFacade() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Singleton(){}", "private Singleton()\n\t\t{\n\t\t}", "private Singleton() {\n\t}", "private Singleton() { }", "private SingletonObject() {\n\n\t}", "private Singleton(){\n }", "private SingletonSigar(){}", "private SingletonSample() {}", "private LazySingleton(){}", "private Singleton() {\n if (instance != null){\n throw new RuntimeException(\"Use getInstance() to create Singleton\");\n }\n }", "private SparkeyServiceSingleton(){}", "private LazySingleton() {\n if (null != INSTANCE) {\n throw new InstantiationError(\"Instance creation not allowed\");\n }\n }", "private SingletonDoubleCheck() {}", "private J2_Singleton() {}", "private SingletonEager(){\n \n }", "private EagerInitializedSingleton() {\n\t}", "private EagerInitializedSingleton() {\n\t}", "private LoggerSingleton() {\n\n }", "private Instantiation(){}", "private EagerlySinleton()\n\t{\n\t}", "private InstanceUtil() {\n }", "private MySingleton() {\r\n\t\tSystem.out.println(\"Only 1 object will be created\");\r\n\t}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public SingletonVerifier() {\n }", "private InnerClassSingleton(){}", "private SingletonAR() {\n System.out.println(Thread.currentThread().getName()\n + \": creating SingletonAR\");\n }", "private EagerInitializationSingleton() {\n\t}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private MApi() {}", "private Singleton2A(){\n\t\tif(instance != null){\n\t\t\tthrow new RuntimeException(\"One instance already created cant create other\");\n\t\t}\t\t\n\t\tSystem.out.println(\"I am private constructor\");\n\t}", "private SingleTon() {\n\t}", "private LOCFacade() {\r\n\r\n\t}", "private TagCacheManager(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private SingleObject()\r\n {\r\n }", "private Singleton()\r\n\t{\r\n\t\tSystem.out.println(\"1st instance of class Singleton created\");\r\n\t\tstr = \"Constructor init\";\r\n\t}", "private SingletonH() {\n System.out.println(Thread.currentThread().getName()\n + \": creating SingletonH\");\n }", "private ObjectFactory() { }", "private SingletonLectorPropiedades() {\n\t}", "private SingletonClass() {\n objects = new ArrayList<>();\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private SingletonClass() {\n x = 10;\n }", "private PermissionUtil() {\n throw new IllegalStateException(\"you can't instantiate PermissionUtil!\");\n }", "Reproducible newInstance();", "private SnapshotUtils() {\r\n\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "private BusquedaMaker() {\n\t\tinit();\n\t}", "private SingletonSyncBlock() {}", "private PropertySingleton(){}", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "private StreamFactory()\n {\n /*\n * nothing to do\n */\n }", "public SharedObject() {}", "private ResourceFactory() {\r\n\t}", "private Service() {}", "private Util() {\n }", "private Utility() {\n\t}", "private Util() {\n }", "private Util() {\n }", "private ModuleSyncHelper() {\n //Private constructor to avoid instances for this helper.\n }", "private ScriptInstanceManager() {\n\t\tsuper();\n\t}", "private RequestManager() {\n\t // no instances\n\t}", "private SingleObject(){}", "private FixtureCache() {\n\t}", "private QcTestRunner()\n\t{\n\t\t// To prevent external instantiation of this class\n\t}", "private ArticleMgr() {\r\n\r\n\t}", "private SingleObject(){\n }", "private JsonUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private GmpLibInstance() {\n }", "private Util() { }", "private WolUtil() {\n }", "private FeedRegistry() {\n // no-op for singleton pattern\n }", "private UtilsCache() {\n\t\tsuper();\n\t}", "private Supervisor() {\r\n\t}", "private LocatorFactory() {\n }", "private DPSingletonLazyLoading(){\r\n\t\tthrow new RuntimeException();//You can still access private constructor by reflection and calling setAccessible(true)\r\n\t}", "private StaticData() {\n\n }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private DataManager() {\n }", "private Rekenhulp()\n\t{\n\t}", "public Instance() {\n }", "public LibraryCache() {\n\t }", "private PerksFactory() {\n\n\t}", "private TSLManager() {\n\t\tsuper();\n\t}", "private FlowExecutorUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "private FactoryCacheValet() {\n\t\tsuper();\n\t}", "private HttpClient() {\n\t}", "private SerializationUtils() {\n\t\tthrow new AssertionError();\n\t}", "private HabitTrackerUtils() {\n // Required empty private constructor (to prevent instantiation).\n }", "private SharedPreferencesUtils() {\n }", "private void initInstance() {\n init$Instance(true);\n }", "private OMUtil() { }" ]
[ "0.87969863", "0.87961644", "0.87283206", "0.8665476", "0.8535576", "0.8402946", "0.827173", "0.8182788", "0.81696206", "0.8071351", "0.79498494", "0.79409987", "0.7878587", "0.7862135", "0.7840997", "0.77403593", "0.77403593", "0.7700436", "0.76197237", "0.75681293", "0.7563083", "0.75225306", "0.7515714", "0.7499579", "0.7479587", "0.7414386", "0.7410071", "0.7404892", "0.7315128", "0.72615147", "0.7252527", "0.72071034", "0.71942014", "0.71666145", "0.7155366", "0.7139418", "0.71250767", "0.71127117", "0.71105546", "0.71015936", "0.70896614", "0.70836985", "0.70791364", "0.70724684", "0.7071134", "0.70441324", "0.7027497", "0.7027497", "0.7013463", "0.7004987", "0.70039946", "0.6997512", "0.69951624", "0.6972143", "0.69658756", "0.6946938", "0.69401526", "0.69366735", "0.6920681", "0.6920681", "0.69203883", "0.6913596", "0.69130474", "0.6910665", "0.69065446", "0.68991196", "0.68935454", "0.6893105", "0.6891557", "0.6855224", "0.6855224", "0.6855224", "0.6855224", "0.6855224", "0.6845353", "0.6837895", "0.6837332", "0.68353647", "0.68256", "0.68237597", "0.6823252", "0.68196326", "0.6812719", "0.6804853", "0.6804853", "0.6804853", "0.6804853", "0.679794", "0.6791928", "0.67905176", "0.67872316", "0.67871577", "0.67843693", "0.67814016", "0.67787457", "0.67718965", "0.67695165", "0.6768722", "0.6768455", "0.6761487", "0.6758748" ]
0.0
-1
Simulate next opponet move, if any move done by opponent will bring victory, player will use that move and undo his move.
public Move validateLastMove() { Move move = board.getLastMove(); int movevalue = move.getValue() == 1 ? -1 : 1; PieceColor nextplayer = Utility.convertCountToPlayerPiece(movevalue); BoardState playerState = (nextplayer == PieceColor.RED ? BoardState.REDWON : BoardState.YELLOWWON); BoardState state; Move newmove; // simulate opponent next move for (int column = 0, colSize = board.size()[1]; column < colSize; column++) { if (move.getColIndex() != column) { try { newmove = board.droppiece(column, nextplayer); state = board.getState(movevalue); board.undoLastMove(); if (state != BoardState.STILL_PLAYING && playerState == state) { return newmove; } } catch (MoveException e) { //ignore } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}", "public void doNextMove(Player player) {\r\n int newX = xCoord;\r\n int newY = yCoord;\r\n switch (currentDirection) {\r\n case 1:\r\n newX = xCoord + 1;\r\n break;\r\n case 2:\r\n newY = yCoord + 1;\r\n break;\r\n case -1:\r\n newX = xCoord - 1;\r\n break;\r\n case -2:\r\n newY = yCoord - 1;\r\n break;\r\n }\r\n if (checkValidMove(newX, newY)) {\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n // System.out.println(newX + \" \" + newY);\r\n moveTo(newX, newY);\r\n // System.out.println(xCoord + \" \" + yCoord);\r\n\r\n } else {\r\n turnAround();\r\n doNextMove(player);\r\n }\r\n }", "private void randomMove() {\n }", "public void move() {\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t}", "private void move() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.resetGameMessage();\n gameMessage.notify(gameMessage);\n\n\n if( liteGame.isWinner() ) endOfTheGame = true;\n }", "public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}", "void simulateMove(CheckersData cur_board, CheckersMove move, int player) {\n\n cur_board.makeMove(move);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. That means their could be another choice to make.\n */\n if (move.isJump()) {\n CheckersMove[] newMoves;\n newMoves = cur_board.getLegalJumpsFrom(player, move.toRow, move.toCol);\n if (newMoves != null) {\n simulateMove(cur_board, newMoves[0], player);\n }\n \t // we have to keep jumping until we can't! If there is more than one jump\n // we are just going to have to pick the first one. More logic could go here\n }\n return;\n }", "public void movePeice(MouseEvent e) {\r\n\r\n\t\tint[] id = gameBoard.coordinateToID(e.getX(), e.getY());\r\n\t\t\r\n\t\tSystem.out.println(\"isOppNear: \" + gameBoard.isOpponentNear(id, 1));\r\n\t\t\r\n\t\tif (gameBoard.isIdTurn(id)) {\r\n\t\t\tgameBoard.setFocusedLocation(id);\r\n\r\n\t\t\tArrayList<int[]> jumpingPos = gameBoard.getPositions(true);\r\n\t\t\tif (!jumpingPos.isEmpty()) {\r\n\r\n\t\t\t\t// check if current mouse click id has jumping move if it\r\n\t\t\t\t// doesn't show an warning\r\n\t\t\t\tif (gameBoard.getPossibleMoves(id, true).isEmpty()) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(gameView, \"Must Jump Your Opponent\", \"Must Jump!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t\t// set focus moves to only jumping moves\r\n\t\t\t\tgameBoard.setMovesOnFocus(gameBoard.getPossibleMoves(id, true));\r\n\t\t\t} else {\r\n\t\t\t\t// normal move - if there is no possible jumping move\r\n\t\t\t\tgameBoard.setMovesOnFocus(gameBoard.getPossibleMoves(id, false));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!gameBoard.getMovesOnFocus().isEmpty()) {\r\n\r\n\t\t\tfor (int[] ID : gameBoard.getMovesOnFocus()) {\r\n\r\n\t\t\t\tif (id[0] == ID[0] && id[1] == ID[1]) {\r\n\t\t\t\t\tsetProperDuration();\r\n\t\t\t\t\ttimer.setStart();\r\n\t\t\t\t\tgameBoard.movePiece(gameBoard.getFocusedLocation(), ID);\r\n\r\n\t\t\t\t\t// check if next if there are jumping moves\r\n\t\t\t\t\t// if so set the timer duration to 1 min\r\n\t\t\t\t\t// gameBoard.removeMovesOnFocus();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// TODO: add logic to restart, etc...\r\n\t\tif (gameBoard.getBlackScore() == 12) {\r\n\t\t\tpopUpWin(\"Black!\");\r\n\t\t} else if (gameBoard.getRedScore() == 12) {\r\n\t\t\tpopUpWin(\"Red!\");\r\n\t\t}\r\n\t}", "@Test\n @DisplayName(\"After one player makes one move, verify conditions for next player toggle\")\n void doesPlayerContinue() {\n Player player = playerService.getP1();\n Pit pit = boardService.getPitByID(0);\n Move move = new Move(player, pit);\n boardService.updateBoardForMove(move);\n Assert.assertTrue(boardService.doesPlayerContinue());\n\n // For the next move, if player 1 moves from pit 1, player will not continue\n pit = boardService.getPitByID(1);\n move = new Move(player, pit);\n boardService.updateBoardForMove(move);\n Assert.assertFalse(boardService.doesPlayerContinue());\n }", "@Override\n\tpublic void makeNextMove() \n\t{\n\t}", "public void advanceToEndOfNextTrick() {\n\n if (isGameOver()) {\n return;\n }\n \n if (isFirstTurn) {\n startTurn();\n isFirstTurn=false;\n }\n else {\n state=state.withTrickCollected();\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateScore(state.score());\n }\n }\n\n if (isGameOver()) {\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().setWinningTeam(findWinningTeam());\n }\n return;\n }\n\n if (!isFirstTurn && state.isTerminal()) {\n startTurn();\n }\n\n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateScore(state.score());\n pId.getValue().updateTrick(state.trick());\n }\n\n while (!(state.trick().isFull())) {\n playNextPlayer();\n }\n }", "public void nextTurn() {\n\t\tusedPocket = false;\n\t\ttookFromPot = false;\n\t\tcurrentTurn++;\n\t\tcurrentTurn = currentTurn%2;\n\t\tif(currentTurn == 0) {\n\t\t\tcurrentPlayer = player1;\n\t\t\topponentPlayer = player2;\n\t\t} else {\n\t\t\tcurrentPlayer = player2;\n\t\t\topponentPlayer = player1;\n\t\t}\n\t}", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "public void simulation(){\n GameInformation gi = this.engine.getGameInformation();\n Point ball = gi.getBallPosition();\n Player playerSelected;\n int xTemp;\n team = gi.getTeam(ball.x , ball.y);\n\n //Attack\n if(team == gi.activeActor){\n selectAttackerPlayer(gi.getPlayerTeam(gi.activeActor));\n doAttackMoove(playerOne.getPosition(), gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectProtectPlayer(gi.getPlayerTeam(gi.activeActor));\n doProtectMoove(playerTwo.getPosition(), playerOne.getPosition() ,gi.cells[(int) playerTwo.getPosition().getX()][(int) playerTwo.getPosition().getY()].playerMoves);\n playerOne = null;\n playerTwo = null;\n this.engine.next();\n }\n else{//Defense\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n TacklAction tackl = new TacklAction();\n tackl.setSource(playerOne.getPosition());\n VisualArea[] area;\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n\n tackl.setSource(playerTwo.getPosition());\n\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n playerOne = null;\n playerTwo = null;\n }\n }", "@Override\r\n public int makeMove(MainController.CellType opponentType) {\r\n MainController.CellType myType = opponentType == MainController.CellType.NOUGHT ? MainController.CellType.CROSS : MainController.CellType.NOUGHT;\r\n int res = checkWin(myType, myType);\r\n if (res != -1)\r\n return res;\r\n res = checkWin(opponentType, myType);\r\n if (res != -1)\r\n return res;\r\n return makeRandomMove(opponentType);\r\n }", "private String easyMove() {\n int randomHole = evaluate();\n while (!isValidMove(randomHole)) {\n randomHole = evaluate();\n }\n\n return super.makeAMove(randomHole);\n }", "@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}", "private void swapPlayer(){\r\n resetTurn();\r\n tries = 0;\r\n Player temp = currentPlayer;\r\n currentPlayer = nextPlayer;\r\n nextPlayer = temp;\r\n if(!gameOver()){\r\n if(currentPlayer.getClass() == Ia.class) {\r\n int[] result = currentPlayer.estimateNextMove(this.getClone());\r\n if (result[0] == 0 && result[1] == 0 && result[2] == 0 && result[3] == 0) currentPlayer.setCanMove(false);\r\n else {\r\n currentPlayer.setCanMove(true);\r\n int row = result[0];\r\n int col = result[1];\r\n int nextRow = result[2];\r\n int nextCol = result[3];\r\n makeMove(row, col, nextRow, nextCol);\r\n }\r\n swapPlayer();\r\n }\r\n }\r\n else {\r\n getWinner();\r\n if(winner == null) System.out.println(\"DRAW!\");\r\n else {\r\n System.out.println(winner.getPlayerName() + \" WIN!\");\r\n if (winner.getClass() == Ia.class)\r\n System.out.println(\"Max time used to move: \" + winner.getMaxTime() + \" seconds\");\r\n }\r\n isOver = true;\r\n }\r\n\r\n }", "public void UndoMove() {\n\t\tif ( !isNextPlayerTurnAnAIEngine() && this.historicMoves.size() > 0 && !this.playerMoveComputing)\n\t\t{\n//\t\t\tthis.updateStatusGameTextFromGameManager(\"Performing UNDO Move\", this.playerToMakeMove);\n\t\t\t// dont allow any more moves on this board while doing undo\n\t\t\tthis.playerMoveComputing = true;\n\t\t\tint undoPLayer = this.playerToMakeMove; // this human player\n\t\t\twhile ( true ) // we will break once the current player is changed or the history size is empty\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// remove the last one\n\t\t\t\tMyShapeDrawable removeMe = this.removeHistoricMoveAtElement(this.historicMoves.size()-1);\n\t\t\t\tremoveMe.alreadySelected = false;\n\t\t\t\tboolean[] completedBoxes = this.b.unSelectEdge(removeMe.myEdge.getCol(), removeMe.myEdge.getRow(), removeMe.myEdge.getEdge());\n\t\t\t\tif ( this.historicMoves.size() > 0 )\n\t\t\t\t{\n\t\t\t\t\tMyShapeDrawable myS = this.historicMoves.get(this.historicMoves.size()-1);\n\t\t\t\t\t// previous shape is made current\n\t\t\t\t\tthis.updateVisualsToCurrentSelectedEdge(myS);\n\t\t\t\t\t// need to check if we must remove a box token\n\t\t\t\t\tcheckAndRemoveBoxTokenForUndo(removeMe, completedBoxes);\n\t\t\t\t\tif ( undoPLayer == this.playerToMakeMove )\n\t\t\t\t\t{\n\t\t\t\t\t\t// player is back to his undo move, so break\n\t\t\t\t\t\tbreak;\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\t// no more historic moves to act on\n\t\t\t\t\tthis.changeToPreviousPlayer(); // change to first player\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.playerMoveComputing = false; // remove control of the board\n\t\t\t// decide if to reset the ai engines\n\t\t\tdetermineIfPlayersShouldReset();\n\t\t\t// finally make player move\n\t\t\tthis.determineNextPlayerAndMakeMove();\n\t\t\n\t\t}\n\t}", "public void move() {\r\n\t\tmoveCount++;\r\n\t}", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "public void nextTurn() {\r\n activePlayer = nextPlayer;\r\n advanceNextPlayer();\r\n }", "public void move() {\n super.move(DIRECTION.getRandom());\n }", "@Override\n\tpublic void excute() {\n\t\tmoveEvent.move(commandinfo.getValue() * 200);\n\t}", "private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}", "public void move() {\n\t\tif (isLuck) {\n\t\t\tif (rand.nextBoolean()) {\n\t\t\t\txPos++;\n\t\t\t}\n\t\t} else {\n\t\t\tif (rightCount < skill) {\n\t\t\t\trightCount++;\n\t\t\t\txPos++;\n\t\t\t}\n\t\t}\n\t}", "public abstract void generateNextMove(final ChessGameConsole console);", "@Test\n public void testSimpleMove()\n {\n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n theEngine.movePlayer(1, 0);\n assertTrue(theEngine.inPlayingState());\n }", "private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }", "void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }", "public void act() \n {\n move(5);\n turn(4);\n }", "@Override\n \t\t\t\tpublic void doMove() {\n \n \t\t\t\t}", "private static void move() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(timer);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\trunTime += timer;\r\n\t\tif (runTime > stepUp) {\r\n\t\t\ttimer *= 0.9;\r\n\t\t\tstepUp += 5000;\r\n\t\t}\r\n\r\n\t\tupdateSnake(lastMove);\r\n\t\t// updateField();\r\n\r\n\t\tif (score >= 10 && (r.nextInt(40) == 0)) {\r\n\t\t\taddFood(MOUSE);\r\n\t\t}\r\n\t\tif (score >= 30 && (r.nextInt(50) == 0)) {\r\n\t\t\taddFood(POISON);\r\n\t\t}\r\n\t}", "private Action doNextMove(Action move){\n\t\t// update east or north\n\t\tif (move == Action.East){\n\t\t\teast++;\n\t\t} else if (move == Action.West){\n\t\t\teast--;\n\t\t} else if (move == Action.North){\n\t\t\tnorth++;\n\t\t} else if (move == Action.South){\n\t\t\tnorth--;\n\t\t}\n\t\treturn move;\n\t}", "public void act(){\n\t\tTile[] possibleMoves = game.getAllNeighbours(currentPosition);\r\n\t\tTile targetTile = possibleMoves[rng.nextInt(4)];\r\n\t\tmove(targetTile);\r\n\t}", "public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }", "private void move(MoveAction moveAction) {\n Move move = moveAction.getLoad();\n Container selectedContainer = mContainersManager.getContainer(move.getBowlNumber());\n boolean anotherRound = false;\n\n if (isAValidMove(move.getPlayer(), selectedContainer)) {\n anotherRound = spreadSeedFrom(move.getBowlNumber());\n\n if (isGameEnded()) {\n Action gameEnded;\n if (!mEvenGame) {\n gameEnded = new Winner(mWinner, getRepresentation(), mContainersManager.getAtomicMoves());\n } else {\n gameEnded = new EvenGame(getRepresentation(), mContainersManager.getAtomicMoves());\n }\n\n postOnTurnContext(gameEnded);\n } else {\n postOnTurnContext(new BoardUpdated(getRepresentation(),\n anotherRound, mContainersManager.getAtomicMoves()));\n }\n\n } else if (!isGameEnded()) {\n postOnTurnContext(new InvalidMove(\n move,\n getRepresentation(),\n mActivePlayer\n ));\n }\n\n\n }", "public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}", "public void act() \n {\n moveTowardsPlayer(); \n }", "public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }", "void playerMove(State state);", "public void makeNextMove() {\n\t\ttakeNextNonTabuedCheapestStep();\n\t\t}", "@Override\n void movePhase() throws IOException, InterruptedException, IOExceptionFromController {\n boolean godPower = false;\n ArrayList<Cell> possibleMoves = findPossibleMoves(activeWorker.getPosition());\n Cell movePosition = client.chooseMovePosition(possibleMoves);\n CellView startView = new CellView(activeWorker.getPosition());\n CellView endView = new CellView(movePosition);\n CellView startView2 = null;\n CellView endView2 = null;\n // + allow pushing away opponents\n if (movePosition.hasWorker()) {\n godPower = true;\n Worker pushedWorker = movePosition.getWorker();\n Cell nextCell;\n int nextX = movePosition.getPosX() + (movePosition.getPosX() - activeWorker.getPosition().getPosX());\n int nextY = movePosition.getPosY() + (movePosition.getPosY() - activeWorker.getPosition().getPosY());\n nextCell = board.getCell(nextX, nextY);\n startView2 = endView;\n endView2 = new CellView(nextCell);\n try {\n pushedWorker.move(nextCell);\n } catch (IllegalMoveException e) {\n gameController.logError(e.getMessage());\n return;\n }\n //\n }\n try {\n activeWorker.move(movePosition);\n } catch (IllegalMoveException e) {\n gameController.logError(e.getMessage());\n }\n if (godPower) displayMove(startView, endView, startView2, endView2, card);\n else displayMove(startView, endView, null);\n }", "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 MoveTileOpponent(Integer position){\n Integer position_inverted = revertTile(position);\n String position_inverted_str = String.valueOf(position_inverted);\n\n ImageView player2 = findImageButton(\"square_\"+position_inverted_str);\n ImageView player2_old = findImageButton(\"square_\"+opponentTile.toString());\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n player2_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n\n opponentTile = position_inverted;\n myTurn = true;\n canPlaceBomb = true;\n turnNumber = turnNumber + 1;\n\n if(ShotsCaller){\n placePowerup(null);\n }\n }", "public static void nextTurn(){\n\t\tPlayerButton [][] ary = GameBoard.getPBAry();\n\t\t\n\t\tfor( int x=0; x< ary.length; x++ ){\n\t\t\tfor( int y=0; y<ary[x].length; y++ ){\n\t\t\t\tary[x][y].setMovable( false );\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurr++;\n\t\tif(curr >= players.size())\n\t\t\tcurr=0;\n\n\t\tif(players.get(curr).hasBeenKicked()){\n\t\t\tnextTurn();\n\t\t}\n\t}", "void move(int steps);", "@Override\n public void act(AgentImp agent) {\n Coordinate coordinate = agent.generateRandomMove();\n if (coordinate != null)\n agent.step(coordinate.getX(), coordinate.getY());\n else\n agent.skip();\n }", "boolean doMove();", "public void move() {\n\t\tthis.hero.setPF(1);\n\t\tthis.hero.setState(this.hero.getMoved());\n\t}", "public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}", "public void next_player() {\n\t\tthis.nb_turn++;\n\t\tthis.player_turn++;\n\t\tthis.same_dice_in_a_row = 0;\n\t\tif (player_turn == this.players.size()) {\n\t\t\tthis.player_turn = 0;\n\t\t}\n\n\t\tif (get_player_from_turn().get_surrend()) {\n\t\t\tthis.nb_turn--;\n\t\t\tif (get_player_in_game() > 0) {\n\t\t\t\tthis.next_player();\n\t\t\t}\n\t\t}\n\t}", "@Test\n void moveWithinPLAYING() {\n getGame().start();\n assertThat(getGame().isInProgress()).isTrue();\n getGame().move(getPlayer(), Direction.EAST);\n assertThat(getPlayer().isAlive()).isTrue();\n verifyZeroInteractions(observer);\n assertThat(getGame().isInProgress()).isTrue();\n }", "@Override\r\n\t// Precondition: During testing the AI is associated with the 'O', the odd number move.\r\n \tpublic Point desiredMove(TicTacToeGame theGame) {\n\t\t\r\n\t\tchar[][] board = theGame.getTicTacToeBoard();\r\n\t\tPoint dPoint;\r\n\t //check for win\r\n\t\tdPoint = winOrBlock(board,'O');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"winning\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//check for block\r\n\t\tdPoint = winOrBlock(board,'X');\r\n\t\tif(dPoint != null) {\r\n\t\t\tSystem.out.println(\"blocking\");\r\n\t\t\treturn dPoint;\r\n\t\t}\r\n\t\t//otherwise pick random loc\r\n\t\tRandom randy = new Random(); \r\n\t int randX = randy.nextInt(3);\r\n\t int randY = randy.nextInt(3);\r\n\t while(!theGame.available(randX, randY)) {\r\n\t \trandX = randy.nextInt(3);\r\n\t \trandY = randy.nextInt(3);\r\n\t }\r\n\t System.out.println(\"random\");\r\n\t return new Point(randX, randY);\r\n\t}", "public void move() {\n\t\tif ( board.getLevel() == 5 )\n\t\t\tmovementIndex = ( movementIndex + 1 ) % movement.length;\n\t}", "public void move() {\r\n\t\tif(torretas.size() == 0){\r\n\t\t\tagregarExplosiones();\r\n\t\t}\r\n\t\tif(System.currentTimeMillis() - init > delay && !control[0])\r\n\t\t\tif(puedeMoverse()){\r\n\t\t\t\tif(random){\r\n\t\t\t\t\tint select = -1;\r\n\t\t\t\t\tboolean move = false;\r\n\t\t\t\t\twhile(!move){\r\n\t\t\t\t\t\tselect = rn.nextInt(4);\r\n\t\t\t\t\t\tif(select == 0 || select == 3){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 2 && hayTorretas(x + defaultWidth/2 + 190, x+defaultWidth)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 1 && hayTorretas(x, x+defaultWidth/2 - 190)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\r\n\t\t\t\t\tint auxX = x;\r\n\t\t\t\t\tint auxY = y;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(select == 0){\r\n\t\t\t\t\t\tmoves[0] = moves[1] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = -defaultHeight;\r\n\t\t\t\t\t\tvelocidad = 4;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 1){\r\n\t\t\t\t\t\tmoves[2] = moves[3] = true;\r\n\t\t\t\t\t\tx = 800;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 2){\r\n\t\t\t\t\t\tmoves[4] = moves[5] = true;\r\n\t\t\t\t\t\tx = - defaultWidth;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 3){\r\n\t\t\t\t\t\tmoves[6] = moves[7] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = 800;\r\n\t\t\t\t\t\tvelocidad = 5;\r\n\t\t\t\t\t\treproductor.addSound(alarm, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactualizarTorretas(x-auxX, y-auxY);\r\n\t\t\t\t\t\r\n\t\t\t\t\trandom = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de arriba a abajo\r\n\t\t\t\tif(!moves[2] && !moves[3] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[0] && y + defaultHeight < 500){\r\n\t\t\t\t\ty +=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0, +velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[0] = false;\r\n\t\t\t\t\tif(y + defaultHeight > -100 && moves[1]){\r\n\t\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0, -velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmoves[1] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de derecha a izquierda\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[2] && x > 250){\t\r\n\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[2] = false;\r\n\t\t\t\t\tif(x < 900 && moves[3]){\r\n\t\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[3] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de izquierda a derecha\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[4] && x + defaultWidth < 550){\r\n\t\t\t\t\t\r\n\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[4] = false;\r\n\t\t\t\t\tif(x + defaultWidth > -100 && moves[5]){\r\n\t\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[5] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de abajo a arriba\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[4] && !moves[5])\r\n\t\t\t\tif(moves[6] && y > 250){\r\n\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0,-velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[6] = false;\r\n\t\t\t\t\tif(y < 700 && moves[7]){\r\n\t\t\t\t\t\ty+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0,velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[7] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tsetMove();\r\n\t}", "public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }", "public void autoMove() {\n selectAndMove(computerPlayer.selectToken(this));\n }", "private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}", "public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }", "private void move()\r\n {\r\n int num = Game.random(4);\r\n String direction;\r\n if (num == 0)\r\n direction = \"north\";\r\n else if (num == 1)\r\n direction = \"east\";\r\n else if (num == 2)\r\n direction = \"south\";\r\n else //num == 3\r\n direction = \"west\";\r\n Room nextRoom = room.nextRoom(direction);\r\n if (nextRoom != null)\r\n {\r\n changeRoom(nextRoom);\r\n \r\n //Monster or Robot greets everyone was already in the room\r\n ArrayList<Person> peopleList = new ArrayList<Person>();\r\n \r\n peopleList = nextRoom.getPeople();\r\n peopleList.remove(name);\r\n \r\n String greetings =\"Hey \";\r\n for (int i=0; i<peopleList.size(); i++)\r\n \tgreetings += peopleList.get(i).getName() + \", \";\r\n\r\n if (!(peopleList.size()==0))\r\n \tsay(greetings);\r\n } \r\n \r\n }", "public void AskForMove();", "public boolean playNextStep(Move otherMove) {\n if (isGameFinished()) {\n return false;\n }\n // If we are in move creation state, we add move and move to next player.\n if (isCreateMoveState) {\n if(addMove(otherMove)){\n nextPlayer();\n isCreateMoveState = false;\n return true;\n }\n else{\n return false;\n }\n\n\n } else {\n // If we are in KopyMove state, we compare moves and increment to next move or player.\n boolean succeeded = compareMove(otherMove);\n if (!succeeded) {\n // If we kill the current player, the index will fix automatically.\n killCurrentPlayer();\n } else {\n nextMove();\n }\n return succeeded;\n }\n }", "public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}", "private void wander(){\n\t\tmonster.moveRandom();\r\n\t\tsaveMove();\r\n\t}", "public void MoveTileSelf(Integer position){\n /**\n * if opponent activated confusion - move to a random tile\n */\n if(confused){\n //random tile for confusion\n Integer tile;\n do{\n Integer tile1 = returnRandom(getNthDigit(position,1)-1,getNthDigit(position,1)+2);\n Integer tile2 = returnRandom(getNthDigit(position,2)-1,getNthDigit(position,2)+2); // between 0 and 2\n tile = Integer.parseInt(tile1.toString() + tile2.toString());\n }while (tile==myTile || tile==opponentTile || getNthDigit(tile,1)<1 || getNthDigit(tile,1)>7 || getNthDigit(tile,2)<1 || getNthDigit(tile,2)>7);\n position = tile;\n showTimedAlertDialog(\"You are confused!\", \"moving at a random direction\", 5);\n confused = false;\n }\n\n /**\n * send message to opponent\n */\n MultiplayerManager.getInstance().SendMessage(position.toString());\n\n if(!is_debug){\n HandleLejos(myTile, position);\n }\n\n ImageView player1 = findImageButton(\"square_\"+position.toString());\n ImageView player1_old = findImageButton(\"square_\"+myTile.toString());\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player1_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n myTile = position;\n myTurn = false;\n turnNumber = turnNumber + 1;\n }", "public void advanceGame() {\n\t\tthis.status = Status.Active;\n\t\tthis.currentSuggestion = null;\n\t\tfor(User u : this.players) {\n\t\t\tu.availableActions.remove(ACTION.Wait);\n\t\t\tu.availableActions.remove(ACTION.Disprove);\n\t\t}\n\t\t\n\t\t// Next player can always move\n\t\tUser nextPlayer = null;\n\t\tdo {\n\t\t\tnextPlayer = getFollowingPlayer(this, this.getCurrentPlayer());\n\t\t\tif (nextPlayer.isActive) {\n\t\t\t\tnextPlayer.availableActions.add(ACTION.Move);\n\t\t\t\tif (this.board.getLocation(nextPlayer.character).isRoom) {\n\t\t\t\t\tnextPlayer.availableActions.add(ACTION.Accuse);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentMove++;\n\t\t} while (!nextPlayer.isActive);\n\t\t\n\t\tif (activeUserCount(this) == 1) {\n\t\t\t// Last player remaining is the winner (by default)\n\t\t\tthis.status = Status.Complete;\n\t\t\tmessages.add(String.format(\"[ %s ] has won the game (by default)!\", nextPlayer.name));\n\t\t}\n\t}", "public TurnState step() {\n ReadOnlyHistory history = board.viewHistory();\n \n if (!isGameOver) {\n Player next = nextPlayer();\n Move move = null;\n \n try {\n final long startTime = System.currentTimeMillis();\n move = next.play(history);\n next.addTime(System.currentTimeMillis() - startTime);\n \n if (next.getTime() >= timeLimit || !board.isValid(move)){\n isGameOver = true;\n }\n else {\n board.set(move);\n }\n }\n catch (IllegalArgumentException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n catch (ArrayIndexOutOfBoundsException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n \n return new TurnState(next, move, isGameOver);\n }\n else {\n return new TurnState(null, null, true);\n }\n }", "public void undoClick(){\n //For Two Player Games\n if (activity.getPlayerVsPlayer()) {\n undoAction();\n } else {\n //One Player games vs the computer\n computerIsMoving = true;\n for(int i=0;i<2;i++) {\n undoAction();\n }\n computerIsMoving = false;\n }\n }", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "private void moveRandomly()\r\n {\r\n if (Greenfoot.getRandomNumber (100) == 50)\r\n turn(Greenfoot.getRandomNumber(360));\r\n else\r\n move(speed);\r\n }", "@Override\n\tpublic void move() {\n\t\ttry {\n\t\t\tTimeUnit.SECONDS.sleep(new Random().nextInt(5));\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"Tank moving...\");\n\t}", "public void act() \n {\n move(3);\n turnAtEdge(); \n StrikeSeaHorse();\n }", "public void playerFinishedGoNext() {\n\t\t// If game is over we don't want to switch turn.\n\t\tif (!isOver()) {\n\t\t\tswitchTurn();\n\t\t}\n\t}", "public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}", "private void computerMove() {\r\n int move = 0;\r\n int tempMove = 0;\r\n String loseHistoricalMoves = \"\";\r\n \r\n loseHistoricalMoves = getLoseHistoricalMoves(); //Get all the next moves leading to existing loses\r\n\r\n Random rand = new Random();\r\n tempMove = rand.nextInt(MAX_MOVE_NUMBER - moveRecord.length() - loseHistoricalMoves.length()) + 1;\r\n\r\n move = 0;\r\n for(int ii=0; ii<tempMove; ii++) {\r\n move++;\r\n while ( (moveRecord.indexOf(String.valueOf(move)) >= 0) || //skip existing moves\r\n\t (loseHistoricalMoves.indexOf(String.valueOf(move)) >= 0) ) { //skip lose moves \r\n if (loseHistoricalMoves.indexOf(String.valueOf(move)) >= 0) { \r\n\t System.out.println(\"Skip a historical lose move: \" + move);\r\n\t}\r\n\tmove++;\r\n }\r\n }\r\n\r\n System.out.println(\"Computer move: \" + String.valueOf((move - ((move - 1) % 3)) / 3 + 1) + \",\" +\r\n\t\t String.valueOf((move - 1) % 3 + 1));\r\n moveRecord = moveRecord + String.valueOf(move); \r\n }", "public void act() {\n\t\tif (canMove2()) {\n\t\t\tsteps += 2;\n\t\t\tmove();\n\t\t} else {\n\t\t\tturn();\n\t\t\tsteps = 0;\n\t\t}\n\t}", "public void chasePlayer() {\n refreshObstructionMatrix();\n Coordinate currPosition = new Coordinate(getX(), getY());\n Player player = this.dungeon.getPlayer();\n Coordinate playerPosition = new Coordinate(player.getX(), player.getY());\n\n if (currPosition.equals(playerPosition)) {\n // Debug.printC(\"Enemy has reached the player!\", Debug.RED);\n player.useItem(this);\n } else {\n this.pathToDest = pathFinder.getPathToDest(currPosition, playerPosition);\n if (!this.pathToDest.empty()) {\n Coordinate nextPosition = this.pathToDest.pop();\n // this.setCoordinate(nextPosition);\n if (getX() + 1 == nextPosition.x) {\n moveRight();\n } else if (getX() - 1 == nextPosition.x) {\n moveLeft();\n } else if (getY() + 1 == nextPosition.y) {\n moveDown();\n } else if (getY() - 1 == nextPosition.y) {\n moveUp();\n }\n }\n }\n }", "public abstract void randomMoves();", "boolean makeMove(int index, Player player);", "public void move(){\n\t\t\n\t}", "public void movePlayer(String direction) {\n if(playerAlive(curPlayerRow, curPlayerCol)){\n if(direction.equals(\"u\")&&(curPlayerRow-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow-1), curPlayerCol);\n curPlayerRow -= 1;\n }else if(direction.equals(\"d\")&&(curPlayerRow+1)<=7){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow+1), curPlayerCol);\n curPlayerRow += 1;\n }else if(direction.equals(\"l\")&&(curPlayerCol-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol-1));\n curPlayerCol -= 1;\n }else if(direction.equals(\"r\")&&(curPlayerCol+1)<=9){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol+1));\n curPlayerCol += 1;\n }\n }\n if(playerFoundTreasure(curPlayerRow, curPlayerCol)){\n playerWins();\n }\n adjustPlayerLifeLevel(curPlayerRow, curPlayerCol);\n int[] array = calcNewTrollCoordinates(curPlayerRow, curPlayerCol, curTrollRow, curTrollCol);\n if(curPlayerRow == curTrollRow && curPlayerCol == curTrollCol){\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n }else{\n int newTrollRow = array[0];\n int newTrollCol = array[1];\n overwritePosition(curTrollRow, curTrollCol, newTrollRow, newTrollCol);\n curTrollRow = newTrollRow;\n curTrollCol = newTrollCol;\n }\n }", "private void handleMovement() {\n if (movements.isEmpty()) return;\n try {\n switch (movements.peek()) {\n case MOVE_UP:\n game.movePlayer(Direction.N);\n break;\n case MOVE_LEFT:\n game.movePlayer(Direction.W);\n break;\n case MOVE_DOWN:\n game.movePlayer(Direction.S);\n break;\n case MOVE_RIGHT:\n game.movePlayer(Direction.E);\n break;\n }\n } catch (Exception ignored) { }\n }", "public void nextTurn() {\r\n\r\n\t\t// System.out.println(\"nextTurn================================================================================================\" + this.DiceNumber);\r\n\t\tif (gameState == GameState.Playing) {\r\n\t\t\tif (!isPlayerCall && currentTurnPlayer != null && !currentTurnPlayer.getPlayerDetail().getIsRobot()) {\r\n\t\t\t\tif (currentTurnPlayer.PlayerTimeOutCall()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentTurnPlayer.addNoOperateTime();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// current turn count add one.\r\n\t\t\tturnIndex++;\r\n\t\t\tisPlayerCall = false;\r\n\t\t\tcurrentTurnPlayer = findNextLiving();\r\n\t\t\tsendGameNextTurn(currentTurnPlayer, this);\r\n\r\n\t\t\t// if current player is robot,add robot logical action.\r\n\t\t\tif (currentTurnPlayer.getPlayerDetail().getIsRobot()\r\n\t\t\t\t\t|| currentTurnPlayer.getPlayerDetail().getIsRobotState()) {\r\n\t\t\t\tThreadSafeRandom random = new ThreadSafeRandom();\r\n\t\t\t\tAddAction(new RobotProcessAction(random.next(1, 6) * 1000, currentTurnPlayer));// 机器人随机一个叫的时间\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// if the player has trusteed the game,add trustee action to deal\r\n\t\t\t// with the condition.\r\n\t\t\t// if (currentTurnPlayer.getPlayerState() == PlayerState.Trustee)\r\n\t\t\t// {\r\n\t\t\t// AddAction(new TrusteePlayerAction(random.next(3, 6) * 1000,\r\n\t\t\t// currentTurnPlayer));\r\n\t\t\t// return;\r\n\t\t\t// }\r\n\r\n\t\t\t// this turn wait for 20 seconds.\r\n\t\t\tWaitTime(1000 * 20);// csf0423 以前是12 + 8\r\n\t\t\tonBeginNewTurn();\r\n\t\t}\r\n\t}", "public void Move(){\n for(int i = 0; i < moveList.length; i++){\n playerString = \"\";\n switch(moveList[i]) {\n case 1: {\n //TODO: Visited points to others\n System.out.println(\"Moving up!\");\n //Logic for fitness score might need to be moved\n if(!(game.mazeArray[game.playerPosition.getPlayerY() -1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() - 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 10;\n }\n game.moveUp();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 2: {\n System.out.println(\"Moving left!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() -1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() -1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveLeft();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 3: {\n System.out.println(\"Moving right!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() +1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() +1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveRight();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 4: {\n System.out.println(\"Moving down!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY() +1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n freedomPoints += 1;\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveDown();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n default: {\n System.out.println(\"End of line\");\n break;\n //You shouldn't be here mate.\n }\n }\n }\n\n }", "@Override\r\n\tpublic void turnToward(int x, int y) {\n\t}", "private void easyMove(Board board) {\n\t\t\r\n\t}", "public void nextTurn() {\r\n ArrayList<Bomb> copy_bombs = new ArrayList<>(this.bombs);\r\n for (Bomb b : copy_bombs) {\r\n if(b.getDelay() == 1){\r\n this.explode = true;\r\n }\r\n b.tick();\r\n b.explode(this);\r\n }\r\n this.ordering = new LinkedList<>();\r\n this.fillPlayerQueue();\r\n if (this.random_order) {\r\n Collections.shuffle((List)this.ordering);\r\n }\r\n\r\n this.turn_number++;\r\n }", "public void move() {\n\t\tdouble xv = 0;\r\n\t\tdouble yv = 0;\r\n\t\t//this method allows the entity to hold both up and down (or left and right) and not move. gives for smooth direction change and movement\r\n\t\tif (moveRight) {\r\n\t\t\txv+=getSpeed();\r\n\t\t\torientation = Orientation.EAST;\r\n\t\t}\r\n\t\tif (moveLeft) {\r\n\t\t\txv-=getSpeed();\r\n\t\t\torientation = Orientation.WEST;\r\n\t\t}\r\n\t\tif (moveUp)\r\n\t\t\tyv-=getSpeed();\r\n\t\tif (moveDown)\r\n\t\t\tyv+=getSpeed();\r\n\t\tif (!doubleEquals(xv,0) || !doubleEquals(yv,0)) {\r\n\t\t\t((Player)this).useMana(0.1);\r\n\t\t\tImageIcon img = new ImageIcon(\"lib/assets/images/fireball.png\");\r\n\t\t\tBufferedImage image = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);\r\n\t\t\tGraphics g = image.getGraphics();\r\n\t\t\tg.drawImage(img.getImage(), 0, 0, image.getWidth(), image.getHeight(), null);\r\n\t\t\tColor n = loop[ind%loop.length];\r\n\t\t\tind++;\r\n\t\t\timage = ImageProcessor.scaleToColor(image, n);\r\n\t\t\t//PopMessage.addPopMessage(new PopMessage(image,getX(),getY()));\r\n\t\t}\r\n\t\telse\r\n\t\t\t((Player)this).useMana(-0.1);\r\n\t\tmove(xv,yv);\r\n\t}", "public void move(){\n System.out.println(\"I can't move...\");\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e)\n\t\t{\n\t\t\tgame.makeMove(activePlayer, null);\n\t\t}", "private void moveGame() {\r\n\t\tmoveFireball1();\r\n\t\tmoveFireball2();\r\n\t\tmoveMehran();\r\n\t\tmoveLaser();\r\n\t\tmoveBullet();\r\n\t\tcheckPlayerCollisions();\r\n\t\tcheckForBulletCollisions();\r\n\t\tpause(DELAY);\r\n\t\tcount++;\r\n\t}", "public void move()\n {\n if (!alive) {\n return;\n }\n\n if (speedTimer > 0) {\n speedTimer --;\n } else if (speedTimer == 0 && speed != DEFAULT_SPEED) {\n speed = DEFAULT_SPEED;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n Location next = null;\n\n // For the speed, iterate x blocks between last and next\n\n if (direction == UPKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() - speed * getPixelSize()));\n } else if (direction == DOWNKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() + speed * getPixelSize()));\n } else if (direction == LEFTKEY)\n {\n next = getLocation((int)(last.getX() - speed * getPixelSize()), last.getY());\n } else if (direction == RIGHTKEY)\n {\n next = getLocation((int)(last.getX() + speed * getPixelSize()), last.getY());\n }\n\n ArrayList<Location> line = getLine(last, next);\n\n if (line.size() == 0) {\n gameOver();\n return;\n }\n\n for (Location loc : line) {\n if (checkCrash (loc)) {\n gameOver();\n return;\n } else {\n // Former bug: For some reason when a player eats a powerup a hole appears in the line where the powerup was.\n Location l2 = getLocation(loc.getX(), loc.getY());\n l2.setType(LocationType.PLAYER);\n l2.setColor(this.col);\n\n playerLocations.add(l2);\n getGridCache().add(l2);\n }\n }\n }", "public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}", "private void decideMakeAutomaicMove(){\n\t\t\r\n\t\tif (playerMode != PlayerMode.manual){\r\n\t\t\tif (playerMode == PlayerMode.random) makeRandomMove();\r\n\t\t\telse makeSmartMove();\r\n\t\t}\r\n\t}", "public abstract boolean changeMove();", "private void unintelligentDecideMove() {\n\t\twander();\r\n\t}", "@Test\n void win() {\n getGame().start();\n assertThat(getGame().isInProgress()).isTrue();\n getGame().move(getPlayer(), Direction.EAST);\n getGame().move(getPlayer(), Direction.EAST);\n verify(observer).levelWon();\n assertThat(getGame().isInProgress()).isFalse();\n }", "public void turn(Player player,String move) {\n String[] art = move.split(\" \");\n int x=Integer.parseInt(art[1]);\n int y=Integer.parseInt(art[2]);\n board.mark(player.getMark(),x-1,y-1);\n board.checkFinishCondition();\n if(board.isFinished()){\n finished = true;\n winner = order;\n }\n int aux = (order + 1) % 2;\n order = aux;\n }" ]
[ "0.72444093", "0.69486845", "0.68528336", "0.6807463", "0.67833704", "0.67623013", "0.675368", "0.67365247", "0.6716127", "0.66811544", "0.66588855", "0.6652327", "0.6642835", "0.6606997", "0.6545203", "0.65395486", "0.6528426", "0.65232897", "0.6521093", "0.64949095", "0.6490035", "0.64698625", "0.64662176", "0.6453947", "0.6452972", "0.6443299", "0.64404345", "0.6430821", "0.64269274", "0.641209", "0.64112955", "0.6400496", "0.6398789", "0.63953245", "0.639459", "0.63819665", "0.6378715", "0.63772184", "0.6353748", "0.6350736", "0.63500017", "0.6348578", "0.63448477", "0.634079", "0.6329083", "0.6323219", "0.63086927", "0.6307426", "0.6300731", "0.6281327", "0.6279501", "0.6275565", "0.62723917", "0.62710214", "0.62706727", "0.6267354", "0.6262352", "0.6261504", "0.62509495", "0.62485325", "0.62459385", "0.6245641", "0.6224773", "0.6222071", "0.6221243", "0.6208756", "0.6207599", "0.6205221", "0.6202728", "0.6198822", "0.6198742", "0.61816406", "0.6177672", "0.61762726", "0.6171899", "0.61715883", "0.6170922", "0.61684066", "0.61675036", "0.61481076", "0.6145184", "0.614325", "0.613666", "0.6130962", "0.61304826", "0.61268747", "0.6126004", "0.6125619", "0.6120388", "0.6114059", "0.61138767", "0.6110168", "0.61087966", "0.6106456", "0.6106308", "0.6104787", "0.6098641", "0.6095432", "0.60906154", "0.6087771", "0.6086489" ]
0.0
-1
Asks for first prediction (when TableActivity onCreate()), beginning with host
public void askFirstPredictions(){ //Ask host if(initialPredictionCount == 0){ Log.d("WizardApp", "Ask host: " + GameConfig.getInstance().getPlayers()[0] + " for stiches."); askForStiches(GameConfig.getInstance().getPlayers()[initialPredictionCount]); initialPredictionCount++; currentPlayer++; } //Ask clients else if(initialPredictionCount > 0 && initialPredictionCount < players.size()){ Log.d("WizardApp", "Ask player: " + initialPredictionCount + " for stiches."); askForStiches(GameConfig.getInstance().getPlayers()[initialPredictionCount]); initialPredictionCount++; currentPlayer++; } //All players asked, go to next state else{ Log.d("WizardApp", "Initial predictions are done now."); gameActivity.setInitialPrediction(false); status = RoundStatus.waitingForCard; currentPlayer=0; checkNextStep(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onCheckAppFirstStart() {\n HwAPPStateInfo curAppInfo = getCurStreamAppInfo();\n if (curAppInfo != null && 100501 == curAppInfo.mScenceId && true == curAppInfo.mIsAppFirstStart && !curAppInfo.mIsVideoStart) {\n boolean isPoorNetwork = false;\n int curRxPackets = this.mHwHiStreamQoeMonitor.getCurTcpRxPackets(curAppInfo.mAppUID);\n if (!(-1 == this.mStartTcpRxPackets || -1 == curRxPackets || curRxPackets - this.mStartTcpRxPackets >= 300)) {\n isPoorNetwork = true;\n }\n HwHiStreamUtils.logD(\"onCheckAppFirstStart: isPoorNetwork = \" + isPoorNetwork);\n if (isPoorNetwork) {\n IHwAPPQoECallback brainCallback = getArbitrationCallback();\n if (brainCallback != null) {\n brainCallback.onAPPQualityCallBack(curAppInfo, 107);\n }\n this.mHwHiStreamCHRManager.onStallDetect(curAppInfo.mScenceId, 107, this.mQoeCallback);\n }\n }\n }", "private Map.Entry<Activity, Prediction> chooseBestPrediction(Map<Activity, Prediction> predictions) {\n \n Map.Entry<Activity, Prediction> prediction = null;\n int result1, result2, lastIndex;\n double probability1, probability2;\n \n \n for (Map.Entry<Activity, Prediction> entry : predictions.entrySet()) {\n \n if (prediction == null) {\n prediction = entry;\n } else {\n lastIndex = prediction.getValue().getObservations().length - 1;\n \n result1 = prediction.getValue().getPredictions()[lastIndex];\n probability1 = prediction.getValue().getProbability();\n result2 = entry.getValue().getPredictions()[lastIndex];\n probability2 = entry.getValue().getProbability();\n \n /*a result 1 means that an activity has been detected,\n * thus we prefer a result that predicts an activity*/\n if (result2 == 1 && result1 == 0)\n prediction = entry;\n \n /* if both predict an activity, or don't predict anything then\n * we take the probability into consideration */\n if (result1 == result2) {\n if (probability2 > probability1)\n prediction = entry;\n }\n \n }\n \n }\n \n return prediction;\n \n }", "public void prediction() {\n\t\txPriorEstimate = xPreviousEstimate;\n\t\tpPriorCovarianceError = pPreviousCovarianceError;\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\r\n\t\tqueryData();\r\n\t}", "protected void onFirstTimeLaunched() {\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n public void StartInitial() {\n model.StartInitial();\n\n // Add any code required\n\n }", "@Override\r\n\tprotected void doFirst() {\n\t\t\r\n\t}", "public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_result);\n handleIntent(getIntent(), this.table_name);\n }", "public void startHourlyActivity() {\n if (getForecast() != null && getForecast().getHourlyForecastList() != null) {\n Intent intent = new Intent(this, HourlyForecastActivity.class);\n intent.putParcelableArrayListExtra(MainActivity.HOURLY_FORECAST_PARCEL, (ArrayList<? extends Parcelable>) getForecast().getHourlyForecastList());\n startActivity(intent);\n }\n }", "private void checkFirstLaunch(){\n SharedPreferencesEditor editor = new SharedPreferencesEditor(this);\n boolean test = editor.GetBoolean(\"firstLaunch\");\n if(test){\n loadData();\n return;\n }\n startActivity(new Intent(MainActivity.this, FirstLaunch.class));\n editor.WriteBoolean(\"firstLaunch\", true);\n }", "private void onTrainActionSelected() {\n\t\tArrayList<Myo> connectedDevices = Hub.getInstance()\n\t\t\t\t.getConnectedDevices();\n\t\tif (connectedDevices.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the Myo to train. In this case, we will train the first Myo in\n\t\t// the Hub's\n\t\t// connected devices list.\n\t\tMyo myo = connectedDevices.get(0);\n\n\t\t// Launch the TrainActivity for the specified Myo.\n\t\tIntent intent = new Intent(this, TrainActivity.class);\n\t\tintent.putExtra(TrainActivity.EXTRA_ADDRESS, myo.getMacAddress());\n\t\tstartActivity(intent);\n\t}", "private void waitForFirstPageToBeLoaded() {\n IdlingResource idlingResource = new ElapsedTimeIdlingResource(LATENCY_IN_MS + 1000);\n IdlingRegistry.getInstance().register(idlingResource);\n\n //Check that first item has been loaded\n onView(withItemText(\"POPULAR MOVIE #1 (1999)\")).check(matches(isDisplayed()));\n\n //Clean up\n IdlingRegistry.getInstance().unregister(idlingResource);\n }", "private boolean isFirstTime() {\n SharedPreferences preferences = getActivity().getPreferences(MODE_PRIVATE);\n boolean ranBefore = preferences.getBoolean(\"RanBefore\", false);\n if (!ranBefore) {\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.putBoolean(\"RanBefore\", true);\n editor.apply();\n mBind.topLayout.setVisibility(View.VISIBLE);\n mBind.topLayout.setOnTouchListener(new View.OnTouchListener() {\n\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n mBind.topLayout.setVisibility(View.INVISIBLE);\n return false;\n }\n\n });\n }\n return ranBefore;\n\n }", "private void onFullyLoaded() {\n info(\"onFullyLoaded()\");\n cancelProgress();\n\n //Fully loaded, start detection.\n ZiapApplication.getInstance().startDetection();\n\n Intent intent = new Intent(LoadingActivity.this, MainActivity.class);\n if (getIntent().getStringExtra(\"testname\") != null)\n intent.putExtra(\"testname\", getIntent().getStringExtra(\"testname\"));\n startActivity(intent);\n finish();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_details);\n\n Intent intent = getIntent();\n Uri data = intent.getData();\n String key = intent.getStringExtra(SearchManager.EXTRA_DATA_KEY);\n if (data != null && key != null) {\n\n if (data.toString().equals(\"homeview://plex/playback\")) {\n\n Intent next = new Intent(this, PlaybackActivity.class);\n next.setAction(PlaybackActivity.ACTION_VIEW);\n next.putExtra(PlaybackActivity.KEY, key);\n PlexVideoItem vid = intent.getParcelableExtra(PlaybackActivity.VIDEO);\n if (vid != null)\n next.putExtra(PlaybackActivity.VIDEO, vid);\n startActivity(next);\n }\n }\n }", "private void loadInitialProducts(){\n final Intent intent = new Intent(this, MainActivity.class);\n\n ProductServiceProvider.getInstance().setServiceListener(new ProductServiceProvider.ServiceListener() {\n @Override\n public void onResultsSuccess(Response<SearchResult> response) {\n if(response.body().getResults() != null){\n AppDataModel.getAppDataModel().setInitialData(response.body().getResults());\n intent.putExtra(EXTRA_INITIAL_PRODUCTS, true);\n }\n\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n startActivity(intent);\n finish();\n }\n }, 1000);\n }\n\n @Override\n public void onProductsSuccess(Response<Products> response) {\n\n }\n\n @Override\n public void onFailure(String message) {\n intent.putExtra(EXTRA_INITIAL_PRODUCTS, false);\n new Handler().postDelayed(new Runnable() {\n\n @Override\n public void run() {\n startActivity(intent);\n finish();\n }\n }, 1000);\n }\n });\n\n ProductServiceProvider.getInstance().searchProducts(\"\");\n }", "public abstract BindPredictor getBindPredictor();", "private void goOnQuery() {\n int end;\n for (end = mQueryTimes; end < SPEED_DIAL_MAX + 1 && TextUtils.isEmpty(mPrefNumState[end]); ++end) {\n // empty loop body\n }\n populateMatrixCursorEmpty(this, mMatrixCursor, mQueryTimes - 1, end - 1);\n Log.i(TAG, \"goOnQuery(), mQueryTimes = \" + mQueryTimes + \", end = \" + end);\n if (end > SPEED_DIAL_MAX) {\n Log.i(TAG, \"goOnQuery(), queryComplete in goOnQuery()\");\n mIsQueryContact = false;\n dismissProgressIndication();\n updatePreferences();\n showToastIfNecessary();\n mAdapter.changeCursor(mMatrixCursor);\n resumeDialog(); \n } else {\n mQueryTimes = end;\n Log.i(TAG, \"goOnQuery(), startQuery at mQueryTimes = \" + mQueryTimes);\n Log.i(TAG, \"goOnQuery(), number = \" + mPrefNumState[mQueryTimes]);\n Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri\n .encode(mPrefNumState[mQueryTimes]));\n Log.i(TAG, \"goOnQuery(), uri = \" + uri);\n mQueryHandler.startQuery(QUERY_TOKEN, null, uri, QUERY_PROJECTION, null, null, null);\n // Cursor testCursor = getContentResolver().query(uri,\n // QUERY_PROJECTION, null, null, null);\n }\n }", "protected void onResume() {\n buildFitnessClient();\n }", "@Override\n public boolean onCreate() {\n AUTHORITY = getContext().getPackageName() + \".provider.sensory_wristband\"; //make sure xxx matches the first string in this class\n\n sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);\n\n sUriMatcher.addURI(AUTHORITY, DATABASE_TABLES[0], TABLE_HEART_RATE_DIR);\n sUriMatcher.addURI(AUTHORITY, DATABASE_TABLES[0] + \"/#\", TABLE_HEART_RATE_ITEM);\n sUriMatcher.addURI(AUTHORITY, DATABASE_TABLES[1], TABLE_STEPS_DIR);\n sUriMatcher.addURI(AUTHORITY, DATABASE_TABLES[1] + \"/#\", TABLE_STEPS_ITEM);\n\n tableHeartRateHashMap = new HashMap<>();\n tableHeartRateHashMap.put(TableHeartRate_Data._ID, TableHeartRate_Data._ID);\n tableHeartRateHashMap.put(TableHeartRate_Data.TIMESTAMP, TableHeartRate_Data.TIMESTAMP);\n tableHeartRateHashMap.put(TableHeartRate_Data.DEVICE_ID, TableHeartRate_Data.DEVICE_ID);\n tableHeartRateHashMap.put(TableHeartRate_Data.HEART_RATE, TableHeartRate_Data.HEART_RATE);\n\n tableStepsHashMap = new HashMap<>();\n tableStepsHashMap.put(TableSteps_Data._ID, TableSteps_Data._ID);\n tableStepsHashMap.put(TableSteps_Data.TIMESTAMP, TableSteps_Data.TIMESTAMP);\n tableStepsHashMap.put(TableSteps_Data.DEVICE_ID, TableSteps_Data.DEVICE_ID);\n tableStepsHashMap.put(TableSteps_Data.STEPS, TableSteps_Data.STEPS);\n tableStepsHashMap.put(TableSteps_Data.DISTANCE, TableSteps_Data.DISTANCE);\n tableStepsHashMap.put(TableSteps_Data.CALORIES, TableSteps_Data.CALORIES);\n\n return true;\n }", "public void setFirstLaunchCalled() {\n this.f51 = true;\n }", "@Override\n protected void onResume() {\n super.onResume();\n Log.d(TAG, \"onResume begin\");\n mITel = ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));\n if (!mHasGotPref)\n getPrefStatus();\n mHasGotPref = false;\n// mAddPosition = -1;\n// mPhotoLoader.clear();\n// mPhotoLoader.resume();\n startQuery();\n Log.d(TAG, \"onResume end\");\n }", "@Override\n protected void onResume() {\n super.onResume();\n if (connection.isOnline(this)) new LoadMeetsAsync().execute();\n fab_toolbar.hide();\n }", "public void doStartComputerGame(View view) {\n mainHelper.playAgainstComputer();\n setContentView(R.layout.activity_table);\n mainHelper.start();\n }", "public boolean isFirstLaunchCalled() {\n return this.f51;\n }", "public void startAutocompletePrefetch() {\n if (!mNativeInitialized) return;\n mAutocompleteCoordinator.prefetchZeroSuggestResults();\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 }", "@Override\n public void run() {\n if(counter+1<trainingObjectList.size()) {\n setupForGame();\n }\n else{//bitir activity. main activitiye dönülebilir belki.\n dbHandler.setTrainingCompletedAll(trainingID);\n if (!CheckNetwork.isOnline(MatchingGame.this)) {\n Log.d(TAG, \"MatchingGame no db no wifi, checknetworktrue\");\n CheckNetwork.showNoConnectionDialog(MatchingGame.this, false, 2); //display dialog\n } else {\n new CreateTrainingResponse(MatchingGame.this, false, username).execute(trainingID);\n Intent intent = new Intent(MatchingGame.this, MainActivity.class);\n intent.putExtra(\"username\", username);\n //startActivity(intent);\n //finish();\n }\n }\n }", "@Override\n public void run() {\n if(counter+1<trainingObjectList.size()) {\n setupForGame();\n }\n else{//bitir activity. main activitiye dönülebilir belki.\n dbHandler.setTrainingCompletedAll(trainingID);\n if (!CheckNetwork.isOnline(MatchingGame.this)) {\n Log.d(TAG, \"MatchingGame no db no wifi, checknetworktrue\");\n CheckNetwork.showNoConnectionDialog(MatchingGame.this, false, 2); //display dialog\n } else {\n new CreateTrainingResponse(MatchingGame.this, false, username).execute(trainingID);\n Intent intent = new Intent(MatchingGame.this, MainActivity.class);\n intent.putExtra(\"username\", username);\n //startActivity(intent);\n //finish();\n }\n }\n }", "protected abstract void onQueryStart();", "@Override\r\n\tpublic void initData() {\n\t\tThreadUtils.getSinglePool().execute(new Runnable() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tIntent intent =null;\r\n\t\t\t\t\tChainApplication application = (ChainApplication) getApplicationContext();\r\n\t\t\t\t\tUser user = application.getUserInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(StringUtils.isEmpty(user.getUser_Name()) && StringUtils.isEmpty(HttpManager.getInstance().getToken(HttpManager.KEY_TOKEN))){\r\n\t\t\t\t\t\tintent = new Intent(getActivity(),LoginActivity.class);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tintent = new Intent(getActivity(), MainActivity.class);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\n protected void onPreExecute() {\n if (this.mListener != null) {\n this.mListener.onPreCapsulePing();\n }\n }", "public void onStartLoading() {\n Cursor cursor = this.mCursor;\n if (cursor != null) {\n deliverResult(cursor);\n }\n if (takeContentChanged() || this.mCursor == null) {\n forceLoad();\n }\n }", "public void startTrainingMode() {\n\t\t\r\n\t}", "public void LaunchTorpedo() {\r\n if(this.CurrentTorpedoCount > 0) {\r\n System.out.println(this.ModelNumber + \" is firing off a torpedo!\");\r\n this.CurrentTorpedoCount -= 1;\r\n } else {\r\n System.out.println(\"Torpedoes Expended\");\r\n }\r\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_team);\n team = getIntent().getStringExtra(\"Team#\"); //Sets the global team number string to the extra given in the intent\n makeTable(); //Create the table that gives information about the team selected\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.tabpredictions);\n\t\t//Set up AdMob\n\t\t/*adView = new AdView(this, AdSize.BANNER, \"a14f51446c622f1\");\n\t\tLinearLayout layoutTop = (LinearLayout) findViewById(R.id.AdMobPredictions);\n\t\tlayoutTop.addView(adView);\n\t\tadView.loadAd(new AdRequest());*/\n\n\t\t// If I want to open the Screen outside of the TabHoast use -->\n\t\t// startActivity(new Intent(this, SrnPredictions.class));\n\t\tTextView textDistance = (TextView) findViewById(R.id.txtDistancePredictions);\n\t\tTextView textTime = (TextView) findViewById(R.id.txtTimePredictions);\n\t\tTextView textAvgSplit = (TextView) findViewById(R.id.txtAvgSplitPredictions);\n\n\t\tIntent intentGetParentCalcs = getParent().getIntent();\n\t\tString strDistance = intentGetParentCalcs.getStringExtra(\"strDistance\");\n\t\tString strTime = intentGetParentCalcs.getStringExtra(\"strTime\");\n\t\tString strAvgSplit = intentGetParentCalcs.getStringExtra(\"strAvgSplit\");\n\t\tboolean booCalculateAccurate = intentGetParentCalcs.getBooleanExtra(\"booCalculateAccurate\", true);\n\t\t\n\t\ttextDistance.setText(strDistance);\n\t\ttextTime.setText(strTime);\n\t\ttextAvgSplit.setText(strAvgSplit);\n\n\t\tint intPredictionsCount = 50;\n\t\tint intPredictionsDistance = 0;\n\t\tdouble mSplit = 500;\n\t\tdouble dblScrCalculateDistance = Double.parseDouble(strDistance);\n\t\tStringToMilliseconds CalculatedMillisecondsTime = new StringToMilliseconds(strAvgSplit);\n\t\tdouble dblScrCalculateAvgSplit = CalculatedMillisecondsTime.getMillisecs(strAvgSplit);\n\t\tdouble dblPredictionsAvgSplit;\n\t\tdouble dblPredictionsTime;\n\t\tString strPredictionsAvgSplit;\n\t\tString strPredictionsTime;\n\t\t// Check to see if Data is usable\n\t\tif (booCalculateAccurate == false) {\n\t\t\treturn;\n\t\t}\n\t\t// Set up the List\n\t\tListView list = (ListView) findViewById(R.id.PREDICTIONS);\n\t\tArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();\n\t\t\n\t\tfor (int i = 0; i < intPredictionsCount; i++) {\n\t\t\tHashMap<String, String>\n\t\t\tmap = new HashMap<String, String>();\n\n\t\t\t//Calculate Distance\n\t\t\tintPredictionsDistance = intPredictionsDistance + 500;\n\n\t\t\t//Calculate AvgSplit\n\t\t\tdblPredictionsAvgSplit = (logx(intPredictionsDistance/dblScrCalculateDistance,2)*5)/(60*60*24)+(dblScrCalculateAvgSplit);\n\t\t\tdblPredictionsAvgSplit = toRound(dblPredictionsAvgSplit);\n\t\t\tMillisecondsToString ConvertedAvgSplit = new MillisecondsToString(dblPredictionsAvgSplit);\n\t\t\tstrPredictionsAvgSplit = ConvertedAvgSplit.getConvertedString();\n\t\t\t\n\t\t\t//Calculate Time\n\t\t\tdblPredictionsTime = (intPredictionsDistance/mSplit)*dblPredictionsAvgSplit;\n\t\t\tdblPredictionsTime = toRound(dblPredictionsTime);\n\t\t\tMillisecondsToString ConvertedTime = new MillisecondsToString(dblPredictionsTime);\n\t\t\tstrPredictionsTime = ConvertedTime.getConvertedString();\n\n\t\t\t//Populate List\n\t\t\tmap.put(\"Distance\", Integer.toString(intPredictionsDistance) + \" m\");\n\t\t\tmap.put(\"Time\", strPredictionsTime);\n\t\t\tmap.put(\"AvgSplit\", strPredictionsAvgSplit);\n\t\t\tmylist.add(map);\n\t\t}\n\n\t\tSimpleAdapter loadPredictions = new SimpleAdapter(this, mylist,\n\t\t\t\tR.layout.mylistpredictions, new String[] { \"Distance\", \"Time\", \"AvgSplit\" }, new int[] {\n\t\t\t\t\t\tR.id.PredictionsDistance, R.id.PredictionsTime, R.id.PredictionsAvgSplit });\n\t\tlist.setAdapter(loadPredictions);\n\t}", "private void requestFirstHug() {\n new ImageDownloader(this) {\n @Override\n protected void onPostExecute(String filePath) {\n super.onPostExecute(filePath);\n Hug hug = new Hug(\n getString(R.string.first_hug_message),\n filePath,\n System.currentTimeMillis());\n HugDatabaseHelper.insertHug(MainActivity.this, hug);\n }\n }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, KramConstant.GOOGLE_SEARCH_URL);\n }", "public PredictorListener buildPredictor();", "public void finishNativeInitialization() {\n if (IntentHandler.getExtraHeadersFromIntent(mIntent) != null) {\n mConnection.cancelSpeculation(mSession);\n }\n\n TabModelOrchestrator tabModelOrchestrator = mTabFactory.getTabModelOrchestrator();\n TabModelSelectorBase tabModelSelector = tabModelOrchestrator.getTabModelSelector();\n\n TabModel tabModel = tabModelSelector.getModel(mIntentDataProvider.isIncognito());\n tabModel.addObserver(mTabObserverRegistrar);\n\n finalizeCreatingTab(tabModelOrchestrator, tabModel);\n Tab tab = mTabProvider.getTab();\n assert tab != null;\n assert mTabProvider.getInitialTabCreationMode() != TabCreationMode.NONE;\n\n // Put Sync in the correct state by calling tab state initialized. crbug.com/581811.\n tabModelSelector.markTabStateInitialized();\n\n // Notify ServiceTabLauncher if this is an asynchronous tab launch.\n if (mIntent.hasExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA)) {\n ServiceTabLauncher.onWebContentsForRequestAvailable(\n mIntent.getIntExtra(ServiceTabLauncher.LAUNCH_REQUEST_ID_EXTRA, 0),\n tab.getWebContents());\n }\n\n updateEngagementSignalsHandler();\n }", "@Override\n public void onPreInflationStartup() {\n mActivity.supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);\n\n if (mSavedInstanceStateSupplier.get() == null && mConnection.hasWarmUpBeenFinished()) {\n mTabModelInitializer.initializeTabModels();\n\n // Hidden tabs shouldn't be used in incognito, since they are always created with\n // regular profile.\n if (mIntentDataProvider.isIncognito()) {\n mTabProvider.setInitialTab(createTab(), TabCreationMode.EARLY);\n return;\n }\n\n Tab tab = getHiddenTab();\n if (tab == null) {\n tab = createTab();\n mTabProvider.setInitialTab(tab, TabCreationMode.EARLY);\n } else {\n mTabProvider.setInitialTab(tab, TabCreationMode.HIDDEN);\n }\n }\n }", "@BeforeClass\n private void launchActivity() {\n ActivityScenario<HomeActivity> activityScenario = ActivityScenario.launch(HomeActivity.class);\n activityScenario.onActivity(new ActivityScenario.ActivityAction<HomeActivity>() {\n @Override\n public void perform(HomeActivity activity) {\n mIdlingResource = activity.getIdlingResourceInTest();\n IdlingRegistry.getInstance().register(mIdlingResource);\n }\n });\n }", "public interface FirstRunActivityObserver {\n /** See {@link #createPostNativeAndPoliciesPageSequence}. */\n void onCreatePostNativeAndPoliciesPageSequence(FirstRunActivity caller);\n\n /** See {@link #acceptTermsOfService}. */\n void onAcceptTermsOfService(FirstRunActivity caller);\n\n /** See {@link #setCurrentItemForPager}. */\n void onJumpToPage(FirstRunActivity caller, int position);\n\n /** Called when First Run is completed. */\n void onUpdateCachedEngineName(FirstRunActivity caller);\n\n /** See {@link #abortFirstRunExperience}. */\n void onAbortFirstRunExperience(FirstRunActivity caller);\n\n /** See {@link #exitFirstRun()}. */\n void onExitFirstRun(FirstRunActivity caller);\n }", "@Override\n protected void onResume() {\n // Log.d(TAG, \"onResume: starts...\");\n super.onResume();\n GetDotaJSONData getDotaJSONData = new GetDotaJSONData(this, \"https://api.opendota.com/api/heroStats\", \"en-us\", true);\n getDotaJSONData.execute(\"\");\n }", "public void onPreExecute() {\n\n // super.onPreExecute();\n\n trdialog = new TableRow(DialogActivity.this);\n\n if (Build.MODEL.contains(\"SM-N\")) {\n\n\n lp = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n lp.setMargins(18, 2, 95, 2);\n trdialog.setLayoutParams(lp);\n\n } else {\n lp = new TableRow.LayoutParams(200, TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n\n trdialog.setLayoutParams(lp);\n lp.setMargins(0, 5, 70, 0);\n }\n System.out.println(\"trdialog async:\" + trdialog);\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\texecutor.execute(new Task(ReadingDataModel.Event.INIT_LOAD));\n\t\tinitBookNote();\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t}", "@Override\n public void onResume() {\n view.get().onDataUpdated(state);\n view.get().activateButton();\n\n }", "protected void onPreExecute() {\n\t\t}", "private void firstNetworkCall() {\n startIndex = 0;\n getBlockListNetworkCall(getActivity(), startIndex, maxItems);\n }", "public void requestLeaderboard() {\r\n connection.requestLeaderboard();\r\n }", "@Override\n protected void lazyLoad() {\n if (!isPrepared || !isVisible) {\n return;\n }\n initResumeInfo();\n }", "@Override\n protected void onResume() {\n super.onResume();\n if (moviesList.size() == 0){\n if (NetworkUtils.hasNetworkAcces(this)){\n fetchMovieData(\"popular\");\n } else {\n Toast.makeText(context,\"Internet connection failed, please try again\",Toast.LENGTH_SHORT).show();\n }\n }\n }", "public void beforeFirst() throws SQLException {\n/* 251 */ notSupported();\n/* */ }", "public void enterSiteAsFirstTimeVisitor(){\n if(!browser.browserDriver().browser().isDesktop()) {\n enterSiteWithCleanBrowser();\n if (browser.browserDriver().browser().isTablet() && ((AppiumDriver) browser.driver()).getOrientation() == ScreenOrientation.PORTRAIT) {\n ((AppiumDriver) browser.driver()).rotate(ScreenOrientation.LANDSCAPE);\n }\n } else {\n navigateToHome();\n }\n }", "public abstract void onFirstUserVisible();", "public void setFirstResult(java.lang.Integer firstResult)\r\n {\r\n this.firstResult = firstResult;\r\n }", "@Override\n\tprotected void setupData() {\n\t\tisFirst = getIntent().getExtras().getBoolean(\"IS_FIRST\");\n\t\tcid = getIntent().getExtras().getString(FirstCategoryAct.class.getName());\n\t\tString title;\n\t\tif(isFirst){\n\t\t\ttitle = getIntent().getExtras().getString(\"TITLE_BAR\") + getResources().getString(R.string.tv_article_all);\n\t\t}else{\n\t\t\ttitle = getResources().getString(R.string.tv_article_all2);\n\t\t}\n\t\t\n\t\tsetGCenter(true, title);\n\t\tsetGLeft(true, R.drawable.back_selector);\n\n\t\tgetData(NET_ARTICLE, false);\n\t}", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\n\tsuper.onCreate(savedInstanceState);\r\n\tsetContentView(R.layout.activity_classify);\r\n\tinit();\r\n }", "@Override\n public void onResume() {\n if (!isFirstRun && universalPlayer.isPrepaired && universalPlayer.getPlayingMediaItem() != null &&\n !universalPlayer.isCurrentMediaItem(playableMediaItem)) {\n playableMediaItem = universalPlayer.getPlayingMediaItem();\n }\n isFirstRun = false;\n initPlayerUI();\n configurePlayer();\n setPlayerCallbacks();\n runPositionUpdater();\n super.onResume();\n }", "public void onResume() {\n super.onResume();\n MiStatInterface.recordPageStart((Activity) this, \"SetMyOtherInfoActivity\");\n }", "@Override\n protected void onPostResume() {\n super.onPostResume();\n }", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t\tConstants.homepage = false;\n\t\t\n\t\tif(Constants.IndustryID.equals(\"Filter\"))\n\t\t{\n\t\t\tnetCheck = UserFunctions.isConnectionAvailable(getActivity());\n\t\t\tif (netCheck == true) {\n\t\t\t\tConstants.flag = \"filter\";\n\t\t\t\t\n\t\t\t\tgetFilterizedData();\n\t\t\t\ttxtHeading.setText(\"Filter\");\n\t\t\t} else {\n\t\t\t\tUserFunctions.dialogboxshow(\"Message\", \"Internet Connection not available.\", getActivity());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onPreExecute() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.yyrg_computation_result);\n\t\tViewUtils.inject(this);\n\t\typpid = getIntent().getStringExtra(\"yppid\");\n\t\ttime = getIntent().getStringExtra(\"time\");\n\t\trenshu = getIntent().getStringExtra(\"renshu\");\n\t\tyungouma=getIntent().getStringExtra(\"yungou\");\n\t\thuojiang=getIntent().getStringExtra(\"huojiang\");\n\t\tif (TextUtils.isEmpty(yppid)) {\n\n\t\t} else {\n\t\t\tgetTopHundredRecord();\n\t\t}\n\t}", "@Override\n\t\t\tprotected void onPreExecute()\n\t\t\t{\n\n\t\t\t}", "@Override\n public void onInitialDPRequest(InitialDPRequest arg0) {\n\n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t}", "private void launchHomeScreen(){\n\n prefManager.setFirstTimeLaunch(false);\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n }", "@Override\n\tprotected void onResume() {\n\t\t\n\t\tinit();\n\t\tsuper.onResume();\n\n\t}", "@Override\n public void onResume() {\n super.onResume();\n model.setActivityID(0);\n }", "@Override\r\n\tprotected void onResume() {\n\t\t\r\n\t}", "protected void onFirstUse() {}", "protected void preRun() {\r\n\t\tthis.preparePairs();\r\n\t}", "@Override\n\t protected void onPreExecute() {\n\t }", "@Override\n public void onTabStateInitialized() {\n SharedPreferences.Editor editor = getSharedPreferences().edit();\n editor.clear();\n TabModelFilter filter =\n mTabModelSelector.getTabModelFilterProvider().getTabModelFilter(false);\n for (int i = 0; i < filter.getCount(); i++) {\n Tab tab = filter.getTabAt(i);\n int id = tab.getId();\n editor.putString(getUrlKey(id), tab.getUrl().serialize());\n editor.putString(getTitleKey(id), tab.getTitle());\n CriticalPersistedTabData tabData = CriticalPersistedTabData.from(tab);\n editor.putInt(getRootIdKey(id), tabData.getRootId());\n editor.putLong(getTimestampMillisKey(id), tabData.getTimestampMillis());\n }\n editor.apply();\n Tab currentTab = mTabModelSelector.getCurrentTab();\n if (currentTab != null) cacheLastSearchTerm(currentTab);\n filter.addObserver(mTabModelObserver);\n }", "public void TrainDataset(){\n\t\ttry{\n\t\t\t//Testing delegate method\n\t\t\tMessageController.logToConsole(\"Hey, I'm from train button\");\n\t\t\t\n\t\t\t//Pass in the real training dataset\n\t\t\tfindSuitableK(new String[]{\"Hello\", \"World\"});\n\t\t\t\n\t\t\t//Pass in the 'k' and 'query string'\n\t\t\tfindKNN(2, \"anything\");\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tthrow ex;\n\t\t}\n\t\tfinally{\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tifneedUpdate();\n\t}", "void gettingBackToInitial(){\n robot.setDrivetrainPosition(-hittingMineralDistance, \"translation\", 1.0);\n }", "@Override\n protected void onResume() {\n super.onResume();\n init();\n decideScreen();\n }", "private static int getStartID(HashMap<Integer, ActivityPrediction> model) {\n int startID = 0;\n for (ActivityPrediction predictionNode : model.values()) {\n if (predictionNode.isStart()) {\n startID = predictionNode.getActivityID();\n }\n }\n return startID;\n }", "private WebElement chooseFirstRow() {\n return getRowsFromTable().get(0);\n\n }", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "void pretrain(DataSetIterator iterator);", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tquerytonlistdata();\n\t}", "@Override\n public void run() {\n Intent i;\n //Tutorial at first launch\n boolean tutorial = !prefs_Read.contains(Constants.PREFS_APP_LAST_VERSION);\n try{\n\n if (getString(R.string.app_version_name).compareTo(prefs_Read.getString(Constants.PREFS_APP_LAST_VERSION, \"\")) > 0) {\n //Do update things\n\n String[] vero2 = prefs_Read.getString(Constants.PREFS_APP_LAST_VERSION, \"\").split(\"\\\\.\");\n String[] vern2 = getString(R.string.app_version_name).split(\"\\\\.\");\n\n tutorial = vero2.length == 0 || !(vero2[0].equals(vern2[0]) && vero2[1].equals(vern2[1]));//check first two numbers of version\n }\n }catch(ClassCastException ignore){}\n if (tutorial) {\n i = new Intent(SplashActivity.this, TutorialActivity.class);\n } else {\n i = new Intent(SplashActivity.this, MainActivity.class);\n }\n\n startActivity(i);\n overridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n finish();\n\n }", "@Override\n protected void onResume() {\n super.onResume();\n loadData();\n }", "@Override\n protected void onResume() {\n super.onResume();\n loadData();\n }", "public int askPrimary();", "@Test public void testClickWithSomeTablets() throws Exception {\n int first=toUnsignedInt(myInetAddress.getAddress()[3]);\n // maybe make first 101?\n int n=32;\n Group group=new Group(first,first+n-1,true);\n p(group.toString());\n ArrayList<Main> mains=new ArrayList<>();\n for(int i=0;i<n;i++) {\n int myService=group.serviceBase+first+i;\n Main main=new Main(defaultProperties,group,Model.mark1.clone(),myService);\n mains.add(main);\n Tablet tablet=main.instance();\n main.myInetAddress=myInetAddress;\n tablet.startListening();\n }\n Main m1=mains.get(0);\n m1.instance().click(1);\n Thread.sleep(100);\n for(Main main:mains)\n p(\"model: \"+main.model);\n for(Main main:mains)\n assertTrue(main.model.state(1));\n for(Main main:mains) {\n Tablet tablet=main.instance();\n tablet.stopListening();\n }\n }", "@Override\r\n\tprotected void onPreExecute() {\n\t}", "@Override\n protected void onPreExecute() {\n\n }", "@Override\n protected void onPreExecute() {\n\n }", "@Override\n protected void onPreExecute() {\n\n }", "@Override\n protected void onPreExecute() {\n\n }", "@Override\n protected void onFirstUserVisible() {\n }", "@Override\n\tprotected void initData() {\n\t\tisSearch = (boolean) getIntent().getExtras().getBoolean(Constant.IntentKey.isSearch,false);\n\t\t\n\t\tif (isSearch) {//非来自直播列表\n\t\t\tarticleID = getIntent().getExtras().getLong(Constant.IntentKey.articleID);\n//\t\t\tprogressActivity.showLoading();\n\t\t\t\n\t\t\t// 查询发现详情\n\t\t\tobtainDetailRequest();\n\t\t} else {\n\t\t\tsquareLiveModel = (SquareLiveModel) getIntent().getExtras().getSerializable(Constant.IntentKey.squareLiveModel);\n\t\t\t\n\t\t\tinitLoadView();\n\t\t}\n\t\t\n\t\t//启动定时器\n//\t\tinitTimerTask();\n\t}", "public void testFirstLoginToListActivityAndBack() {\n testFirstStartApp.testCorrectLogin();\n }", "@Override\n\n protected Integer doInBackground(Integer... params) {\n Bitmap resized_image = ImageUtils.processBitmap(bitmap, 224);\n\n //Normalize the pixels\n floatValues = ImageUtils.normalizeBitmap(resized_image, 224, 127.5f, 1.0f);\n\n //Pass input into the tensorflow\n tf.feed(INPUT_NAME, floatValues, 1, 224, 224, 3);\n\n //compute predictions\n tf.run(new String[]{OUTPUT_NAME});\n\n //copy the output into the PREDICTIONS array\n tf.fetch(OUTPUT_NAME, PREDICTIONS);\n\n //Obtained highest prediction\n Object[] results = argmax(PREDICTIONS);\n\n\n int class_index = (Integer) results[0];\n float confidence = (Float) results[1];\n\n\n try {\n\n final String conf = String.valueOf(confidence * 100).substring(0, 5);\n\n //Convert predicted class index into actual label name\n final String label = ImageUtils.getLabel(getAssets().open(\"labels.json\"), class_index);\n\n\n //Display result on UI\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n progressBar.dismiss();\n resultView.setText(label + \" : \" + conf + \"%\");\n\n }\n });\n\n } catch (Exception e) {\n\n\n }\n\n\n return 0;\n }", "protected boolean _isFirstTime() {\n return _firstTime;\n }" ]
[ "0.5177604", "0.51623905", "0.50219816", "0.5008939", "0.4965616", "0.49378827", "0.49325043", "0.49284303", "0.4921058", "0.4919999", "0.4893178", "0.4835416", "0.48331547", "0.4805067", "0.4796698", "0.4784834", "0.47548953", "0.47255972", "0.470143", "0.4696323", "0.46944526", "0.46896386", "0.46684864", "0.4663756", "0.4658796", "0.46536896", "0.4652668", "0.46448433", "0.46397802", "0.4638829", "0.46359742", "0.46355164", "0.46280745", "0.46279582", "0.46201456", "0.4611666", "0.46104383", "0.4600585", "0.4594967", "0.4590625", "0.4585861", "0.457397", "0.45681235", "0.4564773", "0.45622918", "0.45590666", "0.45589665", "0.4551979", "0.4551556", "0.45463473", "0.45432156", "0.45406246", "0.45389163", "0.45371717", "0.45365086", "0.45344672", "0.45343307", "0.4531517", "0.45302013", "0.4529713", "0.45292628", "0.4524865", "0.45235658", "0.4522747", "0.45214373", "0.45207027", "0.45179567", "0.45171157", "0.45170215", "0.45114112", "0.4511142", "0.45080933", "0.45080316", "0.45074552", "0.4505191", "0.45002514", "0.44996652", "0.44941807", "0.4492485", "0.449117", "0.44852304", "0.4484932", "0.4483763", "0.44792533", "0.44751477", "0.44741008", "0.44738793", "0.44738793", "0.4472617", "0.44680652", "0.4462466", "0.44616565", "0.44616565", "0.44616565", "0.44616565", "0.44579247", "0.44576594", "0.44575566", "0.44565344", "0.44502237" ]
0.6497374
0
/ Entfernt gespielte Karte von der Hand des Spielers
public void removeCard(Player player, AbstractCard card) { //throws exception for (Hand hand : hands) if (hand.getHandOwner().equals(player)) hand.removeCard(card); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HandKarten(){\n this.listKartenInhand = new ArrayList<Karte>();\n }", "public List<Karte> getHandKarte(){\n return listKartenInhand;\n }", "public QwirkleSpiel()\n {\n beutel=new Beutel(3); //erzeuge Beutel mit 3 Steinfamilien\n spielfeld=new List<Stein>();\n\n rote=new ArrayList<Stein>(); //Unterlisten, die zum leichteren Durchsuchen des Spielfelds angelegt werden\n blaue=new ArrayList<Stein>();\n gruene=new ArrayList<Stein>();\n gelbe=new ArrayList<Stein>();\n violette=new ArrayList<Stein>();\n orangene=new ArrayList<Stein>();\n kreise=new ArrayList<Stein>();\n kleeblaetter=new ArrayList<Stein>();\n quadrate=new ArrayList<Stein>();\n karos=new ArrayList<Stein>();\n kreuze=new ArrayList<Stein>();\n sterne=new ArrayList<Stein>();\n\n erstelleListenMap();\n }", "public Feld erzeugeFeld() {\n\t\tArrayList<Schiff> schiffe = new ArrayList<Schiff>();\n\t\t\n\t\t// 1 Schlachtschiff = 5\n\t\tschiffe.add(new Schiff(5));\n\t\t// 2 Kreuzer = 4\n\t\tschiffe.add(new Schiff(4));\n\t\tschiffe.add(new Schiff(4));\n\t\t// 3 Zerstoerer = 3\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\t// 4 Uboote = 2\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\t\n\t\tFeld neuesFeld = new Feld(getSpiel().getFeldGroesse());\n\t\t\n\t\tfor(int s = 0; s<schiffe.size(); s++) {\n\t\t\tSchiff schiff = schiffe.get(s);\n\t\t\t// Jeweils maximal 2*n^2 Versuche das Schiff zu positionieren\n\t\t\tfor(int i = 0; i < getSpiel().getFeldGroesse() * getSpiel().getFeldGroesse() * 2; i++) {\n\t\t\t\t// Zufallsorientierung\n\t\t\t\tOrientierung orientierung = Orientierung.HORIZONTAL;\n\t\t\t\tif(Math.random() * 2 > 1) {\n\t\t\t\t\torientierung = Orientierung.VERTIKAL;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Zufallskoordinate\n\t\t\t\tKoordinate koordinate = new Koordinate(\n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)), \n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)));\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tneuesFeld.setzeSchiff(schiff, koordinate, orientierung);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch(Exception e) { }\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(neuesFeld.getSchiffe().size() != 10) throw new RuntimeException(\"Schiffe konnten nicht gesetzt werden!\");\n\t\t\t\n\t\treturn neuesFeld;\n\t}", "public void sendeSpielfeld();", "public Spielflaeche getSpielflaeche() {return spielflaeche;}", "public SpielfeldZeile()\n\t{\n\t _spalte0 = 0;\n\t _spalte1 = 0;\n\t _spalte2 = 0;\n\t}", "public Spiel()\n {\n \tspieler = new Spieler();\n \t//landkarte = new Landkarte(5);\n //landkarte.raeumeAnlegen(spieler);\n\n \tlandkarte = levelGen.generate(spieler, 5, 6, 4, 10);\n\n parser = new Parser();\n }", "public Endbildschirm(Spiel s) {\r\n\t\tdasSpiel = s;\r\n\r\n\t}", "public void teken(){\n removeAll();\n \n //eerste tekening\n if(tekenEerste != false){\n tekenMuur();\n tekenSleutel();\n veld[9][9] = 6;\n tekenEerste = false;\n tekenBarricade();\n }\n \n //methode die de speler de waarde van de sleutel geeft aanroepen\n sleutelWaarde();\n \n //de methode van het spel einde aanroepen\n einde();\n \n //vernieuwd veld aanroepen\n veld = speler.nieuwVeld(veld);\n \n //het veld tekenen\n for(int i = 0; i < coordinaten.length; i++) {\n for(int j = 0; j < coordinaten[1].length; j++){\n switch (veld[i][j]) {\n case 1: //de sleutels\n if(i == sleutel100.getY() && j == sleutel100.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel1002.getY() && j == sleutel1002.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel200.getY() && j == sleutel200.getX()){\n coordinaten[i][j] = new SleutelVakje(200);\n }\n else if (i == sleutel300.getY() && j == sleutel300.getX()){\n coordinaten[i][j] = new SleutelVakje(300);\n } break;\n case 2: //de muren\n coordinaten[i][j] = new MuurVakje();\n break;\n // de barricades\n case 3:\n coordinaten[i][j] = new BarricadeVakje(100);\n break;\n case 4:\n coordinaten[i][j] = new BarricadeVakje(200);\n break;\n case 5:\n coordinaten[i][j] = new BarricadeVakje(300);\n break;\n case 6: // het eindveld vakje\n coordinaten[i][j] = new EindveldVakje();\n break;\n default: // het normale vakje\n coordinaten[i][j] = new CoordinaatVakje();\n break;\n }\n //de speler\n coordinaten[speler.getY()][speler.getX()] = new SpelerVakje();\n \n //het veld aan de JPanel toevoegen\n add(coordinaten[i][j]);\n }\n }\n System.out.println(\"Speler waarde = \" + speler.getSleutelWaarde());\n revalidate();\n repaint();\n }", "public Farbe letztesKamel();", "public Kupcek() {\r\n kup = new ArrayList<Karta>();\r\n\r\n for (int i = 0; i < 4; i++) { //gremo preko vseh simbolo kart\r\n for (int j = 0; j < 13; j++) { //in njihovih rangov\r\n if (j == 0) { //prvi indeks je vedno as torej mu damo vrednost 11\r\n Karta card = new Karta(i, j, 11); //ustvarimo nasega asa z i-tim simbolom in j-tim rangom\r\n kup.add(card); //karto dodamo v kupcek\r\n }\r\n else if (j >= 10) { //podobno storimo za karte Fant, Kraljica, Kralj in jim dodamo vrednost 10\r\n Karta card = new Karta(i, j, 10);\r\n kup.add(card);\r\n }\r\n else { //za vse preostale karte povecamo vrednost za +1 indeksa zaradi poteka kart 2[1] 3[2] etc.\r\n Karta card = new Karta(i, j, j+1);\r\n kup.add(card);\r\n }\r\n }\r\n }\r\n }", "public void wuerfeln() {\n if (istGefängnis) {\n setIstGefängnis(false);\n if (aktuellesFeldName instanceof GefängnisFeld && !(aktuellesFeldName instanceof NurZuBesuchFeld)) {\n GefängnisFeld g = (GefängnisFeld) aktuellesFeldName;\n g.gefaengnisAktion(this);\n \n return;\n }\n\n } else {\n String[] worte = {\"Eins\", \"Zwei\", \"Drei\", \"Vier\", \"Fünf\", \"Sechs\", \"Sieben\", \"Acht\", \"Neun\", \"Zehn\", \"Elf\", \"Zwölf\"};\n\n wuerfelZahl = getRandomInteger(12, 1);\n\n this.aktuellesFeld = this.aktuellesFeld + wuerfelZahl + 1;\n if (this.aktuellesFeld >= 40) {\n setAktuellesFeld(0);\n\n }\n\n System.out.println(worte[wuerfelZahl] + \" gewürfelt\");\n\n aktuellesFeldName = spielfigurSetzen(this.aktuellesFeld);\n System.out.println(\"Du befindest dich auf Feld-Nr: \" + (this.aktuellesFeld));\n boolean check = false;\n for (Spielfelder s : felderInBesitz) {\n if (aktuellesFeldName.equals(s)) {\n check = true;\n }\n }\n\n if (!check) {\n aktuellesFeldName.spielfeldAktion(this, aktuellesFeldName);\n } else {\n System.out.println(\"Das Feld: \" + aktuellesFeldName.getFeldname() + \"(Nr: \" + aktuellesFeldName.getFeldnummer() + \")gehört dir!\");\n if (aktuellesFeldName instanceof Straße) {\n Straße strasse = (Straße) aktuellesFeldName;\n System.out.println(\"Farbe: \" + strasse.getFarbe());\n try {\n strasse.hausBauen(this, strasse);\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }\n }\n }", "public Speler schuifGangkaartIn(int positie, int richting)\n {\n positie = positie - 1;\n Gangkaart oudeKaart;\n switch (richting)\n {\n case 1:\n for (int rij = 0; rij < gangkaarten.length; rij++)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 2:\n for (int rij = gangkaarten.length - 1; rij >= 0; rij--)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 3:\n for (int kolom = 0; kolom < gangkaarten.length; kolom++)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 4:\n for (int kolom = gangkaarten.length - 1; kolom >= 0; kolom--)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n }\n Speler speler = null;\n if (vrijeGangkaart.getSpeler() != null)\n {\n int[] pos = {-1,-1};\n speler = vrijeGangkaart.getSpeler();\n vrijeGangkaart.setSpeler(null);\n switch(richting)\n {\n case 1: pos[0] = positie;\n pos[1] = 0;\n speler.setPositie(pos);\n gangkaarten[positie][0].setSpeler(speler);\n break;\n case 2: pos[0] = positie;\n pos[1] = 6;\n speler.setPositie(pos);\n gangkaarten[positie][6].setSpeler(speler);\n break;\n case 3: pos[0] = 0;\n pos[1] = positie;\n gangkaarten[0][positie].setSpeler(speler);\n break;\n case 4: pos[0] = 6;\n pos[1] = positie;\n speler.setPositie(pos);\n gangkaarten[6][positie].setSpeler(speler);\n break;\n }\n }\n return speler;\n\n }", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "public void StampaPotenziali()\r\n {\r\n System.out.println(\"----\"+this.nome+\"----\\n\"); \r\n \r\n if(!Potenziale.isEmpty())\r\n {\r\n Set<Entry<Integer,ArrayList<Carta>>> Es = Potenziale.entrySet();\r\n \r\n for(Entry<Integer,ArrayList<Carta>> E : Es)\r\n {\r\n System.out.println(\" -OPZIONE \"+E.getKey()+\"\");\r\n\r\n for(Carta c : E.getValue())\r\n {\r\n System.out.println(\" [ \"+c.GetName()+\" ]\");\r\n }\r\n \r\n System.out.println(\"\\n\");\r\n }\r\n }\r\n else\r\n {\r\n System.out.println(\"-NESSUNA CARTA O COMBINAZIONE DI CARTE ASSOCIATA-\\n\");\r\n }\r\n }", "public void macheZugRueckgaengig(int spalte, int zeile, String spieler){\n\t\t\n\t\tif(spielfeld[spalte][zeile].equals(spieler)){\n\t\t\tspielfeld[spalte][zeile] = \"_\";\n\t\t}\n\t\t\t\n\t}", "public void showHand(){\n System.out.println(this.hand.toString());\n }", "public Hand() {\r\n\t\t\r\n\t}", "public void maakNieuweDoolhof()\n {\n /*hzs: hoek zonder schat\n hms: hoek met schat\n r: recht stuk\n t: T-kruispunt met schat*/\n //vaste aantallen vakjes\n int hzs = 10, hms = 6, r = 11, t = 6;\n List<String> schatten = sch.getSchatten();\n List<String> tSchatten = schatten.subList(12, 18);\n Collections.shuffle(tSchatten);\n List<String> hSchatten = schatten.subList(18, 24);\n Collections.shuffle(hSchatten);\n\n int hKaartTeller = 0, tKaartTeller = 0;\n\n //losse vakken random invullen\n //oneven rijen\n for (int h = 0; h <= 6; h += 2)\n {\n for (int i = 1; i <= 5; i += 2)\n {\n int kaart = (int) (1 + (Math.random() * 4));\n switch (kaart)\n {\n case 1:\n if (hzs > 0)\n {\n this.gangkaarten[h][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, false);\n hzs--;\n } else\n {\n i--;\n }\n break;\n case 2:\n if (hms > 0)\n {\n this.gangkaarten[h][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, hSchatten.get(hKaartTeller), false);\n hms--;\n hKaartTeller++;\n } else\n {\n i--;\n }\n break;\n case 3:\n if (r > 0)\n {\n this.gangkaarten[h][i] = new RechtKaart((int) Math.floor(Math.random() * 4) + 1, false);\n r--;\n } else\n {\n i--;\n }\n break;\n case 4:\n if (t > 0)\n {\n this.gangkaarten[h][i] = new TKaart((int) Math.floor(Math.random() * 4) + 1, tSchatten.get(tKaartTeller), false);\n t--;\n tKaartTeller++;\n } else\n {\n i--;\n }\n break;\n\n }\n }\n }\n\n //even rijen\n for (int j = 1; j <= 5; j += 2)\n {\n for (int i = 0; i <= 6; i++)\n {\n int kaart = (int) (1 + (Math.random() * 4));\n switch (kaart)\n {\n case 1:\n if (hzs > 0)\n {\n this.gangkaarten[j][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, false);\n hzs--;\n } else\n {\n i--;\n }\n break;\n case 2:\n if (hms > 0)\n {\n this.gangkaarten[j][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, hSchatten.get(hKaartTeller), false);\n hms--;\n hKaartTeller++;\n } else\n {\n i--;\n }\n break;\n case 3:\n if (r > 0)\n {\n this.gangkaarten[j][i] = new RechtKaart((int) Math.floor(Math.random() * 4) + 1, false);\n r--;\n } else\n {\n i--;\n }\n break;\n case 4:\n if (t > 0)\n {\n this.gangkaarten[j][i] = new TKaart((int) Math.floor(Math.random() * 4) + 1, tSchatten.get(tKaartTeller), false);\n t--;\n tKaartTeller++;\n } else\n {\n i--;\n }\n break;\n\n }\n }\n }\n }", "public void DaneStartowe() {\n\t\tSystem.out.println(\"DaneStartowe\");\n\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(ZapisOdczyt.getPopulacjaStartowaNiewolnicy());\n\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(ZapisOdczyt.getPopulacjaStartowaNiewolnicy());\n\t\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(ZapisOdczyt.getPopulacjaStartowaRzemieslnicy());\n\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(ZapisOdczyt.getPopulacjaStartowaRzemieslnicy());\n\t\tPlansza.getArystokrataNaPlanszy().setZloto((int) (ZapisOdczyt.getPopulacjaStartowaArystokracja() + ZapisOdczyt.getArystokracjaWiekszaPopulacja()*ZapisOdczyt.getPopulacjaStartowaArystokracja()*0.01));\n\t\tPlansza.getArystokrataNaPlanszy().setTowary((int) (ZapisOdczyt.getPopulacjaStartowaArystokracja() + ZapisOdczyt.getArystokracjaWiekszaPopulacja()*ZapisOdczyt.getPopulacjaStartowaArystokracja()*0.01));\n\t}", "public KI(Spieler spieler, Spiel spiel){\r\n\t\tif (spieler == null) throw new RuntimeException(\"Spieler muss vorhanden sein!\");\t\r\n\t\tthis.spieler = spieler;\r\n\r\n\t\tif(spiel==null) throw new RuntimeException (\"Spiel sollte vorhanden sein\");\r\n\t\tthis.spiel=spiel;\r\n\r\n\t\thatUeberlauf=false;\r\n\t}", "public void keyPressed(KeyEvent e) {\n\t\t// Aktuelle Position des Spielers\n\t\tint xPos = spieler.getXPos();\n\t\tint yPos = spieler.getYPos();\n\n\t\t// Frage Tastatureingaben auf den Pfeiltasten ab.\n\t\t// Es wird geprueft, ob der naechste Schritt zulaessig ist.\n\t\t// Bleibt die Figur innerhalb der Grenzen des Arrays?\n\t\t// Wenn ja, ist das naechste Feld begehbar?\n\t\t// Falls beides \"wahr\" ist, dann gehe den naechsten Schritt\n\t\tif (!spielende) {\n\t\t\tif (e.getKeyCode() == KeyEvent.VK_UP) {\n\t\t\t\tif (yPos > 0 && !(level[xPos][yPos - 1] instanceof Wand))\n\t\t\t\t\tspieler.hoch();\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {\n\t\t\t\tif (yPos < HEIGHT - 1 && !(level[xPos][yPos + 1] instanceof Wand))\n\t\t\t\t\tspieler.runter();\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_LEFT) {\n\t\t\t\tif (xPos > 0 && !(level[xPos - 1][yPos] instanceof Wand))\n\t\t\t\t\tspieler.links();\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\n\t\t\t\tif (xPos < WIDTH - 1 && !(level[xPos + 1][yPos] instanceof Wand))\n\t\t\t\t\tspieler.rechts();\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_Q) {\n\t\t\t\tMonster m = spieler.angriffsMonster();\n\t\t\t\tif (m != null)\n\t\t\t\t\tm.changeHealth(-BOX / 4);\n\t\t\t// B f�r 'Heiltrank benutzen'\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_B){\n\t\t\t\tint change = spieler.benutzeHeiltrank();\n\t\t\t\t// Heilungseffekt wird verbessert, falls neue Monster durch das Aufheben des Schl�ssels ausgel�st wurden\n\t\t\t\tif (spieler.hatSchluessel())\n\t\t\t\t\tspieler.changeHealth((int)(change*1.5));\n\t\t\t\telse\n\t\t\t\t\tspieler.changeHealth((int)(change*0.5));\n\t\t\t} else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif (e.getKeyCode() == KeyEvent.VK_SPACE) {\n\t\t\t// Schluessel aufnehmen\n\t\t\tif (level[spieler.getXPos()][spieler.getYPos()] instanceof Schluessel) {\n\t\t\t\tspieler.nimmSchluessel();\n\t\t\t\tlevel[spieler.getXPos()][spieler.getYPos()] = new Boden();\n\t\t\t}\n\t\t\t// Heiltrank aufnehmen\n\t\t\telse if (level[spieler.getXPos()][spieler.getYPos()] instanceof Heiltrank) {\n\t\t\t\tspieler.nimmHeiltrank((Heiltrank) level[spieler.getXPos()][spieler.getYPos()]);\t\t\n\t\t\t\tlevel[spieler.getXPos()][spieler.getYPos()] = new Boden();\n\t\t\t}\n\t\t\t// Schluessel benutzen\n\t\t\tif (level[spieler.getXPos()][spieler.getYPos()] instanceof Tuer) {\n\t\t\t\tif (!((Tuer) level[spieler.getXPos()][spieler.getYPos()]).istOffen() && spieler.hatSchluessel()) {\n\t\t\t\t\t((Tuer) level[spieler.getXPos()][spieler.getYPos()]).setOffen();\n\t\t\t\t\t// Nach dem Oeffnen der Tuer ist der Schluessel wieder weg\n\t\t\t\t\tspieler.entferneSchluessel();\n\t\t\t\t\tif (currentLevel < MAXLEVEL)\n\t\t\t\t\t\tnextLevel();\n\t\t\t\t\telse {\n\t\t\t\t\t\tspielende = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public Pont ertesit(Pont innenlep, Szereplo sz);", "public void toon(TileSet tileSet, String kaart) {\n Assert.notNull(lader);\n KaartDisplay display = new KaartDisplay(tileSet);\n Wereld wereld = lader.laad(kaart);\n display.setKaart(wereld.getKaart());\n\n SnelstePadDebugPanel spd = new SnelstePadDebugPanel(display, wereld, choices);\n TspDebugPanel tsp = new TspDebugPanel(display, wereld, tspChoices);\n PlanDebugPanel pdb = new PlanDebugPanel(display, wereld, hplans);\n\n HandelsPositiePanel hpos = new HandelsPositiePanel();\n display.addHandelsPositieListener(hpos);\n\n JFrame f = new JFrame();\n JPanel panel = new JPanel(new BorderLayout(8, 8));\n JPanel rightTop = new JPanel(new BorderLayout(8, 8));\n Box right = new Box(BoxLayout.Y_AXIS);\n rightTop.add(right, BorderLayout.NORTH);\n panel.add(MainGui.wrapInScrolPane(display,tileSet.getTileSize()), BorderLayout.WEST);\n panel.add(rightTop, BorderLayout.CENTER);\n right.add(Box.createVerticalStrut(8));\n right.add(spd);\n right.add(Box.createVerticalStrut(8));\n right.add(tsp);\n right.add(Box.createVerticalStrut(8));\n right.add(pdb);\n right.add(hpos);\n\n f.setSize(1024, 800);\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n f.setContentPane(panel);\n f.setVisible(true);\n\n }", "public Husdjurshotell(){}", "public AbstraktesSpielfeld getSpielfeld() {\n // Hier ein Spielfeld-Objekt erzeugen und zurückliefern.\n return new Spielfeld();\n }", "public Wiese() \n {\n // Erzeugt eine neue Welt\n super(WORLD_WIDTH, WORLD_HEIGHT, CELL_SIZE);\n\n setPaintOrder(Kara.class, Tree.class, Mushroom.class, Leaf.class);\n Greenfoot.setSpeed(15);\n\n // Erzeuge die Anfangs-Objekte fuer die Welt.\n prepare();\n }", "public Spieler(String name, FarbEnum farbe,KI ki) {\n\t\tthis.setName(name);\n\t\tthis.setFarbe(farbe);\n\t\tthis.setKi(ki);\n\t\twuerfel = new Wuerfel();\n\t\t\n\t\tfigurlist = new ArrayList<Spielfigur>();\n\t\thinzufuegen();\n\t}", "public void ende() {\r\n\t\tSystem.out.println(dasSpiel.getSieger().getName() + \" hat gewonnen\"); \r\n\t}", "public String toString() {\n/* 6387 */ return \"VolaTile [X: \" + this.tilex + \", Y: \" + this.tiley + \", surf=\" + this.surfaced + \"]\";\n/* */ }", "public String getHand(){\r\n return this.handStr;\r\n }", "@Override\n\t\n\tpublic PlayingCard drawCard() {\n\t\tif(getCount() > 0) {\n\t\t\tPlayingCard obersteKarte = aktuellesDeck[getCount() - 1];\n\t\t\taktuellesDeck[getCount() - 1] = null;\n\t\t\tcount--;\n\t\t\treturn obersteKarte;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer! Karte ziehen nicht mehr möglich.\");\n\t\t\treturn null;\n\t\t}\n\t}", "private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }", "public void HandelKlas() {\n\t\tSystem.out.println(\"HandelKlas\");\n\t\tPlansza.getNiewolnikNaPLanszy().Handel(Plansza.getRzemieslnikNaPlanszy());\n\t\tPlansza.getNiewolnikNaPLanszy().Handel(Plansza.getArystokrataNaPlanszy());\n\t\t\n\t\tPlansza.getRzemieslnikNaPlanszy().Handel(Plansza.getNiewolnikNaPLanszy());\n\t\tPlansza.getRzemieslnikNaPlanszy().Handel(Plansza.getArystokrataNaPlanszy());\n\t\t\n\t\tPlansza.getArystokrataNaPlanszy().Handel(Plansza.getNiewolnikNaPLanszy());\n\t\tPlansza.getArystokrataNaPlanszy().Handel(Plansza.getRzemieslnikNaPlanszy());\n\t}", "public static void main(String[] args) {\n\t\tSingelyCardList alleKarten = new SingelyCardList();\n\n\t\tWissenskarte karte1 = new Wissenskarte (\"Peter Pain\", \"Zockt WoW\", \"Horde\", \"Peter\");\n\t\talleKarten.addLast(karte1);\n\t\tWissenskarte karte2 = new Wissenskarte (\"Koeln\", \"Einwohnerzahl 1 Millionen\", \"Liegt in NRW\", \"Stadt\");\n\t\talleKarten.addLast(karte2);\n\t\tWissenskarte karte3 = new Wissenskarte (\"Java\", \"Ist eine Insel\", \"Kann man auch als Kaffee trinken\", \"OOP\");\n\t\talleKarten.addLast(karte3);\n\t\tWissenskarte karte4 = new Wissenskarte (\"C#\", \"Braucht .NET-Komponenten\", \"Ist eine Objektorientierte Programmiersprache\", \"Spiele\");\n\t\talleKarten.addLast(karte4);\n\t\tWissenskarte karte5 = new Wissenskarte (\"TH Koeln\", \"Hat 11 Fakultaeten\", \"Informatiker sind die besten\", \"Campus\");\n\t\talleKarten.addLast(karte5);\n\t\t\n\t\t\n\t\tFrage neue_Frage = new Frage(\"Was zockt Peter?\", \"WoW\");\n\t\tkarte1.setFrage(neue_Frage);\n\t\t\n\t\tFrage neue_Frage1 = new Frage(\"Wo liegt Koeln?\", \"In NRW\");\n\t\tkarte2.setFrage(neue_Frage1);\n\t\t\n\t\tFrage neue_Frage2 = new Frage(\"Welches Getraenk ist Java?\", \"Kaffee\");\n\t\tkarte3.setFrage(neue_Frage2);\n\t\t\n\t\tFrage neue_Frage3 = new Frage(\"Was braucht C#?\", \".NET-Komponenten\");\n\t\tkarte4.setFrage(neue_Frage3);\n\t\t\n\t\tFrage neue_Frage4 = new Frage(\"Was sind Informatiker?\", \"Die besten\");\n\t\tkarte5.setFrage(neue_Frage4);\n\t\t\n\t\tFlashCardEditor frame = new FlashCardEditor(alleKarten);\n\t}", "public Hand() {\n this.hole1 = new BlankCard();\n this.hole2 = new BlankCard();\n showCards = false;\n }", "public void fuehreNaechstenZugAus(int spalte, int zeile, String spieler){\n\t\t\n\t\tif(spielfeld[spalte][zeile].equals(\"_\")){\n\t\t\tspielfeld[spalte][zeile] = spieler;\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic String Land() {\n\t\treturn \"El Helicoptero esta Aterrizando\";\r\n\t}", "public Spielfeld() {\n\t\tmulden = new int[14];\n\t\tsetSteine();\n\t}", "public KI(String spielerwahl){\n\t\teigenerStein = spielerwahl;\n\t\t\n\t\tswitch (spielerwahl) {\n\t\tcase \"o\":\n\t\t\tgegnerStein = \"x\";\n\t\t\tbreak;\n\t\tcase\"x\":\n\t\t\tgegnerStein = \"o\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Ungueltige Spielerwahl.\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\thatAngefangen = gegnerStein;\n\t\t\n\t\tfor(int i=0; i<7; i++) { //initialisiert spielfeld\n\t\t\tfor(int j=0; j<6; j++){\t\t\t\t\n\t\t\t\tspielfeld[i][j] = \"_\";\n\t\t\t}\n\t\t\tmoeglicheZuege[i] = -1; //initialisiert die moeglichen zuege\n\t\t}\n\t\t\n\t}", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "@Override\n public void obtain() {\n if (AbstractDungeon.player.hasRelic(MariStageDirections.ID)) {\n for (int i=0; i<AbstractDungeon.player.relics.size(); ++i) {\n if (AbstractDungeon.player.relics.get(i).relicId.equals(MariStageDirections.ID)) {\n instantObtain(AbstractDungeon.player, i, true);\n break;\n }\n }\n } else {\n super.obtain();\n }\n }", "public Hand getHand() {\n return hand;\n }", "public Hand getHand() {\n return hand;\n }", "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\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//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\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\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void skalierung(){\n double scale = Double.parseDouble(skalierung_textfield.getText());\n scale = scale/100;\n\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n t1.getTetraeder()[0].setPoint(A[0]*scale,A[1]*scale,A[2]*scale);\n t1.getTetraeder()[1].setPoint(B[0]*scale,B[1]*scale,B[2]*scale);\n t1.getTetraeder()[2].setPoint(C[0]*scale,C[1]*scale,C[2]*scale);\n t1.getTetraeder()[3].setPoint(D[0]*scale,D[1]*scale,D[2]*scale);\n\n redraw();\n }", "private void transferCommunalPile() {\n this.roundWinner.addToDeck(communalPile);\n communalPile = new Pile();\n }", "Hand getHand() {\n\t\treturn _hand;\n\t}", "public Eroeffnungsseite(SpielGUI parent) {\r\n super();\r\n this.parent = parent;\r\n hintergrund = parent.getFarben()[0];\r\n buttonFarbe = parent.getFarben()[1];\r\n init();\r\n }", "public Card showTop() {\n\t\treturn hand.get(0);\n\t}", "public RuimteFiguur() {\n kleur = \"zwart\";\n }", "public void mieteZahlen(BesitzrechtFeld feld) {\n System.out.println(\"Dein aktueller Kontostand beträgt: \" + getKontostand());\n Spieler spieler = feld.getSpieler();\n boolean einzahlen = einzahlen(feld.getMiete());\n if (!einzahlen) {\n MonopolyMap.spielerVerloren(spielfigur);\n } else {\n System.out.println(\"Du musst an \" + feld.getSpieler().getSpielfigur() + \" Miete in Höhe von \" + feld.getMiete() + \" zahlen (\" + feld.getFeldname() + \")\");\n spieler.auszahlen(feld.getMiete());\n System.out.println(\"Dein neuer Kontostand beträgt: \" + getKontostand());\n }\n\n }", "public ArrayList<Tile> getPlayerHand(){\n return playerHand;\n }", "public BruceWayne()\n {\n GeneralPath leftSide = new GeneralPath();\n\tleftSide.moveTo(195,200);\n\tleftSide.lineTo(195,230);//neck\n\tleftSide.lineTo(150,230);//shoulder\n\tleftSide.lineTo(140,250);//shoulder slant\n\tleftSide.lineTo(140,340);//armleft\n\tleftSide.lineTo(165,340);//armbottom\n\tleftSide.lineTo(160,260);//armright\n\tleftSide.lineTo(170,270);//armpit\n\tleftSide.lineTo(170,350);//chest\n\tleftSide.lineTo(160,510);//legleft\n\tleftSide.lineTo(185,510);//legbottom\n\tleftSide.lineTo(200,360);//legright\n\tleftSide.lineTo(220,360);//middle\n\n Shape rightSide = ShapeTransforms.horizontallyFlippedCopyOf(leftSide);\n rightSide = ShapeTransforms.translatedCopyOf(rightSide, 140.0, 0.0);\n\tCircle head = new Circle(210,170,35);\n \n\twholeFigure = new GeneralPath();\n\twholeFigure.append(head,false);\n wholeFigure.append(leftSide, false);\n wholeFigure.append(rightSide, false);\n }", "public void umetniKartu(Card karta){\r\n\t\tkarte.add(karta);\r\n\t\tthis.repaint();\r\n\t}", "public Karte removeKarte( Karte karte) throws ZuWenigKartenException {\n Karte found = null;\n for(Karte k: listKartenInhand){\n if(karte.getClass().isInstance(k)){\n found = k;\n break;\n }\n }\n if(karte != null){\n listKartenInhand.remove(found);\n return found;\n }\n throw new ZuWenigKartenException(\"keine No D:\");\n }", "public String gibZustand(){\n String out = anzahl+QwirkleServer.SEP;\n String aktiv = \"\";\n int[] punkte = new int[anzahl];\n String[] spielerSteine = new String[anzahl];\n String spielfeldString = \"\";\n\n //sammle Daten\n int count = 0;\n while (count<anzahl){\n Spieler spieler = this.spielerRing.getContent();\n if (spieler.istAktiv()) aktiv = spieler.gibIndex()+\"\";\n punkte[spieler.gibIndex()] = spieler.gibPunkteStand();\n spielerSteine[spieler.gibIndex()]=spieler.gibSteineString();\n this.spielerRing.next();\n count++;\n }\n\n if (spielEnde) aktiv = \"-1\";\n\n out += beutel.gibAnzahl()+QwirkleServer.SEP;\n out += aktiv;\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+punkte[i];\n\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+spielerSteine[i];\n\n\n spielfeld.toFirst();\n while(spielfeld.hasAccess()) {\n Stein stein = spielfeld.getContent();\n out += QwirkleServer.SEP + stein.toString();\n spielfeld.next();\n }\n\n return out;\n }", "public PregledPoruka() {\n preuzmiMape();\n preuzmiPoruke();\n }", "public CardPile() {\n \n this.pila = new Stack<ICard>();\n this.tamano = 0;\n }", "@Override\r\n\tpublic void loeschen() {\r\n//\t\tsuper.leuchterAbmelden(this);\r\n\t\tsuper.loeschen();\r\n\t}", "public Card() {\n this.set('A', Suit.spades);\n }", "public Spiel(TerraSnowSpleef plugin) {\r\n this.plugin = plugin;\r\n joinCountdown = false;\r\n startCountdown = false;\r\n spiel = false;\r\n sf = new Spielfeld(plugin);\r\n spielerSet = new HashSet<>();\r\n }", "@Override\n\tpublic void rotiereNachRechts() {\n\n\t}", "private void heilenTrankBenutzen() {\n LinkedList<Gegenstand> gegenstaende = spieler.getAlleGegenstaende();\n for (Gegenstand g : gegenstaende) {\n if (g.getName().equalsIgnoreCase(\"heiltrank\")) {\n spieler.heilen();\n gegenstaende.remove(g);\n System.out.print(\"Heiltrank wird benutzt\");\n makePause();\n System.out.println(\"Du hast noch \" + zaehltGegenstand(\"heiltrank\") + \" Heiltranke!\");\n return;\n }\n }\n System.out.println(\"Du hast gerade keinen Heiltrank\");\n }", "public Hand() {\n downStack = new ArrayList<>();\n cardsInPlayStack = new Stack<>();\n }", "@Override\r\n\tpublic void horario() {\n\t\t\r\n\t}", "public void printHand(){\n\t\tSystem.out.println(name + \"'s hand:\");\n\t\tfor(int i=0; i<hand.size(); i++){\n\t\t\tSystem.out.print(i+1 + \".\\t\");\n\t\t\thand.get(i).printCard();\n\t\t}\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public void sendeSpielerWeg(String spieler);", "TipeLayanan(String deskripsi)\r\n {\r\n this.deskripsi = deskripsi;\r\n }", "public void place(GamePiece teil, QPosition pos) { // old German method name: platziere\n for (int x = teil.getMinX(); x <= teil.getMaxX(); x++) {\n for (int y = teil.getMinY(); y <= teil.getMaxY(); y++) {\n if (teil.filled(x, y)) {\n int ax = pos.getX() + x - teil.getMinX();\n int ay = pos.getY() + y - teil.getMinY();\n set(ax, ay, teil.getBlockType(x, y));\n }\n }\n }\n view.draw();\n }", "public SPIEL( int breite , int hoehe , boolean punkteLinks , boolean punkteRechts , boolean maus ) \n {\n //Zaehler fuer Tick, Tack, ...\n zaehler = 0;\n anzeige = new AnzeigeE( breite , hoehe );\n //animationsManager = AnimationsManager.getAnimationsManager();\n \n //Punkteanzeige\n anzeige.punkteLinksSichtbarSetzen( punkteLinks );\n anzeige.punkteRechtsSichtbarSetzen( punkteRechts );\n \n //Maus ggf. aktivieren\n if ( maus ) \n {\n anzeige.klickReagierbarAnmelden( this , true );\n }\n \n //Tastatur\n anzeige.tastenReagierbarAnmelden( this );\n \n //Ticker\n //Alle 500 Millisekunden (=Jede halbe Sekunde) ein Tick\n //anzeige.tickerAnmelden(this, 500); \n }", "@Override\n public String toString() {\n\t// TODO\n\treturn super.toString() + \" Sides: \" + this.getSide();\n }", "public void starteSpiel(int pAnzahl){\n\n this.anzahl = pAnzahl;\n\n spielerRing = new Ring<>();\n for (int i = 0; i < pAnzahl; i++) {\n spielerRing.insert(new Spieler(i));\n }\n\n Spieler startSpieler = null;\n while (startSpieler==null) {\n\n //verteile Steine\n int count = 0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n spieler.loescheAlleSteine();\n for (int i = 0; i < 6; i++) {\n spieler.addStein(beutel.gibStein());\n }\n this.spielerRing.next();\n count++;\n }\n\n //bestimme Startspieler\n int startWert = 0;\n count=0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n int wert = spieler.gibStartWert();\n if (wert>startWert){\n startWert = wert;\n if (wert>2)\n startSpieler = spieler;\n }\n this.spielerRing.next();\n count++;\n }\n\n if (startSpieler!=null)\n startSpieler.setzeAktiv(true);\n }\n }", "public void updateComputerHand(ArrayList<Carte> hand) {\n computerPaquetView.setCards(hand);\n }", "public int getHandKarteCount(){\n return getHandKarte().size();\n }", "public Card showCard()\r\n {\r\n return pile.peek();\r\n }", "public void creationSable(){\n\t\tfor(int x=2;x<=this.taille-3;x++) {\n\t\tfor(int y=2;y<=this.taille-3;y++) {\n\t\tif( grille.get(x).get(y).getTypeOccupation()==0 &&\n\t\t\t\tgrille.get(x+2).get(y).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x+2).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y-2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x).get(y-2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x+2).get(y-2).getTypeOccupation()!=3 ) {\n\t\t\t\n\t\t\tint[] coord = new int[2];\n\t\t\tcoord[0]=x;\n\t\t\tcoord[1]=y;\n\t\t\tSable sable = new Sable(coord);\n\t\t\tgrille.get(x).set(y, sable);\n\t\t}\n\t\t}\n\t\t}\n\t}", "private void translate()\r\n {\r\n for(int x = 0;x<14;x++)\r\n {\r\n pack.add(new Card(sPack.get(x)));\r\n }\r\n \r\n }", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public Hand(){}", "public Pile getHandPile(){\n return piles.getHandPile();\n }", "public void addSteinZuSpielFeld(Stein pStein, int spielerIndex)\n {\n if (!checkLegbarkeit(pStein))\n return;\n //System.out.println(\"QuirkelSpiel: \"+(System.currentTimeMillis() - start) + \" ms for Legbarkeitscheck!\");\n\n\n\n if (aktiveZeile ==null && aktiveSpalte ==null){\n aktiveZeile = pStein.gibZeile();\n aktiveSpalte = pStein.gibSpalte();\n }\n else if (aktiveZeile!=null && aktiveSpalte!=null){\n if (pStein.gibZeile()!=aktiveZeile && pStein.gibSpalte()!=aktiveSpalte) //Stein muss in gleiche Zeile oder Spalte gelegt werden\n return;\n else if (pStein.gibZeile()==aktiveZeile)\n aktiveSpalte = null;\n else\n aktiveZeile =null;\n }\n else if (aktiveZeile!=null){\n if (pStein.gibZeile()!=aktiveZeile) //Stein muss in die gleiche Zeile gelegt werden\n return;\n }\n else\n if (pStein.gibSpalte()!=aktiveSpalte) //Stein muss in die gleiche Spalte gelegt werden\n return;\n\n if (aktiveFarbe ==null && aktivesSymbol ==null){\n aktiveFarbe = pStein.gibFarbString();\n aktivesSymbol = pStein.gibSymbolString();\n }\n else if (aktiveFarbe!=null && aktivesSymbol!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe) && !pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol oder gleiche Farbe haben\n return;\n else if (pStein.gibFarbString().equals(aktiveFarbe))\n aktivesSymbol = null;\n else\n aktiveFarbe =null;\n }\n else if (aktiveFarbe!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe)) //Stein muss gleiche Farbe haben\n return;\n }\n else\n if (!pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol haben\n return;\n\n\n spielfeld.append(pStein); // legt ihn auf das Spielfeld\n symbolMap.get(pStein.gibSymbol()).add(pStein);\n farbenMap.get(pStein.gibSymbol()).add(pStein);\n\n int punkte=0;\n int zwischenPunkte =horizontalePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n zwischenPunkte =senkrechtePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n\n if (punkte==0)\n punkte = 1; //gib auf alle Faelle einen Punkt\n\n while (spielerRing.getContent().gibIndex()!=spielerIndex)\n spielerRing.next();\n\n Spieler spieler = this.spielerRing.getContent();\n spieler.legeStein(pStein,punkte);\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + pStein.toString() + \" gelegt.\");\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + punkte + \" Punkte bekommen.\");\n\n\n //Wiederauffuellen in der gleichen Runde, wenn alle Steine abgelegt worden sind\n if (spieler.gibAnzahlSteine()==0 && beutel.gibAnzahl()>0){\n while (spieler.gibAnzahlSteine()<6 && beutel.gibAnzahl()>0){\n spieler.addStein(beutel.gibStein());\n }\n }\n\n }", "public Sierpinski() {\n super(\"Sierpinski gasket\");\n \n this.resize(area_size, area_size);\n }", "public void snare();", "public void leerPlanesDietas();", "public void printCompHand(){\n for(int i = 0; i < GetSizeOfComputerHand(); i++){\n System.out.println(handComputer.get(i));\n }\n }", "@Override\n\tpublic PlayingCard[] getCards() {\n\t\tif(getCount() != 0) {\n\t\t\tPlayingCard[] kopie = new SkatCard[getCount()];\n\t\t\tfor(int i = 0; i < getCount(); i++) {\n\t\t\t\tkopie[i] = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t}\n\t\t\treturn kopie;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer --> Kopie vom Stapel leer\");\n\t\t\treturn null;\n\t\t}\n\t}", "public void expLocation() {\n\t\tif (!death) {\t// Geht nicht wenn Tod!\n\t\t\t\n\t\t\t// Beschreibungen anzeigen und boolean explored auf wahr setzen, außer der Raum wurde bereits untersucht\n\t\t\tif (location[this.currentLocation].isExplored()) { Tuna.setMessage(\"Dieser Raum wurde bereits untersucht!\");\n\t\t\t} else {\n\t\t\t\tTuna.addText(location[this.currentLocation].getDescriptions().getExploreDescription());\n\t\t\t\tlocation[this.currentLocation].setExplored(true);\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle null im Item-Array des Standortes sichtbar machen\n\t\t\tif ((currentLocation > 0 && currentLocation < 7 && currentLocation != 2) || currentLocation == 20) {\n\t\t\t\tlocation[this.currentLocation].getItem(0).setVisible(true);\n\t\t\t\t/* Im Korridor (1) der Kaffeelöscherkasten\n\t\t\t\t * Im Konferenzraum (3) der Ventilationsschacht\n\t\t\t\t * In der Kammer der Leere (4) die Notiz\n\t\t\t\t * Im Ventilationsraum (5) die Notiz\n\t\t\t\t * In der Damentoilette (6) das Skillboook\n\t\t\t\t * Im Fahrstuhlschacht (20) die Kaffeetasse\n\t\t\t\t */\n\t\t\t}\n\t\t\t\n\t\t\t// Items an Stelle eins im Item-Array des Standortes sichtbar machen\n\t\t\tif (currentLocation == 9) {\n\t\t\t\tlocation[this.currentLocation].getItem(1).setVisible(true);\n\t\t\t}\n\t\t} else if (death) {\n\t\t\tTuna.setMessage(\"Du bist tot!\");\n\t\t}\n\t}", "public void maakDambord() {\t\r\n\tbord.addSpeelBord(dambord.getSpeelbord());\r\n\tframe.pack();\r\n }", "public abstract Koordinate schuss();", "@Override\n public void aktion(Hauptobjekt h) {\n System.out.println(\"Hin\");\n h.setAktuellerZustand(new ZweiterZustand());\n }", "public MangKaib(Main game){\n super(game);\n taust = new Taust(0,0,600,400);\n taust.checkLevel();// checkime, mis areaga tegu on peale uue tausta loomist\n mobSpawner.lisaMobInfo(); // laeme mob info.\n //game, width height draw x draw y, elud, damage, nimi, exp\n mangija = new Player(game, 97,174,50,370,100,10);\n mspawner = new mobSpawner(game, Mobid[13].getWidth(), Mobid[13].getHeight(), 450, 370, km[13].elud, km[13].dpsMin, km[13].dpsMax, km[13].mobSpeed, km[13].nimi, km[13].mobXp, km[13].mobGold,km[13].mobGold);\n magicAttack = new magicAttack(game,(mangija.x+mangija.width-15),(mangija.y-(mangija.height/2)),40,20,1,mangija.damage);\n kLiides = new uiBox(0,400,600,200);\n kLiides2 = new uiSide(600,0,200,600);\n uusRida = new Tekstid(0,420);//420 v 590\n }", "public Farbe fuehrendesKamel();", "protected boolean betreteSpielfeld(){\r\n\t\t\r\n\t\tint neueId;\r\n\t\t\r\n\t\tif(spiel.getBewegungsWert()==6)\r\n\t\t{\r\n\t\t\tfor(int i=0; i<4; i++){\r\n\t\t\t\tif(spieler.getFigur(i).getPosition().getTyp() == FeldTyp.Startfeld){\r\n\t\t\t\t\tneueId = spieler.getFigur(i).getFreiPosition();\r\n\t\t\t\t\tif(spiel.userIstDumm(neueId, i)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tspiel.bewege(i);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public Hand() {\n }", "public void AwansSpoleczny() {\n\t\tSystem.out.println(\"AwansSpoleczny\");\n\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getNiewolnikNaPLanszy() instanceof Niewolnicy) {\n\t\t\tPlansza.setNiewolnikNaPlanszy(new Mieszczanie(Plansza.getNiewolnikNaPLanszy()));\n\t\t}\n\t\t\t\n\t\tif(Plansza.getRzemieslnikNaPlanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getRzemieslnikNaPlanszy() instanceof Rzemieslnicy) {\n\t\t\tPlansza.setRzemieslnikNaPlanszy(new Handlarze(Plansza.getRzemieslnikNaPlanszy()));\n\t\t}\n\t\t\t\n\t\tif(Plansza.getArystokrataNaPlanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getArystokrataNaPlanszy() instanceof Arystokracja) {\n\t\t\tPlansza.setArystokrataNaPlanszy(new Szlachta(Plansza.getArystokrataNaPlanszy()));\n\t\t}\n\t}", "@Override\n public CartAttachmentSeat getSeat() {\n return super.getSeat();\n }", "public ArrayList<Piece> getHand() {\n return this.piecesInHand;\n }", "Side getSide();" ]
[ "0.68444794", "0.6484243", "0.62977356", "0.62190235", "0.607496", "0.60304344", "0.5966708", "0.5859534", "0.58351296", "0.57101274", "0.5704543", "0.5692728", "0.5686971", "0.5674399", "0.5649378", "0.5648653", "0.5639591", "0.5624213", "0.55953395", "0.55900735", "0.55825186", "0.5580141", "0.55705875", "0.55503935", "0.55480134", "0.5547896", "0.5542372", "0.5511563", "0.5510834", "0.55041903", "0.55023044", "0.54943424", "0.5493079", "0.5475918", "0.54689103", "0.546728", "0.54637814", "0.546114", "0.5453552", "0.5453212", "0.54434633", "0.54340255", "0.5431531", "0.542594", "0.542594", "0.5419956", "0.5410205", "0.5406834", "0.53982764", "0.5384439", "0.53827083", "0.5374389", "0.537316", "0.5368473", "0.5368059", "0.5367639", "0.53645563", "0.5363711", "0.5362984", "0.5357062", "0.5353896", "0.5351734", "0.53490776", "0.53445727", "0.53414226", "0.53357416", "0.53313106", "0.53217083", "0.5319891", "0.531887", "0.53181696", "0.53171414", "0.5315187", "0.5314851", "0.5314737", "0.5313948", "0.53096485", "0.5307782", "0.53035057", "0.5299462", "0.5297695", "0.5295574", "0.5294364", "0.528851", "0.5285069", "0.52838534", "0.5283027", "0.5277616", "0.5277021", "0.5274135", "0.52736366", "0.5273571", "0.5272242", "0.5267244", "0.5266115", "0.5265757", "0.52540433", "0.52537346", "0.52510965", "0.5245288", "0.5245041" ]
0.0
-1
Gets data source factory.
public DataSourceFactory getDataSourceFactory() { return database; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private DataSource.Factory buildDataSourceFactory() {\n return ((DemoApplication) getApplication()).buildDataSourceFactory();\n }", "DataFactory getDataFactory();", "public DataSourceFactory() {}", "static public DataSource getDataSource(Context appContext) {\n // As per\n // http://goo.gl/clVKsG\n // we can rely on the application context never changing, so appContext is only\n // used once (during initialization).\n if (ds == null) {\n //ds = new InMemoryDataSource();\n //ds = new GeneratedDataSource();\n ds = new CacheDataSource(appContext, 20000);\n }\n \n return ds;\n }", "public static DataSource getDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), true);\n }", "static DataFrameFactory factory() {\n return DataFrameFactory.getInstance();\n }", "public DataSource getDataSource()\n\t{\n\t\tLOGGER.info(\"Getting DataSource object\");\n\t\treturn this.dataSource;\n\t}", "public static JRDataSource getDataSource() {\n\t\treturn new CustomDataSource(1000);\n\t}", "public OBStoreFactory getFactory();", "public static DataSource getDs() {\n return ds;\n }", "protected DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public SimpleDriverDataSource getDataSource() {\n\t\tString path = context.getRealPath(\"/\");\n\t\tString dbpath = path + Utility.DB_PATH;\n\t\tSimpleDriverDataSource dataSource = new SimpleDriverDataSource();\n\t\tFileInputStream fileInputStreamSystemSettings = null;\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tfileInputStreamSystemSettings = new FileInputStream(dbpath);\n\t\t\ttry {\n\t\t\t\tprop.load(fileInputStreamSystemSettings);\n\t\t\t\ttry {\n\t\t\t\t\t// set datasource parameters\n\t\t\t\t\t// set driver\n\t\t\t\t\tdataSource.setDriver(new com.mysql.jdbc.Driver());\n\t\t\t\t\t// set username\n\t\t\t\t\tdataSource.setUsername(prop.getProperty(\"jdbc.username\"));\n\t\t\t\t\t// set password\n\t\t\t\t\tdataSource.setPassword(prop.getProperty(\"jdbc.password\"));\n\t\t\t\t\t// set jdbc url\n\t\t\t\t\tdataSource.setUrl(prop.getProperty(\"jdbc.url\"));\n\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileInputStreamSystemSettings.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn dataSource;\n\t}", "public static DataFactory init() {\n\t\ttry {\n\t\t\tDataFactory theDataFactory = (DataFactory)EPackage.Registry.INSTANCE.getEFactory(DataPackage.eNS_URI);\n\t\t\tif (theDataFactory != null) {\n\t\t\t\treturn theDataFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new DataFactoryImpl();\n\t}", "String getDataSource();", "@Override\n\tpublic DataSource getDataSource() {\n\t\tif(this.dataSource == null) {\n\t\t\ttry {\n\t\t\t\tInitialContext initialContext = new InitialContext();\n\t\t\t\tthis.dataSource = (DataSource) initialContext.lookup(\"java:comp/env/jdbc/DefaultDB\");\n\t\t\t} catch(NamingException e){\n\t\t\t\tthrow new IllegalStateException(e);\n\t\t\t}\n\t\t}\n\t\treturn this.dataSource;\n\t}", "private DataSource.Factory buildDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {\n return new DefaultDataSourceFactory(this, bandwidthMeter, buildHttpDataSourceFactory(bandwidthMeter));\n }", "public DataSource getDataSource() {\n return _dataSource;\n }", "public DataSource createImpl()\n {\n if (_impl == null)\n {\n // create a param defining the datasource\n \n \tJdbcDataSourceParam dsParam = new JdbcDataSourceParam(getName(),\n getJdbcDriver(), getJdbcUrl() , //getJdbcCatalog(),\n getJdbcUser(), getJdbcPassword());//+ \":\" + getJdbcCatalog()\n\n // get/create the datasource\n _impl = DataManager.getDataSource(dsParam);\n\n // get the entities, create and add them\n Vector v = getEntities();\n for (int i = 0; i < v.size(); i++)\n {\n EntityDobj ed = (EntityDobj) v.get(i);\n _impl.addEntity(ed.createImpl());\n }\n\n // get the joins, create and add them\n v = getJoins();\n for (int i = 0; i < v.size(); i++)\n {\n JoinDobj jd = (JoinDobj) v.get(i);\n _impl.addJoin(jd.createImpl());\n }\n }\n\n return _impl;\n }", "public DataSource getDataSource(){\n\n // open/read the applicliation context file\n // belove instruction to ger absolute path of current java apps\n //URL location = NaicsUtility.class.getProtectionDomain().getCodeSource().getLocation();\n //System.out.println(location);\n ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(\"./../db.xml\");\n DataSource dataSource = null;\n try{ \n dataSource = (DataSource) appContext.getBean(\"dataSource\");\n } catch ( Exception ex ) {\n logger.log( Level.SEVERE, \"ERROR: can't create spring context and data source from application context\", ex.getMessage() );\n } finally {\n appContext.close();\n }\n return dataSource;\n }", "@Override\n\tpublic DataSource getDataSource() {\t\t\n\t\treturn dataSource;\n\t}", "public DataSource getDataSource(final QueriesConfig qryConfig) throws DBMissingValueException {\n validate(qryConfig);\n\n final var connectionString = qryConfig.getConnectionString();\n\n var dataSource = DATA_SOURCES.get(connectionString);\n\n if (dataSource==null) {\n try {\n LOCK.lock();\n dataSource = DATA_SOURCES.get(connectionString);\n if (dataSource==null) {\n LOG.trace(String.format(\"Registering %s to pool.\", connectionString));\n Class.forName(qryConfig.getJdbcDriver());\n\n final var basicDataSource = new BasicDataSource();\n basicDataSource.setUrl(connectionString);\n\n if (qryConfig.getWindowsAuthentication()==null) {\n basicDataSource.setUsername(qryConfig.getUsername());\n basicDataSource.setPassword(qryConfig.getPassword());\n }\n\n basicDataSource.setMinIdle(dbPoolConfig.getMinIdle());\n basicDataSource.setMaxIdle(dbPoolConfig.getMaxIdle());\n basicDataSource.setMaxOpenPreparedStatements(dbPoolConfig.getMaxOpenPreparedStatements());\n dataSource = basicDataSource;\n\n DATA_SOURCES.put(connectionString, dataSource);\n }\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(e);\n } finally {\n LOCK.unlock();\n }\n }\n else {\n LOG.trace(String.format(\"Retrieve %s from pool.\", connectionString));\n }\n\n return dataSource;\n }", "@Override\n public String getDataSource()\n {\n return dataSource;\n }", "public static Factory factory() {\n return ext_dbf::new;\n }", "public static DaoFactory getInstance(){\n\t\tif(daoFactory==null){\n\t\t\tdaoFactory = new DaoFactory();\n\t\t}\n\t\treturn daoFactory;\n\t}", "public static DataSource getDataSource(){\n try {\n Context context = new InitialContext();\n DataSource ds = (DataSource) context.lookup(\"jdbc/oracle\");\n return ds;\n } catch (NamingException ex) {\n Logger.getLogger(DataSourceBean.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "EDataSourceType getDataSource();", "public DataSource getDataSource() {\n return dataSource;\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public DataSource getDataSource() {\r\n return dataSource;\r\n }", "public DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public RDFCompositeDataSource getDatabase() //readonly\n\t{\n\t\tif(rdfCompositeDataSource == null) {\n\t\t\tString attr = StringUtils.trimToNull(getAttribute(\"datasources\"));\n\t\t\tif(attr != null) {\n\t\t\t\tRDFService rdfService = null; //TODO get the RDFService\n\t\t\t\trdfCompositeDataSource = new RDFCompositeDataSourceImpl(rdfService); //TODO should we ask the RDFService for this?\n\t\t\t\tfor(String uri : attr.split(\"\\\\s+\")) {\n\t\t\t\t\trdfCompositeDataSource.addDataSource(rdfService.getDataSource(uri));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rdfCompositeDataSource;\n\t}", "public DataSource getDataSource() {\n\t\treturn this.dataSource;\n\t}", "public void setDataSourceFactory(Factory<DataSource> dataSourceFactory) {\n this.dataSourceFactory = dataSourceFactory;\n }", "public static CLONDATAFactory init() {\n\t\ttry {\n\t\t\tCLONDATAFactory theCLONDATAFactory = (CLONDATAFactory) EPackage.Registry.INSTANCE.getEFactory(\n\t\t\t\tCLONDATAPackage.eNS_URI);\n\t\t\tif (theCLONDATAFactory != null) {\n\t\t\t\treturn theCLONDATAFactory;\n\t\t\t}\n\t\t} catch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new CLONDATAFactoryImpl();\n\t}", "public synchronized String getDataSource(){\n\t\treturn dataSource;\n\t}", "public String getDataSource() {\n return dataSource;\n }", "public static synchronized DAOFactory getDAOFactory() {\r\n if (daof == null) {\r\n daoType = JDBCDAO;\r\n switch (daoType) {\r\n case JDBCDAO:\r\n daof = new JDBCDAOFactory();\r\n break;\r\n case DUMMY_DAO:\r\n daof = new InMemoryDAOFactory();\r\n break;\r\n default:\r\n daof = null;\r\n }\r\n }\r\n return daof;\r\n }", "private DataSource getDataSource() throws PermissionException {\n if (dataSource != null) {\n return dataSource;\n }\n\n if (dataSourceService == null) {\n throw new PermissionException(\"Datasource service is null. Cannot retrieve datasource \" +\n permissionConfig.getDatasourceName());\n }\n\n try {\n dataSource = (DataSource) dataSourceService.getDataSource(permissionConfig.getDatasourceName());\n } catch (DataSourceException e) {\n throw new PermissionException(\"Unable to retrieve the datasource: \" +\n permissionConfig.getDatasourceName(), e);\n }\n return dataSource;\n }", "protected static HttpDataFactory getHttpDataFactory() {\n return httpDataFactory;\n }", "public static DataSource getNonTXDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), false);\n }", "public AdapterFactory getAdapterFactory()\n {\n return adapterFactory;\n }", "public String getDataSource() {\n return dataSource;\n }", "public Factory getFactory()\r\n {\r\n if( m_factory != null ) return m_factory;\r\n m_factory = FactoryHelper.narrow( m_primary );\r\n return m_factory;\r\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public StoreFactory getStoreFactory()\r\n {\r\n return (StoreFactory)getEFactoryInstance();\r\n }", "public DataSource getDataSource(CConnection connection)\n\t{\n\t\t//throw new UnsupportedOperationException(\"Not supported/implemented\");\n\t\tif (m_ds != null)\n\t\t\treturn m_ds;\n\t\t\n\t\t//org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource();\n\t\torg.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();\n\t\tds.setDataSourceName(\"CompiereDS\");\n\t\tds.setServerName(connection.getDbHost());\n\t\tds.setDatabaseName(connection.getDbName());\n\t\tds.setUser(connection.getDbUid());\n\t\tds.setPassword(connection.getDbPwd());\n\t\tds.setPortNumber(connection.getDbPort());\n\t\tds.setMaxConnections(50);\n\t\tds.setInitialConnections(20);\n\t\t\n\t\t//new InitialContext().rebind(\"DataSource\", source);\t\t\n\t\tm_ds = ds;\n\t\t\n\t\treturn m_ds;\n\t}", "public DataSource getDatasource() {\n return datasource;\n }", "@Bean(destroyMethod = \"close\")\n\tpublic DataSource dataSource() {\n\t\tHikariConfig config = Utils.getDbConfig(dataSourceClassName, url, port, \"postgres\", user, password);\n\n try {\n\t\t\tlogger.info(\"Configuring datasource {} {} {}\", dataSourceClassName, url, user);\n config.setMinimumIdle(0);\n\t\t\tHikariDataSource ds = new HikariDataSource(config);\n\t\t\ttry {\n\t\t\t\tString dbExist = \"SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = lower('\"+databaseName+\"')\";\n\t\t\t\tPreparedStatement statementdbExist = ds.getConnection().prepareStatement(dbExist);\n\t\t\t\tif(statementdbExist.executeQuery().next()) {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tds.close();\n\t\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\t} else {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tString sql = \"CREATE DATABASE \" + databaseName;\n\t\t\t\t\tPreparedStatement statement = ds.getConnection().prepareStatement(sql);\n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tds.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"ERROR Configuring datasource SqlException {} {} {}\", e);\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t} catch (Exception ee) {\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\tlogger.debug(\"ERROR Configuring datasource catch \", ee);\n\t\t\t}\n\t\t\tHikariConfig config2 = Utils.getDbConfig(dataSourceClassName, url, port, databaseName, user, password);\n\t\t\treturn new HikariDataSource(config2);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR in database configuration \", e);\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "public ConfigurableCacheFactory getCacheFactory();", "public static DataSourceSwapperRegistry getInstance() {\n return INSTANCE;\n }", "Factory getFactory()\n {\n return configfile.factory;\n }", "@Bean\n\tpublic DataSource getDataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL)\n\t\t\t\t.addScript(\"crate-db.sql\")\n\t\t\t\t.addScript(\"insert-db.sql\")\n\t\t\t\t.build();\n\t\treturn db;\n\t}", "public ValueFactory<K, V> getFactory()\n {\n return factory;\n }", "public DataSource getDataSource() {\n return datasource;\n }", "public DataSourcesImpl dataSources() {\n return this.dataSources;\n }", "ProfileFactory getProfileFactory( DataSourceMetadata dataSourceMetadata );", "public static FirebaseDataSource getInstance(Context context, AppExecutors executors, FirestoreTasks tasks) {\n Log.d(LOG_TAG, \"Getting the network data source\");\n if (sInstance == null) {\n synchronized (LOCK) {\n sInstance = new FirebaseDataSource(context.getApplicationContext(), executors, tasks);\n Log.d(LOG_TAG, \"Made new network data source\");\n }\n }\n return sInstance;\n }", "public static DAOFactory getInstance() {\r\n return instance;\r\n }", "@Bean(name = \"dataSource\")\n\tpublic DataSource dataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript(\"db/create-db.sql\").addScript(\"db/insert-data.sql\").build();\n\t\treturn db;\n\t}", "DatasetFileService getSource();", "public static DaoFactory getInstance() {\n if (daoFactory == null) {\n synchronized (DaoFactory.class) {\n if (daoFactory == null) {\n daoFactory = new JDBCDaoFactory();\n }\n }\n }\n return daoFactory;\n }", "public String getDatasource()\r\n\t{\r\n\t\treturn _dataSource;\r\n\t}", "@Pure\n\tprotected IResourceFactory getResourceFactory() {\n\t\treturn this.resourceFactory;\n\t}", "PlanningFactory getFactory();", "public static ContaCapitalCadastroDaoFactory getInstance() {\n\t\treturn factory;\n\t}", "public static synchronized ANSSRegionsFactory getFactory() {\n return getFactory(true);\n }", "public DataSourceRegistry getDataSourceRegistry();", "private EnabledDataSource getEnabledDataSource()\n {\n EnabledDataSource ds = new EnabledDataSource();\n ds.setDriverClassName(\"jdbc.db.TestDriverImpl\");\n ds.setDriverName(TestDriverImpl.TEST_URL_START);\n ds.setPruneFactor(0);\n\n return ds;\n }", "DTMCFactory getDTMCFactory();", "@Bean(name = \"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tDriverManagerDataSource dataSource = new DriverManagerDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.cj.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/test_db\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"password\");\n\t\treturn dataSource;\n\t}", "public static DataStore getInstance() {\n if (ourInstance == null) {\n ourInstance = new DataStore();\n }\n return ourInstance;\n }", "@Bean\n @Profile(\"Prod\")\n public DataSource jndiDataSource(){\n \tJndiObjectFactoryBean bean = new JndiObjectFactoryBean();\n \tbean.setJndiName(\"dataSource\");\n \tbean.setProxyInterface(DataSource.class);\n \tbean.setResourceRef(true);\n \treturn (DataSource) bean.getObject();\n }", "public static Factory factory() {\n return ext_accdt::new;\n }", "public static BackendFactory getInstance() {\n return INSTANCE;\n }", "public static ConnectionSource getSource() {\n try {\n return new JdbcConnectionSource(CONNECTION_STRING);\n } catch (final SQLException e) {\n throw new RuntimeException(e);\n }\n }", "@Profile(\"production\")\r\n @Bean(name=\"DataSourceBean\") \r\n public DataSource getDataSource(){\r\n final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();\r\n dsLookup.setResourceRef(true);\r\n DataSource dataSource = dsLookup.getDataSource(\"jdbc/eshop_db\"); \t \r\n return dataSource;\r\n }", "public static LambdaFactory get() {\n return get(LambdaFactoryConfiguration.get());\n }", "Source createDatasourceHttp(Source ds, Provider prov) throws RepoxException;", "public static UseCaseDslFactory init()\n {\n try\n {\n UseCaseDslFactory theUseCaseDslFactory = (UseCaseDslFactory)EPackage.Registry.INSTANCE.getEFactory(UseCaseDslPackage.eNS_URI);\n if (theUseCaseDslFactory != null)\n {\n return theUseCaseDslFactory;\n }\n }\n catch (Exception exception)\n {\n EcorePlugin.INSTANCE.log(exception);\n }\n return new UseCaseDslFactoryImpl();\n }", "public DataService getDataService()\r\n\t{\r\n\t\treturn dataService;\r\n\t}", "public static DataBaseCreator getInstance() {\r\n if (instance == null) {\r\n synchronized (lock) {\r\n if (instance == null) {\r\n instance = new DataBaseCreator();\r\n }\r\n }\r\n }\r\n\r\n return instance;\r\n }", "public DataSource generateShardingSphereDataSourceFromProxy() {\n Awaitility.await().atMost(5L, TimeUnit.SECONDS).pollInterval(1L, TimeUnit.SECONDS).until(() -> null != getYamlRootConfig().getRules());\n YamlRootConfiguration rootConfig = getYamlRootConfig();\n ShardingSpherePreconditions.checkNotNull(rootConfig.getDataSources(), () -> new IllegalStateException(\"dataSources is null\"));\n ShardingSpherePreconditions.checkNotNull(rootConfig.getRules(), () -> new IllegalStateException(\"rules is null\"));\n if (PipelineEnvTypeEnum.DOCKER == PipelineE2EEnvironment.getInstance().getItEnvType()) {\n DockerStorageContainer storageContainer = ((DockerContainerComposer) containerComposer).getStorageContainers().get(0);\n String sourceUrl = String.join(\":\", storageContainer.getNetworkAliases().get(0), Integer.toString(storageContainer.getExposedPort()));\n String targetUrl = String.join(\":\", storageContainer.getHost(), Integer.toString(storageContainer.getMappedPort()));\n for (Map<String, Object> each : rootConfig.getDataSources().values()) {\n each.put(\"url\", each.get(\"url\").toString().replaceFirst(sourceUrl, targetUrl));\n }\n }\n for (Map<String, Object> each : rootConfig.getDataSources().values()) {\n each.put(\"dataSourceClassName\", \"com.zaxxer.hikari.HikariDataSource\");\n }\n YamlSingleRuleConfiguration singleRuleConfig = new YamlSingleRuleConfiguration();\n singleRuleConfig.setTables(Collections.singletonList(\"*.*\"));\n rootConfig.getRules().add(singleRuleConfig);\n return PipelineDataSourceFactory.newInstance(new ShardingSpherePipelineDataSourceConfiguration(rootConfig));\n }", "private DataSource getDataSource(DataSourceConfig key) {\n\t\tDataSource dataSource = adminService.getComponent(key.getBeanName(), DataSource.class);\n\t\treturn dataSource;\n\t}", "Source createDatasourceOAI(Source ds, Provider prov) throws RepoxException;", "@Bean\n\tpublic DataSourceDao dataSourceDao() {\n\t\tDataSourceDao metadata = new DataSourceDao();\n\t\tmetadata.put(\"rslite\", dsRSLite());\n\t\tmetadata.put(\"rastreosat\", dsRS());\n\t\tmetadata.put(\"entel\", dsEntel());\n\t\tmetadata.put(\"mongo\", dsMongo());\n\t\treturn metadata;\n\t}", "@Bean\r\n public DataSource dataSource() {\r\n String message = messageSource.getMessage(\"begin\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n dataSource.setDriverClassName(propDatabaseDriver);\r\n dataSource.setUrl(propDatabaseUrl);\r\n dataSource.setUsername(propDatabaseUserName);\r\n dataSource.setPassword(propDatabasePassword);\r\n\r\n message = messageSource.getMessage(\"end\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n return dataSource;\r\n }", "public static EpitrelloDataServerice creator() {\n\t\tif(dataServerice == null) {\n\t\t\tdataServerice = new DataService();\n\t\t}\n\t\treturn dataServerice;\n\t}", "public IDataSource createDataSource(String initFileFullPath) throws Exception {\n\r\n\t\tProperties settings = new Properties();\r\n\t\ttry {\r\n\t\t\tFileInputStream sf = new FileInputStream(initFileFullPath);\r\n\t\t\tsettings.load(sf);\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"Exception during loading initialization file\");\r\n\t\t\tlogger.error(ex.toString());\r\n\t\t\tthrow ex;\r\n\t\t}\r\n\t\tString host = settings.getProperty(\"DBHOST\", \"\");\r\n\t\tString dbUser = settings.getProperty(\"USER\");\r\n\t\tString dbPassword = settings.getProperty(\"PWORD\", \"\");\r\n\t\tString sessionType = settings.getProperty(\"SESSIONTYPE\");\r\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\tlogger.info(\"BMIRDataSource args: \"+host+\" \"+dbUser+\" \"+ dbPassword);\r\n\t\tConnection con = DriverManager.getConnection (host, dbUser, dbPassword);\r\n\t\tif (sessionType.equals(\"Outpatient\")) { \r\n\t\t\treturn new BMIROutPatientDataSource(con, initFileFullPath) ;\r\n\t\t} else if (sessionType.equals(\"Inpatient\")) {\r\n\t\t\treturn new BMIRInPatientDataSource(con, initFileFullPath);\r\n\t\t}\r\n\t\telse \r\n\t\t\tlogger.error(\"No valid session type (must be inpatient or outpatient\");\r\n\t\treturn null;\r\n\t}", "Source createDatasourceFtp(Source ds, Provider prov) throws RepoxException;", "public EODataSource queryDataSource();", "@Bean(name=\"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tBasicDataSource dataSource = new BasicDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/elearningforum\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"\");\n\t\tdataSource.addConnectionProperty(\"useUnicode\", \"yes\");\n\t\tdataSource.addConnectionProperty(\"characterEncoding\", \"UTF-8\");\n\t\treturn dataSource;\n\t}", "public static MovieListRemoteDataSource getInstance(){\n if(movieListDataSource == null){\n movieListDataSource = new MovieListRemoteDataSource();\n }\n\n return movieListDataSource;\n }", "public abstract ProductFactory getFactory();", "public static SelectorFactory getInstance() {\n return ServiceFactoryHolder.INSTANCE;\n }", "public static MyTownDatasource getDatasource() {\n return datasource;\n }", "public ObjectifyFactory factory() {\n return ofy().factory();\n }", "public static FunctionConfigurationSource instance() {\n return new IRFutureOptionFunctions().getObjectCreating();\n }", "public static IInputFactory getInputFactory() {\n\n return m_InputFactory;\n\n }", "DataSources retrieveDataSources() throws RepoxException;", "private DataSource initializeDataSourceFromSystemProperty() {\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\n dataSource.setDriverClassName(System.getProperty(PropertyName.JDBC_DRIVER, PropertyDefaultValue.JDBC_DRIVER));\n dataSource.setUrl(System.getProperty(PropertyName.JDBC_URL, PropertyDefaultValue.JDBC_URL));\n dataSource.setUsername(System.getProperty(PropertyName.JDBC_USERNAME, PropertyDefaultValue.JDBC_USERNAME));\n dataSource.setPassword(System.getProperty(PropertyName.JDBC_PASSWORD, PropertyDefaultValue.JDBC_PASSWORD));\n\n return dataSource;\n }" ]
[ "0.7229032", "0.7013469", "0.6851354", "0.68347347", "0.68158644", "0.6457283", "0.6445659", "0.64202166", "0.6401545", "0.63830346", "0.6355555", "0.6337923", "0.63331825", "0.63123626", "0.62879485", "0.61966306", "0.6178744", "0.61766356", "0.6175161", "0.609964", "0.60662234", "0.6051893", "0.6051665", "0.60481757", "0.6044758", "0.60410947", "0.60410225", "0.60410225", "0.6034715", "0.5999163", "0.5987018", "0.59837544", "0.5982601", "0.5955862", "0.59492284", "0.5939348", "0.5933166", "0.5911364", "0.5866602", "0.5855846", "0.58475536", "0.5830408", "0.5814007", "0.58092874", "0.5804812", "0.5798943", "0.5784689", "0.57842296", "0.5782176", "0.5781246", "0.5779695", "0.5777665", "0.5775086", "0.5773824", "0.57727695", "0.57722133", "0.57651305", "0.5762016", "0.57498604", "0.5741936", "0.5729615", "0.57241297", "0.572243", "0.5715596", "0.57113355", "0.57105535", "0.57068086", "0.5694438", "0.5683384", "0.56809676", "0.567369", "0.56735855", "0.5673", "0.566849", "0.56425637", "0.5630582", "0.55990875", "0.5574807", "0.5566776", "0.5558214", "0.5557767", "0.5548342", "0.55442154", "0.5542425", "0.5536764", "0.5532322", "0.5518219", "0.55098885", "0.5501873", "0.5491915", "0.54872906", "0.5485731", "0.54844236", "0.54790586", "0.5475396", "0.54732776", "0.54671437", "0.5458423", "0.5457114", "0.5451357" ]
0.75269145
0
Gets auth public key.
public String getAuthPublicKey() { return authPublicKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getPubkey();", "java.lang.String getPublicEciesKey();", "java.lang.String getPublicKey();", "public String getPublicKey();", "String getPublicKey();", "public PublicKey getPublicKey() {\n return pk;\n }", "public PublicKey getPublicKey() {\n return publicKey;\n }", "public PublicKey getPubKey(){\r\n\t\treturn this.myCert.getPublicKey();\r\n\t}", "OctetString getPublicKey();", "public PublicKey getPublicKey() {\r\n return publicKey;\r\n }", "public String getPublicKey() {\n return publicKey;\n }", "public PublicKey getPublicKey(){\n\t\treturn this.publickey;\n\t}", "public String getPublicKeyIdentifier();", "com.google.protobuf.ByteString\n getPubkeyBytes();", "String publicKey();", "public byte[] getPubKey() {\n return pub.getEncoded();\n }", "public byte[] getPubkey() {\n return pubkey;\n }", "public PublicKey getPublicKey() {\n File keyFile = new File(baseDirectory, pubKeyFileName);\n if (!keyFile.exists()) {\n if (!generateKeys()) {\n return null;\n }\n }\n if (!keyFile.exists()) {\n return null;\n }\n try {\n byte[] bytes = FileUtils.readFileToByteArray(keyFile);\n X509EncodedKeySpec ks = new X509EncodedKeySpec(bytes);\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n PublicKey pub = kf.generatePublic(ks);\n return pub;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "com.google.protobuf.ByteString getPublicKeyBytes();", "com.google.protobuf.ByteString getPublicEciesKeyBytes();", "Object getAuthInfoKey();", "public BigInteger getPublicKey()\n {\n\treturn publicKey;\n }", "public CPubkeyInterface getPubKey() {\n return new SaplingPubKey(this.f12197e.mo42966a(), mo42979b(), false);\n }", "java.lang.String getExtendedPublicKey();", "public ECPoint getPubKeyPoint() {\n return pub.get();\n }", "public Class<PUB> getPublicKeyClass() {\n return pubKeyType;\n }", "public ECP getPublicKGCKey(){return pkS;}", "protected String getKey() {\n\t\treturn makeKey(host, port, transport);\n\t}", "public PrivateKey getKey();", "public java.lang.String getExtendedPublicKey() {\n java.lang.Object ref = extendedPublicKey_;\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 extendedPublicKey_ = s;\n }\n return s;\n }\n }", "public java.lang.String getExtendedPublicKey() {\n java.lang.Object ref = extendedPublicKey_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n extendedPublicKey_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public static PublicKey load3tierTestRootCAPublicKey() {\n return load3tierTestRootCACertificate().getPublicKey();\n }", "public PGPPublicKey getEncryptionKey() {\n\t\tIterator iter = base.getPublicKeys();\n\t\tPGPPublicKey encKey = null;\n\t\twhile (iter.hasNext()) {\n\t\t\tPGPPublicKey k = (PGPPublicKey) iter.next();\n\t\t\tif (k.isEncryptionKey())\n\t\t\t\tencKey = k;\n\t\t}\n\n\t\treturn encKey;\n\t}", "public Key getKey() {\n\t\treturn getKey(settings, url);\n\t}", "public Key getPublicKey(String alias) throws CryptoException {\n\t\treturn getPublicKey(alias, null);\n\t}", "public java.security.PublicKey getPublicKey() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getPublicKey():java.security.PublicKey, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.getPublicKey():java.security.PublicKey\");\n }", "public Key getPublicKey(String alias, String password) throws CryptoException {\n\t\ttry {\n\t\t\tKey key = getPrivateKey(alias, password);\n\t\t\tif (key instanceof PrivateKey) {\n\t // get certificate of public key\n\t Certificate certificate = keystore.getCertificate(alias);\n\t // get public key from the certificate\n\t return certificate.getPublicKey();\n\t\t\t}\t\t\t\n\t\t} catch (KeyStoreException e) {\n\t\t\tlogger.error(\"error accessing the keystore\", e);\n\t\t\tthrow new CryptoException(\"error accessing the keystore\", e);\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "protected PublicKeyInfo getFirstKey() {\n nextKeyToGet = 0;\n return getNextKey();\n }", "public String selectPKAuthKeys(int id) throws SQLException {\n String sql = \"SELECT publickey FROM authenticatedkeys WHERE id_user=?\";\n\n try (Connection conn = this.connect(); PreparedStatement pstmt = conn.prepareStatement(sql)) {\n \n pstmt.setInt(1, id);\n ResultSet rs = pstmt.executeQuery();\n String value = rs.getString(\"publickey\");\n\n return value;\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n return \"\";\n }\n }", "public String getPrivateKey();", "public String getPrivateKey();", "public byte[] getPublicEncoded() throws NoSuchAlgorithmException, InvalidKeySpecException {\n\t\t\n\t\tKey publicKey = getPublic();\n\t\t\n\t\t //Key factory, for key-key specification transformations\n KeyFactory kfac = KeyFactory.getInstance(\"RSA\");\n //Generate plain-text key specification\n RSAPublicKeySpec keyspec = (RSAPublicKeySpec)kfac.getKeySpec(publicKey, RSAPublicKeySpec.class);\n \n\t\tSystem.out.println(\"Public key, RSA modulus: \" +\n\t\t\tkeyspec.getModulus() + \"\\nexponent: \" +\n\t\t\tkeyspec.getPublicExponent() + \"\\n\");\n\t\t\n\t\t//Building public key from the plain-text specification\n\t\t//Key recoveredPublicFromSpec = kfac.generatePublic(keyspec);\n\t\t\n\t\t//Encode a version of the public key in a byte-array\n\t\n\t\tSystem.out.print(\"Public key encoded in \" +\n\t\t_kpair.getPublic().getFormat() + \" format: \");\n\t\tbyte[] encodedPublicKey = _kpair.getPublic().getEncoded();\n\t\t\n\t\tSystem.out.println(Arrays.toString(encodedPublicKey) + \"\\n\");\n\t\t\n\t\tSystem.out.println(\"Length: \" + encodedPublicKey.length);\n\t\treturn encodedPublicKey;\n\t}", "public static RSAPublicKey getPublicKey(String filename)\n\t\t\tthrows IOException, GeneralSecurityException {\n\t\tString publicKeyPEM = getKey(filename);\n\t\treturn getPublicKeyFromString(publicKeyPEM);\n\t}", "public static KeyPair generatePublicKeyPair(){\r\n\t\ttry {\r\n\t\t\tKeyPairGenerator keyGen = KeyPairGenerator.getInstance(publicKeyAlgorithm);\r\n\t\t\tkeyGen.initialize(PUBLIC_KEY_LENGTH, new SecureRandom());\r\n\t\t\treturn keyGen.generateKeyPair();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// should not happen\r\n\t\t\tthrow new ModelException(\"Internal key generation error - \"+publicKeyAlgorithm+\"[\"+PUBLIC_KEY_LENGTH+\"]\",e);\r\n\t\t}\r\n\t}", "public PublicKey GetPublicKey(String filename)\n\t\t\t throws Exception {\n\t\t\t \n\t\t\t File f = new File(filename);\n\t\t\t FileInputStream fis = new FileInputStream(f);\n\t\t\t DataInputStream dis = new DataInputStream(fis);\n\t\t\t byte[] keyBytes = new byte[(int)f.length()];\n\t\t\t dis.readFully(keyBytes);\n\t\t\t dis.close();\n\n\t\t\t X509EncodedKeySpec spec =\n\t\t\t new X509EncodedKeySpec(keyBytes);\n\t\t\t KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n\t\t\t return kf.generatePublic(spec);\n\t\t\t }", "private static PublicKey[] getPublicKeys() {\r\n\t\t\r\n\t\tPublicKey[] publicKeys = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tExternalInformationPortController externalInformationPort = \r\n\t\t\t\tnew ExternalInformationPortController();\r\n\t\t\t\r\n\t\t\texternalInformationPort.initialize();\r\n\t\t\t\r\n\t\t\tInetAddress informationProviderAddress = \r\n\t\t\t\tInetAddress.getByName(\r\n\t\t\t\t\t\tinternalInformationPort.getProperty(\"CASCADE_ADDRESS\")\r\n\t\t\t\t\t\t);\r\n\t\t\t\r\n\t\t\tint informationProviderPort = \r\n\t\t\t\tnew Integer(\r\n\t\t\t\t\t\tinternalInformationPort.getProperty(\"CASCADE_INFO_PORT\")\r\n\t\t\t\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tpublicKeys = \r\n\t\t\t\t(PublicKey[]) externalInformationPort.getInformationFromAll(\r\n\t\t\t\t\t\t\t\t\tinformationProviderAddress,\r\n\t\t\t\t\t\t\t\t\tinformationProviderPort,\r\n\t\t\t\t\t\t\t\t\tInformation.PUBLIC_KEY\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\r\n\t\t} catch (InformationRetrieveException e) {\r\n\t\t\t\r\n\t\t\tLOGGER.severe(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t\t\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\t\r\n\t\t\tLOGGER.severe(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn publicKeys;\r\n\t\t\r\n\t}", "private static PublicKey getPublicKey(String keyStr)\n throws Exception\n {\n return KeyFactory.getInstance(RSA).generatePublic(new X509EncodedKeySpec(Base64.decode(keyStr)));\n }", "@Nullable\n private String getCaptchaPublicKey() {\n return RegistrationToolsKt.getCaptchaPublicKey(mRegistrationResponse);\n }", "public Ed25519PublicKey derivePublicKey() {\r\n\t\tif(this.pubKey==null) {\r\n\t\t\tthis.pubKey = new Ed25519PublicKey(new EdDSAPublicKey(new EdDSAPublicKeySpec(this.key.getA(), this.key.getParams())));\r\n\t\t}\r\n\t\treturn this.pubKey;\r\n\t}", "private static String getAuthorizationKey() {\n\n\t\t// Get valid authentication key from Environment\n\t\tString validAuthKey = AUTHORIZATION_KEY;\n\t\tif (String.valueOf(System.getenv(\"PROCESS_AUTH_KEY\")) != \"null\"){\n\t\t\tvalidAuthKey = String.valueOf(System.getenv(\"PROCESS_AUTH_KEY\"));\n\t\t}\n\n\t\treturn validAuthKey;\n\t}", "@Override\n public PGPPublicKey getPGPPublicKeyById(String id) throws IOException, PGPException {\n // TODO: bring that back after LocalEGA key server becomes able to register itself against Eureka\n // ResponseEntity<Resource> responseEntity =\n // restTemplate.getForEntity(keyServiceURL + \"/pgp/\" + id, Resource.class);\n\n InputStream in = PGPUtil.getDecoderStream(new URL(cegaURL + \"/pgp/\" + id).openStream());\n PGPPublicKeyRingCollection pgpPublicKeyRings = new PGPPublicKeyRingCollection(in, new BcKeyFingerprintCalculator());\n PGPPublicKey pgpPublicKey = null;\n Iterator keyRings = pgpPublicKeyRings.getKeyRings();\n while (pgpPublicKey == null && keyRings.hasNext()) {\n PGPPublicKeyRing kRing = (PGPPublicKeyRing) keyRings.next();\n Iterator publicKeys = kRing.getPublicKeys();\n while (publicKeys.hasNext()) {\n PGPPublicKey key = (PGPPublicKey) publicKeys.next();\n if (key.isEncryptionKey()) {\n pgpPublicKey = key;\n break;\n }\n }\n }\n if (pgpPublicKey == null) {\n throw new IllegalArgumentException(\"Can't find encryption key in key ring.\");\n }\n return pgpPublicKey;\n }", "public String getAppKey() {\n return appKey;\n }", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "com.google.protobuf.ByteString\n getExtendedPublicKeyBytes();", "public interface PublicKey {\n\n /**\n * Returns id of the public key.\n *\n * @return id of key\n */\n String getId();\n\n /**\n * Returns ids from gpg sub keys.\n *\n * @return sub key ids\n * @since 2.19.0\n */\n default Set<String> getSubkeys() {\n return Collections.emptySet();\n }\n\n /**\n * Returns the username of the owner or an empty optional.\n *\n * @return owner or empty optional\n */\n Optional<String> getOwner();\n\n /**\n * Returns raw of the public key.\n *\n * @return raw of key\n */\n String getRaw();\n\n /**\n * Returns the contacts of the publickey.\n *\n * @return owner or empty optional\n */\n Set<Person> getContacts();\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param stream stream of data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n boolean verify(InputStream stream, byte[] signature);\n\n /**\n * Verifies that the signature is valid for the given data.\n *\n * @param data data to verify\n * @param signature signature\n * @return {@code true} if the signature is valid for the given data\n */\n default boolean verify(byte[] data, byte[] signature) {\n return verify(new ByteArrayInputStream(data), signature);\n }\n}", "PrivateKey getPrivateKey();", "public com.google.protobuf.ByteString\n getExtendedPublicKeyBytes() {\n java.lang.Object ref = extendedPublicKey_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n extendedPublicKey_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "boolean hasAuthKey();", "public com.google.protobuf.ByteString\n getExtendedPublicKeyBytes() {\n java.lang.Object ref = extendedPublicKey_;\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 extendedPublicKey_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String accessKey() {\n return this.accessKey;\n }", "protected PublicKey getCAPublicKey(SOAPMessageContext smc) throws Exception {\n Certificate certCA = readCertificateFile(\"/home/dziergwa/Desktop/SD/T_27-project/transporter-ws/src/main/resources/UpaCA.cer\");\n return certCA.getPublicKey();\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-08-13 13:14:15.603 -0400\", hash_original_method = \"9CA51125BBD9928A127E75CF99CB1D14\", hash_generated_method = \"10D7CA0C3FC5B5A6A133BC7DAAF5C8C5\")\n \npublic PublicKey getPublicKey() {\n return subjectPublicKey;\n }", "protected PublicKey getPublicKey(X509Certificate cert) {\n PublicKey pk = null;\n if (cert != null) {\n pk = cert.getPublicKey();\n }\n return pk;\n }", "public static PublicKey getPublicKey(String pubKey) {\n try {\n PemReader pemReader = new PemReader(new StringReader(pubKey));\n byte[] content = pemReader.readPemObject().getContent();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(content);\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n return kf.generatePublic(spec);\n } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException | NullPointerException ex) {\n return getPublicKeyFromNonPem(pubKey);\n }\n }", "private PublicKey getPublicKey(byte[] publicKeyBytes) {\n try {\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes);\n return keyFactory.generatePublic(keySpec);\n } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {\n Log.e(TAG, \"getPublicKey: \" + e.getMessage());\n }\n return null;\n }", "static String getAuth(String key) {\r\n try {\r\n Properties properties = new Properties();\r\n properties.load(new FileInputStream(new File(Run.CREDENTIALS_FILE_NAME)));\r\n\r\n return properties.getProperty(key);\r\n }\r\n catch(IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n return null;\r\n }", "public String getPublicId() {\n\t\treturn mPublicId;\n\t}", "private String key() {\n return \"secret\";\n }", "public static String getKey() {\t\t\n\t\treturn key;\n\t}", "@Test\n public void getPublicKey() throws Exception {\n when(keyStore.getCertificate(KEY_ALIAS)).thenReturn(certificate);\n when(certificate.getPublicKey()).thenReturn(publicKey);\n\n assertThat(keyStoreWrapper.getPublicKey(KEY_ALIAS)).isNotNull();\n }", "private static String shortKey(PublicKey publicKey) {\n return publicKey.toString().substring(publicKey.toString().length() - 4);\n }", "public String selectPKUser(int id) {\n String sql = \"SELECT publickey FROM users WHERE id = ?\";\n\n try (Connection conn = this.connect(); PreparedStatement pstmt = conn.prepareStatement(sql)) {\n pstmt.setInt(1, id);\n ResultSet rs = pstmt.executeQuery();\n String value = rs.getString(\"publickey\");\n return value;\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n return \"\";\n }\n }", "public static RSAPublicKey getPublicKeyFromString(String key)\n\t\t\tthrows IOException, GeneralSecurityException {\n\t\tString publicKeyPEM = key;\n\n\t\t// Remove the first and last lines\n\t\tpublicKeyPEM = publicKeyPEM.replace(\"-----BEGIN PUBLIC KEY-----\", \"\");\n\t\tpublicKeyPEM = publicKeyPEM.replace(\"-----END PUBLIC KEY-----\", \"\");\n\n\t\t// Base64 decode data\n\t\tbyte[] encoded = org.bouncycastle.util.encoders.Base64\n\t\t\t\t.decode(publicKeyPEM);\n\n\t\tKeyFactory kf = KeyFactory.getInstance(\"RSA\");\n\t\tRSAPublicKey pubKey = (RSAPublicKey) kf\n\t\t\t\t.generatePublic(new X509EncodedKeySpec(encoded));\n\t\treturn pubKey;\n\t}", "public String getPinKey() {\r\n return pinKey;\r\n }", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "public String getAPIkey() {\n\t\treturn key1;\r\n\t}", "public String getAccessKey() {\n return properties.getProperty(ACCESS_KEY);\n }", "public static PublicKey getStoredPublicKey(String filePath) {\n PublicKey publicKey = null;\n byte[] keydata = getKeyData(filePath);\n KeyFactory keyFactory = null;\n try {\n keyFactory = KeyFactory.getInstance(ALGORITHM);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n X509EncodedKeySpec encodedPublicKey = new X509EncodedKeySpec(keydata);\n try {\n publicKey = keyFactory.generatePublic(encodedPublicKey);\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }\n return publicKey;\n }", "public String vmAuthKey() {\n return this.vmAuthKey;\n }", "java.lang.String getClientKey();", "String getEncryptionKeyId();", "public String getAccessKey() {\n return cred.getAWSAccessKeyId();\n }", "private void sendPublicKey() {\n PublicKey publicKey = EncryptionUtils.getKeyPair(getApplicationContext()).getPublic();\n String encodedPublicKey = Base64.encodeToString(publicKey.getEncoded(),Base64.URL_SAFE);\n socket.emit(\"public_key\",encodedPublicKey);\n }", "public ECP getPublicEphemeralKey(){return epk;}", "public PublicKey getPublicKey(String keyFilePath) throws Exception {\n\t\tFileInputStream fis = new FileInputStream(keyFilePath);\n\t\tbyte[] encodedKey = new byte[fis.available()];\n\t\tfis.read(encodedKey);\n\t\tfis.close();\n\t\tX509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encodedKey);\n\t\treturn keyFactory.generatePublic(publicKeySpec);\n\t}", "String getPublicKeyActorSend();", "String key();", "public BigInteger getPrivKey() {\n if (priv == null)\n throw new MissingPrivateKeyException();\n return priv;\n }", "public IntegrationRuntimeAuthKeyName keyName() {\n return this.keyName;\n }", "java.lang.String getSubjectKeyID();", "java.lang.String getSubjectKeyID();", "public final String getKey() {\n return key;\n }", "public final String mo1957a() {\n return \"type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey\";\n }", "public static byte[] getKey() {\n return key;\n }", "public String getPublicContext(String key) {\n return getContext(PUBLIC_NAMESPACE, key);\n }", "OpenSSLKey mo134201a();", "private static PublicKey buildPublicKeyFromString(String publicKeyAsString) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException, CertificateException {\n String publicKeyStrWithoutHeaderFooter = publicKeyAsString.\n replaceAll(\"-----BEGIN PUBLIC KEY-----\\n\", \"\").\n replaceAll(\"-----END PUBLIC KEY-----\\n\", \"\").\n replaceAll(\"\\n\", \"\");\n ;\n byte[] publicKeyBytes = Base64.getDecoder().decode(publicKeyStrWithoutHeaderFooter.getBytes(\"UTF-8\"));\n X509EncodedKeySpec spec = new X509EncodedKeySpec(publicKeyBytes);\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n return keyFactory.generatePublic(spec);\n }", "public Pokemon.RequestEnvelop.AuthInfo getAuth() {\n return auth_;\n }" ]
[ "0.81260777", "0.79007024", "0.756101", "0.7528927", "0.7480259", "0.744662", "0.7237488", "0.71802074", "0.71774805", "0.71566796", "0.71349347", "0.71119785", "0.70956296", "0.7021301", "0.70119685", "0.6985481", "0.69282883", "0.68804073", "0.68725514", "0.68526655", "0.6799848", "0.6766509", "0.67036897", "0.6660907", "0.662882", "0.6535358", "0.6454402", "0.64531726", "0.6452603", "0.6451706", "0.6418228", "0.64099735", "0.64038265", "0.63994676", "0.63281095", "0.6296432", "0.6275092", "0.61973023", "0.6186067", "0.6158706", "0.6158706", "0.61404794", "0.61396337", "0.61228323", "0.61192113", "0.6113235", "0.610646", "0.6065696", "0.60586834", "0.60404813", "0.6037566", "0.6014037", "0.60136163", "0.6013563", "0.60037285", "0.60013455", "0.59900725", "0.5986436", "0.5979847", "0.59514934", "0.5941743", "0.5934838", "0.5928047", "0.5925255", "0.59222263", "0.59175795", "0.5911189", "0.58947146", "0.5888632", "0.5884172", "0.5883492", "0.5879037", "0.58503187", "0.5843849", "0.5837758", "0.5837758", "0.5837758", "0.5834958", "0.5806786", "0.57861704", "0.57860696", "0.5778296", "0.57780945", "0.5746152", "0.57445633", "0.5743617", "0.5724741", "0.57210046", "0.5717702", "0.5714307", "0.57063603", "0.57008225", "0.57008225", "0.5680874", "0.56800115", "0.56783444", "0.56438637", "0.5641284", "0.5627012", "0.56258327" ]
0.7917571
1
Get existing layout params for the window
@Override public void onResume() { ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes(); // Assign window properties to fill the parent params.width = WindowManager.LayoutParams.MATCH_PARENT; params.height = WindowManager.LayoutParams.MATCH_PARENT; getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); // Call super onResume after sizing super.onResume(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic StandOutLayoutParams getParams(int id, Window window) {\n\t\treturn new StandOutLayoutParams(id, getWidthParam(),\n\t\t\t\tLayoutParams.MATCH_PARENT, StandOutLayoutParams.LEFT,\n\t\t\t\tStandOutLayoutParams.TOP);\n\t}", "@Override\n\tpublic StandOutLayoutParams getParams(int id, Window window) {\n\n\t\tWindowManager wm = (WindowManager) this\n\t\t\t\t.getSystemService(this.WINDOW_SERVICE);\n\t\tDisplay display = wm.getDefaultDisplay();\n\t\tint width = display.getWidth(); // deprecated\n\t\tint height = display.getHeight(); // deprecated\n\n\t\t// TODO uncomment this code after deubugging\n\t\tint msg_box_height = (int) (height - .5 * height);\n\t\tint msg_box_width = (int) (width - 30);\n\n\t\t// TODO remove after debugging the touch button\n\t\t// int msg_box_height = (int) (100);\n\t\t// int msg_box_width = (int) (100);\n\n\t\treturn new StandOutLayoutParams(id, msg_box_width, msg_box_height,\n\t\t\t\tStandOutLayoutParams.CENTER, StandOutLayoutParams.TOP+200,\n\t\t\t\tmsg_box_width, msg_box_height);\n\t}", "@Override // android.widget.PopupWindow\n public WindowManager.LayoutParams getDecorViewLayoutParams() {\n return this.mWindowLayoutParams;\n }", "public static LinearLayout.LayoutParams getLayoutParams() {\r\n return new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);\r\n }", "@VisibleForTesting\n protected void maybeUpdateLayout() {\n try {\n Object attributes = getWindowAttributes();\n\n int layoutValue =\n attributes.getClass().getDeclaredField(getDisplayCutoutMode()).getInt(null);\n\n attributes.getClass()\n .getDeclaredField(\"layoutInDisplayCutoutMode\")\n .setInt(attributes, layoutValue);\n\n setWindowAttributes(attributes);\n } catch (Exception ex) {\n // API is not available.\n return;\n }\n }", "public LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams();\n }", "protected abstract int getResLayout();", "public Map getLayoutWidgetMappingAsMap()\r\n\t{\r\n\t\tMap lwmMap = new HashMap();\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_WIDGET_ID, widgetId);\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_LAYOUT_ID, layoutId);\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_POSITION, layoutWidgetPosition);\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_BLOCK_POSITION, blockPosition);\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_CLOSED_IND, closedInd);\r\n\t\tlwmMap.put(ViewDefinitionConstants.PARAM_DEFAULT_WIDGET_IND, defaultWidgetInd);// CT_DESIGN_CANVAS\r\n\t\treturn lwmMap;\r\n\t}", "public LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams(-1, -2);\n }", "String getLayout();", "public abstract int getLayoutResources();", "public android.view.ViewGroup.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams layoutParams) {\n return new LayoutParams(layoutParams);\n }", "public Object getLayoutInfo() { return _layoutInfo; }", "public JDialog getParametersWidget(JFrame master);", "public abstract int presentViewLayout();", "public android.view.ViewGroup.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams layoutParams) {\n return new LayoutParams(super.generateLayoutParams(layoutParams));\n }", "public ViewGroup.LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams(-1, -1);\n }", "public android.view.ViewGroup.LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams();\n }", "public android.view.ViewGroup.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams layoutParams) {\n return generateDefaultLayoutParams();\n }", "public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {\n if (layoutParams instanceof LayoutParams) {\n return layoutParams;\n }\n return new LayoutParams(layoutParams);\n }", "public Map getRenderParameterMap(PortletWindow window) {\n Map result = new HashMap();\n int nsSize = RENDER.length() + window.getId().toString().length() + 1;\n for (Iterator iter = pathParams.keySet().iterator(); iter.hasNext();) {\n String name = (String) iter.next();\n if (name.startsWith(RENDER + window.getId())) {\n String paramName = name.substring(nsSize);\n result.put(paramName, pathParams.get(name));\n }\n }\n return result;\n }", "public static String getWindowLayoutAsString(DockingWindow window) {\n return getDockingWindowLayout(window, 0);\n }", "public /* synthetic */ android.view.ViewGroup.LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams();\n }", "protected SpringLayout getLayout() {\n\t\treturn (SpringLayout) window.getContentPane().getLayout();\n\t}", "public final int getLayout() {\n return 2130970726;\n }", "private JPanel getConfigInfo() {\r\n\t\tif (configInfo == null) {\r\n\t\t\tGridBagConstraints gridBagConstraints14 = new GridBagConstraints();\r\n\t\t\tgridBagConstraints14.fill = GridBagConstraints.BOTH;\r\n\t\t\tgridBagConstraints14.gridy = 0;\r\n\t\t\tgridBagConstraints14.weightx = 1.0;\r\n\t\t\tgridBagConstraints14.weighty = 1.0;\r\n\t\t\tgridBagConstraints14.gridx = 0;\r\n\t\t}\r\n\t\treturn configInfo;\r\n\t}", "void restoreLayoutParams(@NonNull ViewGroup.LayoutParams params) {\n params.width = mPreservedParams.width;\n params.height = mPreservedParams.height;\n }", "public ColumnInfo[] getLayout()\n\t{\n\t\treturn m_layout;\n\t}", "public Map<Integer, List<String>> getLayout() {\n return map;\n }", "int getLayoutId();", "public android.view.ViewGroup.LayoutParams generateDefaultLayoutParams() {\n return new LayoutParams(super.generateDefaultLayoutParams());\n }", "DetailsChartLayoutSettings getLayoutSettings() {\n return layoutSettings;\n }", "public void calculateWindow()\n {\n Vector2 windowBottomLeftBounds = new Vector2(1000000, 1000000);\n Vector2 windowTopRightBounds = new Vector2(-1000000, -1000000);\n for (Element<?> e : children())\n {\n if (e.id() != null && (e.id().startsWith(id() + \"hBar\") || e.id().startsWith(id() + \"vBar\")))\n {\n continue;\n }\n for (Element<?> child : e)\n {\n Vector2 alignmentVector = child.alignment().alignmentVector();\n Vector2 bottomLeftBounds = new Vector2(child.x() - (alignmentVector.x * child.width()), child.y()\n - (alignmentVector.y * child.height()));\n Vector2 topRightBounds = new Vector2(bottomLeftBounds.x + child.width(), bottomLeftBounds.y + child.height());\n // left\n if (windowBottomLeftBounds.x > bottomLeftBounds.x)\n {\n windowBottomLeftBounds.x = bottomLeftBounds.x;\n }\n // bottom\n if (windowBottomLeftBounds.y > bottomLeftBounds.y)\n {\n windowBottomLeftBounds.y = bottomLeftBounds.y;\n }\n // right\n if (windowTopRightBounds.x < topRightBounds.x)\n {\n windowTopRightBounds.x = topRightBounds.x;\n }\n // top\n if (windowTopRightBounds.y < topRightBounds.y)\n {\n windowTopRightBounds.y = topRightBounds.y;\n }\n }\n }\n \n content = new CRectangle(windowBottomLeftBounds.x, windowBottomLeftBounds.y, windowTopRightBounds.x - windowBottomLeftBounds.x,\n windowTopRightBounds.y - windowBottomLeftBounds.y);\n content.origin = new Vector2(0, 0);\n \n calculateScrollSize();\n }", "protected abstract\n @LayoutRes\n int getLayoutRes(int position);", "@Override\r\n\tprotected LayoutParams getLayoutParam(int arg0) {\n\t\tLayoutParams params = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT, poiItem.get(number).getPoint(), 0, -height, LayoutParams.BOTTOM_CENTER);\r\n\r\n\t\treturn params;\r\n\t}", "void computeNewLayout();", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "public abstract int getLayoutId();", "public String getPageLayout() {\n\t\treturn layout.getText();\n\t}", "@SuppressWarnings(\"UnnecessaryBoxing\")\r\n private void initLayoutDimensions() {\r\n leftPanelWidth = Page.getScreenWidth() * 20 / 100;\r\n leftPanelHeight = Page.getScreenHeight() - 225;\r\n middlePanelWidth = Page.getScreenWidth() / 2;\r\n if (Double.valueOf(middlePanelWidth) % 2.0 > 0.0) {\r\n middlePanelWidth = middlePanelWidth - 1;\r\n }\r\n rightPanelWidth = Page.getScreenWidth() - (leftPanelWidth + 2 + middlePanelWidth + 2);\r\n }", "@LayoutRes\n protected abstract int getLayoutId();", "public static String getLayout() {\n layout = getProperty(\"layout\");\n if (layout == null) layout = \"dot\";\n return layout;\n }", "public ViewGroup.LayoutParams generateDefaultLayoutParams() {\n return new C17366a(-1, -2);\n }", "private void setupLayout()\n {\n Container contentPane;\n\n setSize(300, 300); \n\n contentPane = getContentPane();\n\n // Layout this PINPadWindow\n }", "public ViewGroup.LayoutParams generateDefaultLayoutParams() {\r\n return new ViewGroup.MarginLayoutParams(-1, -2);\r\n }", "public Map getQueryParameterMap(PortletWindow window) {\n return queryParams;\n }", "public LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {\n return new LayoutParams(p);\n }", "public JPanel getSettingsPanel() {\n\t\t//edgeAttributeHandler.updateAttributeList();\n\t\t// Everytime we ask for the panel, we want to update our attributes\n\t\tTunable attributeTunable = clusterProperties.get(\"attributeList\");\n\t\tattributeArray = getAllAttributes();\n\t\tattributeTunable.setLowerBound((Object)attributeArray);\n\n\t\treturn clusterProperties.getTunablePanel();\n\t}", "public CommonPopWindow loadLayout(@LayoutRes int layoutResId) {\n/* 48 */ this.mLayoutResId = layoutResId;\n/* */ \n/* 50 */ if (this.mLayoutResId != 0) {\n/* 51 */ mContentView = LayoutInflater.from(this.mContext).inflate(this.mLayoutResId, null);\n/* */ }\n/* */ \n/* 54 */ return this;\n/* */ }", "public void initLayouts() {\n\t\tJPanel p_header = (JPanel) getComponentByName(\"p_header\");\n\t\tJPanel p_container = (JPanel) getComponentByName(\"p_container\");\n\t\tJPanel p_tree = (JPanel) getComponentByName(\"p_tree\");\n\t\tJPanel p_commands = (JPanel) getComponentByName(\"p_commands\");\n\t\tJPanel p_execute = (JPanel) getComponentByName(\"p_execute\");\n\t\tJPanel p_buttons = (JPanel) getComponentByName(\"p_buttons\");\n\t\tJPanel p_view = (JPanel) getComponentByName(\"p_view\");\n\t\tJPanel p_info = (JPanel) getComponentByName(\"p_info\");\n\t\tJPanel p_chooseFile = (JPanel) getComponentByName(\"p_chooseFile\");\n\t\tJButton bt_apply = (JButton) getComponentByName(\"bt_apply\");\n\t\tJButton bt_revert = (JButton) getComponentByName(\"bt_revert\");\n\t\tJTextArea ta_header = (JTextArea) getComponentByName(\"ta_header\");\n\t\tJLabel lb_icon = (JLabel) getComponentByName(\"lb_icon\");\n\t\tJLabel lb_name = (JLabel) getComponentByName(\"lb_name\");\n\t\tJTextField tf_name = (JTextField) getComponentByName(\"tf_name\");\n\n\t\tBorder etched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);\n\n\t\tp_header.setBorder(etched);\n\t\tp_container.setBorder(etched);\n\t\tp_commands.setBorder(etched);\n\t\t// p_execute.setBorder(etched);\n\t\t// p_view.setBorder(etched);\n\t\t// p_buttons.setBorder(etched);\n\n\t\tp_buttons.setLayout(new FlowLayout(FlowLayout.LEFT, 25, 2));\n\t\tp_chooseFile.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 1));\n\t\tp_view.setLayout(new BorderLayout(0, 0));\n\t\tp_info.setLayout(null);\n\n\t\t// GroupLayout for main JFrame\n\t\t// If you want to change this, use something like netbeans or read more\n\t\t// into group layouts\n\t\tGroupLayout groupLayout = new GroupLayout(getContentPane());\n\t\tgroupLayout\n\t\t\t\t.setHorizontalGroup(groupLayout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_commands,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t225,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_execute,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t957,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_container,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t957,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_header,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1188,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\t\tgroupLayout\n\t\t\t\t.setVerticalGroup(groupLayout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addComponent(p_header,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, 57,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_commands,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t603,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroupLayout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_container,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t549,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_execute,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t48,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\n\t\tGroupLayout gl_p_container = new GroupLayout(p_container);\n\t\tgl_p_container\n\t\t\t\t.setHorizontalGroup(gl_p_container\n\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_view,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t955,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbt_apply)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbt_revert))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlb_name)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttf_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t893,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\t\tgl_p_container\n\t\t\t\t.setVerticalGroup(gl_p_container\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttf_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lb_name))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addComponent(p_view,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t466, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(\n\t\t\t\t\t\t\t\t\t\t\t\tComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_container\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(bt_revert)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(bt_apply))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap(\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)));\n\t\tp_container.setLayout(gl_p_container);\n\n\t\t// GroupLayout for p_header\n\n\t\tGroupLayout gl_p_header = new GroupLayout(p_header);\n\t\tgl_p_header.setHorizontalGroup(gl_p_header.createParallelGroup(\n\t\t\t\tAlignment.LEADING).addGroup(\n\t\t\t\tAlignment.TRAILING,\n\t\t\t\tgl_p_header\n\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(ta_header, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t1069, Short.MAX_VALUE).addGap(18)\n\t\t\t\t\t\t.addComponent(lb_icon).addGap(4)));\n\t\tgl_p_header\n\t\t\t\t.setVerticalGroup(gl_p_header\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_header\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGap(6)\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_header\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.BASELINE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tta_header,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t44,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(lb_icon))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\t\tp_header.setLayout(gl_p_header);\n\n\t\tGroupLayout gl_p_commands = new GroupLayout(p_commands);\n\t\tgl_p_commands\n\t\t\t\t.setHorizontalGroup(gl_p_commands\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\tgl_p_commands\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tgl_p_commands\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tree,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t211,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_buttons,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE))\n\t\t\t\t\t\t\t\t\t\t.addContainerGap()));\n\t\tgl_p_commands.setVerticalGroup(gl_p_commands.createParallelGroup(\n\t\t\t\tAlignment.LEADING).addGroup(\n\t\t\t\tgl_p_commands\n\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t\t.addComponent(p_buttons, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(p_tree, GroupLayout.DEFAULT_SIZE, 558,\n\t\t\t\t\t\t\t\tShort.MAX_VALUE).addContainerGap()));\n\t\tp_commands.setLayout(gl_p_commands);\n\n\t\tgetContentPane().setLayout(groupLayout);\n\t}", "@Override\n\tpublic java.lang.String getLayout() {\n\t\treturn _scienceApp.getLayout();\n\t}", "@Override\r\n\tpublic void setLayoutParams(LayoutParams params) {\n\t\tparams.width = mBmpWidth;\r\n\t\tparams.height = mBmpHeight;\r\n\t\tsuper.setLayoutParams(params);\r\n\t}", "public Layout getLayout() {\n return this.mLayout;\n }", "public abstract int layoutId();", "protected static Dictionary getWidgetParameters(String widgetId) {\n Dictionary dictionary = Dictionary.getDictionary(widgetId);\n return dictionary;\n }", "@Override\n public JQLayout getLayout()\n {\n return layout;\n }", "public void requestLargeLayout() {\n Dialog dialog = getDialog();\n if (dialog == null) {\n Log.w(getClass().getSimpleName(), \"requestLargeLayout dialog has not init yet!\");\n return;\n }\n Window window = dialog.getWindow();\n if (window == null) {\n Log.w(getClass().getSimpleName(), \"requestLargeLayout window has not init yet!\");\n return;\n }\n FragmentActivity activity = getActivity();\n if (activity != null) {\n float displayWidthInDip = UIUtil.getDisplayWidthInDip(activity);\n float displayHeightInDip = UIUtil.getDisplayHeightInDip(activity);\n int dimensionPixelSize = getResources().getDimensionPixelSize(C4558R.dimen.annotate_dialog_min_width);\n if (displayWidthInDip < displayHeightInDip) {\n displayHeightInDip = displayWidthInDip;\n }\n if (displayHeightInDip < ((float) dimensionPixelSize)) {\n window.setLayout(dimensionPixelSize, -1);\n }\n }\n }", "public Stone[][] getCurrentBoardLayout() {\n \t\tGoCell[][] currentLayout = getCurrentBoard().getBoard();\n \t\tStone[][] newLayout = new Stone[getCurrentBoard().getWidth()][getCurrentBoard().getHeight()];\n \t\tfor (int i = 0; i < getCurrentBoard().getHeight(); i++)\n \t\t\tfor (int j = 0; j < getCurrentBoard().getWidth(); j++)\n \t\t\t\tnewLayout[i][j] = currentLayout[i][j].getContent();\n \t\treturn newLayout;\n \t}", "private void setupWindow() {\n // Some visual tweaks - first, modify window width based on screen dp. Height handled\n // later after the adapter is populated\n WindowManager.LayoutParams params = getWindow().getAttributes();\n DisplayMetrics metrics = getResources().getDisplayMetrics();\n if (isSmallTablet(metrics)) {\n params.width = (metrics.widthPixels * 2 / 3);\n params.height = (metrics.heightPixels * 3 / 5);\n }\n // For phone screens, we won't adjust the window dimensions\n\n // Don't dim the background while the activity is displayed\n params.alpha = 1.0f;\n params.dimAmount = 0.0f;\n\n getWindow().setAttributes(params);\n\n // Set dialog title\n Set<String> preferredLines =\n PreferenceManager.getDefaultSharedPreferences(this).getStringSet(DashTubeExtension.FAVOURITE_LINES_PREF, null);\n setTitle((preferredLines != null && preferredLines.size() > 0)\n ? R.string.expanded_title_filtered\n : R.string.expanded_title);\n\n // Updated time text\n String updatedStr = String.format(getString(R.string.updated_at),\n getIntent().getStringExtra(DashTubeExtension.TUBE_STATUS_TIMESTAMP));\n\n TextView time = (TextView) findViewById(R.id.updated_at);\n time.setText(updatedStr);\n }", "public int onCreateViewLayout() {\n return R.layout.gb_fragment_performance_settings;\n }", "protected IDialogSettings getDialogBoundsSettings() {\n\t\t\t\treturn JavaPlugin.getDefault().getDialogSettingsSection(\"JavadocWizardDialog\"); //$NON-NLS-1$\n\t\t\t}", "public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp) {\n return new ViewGroup.MarginLayoutParams(lp);\n }", "public ArrayList<Tile[]> getLayout() {\r\n\t\treturn layout;\r\n\t}", "public Map<String, NGPackageSpecification<WebLayoutSpecification>> getLayoutSpecifications()\n\t{\n\t\treturn reader.getLayoutSpecifications();\n\t}", "public WindowPanel() {\r\n\t\tsetLayout(null);\r\n\t\t\r\n\t\tIPropertyService svc = ServiceManager.getService();\r\n\t\t\r\n\t\tlXmin = new JLabel(\"XMin:\");\r\n\t\tlXmin.setBounds(10, 10, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lXmin);\r\n\t\t\r\n\t\tlXmax = new JLabel(\"XMax:\");\r\n\t\tlXmax.setBounds(10, 40, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lXmax);\r\n\t\t\r\n\t\tlYmin = new JLabel(\"YMin:\");\r\n\t\tlYmin.setBounds(10, 70, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lYmin);\r\n\t\t\r\n\t\tlYmax = new JLabel(\"YMax:\");\r\n\t\tlYmax.setBounds(10, 100, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lYmax);\r\n\t\t\r\n\t\tsXmin = new JSpinner(new SpinnerNumberModel(-10.0d, -100.0d, 100.0d, 1.0d));\r\n\t\tsXmin.setBounds(60, 10, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sXmin);\r\n\t\tsXmin.addChangeListener((ChangeEvent e) -> svc.setXMin((double) sXmin.getValue()));\r\n\t\t\r\n\t\tsXmax = new JSpinner(new SpinnerNumberModel(10.0d, -100.0d, 100.0d, 1.0d));\r\n\t\tsXmax.setBounds(60, 40, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sXmax);\r\n\t\tsXmax.addChangeListener((ChangeEvent e) -> svc.setXMax((double) sXmax.getValue()));\r\n\t\t\r\n\t\tsYmin = new JSpinner(new SpinnerNumberModel(-10.0d, -100.0d, 100.0d, 1.0d));\r\n\t\tsYmin.setBounds(60, 70, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sYmin);\r\n\t\tsYmin.addChangeListener((ChangeEvent e) -> svc.setYMin((double) sYmin.getValue()));\r\n\t\t\r\n\t\tsYmax = new JSpinner(new SpinnerNumberModel(10.0d, -100.0d, 100.0d, 1.0d));\r\n\t\tsYmax.setBounds(60, 100, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sYmax);\r\n\t\tsYmax.addChangeListener((ChangeEvent e) -> svc.setYMax((double) sYmax.getValue()));\r\n\t\t\r\n\t\tlGridStepX2D = new JLabel(\"Grid step X:\");\r\n\t\tlGridStepX2D.setBounds(120, 10, 100, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lGridStepX2D);\r\n\t\t\r\n\t\tlGridStepY2D = new JLabel(\"Grid step Y:\");\r\n\t\tlGridStepY2D.setBounds(120, 40, 100, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(lGridStepY2D);\r\n\t\t\r\n\t\tsGridStepX2D = new JSpinner(new SpinnerNumberModel(1.0d, 0.125d, 1000.0d, 0.25d));\r\n\t\tsGridStepX2D.setBounds(230, 10, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sGridStepX2D);\r\n\t\tsGridStepX2D.addChangeListener((ChangeEvent e) -> svc.setGridX((double) sGridStepX2D.getValue()));\r\n\t\t\r\n\t\tsGridStepY2D = new JSpinner(new SpinnerNumberModel(1.0d, 0.125d, 1000.0d, 0.25d));\r\n\t\tsGridStepY2D.setBounds(230, 40, 50, ProgramInfo.DEFAULTCOMPONENTHEIGHT);\r\n\t\tadd(sGridStepY2D);\r\n\t\tsGridStepY2D.addChangeListener((ChangeEvent e) -> svc.setGridY((double) sGridStepY2D.getValue()));\r\n\t\t\r\n\t}", "public void setLayoutParams(ViewGroup.LayoutParams layoutParams) {\n super.setLayoutParams(layoutParams);\n try {\n if (this.a == null) {\n com.adincube.sdk.h.c.c c2;\n if (layoutParams == null) {\n c2 = com.adincube.sdk.h.c.c.a;\n } else {\n float f2 = this.k.density;\n int n2 = layoutParams.height;\n if (n2 > 0) {\n n2 = (int)((float)n2 / f2);\n }\n c2 = com.adincube.sdk.h.c.c.a(n2);\n }\n this.b(c2);\n new Object[1][0] = this.a;\n if (this.a == com.adincube.sdk.h.c.c.b) {\n this.setVisibility(0);\n }\n }\n this.c.c();\n this.d.c();\n this.e.c();\n return;\n }\n catch (Throwable throwable) {\n com.adincube.sdk.util.a.c(\"BannerView.setLayoutParams\", new Object[]{throwable});\n ErrorReportingHelper.report(\"BannerView.setLayoutParams\", com.adincube.sdk.h.c.b.b, this.c(), throwable);\n return;\n }\n }", "protected void init(Glk glk, Window oldw, Window neww, int method, int size) {\n \t\tmWaitingForLayout = false;\n \t\t_glk = glk;\n \t\tLinearLayout l = _view = new _View(glk.getContext());\n \t\tfinal PairWindow parent = oldw.getParent();\n \t\tsetParent(parent);\n \t\tif (parent != null)\n \t\t\tparent.mChildren[parent.mChildren[0] == oldw ? 0 : 1] = this;\n \n \t\tint dir = (int) method & Window.WINMETHOD_DIRMASK; \n \t\t\n \t\tswitch (dir) {\n \t\tcase Window.WINMETHOD_ABOVE:\n \t\tcase Window.WINMETHOD_BELOW:\n \t\t\tl.setOrientation(LinearLayout.VERTICAL);\n \t\t\tbreak;\n \t\tcase Window.WINMETHOD_LEFT:\n \t\tcase Window.WINMETHOD_RIGHT:\n \t\tdefault:\n \t\t\tl.setOrientation(LinearLayout.HORIZONTAL);\n \t\t}\n \n \t\tView oldv = oldw.getView();\n \t\tWindow first, second;\n \t\tswitch (dir) {\n \t\tcase Window.WINMETHOD_RIGHT:\n \t\tcase Window.WINMETHOD_BELOW:\n \t\t\tfirst = oldw;\n \t\t\tsecond = neww;\n \t\t\tbreak;\n \t\tcase Window.WINMETHOD_LEFT:\n \t\tcase Window.WINMETHOD_ABOVE:\n \t\tdefault:\n \t\t\tfirst = neww;\n \t\t\tsecond = oldw;\n \t\t}\n \t\t\n \t\t// transfer layout params of the split window to the pair\n \t\tl.setLayoutParams(oldv.getLayoutParams());\n \t\toldv.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, 0));\n \n \t\tViewGroup oldParent = (ViewGroup) oldv.getParent();\n \t\tassert(oldParent != null);\n \t\t\n \t\t// swap the pair in\n \t\tint parentIndex = (oldParent.getChildAt(0) == oldv) ? 0 : 1;\n \t\toldParent.removeView(oldv);\n \t\toldParent.addView(l, parentIndex);\n \t\t\n \t\toldw.setParent(this);\n \t\tneww.setParent(this);\n \t\tmChildren = new Window[] { first, second };\n \t\t\n \t\tl.addView(first.getView());\n \t\tl.addView(second.getView());\n \t\t\n \t\tdoSetArrangement(method, size, neww);\n \t}", "public void layoutAndAssignWindowLayersIfNeeded() {\n this.mWmService.mWindowsChanged = true;\n setLayoutNeeded();\n if (HwPCUtils.isPcCastModeInServer() && HwPCUtils.isValidExtDisplayId(this.mDisplayId)) {\n this.mWmService.updateFocusedWindowLocked(3, false);\n assignWindowLayers(false);\n } else if (!this.mWmService.updateFocusedWindowLocked(3, false)) {\n assignWindowLayers(false);\n }\n this.mInputMonitor.setUpdateInputWindowsNeededLw();\n this.mWmService.mWindowPlacerLocked.performSurfacePlacement();\n this.mInputMonitor.updateInputWindowsLw(false);\n }", "public int getWindowAlignmentOffset() {\n return mLayoutManager.getWindowAlignmentOffset();\n }", "private static List<ViewConfig> getScreenViews(Activity activity) {\n Object globalWindowManager;\n\n globalWindowManager = getFieldValue(\"mGlobal\", activity.getWindowManager());\n Object rootsObj = getFieldValue(\"mRoots\", globalWindowManager);\n Object paramsObj = getFieldValue(\"mParams\", globalWindowManager);\n\n Object[] roots;\n WindowManager.LayoutParams[] params;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n roots = ((List) rootsObj).toArray();\n\n List<WindowManager.LayoutParams> paramsList =\n (List<WindowManager.LayoutParams>) paramsObj;\n params = paramsList.toArray(new WindowManager.LayoutParams[paramsList.size()]);\n } else {\n roots = (Object[]) rootsObj;\n params = (WindowManager.LayoutParams[]) paramsObj;\n }\n\n List<ViewConfig> viewConfigs = fetchViewConfigs(roots, params);\n\n if (isEmpty(viewConfigs)) {\n return Collections.emptyList();\n }\n\n return viewConfigs;\n }", "protected abstract int getFragmentLayout();", "protected abstract int getFragmentLayout();", "protected abstract int getFragmentLayout();", "Board createLayout();", "public abstract\n @LayoutRes\n int getLayoutId();", "@Override\n\t\t\tpublic void onGlobalLayout() {\n\t\t\t\tint [] location = new int[2];\n\t\t\t\tgetLocationOnScreen(location);\n\t\t\t\tif (mWindowMgrParams.y == location[1]) {\n\t\t\t\t\t// is full screen\n\t\t\t\t\tisNotFullScreen = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tisNotFullScreen = true;\n\t\t\t\t}\n\n\t\t\t\t//detect screen orientation change\n\t\t\t\tPoint tempDimension = ScreenUtils.getScreenDimen((Activity) mContext);\n\t\t\t\tif (screendimension.x == tempDimension.y) {\n\t\t\t\t\t//now is in landscape\n\t\t\t\t\tif (currentdimension.x == screendimension.x) {\n\t\t\t\t\t\t// this is the first time that detect screen orientation\n\t\t\t\t\t\t// is changed to landscape\n\t\t\t\t\t\tcurrentdimension = tempDimension;\n\t\t\t\t\t\tonOrientationChanged(ScreenStateListener.ORIENTATION_LANDSCAPE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//now is in portrait\n\t\t\t\t\tif (currentdimension.x != screendimension.x) {\n\t\t\t\t\t\t// this is the first time that screen orientation\n\t\t\t\t\t\t// is recovered from landscape for the first time\n\t\t\t\t\t\tcurrentdimension = tempDimension;\n\t\t\t\t\t\tonOrientationChanged(ScreenStateListener.ORIENTATION_PORTRAIT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void loadPreferences() {\n\t\tVector v = dboxini.getSection(\"WindowState\");\n\t\tif (v != null && v.size() == 1) {\n\t\t\tDimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();\n\n\t\t\tConfigSection wp = (ConfigSection) v.elementAt(0);\n\t\t\tint x = wp.getIntProperty(\"xLoc\",-1);\n\t\t\tint y = wp.getIntProperty(\"yLoc\",-1);\n\t\t\tint w = wp.getIntProperty(\"width\",-1);\n\t\t\tint h = wp.getIntProperty(\"height\",-1);\n\n\t\t\tif (w > -1 && h > -1) {\n\t\t\t\tif (w > scrSize.width) w = scrSize.width;\n\t\t\t\tif (h > scrSize.height) h = scrSize.height;\n\t\t\t\tsetSize(w,h);\n\t\t\t}\n\n\t\t\tDimension winSize = getSize();\n\n\t\t\tif (x > -1 && y > -1) {\n\t\t\t\tif (x + winSize.width > scrSize.width) x = scrSize.width - winSize.width;\n\t\t\t\tif (y + winSize.height > scrSize.height) y = scrSize.height - winSize.height;\n\n\t\t\t\tsetLocation(x,y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tx = (scrSize.width - winSize.width) / 2;\n\t\t\t\ty = (scrSize.height - winSize.height) / 2;\n\n\t\t\t\tint dx = x + winSize.width - scrSize.width;\n\t\t\t\tif (dx > 0)\n\t\t\t\t\tx -= dx;\n\n\t\t\t\tif (x < 0)\n\t\t\t\t\tx = 0;\n\n\t\t\t\tint dy = y + winSize.height - scrSize.height;\n\t\t\t\tif (dy > 0)\n\t\t\t\t\ty -= dy;\n\n\t\t\t\tif (y < 0)\n\t\t\t\t\ty = 0;\n\n\t\t\t\tsetLocation(x,y);\n\t\t\t}\n\t\t}\n\t\t// Otherwise, use the default.\n\t\telse {\n\t\t\tsetSize(800,550);\n\t\n\t\t\tDimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\tDimension winSize = getSize();\n\t\n\t\t\tint x = (scrSize.width - winSize.width) / 2;\n\t\t\tint y = (scrSize.height - winSize.height) / 2;\n\t\n\t\t\tint dx = x + winSize.width - scrSize.width;\n\t\t\tif (dx > 0)\n\t\t\t\tx -= dx;\n\t\n\t\t\tif (x < 0)\n\t\t\t\tx = 0;\n\t\n\t\t\tint dy = y + winSize.height - scrSize.height;\n\t\t\tif (dy > 0)\n\t\t\t\ty -= dy;\n\t\n\t\t\tif (y < 0)\n\t\t\t\ty = 0;\n\t\n\t\t\tsetLocation(x,y);\n\t\t}\n\t}", "public ToolWindowSelector() {\r\n\t\tfinal ImageStack slices = ImageStack.getInstance();\t\t\r\n\t\t\r\n\r\n\t\t// range_max needs to be calculated from the bits_stored value\r\n\t\t// in the current dicom series\r\n\t\tint window_center_min = 0;\r\n\t\tint window_width_min = 0;\r\n\t\tint window_center_max = 1<<(slices.getDiFile(0).getBitsStored());\r\n\t\tint window_width_max = 1<<(slices.getDiFile(0).getBitsStored());\r\n\t\t_window_center = slices.getWindowCenter();\r\n\t\t_window_width = slices.getWindowWidth();\r\n\t\t\r\n\t\t_window_settings_label = new JLabel(\"Window Settings\");\r\n\t\t_window_center_label = new JLabel(\"Window Center:\");\r\n\t\t_window_width_label = new JLabel(\"Window Width:\");\r\n\t\t\r\n\t\t_window_center_slider = new JSlider(window_center_min, window_center_max, _window_center);\r\n\t\t_window_center_slider.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tJSlider source = (JSlider) e.getSource();\r\n\t\t\t\tif (source.getValueIsAdjusting()) {\r\n\t\t\t\t\t_window_center = (int)source.getValue();\r\n//\t\t\t\t\tSystem.out.println(\"_window_center_slider state Changed: \"+_window_center);\r\n\t\t\t\t\tslices.setWindowCenter(_window_center);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\t\t\r\n\t\t\r\n\t\t_window_width_slider= new JSlider(window_width_min, window_width_max, _window_width);\r\n\t\t_window_width_slider.addChangeListener(new ChangeListener() {\r\n\t\t\tpublic void stateChanged(ChangeEvent e) {\r\n\t\t\t\tJSlider source = (JSlider) e.getSource();\r\n\t\t\t\tif (source.getValueIsAdjusting()) {\r\n\t\t\t\t\t_window_width = (int)source.getValue();\r\n//\t\t\t\t\tSystem.out.println(\"_window_width_slider state Changed: \"+_window_width);\r\n\t\t\t\t\tslices.setWindowWidth(_window_width);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tsetLayout(new GridBagLayout());\r\n\t\tGridBagConstraints c = new GridBagConstraints();\r\n\t\tc.weighty = 0.3;\r\n\t\tc.fill = GridBagConstraints.BOTH;\r\n\t\tc.insets = new Insets(2,2,2,2); // top,left,bottom,right\r\n\t\tc.weightx = 0.1;\r\n\t\tc.gridwidth = 2;\r\n\t\tc.gridx = 0; c.gridy = 0; this.add(_window_settings_label, c);\r\n\t\tc.gridwidth=1;\r\n\r\n\t\tc.weightx = 0;\r\n\t\tc.gridx = 0; c.gridy = 1; this.add(_window_center_label, c);\r\n\t\tc.gridx = 0; c.gridy = 2; this.add(_window_width_label, c);\r\n\t\tc.gridx = 1; c.gridy = 1; this.add(_window_center_slider, c);\r\n\t\tc.gridx = 1; c.gridy = 2; this.add(_window_width_slider, c);\r\n\t\t\r\n\r\n\t}", "protected void computeGridParameters() {\n float padding = 0.02f * overlay.getScalingValue();\n boolean flipX = x2 < x1;\n float xx1 = flipX ? (x1 + padding) : (x1 - padding);\n float xx2 = flipX ? (x2 - padding) : (x2 + padding);\n boolean flipY = y2 < y1;\n float yy1 = flipY ? (y1 + padding) : (y1 - padding);\n float yy2 = flipY ? (y2 - padding) : (y2 + padding);\n \n xGrid1 = xx1; yGrid1 = yy1;\n xGrid2 = xx2; yGrid2 = yy1;\n xGrid3 = xx1; yGrid3 = yy2;\n xGrid4 = xx2; yGrid4 = yy2;\n horizGridCount = 3; vertGridCount = 3;\n }", "public boolean checkLayoutParams(android.view.ViewGroup.LayoutParams layoutParams) {\n return layoutParams instanceof LayoutParams;\n }", "Map<Integer, Symbol> getBoardLayout() {\n return tiles.getBoardLayout();\n }", "public static LinearLayout.LayoutParams setParams(Integer width, Integer height) {\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);\n\n params.setMargins(20, 5, 20, 5);\n return params;\n }", "private void initRippleViewLayoutParams() {\n int rippleSide = (int) (2 * (mRippleRadius + mStrokeWidth));\n mRippleViewParams = new LayoutParams(rippleSide, rippleSide);\n // The settings shown in the position of the parent control\n mRippleViewParams.addRule(CENTER_IN_PARENT, TRUE);\n }", "public JPanel getWindow(String key)\r\n\t{\r\n\t\treturn aniWin.getWindow(key);\r\n\t}", "public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {\n return layoutParams instanceof LayoutParams;\n }", "public LayoutParams(@NotNull LinearLayout.LayoutParams layoutParams) {\n super(layoutParams);\n Intrinsics.checkNotNullParameter(layoutParams, \"source\");\n if (layoutParams instanceof LayoutParams) {\n this.a = ((LayoutParams) layoutParams).a;\n }\n }", "private void updateSizeInfo() {\n RelativeLayout drawRegion = (RelativeLayout)findViewById(R.id.drawWindow);\r\n drawW = drawRegion.getWidth();\r\n drawH = drawRegion.getHeight();\r\n getImageFromStorage();\r\n LinearLayout parentWindow = (LinearLayout)findViewById(R.id.parentWindow);\r\n parentWindow.setPadding((drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2, (drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2);\r\n parentWindow.invalidate();\r\n }", "public abstract int getFragmentLayout();", "protected void saveWindowDimensionsIfWindowed() {\n\t\tif(isFullscreen() || isBorderless()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.lastWindowWidth = getWidth();\n\t\tthis.lastWindowHeight = getHeight();\n\t\tthis.lastWindowPosX = getPositionX();\n\t\tthis.lastWindowPosY = getPositionY();\n\t}", "private JPanel getJPanelConfig() {\r\n\t\tif (jPanelConfig == null) {\r\n\t\t\tjLabel8 = new JLabel();\r\n\t\t\tjLabel8.setBounds(new Rectangle(195, 50, 55, 23));\r\n\t\t\tjLabel8.setText(\"字符集:\");\r\n\t\t\tjLabel5 = new JLabel();\r\n\t\t\tjLabel5.setText(\"数据库类型:\");\r\n\t\t\tjLabel5.setBounds(new Rectangle(458, 36, 80, 23));\r\n\t\t\tjLabel4 = new JLabel();\r\n\t\t\tjLabel4.setBounds(new Rectangle(10, 82, 52, 23));\r\n\t\t\tjLabel4.setText(\"密码:\");\r\n\t\t\tjLabel3 = new JLabel();\r\n\t\t\tjLabel3.setBounds(new Rectangle(10, 50, 59, 23));\r\n\t\t\tjLabel3.setText(\"用户名:\");\r\n\t\t\tjLabel2 = new JLabel();\r\n\t\t\tjLabel2.setBounds(new Rectangle(10, 18, 80, 23));\r\n\t\t\tjLabel2.setText(\"数据库链接:\");\r\n\t\t\tjLabel = new JLabel();\r\n\t\t\tjLabel.setBounds(new Rectangle(10, 115, 59, 23));\r\n\t\t\tjLabel.setText(\"导入表:\");\r\n\t\t\tjPanelConfig = new JPanel();\r\n\t\t\tjPanelConfig.setLayout(null);\r\n\t\t\tjPanelConfig.setBorder(BorderFactory.createTitledBorder(null, \" 入库配置 \"));\r\n\t\t\tjPanelConfig.setBounds(new Rectangle(7, 253, 652, 260));\r\n\t\t\tjPanelConfig.add(getJScrollPaneDbTable(), null);\r\n\t\t\tjPanelConfig.add(jLabel, null);\r\n\t\t\tjPanelConfig.add(jLabel2, null);\r\n\t\t\tjPanelConfig.add(jLabel3, null);\r\n\t\t\tjPanelConfig.add(jLabel4, null);\r\n\t\t\tjPanelConfig.add(getJTextFieldUser(), null);\r\n\t\t\tjPanelConfig.add(getJTextFieldPasswd(), null);\r\n\t\t\tjPanelConfig.add(getJComboBoxConStr(), null);\r\n\t\t\tjPanelConfig.add(getJButtonConnect(), null);\r\n\t\t\tjPanelConfig.add(getJScrollPaneTables(), null);\r\n\t\t\tjPanelConfig.add(getJButtonDiscnnt(), null);\r\n\t\t\tjPanelConfig.add(jLabel8, null);\r\n\t\t\tjPanelConfig.add(getJTextFieldDbCharset(), null);\r\n\t\t}\r\n\t\treturn jPanelConfig;\r\n\t}", "int getWindowSize();", "@Override // android.view.ViewGroup\n public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {\n if (layoutParams instanceof C17366a) {\n return new C17366a((C17366a) layoutParams);\n }\n if (layoutParams instanceof ViewGroup.MarginLayoutParams) {\n return new C17366a((ViewGroup.MarginLayoutParams) layoutParams);\n }\n return new C17366a(layoutParams);\n }", "protected void createLayout() {\n\t\tthis.layout = new GridLayout();\n\t\tthis.layout.numColumns = 2;\n\t\tthis.layout.marginWidth = 2;\n\t\tthis.setLayout(this.layout);\n\t}", "private void initLayouts() {\n mRelativeLayout1WA = findViewById(R.id.history_layout_one_week_ago);\n mRelativeLayout6DA = findViewById(R.id.history_layout_six_days_ago);\n mRelativeLayout5DA = findViewById(R.id.history_layout_five_days_ago);\n mRelativeLayout4DA = findViewById(R.id.history_layout_four_days_ago);\n mRelativeLayout3DA = findViewById(R.id.history_layout_three_days_ago);\n mRelativeLayout2DA = findViewById(R.id.history_layout_two_days_ago);\n mRelativeLayoutY = findViewById(R.id.history_layout_yesterday);\n\n layoutsList.add(mRelativeLayoutY);\n layoutsList.add(mRelativeLayout2DA);\n layoutsList.add(mRelativeLayout3DA);\n layoutsList.add(mRelativeLayout4DA);\n layoutsList.add(mRelativeLayout5DA);\n layoutsList.add(mRelativeLayout6DA);\n layoutsList.add(mRelativeLayout1WA);\n\n }", "public JPanel buildProjectProperties()\n\t{\n\t\tprojectProperties.setPreferredSize(new Dimension(200, 190)); //Set the size of the window\n \tprojectProperties.setBorder (projectTitle); //Add a border around the window\n \t\n \treturn projectProperties;\n\t}", "public void setLayoutNeeded() {\n if (WindowManagerDebugConfig.DEBUG_LAYOUT) {\n Slog.w(TAG, \"setLayoutNeeded: callers=\" + Debug.getCallers(3));\n }\n this.mLayoutNeeded = true;\n }", "public abstract int layoutWidth();", "protected abstract void iniciarLayout();", "GridBagLayoutCalc(){\n\n windowContent = new JPanel();\n\n // Set the layout manager for this panel\n GridBagLayout gblwc = new GridBagLayout();\n windowContent.setLayout(gblwc);\n\n\n // Create the display field and place it in the\n // North area of the window\n\n displayField = new JTextField(20);\n gblwc.setConstraints(displayField, constr);\n windowContent.add(\"0\",displayField);\n \n\n // Create buttons using constructor of the\n // class JButton that takes the label of the\n // button as a parameter\n\n JButton[] numbers = new JButton[10];\n JButton[] equals = new JButton[1];\n JButton[] controllers = new JButton[4];\n\n String[] numbers_name = {\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"};\n String[] equals_name = {\"=\"};\n String[] controllers_name = {\"+\", \"-\", \"*\", \"/\"};\n\n // Create the panel with the GridBagLayout with 15 buttons\n //10 numeric ones, 4 controllers, and the equal sign\n\n p1 = new JPanel();\n GridBagLayout gbl =new GridBagLayout();\n p1.setLayout(gbl);\n\n // Add window controls to the panel p1\n panelMaker(numbers, numbers_name, p1, Color.BLUE);\n panelMaker(equals, equals_name, p1, Color.BLACK);\n panelMaker(controllers, controllers_name, p1, Color.BLACK);\n\n }", "public String getLayoutId()\r\n\t{\r\n\t\treturn layoutId;\r\n\t}" ]
[ "0.6893923", "0.66737777", "0.6498515", "0.64426744", "0.6115523", "0.60821146", "0.60421306", "0.591658", "0.589864", "0.58975166", "0.5895757", "0.5890181", "0.5873777", "0.5861733", "0.5829254", "0.5776819", "0.57729596", "0.57729584", "0.5771402", "0.57567763", "0.5738204", "0.5736143", "0.56966656", "0.5686964", "0.56276983", "0.5593313", "0.55650073", "0.5522568", "0.55197686", "0.5515718", "0.55135304", "0.5507156", "0.5478649", "0.5475236", "0.5440619", "0.5401479", "0.5395674", "0.5395674", "0.5395674", "0.53798246", "0.537733", "0.53715616", "0.53701913", "0.5370062", "0.5356722", "0.5294797", "0.52881736", "0.52756417", "0.5253408", "0.5246476", "0.5239251", "0.52390283", "0.5226946", "0.5215991", "0.52088743", "0.52025795", "0.5192244", "0.51787055", "0.51741743", "0.517178", "0.5156299", "0.51464653", "0.51445645", "0.51194334", "0.5118559", "0.5118321", "0.5110779", "0.5109509", "0.51016855", "0.509162", "0.508996", "0.5087152", "0.5087152", "0.5087152", "0.5085228", "0.50849134", "0.508344", "0.50765145", "0.507447", "0.50740445", "0.5072992", "0.5037323", "0.50272757", "0.50122863", "0.50046563", "0.5003342", "0.50017416", "0.5001105", "0.4997257", "0.4972418", "0.49572638", "0.49418694", "0.49417603", "0.49408665", "0.49392292", "0.49379987", "0.49335024", "0.49297327", "0.49271017", "0.4924058", "0.49164334" ]
0.0
-1
Konstruktor dari Class PremiumRoom
public PremiumRoom(Hotel hotel, String nomor_kamar) { super(hotel, nomor_kamar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Room getRoom();", "Room getRoom();", "public Room getRoom()\r\n {\r\n return room;\r\n }", "public Room getStartRoom(){\n return startRoom;\n }", "public Room getLocalisation(){return this.aLocalisation;}", "public Room getRoom0(){\n return basement;\n }", "private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }", "private static void performRoomManagement() {\n\t\t\r\n\t\t\r\n\r\n\t}", "Room mo12151c();", "public void updatePremiumRoomId(Long premiumId, Integer roomId);", "public SingleRoom(Hotel hotel, String nomor_kamar)\n {\n // initialise instance variables\n super(hotel,nomor_kamar);\n\n }", "public String getRoom() {\r\n return room;\r\n }", "PlayerInRoomModel createPlayerInRoomModel(PlayerInRoomModel playerInRoomModel);", "RoomInfo room(String name);", "private Room createRooms(){\n Room inicio, pasilloCeldas, celdaVacia1,celdaVacia2, pasilloExterior,vestuarioGuardias, \n comedorReclusos,enfermeria,ventanaAbierta,salidaEnfermeria,patioReclusos,tunelPatio,salidaPatio;\n\n Item mochila,medicamentos,comida,itemInutil,itemPesado;\n mochila = new Item(\"Mochila\",1,50,true,true);\n medicamentos = new Item(\"Medicamentos\",5,10,true,false);\n comida = new Item(\"Comida\",2,5,true,false);\n itemInutil = new Item(\"Inutil\",10,0,false,false);\n itemPesado = new Item(\"Pesas\",50,0,false,false);\n\n // create the rooms\n inicio = new Room(\"Tu celda de la prision\");\n pasilloCeldas = new Room(\"Pasillo donde se encuentan las celdas\");\n celdaVacia1 = new Room(\"Celda vacia enfrente de la tuya\");\n celdaVacia2 = new Room(\"Celda de tu compaņero, esta vacia\");\n pasilloExterior = new Room(\"Pasillo exterior separado de las celdas\");\n vestuarioGuardias = new Room(\"Vestuario de los guardias de la prision\");\n comedorReclusos = new Room(\"Comedor de reclusos\");\n enfermeria = new Room(\"Enfermeria de la prision\");\n ventanaAbierta = new Room(\"Saliente de ventana de la enfermeria\");\n salidaEnfermeria = new Room(\"Salida de la prision por la enfermeria\");\n patioReclusos = new Room(\"Patio exterior de los reclusos\");\n tunelPatio = new Room(\"Tunel escondido para escapar de la prision\");\n salidaPatio = new Room(\"Salida de la prision a traves del tunel del patio\");\n\n // initialise room items\n\n comedorReclusos.addItem(\"Comida\",comida);\n enfermeria.addItem(\"Medicamentos\",medicamentos);\n pasilloCeldas.addItem(\"Inutil\",itemInutil);\n patioReclusos.addItem(\"Pesas\",itemPesado);\n vestuarioGuardias.addItem(\"Mochila\",mochila);\n\n // initialise room exits\n\n inicio.setExits(\"east\", pasilloCeldas);\n pasilloCeldas.setExits(\"north\",pasilloExterior);\n pasilloCeldas.setExits(\"east\",celdaVacia1);\n pasilloCeldas.setExits(\"south\",patioReclusos);\n pasilloCeldas.setExits(\"west\",inicio);\n pasilloCeldas.setExits(\"suroeste\",celdaVacia2);\n celdaVacia1.setExits(\"west\", pasilloCeldas);\n pasilloExterior.setExits(\"north\",comedorReclusos);\n pasilloExterior.setExits(\"west\",enfermeria);\n pasilloExterior.setExits(\"east\",vestuarioGuardias);\n comedorReclusos.setExits(\"south\", pasilloExterior);\n enfermeria.setExits(\"east\",pasilloExterior);\n enfermeria.setExits(\"south\", ventanaAbierta);\n ventanaAbierta.setExits(\"north\",enfermeria);\n ventanaAbierta.setExits(\"south\", salidaEnfermeria);\n patioReclusos.setExits(\"north\", pasilloCeldas);\n patioReclusos.setExits(\"east\", tunelPatio);\n tunelPatio.setExits(\"east\",salidaPatio);\n tunelPatio.setExits(\"west\", patioReclusos);\n // casilla de salida\n\n return inicio;\n }", "public Room getRoom(){\n\t\treturn this.room;\n\t}", "public void onRoomLoad() {\n\n }", "public void populateRooms(){\n }", "private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }", "public int getRoom(){\n\t\treturn room;\n\t}", "public Room getRoom()\n {\n return currentRoom;\n }", "public Room (String number, int seatingCapacity, String roomT){\r\n this.number = number;\r\n this.seatingCapacity = seatingCapacity;\r\n this.roomType= roomT;\r\n }", "public Room createRoom(Room room);", "public MyRoom() {\r\n }", "public Room getMyRoom() {\n return this.myRoom;\n }", "public String getRoom() {\n\t\treturn room;\n\t}", "public abstract String getRoomName();", "public Room() {\n this.isTable = false;\n this.hasStage = false;\n this.hasTech = false;\n }", "public RoomPrice getRoomPrice(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomprice.v1.RoomPrice res){\n\t\tRoomPrice roomPrice = new RoomPrice();\n\t\t\n\t\t//setting two more new fields to hold hotelCost and transfer cost\n\t\troomPrice.setHotelCost(res.getHotelCost());\n\t\troomPrice.setTransferCost(res.getTransferCost());\n\t\t\n\t\t\n\t\troomPrice.setCurrency( res.getCurrency() );\n\t\troomPrice.setGuestAllocation( res.getGuestAllocation() );\n\t\tif( res.getHotelId() != null ){\n\t\t\troomPrice.setHotelId( res.getHotelId() );\n\t\t}\n\t\tif( res.getRoomCategoryId() != null ){\n\t\t\troomPrice.setRoomCategoryId( res.getRoomCategoryId().intValue() );\n\t\t}\n\t\tif( res.getFreeNights() != null ){\n\t\t\troomPrice.setFreeNights( res.getFreeNights().intValue() );\n\t\t}\n\t\tif( res.getRoomId() != null ){\n\t\t\troomPrice.setRoomId( res.getRoomId().byteValue() );\n\t\t}\n\t\tif( res.isPriceChanged() != null ){\n\t\t\troomPrice.setPriceChanged( res.isPriceChanged().booleanValue() );\n\t\t}\n\t\tif( res.getPromoSavingsAmount() != null ){\n\t\t\troomPrice.setPromoSavingsAmount( res.getPromoSavingsAmount().doubleValue() );\n\t\t}\n\t\tif( res.getSavings() != null ){\n\t\t\troomPrice.setSavings( res.getSavings().doubleValue() );\n\t\t}\n\t\tif( res.getTotalAmount() != null ){\n\t\t\troomPrice.setTotalAmount( res.getTotalAmount().doubleValue() );\n\t\t}\n\t\tif( res.getTax() != null ){\n\t\t\troomPrice.setTax( res.getTax().doubleValue() );\n\t\t}\n\t\tif( res.getCommissionAmount() != null ){\n\t\t\troomPrice.setCommissionAmount( res.getCommissionAmount().doubleValue() );\n\t\t}\n\t\tif( res.getCommissionPercent() != null ){\n\t\t\troomPrice.setCommissionPercent( res.getCommissionPercent().doubleValue() );\n\t\t}\n\t\tif( res.getLateFee() != null ){\n\t\t\troomPrice.setLateFee( res.getLateFee().doubleValue() );\n\t\t}\n\t\tif( res.getPackagePrice() != null ){\n\t\t\troomPrice.setPackagePrice( res.getPackagePrice().doubleValue() );\n\t\t}\n\t\tif( res.getPerAdultBasePrice() != null ){\n\t\t\troomPrice.setPerAdultBasePrice( res.getPerAdultBasePrice().doubleValue() );\n\t\t}\n\t\tif( res.getPerAdultBasePriceSavings() != null ){\n\t\t\troomPrice.setPerAdultBasePriceSavings( res.getPerAdultBasePriceSavings().doubleValue() );\n\t\t}\n\t\tif( res.getPaxBasePrices() != null ){\n\t\t\troomPrice.setPaxBasePrices( this.getPaxTypeBasePrices( res.getPaxBasePrices() ) );\n\t\t}\n\t\tif( (res.getPaxTypePriceBreakups() != null) && (res.getPaxTypePriceBreakups().size() > 0) ){\n\t\t\tList<PaxTypePriceBreakup> paxTypePriceBreakups = new ArrayList<PaxTypePriceBreakup>();\n\t\t\tfor(int i=0; i < res.getPaxTypePriceBreakups().size(); i++){\n\t\t\t\tif( res.getPaxTypePriceBreakups().get(i) != null )\n\t\t\t\tpaxTypePriceBreakups.add( this.getPaxTypePriceBreakup( res.getPaxTypePriceBreakups().get(i) ) );\n\t\t\t}\n\t\t\troomPrice.setPaxTypePriceBreakups(paxTypePriceBreakups);\n\t\t}\n\t\tif(res.getInitialPrice()!=null)\n\t\t{\n\t\troomPrice.setInitialPrice(this.getInitialRoomPrice(res.getInitialPrice()) );\n\t\t}\n\t\t\n\t\treturn roomPrice;\n\t}", "private void playerReserve(String promoCode, String username)\n {\n\n Reservation myReservation = new Reservation(username,reservationStartsOn,reservationEndsOn,pitch.getVenueID(),pitch.getPitchName(),promoCode);\n connectionManager.reserve(myReservation, instance);\n }", "public Room(String roomName) {\n guests = new ArrayList<>();\n roomTier = null;\n this.roomName = roomName;\n this.roomId = RoomId.generate(roomName);\n }", "public Room getRoom() {\n return currentRoom;\n }", "ItcRoom()\r\n\t {\t }", "public void setRmTable(Rooms value);", "private void createRooms()\n {\n Room outside, theatre, pub, lab, office , hallway, backyard,chickenshop;\n \n // create the rooms\n outside = new Room(\"outside the main entrance of the university\");\n theatre = new Room(\"in a lecture theatre\");\n pub = new Room(\"in the campus pub\");\n lab = new Room(\"in a computing lab\");\n office = new Room(\"in the computing admin office\");\n hallway=new Room (\"in the hallway of the university\");\n backyard= new Room( \"in the backyard of the university\");\n chickenshop= new Room(\"in the chicken shop\");\n \n \n \n // initialise room exits\n outside.setExit(\"east\", theatre);\n outside.setExit(\"south\", lab);\n outside.setExit(\"west\", pub);\n\n theatre.setExit(\"west\", outside);\n theatre.setExit(\"north\", backyard);\n\n pub.setExit(\"east\", outside);\n\n lab.setExit(\"north\", outside);\n lab.setExit(\"east\", office);\n \n office.setExit(\"south\", hallway);\n office.setExit(\"west\", lab);\n \n chickenshop.setExit(\"west\", lab);\n\n currentRoom = outside; // start game outside\n \n }", "abstract void classRooms();", "public Bedroom(int number, int capacity , TypesOfBedrooms type, int nightlyrate) {\n super(capacity);\n this.number = number;\n this.type = type;\n this.nightlyrate = nightlyrate;\n this.guests = new ArrayList<Guest>();\n }", "public String getRoomType() {\n\t\treturn \"class room\";\n\t}", "public Player(Playground_Registration pgr) {\n this.pgr = pgr;\n pgr.setPName(\"barca\");\n System.out.println(pgr.getPName());\n pgr.setLocation(\"naser city\");\n System.out.println(pgr.getLocation());\n pgr.setSize(5);\n System.out.println(pgr.getSize());\n pgr.setAvailable_Hour(3);\n System.out.println(pgr.getAvailable_Hour());\n pgr.setPrice_Of_hour(120);\n System.out.println(pgr.getPrice_Of_hour());\n pgr.setPlayground_Status(\"available\");\n System.out.println(pgr.getPlayground_Status());\n pgr.setCancelation_Perioud(\"\");\n System.out.println(pgr.getCancelation_Perioud());\n System.out.println(\"i want to book this play ground\");\n\n }", "public ViewRoom(Customer cust,Room r, int wrkNum) {\n initComponents();\n this.room = r;\n this.workoutNum = wrkNum;\n customer = cust;\n updateRoom();\n \n }", "public String getRoomno() {\n return roomno;\n }", "private void createRooms()\n {\n // create the rooms\n prison = new Room(\"Prison\", \"Prison. You awake in a cold, dark cell. Luckily, the wall next to you has been blown open. \\nUnaware of your current circumstances, you press on... \\n\");\n promenade = new Room(\"Promenade\",\"Promenade. After stumbling upon a ladder, you decided to climb up. \\n\" + \n \"You appear outside a sprawling promenade. There appears to be something shiny stuck in the ground... \\n\");\n sewers = new Room(\"Sewers\",\"Sewers. It smells... interesting. As you dive deeper, you hear something creak\");\n ramparts = new Room(\"Ramparts\", \"Ramparts. You feel queasy as you peer down below. \\nAs you make your way along, you're greated by a wounded soldier.\" +\n \"\\nIn clear agony, he slowly closes his eyes as he says, 'the king... ki.. kil... kill the king..' \\n\");\n depths = new Room(\"Depths\", \"Depths. You can hardly see as to where you're going...\" + \"\\n\");\n ossuary = new Room(\"Ossuary\", \"Ossuary. A chill runs down your spine as you examine the skulls... \\n\" +\n \"but wait... is.. is one of them... moving? \\n\" +\"\\n\" + \"\\n\" + \"There seems to be a chest in this room!\" + \"\\n\");\n bridge = new Room(\"Bridge\", \"Bridge. A LOUD SHREIK RINGS OUT BEHIND YOU!!! \\n\");\n crypt = new Room(\"Crypt\", \"Crypt. An eerire feeling begins to set in. Something about this place doesn't seem quite right...\" + \"\\n\");\n graveyard = new Room(\"Graveyard\", \"Graveyard. The soil looks rather soft. \\n\" +\n \"As you being to dive deeper, you begin to hear moans coming from behind you...\");\n forest = new Room(\"Forest\", \"Forest. It used to be gorgeous, and gleaming with life; that is, until the king came...\" + \"\\n\" +\n \"there's quite a tall tower in front of you... if only you had something to climb it.\" + \"\\n\");\n tower = new Room(\"Tower\", \"Tower. As you look over the land, you're astounded by the ruin and destruction the malice and king have left behind. \\n\");\n castle = new Room(\"Castle\", \"Castle. Used to be the most elegant and awe-inspiring building in the land. \\n\" +\n \"That is, before the king showed up... \\n\" +\n \"wait... is that... is that a chest? \\n\");\n throneRoomEntrance = new Room(\"Throne Entrance\", \"You have made it to the throne room entrance. Press on, if you dare.\");\n throne = new Room(\"Throne Room\", \"You have entered the throne room. As you enter, the door slams shut behind you! \\n\" +\n \"Before you stands, the king of all malice and destruction, Mr. Rusch\" + \"\\n\");\n deathRoom1 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom2 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom3 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom4 = new Room(\"Death Room\", \"depths of the earth... well part of you at least.\" + \"\\n\" + \"You fell off the peaks of the castle to your untimely death\");\n \n // initialise room exits\n\n currentRoom = prison; // start game outside player.setRoom(currentRoom);\n player.setRoom(currentRoom);\n \n }", "public Room getRoom() {\n\t\treturn super.getRoom();\n\t}", "public Premium() {\r\n\t\titemName = \"Premium\";\r\n\t\titemPrice = 100;\r\n\t\tcount = 10;\r\n\t}", "@Override\n\tpublic void onRoomCreated(RoomData arg0) {\n\t\t\n\t}", "public void createRooms()\n {\n Room outside,bedroom, bathroom, hallway1, hallway2, spareroom, kitchen, fridge;\n\n // create the rooms\n bedroom = new Room(\"Bedroom\", \"your bedroom. A simple room with a little bit too much lego\");\n bathroom = new Room(\"Bathroom\", \"the bathroom where you take your business calls. Also plenty of toilet paper\");\n hallway1 = new Room(\"Hallway1\", \"the hallway outside your room, there is a dog here blocking your path. Youll need to USE something to distract him\");\n hallway2 = new Room(\"Hallway2\", \"the same hallway? This part leads to the spare room and kitchen\");\n spareroom = new Room(\"Spare room\", \"the spare room. This is for guests\");\n kitchen = new Room(\"Kitchen\", \"your kitchen. There is a bowl with cereal in it waiting for you,But its still missing some things\");\n fridge = new Room (\"Walk in Fridge\", \"a walkin fridge. Have you ever seen Ratatouille? Its like that\");\n outside = new Room(\"Outside\", \"the outside world, breathe it in\");\n \n \n Item toiletPaper, milk, spoon, poison;// creates the items and sets their room\n \n toiletPaper = new Item(\"Toilet-Paper\", hallway1);\n toiletPaper.setDescription(\"Just your standard bog roll. Dont let your dog get a hold of it\");\n bathroom.setItems(\"Toilet-Paper\",toiletPaper);\n \n milk = new Item(\"Milk\", kitchen);\n milk.setDescription(\"white and creamy, just like mama used to make\");\n fridge.setItems(\"Milk\", milk);\n \n spoon = new Item(\"Spoon\", kitchen);\n spoon.setDescription(\"Like a fork but for liquids\");\n spareroom.setItems(\"Spoon\", spoon);\n \n poison = new Item(\"Poison\", outside);\n poison.setDescription(\"This will probably drain all of your energy, dont USE it\");\n outside.setItems(\"Poison\", poison);\n \n // initialise room exits\n bedroom.setExit(\"east\", bathroom);\n bedroom.setExit(\"north\", hallway1);\n \n bathroom.setExit(\"west\", bedroom);\n \n hallway1.setExit(\"south\", bedroom);\n hallway1.setExit(\"north\", hallway2);\n \n hallway2.setExit(\"south\", hallway1);\n hallway2.setExit(\"west\", spareroom);\n hallway2.setExit(\"north\", kitchen);\n \n spareroom.setExit(\"east\", hallway2);\n \n kitchen.setExit(\"east\", outside);\n kitchen.setExit(\"west\", fridge);\n \n fridge.setExit(\"east\", kitchen);\n \n \n outside.setExit(\"west\", kitchen);\n \n\n this.currentRoom = bedroom; // start game in bedroom\n \n }", "public int getRoomNum() {\n return roomNum;\n }", "void opponentInRoom();", "@Override\n\tpublic int getNumberOfRooms() {\n\t\treturn 0;\n\t}", "RoomInfo room(int id);", "public static void addNewRoom() {\n Services room = new Room();\n room = addNewService(room);\n\n ((Room) room).setFreeService(FuncValidation.getValidFreeServices(ENTER_FREE_SERVICES,INVALID_FREE_SERVICE));\n\n //Get room list from CSV\n ArrayList<Room> roomList = FuncGeneric.getListFromCSV(FuncGeneric.EntityType.ROOM);\n\n //Add room to list\n roomList.add((Room) room);\n\n //Write room list to CSV\n FuncReadWriteCSV.writeRoomToFileCSV(roomList);\n System.out.println(\"----Room \"+room.getNameOfService()+\" added to list---- \");\n addNewServices();\n\n }", "public Room(int id, int roomNumber, int persons, int days){\n this.id = id;\n this.roomNumber = roomNumber;\n this.persons = persons;\n this.days = days;\n available = false; //default value, assignment not necessary\n }", "public String getRoomnumber() {\r\n return roomnumber;\r\n }", "public interface OptionsProvider {\n void reqRooms(String room_name, String date, String floor, String stime, String etime, String capacity, String proom,int msp, OnRoomsReceived onRoomsReceived);\n}", "public Room room() {\r\n\t\treturn this.room;\r\n\t}", "public ViewRoom(Room r) {\n initComponents();\n this.room = r;\n this.workoutNum = 0;\n updateRoom();\n \n }", "Classroom() {}", "public Room getDoorRoom()\n {\n return room;\n }", "public void createRoom(LoadingDialog load, String code, String nickname, DataSnapshot roomToHaveAccess) {\n DatabaseReference roomRef = firebaseDatabase.getReference(ROOMS_NODE + \"/\" + code);\n room = new Room(nickname,EMPTY_STRING,0,0,0,0,0,0,false,0,0,0,0,0,3);\n\n roomRef.setValue(room, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n ref.child(PLAYER2_NODE).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot fieldPlayer2) {\n if(fieldPlayer2.getValue() != null){\n if(! fieldPlayer2.getValue().equals(EMPTY_STRING)){\n // il giocatore accede alla stanza poichè passa tutti i controlli sulla disponibilità del posto in stanza\n load.dismissDialog();\n Intent intent = new Intent(MultiplayerActivity.this,ActualGameActivity.class);\n intent.putExtra(CODE_ROOM_EXTRA,code);\n intent.putExtra(CODE_PLAYER_EXTRA,ROLE_PLAYER1);\n ref.child(PLAYER2_NODE).removeEventListener(this);\n startActivity(intent);\n }\n } else {\n ref.child(PLAYER2_NODE).removeEventListener(this);\n }\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n OfflineFragment offlineFragment = new OfflineFragment();\n offlineFragment.show(getSupportFragmentManager(),\"Dialog\");\n }\n });\n\n }\n });\n\n\n\n }", "public String getRoomDescription() {\n\treturn this.description;\n\t\n}", "public void createRoom() {\n int hp = LabyrinthFactory.HP_PLAYER;\n if (hero != null) hp = hero.getHp();\n try {\n labyrinth = labyrinthLoader.createLabyrinth(level, room);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n characterLoader.createCharacter(level, room);\n hero = characterLoader.getPlayer();\n if (room > 1) hero.setHp(hp);\n createMonsters();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public String getRoomtype() {\r\n\t\treturn roomtype;\r\n\t}", "private static void createRooms() {\n// Room airport, beach, jungle, mountain, cave, camp, raft, seaBottom;\n\n airport = new Room(\"airport\");\n beach = new Room(\"beach\");\n jungle = new Room(\"jungle\");\n mountain = new Room(\"mountain\");\n cave = new Room(\"cave\");\n camp = new Room(\"camp\");\n seaBottom = new Room(\"seabottom\");\n\n //Setting the the exits in different rooms\n beach.setExit(\"north\", jungle);\n beach.setExit(\"south\", seaBottom);\n beach.setExit(\"west\", camp);\n\n jungle.setExit(\"north\", mountain);\n jungle.setExit(\"east\", cave);\n jungle.setExit(\"south\", beach);\n\n mountain.setExit(\"south\", jungle);\n\n cave.setExit(\"west\", jungle);\n\n camp.setExit(\"east\", beach);\n\n seaBottom.setExit(\"north\", beach);\n\n // Starting room\n currentRoom = airport;\n }", "private void createRooms()\n {\n Room outside, garden, kitchen, frontyard, garage, livingroom,\n upperhallway, downhallway, bedroom1, bedroom2, toilet,teleporter;\n\n // create the rooms\n outside = new Room(\"outside the house\",\"Outside\");\n garden = new Room(\"in the Garden\", \"Garden\");\n kitchen = new Room(\"in the Kitchen\",\"Kitchen\");\n frontyard = new Room(\"in the Frontyard of the house\", \"Frontyard\");\n garage = new Room(\"in the Garage\", \"Garage\");\n livingroom = new Room(\"in the Living room\", \"Living Room\");\n upperhallway = new Room(\"in the Upstairs Hallway\",\"Upstairs Hallway\");\n downhallway = new Room(\"in the Downstairs Hallway\", \"Downstairs Hallway\");\n bedroom1 = new Room(\"in one of the Bedrooms\", \"Bedroom\");\n bedroom2 = new Room(\"in the other Bedroom\", \"Bedroom\");\n toilet = new Room(\"in the Toilet upstairs\",\"Toilet\");\n teleporter = new Room(\"in the Warp Pipe\", \"Warp Pipe\");\n\n // initialise room exits\n outside.setExit(\"north\", garden);\n outside.setExit(\"east\", frontyard);\n\n garden.setExit(\"south\", outside);\n garden.setExit(\"east\", kitchen);\n\n kitchen.setExit(\"west\", garden);\n kitchen.setExit(\"north\", livingroom);\n kitchen.setExit(\"south\", downhallway);\n\n frontyard.setExit(\"west\", outside);\n frontyard.setExit(\"north\", downhallway);\n frontyard.setExit(\"east\", garage);\n\n garage.setExit(\"west\", frontyard);\n garage.setExit(\"north\", downhallway);\n\n livingroom.setExit(\"west\", kitchen);\n\n downhallway.setExit(\"north\",kitchen);\n downhallway.setExit(\"west\",frontyard);\n downhallway.setExit(\"south\",garage);\n downhallway.setExit(\"east\",upperhallway);\n\n upperhallway.setExit(\"north\", bedroom2);\n upperhallway.setExit(\"east\", bedroom1);\n upperhallway.setExit(\"south\", toilet);\n upperhallway.setExit(\"west\", downhallway);\n\n toilet.setExit(\"north\", upperhallway);\n\n bedroom1.setExit(\"west\",upperhallway);\n\n bedroom2.setExit(\"south\", upperhallway);\n\n rooms.add(outside);\n rooms.add(garden);\n rooms.add(kitchen);\n rooms.add(frontyard);\n rooms.add(garage);\n rooms.add(livingroom);\n rooms.add(upperhallway);\n rooms.add(downhallway);\n rooms.add(bedroom1);\n rooms.add(bedroom2);\n rooms.add(toilet);\n }", "public int getRoomNumber() \n\t{\n\t\treturn roomNumber;\n\t}", "public Mumie(Room room, Player p) {\r\n\t\tsuper(room, p);\r\n\t\tattackDamage = (-10);\r\n\t\tattackRange = 10;\r\n\t\tsenseRange = 70;\r\n\t\tspeed = 0.005f;\r\n\t\tcurrentRoom = room;\r\n\t\tplayer = p;\r\n\t\tmonsterSpecificCooldown = 1000;\r\n\t\tmonsterSpecificValue = 750;\r\n\t}", "void showCreatorWaitingRoom();", "private Room (String roomName, boolean isHealingPot, boolean isPit,boolean isEntrance, boolean isExit, boolean isPillar, int numMons, boolean isVisionPot) {\n \t this.roomName = roomName;\n this.isHealingPot = isHealingPot;\n this.isPit = isPit;\n this.isEntrance = isEntrance;\n this.isExit = isExit;\n this.isPillar = isPillar;\n this.numMons = numMons;\n this.isVisionPot = isVisionPot;\n }", "private static void printRoom(Room currentRoom) {\n\t\t\n\t}", "public String getRoomName() {\n\treturn this.name;\n}", "@Override\n\tpublic String toString() {\n\t\t\n\t\tString s = \"user's id=\" + id +\"hotel Name = \" + hotelName +\", RoomNumber\" + roomNumber+\" hotelPrice=\" + price + \", roomType=\" + type; \n\t\treturn s;\n\t}", "@Override\n public int getRoomId() {\n return room.getRoomId();\n }", "public static void main(String[] ar){\n Room living = new Room(\"Living\");\n Room kitchen = new Room(\"Kitchen\");\n Room bathroom = new Room(\"Bathroom\");\n Room garage = new Room(\"Garage\");\n \n Room bedroom1 = new Room(\"Bedroom1\");\n Room bedroom2 = new Room(\"Bedroom2\");\n Room bathroom1stf=new Room(\"Bathroom\");\n \n \n //Living\n living.addDevice(new Device(\"Aire acondicionado\", \"LG\", \"pm07sp\", true));\n living.addDevice(new Device(\"Luces\", \"Philips\", \"Hue\", true));\n //Kitchen\n kitchen.addDevice(new Device(\"luces\",\"Ahorradoras\",\"34234\", true));\n //Bathroom\n bathroom.addDevice(new Device(\"luce\",\"simple\",\"354676\", true));\n //Garage\n garage.addDevice(new Device(\"lightbulb\",\"the best\",\"X3000\",true));\n \n //Bedroom 1\n bedroom1.addDevice(new Device(\"Aire acondicionado\", \"Mabe\" , \"Mmt12cdbs3\", true));\n bedroom1.addDevice(new Device(\"Luces\",\"Philips\",\"EcoVantage\",true));\n \n //Bedroom 2\n bedroom2.addDevice(new Device(\"Aire acondicionado\", \"Hisense\" , \"AS-12CR5FVETD/1TR\", true));\n bedroom2.addDevice(new Device(\"Luces\",\"Ho Iluminacion\",\"A19 60W Claro\",true));\n \n //baño primer piso\n bathroom1stf.addDevice(new Device(\"Luces\",\"Alefco\",\"lw100\",true));\n \n \n \n Level groundFloor = new Level(\"Ground Floor\");\n Level firstFloor = new Level(\"First Floor\");\n \n \n groundFloor.addRoom(living);\n groundFloor.addRoom(kitchen);\n groundFloor.addRoom(bathroom);\n groundFloor.addRoom(garage);\n \n firstFloor.addRoom(bedroom1);\n firstFloor.addRoom(bedroom2);\n firstFloor.addRoom(bathroom1stf);\n \n\n House myhouse = new House(\"MyHome\");\n \n myhouse.addLevel(groundFloor);\n myhouse.addLevel(firstFloor);\n \n System.out.println(myhouse);\n \n \n /*\n room.addDevice(new Device(\"Reynaldo\", \"LG\", \"123456\", true));\n room.addDevice(new Device(\"Andrea\", \"Nokia\", \"Lumia-520\", true));\n room.addDevice(new Device(\"Karina\",\"Panasonic\",\"465464\", true));\n room.addDevice(new Device(\"Martin\", \"ZTE\", \"V7\",true));\n room.addDevice(new Device(\"Antonio\",\"Samsung\",\"J5\",true));\n room.addDevice(new Device(\"Roberto\",\"HP\",\"SpectreX360\",true));\n room.addDevice(new Device(\"Gabriel\",\"Linu\",\"Ilium_S106\",true));\n room.addDevice(new Device (\"Limberth\",\"LG\", \"lg-206\",true));\n room.addDevice(new Device(\"jesus\", \"hp\",\"2997\", true));\n room.addDevice(new Device(\"Rich\", \"Asus\",\"Zenfone_4_Max\",true));\n room.addDevice(new Device(\"Adrian\",\"Apple\",\"SE\",true));\n room.addDevice(new Device (\"Jonatan\",\"samsung\",\"J5\",true));\n room.addDevice(new Device(\"Jessica\", \"Huaweii\", \"P9LITE\", true));\n */\n \n \n \n \n \n }", "private ArrayList<Room> createRooms() {\n //Adding starting position, always rooms(index0)\n\n rooms.add(new Room(\n \"Du sidder på dit kontor. Du kigger på uret og opdager, at du er sent på den. WTF! FISKEDAG! Bare der er fiskefilet tilbage, når du når kantinen. Du må hellere finde en vej ud herfra og hen til kantinen.\",\n false,\n null,\n null\n ));\n\n //Adding offices to <>officerooms, randomly placed later \n officeRooms.add(new Room(\n \"Du bliver kort blændet af en kontorlampe, som peger lige mod døråbningen. Du ser en gammel dame.\",\n false,\n monsterList.getMonster(4),\n itemList.getItem(13)\n ));\n\n officeRooms.add(new Room(\n \"Der er ingen i rummet, men rodet afslører, at det nok er Phillipas kontor.\",\n false,\n null,\n itemList.getItem(15)\n ));\n\n officeRooms.add(new Room(\n \"Du vader ind i et lokale, som er dunkelt oplyst af små, blinkende lamper og har en stank, der siger så meget spar fem, at det kun kan være IT-lokalet. Du når lige at høre ordene \\\"Rick & Morty\\\".\",\n false,\n monsterList.getMonster(6),\n itemList.getItem(7)\n ));\n\n officeRooms.add(new Room(\n \"Det var ikke kantinen det her, men hvorfor er der så krummer på gulvet?\",\n false,\n null,\n itemList.getItem(1)\n ));\n\n officeRooms.add(new Room(\n \"Tine sidder ved sit skrivebord. Du kan se, at hun er ved at skrive en lang indkøbsseddel. Hun skal nok have gæster i aften.\",\n false,\n monsterList.getMonster(0),\n itemList.getItem(18)\n ));\n\n officeRooms.add(new Room(\n \"Du træder ind i det tekøkken, hvor Thomas plejer at opholde sig. Du ved, hvad det betyder!\",\n false,\n null,\n itemList.getItem(0)\n ));\n\n officeRooms.add(new Room(\n \"Du går ind i det nok mest intetsigende rum, som du nogensinde har set. Det er så intetsigende, at der faktisk ikke er mere at sige om det.\",\n false,\n monsterList.getMonster(1),\n itemList.getItem(9)\n ));\n\n //Adding copyrooms to <>copyrooms, randomly placed later \n copyRooms.add(new Room(\n \"Døren knirker, som du åbner den. Et kopirum! Det burde du have set komme. Især fordi det var en glasdør.\",\n false,\n null,\n itemList.getItem(19)\n ));\n\n copyRooms.add(new Room(\n \"Kopimaskinen summer stadig. Den er åbenbart lige blevet færdig. Du går nysgerrigt over og kigger på alle de udskrevne papirer.\",\n false,\n null,\n itemList.getItem(12)\n ));\n\n //Adding restrooms to <>restrooms, randomly placed later \n restRooms.add(new Room(\n \"Ups! Dametoilettet. Der hænger en klam stank i luften. Det må være Ruth, som har været i gang.\",\n false,\n null,\n itemList.getItem(5)\n ));\n\n restRooms.add(new Room(\n \"Pedersen er på vej ud fra toilettet. Han vasker ikke fingre! Slut med at give ham hånden.\",\n false,\n monsterList.getMonster(7),\n itemList.getItem(11)\n ));\n\n restRooms.add(new Room(\n \"Du kommer ind på herretoilettet. Du skal simpelthen tisse så meget, at fiskefileterne må vente lidt. Du åbner toiletdøren.\",\n false,\n monsterList.getMonster(2),\n null\n ));\n\n restRooms.add(new Room(\n \"Lisette står og pudrer næse på dametoilettet. Hvorfor gik du herud?\",\n false,\n monsterList.getMonster(8),\n itemList.getItem(14)\n ));\n\n //Adding meetingrooms to<>meetingrooms, randomly placed later\n meetingRooms.add(new Room(\n \"Du træder ind i et lokale, hvor et vigtigt møde med en potentiel kunde er i gang. Du bliver nødt til at lade som om, at du er en sekretær.\",\n false,\n monsterList.getMonster(9),\n itemList.getItem(6)\n ));\n\n meetingRooms.add(new Room(\n \"Mødelokalet er tomt, men der står kopper og service fra sidste møde. Sikke et rod!\",\n false,\n null,\n itemList.getItem(3)\n ));\n\n meetingRooms.add(new Room(\n \"Projektgruppen sidder i mødelokalet. Vil du forsøge at forsinke dem i at nå fiskefileterne i kantinen?\",\n false,\n monsterList.getMonster(10),\n itemList.getItem(2)\n ));\n\n //Adding specialrooms to<>specialrooms, randomly placed later\n specialRooms.add(new Room(\n \"Du vader ind på chefens kontor. På hans skrivebord sidder sekretæren Phillipa.\",\n false,\n monsterList.getMonster(5),\n itemList.getItem(8)\n ));\n\n specialRooms.add(new Room(\n \"Det her ligner øjensynligt det kosteskab, Harry Potter boede i.\",\n false,\n monsterList.getMonster(3),\n itemList.getItem(4)\n ));\n\n specialRooms.add(new Room(\n \"OMG! Hvad er det syn?! KANTINEN!! Du klarede det! Du skynder dig op i køen lige foran ham den arrogante fra din afdeling. Da du når frem til fadet er der kun 4 fiskefileter tilbage. Du snupper alle 4!\",\n true,\n null,\n null\n ));\n\n //Adding rooms(Inde1-5)\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addMeetingRoom(rooms, meetingRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n\n //Adding rooms(Inde6-10)\n addMeetingRoom(rooms, meetingRooms);\n addCopyRoom(rooms, copyRooms);\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n addCopyRoom(rooms, copyRooms);\n\n //Adding rooms(Inde11-15)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n\n //Adding rooms(Inde16-19)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addSpecialRoom(rooms, specialRooms);\n addMeetingRoom(rooms, meetingRooms);\n\n return rooms;\n }", "public void getAllSingleRoom() {\n\t\t for(SuiteRoom elem: suiteroom)\n\t {\n\t \t System.out.println (\"capacité : \" +elem.getCapacity());\n\t \t System.out.println (\"prix : \" +elem.getPrice());\n\t \t System.out.println (\"numéro : \" +elem.getIdRoom());\n\t \t System.out.println (\"nom : \" +elem.getName());\n\t \tSystem.out.println (\"-------------------\");\n\t \t \n\t }\n\t}", "public Question(RoomType room){\n location = new Card(room.toString());\n murderer = null;\n weapon = null;\n }", "@Override\n public int getCapacity() {\n return room.getCapacity();\n }", "public void createRooms()//Method was given\n { \n \n // create the rooms, format is name = new Room(\"description of the situation\"); ex. desc = 'in a small house' would print 'you are in a small house.'\n outside = new Room(\"outside\", \"outside of a small building with a door straight ahead. There is a welcome mat, a mailbox, and a man standing in front of the door.\", false);\n kitchen = new Room(\"kitchen\", \"in what appears to be a kitchen. There is a sink and some counters with an easter egg on top of the counter. There is a locked door straight ahead, and a man standing next to a potted plant. There is also a delicious looking chocolate bar sitting on the counter... how tempting\", true);\n poolRoom = new Room(\"pool room\", \"in a new room that appears much larger than the first room.You see a table with a flashlight, towel, and scissors on it. There is also a large swimming pool with what looks like a snorkel deep in the bottom of the pool. Straight ahead of you stands the same man as before.\", true);\n library = new Room(\"library\", \"facing east in a new, much smaller room than before. There are endless rows of bookshelves filling the room. All of the books have a black cover excpet for two: one red book and one blue book. The man stands in front of you, next to the first row of bookshelves\", true);\n exitRoom = new Room(\"exit\", \"outside of the building again. You have successfully escaped, congratulations! Celebrate with a non-poisonous chocolate bar\",true);\n \n // initialise room exits, goes (north, east, south, west)\n outside.setExits(kitchen, null, null, null);\n kitchen.setExits(poolRoom, null, outside, null);\n poolRoom.setExits(null, library, kitchen, null);\n library.setExits(null, null, exitRoom, poolRoom);\n exitRoom.setExits(null, null, null, null); \n \n currentRoom = outside; // start game outside\n }", "RosterProfile rosterProfile();", "java.lang.String getRoomName();", "@Override\n\tpublic int getRoomAvailable(String month, int day, String type, int lengthOfStay) {\n\t\treturn 0;\n\t}", "public abstract void enterRoom();", "public void setRoom(String room) {\n\t\tthis.room = room;\n\t}", "@Override\n\tpublic Object getModel() \n\t{\n\t\treturn room;\n\t}", "public Room(int roomNum, int capacity) {\n this.id = UUID.randomUUID().toString();\n this.roomNum = roomNum;\n this.capacity = capacity;\n this.isTable = false;\n this.hasStage = false;\n this.hasTech = false;\n }", "public int getRoom()\n\t{\t\n\t\treturn iCurrentRoom;\n\t\t\n\t}", "@Override\n public boolean isAvailable() {\n return room.isAvailable();\n }", "public static void main(String[] args) {\n Room room1 = new Room(14, 6, 2, false);\n Room room2 = new Room(8, 6, 2, false);\n Room room3 = new Room(18, 6, 2, false);\n\n ArrayList<Room> rooms = new ArrayList<>();\n rooms.add(room1);\n rooms.add(room2);\n rooms.add(room3);\n\n\n House house = new House(8, 2, 140.00, rooms);\n\n\n\n\n System.out.println(\"Aantal stoelen \" + house.aantalStoelenInHetHuis());\n\n }", "public int getRoomNumber() {\r\n\t\treturn this.roomNumber;\r\n\t}", "public Player(Room room)\n {\n Inventory = new HashMap<String, Items>();\n currentRoom = room; //Starting Room Number 1\n itemsHeld = 0; //Start with no items being held\n itemLimit = 2; // can only hold 2 items until a backpack\n Inventory = new HashMap<String, Items>();\n \n roomHistory = new Stack<Room>();\n \n haveBackpack = false; //no backpack at start\n usingFlashlight = false;\n }", "private Room (String roomName,boolean isHealingPot, boolean isPit,boolean isEntrance, boolean isExit, boolean isPillar, Monster monster, int numMons, boolean isVisionPot){\n this.roomName = roomName;\n this.isHealingPot = isHealingPot;\n this.isPit = isPit;\n this.isEntrance = isEntrance;\n this.isExit = isExit;\n this.isPillar = isPillar;\n\n this.monster = monster;\n this.numMons = numMons;\n this.isVisionPot = isVisionPot;\n }", "@Override\n public String getRoomType()\n {\n return room.getRoomType() + \" + \" + service;\n }", "protected void setRoom() {\n\t\tfor(int x = 0; x < xSize; x++) {\n\t\t\tfor (int y = 0; y < ySize; y++) {\n\t\t\t\tif (WALL_GRID[y][x] == 1) {\n\t\t\t\t\tlevelSetup[x][y] = new SimpleRoom();\n\t\t\t\t} else{\n\t\t\t\t\tlevelSetup[x][y] = new ForbiddenRoom();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// put special rooms\n\t\tlevelSetup[6][0] = new RoomWithLockedDoor();\n\t\tlevelSetup[2][6] = new FragileRoom();\n\n\t}", "public Classroom() {\n\t}", "public String convertRoomType(){\r\n String str = null;\r\n if (this.roomType == Room.ROOM_TYPE_BASIC_ROOM){\r\n str = \"Basic Room\";\r\n }\r\n if (this.getRoomType() == Room.ROOM_TYPE_JUNIOR_SUITE) {\r\n str = \"Junior Suite\";\r\n }\r\n if (this.getRoomType() == Room.ROOM_TYPE_FULL_SUITE) {\r\n str = \"Full Suite\";\r\n }\r\n return str;\r\n }", "public String getRoomNum() {\n return roomNum;\n }", "public void createRooms()\n { \n // create the rooms\n //RDC//\n hall = new Room(\"Hall\", \"..\\\\pictures\\\\Rooms\\\\hall.png\");\n banquetinghall = new Room (\"Banqueting hall\", \"..\\\\pictures\\\\Rooms\\\\banquet.png\");\n poolroom = new Room (\"PoolRoom\", \"..\\\\pictures\\\\Rooms\\\\billard.png\");\n dancingroom = new Room (\"Dancing Room\", \"..\\\\pictures\\\\Rooms\\\\bal.png\");\n kitchen = new Room(\"Kitchen\", null);\n garden = new Room(\"Garden\", null);\n well = new Room(\"Well\", null);\n gardenerhut = new Room(\"Gardener hut\", null);\n //Fin RDN //\n \n //-1//\n anteroom = new Room(\"Anteroom\", null);\n ritualroom = new Room(\"Ritual Room\", null);\n cellar = new Room(\"Cellar\", null);\n // FIN -1//\n // +1 //\n livingroom = new Room(\"Living Room\", null); \n library = new Room (\"Library\", null);\n laboratory = new Room(\"Laboratory\", null);\n corridor= new Room(\"Corridor\", null);\n bathroom = new Room(\"Bathroom\", null);\n bedroom = new Room(\"Bedroom\", null);\n guestbedroom = new Room(\"Guest Bedroom\", null); \n //FIN +1 //\n //+2//\n attic = new Room(\"Attic\", null);\n //Fin +2//\n //Fin create room // \n \n // initialise room exits\n //RDC\n hall.setExits(\"north\",garden, false, \"> You must explore the mansion before\");\n hall.setExits(\"south\",banquetinghall, true, null); \n banquetinghall.setExits(\"north\",hall, true, null);\n banquetinghall.setExits(\"south\",dancingroom, false, \"> The door is blocked by Bob's toys\");\n banquetinghall.setExits(\"east\",kitchen, true, null);\n banquetinghall.setExits(\"west\",poolroom, true, null);\n //poolroom.setExits(\"east\",banquetinghall, false, \"> You have not finished examining the crime scene\");\n poolroom.setExits(\"east\",banquetinghall, true, \"> You have not finished examining the crime scene\");\n dancingroom.setExits(\"north\",banquetinghall, true, null);\n dancingroom.setExits(\"up\",livingroom, true, null);\n kitchen.setExits(\"west\",banquetinghall, true, null);\n kitchen.setExits(\"down\",cellar, true, null);\n garden.setExits(\"south\",hall, true, null);\n garden.setExits(\"north\",well, true, null);\n garden.setExits(\"east\",gardenerhut, true, null);\n well.setExits(\"south\",garden, true, null);\n gardenerhut.setExits(\"west\",garden, true, null);\n //gardenerhut.setExits(\"down\",anteroom, false, null);\n //-1// \n anteroom.setExits(\"south\",ritualroom, true, null);\n anteroom.setExits(\"up\",gardenerhut, false, \"> The door is locked. You cannot go backward\");\n anteroom.setExits(\"west\",cellar, true, null);\n ritualroom.setExits(\"north\",anteroom, true, null);\n cellar.setExits(\"up\",kitchen, true, null);\n //cellar.setExits(\"east\", anteroom, false); To unlock\n //+1//\n livingroom.setExits(\"down\",dancingroom, true, null);\n livingroom.setExits(\"north\",library, true, null);\n livingroom.setExits(\"west\",corridor, true, null);\n library.setExits(\"south\",livingroom, true, null);\n //library.setExits(\"north\",laboratory, false); To unlock\n laboratory.setExits(\"south\",library, true, null);\n corridor.setExits(\"north\",bathroom, true, null);\n corridor.setExits(\"south\",bedroom, false, \"> The door is locked. A key may be mandatory\");\n corridor.setExits(\"east\",livingroom, true, null);\n corridor.setExits(\"west\",guestbedroom, true, null);\n corridor.setExits(\"up\",attic, false, \"> You see a weird lock in the ceiling\");\n bathroom.setExits(\"south\",corridor, true, null);\n bedroom.setExits(\"north\",corridor, true, null);\n guestbedroom.setExits(\"east\",corridor, true, null);\n attic.setExits(\"down\",corridor, true, null);\n \n //currentRoom = poolroom; // start game outside\n currentRoom = poolroom;\n }", "public Shower(MotelRoom roomType) {\n this.roomType = roomType;\n }", "public Integer getRoomnumber() {\n return roomnumber;\n }", "public Room() {\n }" ]
[ "0.6499101", "0.6499101", "0.617415", "0.6129312", "0.60962224", "0.6091009", "0.60878354", "0.6083881", "0.60391927", "0.5978359", "0.5940761", "0.5890755", "0.5850864", "0.58419096", "0.581741", "0.58168465", "0.5807989", "0.57942075", "0.57935625", "0.5784574", "0.5783808", "0.5744852", "0.5622682", "0.5618493", "0.56152725", "0.56126523", "0.5608676", "0.5606041", "0.5603095", "0.5602944", "0.5588699", "0.5581751", "0.55601937", "0.5557674", "0.55458933", "0.55427635", "0.5540735", "0.5529702", "0.5524738", "0.5522408", "0.5512968", "0.54989684", "0.54946965", "0.5489307", "0.5475267", "0.54741734", "0.5456642", "0.54504913", "0.5433899", "0.5431564", "0.54298294", "0.5427562", "0.5423583", "0.5417294", "0.5404888", "0.5396647", "0.539193", "0.53825545", "0.5380476", "0.5378098", "0.53703505", "0.5367099", "0.5366907", "0.53633654", "0.53614384", "0.53533316", "0.5342276", "0.53415257", "0.5331195", "0.5328661", "0.53248566", "0.5311166", "0.53107893", "0.5310736", "0.5310656", "0.5310467", "0.5307293", "0.53045464", "0.53028494", "0.5302581", "0.5301232", "0.52893186", "0.52888805", "0.5288254", "0.5282332", "0.5281858", "0.52772975", "0.52746105", "0.527227", "0.52596897", "0.52589273", "0.5258825", "0.5249745", "0.52477896", "0.524763", "0.5246737", "0.5246209", "0.5245678", "0.5241994", "0.5237475" ]
0.7672549
0
Method dari getTipeKamar Mengambil nilai return dari TIPE_KAMAR
public TipeKamar getTipeKamar() { return TIPE_KAMAR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TipeKamar getTipeKamar()\n {\n return TIPE_KAMAR;\n }", "public String getKontaktai() {\r\n\t\treturn kontaktai;\r\n\t}", "public java.lang.Integer getHariKe() {\n return hari_ke;\n }", "public java.lang.Integer getHariKe() {\n return hari_ke;\n }", "public Map<String, KelimeTipi> kokTipiAdlari() {\n Map<String, KelimeTipi> tipMap = new HashMap<String, KelimeTipi>();\r\n tipMap.put(\"IS\", ISIM);\r\n tipMap.put(\"FI\", FIIL);\r\n tipMap.put(\"SI\", SIFAT);\r\n tipMap.put(\"SA\", SAYI);\r\n tipMap.put(\"YA\", YANKI);\r\n tipMap.put(\"ZA\", ZAMIR);\r\n tipMap.put(\"SO\", SORU);\r\n tipMap.put(\"IM\", IMEK);\r\n tipMap.put(\"ZAMAN\", ZAMAN);\r\n tipMap.put(\"HATALI\", HATALI);\r\n tipMap.put(\"EDAT\", EDAT);\r\n tipMap.put(\"BAGLAC\", BAGLAC);\r\n tipMap.put(\"OZ\", OZEL);\r\n tipMap.put(\"UN\", UNLEM);\r\n tipMap.put(\"KI\", KISALTMA);\r\n return tipMap;\r\n }", "public void tampilKarakterA(){\r\n System.out.println(\"Saya mempunyai kaki empat \");\r\n }", "public Integer getCodTienda();", "public Instant getjamKeluar() {\n return waktu.getJamKeluar();\n }", "public String getKakarinm() {\r\n return kakarinm;\r\n }", "void tampilKarakterA();", "public int darTamano() {\n\t\treturn tamano;\n\t}", "public int getTilaa() {\r\n return maara - matkustajia;\r\n }", "public String getTorihikisakinm() {\r\n return torihikisakinm;\r\n }", "public static List<Kontak> getKontakData() {\n // Mendeklarasikan varibel ArrayList berjenis Kontak\n ArrayList<Kontak> listKontak = new ArrayList<>();\n // Melakukan perulangan sebanyak jumlah data(10 kali)\n for (int i = 0; i < nama.length; i++) {\n // Membuat objek Kontak\n Kontak kontak = new Kontak();\n // Mengisi data setiap atribut menggunakan setter()\n kontak.setFoto(foto[i]);\n kontak.setNama(nama[i]);\n kontak.setNoTelepon(noTelepon[i]);\n kontak.setEmail(email[i]);\n\n // Menambahkan objek kontak ke dalam ArrayList Kontak\n listKontak.add(kontak);\n }\n // Mengembalikan nilai ArrayList Kontak\n return listKontak;\n }", "public Kupcek() {\r\n kup = new ArrayList<Karta>();\r\n\r\n for (int i = 0; i < 4; i++) { //gremo preko vseh simbolo kart\r\n for (int j = 0; j < 13; j++) { //in njihovih rangov\r\n if (j == 0) { //prvi indeks je vedno as torej mu damo vrednost 11\r\n Karta card = new Karta(i, j, 11); //ustvarimo nasega asa z i-tim simbolom in j-tim rangom\r\n kup.add(card); //karto dodamo v kupcek\r\n }\r\n else if (j >= 10) { //podobno storimo za karte Fant, Kraljica, Kralj in jim dodamo vrednost 10\r\n Karta card = new Karta(i, j, 10);\r\n kup.add(card);\r\n }\r\n else { //za vse preostale karte povecamo vrednost za +1 indeksa zaradi poteka kart 2[1] 3[2] etc.\r\n Karta card = new Karta(i, j, j+1);\r\n kup.add(card);\r\n }\r\n }\r\n }\r\n }", "public final String dataTauluMerkkiJonoksi() {\r\n String data = \"\";\r\n\r\n for (int i = 0; i < this.riviAsteikko.length; i++) {\r\n for (int j = 0; j < this.sarakeAsteikko.length; j++) {\r\n if (this.dataTaulukko[i][j] < 10) {\r\n data = data + \" \" + dataTaulukko[i][j];\r\n } else if (this.dataTaulukko[i][j] >= 10\r\n && this.dataTaulukko[i][j] < 100) {\r\n data = data + \" \" + this.dataTaulukko[i][j];\r\n } else {\r\n data = data + \" \" + this.dataTaulukko[i][j];\r\n }\r\n }\r\n data = data + System.lineSeparator();\r\n }\r\n return data;\r\n }", "public String cekPengulangan(String kata) throws IOException{\n String hasil=\"\";\n if(cekUlangSemu(kata)){\n return kata+\" kata ulang semu \";\n }\n if(kata.contains(\"-\")){\n String[] pecah = kata.split(\"-\");\n String depan = pecah[0];\n String belakang = pecah[1];\n ArrayList<String> depanList = new ArrayList<String>();\n ArrayList<String> belakangList = new ArrayList<String>();\n if(!depan.equals(\"\")){\n depanList.addAll(morpParser.cekBerimbuhan(depan, 0));\n }\n if(!belakang.equals(\"\")){\n belakangList.addAll(morpParser.cekBerimbuhan(belakang, 0));\n }\n for(int i = 0; i < depanList.size(); i++){\n for(int j = 0; j < belakangList.size(); j++){\n if(depanList.get(i).equals(belakangList.get(j))){\n return depan+\" kata ulang penuh \";\n }\n }\n }\n if(depan.equals(belakang)){\n return depan+\" kata ulang penuh \";\n }\n char[] isiCharDepan = depan.toCharArray();\n char[] isiCharBelakang = belakang.toCharArray();\n boolean[] sama = new boolean[isiCharDepan.length];\n int jumlahSama=0;\n int jumlahBeda=0;\n for(int i =0;i<sama.length;i++){\n if(isiCharDepan[i]==isiCharBelakang[i]){\n sama[i]=true;\n jumlahSama++;\n }\n else{\n sama[i]=false;\n jumlahBeda++;\n }\n }\n \n if(jumlahBeda<jumlahSama && isiCharDepan.length==isiCharBelakang.length){\n return depan+\" kata ulang berubah bunyi \";\n }\n \n \n }\n else{\n if(kata.charAt(0)==kata.charAt(2)&&kata.charAt(1)=='e'){\n if((kata.charAt(0)=='j'||kata.charAt(0)=='t')&&!kata.endsWith(\"an\")){\n return kata.substring(2)+\" kata ulang sebagian \";\n }\n else if(kata.endsWith(\"an\")){\n return kata.substring(2,kata.length()-2)+\" kata ulang sebagian \";\n }\n \n }\n }\n return hasil;\n }", "public String dimeTuTiempo()\n {\n String cadResultado=\"\";\n if (horas<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+horas;\n cadResultado=cadResultado+\":\";\n if(minutos<10)\n {\n cadResultado=cadResultado+\"0\";\n }\n cadResultado=cadResultado+minutos;\n \n return cadResultado;\n }", "public double getKilometraza() {\r\n return kilometraza;\r\n }", "public void testTampilkanJumlahSKPP_PNSberdasarkanKodePangkat(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getTampilkanJumlahSKPP_PNSberdasarkanKodePangkat(); \n\n\t\tshowData(data,\"kode_pangkat\",\"jumlah_pns\");\n\t}", "protected String getTitoloPaginaMadre() {\n return VUOTA;\n }", "public Tequisquiapan()\n {\n nivel = new Counter(\"Barrio Tequisquiapan: \");\n \n nivel.setValue(5);\n hombre.escenario=5;\n\n casa5.creaCasa(4);\n addObject(casa5, 2, 3);\n \n arbol2.creaArbol(2);\n addObject(arbol2, 20, 3);\n arbol3.creaArbol(3);\n addObject(arbol3, 20, 16); \n \n addObject(letrero5, 15, 8);\n\n addObject(hombre, 11, 1);\n \n arbol4.creaArbol(4);\n addObject(arbol4, 20, 20);\n arbol5.creaArbol(5);\n addObject(arbol5, 3, 17);\n \n fuente2.creaAfuera(6);\n addObject(fuente2, 11, 19);\n \n lampara1.creaAfuera(2);\n addObject(lampara1, 8, 14);\n lampara2.creaAfuera(1);\n addObject(lampara2, 8, 7);\n \n addObject(nivel, 5, 0);\n addObject(atras, 20, 2); \n }", "public int getTanggalLahir() {\r\n return tanggalLahir;\r\n }", "public TonKho getTonKhoHienTai(String malk, Integer maKhoa) {\n Query q = getEm().createQuery(\"SELECT t FROM TonKho t WHERE t.dmkhoaMaso.dmkhoaMaso = :maKhoa AND t.tonkhoMalienket = :malk AND t.tonkhoMa = (SELECT MAX(t1.tonkhoMa) FROM TonKho t1 WHERE t1.tonkhoMalienket = :malk AND t1.dmkhoaMaso.dmkhoaMaso = :maKhoa)\");\n q.setParameter(\"malk\", malk);\n q.setParameter(\"maKhoa\", maKhoa);\n try {\n List<TonKho> listTk = q.getResultList();\n if (listTk != null && listTk.size() > 0) {\n return listTk.get(0);\n }\n } catch (Exception ex) {\n System.out.println(\"Error getTonKhoHienTai: \" + ex.toString());\n ex.printStackTrace();\n }\n return null;\n }", "public int koko() {\n return this.arvoja;\n }", "private static PohonAVL seimbangkanKembaliKiri (PohonAVL p) {\n\t// Write your codes in here\n //...\n // Write your codes in here\n if(tinggi(p.kiri) <= (tinggi(p.kanan)+1)) return p;\n else{\n PohonAVL ki = p.kiri;\n PohonAVL ka = p.kanan;\n PohonAVL kiki = ki.kiri;\n PohonAVL kika = ki.kanan;\n if(tinggi(kiki) > tinggi(ka))\n return sisipkanTinggiSeimbang(0, p)\n }\n }", "public static Pesanan getPesananAktif(Room kamar){\n int besar = PESANAN_DATABASE.size();\n int i= 0;\n for(i=0;i<besar;i++){\n if(PESANAN_DATABASE.get(i).getRoom().equals(kamar) && PESANAN_DATABASE.get(i).getStatusAktif()){\n return PESANAN_DATABASE.get(i);\n\n }\n }\n return null;\n }", "public Tipe getTipeBilangan() /*const*/{\n\t\tassert(getTkn()==TipeToken.Bilangan);\n\t\treturn TipeBilangan;\n\t}", "private String tallenna() {\n Dialogs.showMessageDialog(\"Tallennetaan!\");\n try {\n paivakirja.tallenna();\n return null;\n } catch (SailoException ex) {\n Dialogs.showMessageDialog(\"Tallennuksessa ongelmia!\" + ex.getMessage());\n return ex.getMessage();\n }\n }", "public String getKanm() {\r\n return kanm;\r\n }", "public String getTiempo() {\r\n return tiempo;\r\n }", "public String suaTaiKhoan(){\n\t\ttaiKhoanDao.suaTaiKhoan(ttCaNhan);\r\n\t\t\r\n\t\t//kiem tra quyen dang nhap\r\n\t\tint kt=kiemTraquyenDN();\r\n\t\tif(kt==1){\r\n\t\t\treturn \"QLTaiKhoan_Admin?faces-redirect=true\";\r\n\t\t}else if(kt==3){\r\n\t\t\treturn \"QLTaiKhoan_NV?faces-redirect=true\";\r\n\t\t}else{\r\n\t\t\treturn \"QLTaiKhoan_NVDH?faces-redirect=true\";\r\n\t\t}\r\n\t}", "public SistemskiKontroler() {\r\n\t\ttabla = new Tabla(10, 10, 10);\r\n\t\tlista = SOUcitajIzFajla.izvrsi(\"data/lista\");\r\n\t}", "public String getTema() {\n return this.tema;\n }", "public int getTiempoEspera() {\n return tiempoEspera;\n }", "public void tampilBuku() {\n System.out.println(\"ID : \" + this.id);\n System.out.println(\"Judul : \" + this.judul);\n System.out.println(\"Tahun Terbit: \" + this.tahun);\n }", "private String getPais()\n throws Exception,MareException\n\t{\n\t\tLong pais = UtilidadesSession.getPais(this);\n\t\treturn pais.toString();\n\t}", "public long getTiempoJuego() {\n\t\ttry {\r\n\t\t\treturn juego.getTiempoJuego();\r\n\t\t} catch (RemoteException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public String getAlamat_pelanggan(){\r\n \r\n return alamat_pelanggan;\r\n }", "static String cetak_nama1() {\n return \"Nama Saya : Aprianto\";\r\n }", "public void klikkaa(Tavarat tavarat, Klikattava klikattava);", "public int getTamanio(){\r\n return tamanio;\r\n }", "public java.lang.String getHora_hasta();", "public void setKontaktai(String kontaktai) {\r\n\t\tthis.kontaktai = kontaktai;\r\n\t}", "public String getDepartamentoTI() {\n return this.departamentoTI;\n }", "public int promossaDama(int pezzo)\n {\n switch (pezzo)\n {\n case PEDINA_NERA: case DAMA_NERA: return DAMA_NERA;\n case PEDINA_BIANCA: case DAMA_BIANCA: return DAMA_BIANCA;\n }\n return VUOTA;\n }", "public int kiemTraquyenDN(){\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);\r\n\t NhanVien x= new NhanVien();\r\n\t x.setMaNV(session.getAttribute(\"manv\").toString());\r\n\t NhanVienDao nvDao=new NhanVienDao();\r\n\t NhanVien nv=nvDao.layNhanVien(x);\r\n\t\t PhanQuyen pq=nv.getMaPQ();\r\n\t\t return pq.getMaPQ();\r\n\t}", "public void testTampilkanJumlahSuratSKPPberdasarkanPenerbitnya(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getTampilkanJumlahSuratSKPPberdasarkanPenerbitnya(); \n\n\t\tshowData_skpp(data,\"penerbit\",\"jumlah_surat\");\n\t}", "public String getTorihikisakicd() {\r\n return torihikisakicd;\r\n }", "int getNombreColonnesPlateau();", "public List<Termek> getAllTermek() {\r\n return Termeks;\r\n }", "public static int AnaEkranGoruntusu(){\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"****************************************\");\n\t\tSystem.out.println(\"* NE YAPMAK İSTERSİNİZ?\t\t\t*\");\n\t\tSystem.out.println(\"* 0)Alisveris Sepetini Goster\t\t*\");\n\t\tSystem.out.println(\"* 1)Sepetine Yeni Urun Ekle\t\t*\");\n\t\tSystem.out.println(\"* 2)Toplam Harcamami Goster\t\t*\");\n\t\tSystem.out.println(\"* 3)Cikis\t\t\t\t*\");\n\t\tSystem.out.println(\"****************************************\");\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Lutfen Secimini Giriniz: \");\n\t\tint anamenu_secim = scan.nextInt();\n\t\treturn anamenu_secim;\n\t}", "public int getArtikelAnzahl(){\n return key;\n }", "@Override\n\tpublic int horas_trabajo() {\n\t\treturn 1000;\n\t}", "public TextInput getEmpfaengerKonto() throws RemoteException\n {\n if (empfkto != null)\n return empfkto;\n\n SepaDauerauftrag t = getTransfer();\n empfkto = new IBANInput(t.getGegenkontoNummer(),this.getEmpfaengerBic());\n empfkto.setMandatory(true);\n if (t.isActive())\n empfkto.setEnabled(getBPD().getBoolean(\"recktoeditable\",true));\n return empfkto;\n }", "public static void jawaban1() {\n int cari;\r\n boolean ditemukan = true;\r\n int a=0;\r\n\r\n //membentuk array yang berisi data\r\n int[] angka = new int[]{74, 98, 72, 74, 72, 90, 81, 72};\r\n \r\n //mengeluarkan array\r\n for (int i = 0; i < angka.length; i++) {\r\n System.out.print(angka [i]+\"\\t\");\r\n\r\n \r\n }\r\n\r\n\r\n //meminta user memasukkan angka yang hendak dicari\r\n Scanner keyboard = new Scanner(System.in);\r\n System.out.println(\"\\nMasukkan angka yang ingin anda cari dibawah sini\");\r\n cari = keyboard.nextInt();\r\n\r\n //proses pencarian atau pencocokan data pada array\r\n for (int i = 0; i < angka.length; i++) {\r\n if (cari == angka[i]) {\r\n ditemukan = true;\r\n \r\n System.out.println(\"Angka yang anda masukkan ada didalam data ini\");\r\n \r\n break;\r\n }\r\n\r\n }\r\n //proses hitung data\r\n if (ditemukan == true) {\r\n \r\n for (int i = 0; i < angka.length; i++) {\r\n if (angka[i]== cari){\r\n a++;\r\n }\r\n \r\n }\r\n\r\n }\r\n \r\n System.out.println(\"Selamat data anda dengan angka \"+cari+ \" ditemukan sebanyak \"+a);\r\n }", "private String getDuzMetinSozlukForm(Kok kok) {\n String icerik = kok.icerik();\r\n if (kok.asil() != null)\r\n icerik = kok.asil();\r\n\r\n StringBuilder res = new StringBuilder(icerik).append(\" \");\r\n\r\n // Tipi ekleyelim.\r\n if (kok.tip() == null) {\r\n System.out.println(\"tipsiz kok:\" + kok);\r\n return res.toString();\r\n }\r\n\r\n if (!tipAdlari.containsKey(kok.tip())) {\r\n System.out.println(\"tip icin dile ozel kisa ad bulunamadi.:\" + kok.tip().name());\r\n return \"#\" + kok.icerik();\r\n }\r\n\r\n res.append(tipAdlari.get(kok.tip()))\r\n .append(\" \")\r\n .append(getOzellikString(kok.ozelDurumDizisi()));\r\n return res.toString();\r\n }", "public void setHariKe(java.lang.Integer value) {\n this.hari_ke = value;\n }", "private String tulostuksenApu(){\r\n String apu = \"Rivitiedosto: \";\r\n for(int i = 0; i<rivitiedot.length; i++){\r\n apu = apu + i+\": \";\r\n for(int k = 1; k <= rivitiedot[i].getKoko(); k++){\r\n apu = apu + \" \"+rivitiedot[i].get(k);\r\n }\r\n apu = apu + \" \";\r\n }\r\n\r\n return apu;\r\n }", "public int MasalarmasaEkle(String masa_adi) {\n baglanti vb = new baglanti();\r\n vb.baglan();\r\n try {\r\n int masa_no = 0;\r\n // masalar tablosundaki en son id ye gore masa_no yu getirir\r\n String sorgu = \"select masa_no from masalar where idmasalar= (select idmasalar from masalar order by idmasalar desc limit 0, 1)\";\r\n ps = vb.con.prepareStatement(sorgu);\r\n rs = ps.executeQuery(sorgu);\r\n while (rs.next()) {\r\n masa_no = rs.getInt(1);\r\n }\r\n masa_no = masa_no + 1;\r\n String sorgu2 = \"insert into masalar (masa_no, masa_adi) values (\" + masa_no + \", '\" + masa_adi + \"')\";\r\n ps = vb.con.prepareStatement(sorgu2);\r\n ps.executeUpdate();\r\n String sorgu3 = \"insert into masa_durum (masa_no, durum) values (\" + masa_no + \", 0)\";\r\n ps = vb.con.prepareStatement(sorgu3);\r\n ps.executeUpdate();\r\n return masa_no;\r\n } catch (Exception e) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, e);\r\n return 0;\r\n }\r\n finally{\r\n try {\r\n vb.con.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(masalar.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }", "public java.lang.CharSequence getKullaniciAdi() {\n return kullanici_adi;\n }", "Kerucut(){\r\n Tabung tab = new Tabung();\r\n tinggi=tab.getTinggi();\r\n }", "public int CheckKARute(String kodeKA){\n int i;\n boolean found = false;\n ArrayList<Rute> rute = ctrUtil.getRute();\n for (i=0; i < rute.size(); i++) {\n for(int j=0;j<rute.get(i).getKereta().size();j++) {\n if (kodeKA.equals(rute.get(i).getKereta().get(j).getKodeKereta())) {\n found = true;\n break;\n }\n }\n }\n if(found) return i;\n else return -1;\n }", "public void tampilKarakterC(){\r\n System.out.println(\"Saya adalah binatang \");\r\n }", "String getTitolo();", "public int getEmpatadas(){\n\t\treturn empatadas;\n\t}", "public Asiakas(){\n\t\tid++;\n\t\tbussiNumero = new Random().nextInt(OmaMoottori.bussienMaara);\n\t\tsaapumisaika = Kello.getInstance().getAika();\n\t}", "public java.lang.CharSequence getKullaniciAdi() {\n return kullanici_adi;\n }", "public abstract String dohvatiKontakt();", "public int getTCYoneticiKodu() {\n return tcYoneticiKodu;\n }", "@Override\n\tpublic int hitungPemasukan() {\n\t\treturn getHarga() * getPenjualan();\n\t}", "public static String getPelottavaNimi() {\n int indeksi = random.nextInt(pelottavatNimet.length);\n return pelottavatNimet[indeksi];\n }", "public void setKota1(String tempatKerja) {\n\t\t\n\t}", "@GET\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response getTipos() {\n\t\tRotondAndesTM tm = new RotondAndesTM(getPath());\n\t\tList<Tipo> Tipos;\n\t\ttry {\n\t\t\tTipos = tm.darTipos();\n\t\t} catch (Exception e) {\n\t\n\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\n\t\t}\n\t\treturn Response.status(200).entity(Tipos).build();\n\t}", "public void testNamaPNSYangSkepnyaDiterbitkanOlehPresiden(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getNamaPNSYangSkepnyaDiterbitkanOlehPresiden(); \n\n\t\tshowData(data,\"nip\",\"nama\",\"tanggal_lahir\",\"tanggal_berhenti\",\"pangkat\",\"masa_kerja\",\"penerbit\");\n\t}", "public String tampilkanBooking() {\r\n int i = 0;\r\n String Tampil = \"\";\r\n for (Tamu guest : tamu) {\r\n Tampil =\"==========================================\" +\r\n \"\\nHasil Booking Anda : \" +\r\n \"\\nNama : \" + guest.getNama() +\r\n \"\\nNo telp anda : \" + guest.getNoTelp() +\r\n \"\\nAnda adalah : \" + guest.getCustomerType() + \" \" + guest.getDataAnda() +\r\n \"\\nJumlah kamar yang dipesan : \" + guest.getJumlahKamar() +\r\n \"\\nhari : \" + getLama() +\r\n \"\\nTanggal anda booking : \" + booking.get(i).getTglBooking() +\r\n \"\\nTanggal Check-In anda : \" + booking.get(i).getTglCheckIn() +\r\n \"\\nTotal harga : \" + TotalHarga(guest) +\r\n \"\\ncheck In : \" + guest.getStatus() +\r\n \"\\n\" + jeniskamar.FasilitasJenisK();\r\n i += 1;\r\n }\r\n return Tampil;\r\n }", "public long getIdCargaTienda();", "public static void alamatPerusahaan() {\r\n System.out.println(\"Karyawan bekerja di Perusahaan \" + Employee.perusahaan + \" yang beralamat di Jalan Astangkuri Jakarta\");\r\n }", "public java.lang.CharSequence getNamaKelas() {\n return nama_kelas;\n }", "public void getTanggalKelahiran() {\r\n Date tanggalKelahiran = new Date(getTahunLahir() - 1900, getBulanLahir() - 1, getTanggalLahir());\r\n SimpleDateFormat ft = new SimpleDateFormat(\"dd - MM - yyyy\");\r\n System.out.println(ft.format(tanggalKelahiran));\r\n }", "public static void tambahDepan() {\n String NAMA;\n String ALAMAT;\n int UMUR;\n char JEKEL;\n String HOBI[] = new String[3];\n float IPK;\n Scanner masukan = new Scanner(System.in);\n int bacaTombol = 0;\n System.out.println(\"\\nTAMBAH DEPAN : \");\n System.out.print(\"Silakan masukkan nama anda : \");\n NAMA = masukan.nextLine();\n System.out.print(\"Silakan masukkan alamat anda: \");\n ALAMAT = masukan.nextLine();\n System.out.print(\"Silakan masukkan umur anda : \");\n UMUR = masukan.nextInt();\n System.out.print(\"Silakan masukkan Jenis Kelamin anda : \");\n\n try {\n bacaTombol = System.in.read();\n } catch (java.io.IOException e) {\n }\n\n JEKEL = (char) bacaTombol;\n System.out.println(\"Silakan masukkan hobi (maks 3) : \");\n System.out.print(\"hobi ke-0 : \");\n HOBI[0] = masukan.next();\n System.out.print(\"hobi ke-1 : \");\n HOBI[1] = masukan.next();\n System.out.print(\"hobike- 2 : \");\n HOBI[2] = masukan.next();\n System.out.print(\"Silakan masukkan IPK anda : \");\n IPK = masukan.nextFloat();\n\n // -- -- -- -- -- --bagian menciptakan & mengisi simpul baru--------------\n simpul baru;\n baru = new simpul();\n baru.nama = NAMA;\n baru.alamat = ALAMAT;\n baru.umur = UMUR;\n baru.jekel = JEKEL;\n baru.hobi[0] = HOBI[0];\n baru.hobi[1] = HOBI[1];\n baru.hobi[2] = HOBI[2];\n baru.ipk = IPK;\n\n //-- -- -- --bagian mencangkokkan simpul baru ke dalam simpul lama--- ----- --\n if (awal == null) // jika senarai masih kosong\n {\n awal = baru;\n akhir = baru;\n baru.kiri = null;\n baru.kanan = null;\n } else // jika senarai tidak kosong\n {\n baru.kanan = awal;\n awal.kiri = baru;\n awal = baru;\n awal.kiri = null;\n }\n }", "public String getMA_KHOA()\n {\n return this.MA_KHOA;\n }", "public void isiPilihanDokter() {\n String[] list = new String[]{\"\"};\n pilihNamaDokter.setModel(new javax.swing.DefaultComboBoxModel(list));\n\n /*Mengambil data pilihan spesialis*/\n String nama = (String) pilihPoliTujuan.getSelectedItem();\n String kodeSpesialis = ss.serviceGetIDSpesialis(nama);\n\n /* Mencari dokter where id_spesialis = pilihSpesialis */\n tmd.setData(ds.serviceGetAllDokterByIdSpesialis(kodeSpesialis));\n int b = tmd.getRowCount();\n\n /* Menampilkan semua nama berdasrkan pilihan sebelumnya */\n pilihNamaDokter.setModel(new javax.swing.DefaultComboBoxModel(ds.serviceTampilNamaDokter(kodeSpesialis, b)));\n }", "public final int getSarakeMuuttujatAihe() {\r\n return sarakeMuuttujatAihe;\r\n }", "public int getTempoPatrulha() {\n return tempoPatrulha;\n }", "public static void tambahTengah() {\n Scanner masukan = new Scanner(System.in);\n System.out.println(\"\\nTentukan Lokasi Penambahan Data\");\n int LOKASI = masukan.nextInt();\n masukan.nextLine();\n\n int jumlahSimpulYangAda = hitungJumlahSimpul();\n if (LOKASI == 1) {\n System.out.println(\"Lakukan penambahan di depan\");\n } else if (LOKASI > jumlahSimpulYangAda) {\n System.out.println(\"Lakukan penambahan di belakang\");\n } else {\n\n //------------bagian entri data dari keyboard--------------\n String NAMA;\n String ALAMAT;\n int UMUR;\n char JEKEL;\n String HOBI[] = new String[3];\n float IPK;\n int bacaTombol = 0;\n System.out.println(\"\\nTAMBAH TENGAH : \");\n System.out.print(\"Silakan masukkan nama anda : \");\n NAMA = masukan.nextLine();\n System.out.print(\"Silakan masukkan alamat anda: \");\n ALAMAT = masukan.nextLine();\n System.out.print(\"Silakan masukkan umur anda : \");\n UMUR = masukan.nextInt();\n System.out.print(\"Silakan masukkan Jenis Kelamin anda : \");\n\n try {\n bacaTombol = System.in.read();\n } catch (java.io.IOException e) {\n }\n\n JEKEL = (char) bacaTombol;\n System.out.println(\"Silakan masukkan hobi (maks 3) : \");\n System.out.print(\"hobi ke-0 : \");\n HOBI[0] = masukan.next();\n System.out.print(\"hobi ke-1 : \");\n HOBI[1] = masukan.next();\n System.out.print(\"hobike- 2 : \");\n HOBI[2] = masukan.next();\n System.out.print(\"Silakan masukkan IPK anda : \");\n IPK = masukan.nextFloat();\n\n //-- -- -- -- -- --bagian menemukan posisi yang dikehendaki-----------\n simpul bantu;\n bantu = awal;\n int i = 1;\n while ((i < LOKASI)\n && (bantu != akhir)) {\n bantu = bantu.kanan;\n i++;\n }\n\n // -- -- -- -- -- --bagian menciptakan & mengisi simpul baru-----------\n simpul baru = new simpul();\n baru.nama = NAMA;\n baru.alamat = ALAMAT;\n baru.umur = UMUR;\n baru.jekel = JEKEL;\n baru.hobi[0] = HOBI[0];\n baru.hobi[1] = HOBI[1];\n baru.hobi[2] = HOBI[2];\n baru.ipk = IPK;\n\n //-- -- --bagian mencangkokkan simpul baru ke dalam linkedlist lama------\n baru.kiri = bantu.kiri;\n baru.kiri.kanan = baru;\n baru.kanan = bantu;\n bantu.kiri = baru;\n }\n }", "public java.lang.CharSequence getNamaKelas() {\n return nama_kelas;\n }", "public MatkaKokoelma() {\n tallentaja = new TXTTallentaja();\n matkat = new ArrayList<Matka>();\n matkojenkesto = 0.0;\n }", "TipeLayanan(String deskripsi)\r\n {\r\n this.deskripsi = deskripsi;\r\n }", "public void testNamaPnsYangPensiunTahunIni(){\n\t\tSkppPegawai objskp =new SkppPegawai();\n\n\t\tJSONArray data = objskp.getNamaPnsYangPensiunTahunIni(); \n\n\t\tshowData_YangpensiunTahunini(data,\"nip\",\"nama\",\"tmtpensiun\");\n\t}", "public void checkin(Tamu t,Kamar k, int jumHari) {\n //Menginap m = new Menginap(k,t,jumHari);\n //tagihan mulai dibuat disini\n Tagihan tagihan = new Tagihan(t);\n tagihan.tamu = t;\n daftarTagihan.put(t.id,tagihan);\n FasilitasKamar fk = new FasilitasKamar(k);\n fk.jumHari = jumHari;\n tagihan.addFasilitas(fk);\n k.isKosong = false;\n }", "public static void main(String[] args) {\n int T;\n\n //Program\n System.out.println(\"\\nProgram untuk mengetahui bentuk air \");\n System.out.println(\"Silahkan masukan suhu air : \");\n\n //membuat Scanner untuk input\n Scanner baca = new Scanner(System.in);\n T = baca.nextInt();\n\n //Blok b=percabangan\n if(T < 0 ){\n System.out.println(\"Wujud Air beku \" + T);\n }else if(0 <= T && T<=100){\n System.out.println(\"Wujud air cair \" + T );\n }else{\n System.out.println(\"Wujud Air uap/gas \" + T);\n }\n }", "public void setKelas(String sekolah){\n\t\ttempat = sekolah;\n\t}", "public String getTieteellinenNimi() {\n return this.tieteellinen_nimi;\n }", "public String getNamaKlinik() {\n return namaKlinik;\r\n }", "public java.lang.CharSequence getKullaniciSoyadi() {\n return kullanici_soyadi;\n }", "public int getTrangthaiChiTiet();", "public String getId_Pelanggan(){\r\n \r\n return id_pelanggan;\r\n }", "public String getKetuInfo() {\n\t\treturn null;\r\n\t}", "protected Kazan[] getKazans(){\n return kazans;\n }" ]
[ "0.8275748", "0.6385283", "0.6362171", "0.63593686", "0.613737", "0.611015", "0.60414493", "0.60271084", "0.60222316", "0.6015125", "0.5999874", "0.5985844", "0.5932727", "0.59260476", "0.59130263", "0.5900422", "0.5857419", "0.5846312", "0.5821857", "0.57992196", "0.57968396", "0.57922107", "0.5788971", "0.57740545", "0.57522655", "0.57483405", "0.5737519", "0.5731699", "0.5720415", "0.57136756", "0.57041067", "0.56991553", "0.5696861", "0.5693643", "0.56726205", "0.5671901", "0.5659588", "0.56570786", "0.56481326", "0.5640563", "0.56346613", "0.56329894", "0.5629602", "0.5619806", "0.5615903", "0.5611112", "0.5602429", "0.5592334", "0.55899894", "0.5584499", "0.55748165", "0.5568926", "0.55603135", "0.5556189", "0.55556744", "0.55546725", "0.5551901", "0.55469364", "0.55349725", "0.5533651", "0.55321425", "0.55283654", "0.5527683", "0.5523944", "0.5520597", "0.5519754", "0.55174345", "0.5512825", "0.5512211", "0.5510216", "0.55090016", "0.5504842", "0.54965734", "0.54894865", "0.54876924", "0.54837537", "0.54820305", "0.54812217", "0.5480522", "0.547719", "0.5470459", "0.54565036", "0.54459715", "0.5436854", "0.5436534", "0.5434553", "0.54341775", "0.54202247", "0.54186577", "0.5405548", "0.5399101", "0.5397897", "0.5394853", "0.53841186", "0.53758967", "0.5375036", "0.53621316", "0.5357788", "0.5355891", "0.53495044" ]
0.83340114
0
Method dari setDailyTariff Set nilai return dari DailyTariff di kelas Super PremiumRoom
public void setDailyTariff(double dailyTariff) { super.setDailyTariff(dailyTariff*DISCOUNT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setDailyValues(){\n //set updateTime\n SimpleDateFormat t = new SimpleDateFormat(\"h:mm:ss a\");\n updatedTime = \"Last updated: \" + t.format(new Date(System.currentTimeMillis()));\n \n //set maxTemp and minTemp\n maxTemp = Integer.toString(weather.getMaxTemp());\n minTemp = Integer.toString(weather.getMinTemp());\n \n //set sunriseTime and sunsetTime\n SimpleDateFormat sr = new SimpleDateFormat(\"h:mm a\");\n sunriseTime = sr.format(new Date(weather.getSunrise()*1000));\n SimpleDateFormat ss = new SimpleDateFormat(\"h:mm a\");\n sunsetTime = sr.format(new Date(weather.getSunset()*1000));\n }", "public void setupDays() {\n\n //if(days.isEmpty()) {\n days.clear();\n int day_number = today.getActualMaximum(Calendar.DAY_OF_MONTH);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEEE\");\n SimpleDateFormat sdfMonth = new SimpleDateFormat(\"MMM\");\n today.set(Calendar.DATE, 1);\n for (int i = 1; i <= day_number; i++) {\n OrariAttivita data = new OrariAttivita();\n data.setId_utente(mActualUser.getID());\n\n //Trasformare in sql date\n java.sql.Date sqldate = new java.sql.Date(today.getTimeInMillis());\n data.setGiorno(sqldate.toString());\n\n data.setDay(i);\n data.setMonth(today.get(Calendar.MONTH) + 1);\n\n data.setDay_of_week(today.get(Calendar.DAY_OF_WEEK));\n Date date = today.getTime();\n String day_name = sdf.format(date);\n data.setDay_name(day_name);\n data.setMonth_name(sdfMonth.format(date));\n\n int indice;\n\n if (!attivitaMensili.isEmpty()) {\n if ((indice = attivitaMensili.indexOf(data)) > -1) {\n OrariAttivita temp = attivitaMensili.get(indice);\n if (temp.getOre_totali() == 0.5) {\n int occurence = Collections.frequency(attivitaMensili, temp);\n if (occurence == 2) {\n for (OrariAttivita other : attivitaMensili) {\n if (other.equals(temp) && other.getCommessa() != temp.getCommessa()) {\n data.setOtherHalf(other);\n data.getOtherHalf().setModifica(true);\n }\n }\n\n }\n }\n data.setFromOld(temp);\n data.setModifica(true);\n }\n }\n isFerie(data);\n\n\n //Aggiungi la data alla lista\n days.add(data);\n\n //Aggiugni un giorno alla data attuale\n today.add(Calendar.DATE, 1);\n }\n\n today.setTime(actualDate);\n\n mCalendarAdapter.notifyDataSetChanged();\n mCalendarList.setAdapter(mCalendarAdapter);\n showProgress(false);\n }", "@Scheduled(fixedRate = 19000)\n public void tesk() {\n\t\tDateFormat df = new SimpleDateFormat(\"MM/dd/yyyy\");\n DateFormat tf =new SimpleDateFormat(\"HH:mm\");\n\t\t// Get the date today using Calendar object.\n\t\tDate today = Calendar.getInstance().getTime(); \n\t\t// Using DateFormat format method we can create a string \n\t\t// representation of a date with the defined format.\n\t\tString reportDate = df.format(today);\n\t\tString repo = tf.format(today);\n\t\tSystem.out.println(\"Report Date: \" + reportDate);\n \n\t\t List<Tacher> tacher= tacherservice.findBydatetime(today, repo);\n\t\t\n\t\t if (tacher!=null){\t \n \t\t for(int i=0; i<tacher.size(); i++) {\n \t\t\t Tacher current = tacher.get(i);\n \t\t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut()); \n \t\t tacherservice.metajourtacher(current.getId());\n \t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut());\n \t\t } ///// fermeteur de for \n\t\t }//fermeteur de if\n\t}", "public Trimestre(){\n id_trimestre=0;\n numero=0;\n debut_trimestre= new Date(2012,8,12);\n fin_trimestre=new Date(2013,1,13);\n id_anneeScolaire=0;\n }", "private void setDayCountDown() {\n dayCountDown = getMaxHunger();\n }", "public void setTanggal(Date tanggal) {\n this.tanggal = tanggal;\n }", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n Calendar tmp_Calen = Calendar.getInstance();\n tmp_Calen.set(year, monthOfYear, dayOfMonth);\n if(tmp_Calen.compareTo(purCalen) < 0)\n {\n Toast.makeText(FoodInputActivity.this, \"구매일자 이전의 날짜는 선택하실 수 없습니다.\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n shelfCalen.set(year, monthOfYear, dayOfMonth);\n shelDateBtn.setText(year+\"년 \"+(monthOfYear+1)+\"월 \"+ dayOfMonth+\"일\");\n }\n// long diff = TimeUnit.MILLISECONDS.toDays(Math.abs(shelfCalen.getTimeInMillis() - purCalen.getTimeInMillis()));\n// Log.e(\"good\", \"D-Day : \" + diff);\n\n// String msg = String.format(\"%d / %d / %d\", year,monthOfYear+1, dayOfMonth);\n// Toast.makeText(FoodInputActivity.this, msg, Toast.LENGTH_SHORT).show();\n }", "public void setGeboorteDatum(int geboorteDag, int geboorteMaand, int geboorteJaar)\n {\n switch (geboorteMaand){\n case 1 : \n case 3 :\n case 5 :\n case 7 :\n case 8 :\n case 10:\n case 12:\n if (geboorteDag >= 1 && geboorteDag <= 31){\n this.geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else {\n System.out.println (\"Dag voldoet niet aan de voorwaarden.\"); \n }\n break ;\n case 4 :\n case 6 :\n case 9 :\n case 11:\n if (geboorteDag >= 1 && geboorteDag <= 30){\n this.geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else {\n System.out.println (\"Dag voldoet niet aan de voorwaarden deze maand heeft geen 31 dagen.\");\n\n }\n break ;\n case 2 :\n if(geboorteJaar % 4 == 0)\n {\n if((geboorteJaar % 100 == 0) && (geboorteJaar % 400 != 0))\n {\n isSchrikkeljaar = false;\n }\n else\n {\n isSchrikkeljaar = true;\n }\n }\n else\n {\n isSchrikkeljaar = false;\n } \n\n if(isSchrikkeljaar == false)\n {\n if(geboorteDag >= 1 && geboorteDag <= 28){\n geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else{\n geboorteDag = 0;\n geldigeDag = false;\n System.out.println (\"deze maand gaat maar tot 28 dagen\");\n }\n }\n\n if(isSchrikkeljaar == true)\n {\n if(geboorteDag >= 1 && geboorteDag <= 29){\n geboorteDag = geboorteDag;\n geldigeDag = true;\n }\n else{\n geboorteDag = 0;\n geldigeDag = false;\n System.out.println (\"deze maand gaat maar tot 29 dagen\");\n }\n }\n break ;\n }\n\n if (geboorteMaand >= 1 && geboorteMaand <= 12 && geldigeDag == true){\n this.geboorteMaand = geboorteMaand;\n }\n else {\n System.out.println (\"Maand voldoet niet aan de voorwaarden.\");\n geboorteMaand = 0;\n }\n\n if (geboorteJaar >= 1900 && geboorteJaar <= 2100 && geldigeDag == true){\n this.geboorteJaar = geboorteJaar;\n }\n else {\n System.out.println (\"Jaar voldoet niet aan de voorwaarden.\");\n geboorteJaar = 0;\n } \n }", "public void setDailyTime(int nHour, int nMin)\n\t{\n\t\tsetType(AT_DAILY);\n\t\tsetHour(nHour);\n\t\tsetMinute(nMin);\n\t\tsetData(null);\n\t}", "public void setUpddte(Date upddte) {\r\n this.upddte = upddte;\r\n }", "protected void onSetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "public void toPunish() {\n\n //// TODO: 24/03/2017 delete the following lines\n// dalDynamic.addRowToTable2(\"23/03/2017\",\"Thursday\",4,walkingLength,deviation)\n\n\n\n int dev,sum=0;\n long id;\n id=dalDynamic.getRecordIdAccordingToRecordName(\"minutesWalkTillEvening\");\n Calendar now = Calendar.getInstance();//today\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat dateFormat=new SimpleDateFormat(\"dd/MM/yyyy\");\n String date;\n for (int i = 0; i <DAYS_DEVIATION ; i++) {\n date=dateFormat.format(calendar.getTime());\n Log.v(\"Statistic\",\"date \"+date);\n dev = dalDynamic.getDeviationAccordingToeventTypeIdAnddate(id,date);\n sum+=dev;\n calendar.add(Calendar.DATE,-1);//// TODO: -1-i????\n }\n if(sum==DAYS_DEVIATION){\n Intent intent = new Intent(context,BlankActivity.class);\n context.startActivity(intent);\n //todo:punishment\n }\n\n }", "public int getSettlementDays() {\n return _settlementDays;\n }", "private void getData(int day){\n try {\n String today = DateUtilities.getCurrentDateInString();\n DateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date currentDate = dateFormat.parse(today);\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(currentDate);\n calendar.add(Calendar.DAY_OF_YEAR,-day);\n Date datebefore = calendar.getTime();\n String dateBeforeStr = dateFormat.format(datebefore);\n\n stepsTakenModels = db.stepsTakenDao().getStepsTakenInrange(dateBeforeStr,today);\n// stepsTakenModels.addAll(db.stepsTakenDao().getStepsTakenInrange(\"01-10-2019\",today));\n\n for(int i = 0 ; i < 7 ; i++){\n stepsTakenModelsLastWeek.add(stepsTakenModels.get(i));\n }\n\n for(int i = 7 ; i<stepsTakenModels.size() ; i++){\n stepsTakenModelsThisWeek.add(stepsTakenModels.get(i));\n }\n// if(stepsTakenModelsThisWeek.size()==0){\n// StepsTakenModel stepsTakenModel = new StepsTakenModel();\n// stepsTakenModel.setSteps(659);\n// stepsTakenModel.setDate(today);\n// stepsTakenModelsThisWeek.add(stepsTakenModel);\n// }\n\n }catch (Exception e){\n Log.d(\"TAG\",e.getMessage());\n }\n }", "public void setDate(DateInfo dates) {\r\n\t\tsuper.setDate(dates);\r\n\t\t//maturityDate = new DateInfo(dates);\r\n\t}", "protected int getTreinAantal(){\r\n return treinaantal;\r\n }", "public void liquidarEmpleado(Fecha fechaLiquidacion) {\n //COMPLETE\n double prima=0; \n boolean antiguo=false;\n double aniosEnServicio=fechaLiquidacion.getAnio()-this.fechaIngreso.getAnio();\n if(aniosEnServicio>0&&\n fechaLiquidacion.getMes()>this.fechaIngreso.getMes())\n aniosEnServicio--; \n \n //System.out.println(\"A:\"+aniosEnServicio+\":\"+esEmpleadoLiquidable(fechaLiquidacion));\n if(esEmpleadoLiquidable(fechaLiquidacion)){\n this.descuentoSalud=salarioBase*0.04;\n this.descuentoPension=salarioBase*0.04;\n this.provisionCesantias=salarioBase/12;\n if(fechaLiquidacion.getMes()==12||fechaLiquidacion.getMes()==6)\n prima+=this.salarioBase*0.5; \n if(aniosEnServicio<6&&\n fechaLiquidacion.getMes()==this.fechaIngreso.getMes())prima+=((aniosEnServicio*5)/100)*this.salarioBase;\n if(aniosEnServicio>=6&&fechaLiquidacion.getMes()==this.fechaIngreso.getMes()) prima+=this.salarioBase*0.3;\n\n this.prima=prima;\n this.setIngresos(this.salarioBase+prima);\n \n this.setDescuentos(this.descuentoSalud+this.descuentoPension);\n this.setTotalAPagar(this.getIngresos()-this.getDescuentos());\n }\n\n }", "public void getTanggalKelahiran() {\r\n Date tanggalKelahiran = new Date(getTahunLahir() - 1900, getBulanLahir() - 1, getTanggalLahir());\r\n SimpleDateFormat ft = new SimpleDateFormat(\"dd - MM - yyyy\");\r\n System.out.println(ft.format(tanggalKelahiran));\r\n }", "public abstract void aktualisiereZeitpunk(int momentanZeitpunkt);", "public void setTipoFecha(int tipoFecha)\n {\n tipFecha=tipoFecha;\n }", "private String calculaTempo(Date dtTileLine) {\n\t\treturn \"2 minutos atrás (\"+dtTileLine.toString()+\")\";\n\t}", "public void Raport2(){\r\n try {\r\n Long id = idUtilizatorCurent;\r\n System.out.println(id);\r\n Utilizator u = service.findOne(id);\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MM/dd/yyyy\");\r\n model.setAll(\r\n creareLista(u.getId())\r\n );\r\n Utilizator prieten = tableView.getSelectionModel().getSelectedItem();\r\n\r\n if (u == null)\r\n MessageAlert.showErrorMessage(null, \"Nu am gasit userul\");\r\n else if (prieten == null)\r\n MessageAlert.showErrorMessage(null, \"Nu ati selectat niciun prieten\");\r\n else if (DataPickerData.getEditor().getText().equals(\"\") ||\r\n DataPickerDataFinal.getEditor().getText().equals(\"\")) {\r\n MessageAlert.showErrorMessage(null, \"Una dintre date este vida!\");\r\n return;\r\n }\r\n\r\n String data = DataPickerData.getEditor().getText();\r\n List<String> attr = Arrays.asList(data.split(\"/\"));\r\n String data1 = \"\";\r\n if (attr.get(1).length() == 1 || attr.get(0).length() == 1) {\r\n for (String s : attr) {\r\n if (s.equals(attr.get(1)) && attr.get(1).length() == 1) {\r\n data1 = data1 + \"0\" + s + \"/\";\r\n } else if (s.equals(attr.get(0)) && attr.get(0).length() == 1) {\r\n data1 = data1 + \"0\" + s + \"/\";\r\n } else {\r\n data1 = data1 + s + \"/\";\r\n }\r\n }\r\n data1 = data1.substring(0, 10);\r\n } else data1 = data;\r\n\r\n LocalDateTime d = LocalDate.parse(data1, formatter).atStartOfDay();\r\n String datafinal = DataPickerDataFinal.getEditor().getText();\r\n List<String> attr1 = Arrays.asList(datafinal.split(\"/\"));\r\n String data2 = \"\";\r\n if (attr1.get(1).length() == 1 || attr1.get(0).length() == 1) {\r\n for (String s : attr1) {\r\n if (s.equals(attr1.get(1)) && attr1.get(1).length() == 1) {\r\n data2 = data2 + \"0\" + s + \"/\";\r\n } else if (s.equals(attr1.get(0)) && attr1.get(0).length() == 1) {\r\n data2 = data2 + \"0\" + s + \"/\";\r\n } else {\r\n data2 = data2 + s + \"/\";\r\n }\r\n }\r\n data2 = data2.substring(0, 10);\r\n } else data2 = datafinal;\r\n LocalDateTime d2 = LocalDate.parse(data2, formatter).atStartOfDay();\r\n List<String> rez = service.getMesajeDelaPrieten(u, prieten, d, d2);\r\n //for (String s : rez) System.out.println(s);\r\n CreatePdf createPdf = new CreatePdf();\r\n createPdf.creare(rez, \"C:\\\\Users\\\\alini\\\\Desktop\\\\pdfCerinta2.pdf\", \"Raport mesaje primite pentru \" + u.getFirstName()+\" \" + u.getLastName());\r\n MessageAlert.showMessage(null, Alert.AlertType.INFORMATION, \"Generare raport\", \"Raportul a fost generat cu succes!\");\r\n } catch (Exception e) {\r\n // MessageAlert.showErrorMessage(null,\"Selectati un user din tabel\");\r\n }\r\n\r\n }", "public synchronized void updateTransdailyData() {\n Instant startTime = Instant.now();\n log.debug(\"start updateTransdailyData startTime:{}\", startTime.toEpochMilli());\n try {\n\n // query all group statistical info\n List<StatisticalGroupTransInfo> groupStatisticalList = groupService\n .queryLatestStatisticalTrans();\n\n // traverse group list\n traverseNetList(groupStatisticalList);\n\n } catch (Exception ex) {\n log.error(\"fail updateTransdailyData\", ex);\n }\n log.debug(\"end updateTransdailyData useTime:{}\",\n Duration.between(startTime, Instant.now()).toMillis());\n }", "public void papierkorbAnzeigen() {\n\t\tfor (Datei a:papierkorb) {\n\t\t\ta.anzeigeDateiDetail();\n\t\t}\n\t}", "private void Calculation() {\n\t\tint calStd = jetztStunde + schlafStunde;\n\t\tint calMin = jetztMinute + schlafMinute;\n\n\t\ttotalMin = calMin % 60;\n\t\ttotalStunde = calStd % 24 + calMin / 60;\n\n\t}", "@Test\n\tpublic void testSetFecha7(){\n\t\tPlataforma.closePlataforma();\n\t\t\n\t\tfile = new File(\"./data/plataforma\");\n\t\tfile.delete();\n\t\tPlataforma.openPlataforma();\n\t\tPlataforma.login(\"1\", \"contraseniaprofe\");\n\t\t\n\t\tPlataforma.setFechaActual(Plataforma.fechaActual.plusDays(2));\n\t\tej1.responderEjercicio(nacho, array);\n\t\t\t\t\n\t\tLocalDate fin = Plataforma.fechaActual.plusDays(10);\n\t\tLocalDate ini = Plataforma.fechaActual.plusDays(3);\n\t\tassertTrue(ej1.setFechaFin(fin));\n\t\tassertFalse(ej1.setFechaIni(ini));\n\t}", "private String calculateFertileDays() {\n int year = datePicker.getYear();\n int month = datePicker.getMonth();\n int day = datePicker.getDayOfMonth();\n\n //pravia si dva kalendara. I dvata sega sochat kam parvia den ot predishnia menstrualen cikal\n Calendar firstFertileDay = new GregorianCalendar(year,month,day);\n Calendar lastFertileDay = new GregorianCalendar(year,month,day);\n\n\n\n //izchisliavane na dnite\n firstFertileDay.add(Calendar.DAY_OF_MONTH, (averageLengthOfMenstrualCycle - 17));\n lastFertileDay.add(Calendar.DAY_OF_MONTH, (averageLengthOfMenstrualCycle - 12));\n\n //sastaviane na message\n String first = firstFertileDay.get(Calendar.DAY_OF_MONTH) + \" \" +\n new DateFormatSymbols().getMonths()[firstFertileDay.get(Calendar.MONTH)] + \" \" +\n firstFertileDay.get(Calendar.YEAR);\n\n String last = lastFertileDay.get(Calendar.DAY_OF_MONTH) + \" \" +\n new DateFormatSymbols().getMonths()[lastFertileDay.get(Calendar.MONTH)] + \" \" +\n lastFertileDay.get(Calendar.YEAR);\n String messageToDisplay = \"You are ready for sex from \" + first +\n \" until \" + last ;\n\n return messageToDisplay;\n }", "@Override\n\tprotected void setNextSiegeDate()\n\t{\n\t\tif(_siegeDate.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())\n\t\t{\n\t\t\t_siegeDate = Calendar.getInstance();\n\t\t\t// Осада не чаще, чем каждые 4 часа + 1 час на подготовку.\n\t\t\tif(Calendar.getInstance().getTimeInMillis() - getSiegeUnit().getLastSiegeDate() * 1000L > 14400000)\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 1);\n\t\t\telse\n\t\t\t{\n\t\t\t\t_siegeDate.setTimeInMillis(getSiegeUnit().getLastSiegeDate() * 1000L);\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 5);\n\t\t\t}\n\t\t\t_database.saveSiegeDate();\n\t\t}\n\t}", "public void recomendarTempos() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXCH = CFusionar.arregloPPTX1;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXCH = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXDB = CFusionar.arregloPPTX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXDB = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYCH = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYCH = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYDB = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYDB = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZCH = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZCH = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZDB = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZDB = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(paTZDB.get(iposision).toString());\n }\n\n }", "protected boolean setDailyTimerSetting(byte[] edt) {return false;}", "public void setFiNgayDk(Date fiNgayDk) {\n this.fiNgayDk = fiNgayDk;\n }", "public void TemperaturaDentroDoPermitido() {\n\t\tSystem.out.println(\"Temperatura: \" + temperaturaAtual);\n\t\t// verifica se a temperatua esta abaixo do permitido\n\t\tif (temperaturaAtual < temperaturaMinimaPermitida) {\n\t\t\tSystem.out.println(\"Temperatura abaixo do permitido, Alerta!!\");\n\t\t}\n\t\t// verifica se a temperatura esta acima do permitido\n\t\telse if (temperaturaAtual > temperaturaMaximaPermitida) {\n\t\t\tSystem.out.println(\"Temperatura acima do permitido, Alerta!!\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Temperatura OK!!\");\n\t\t}\n\t}", "public Double getTotalOliDOdeEnvasadoresEntreDates(Long temporadaId, Date dataInici, Date dataFi, Integer idAutorizada) throws InfrastructureException {\r\n\t\tlogger.debug(\"getTotalOliDOdeEnvasadoresEntreDates ini\");\r\n//\t\tCollection listaTrasllat = getEntradaTrasladosEntreDiasoTemporadas(temporadaId, dataInici, dataFi);\r\n\t\tCollection listaTrasllat = null;\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\tdouble litros = 0;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString q = \"from Trasllat tdi where tdi.retornatEstablimentOrigen = true \";\r\n\t\t\tif(dataInici != null){\r\n\t\t\t\tString fi = df.format(dataInici);\r\n\t\t\t\tq = q+ \" and tdi.data >= '\"+fi+\"' \";\r\n\t\t\t}\r\n\t\t\tif(dataFi != null){\r\n\t\t\t\tString ff = df.format(dataFi);\r\n\t\t\t\tq = q+ \" and tdi.data <= '\"+ff+\"' \";\r\n\t\t\t}\r\n\t\t\tlistaTrasllat = getHibernateTemplate().find(q);\t\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tlogger.error(\"getTotalOliDOdeEnvasadoresEntreDates failed\", ex);\r\n\t\t\tthrow new InfrastructureException(ex);\r\n\t\t}\r\n\t\t\r\n\t\t//Para cada uno de lor registro Trasllat separamos los depositos y devolvemos un objeto rasllatDipositCommand\r\n\t\tif (listaTrasllat != null){\r\n\t\t\tfor(Iterator it=listaTrasllat.iterator();it.hasNext();){\r\n\t\t\t\tTrasllat trasllat = (Trasllat)it.next();\r\n\t\t\t\tif(trasllat.getDiposits()!= null){\r\n\t\t\t\t\tfor(Iterator itDip=trasllat.getDiposits().iterator();itDip.hasNext();){\r\n\t\t\t\t\t\tDiposit diposit = (Diposit)itDip.next();\r\n\t\t\t\t\t\tif(idAutorizada!= null && diposit.getPartidaOli() != null && diposit.getPartidaOli().getCategoriaOli() !=null && diposit.getPartidaOli().getCategoriaOli()!= null){\r\n\t\t\t\t\t\t\tif(diposit.getPartidaOli().getCategoriaOli().getId().intValue() == idAutorizada.intValue() && diposit.getVolumActual()!= null){\r\n\t\t\t\t\t\t\t\tlitros+= diposit.getVolumActual().doubleValue();\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tlogger.debug(\"getTotalOliDOdeEnvasadoresEntreDates fin\");\r\n\t\treturn Double.valueOf(String.valueOf(litros));\r\n\t}", "public void recomendarTemposEM() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH2.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXCH = CFusionarEM.arregloPPTX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH2.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXCH = CFusionarEM.arregloPATX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH2.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXDB = CFusionarEM.arregloPPTX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXDB = CFusionarEM.arregloPATX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB2.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH2.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYCH = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYCH = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB2.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYDB = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYDB = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH2.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZCH = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZCH = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB2.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZDB = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZDB = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(paTZDB.get(iposision).toString());\n }\n\n }", "public Long calculateTotalAgingForFirstDay(Integer day, LocalDateTime endDateParam, LocalDateTime startDateParam,\n\t\t\tInteger totalSecondRest, List<KPIServiceHourRest> ticketRests) {\n/*\t\t \n * 9:02-8:29-restAging\n *\t\t 8:29:00,9:10:00,\n *\t\t 8:30:00, 9:00\n *\t\t Istirahat jam 8:30-9:00 \n *\t\t long restAging=0L<\n *\t \n *\t if(startDateParam<restStart && startDateParam<restEnd)\n *\t {\n *\t \t\t8:29<8:30 Y, 8:29<9:00 Y\n *\t \t\trestAging=9:00:00-8:30:00\n *\t \t \t 8:29<11:30 Y, 8:29<1:00:00 Y\n *\t \t\trestAging=9:00:00-8:30:00\n *\n *\t \t\t9:10<8:29 N, 9:10<9:00 N\n *\t \t\tbreak;\n *\t \t\t8:29<11:30 Y, 8:29<1:00 Y\n *\t }\n */\n\t\t Long totalAging=new Long(0);\n\t \t Long totalAgingOnRest=0L;\n\t \t for(KPIServiceHourRest ticketRest:ticketRests){\n\t \t\t if(day==ticketRest.getDay()){\n\t \t\t\t LocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t LocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))<=0\n\t\t \t\t && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t \t totalAgingOnRest+=secondTotalAgingBetweenDate(restEnd.toDate().getTime(), restStart.toDate().getTime(), 0L);\n\t\t }\n\t \t\t }\n\t \t }\n\t \t totalAging=secondTotalAgingBetweenDate(endDateParam.toDate().getTime(),startDateParam.toDate().getTime(),totalAgingOnRest);\n return totalAging;\n\t}", "public void setDate(int dt) {\n date = dt;\n }", "public void setLBR_ProtestDays (int LBR_ProtestDays);", "public getForecast() {\n\t\t\n\t\t\n\t\tString finalePrevisioni; //stringa dove metteremo le previsioni\n\t\t\n\t\tFileReader f= null;\n try {\n f =new FileReader(\"Previsioni.txt\");\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n /*\n * quello che facciamo è vedere se la data nel nostro file cosrripsonde alla data di oggi\n */\n \n\n BufferedReader b;\n b=new BufferedReader(f);\n \n String MeteoCorrente = \"\";\n String line = \"\";\n \n try {\n while((line = b.readLine())!=null) {\n MeteoCorrente += line;\n if (MeteoCorrente.length()==19) break;\n // ci basta leggere questi caratteri per scoprire la data\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n \n \n try {\n\t\t\tb.close();\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n \n\t\t\n\t\t\n\t\tString dataFile = MeteoCorrente.substring(9,19);\n\t\t\n\t\t//data di oggi\n \n\t\tDateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"); \n\t\tLocalDateTime now = LocalDateTime.now(); \n\t\t\n\t\tString dataOggi = (String) dtf.format(now);\n\t\t\n\t\t//se le date sono diverse\n\t\t\n\t\tif (!(dataFile.equals(dataOggi))) {\n\t\t\n\t\t//si aggiorna il file di appoggio così da avere i dati sul meteo aggiornati\t\n\t\t// essendo nello stesso package posso invocare il metodo senza dover importare la classe visto che sia\n\t\t//la classe che il metodo sono public\n\t updateWeeklyForecast.update();\n\t\t\t\n\t\tString parte1 = MeteoCorrente.substring(0,9);\n\t\t//si aggiorna la data\n\t\tString parte2 = dataOggi;\n\t\t//le nuove previsoni vengono aggiunte per prime così che ci aiuti nel prelevare i dati più aggiornati\n\t\t//nei metodi successivi\n\t\tString parte3 = MeteoCorrente.substring(19,35);\n\t\t\t\n \n \n\t\tString meteo2 = MeteoCorrente.substring(35);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tFileReader fi= null;\n try {\n fi =new FileReader(\"appoggio.txt\");\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n //appoggio\n\n BufferedReader a;\n a=new BufferedReader(fi);\n \n String meteo = \"\";\n String lin = \"\";\n \n try {\n while((lin = a.readLine())!=null) {\n meteo += lin;\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n \n \n //essendo sotto forma di array rimuoviamo le parentesi quadre\n \n String meteo3 = meteo.substring(1, meteo.length()-1);\n \n File file = new File(\"Previsioni.txt\");\n\t\t\n\t\t FileWriter fileWriter = null;\n\t\t try {\n\t\t fileWriter = new FileWriter(file);\n\t\t } catch (IOException e) {\n\t\t \n\t\t e.printStackTrace();\n\t\t }\n\t\t \n\t\t BufferedWriter bufferedWriter = null;\n\t\t bufferedWriter=new BufferedWriter(fileWriter);\n\t\t \n\t\t //uniamo le varie stringhe così da formare un JSONObject\n\t\t //(a virgola ha questo scopo, infatti noi abbiamo già aggiunto i dati e questo ci aiuta)\n\t\t //(se invece il file fosse vuoto la virgola ci avrebbe creato dei problemi nelle varie codifiche)\n\t\t \n\t\t finalePrevisioni = parte1 + parte2 + parte3 + meteo3 + \", \" + meteo2;\n\t\t \n\t\t \n\t\t try {\n\t\t \tbufferedWriter.write(finalePrevisioni);\n\t\t \t\n\t\t } catch (IOException e) {\n\t\t // TODO Auto-generated catch block\n\t\t e.printStackTrace();\n\t\t }\n\t\t try\n\t\t {\n\t\t if ( bufferedWriter != null)\n\t\t bufferedWriter.close( );\n\t\t }\n\t\t catch ( IOException e) {e.printStackTrace();}\n\t\ttry {\n\t\t\tfileWriter.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n \n\t\n\t\t}\n\t\telse{ // caso in cui il file è già agiornato\n\t\t\t\n\t\t\t\n\t try {\n\t f =new FileReader(\"Previsioni.txt\");\n\t } catch (FileNotFoundException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n\n\t \n\n\n\t BufferedReader c;\n\t c=new BufferedReader(f);\n\t \n\t MeteoCorrente = \"\";\n\t line = \"\";\n\t \n\t \n\t try {\n\t while((line = c.readLine())!=null) {\n\t MeteoCorrente += line;\n\t \n\t }\n\t } catch (IOException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n\t finalePrevisioni = MeteoCorrente;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//prendiamo ora il JSONObject di Previsioni e preleviamo il JSONArry con le previsioni\n\t\t\n\t\tJSONParser parser = new JSONParser();\n\t\tObject obj = null;\n\t\ttry {\n\t\t\tobj = parser.parse(finalePrevisioni);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tJSONObject jsonObject = (JSONObject) obj;\n\t\t\n\t\tthis.previsioni =(JSONArray) jsonObject.get(\"previsioni\");\n\t\t\n\n\t}", "public void minutoStamina(int minutoStamina){\n tiempoReal = (minutoStamina * 6)+10;\n }", "public int getDailyWorkload(){\r\n return dailyWorkload;\r\n }", "public void actualiser(){\n try{\n \t\n /* Memo des variables : horaireDepart tableau de string contenant l'heure de depart entree par l'user\n * heure = heure saisie castee en int, minutes = minutes saisie castee en Integer\n * tpsRest = tableau de string contenant la duree du cours en heure entree par l'user\n * minutage = format minutes horaire = format heure, ils servent a formater les deux variables currentTime qui recuperent l'heure en ms\n * tempsrestant = variable calculant le temps restant en minutes, heurerestante = variable calculant le nombre d'heure restantes\n * heureDuree = duree du cours totale en int minutesDuree = duree totale du cours en minute\n * tempsfinal = temps restant reel en prenant en compte la duree du cours\n * angle = temps radian engleu = temps en toDegrees\n */\n String[] horaireDepart = Reader.read(saisie.getText(), this.p, \"\\\\ \");\n \n //on check si le pattern est bon et si l'utilisateur n'est pas un tard\n if(Reader.isHour(horaireDepart)){\n \t\n int heure = Integer.parseInt(horaireDepart[0]);\n int minutes = Integer.parseInt(horaireDepart[2]);\n minutes += (heure*60);\n String[] tpsrest = Reader.read(format.getText(), this.p, \"\\\\ \");\n \n //conversion de la saisie en SimpleDateFormat pour les calculs\n SimpleDateFormat minutage = new SimpleDateFormat (\"mm\");\n SimpleDateFormat Horaire = new SimpleDateFormat (\"HH\");\n \n //recupere l'heure en ms\n Date currentTime_1 = new Date(System.currentTimeMillis());\n Date currentTime_2 = new Date(System.currentTimeMillis());\n \n //cast en int pour les calculs\n int tempsrestant = Integer.parseInt(minutage.format(currentTime_1));\n int heurerestante = Integer.parseInt(Horaire.format(currentTime_2))*60;\n tempsrestant += heurerestante;\n \n //pareil mais pour la duree\n if(Reader.isHour(tpsrest)){\n int heureDuree = Integer.parseInt(tpsrest[0]);\n int minutesDuree = Integer.parseInt(tpsrest[2]);\n minutesDuree += (heureDuree*60);\n tempsrestant -= minutes;\n int tempsfinal = minutesDuree - tempsrestant;\n \n //conversion du temps en angle pour l'afficher \n double angle = ((double)tempsfinal*2/(double)minutesDuree)*Math.PI;\n int engleu = 360 - (int)Math.toDegrees(angle);\n for(int i = 0; i < engleu; i++){\n this.panne.dessineLine(getGraphics(), i);\n }\n \n //conversion du temps en pi radiant pour l'affichage\n if(tempsfinal < minutesDuree){\n tempsfinal *= 2;\n for(int i = minutesDuree; i > 1; i--){\n if(tempsfinal % i == 0 && minutesDuree % i == 0){\n tempsfinal /= i;\n minutesDuree /= i;\n }\n }\n }\n \n //update l'affichage\n this.resultat.setText(tempsfinal + \"/\" + minutesDuree + \"π radiant\");\n this.resultat.update(this.resultat.getGraphics());\n }\n }\n }catch(FormatSaisieException fse){\n this.resultat.setText(fse.errMsg(this.p.toString()));\n }\n }", "@Override\n public void onDateSet(DatePicker view, int year, int monthOfYear,\n int dayOfMonth) {\n purCalen.set(year, monthOfYear, dayOfMonth);\n purDateBtn.setText(year+\"년 \"+(monthOfYear+1)+\"월 \"+ dayOfMonth+\"일\");\n setShelfCalen();\n// String msg = String.format(\"%d / %d / %d\", year,monthOfYear+1, dayOfMonth);\n// Toast.makeText(FoodInputActivity.this, msg, Toast.LENGTH_SHORT).show();\n }", "public FrecuenciaPorSemana(){\n super(new Hora(0,0));\n dias = new boolean[7];\n for (int i = 0;i<7;i++)\n dias[i] = true;\n }", "public void hora()\n {\n horaTotal = HoraSalida - HoraLlegada;\n\n }", "public static void calculateSettlementDate(DataRow dataRow) {\n // Select proper strategy based on the Currency\n final IWorkingDays workingDaysMechanism = getWorkingDaysStrategy(dataRow.getCurrency());\n\n // find the correct settlement date\n final LocalDate newSettlementDate =\n workingDaysMechanism.findFirstWorkingDate(dataRow.getSettlementDate());\n\n if (newSettlementDate != null) {\n // set the correct settlement date\n dataRow.setSettlementDate(newSettlementDate);\n }\n }", "protected void onGetDailyTimerSetting(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "public void setFiNgaytao(Date fiNgaytao) {\n this.fiNgaytao = fiNgaytao;\n }", "public void setFechaFacturado(java.util.Calendar param){\n \n this.localFechaFacturado=param;\n \n\n }", "private void setDay() {\n Boolean result = false;\n for (int i = 0; i < 7; ++i) {\n if(mAlarmDetails.getRepeatingDay(i))\n result = true;\n mAlarmDetails.setRepeatingDay(i, mAlarmDetails.getRepeatingDay(i));\n }\n if(!result)\n mAlarmDetails.setRepeatingDay((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1), true);\n }", "private void procurarData() {\n if (jDateIni.getDate() != null && jDateFim.getDate() != null) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String data = sdf.format(jDateIni.getDate());\n String data2 = sdf.format(jDateFim.getDate());\n carregaTable(id, data, data2);\n JBreg.setEnabled(false);\n }\n }", "public void setCalDay() {\n\t\tfloat goal_bmr;\n\t\tif(gender==\"male\") {\n\t\t\tgoal_bmr= (float) (10 * (weight+loseGainPerWeek) + 6.25 * height - 5 * age + 5);\n\t\t}\n\t\telse {\n\t\t\tgoal_bmr=(float) (10 * (weight+loseGainPerWeek) + 6.25 * height - 5 * age - 161);\n\t\t}\n\t\tswitch (gymFrequency) {\n\t\tcase 0:calDay = goal_bmr*1.2;\n\t\t\t\tbreak;\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:calDay = goal_bmr*1.375;\n\t\t\t\tbreak;\n\t\tcase 4:\n\t\tcase 5:calDay = goal_bmr*1.55;\n\t\t\n\t\t\t\tbreak;\n\t\tcase 6:\n\t\tcase 7:calDay = goal_bmr*1.725;\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void initTempsPassage() {\r\n\t\tlong dureeTotale = heureDepart.getTime();\r\n\t\ttempsPassage = new Date[getItineraire().size()][2];\r\n\r\n\t\tfor (int i = 0; i < getItineraire().size(); i++) {\r\n\t\t\tfor (int j = 0; j < getItineraire().get(i).getTroncons().size(); j++) {\r\n\t\t\t\tdureeTotale += getItineraire().get(i).getTroncons().get(j).getLongueur() * 1000 / VITESSE;// Duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// des\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// trajets\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// seconde\r\n\r\n\t\t\t}\r\n\t\t\tif (i < listeLivraisons.size()) {\r\n\t\t\t\tif (listeLivraisons.get(i).getDebutPlageHoraire() != null\r\n\t\t\t\t\t\t&& listeLivraisons.get(i).getDebutPlageHoraire().getTime() > dureeTotale) {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t\ttempsPassage[i][1] = new Date(listeLivraisons.get(i).getDebutPlageHoraire().getTime());\r\n\t\t\t\t\tdureeTotale = listeLivraisons.get(i).getDebutPlageHoraire().getTime();\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t}\r\n\t\t\t\tdureeTotale += listeLivraisons.get(i).getDuree() * 1000; // duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// de\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// livraison\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ms\r\n\t\t\t} else {\r\n\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theureArrivee = new Date(dureeTotale);\r\n\t}", "protected final void reduireTempsRestant() {\n arme.reduireTempsRestant();\n }", "public void setInstdte(Date instdte) {\r\n this.instdte = instdte;\r\n }", "@Override\n public void onDateSet(DatePicker view, int year1, int monthOfYear,\n int dayOfMonth) {\n myCalendar.set(Calendar.YEAR, year1);\n myCalendar.set(Calendar.MONTH, monthOfYear);\n myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);\n /* date=dayOfMonth;\n month=monthOfYear;\n year=year1;*/\n if(getAge(year1,monthOfYear,dayOfMonth) >= 18){\n updateLabel();\n }else{\n Utility.showToastMessage(GetUserInfoActivity.this,\"Age should be 18+\");\n }\n\n }", "public static void calculateSettlementDates(Set<DataRow> dataRows) {\n dataRows.forEach(TradeSettlementDateCalculator::calculateSettlementDate);\n }", "@Override\n\tpublic void setNgayXuatBan(java.util.Date ngayXuatBan) {\n\t\t_keHoachKiemDemNuoc.setNgayXuatBan(ngayXuatBan);\n\t}", "public void setDay(int day)\n {\n this.day = day;\n }", "private void getChaRecordNew(TaxChallan taxChallan,Object[][] tdsParameter, Object[][] data) {\r\n\t\tdouble surcharge=0.00,totaltds=0.00;\r\n\t\tdouble educationCess=0.00;\r\n\t\tdouble totTds=0.00,totalTax=0.00;\r\n\t\t\r\n\t\t/**\r\n\t\t * this values are set...because they are used in java script for calculation\r\n\t\t * if in case total tax is changed.\r\n\t\t */\r\n\t\ttaxChallan.setEduCessPercen(String.valueOf(tdsParameter[0][1]));\r\n\t\ttaxChallan.setRebateLimit(String.valueOf(tdsParameter[0][2]));\r\n\t\ttaxChallan.setSurchargePercen(String.valueOf(tdsParameter[0][3]));\r\n\t\t\r\n\t\tint fromYear=0;\r\n\t\tint toYear=0;\r\n\t\tif(Integer.parseInt(taxChallan.getMonth())>=4 && Integer.parseInt(taxChallan.getMonth())<=12) {\r\n\t\t\tfromYear =Integer.parseInt(taxChallan.getYear());\r\n\t\t\ttoYear=fromYear+1;\r\n\t\t } //end of if\r\n\t\telse if(Integer.parseInt(taxChallan.getMonth())>=1 && Integer.parseInt(taxChallan.getMonth())<=3) {\r\n\t\t fromYear =Integer.parseInt(taxChallan.getYear())-1;\r\n\t\t toYear=Integer.parseInt(taxChallan.getYear());\r\n\t\t} //end of else if\t\r\n\t\t\r\n\t\tArrayList<Object> challanList = new ArrayList<Object>();\r\n\t\t\r\n\t\t/*\r\n\t\t * Following loop is used to set the employee id,name,challan tds,challan surcharge,education cess to every employee\r\n\t\t * those who belong to the selected division\r\n\t\t */\r\n\t\tObject empTaxIncome[][] = null;\r\n\t\ttry {\r\n\t\t\tString empIncomeQuery = \"SELECT TO_CHAR(NVL(TDS_TAXABLE_INCOME,0),9999999990.99),TDS_EMP_ID FROM HRMS_TDS \"\r\n\t\t\t\t\t\t\t\t\t+\" WHERE TDS_FROM_YEAR=\"+fromYear+\" AND TDS_TO_YEAR=\"+toYear+\" ORDER BY TDS_EMP_ID\";\r\n\t\t\tempTaxIncome = getSqlModel().getSingleResult(empIncomeQuery);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"exception in empIncomeQuery\",e);\r\n\t\t} //end of catch\r\n\t\t\r\n\t\tString challanCodeQuery =\"SELECT NVL(MAX(CHALLAN_CODE),0)+1 FROM HRMS_TAX_CHALLAN\";\r\n\t\tObject chalCodeObj[][] = getSqlModel().getSingleResult(challanCodeQuery);\r\n\t\t\r\n\t\tString challanCode = String.valueOf(chalCodeObj[0][0]);\r\n\t\t\r\n\t\ttry{\t\r\n\t\t\tfor(int i=0;i<data.length;i++){\r\n\t\t\t\tTaxChallan bean=new TaxChallan(); \r\n\t\t\t\tdouble amount=0.00;\r\n\t\t\t\tObject[][] challanTax = null;\r\n\t\t\t\tdouble chkAmount=0.00;\r\n\r\n\t\t\t\tif(empTaxIncome!=null && empTaxIncome.length!=0){\r\n\t\t\t\t\tfor (int j = 0; j < empTaxIncome.length; j++) {\r\n\t\t\t\t\t\t if(String.valueOf(empTaxIncome[j][1]).equals(String.valueOf(data[i][0]))){\r\n\t\t\t\t\t\t\t amount=Double.parseDouble(String.valueOf(empTaxIncome[j][0]));\r\n\t\t\t\t\t\t } //end of if\r\n\t\t\t\t\t} //end of loop\r\n\t\t\t\t} //end of if\r\n\t\t\t\telse{\r\n\t\t\t\t\tamount=0.00;\r\n\t\t\t\t} //end of else\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"amount is\"+amount);\r\n\t\t\t\t try {\r\n\t\t\t\t\tchallanTax = getTaxDtls(Double.parseDouble(String.valueOf(data[i][3])), Double\r\n\t\t\t\t\t\t\t.parseDouble(String.valueOf(tdsParameter[0][2])),amount, tdsParameter);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tlogger.error(\"exception in challanTax\",e);\r\n\t\t\t\t} //end of catch\r\n\t\t\t\tlogger.info(\"data[i][2] emp name--->\"+data[i][2]); \r\n\t\t\t\tdouble tottds = Double.parseDouble(String.valueOf(challanTax[0][0]));\r\n\t\t\t//\ttotaltds += tottds;\r\n\t\t\t\tlogger.info(\"totaltds-------->\"+totaltds);\r\n\t\t\t\tdouble sur=Double.parseDouble(String.valueOf(challanTax[0][2]));\r\n\t\t\t\t//surcharge+=sur;\r\n\t\t\t\t//logger.info(\"surcharge----------in loop 2---\"+surcharge);\r\n\t\t\t\tdouble cess=Double.parseDouble(String.valueOf(challanTax[0][1]));\r\n\t\t\t\t//educationCess+=cess;\r\n\t\t\t\t//logger.info(\"educationCess----------in loop 3---\"+educationCess);\r\n\t\t\t\t\r\n\t\t\t totTds+=Double.parseDouble(String.valueOf(data[i][3]));\r\n\t\t\t \r\n\t\t\t // logger.info(\"totTds----------down 4---\"+totTds);\r\n\t\t\t Object[][] data1=new Object[1][6];\r\n\t\t\t \r\n\t\t\t data1[0][0]=chalCodeObj[0][0];\r\n\t\t\t data1[0][1]=data[i][0];\r\n\t\t\t \r\n\t\t\t\tbean.setEmpId(String.valueOf(data[i][0]));\r\n\t\t\t\tbean.setEmpToken(String.valueOf(data[i][1]));\r\n\t\t\t\tbean.setEmpName(String.valueOf(data[i][2]));\r\n\t\t\t\tbean.setEmpTaxIncome(String.valueOf(amount));//this is used in java script\r\n\r\n\t\t\t\tchkAmount = Math.round(tottds) + Math.round(sur) + Math.round(cess);\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"value of chkAmount==11====>\"+chkAmount);\r\n\t\t\t\t\r\n\t\t\t\tchkAmount = Double.parseDouble(String.valueOf(data[i][3])) - chkAmount;\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"value of data[i][3]======>\"+data[i][3]);\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"value of chkAmount==22====>\"+chkAmount);\r\n\t\t\t\t\r\n\t\t\t\tbean.setChallanTax(Utility.twoDecimals(Math.round(tottds) + chkAmount));\r\n\t\t\t\t\r\n\t\t\t\tdata1[0][2]=bean.getChallanTax();\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"TDS-----------\"+bean.getChallanTax());\r\n\t\t\t\ttotaltds+= Double.parseDouble(String.valueOf(bean.getChallanTax()));\r\n\t\t\t\tbean.setChallanSurcharge(Utility.twoDecimals(Math.round(sur)));\r\n\t\t\t\tlogger.info(\"ChallanSurcharge-----------\"+bean.getChallanSurcharge());\r\n\t\t\t\t \r\n\t\t\t\tdata1[0][3]=bean.getChallanSurcharge();\r\n\t\t\t\t\r\n\t\t\t\tsurcharge+= Double.parseDouble(String.valueOf(bean.getChallanSurcharge()));\r\n\t\t\t\t\r\n\t\t\t\tbean.setChallanEduCess(Utility.twoDecimals(Math.round(cess)));\r\n\t\t\t\tlogger.info(\"ChallanEduCess-----------\"+bean.getChallanEduCess());\r\n\t\t\t\teducationCess+= Double.parseDouble(String.valueOf(bean.getChallanEduCess()));\r\n\t\t\t\t\r\n\t\t\t\tdata1[0][4]=bean.getChallanEduCess();\r\n\t\t\t\t\r\n\t\t\t\tbean.setChallanTotTax(Utility.twoDecimals(Math.round(Double.parseDouble(String.valueOf(data[i][3])))));\r\n\t\t\t\ttotalTax+= Double.parseDouble(String.valueOf(bean.getChallanTotTax()));\r\n\t\t\t\tlogger.info(\"ChallanTotTax-----------\"+bean.getChallanTotTax());\r\n\t\t\t\t\r\n\t\t\t\tdata1[0][5]=bean.getChallanTotTax();\r\n\t\t\t\t\r\n\t\t\t\tchallanList.add(data1);\r\n\t\t\t} //end of loop\r\n\t\t\t//taxChallan.setChallanList(challanList);\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * Following code sets the total sum of the surcharge,education cess and total tax amount.\r\n\t\t\t */\r\n\t\t\ttaxChallan.setTax(Utility.twoDecimals(totaltds));\r\n\t\t\ttaxChallan.setSurcharge(Utility.twoDecimals(surcharge));\r\n\t\t\ttaxChallan.setEduCess(Utility.twoDecimals(educationCess));\r\n\t\t\ttaxChallan.setTotalTax(Utility.twoDecimals(totalTax));\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsaveAndNext(taxChallan, challanList, challanCode);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tlogger.error(\"exception in saveAndNext method\",e);\r\n\t\t\t} //end of catch\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlogger.error(\"exception in HRMS_SAL_DEBITS object loop\",e);\r\n\t\t} //end of catch\r\n\t}", "public int getLBR_ProtestDays();", "public void setDay(int day) {\r\n this.day = day;\r\n }", "public void setfPeticion(Date fPeticion) {\r\n this.fPeticion = fPeticion;\r\n }", "public void setFechaHasta(Date fechaHasta)\r\n/* 179: */ {\r\n/* 180:312 */ this.fechaHasta = fechaHasta;\r\n/* 181: */ }", "public Tirage getTirage(List<ObjetArchiver> listeTirages) {\n\tTirage tirageCorrespondant = new Tirage();\n\t/*\n\t * On calcule l'occurence de chaque numéro et chaque étoile depuis listeTirage\n\t */\n\t// On créer une liste d'occurance pour les étoiles et numéros\n\tList<StatNombre> listeOcNumeros = OccuranceData.getListeStatNumerosEnum();\n\tList<StatNombre> listeOcEtoiles = OccuranceData.getListeStatEtoilesEnum();\n\n\t// On met à jour les occurances de la liste de tirages\n\tfor (ObjetArchiver objetArchiver : listeTirages) {\n\t for (Numero numero : objetArchiver.getNumeros()) {\n\t\tfor (StatNombre statNumero : listeOcNumeros) {\n\t\t if (numero.getNumero() == statNumero.getNombre()) {\n\t\t\tstatNumero.setOccurence(statNumero.getOccurence() + 1);\n\t\t }\n\t\t}\n\t }\n\t for (Etoile etoile : objetArchiver.getEtoiles()) {\n\t\tfor (StatNombre statEtoile : listeOcEtoiles) {\n\t\t if (etoile.getEtoile() == statEtoile.getNombre()) {\n\t\t\tstatEtoile.setOccurence(statEtoile.getOccurence() + 1);\n\t\t }\n\t\t}\n\t }\n\t}\n\n\t// On range dans l'ordre croissant les occurences\n\tCollections.sort(listeOcNumeros, (o1, o2) -> o1.getOccurence().compareTo(o2.getOccurence()));\n\tCollections.sort(listeOcEtoiles, (o1, o2) -> o1.getOccurence().compareTo(o2.getOccurence()));\n\n\t// On prend les 15 dernières occurences de listeOcNumeros\n\tList<Numero> combinaisonNumeros = new ArrayList<>();\n\tList<Etoile> combinaisonEtoiles = new ArrayList<>();\n\tFloat precision = 0F;\n\tFloat precisionNumeros = 0F;\n\tFloat precisionEtoiles = 0F;\n\tInteger listeTiragesSize = listeTirages.size();\n\t// On prend les 5 deniers occurences de listeOcNumros\n\tfor (int i = 1; i <= 15; i++) {\n\t Numero numero = new Numero((listeOcNumeros.get(listeOcNumeros.size() - i)).getNombre());\n\t combinaisonNumeros.add(numero);\n\t // On recupère l'occurence de i\n\t Integer ocCourante = listeOcNumeros.get(listeOcNumeros.size() - i).getOccurence();\n\t /*\n\t * On ajoute le rapport (occurence courante/au nombre de tirage) à la précision\n\t * précédente ce qui revient à faire la moyenne des ratios d'occurence\n\t * (occurence/nb de tirage)\n\t */\n\t precisionNumeros += Float.valueOf((float) ocCourante / (float) listeTiragesSize);\n\t precisionNumeros = precisionNumeros / 2;\n\t}\n\t// On prend les 4 denières occurences de listeOcEtoiles\n\tfor (int i = 1; i <= 4; i++) {\n\t Etoile etoile = new Etoile((listeOcEtoiles.get(listeOcEtoiles.size() - i)).getNombre());\n\t combinaisonEtoiles.add(etoile);\n\t // On recupère l'occurence de i\n\t Integer ocCourante = listeOcEtoiles.get(listeOcEtoiles.size() - i).getOccurence();\n\t /*\n\t * On ajoute le rapport (occurence courante/au nombre de tirage) à la précision\n\t * précédente ce qui revient à faire la moyenne des ratios d'occurence\n\t * (occurence/nb de tirage)\n\t */\n\t precisionEtoiles += Float.valueOf((float) ocCourante / (float) listeTiragesSize);\n\t precisionEtoiles = precisionEtoiles / 2;\n\t}\n\n\t// On recupère la precision du tirage (moyenne des deux precision)\n\tprecision = 100 * (precisionNumeros + precisionEtoiles) / 2;\n\n\ttirageCorrespondant.setPrecision(precision);\n\ttirageCorrespondant.setNumeros(combinaisonNumeros);\n\ttirageCorrespondant.setEtoiles(combinaisonEtoiles);\n\n\treturn tirageCorrespondant;\n }", "@Override\n public void onDateSet(DatePicker view, int year, int month, int day) {\n int mMonth = month + 1;\n String bydate = year + \"-\" + mMonth + \"-\" + day;\n mIdTvMoonatCenterShortLine.setText(bydate);\n\n List<SleepDataInfo> all = manager.findAllSleep();\n SleepDataInfo sleepDataInfo_total = manager.findSleepDataInfo(SPUtil.getUserName(getApplication()), bydate);\n RefreshView(sleepDataInfo_total); /*选择日期后刷新ui*/\n }", "public void Raport1(){\r\n try {\r\n Utilizator m = service.findOne(idUtilizatorCurent);\r\n\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MM/dd/yyyy\");\r\n String data = DataPickerData.getEditor().getText();\r\n if(data.equals(\"\")){\r\n MessageAlert.showErrorMessage(null,\"Selectati data de inceput!\");\r\n return;\r\n }\r\n List<String> attr = Arrays.asList(data.split(\"/\"));\r\n String data1 = \"\";\r\n if (attr.get(1).length() == 1 || attr.get(0).length()==1) {\r\n for (String s : attr) {\r\n if (s.equals(attr.get(1))&&attr.get(1).length() == 1) {\r\n data1 = data1 + \"0\" + s + \"/\";\r\n }\r\n else if(s.equals(attr.get(0))&&attr.get(0).length() == 1){\r\n data1 = data1 + \"0\" + s + \"/\";\r\n }\r\n else {\r\n data1 = data1 + s + \"/\";\r\n }\r\n }\r\n data1 = data1.substring(0, 10);\r\n } else data1 = data;\r\n LocalDateTime d = LocalDate.parse(data1, formatter).atStartOfDay();\r\n String datafinal = DataPickerDataFinal.getEditor().getText();\r\n if(datafinal.equals(\"\")){\r\n MessageAlert.showErrorMessage(null,\"Selectati data de final!\");\r\n return;\r\n }\r\n List<String> attr1 = Arrays.asList(datafinal.split(\"/\"));\r\n String data2 = \"\";\r\n if (attr1.get(1).length() == 1 || attr1.get(0).length()==1) {\r\n for (String s : attr1) {\r\n if (s.equals(attr1.get(1)) &&attr1.get(1).length() == 1 ) {\r\n data2 = data2 + \"0\" + s + \"/\";\r\n }\r\n else if(s.equals(attr1.get(0))&&attr1.get(0).length() == 1) {\r\n data2 = data2 + \"0\" + s + \"/\";\r\n }\r\n else {\r\n data2 = data2 + s + \"/\";\r\n }\r\n }\r\n data2 = data2.substring(0, 10);\r\n } else data2 = datafinal;\r\n LocalDateTime d2 = LocalDate.parse(data2, formatter).atStartOfDay();\r\n List<String> rez = service.getMessagesAndFriendships(m.getId(), d, d2);\r\n for (String s : rez) {\r\n System.out.println(s);\r\n }\r\n CreatePdf createPdf = new CreatePdf();\r\n createPdf.creare(rez, \"C:\\\\Users\\\\alini\\\\Desktop\\\\pdfCerinta1.pdf\", \"Raport activitati pentru \"+m.getFirstName()+\" \"+m.getLastName());\r\n MessageAlert.showMessage(null, Alert.AlertType.INFORMATION,\"Generare raport\",\"Raportul a fost generat cu succes!\");\r\n }\r\n catch (NullPointerException e){\r\n //MessageAlert.showErrorMessage(null,\"Selectati un user din tabel\");\r\n }\r\n\r\n\r\n }", "@Test\n\tpublic void testSetFecha8(){\n\t\tPlataforma.closePlataforma();\n\t\t\n\t\tfile = new File(\"./data/plataforma\");\n\t\tfile.delete();\n\t\tPlataforma.openPlataforma();\n\t\tPlataforma.login(\"1\", \"contraseniaprofe\");\n\t\t\n\t\tPlataforma.setFechaActual(Plataforma.fechaActual.plusDays(5));\n\t\tej1.enPlazo();\n\t\t\n\t\tassertEquals(ej1.getEstado(), EstadoEjercicio.TERMINADO);\n\t\t\t\t\n\t\tLocalDate fin = Plataforma.fechaActual.plusDays(6);\n\t\tLocalDate ini = Plataforma.fechaActual.plusDays(10);\n\t\tassertFalse(ej1.setFechaFin(fin));\n\t\tassertFalse(ej1.setFechaIni(ini));\n\t}", "@Override\n\tpublic String getDailyFortune() {\n\t\t// TODO Auto-generated method stub\n\t\treturn fortuneService.getFortune();\n\t}", "public Datum(int jahr) {\n this.tag = 1;\n this.monat = 1;\n this.jahr = jahr;\n }", "@Override\n\tpublic void setDates(User user, Book book) {\n\t\t\n\t\treservationDate = new Date();\n\t\trestituteDate = new Date();\n\t\tcal = Calendar.getInstance();\n\t\tcal.setTime(restituteDate);\n\t\tcal.add(Calendar.DATE, 14);\n\t\trestituteDate = cal.getTime();\n\t\t\n\t\tformat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\treservDate = format.format(reservationDate);\n\t\trestDate = format.format(restituteDate);\n\t\t\n\t\trdDAO.setDates(user.getId(), book.getId(), reservDate, restDate);\n\t\t\n\t\t\n\t}", "public void setDeldte(Date deldte) {\r\n this.deldte = deldte;\r\n }", "@Override\r\n public void onDateSet(DatePicker view, int year, int monthOfYear,\r\n int dayOfMonth) {\n myCalendar.set(Calendar.YEAR, year);\r\n myCalendar.set(Calendar.MONTH, monthOfYear);\r\n myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);\r\n\r\n String myFormat = \"dd-MM-yyyy\";\r\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);\r\n tgl = sdf.format(myCalendar.getTime());\r\n if (istgltrx) {\r\n tTglTrx.setText(tgl);\r\n }\r\n else {\r\n tTglTerbit.setText(tgl);\r\n }\r\n }", "public void ustawDate(Date data) {\n\t\tcalendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(data);\r\n\t\tthis.rok = calendar.get(Calendar.YEAR);\r\n\t\tthis.miesiac = calendar.get(Calendar.MONTH);\r\n\t\tif ((this.rok % 4 == 0 && this.rok % 100 != 0) || this.rok % 400 == 0) {\r\n\t\t\tmiesiace[1] = 29;\r\n\t\t} else {\r\n\t\t\tmiesiace[1] = 28;\r\n\t\t}\r\n\r\n\t\twypelnijTabele();\r\n\t}", "public boolean editionElementFacture(Habitation hab){\r\n\t\t\r\n\t\tboolean res = false;\r\n\t\tdouble totalGeneralHT = 0;\r\n\t\tfinal double tva = 0.62;\r\n\t\t\r\n\t\tCalendar cal = null;\r\n\t\tcal = Calendar.getInstance();\r\n\t\t\r\n\t\tDate actuelle = new Date();\r\n\t\t\r\n\t\t//SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\t//String dat = dateFormat.format(actuelle);\r\n\t\t\r\n\t\tcal.setTime(actuelle);\r\n\t\t\r\n\t\tint year = cal.get(Calendar.YEAR);\r\n\t\t// extraction du mois mettre + 1 car d�marre � 0 et non pas 1\r\n\t\tint month = cal.get(Calendar.MONTH) + 1;\r\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\r\n\t\t\r\n\t\tString mois=tabMois[month];\r\n\t\t\r\n\t\tSystem.out.println(\"**************\");\r\n\t\tSystem.out.println(\"Société Trisel\");\r\n\t\tSystem.out.println(\"**************\");\r\n\t\t\r\n\t\tSystem.out.println(\"Facture du mois de \"+mois);\r\n\t\tSystem.out.println(\"Editée le lundi \"+day+\" \"+mois+\" \"+year);\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(hab.getUsager().getNomUsager()+\" \"+hab.getUsager().getPrenomUsager());\r\n\t\tSystem.out.println(hab.getAdresseRue());\r\n\t\tSystem.out.println(hab.getCp()+\" \"+hab.getAdresseVille());\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Code usager : \"+hab.getUsager().getIdUsager());\r\n\t\tSystem.out.println(\"Récapitulatif des pesées des poubelles au mois de : \"+mois);\r\n\t\t\r\n\t\tArrayList<Poubelle> lespoubelles = hab.getLesPoubelles();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\tfor(Poubelle p : lespoubelles)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tdouble totalPoubelleHT = 0;\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\"Poubelle : \"+p.getIdPoubelle()+\" Nature des déchets : \"+p.getNature().getLibelle());\r\n\t\t\t\t\r\n\t\t\t\tArrayList<Levee> leslevees = p.getLesLevees(year,month);\r\n\t\t\t\t\r\n\t\t\t\tif(leslevees.size()==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Pas de levees pour cette poubelle\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse{\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Levee l : leslevees)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\t\t\tSystem.out.println(\"Date de pesée : \"+l.getDate());\r\n\t\t\t\t\t\tSystem.out.println(\"Nombre de kg : \"+l.getPoids());\r\n\t\t\t\t\t\tSystem.out.println(\"Prix HT au kg : \"+p.getNature().getTarif());\r\n\t\t\t\t\t\tSystem.out.println(\"Total HT - levee \"+l.getIdLevee()+\" : \"+(p.getNature().getTarif())*(l.getPoids()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttotalPoubelleHT = p.getCout(year, month);\r\n\t\t\t\t\ttotalGeneralHT = totalPoubelleHT + totalPoubelleHT ;\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"Total HT - poubelle \"+p.getIdPoubelle()+\" : \"+totalPoubelleHT);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"------------------\");\r\n\t\t\tSystem.out.println(\"Total général HT : \"+totalGeneralHT);\r\n\t\t\tSystem.out.println(\"Montant TVA : \"+tva);\r\n\t\t\tSystem.out.println(\"Montant Total : \"+(totalGeneralHT+tva)+\" \"+hab.getCout(year, month));\r\n\t\t\tSystem.out.println(\"------------------\");\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn res;\r\n\t\r\n\t}", "public void dataPadrao() {\n Calendar c = Calendar.getInstance();\n SimpleDateFormat s = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dataAtual = s.format(c.getTime());\n c.add(c.MONTH, 1);\n String dataAtualMaisUm = s.format(c.getTime());\n dataInicial.setText(dataAtual);\n dataFinal.setText(dataAtualMaisUm);\n }", "public int valoreGiornoSettimana(){\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTimeZone(italia);\n\t\tcal.setTime(new Date());\n\t\treturn cal.get(Calendar.DAY_OF_WEEK);\n\t}", "private void setCurrentDay() {\n Calendar c = Calendar.getInstance();\n\n year = c.get(Calendar.YEAR);\n month = c.get(Calendar.MONTH);\n day = c.get(Calendar.DAY_OF_MONTH);\n hour = c.get(Calendar.HOUR_OF_DAY);\n minute = c.get(Calendar.MINUTE);\n }", "public void setFechaDesde(Date fechaDesde)\r\n/* 169: */ {\r\n/* 170:293 */ this.fechaDesde = fechaDesde;\r\n/* 171: */ }", "void setOrderwithdate() {\r\n\r\n\t\tOrderAbyDate oad = new OrderAbyDate();\r\n\r\n\t\tMap<Integer, Map<Integer, Integer>> data = oad.getOrderByDate();\r\n\r\n\t\tjava.util.List<Integer> ls = new ArrayList<>(data.keySet());\r\n\r\n\t\tfor (int i = 0; i < ls.size(); i++) {\r\n\r\n\t\t\tdropyear1.getItems().add(\"\" + ls.get(i));\r\n\r\n\t\t}\r\n\r\n\t\tif (ls.size() > 0) {\r\n\r\n\t\t\tdropyear1.getSelectionModel().selectedItemProperty()\r\n\t\t\t\t\t.addListener(new ChangeListener<String>() {\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void changed(\r\n\t\t\t\t\t\t\t\tObservableValue<? extends String> observable,\r\n\t\t\t\t\t\t\t\tString oldValue, String newValue) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\r\n\t\t\t\t\t\t\tsetBarchartorder(\r\n\t\t\t\t\t\t\t\t\tdata.get(Integer.parseInt(newValue)),\r\n\t\t\t\t\t\t\t\t\tnewValue);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\tdropyear1.getSelectionModel().select(0);\r\n\r\n\t\t}\r\n\r\n\t}", "public void setDay(Date day) {\r\n this.day = day;\r\n }", "public void setDay(Date day) {\r\n this.day = day;\r\n }", "public void setDay(Date day) {\r\n this.day = day;\r\n }", "public void setDay(Date day) {\r\n this.day = day;\r\n }", "public void setDay(Date day) {\r\n this.day = day;\r\n }", "public void setAlarms()\n\t{\n\t\tSharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n\t\tAlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n\t\t\n\t\tSet<String> set;\n\t\tset=sp.getStringSet(\"lowattnotifs\", null);\n\t\tif(set!=null)\n\t\t{\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, 19);\n\t\t\tcal.set(Calendar.MINUTE, 0);\n\t\t\tcal.set(Calendar.SECOND, 0);\n\t\t\t\n\t\t\tIntent attintent = new Intent(this, Monitor.class);\n\t\t\tattintent.putExtra(\"attordate\", 0);\n\t\t\tPendingIntent attpintent = PendingIntent.getService(this, 0, attintent, 0);\n\t\t\t\n\t\t\talarm.cancel(attpintent);\t\t//cancel all alarms for attendance reminders\n\t\t\t\n\t\t\t//check if set contains these days\n\t\t\tfor(int i=0; i<7; i++)\n\t\t\t{\n\t\t\t\tif(set.contains(String.valueOf(i)))\n\t\t\t\t{\n\t\t\t\t\tcal.set(Calendar.DAY_OF_WEEK, i);\n\t\t\t\t\talarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), attpintent);\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Set for day: \"+i, Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void setupSpalteAnzMitarbeiter() {\r\n\t\t// legt fest, welches Attribut von Arbeitspaket in dieser Spalte angezeigt wird\r\n\t\tspalteAnzMitarbeiter.setCellValueFactory(new PropertyValueFactory<>(\"mitarbeiteranzahl\"));\r\n\r\n\t\t// lässt die Zelle mit Hilfe der Klasse EditCell bei Tastatureingabe bearbeitbar\r\n\t\t// machen\r\n\t\tspalteAnzMitarbeiter.setCellFactory(\r\n\t\t\t\tEditCell.<ArbeitspaketTableData, Integer>forTableColumn(new MyIntegerStringConverter()));\r\n\r\n\t\t// überschreibt den alten Attributwert mit der User-Eingabe\r\n\t\tspalteAnzMitarbeiter.setOnEditCommit(event -> {\r\n\t\t\tfinal Integer value = event.getNewValue() != null ? event.getNewValue() : event.getOldValue();\r\n\t\t\tevent.getTableView().getItems().get(event.getTablePosition().getRow()).setMitarbeiteranzahl(value);\r\n\t\t\ttabelle.refresh();\r\n\t\t});\r\n\t}", "public void setDebut(int d) {\n\t\tthis.debut = d;\n\t}", "public Setter reqSetDailyTimerSetting(byte[] edt) {\n\t\t\treqSetProperty(EPC_DAILY_TIMER_SETTING, edt);\n\t\t\treturn this;\n\t\t}", "public void setDataTest() {\n\n for(int i=0;i<10;i++){\n LocalDate date = DateHelper.getPastDate(i);\n\n for(int j=0;j<3;j++){\n Enums.MealTime time = Enums.MealTime.Breakfast;\n if(j==0) time = Enums.MealTime.Breakfast;\n if(j==1)time = Enums.MealTime.Lunch;\n if(j==2)time = Enums.MealTime.Dinner;\n\n for(int k=0;k<2;k++) {\n final LocalDate d = date;\n final Enums.MealTime t = time;\n FirebaseDBMenuDataHelper.getMenuData(Enums.RestaurantName.CafeVentanas, DateHelper.getCurrentDate(), time,\n new FirebaseDBCallaback<ArrayList<MenuEntity>>() {\n @Override\n public void getData(ArrayList<MenuEntity> data) {\n int ran = (int)(Math.random()*data.size());\n FirebaseDBUserDataHelper.setStatisticsData(d, t,data.get(ran));\n }\n });\n }\n }\n }\n /*\n MenuEntity ent = new MenuEntity();\n ent.setName(\"TTasdsda0\");\n ent.setPrice(200);\n FirebaseDBUserDataHelper.setStatisticsData(DateHelper.getCurrentDate(),ent);\n */\n }", "public void setDateStart_CouponsTab_Marketing() {\r\n\t\tthis.dateStart_CouponsTab_Marketing.clear();\r\n\t\tSimpleDateFormat formattedDate = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\tString today1 = (String) (formattedDate.format(c.getTime()));\r\n\t\tthis.dateStart_CouponsTab_Marketing.sendKeys(today1);\r\n\t}", "public void setFiNgayKy(Date fiNgayKy) {\n this.fiNgayKy = fiNgayKy;\n }", "public void setShipped(){\n this.shipped = new Date();\n }", "@Override\n\tpublic String getDailyFortune() {\n\t\treturn \"SWIM COACH: getDailyFortune() + running getFortune(): \" + fortuneService.getFortune();\n\t}", "public TypicalDay() {\n\t\tnbDeliveries = 0;\n\t\twareHouse = -1;\n\t}", "public void verurteilen(Schurke schurke) {\n\t\tif (!this.korrupt) {\n\t\t\tschurke.MetroDollarVeraendern(-1000);\n\t\t}\n\t\tthis.metroDollar += 60000;\n\t}", "public Date getTanggal() {\n return this.tanggal;\n }", "private void initDate(){\n\n owa = findViewById(R.id.OWA);\n sda = findViewById(R.id.SWA);\n fida = findViewById(R.id.FIDA);\n fda = findViewById(R.id.FDA);\n trda = findViewById(R.id.TRDA);\n tda = findViewById(R.id.TDA);\n hier = findViewById(R.id.HIER);\n\n dateList.add(hier);\n dateList.add(tda);\n dateList.add(trda);\n dateList.add(fda);\n dateList.add(fida);\n dateList.add(sda);\n dateList.add(owa);\n\n }", "long getSettlementDate();", "@Test\n\tpublic void testSetFecha2(){\n\t\tPlataforma.logout();\n\t\tPlataforma.login(Plataforma.alumnos.get(0).getNia(), Plataforma.alumnos.get(0).getPassword());\n\t\tLocalDate fin = Plataforma.fechaActual.plusDays(10);\n\t\tLocalDate ini = Plataforma.fechaActual.plusDays(2);\n\t\tassertFalse(ej1.setFechaFin(fin));\n\t\tassertFalse(ej1.setFechaIni(ini));\n\t}", "@Override\n\tpublic void setDurchmesser(int d) {\n\n\t}" ]
[ "0.62155914", "0.5811178", "0.55694234", "0.53798914", "0.53193396", "0.5276953", "0.526904", "0.52343744", "0.5229187", "0.5132113", "0.509066", "0.508534", "0.507172", "0.5066442", "0.50252545", "0.5021864", "0.49903437", "0.4973722", "0.4971853", "0.49607804", "0.49605274", "0.49552977", "0.49505863", "0.49455076", "0.49386978", "0.4934679", "0.49277094", "0.49259013", "0.49216312", "0.49054283", "0.49021596", "0.49010873", "0.4892146", "0.48919144", "0.48891073", "0.48772523", "0.4871302", "0.4857357", "0.48563242", "0.48542848", "0.48527145", "0.48413122", "0.48396894", "0.48329145", "0.4811433", "0.4809571", "0.4807113", "0.4806983", "0.47985327", "0.47921547", "0.47903925", "0.47817108", "0.47809008", "0.47798976", "0.47739705", "0.4773854", "0.47693917", "0.4763228", "0.4761329", "0.4760515", "0.47471485", "0.4744944", "0.47444642", "0.47370967", "0.47248203", "0.47235706", "0.47189966", "0.47148174", "0.47138542", "0.47096616", "0.47066247", "0.47050273", "0.47038075", "0.47023213", "0.46962342", "0.46961418", "0.46941465", "0.46936977", "0.46904007", "0.46903828", "0.46903828", "0.46903828", "0.46903828", "0.46903828", "0.46877497", "0.4687184", "0.46868098", "0.46847215", "0.46839446", "0.46826875", "0.46772748", "0.46768418", "0.4676487", "0.46748057", "0.46744654", "0.46742678", "0.46734458", "0.467095", "0.4668997", "0.46677405" ]
0.66336995
0
ApplicationContext context = new ClassPathXmlApplicationContext("_3_aop/_10_spring_aop_process_two/aspect.xml");
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("_3_aop/_10_spring_aop_process_two/aspect-autoproxy.xml"); Foo target = (Foo) context.getBean("target"); target.method1(); target.method2(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\tApplicationContext ctx=new ClassPathXmlApplicationContext(\"AopExampleBean.xml\");\n\t\t//ApplicationContext ctx=new ClassPathXmlApplicationContext(\"AopExample.xml\");\n\t\tMyMathImpl mi=(MyMathImpl)ctx.getBean(\"myMathImpl\");\n\t\tmi.add(7,9);\n\t\tmi.sub(5, 2);\n\t\tmi.div(6, 0);\n\t}", "public static void main(String args[]) {\n\r\n\t\r\n\tApplicationContext ac = new ClassPathXmlApplicationContext(\"com/springcore/annotations/anootationconfig.xml\");\r\n\t \r\n Employee emp = ac.getBean(\"myemployee\", Employee.class);\r\n System.out.println(emp.toString());\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"spring aop\");\n\t\t\n\t\tApplicationContext ac = new ClassPathXmlApplicationContext(\"beans.xml\");\n\t\t\n\t\tAppService app = (AppService) ac.getBean(\"appService\");\n\t\t\n\t\tapp.playComedyShow();\n\t\tapp.playConcert();\n\t\tapp.runAmusementPark();\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext ctx=new ClassPathXmlApplicationContext(\"performance.xml\");\r\n\t Performer p=ctx.getBean(\"sonu nigam\", Performer.class); \r\n\t p.Performe();\r\n\t ConfigurableApplicationContext cfgCtx=(ConfigurableApplicationContext) ctx;\r\n\t cfgCtx.close();\r\n\t \r\n\t\r\n\t}", "public static void main(String[] args) {\n\t\tGenericXmlApplicationContext ctx = new GenericXmlApplicationContext(\"Echo.xml\");\r\n\t\t\r\n\t\tEchobean bean = ctx.getBean(\"aaa\", Echobean.class);\r\n\t\t \r\n\t\tOneService one = bean.getOne();\r\n\t\tTwoService two = bean.getTwo(); \r\n\t\t \r\n\t\tone.one();\r\n\t\ttwo.two();\r\n\t}", "public static void main(String[] args) {\nApplicationContext context=new ClassPathXmlApplicationContext(\"spring.xml\");\r\n\t\r\n\t\r\n\r\n\t\r\n\t\r\n\tCoach coach2=(Coach)context.getBean(\"myCCoach\");\r\n\r\n\t\r\n\tSystem.out.println(coach2);\r\n\t((ClassPathXmlApplicationContext)context).close();\r\n\t\r\n\t\r\n\tSystem.out.println(coach2.getDailyFortune());\r\n\t\r\n\t}", "@Test\n public void testOrders(){\n ClassPathXmlApplicationContext context=\n new ClassPathXmlApplicationContext(\"bean4.xml\");\n Orders orders = context.getBean(\"orders\", Orders.class);\n System.out.println(\"第四步 得到bean实例\");\n System.out.println(orders);\n// orders.initMethod();\n context.close();\n }", "public static void main(String[] args) {\n AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AopConfig.class);\n TaskService bean = applicationContext.getBean(TaskService.class);\n for (int i = 0; i <10 ; i++) {\n bean.task1(i);\n bean.task2(i);\n }\n\n }", "public static void main(String[] args) {\n\n\n\n\n\n ClassPathXmlApplicationContext contexto=new ClassPathXmlApplicationContext(\"applicationContext3.xml\");\n \n \n\n Empleados Maria=contexto.getBean(\"secretarioEmpleado2\",Empleados.class);\n\n \n \n \n //System.out.println(\"Tareas del director: \"+Maria.getTareas());\n System.out.println(\"Informes del director: \"+Maria.getInformes());\n //System.out.println(\"El correo es: \"+Maria.getEmail());\n //System.out.println(\"El nombre de la empresa es: \"+Maria.getNombreEmpresa());\n \n\n contexto.close();\n\n\n \n }", "public static void main(String[] args) {\n\t\tApplicationContext ctx=new ClassPathXmlApplicationContext(\"com/Kamal/SpringCoreAdvanced/InterfaceInjection/config.xml\");\n\t\tOrderBo impl=(OrderBo)ctx.getBean(\"bo\");\n\t\timpl.placeOrder();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n ApplicationContext cont=new ClassPathXmlApplicationContext(\"Dependentbean.xml\");\n Mapp qump=(Mapp)cont.getBean(\"pp\");\n qump.showAnswers();\n \n }", "public static void main(String[] args) {\n\t\tResource resource = new ClassPathResource(\"config/p51.xml\");\n\t\tBeanFactory factory = new XmlBeanFactory(resource);\n\t\t\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"config/p51.xml\");\n\t\t//context.getBean()....\n\t\t\n\t\t\n\t\tGreetingService greetingService =(GreetingService)factory.getBean(\"greeting\");\n\t\tSystem.out.println(greetingService.sayHello(\"아무거나 \"));\n\t\tGreetingService greetingService2 =(GreetingService)factory.getBean(\"greeting2\");\n\t\tSystem.out.println(greetingService2.sayHello(\"아무거나 \"));\n\n\t}", "@Before\n public void setUp() {\n this.context = new AnnotationConfigApplicationContext(\"com.fxyh.spring.config\");\n// this.context = new ClassPathXmlApplicationContext(\"classpath*:applicationContext-bean.xml\");\n this.user = this.context.getBean(User.class);\n this.user2 = this.context.getBean(User.class);\n this.department = this.context.getBean(Department.class);\n this.userService = (UserService) this.context.getBean(\"userService\");\n }", "public static void main(String[] args) {\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"beans.xml\");\n\t\tSystem.out.println(\"context loaded\");\n\t\t// Sim sim = (Sim) context.getBean(\"sim\");\n\t\t/**\n\t\t * Avoid above type casting\n\t\t */\n\t\tSim sim = context.getBean(\"sim\", Sim.class);\n\t\tsim.calling();\n\t\tsim.data();\n\t}", "public static void main(String[] arg)\n\t{\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"ApplicationInterface.xml\");\n\t\t\n\t\t\n\t // retrieving bean from context file\n\t\tCoach theCoach = context.getBean(\"TennisCoach\",Coach.class);\n\t\tCoach AlphaCoach = context.getBean(\"TennisCoach\",Coach.class);\n\t\tboolean result = theCoach == AlphaCoach;\n\t\tSystem.out.println(\"Point to the same object :\"+result);\n\t\tSystem.out.println(\"The coach memory location:\"+theCoach);\n\t\tSystem.out.println(\"Alpha coach memory location\"+AlphaCoach);\n\t\t\n\t\t//clossing class path xml\n\t\tcontext.close();\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext container = new ClassPathXmlApplicationContext(\"context.xml\");\n\t\tSystem.out.println(\"container created\");\n\n\t\t//Animal dog = container.getBean(\"animal\", Animal.class);\n\t\t//System.out.println(dog);\n\n\t}", "public static void main(String[] args) {\n ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);\n//\n// SpeakerService service = context.getBean(\"speakerService\", SpeakerService.class);\n//\n// System.out.println(service);\n//\n// System.out.println(service.findAll().get(0).getFirstName());\n//\n /*\n * In case of Singleton\n * This will not instantiate new object of SpeakerService because it is singleton\n * Same reference will be returned\n * */\n// SpeakerService service2 = context.getBean(\"speakerService\", SpeakerService.class);\n// System.out.println(service2);\n\n // XML Configuration\n// ApplicationContext context = new ClassPathXmlApplicationContext(\"ApplicationContext.xml\");\n// SpeakerService service2 = context.getBean(\"speakerService\", SpeakerService.class);\n// System.out.println(service2);\n }", "public static void main(String[] args){\n ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n /*\n Check to see if the file exists\n File file = new File(\"src/main/java/applicationContext.xml\");\n System.out.println(file.exists());\n \n */\n \n //retrieve bean from spring container\n Coach theCoach = context.getBean(\"myCoach\", Coach.class);\n //call methods on the bean\n System.out.println(theCoach.getDailyWorkout());\n //close the context\n \n context.close();\n \n /*Note: PUT THE FILE IN THE RESOURCES FOLDER, OR ELSE YOU'LL GET A FILE NOT FOUND ERROR*/\n }", "public static void main(String[] args) {\n ApplicationContext context = new ClassPathXmlApplicationContext(\"classpath:data.xml\");\n\n Employee emp1 = context.getBean(\"employee1\", Employee.class);\n\n System.out.println(\"Employee Details \" + emp1);\n\n }", "public static void main(String[] args) \r\n\t{\n\t\tString s = \"resources/spring.xml\";\r\nApplicationContext ac = new ClassPathXmlApplicationContext(s);\r\nCar c=(Car)ac.getBean(\"c\");\r\nc.printCarDetails();\r\n\t}", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(\"beanScope-applicationContext.xml\");\nCoach trackCoach=context.getBean(\"secondCoach\",Coach.class);\nCoach coach=context.getBean(\"secondCoach\",Coach.class);\n\t\n\tboolean result=(trackCoach==coach);\n\tSystem.out.println(\"Pointing to same obejcts\");\n\t}", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context =new \r\n\t\t\t\tClassPathXmlApplicationContext(\"initMethodConcept.xml\");\r\n\t\tCoach c=context.getBean(\"myApp\",Coach.class);\r\n//\t\tCoach d=context.getBean(\"myApp\",Coach.class);\r\n//\t\tboolean result =(c==d);\r\n//\t\tSystem.out.println(\"Same instance\" +result);\r\n//\t\tSystem.out.println(\"location1\" +c);\r\n//\t\tSystem.out.println(\"location1\" +d);\r\n//\t\t\r\n//\t\tc.print();\r\n\t\tSystem.out.println(\"myFortune is \"+c.getDailyFortune());\r\n//\t\tSystem.out.println(\"emailAddress\"+c.getEmailAddress());\r\n//\t\tSystem.out.println(\"team name is\"+c.getTeam());\r\n\t\tcontext.close();\r\n\r\n\t}", "@Test\n\tpublic void testMultipleContexts() {\n\t\tConfigurableApplicationContext pContext = new ClassPathXmlApplicationContext(\"ex5/context-1.xml\");\n\t\t//creating the child context\n\t\tConfigurableApplicationContext cContext = new \n\t\t\t\t\t\tClassPathXmlApplicationContext(new String[]{\"ex5/context-2.xml\"}, pContext);\n\t\t//accessing the bean\n\t\tCurrencyService currencyService = cContext.getBean(CurrencyService.class);\n\t\t//calling the method to verify if the parent bean was injected or not\n\t\tSystem.out.println(currencyService.convert(100));\n\t}", "@Test\r\n\tpublic void test() throws Exception {\n\t\tApplicationContext applicationContext = new ClassPathXmlApplicationContext(\"tinyioc.xml\");\r\n\t\tHelloWorldService helloWorldService = (HelloWorldService) applicationContext.getBean(\"helloWorldService\");\r\n\t\thelloWorldService.helloWorld();\r\n\t\t\r\n\t\t//hello world with aop\r\n\t\t//1.设置被代理对象\r\n\t\tAdvisedSupport advisedSupport = new AdvisedSupport();\r\n\t\tTargetSource targetSource = new TargetSource( HelloWorldService.class,helloWorldService);\r\n\t\tadvisedSupport.setTargetSource(targetSource);\r\n\t\t\r\n\t\t//2.设置拦截器(advice)\r\n\t\tTimerInterceptor timerInterceptor = new TimerInterceptor();\r\n\t\tadvisedSupport.setMethodInterceptor(timerInterceptor);\r\n\t\t\r\n\t\t//3.创建代理(proxy)\r\n\t\tJdkDynamicAopProxy jdkDynamicAopProxy = new JdkDynamicAopProxy(advisedSupport);\r\n\t\tHelloWorldService helloWorldServiceProxy = (HelloWorldService) jdkDynamicAopProxy.getProxy();\r\n\t\t\r\n\t\t//4.基于AOP的调用\r\n\t\thelloWorldServiceProxy.helloWorld();\r\n\t}", "private static CamelContext configureCamelContext(ApplicationContext context) throws Exception {\n //normal way of getting camel context but i have it defined in camelSpringApplicationContext.xml\n // CamelContext camel = new DefaultCamelContext();\n // CamelContext camel = new SpringCamelContext(context);\n CamelContext camel = (CamelContext) context.getBean(\"myCamelContext\");\n // shows up in jmx with this context name instead of camel-1\n camel.setNameStrategy(new DefaultCamelContextNameStrategy(\"steves_camel_driver\"));\n // camel.setTracing(true); // set in camelSpringApplicationContext.xml\n camel.addStartupListener(new StartupListener() {\n @Override\n public void onCamelContextStarted(CamelContext context, boolean alreadyStarted) throws Exception {\n LOG.info(\"Seeing when startup strategy is called. CamelContext=\" + context);\n }\n });\n\n return camel;\n }", "public static void main(String[] args) {\r\n\tAnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(SwimConfig.class);\r\n\tCoach myCoach=context.getBean(\"swimCoach\",Coach.class);\r\n\tSystem.out.println(myCoach.getDailyFortune());\r\n\tSystem.out.println(myCoach.getDailyWorkOut());\r\n\tcontext.close();\r\n\r\n}", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext contexto= new ClassPathXmlApplicationContext(\"applicationContext.xml\");\r\n\t\t \r\n\t\tdirectorEmpleado Juan=contexto.getBean(\"miEmpleado\",directorEmpleado.class);\r\n\t\tSystem.out.println(Juan.getTareas());\r\n\t\tSystem.out.println(Juan.getInforme());\r\n\t\tSystem.out.println(Juan.getEmail());\r\n\t\tSystem.out.println(Juan.getNombreEmpresa());\r\n\t\t\r\n\t\t/*secretarioEmpleado Maria=contexto.getBean(\"miSecretarioEmpleado\",secretarioEmpleado.class);\r\n\t\tSystem.out.println(Maria.getTareas());\r\n\t\tSystem.out.println(Maria.getInforme());\r\n\t\tSystem.out.println(\"Email= \"+Maria.getEmail());\r\n\t\tSystem.out.println(\"Nombre Empresa= \"+Maria.getNombreEmpresa());*/\r\n\t\t\r\n\t\tcontexto.close();\r\n\t}", "public static void main(String[] args) {\n\n System.out.println(\"开始初始化容器\");\n ApplicationContext ac = new ClassPathXmlApplicationContext(\"classpath:dispatcher-servlet.xml\");\n\n System.out.println(\"xml加载完毕\");\n Person person1 = (Person) ac.getBean(\"person1\");\n System.out.println(person1);\n System.out.println(\"关闭容器\");\n ((ClassPathXmlApplicationContext)ac).close();\n\n }", "public static void main( String[] args )\n {\n ApplicationContext bean = new ClassPathXmlApplicationContext(\"beans.xml\");\n Movie movie = (Movie) bean.getBean(\"movie1\");\n System.out.println(movie);\n }", "public static void main( String[] args )\n {\n \tApplicationContext context=new FileSystemXmlApplicationContext(\"beans.xml\");\n \tTraveller traveller=(Traveller)context.getBean(\"traveller\"); //SPRING CONTAINER\n \tSystem.out.println(traveller.getTravelDetails());\n\n }", "public static void main(String[] args) {\n ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"applicationContextPart2.xml\");\n // get bean from the application context\n Coach theCoach = context.getBean(\"myCoach\", Coach.class);\n // call the method from the beans\n System.out.println(theCoach.getDailyWorkout());\n System.out.println(theCoach.getFortune());\n\n // close the application context\n context.close();\n\n }", "public static void main(String[] args) {\r\nApplicationContext context=new ClassPathXmlApplicationContext(\"/beans.xml\");\t\t\r\n\tServlet s=(Servlet)context.getBean(\"servletRef\");\r\n\ts.serviceMethod();\r\n\t}", "@Test\n @DisplayName(\"Spring Container and songleton\")\n void springContainer(){\n\n ApplicationContext ac = new AnnotationConfigApplicationContext(AppConfig.class);\n\n //1. access: create object when gets called\n MemberService memberService1 = ac.getBean(\"memberService\", MemberService.class);\n\n //2 access: create object whenever gets called\n MemberService memberService2 = ac.getBean(\"memberService\", MemberService.class);\n\n //check the references\n System.out.println(\"memberService1 = \" + memberService1);\n System.out.println(\"memberService2 = \" + memberService2);\n\n //memberService1 !== memberService2\n Assertions.assertThat(memberService1).isSameAs(memberService2);\n\n //as you could see all the objects are created everytime we request for it when calling allConfig.memberService()\n }", "public static void main(String[] args)\n {\n ApplicationContext context=new ClassPathXmlApplicationContext(\"beans.xml\");\n Movie movie=context.getBean(\"movie\",Movie.class);\n movie.displayActor();\n\n // intialize XmlBeanFactory with beanx.xml\n BeanFactory beanFactory=new XmlBeanFactory(new ClassPathResource(\"beans.xml\"));\n Movie movie1=(Movie) beanFactory.getBean(\"movie\");\n movie1.displayActor();\n // intialize BeanDefinitionRegistry and BeanDefinitionReader with beanx.xml\n DefaultListableBeanFactory factory=new DefaultListableBeanFactory();\n BeanDefinitionRegistry registry=new GenericApplicationContext(factory);\n BeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);\n reader.loadBeanDefinitions(\"beans.xml\");\n Movie picture1 = (Movie) factory.getBean(\"movie\");\n picture1.displayActor();\n\n\n }", "@Before(\"execution(* add*(org.ms.aopdemo.Account))\") //runs just with param we need fully qualified class name\n\tpublic void beforeAddAccountAdvice() {\n\t\tSystem.out.println(\"\\n Executing @Before advice on addAccount()\");\n\t}", "public static void main(String[] args) {\n ApplicationContext context =new ClassPathXmlApplicationContext(\"spring.xml\");\n\t \n\t\tService ser= context.getBean(Service.class);\n\t\tSystem.out.println(ser.getAccountID());\n\t}", "public static void main(String[] args) {\n ApplicationContext ctx=new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n HelloWord h=(HelloWord) ctx.getBean(\"helloWord\");\n h.sayHello();\n Car car=(Car) ctx.getBean(\"car\");\n System.out.println(car);\n Person person=(Person) ctx.getBean(\"person\");\n System.out.println(person);\n\t}", "@Test\n public void contextLoad() throws Exception {\n testCase1();\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"com/spring/annotations/annotation-config.xml\");\n\t\tStudent stu = context.getBean(\"firstStudent\",Student.class);\n\t\tSystem.out.println(stu);\n\t\tcontext.close();\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);\r\n\t\t \r\n\t\tIMensaje mensaje = context.getBean(\"miBean\", Mensaje.class);\r\n\t\t\r\n\t\tmensaje.printHelloWorld(\"prueba Spring\");\r\n\t\t\r\n\t\t((AnnotationConfigApplicationContext) context).close();\r\n\t}", "public ApplicationContextAwareProcessor(ConfigurableApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t}", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"spring-test.xml\");\n\t\tSystem.out.println(context.getBean(\"test\"));\n\t\tSystem.out.println(context.getBean(MyConfig.class));\n\t\t//context.close();\n\t}", "public static void main(String[] args) {\n\t\t\tResource r = new ClassPathResource(\"resources/spring.xml\");\n\t\t\tBeanFactory factory = new XmlBeanFactory(r);\n\t\t//ApplicationContext factory1 = new ClassPathXmlApplicationContext(\"resources/spring.xml\");\n\t\t\n\t\t\n\t\t\t//Test t1 = (Test)factory1.getBean(\"t\");\n\t\t\t//Test t2 = (Test)factory1.getBean(\"t\");\n\t\t\t//t1.hello();\n\t\t\t//t2.hello();\n\t\t\t//System.out.println(t1==t2);\n\t\t\n\t\tfactory.getBean(\"t\");\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(JavaConfig.class);\n\nStudent s1 = context.getBean(\"s1\", Student.class);\n\nSystem.out.println(s1);\n\n\n\t}", "@Loggable(value=\"proceed\")\r\n\tpublic void testAspect3(String string, String string2, AspectBean bean) {\n\t\t\r\n\t}", "public static void main(String args[])\r\n\t{\n\t\tResource res=new ClassPathResource(\"/com/excel/core_01/iocContainer/_01FirstApp/spring.cfg.xml\");\r\n\r\n\t\t//activation of spring container & reading spring configuration file\r\n\t\tBeanFactory factory=new XmlBeanFactory(res);\r\n\r\n\t\t//getting object of implementation class\r\n\t\t//DemoInter d = (DemoInter)factory.getBean(\"com.excel.core_01.iocContainer._01FirstApp.DemoInterImpl\");\r\n\t\tDemoInterImpl d = (DemoInterImpl)factory.getBean(\"com.excel.core_01.iocContainer._01FirstApp.DemoInterImpl\");\r\n//\t\td.setMessage(\"Hi\");\r\n\t\t/**\r\n\t\tDemoInterImpl d1 = (DemoInterImpl) factory.getBean(\"p1.DemoInterImpl\");\r\n\t\tDemoInterImpl d2=(DemoInterImpl)factory.getBean(\"p1.DemoInterImpl\");\r\n\t\tSystem.out.println(d.hashCode());\r\n\t\tSystem.out.println(d1.hashCode());\r\n\t\tSystem.out.println(d2.hashCode());\r\n\t\t */\r\n\t\tSystem.out.println(d.wish(\"Rahul\"));\r\n\t}", "public static void main(String[] args) {\n \n ApplicationContext context =\n new ClassPathXmlApplicationContext(\"spring-beans.xml\");\n \n \n Dependant dependant = context.getBean(\"dependant\", Dependant.class);\n \n }", "public static void main(String[] args) {\n\n ApplicationContext context = new ClassPathXmlApplicationContext(\"applicationContext_work.xml\");\n SqlSessionFactory c = context.getBean(\"C\", SqlSessionFactory.class);\n System.out.println(c);\n\n\n }", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"beanscope.applicationContext.xml\");\r\n\t\t\r\n\t\t//retrieving bean from the spring container\r\n\t\tCoach myCoach = context.getBean(\"myCoach\",Coach.class);\r\n\t\tCoach newCoach = context.getBean(\"myCoach\",Coach.class);\r\n\t\t\r\n\t\t//checking if both objects are same\r\n\t\tboolean result = (myCoach==newCoach);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nPointing to the same object: \"+result);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nMemory location of myCoach: \"+myCoach);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nMemory location of newCoach: \"+newCoach);\r\n\t\t\r\n\t\tcontext.close();\r\n\t}", "@Before(\"execution (* com.jayway.blog.YourClass.yourMethodBefore(..))\")\n //JointPoint = the reference of the call to the method\n public void beforeAdvice(JoinPoint joinPoint) {\n System.out.println(\"YourAspect's BeforeAdvice's body is now executed Before yourMethodBefore is called.\");\n }", "public static void main(String[] args) {\n\t\tApplicationContext context =\n\t\t\t new ClassPathXmlApplicationContext(new String[] {\"services.xml\"});\n\t\t\tHelloBean xmlBean = (HelloBean)context.getBean(\"xmlHelloID\");\n\t\t\tSystem.out.println(xmlBean.getMsg() + \" called \" + xmlBean.getCount() + \" times.\");\n\t\t\t\n\t\t//\tAnnotation example\n\t\t\tApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);\n\t\t\t HelloBean annotationBean = ctx.getBean(HelloBean.class);\n\t\t\t System.out.println(annotationBean.getMsg() + \" called \" + annotationBean.getCount() + \" times.\");\n\t}", "@Before\n\tpublic void onBefore() {\n\t\tcontext = new ClassPathXmlApplicationContext(\n\t\t \"classpath:test-spring-post-processor-with-annotation-config.xml\");\n\n\t\tcontext.registerShutdownHook();\n\n\t}", "public static void main(String[] args) {\n ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(\"spring.xml\");\r\n \r\n //Get the EmployeeDAO Bean\r\n SurveyDAO surveyDAO = ctx.getBean(\"surveyDAO\", SurveyDAO.class);\r\n \r\n \r\n \r\n \r\n// Customer emp1 = customerDAO.getByWebQuoteReferenceNumber(\"C15482084J\");\r\n// System.out.println(\"Customer Retrieved::\"+emp1);\r\n \r\n// System.out.println(\"==================================\");\r\n// System.out.println(\"reference policy number :\"+customerDAO.retrievePolicyNumberAndDatOfBirth().getRefencePolicyNumber());\r\n// System.out.println(\"reference policy number :\"+customerDAO.retrievePolicyNumberAndDatOfBirth().getDateOfBirth());\r\n \r\n \r\n SAppQuestions c = surveyDAO.getAllQuestions();\r\n System.out.println(\"reference number \"+ c.getQuestionNo());\r\n System.out.println( \"Date of birth \"+c.getQuestionTitle());\r\n \r\n \r\n \r\n \t\r\n \t//System.out.println(\"Policy Number and date of birth:\"+emp2);\r\n ctx.close();\r\n \r\n System.out.println(\"DONE\");\r\n }", "public static void main(String[] args) {\n\n SpringApplication springApplication = new SpringApplication(AopTestRunner.class);\n springApplication.setWebApplicationType(WebApplicationType.NONE);\n springApplication.run(AopTestRunner.class, args);\n\n }", "ApplicationContext getAppCtx();", "public static void main(String[] args){\n ApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);\n Singer xiaoming = ctx.getBean(\"xiaoming\",Singer.class);\n// Singer xiaoming2 = ctx.getBean(\"xiaoming\",Singer.class);\n//\n xiaoming.play();\n }", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(\"contextApplicationXML.xml\");\n\n\t\t//retrieve bean from spring container\n\t\tCoach coach=context.getBean(\"myCoach\", Coach.class);\n\t\tSystem.out.println(coach.getWorkout());\n\t\t\n\t\t//close the context \n\t\tcontext.close();\n\t}", "public Aspect getAspect() { return Aspect.ALCHEMY; }", "public static void main(String[] args) {\n\t\tString configLocation = \"classpath:applicationCTX.xml\";\r\n\t\tAbstractApplicationContext ctx = new GenericXmlApplicationContext(configLocation);\r\n\t\tMyCalculator myCalculator = ctx.getBean(\"myCalculator\",MyCalculator.class);\r\n\t\tMyInfo myInfo = ctx.getBean(\"myInfo\",MyInfo.class);\r\n\t\t/*myCalculator.add();\r\n\t\tmyCalculator.sub();\r\n\t\tmyCalculator.multi();\r\n\t\tmyCalculator.div();\r\n\t\t*/\r\n\t\t//myInfo.bmiCalculation();\r\n\t\tmyInfo.getInfo();\r\n\t\t\r\n\t\t\r\n\t\tStudentInfo studentInfo = ctx.getBean(\"studentInfo\",StudentInfo.class);\r\n\t\tstudentInfo.getStudentInfo();\r\n\t\tStudent student2 = ctx.getBean(\"student2\",Student.class);\r\n\t\tstudentInfo.setStudent(student2);\r\n\t\tstudentInfo.getStudentInfo();\r\n\t\t\r\n\t\tPencil pencil = ctx.getBean(\"pencil\",Pencil.class);\r\n\t\tpencil.use();\r\n\t\t\r\n\t\tctx.close();\r\n\t}", "@Test\n void configuration_mixedConfiguration() {\n ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfigThree.class);\n\n MessageRenderer messageRenderer = ctx.getBean(\"messageRenderer\", MessageRenderer.class);\n messageRenderer.render();\n }", "@Pointcut(\"execution(* com.bharath.spring.mvc.aop.service.*.*(..))\")\n private void forServicePackage() {}", "@Before(\"execution(* com.zzt.learnspring.service.HelloWorldService+.*(..))\")\n public void logBefore(JoinPoint joinPoint) {\n\n System.out.println(\"logBefore() is running!\");\n System.out.println(\"hijacked : \" + joinPoint.getSignature().getName());\n System.out.println(\"******\");\n }", "@Test\n public void beanFactoryPostProcessir() {\n Person p1 = (Person) applicationContext.getBean(\"p1\");\n //System.out.println(p1.getAge());\n\n // applicationContext.getBean(\"p3\");\n }", "public static void main(String[] args) {\n\t\tAnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConfigClass.class);\n\t\t//Bean1 b1 = (Bean1) context.getBean(\"Bean1\");\n\t\tBean2 b2 = context.getBean(Bean2.class);\n\t\tb2.getProp1();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tResource r = new ClassPathResource(\"spring/b01_di/diexp_p_c.xml\");\n\t\tBeanFactory bean1 = new XmlBeanFactory(r);\n\t\tPerson p01 = (Person)bean1.getBean(\"p01\");\n\t\tSystem.out.println(\"À̸§: \"+p01.getName());\n\t\tSystem.out.println(\"³ªÀÌ: \"+p01.getAge());\n\t\tAbstractApplicationContext aactx = new GenericXmlApplicationContext(\"spring/b01_di/diexp_p_c.xml\");\n\t\tProduct prod1 = aactx.getBean(\"prod1\", Product.class);\n\t\tSystem.out.println(prod1.getName()+\" : \"+prod1.getPrice());\n\t\t\n\t\tBeanFactory bean2 = new XmlBeanFactory(r);\n\t\tProduct prod2 = (Product)bean2.getBean(\"prod1\");\n\t\tSystem.out.println(prod2.getName());\n\t\t\n\t\tPerson p02 = aactx.getBean(\"p01\", Person.class);\n\t\tSystem.out.println(p02.getName());\n\t}", "public interface MyApplicationContextAware {\n /**\n * 20:18 2020/11/15\n * @param \n * @return\n */\n void setAapplicationContext(MyApplicationContext application);\n}", "public static void main(String[] args) {\n ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);\n }", "public static void main(String[] args) {\n\t \tApplicationContext context = new ClassPathXmlApplicationContext(\"withAutowireT.xml\"); \r\n\t \r\n\t \t//we get human object\r\n\t HumanT human=(HumanT)context.getBean(\"human\"); \r\n\t human.startPumping(); \r\n\t }", "public static void main(String[] args) {\n\tBeanFactory factory;\n\tfactory=new XmlBeanFactory(new ClassPathResource(\"kcp/spring/configuration/applicationContext.xml\"));\n\tClass c1=null;\n\tc1=factory.getBean(\"c1\",Class.class);\n\tSystem.out.println(c1+\" \"+c1.getClass());\n\t Properties c2=factory.getBean(\"c2\",Properties.class);\n\tSystem.out.println(c2+\" \"+c2.getClass());\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tApplicationContext applicationContext = new ClassPathXmlApplicationContext(\"com/i18n/common/application-context.xml\");\r\n\t\tSystem.out.println(\"ApplicationContext class Object type \"+applicationContext.getClass().getName());\r\n\t\tString messageFromApplivationContext = applicationContext.getMessage(\"title\",null,Locale.getDefault());\r\n\t\tSystem.out.println(\"Message From ApplicationContext \"+messageFromApplivationContext);;\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\tClassPathXmlApplicationContext cpac = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\r\n\t\t//Coach c = cpac.getBean(\"Cricket_Coach\", Coach.class);\r\n\t\tTennisCoach t = cpac.getBean(\"Tennis_Coach\", TennisCoach.class);\r\n\t\t//TennisCoach t_copy = cpac.getBean(\"Tennis_Coach\", TennisCoach.class); // By Default, it is singleton.\r\n\t\t//Coach f = cpac.getBean(\"Football_Coach\", Coach.class);\r\n\t\t//System.out.println(c.getPracticeInfo());\r\n\t\t//System.out.println(t + \"\\n\" + t_copy);\r\n\t\t/*System.out.println(t.getCandy());\r\n\t\tSystem.out.println(t.getPracticeInfo());\r\n\t\tSystem.out.println(t_copy.getCandy());\r\n\t\tSystem.out.println(t_copy.getPracticeInfo());*/\r\n\t\t//System.out.println(f.getPracticeInfo());\r\n\t\tSystem.out.println(t.getEmail());\r\n\t\tSystem.out.println(t.getTeamName());\r\n\t}", "public static void main(String args[]){\n ApplicationContext context=new ClassPathXmlApplicationContext(\"bean.xml\");\n Movie movie=context.getBean(\"movie\", Movie.class);\n movie.movieDisplay();\n\n BeanFactory beanfactory=new XmlBeanFactory(new ClassPathResource(\"bean.xml\"));\n //getBean() returns instance\n Movie movie1=beanfactory.getBean(\"movie\", Movie.class);\n movie1.movieDisplay();\n\n DefaultListableBeanFactory defaultListableBeanFactory=new DefaultListableBeanFactory();\n BeanDefinitionRegistry beanDefinitionRegistry=new GenericApplicationContext(defaultListableBeanFactory);\n BeanDefinitionReader beanDefintionReader=new XmlBeanDefinitionReader(beanDefinitionRegistry);\n beanDefintionReader.loadBeanDefinitions(\"bean.xml\");\n Movie movie2=defaultListableBeanFactory.getBean(\"movie\",Movie.class);\n movie2.movieDisplay();\n }", "public static void main(String[] args) {\n\t\tApplicationContext actx = new FileSystemXmlApplicationContext(\"/src/main/java/com/baby/springStudy/echoMsgConfig.xml\");\n\t\tEchoMsg echoMsg = (EchoMsg)actx.getBean(\"EchoMsg\");\n\t\tSystem.out.println(echoMsg.sayHello());\n\t}", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(\"beanScopeApplicationContext.xml\");\n\t\t\n\t\t// Retrieve bean from spring container \n Coach coach=context.getBean(\"myCoach\",Coach.class);\n Coach alphaCoach=context.getBean(\"myCoach\",Coach.class);\n // Check if they are same\n boolean result = (coach==alphaCoach);\n // print out the result\n \n System.out.println(result);\n System.out.println(coach);\n System.out.println(alphaCoach);\n context.close();\n \n \t\n\t}", "public IAspect getAspect(ResourceLocation name);", "public static void main(String args[]) {\r\n\t\tApplicationContext appContext=new ClassPathXmlApplicationContext(\"beans.xml\");\r\n\t\tEmployeeBean emp1=(EmployeeBean) appContext.getBean(\"Employee\");\r\n\t\tSystem.out.println(emp1.getName());\r\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext factory = new ClassPathXmlApplicationContext(\"com/test01/application.xml\");\n\t\t\n\t\tMyClass myclass = (MyClass)factory.getBean(\"myClass\");\n\t\tmyclass.prn();\n\t\t\n//\t\tScore sc = (Score)factory.getBean(\"score\");\n\t\t\n\t\tBeanTst bean = factory.getBean(\"beanTst\", BeanTst.class );\n\t}", "@Test\n\tpublic void testAroundAdvice() {\n\t\tSystem.out.println(customerService.getClass().getName());\n\t\t//customerService.applyForChequeBook(12345);\n\t\t//customerService.stopCheque(12345);\n\t\t//manually creating a new instance bypassing sping\n\t\tcustomerService = new CustomerServiceImpl();\n\t\tcustomerService.applyForChequeBook(12345);\n\t\tcustomerService.stopCheque(12345);\n\n\t}", "public static void main(String[] args){\n\n \tApplicationContext appContext = new AnnotationConfigApplicationContext(AppConfig.class);\n AnimalStoreService aService = appContext.getBean(\"animalStoreService\", AnimalStoreService.class);\n aService.execute();\n\n\n }", "public static void main(String[] args) {\n\t\tApplicationContext ac=new ClassPathXmlApplicationContext(\"com/nt/cfgs/applicationContext.xml\");\n\t\t\n\t\t//get Bean\n\t\tVechile vechile = ac.getBean(\"vech\", Vechile.class);\n\t\tvechile.move();\n\t}", "public static void main(String[] args) {\n AbstractApplicationContext context = new AnnotationConfigApplicationContext(\"com.ravindra\");\n Product p =(Product)context.getBean(\"product \");\n p.setId(\"123\");\n p.setName(\"Dell\");\n p.setPrice(400);\n System.out.println(p.toString());\n }", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context = \n\t\t\t\tnew ClassPathXmlApplicationContext(\"annotations-applicationContext.xml\");\n\t\t\n\t\t// get bean from spring container\n\t\tInstructor theInstructor = context.getBean(\"javaInstructor\", Instructor.class);\n\t\t\n\t\t// call methods on the bean\n\t\tSystem.out.println(theInstructor.getDailyPractice());\n\t\t\n\t\t// call method , get daily infoservice\n\t\tSystem.out.println(theInstructor.getDailyInfoService());\t\n\t\t\n\t\t// close context\n\t\tcontext.close();\n\n\t}", "public static void main(String args[])\n {\n ClassPathXmlApplicationContext context = new\n ClassPathXmlApplicationContext(\"applicationContext.xml\");\n\n // retrieve bean from spring container\n Coach theCoach = context.getBean(\"myCoach\",Coach.class);\n\n// call methods on the bean\n System.out.println(theCoach.getDailyWorkout());\n\n// lest call our new method for fortunes\n System.out.println(theCoach.getDailyFortune());\n\n// close the context\n context.close();\n\n\n }", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n\t\t\n\t\t//retrieve the beans\n\t\tCoach theCoach = context.getBean(\"tennisCoach\", Coach.class);\n\t\tCoach coach2 = context.getBean(\"soccerCoach\",SoccerCoach.class);\n\t\tCoach coach3 = context.getBean(\"karateCoach\", KarateCoach.class);\n\t\t\n\t\t//call some methods\n\t\tSystem.out.println(theCoach.getDailyWorkout());\n\t\tSystem.out.println(theCoach.getDailyFortune());\n\t\tSystem.out.println(coach2.getDailyFortune());\n\t\tSystem.out.println(coach3.getDailyFortune());\n\t\t\n\t\t//close the container\n\t\tcontext.close();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t BeanFactory factory = new XmlBeanFactory(new ClassPathResource(\"com/nit/cfgs/applicationContext.xml\"));\r\n\r\n//\tgetting target class object using bean id\r\n\tVechicle vehicle = factory.getBean(\"vechicle\", Vechicle.class);\r\n\t\r\n//\tinvoking method\r\n\tvehicle.journey(\"Delhi\", \"banglore\");\r\n\t\r\n\t\r\n\t}", "public static void main(String[] args) {\n ApplicationContext applicationContext = new ClassPathXmlApplicationContext(\"bean.xml\");\n SingletonComponent singletonComponent = applicationContext.getBean(SingletonComponent.class);\n singletonComponent.setComponentProperty(\"Hello\");\n System.out.println(singletonComponent.getComponentProperty());\n\n SingletonComponent singletonComponent2 = applicationContext.getBean(SingletonComponent.class);\n System.out.println(singletonComponent2.getComponentProperty());\n\n\n PrototypeComponent prototypeComponent = applicationContext.getBean(PrototypeComponent.class);\n prototypeComponent.setComponentProperty(\"Hello\");\n System.out.println(prototypeComponent.getComponentProperty());\n\n PrototypeComponent prototypeComponent2 = applicationContext.getBean(PrototypeComponent.class);\n prototypeComponent2.setComponentProperty(\"Hello2\");\n System.out.println(prototypeComponent2.getComponentProperty());\n\n\n ComplexComponent bean = applicationContext.getBean(ComplexComponent.class);\n System.out.println(applicationContext.getBean(AutowiredComponent.class));\n bean.printAutoWiredComponent();\n\n\n System.out.println(applicationContext.getBean(AutowiredPrototypeComponent.class));\n bean.printAutoWiredPrototypeComponent();\n\n\n }", "public static void main(String[] args) {\n\t\tAbstractApplicationContext appContext = new FileSystemXmlApplicationContext(\"src/ApplicationMetaData.xml\");\n\t\tEmployee employee = appContext.getBean(\"tcsEmployee\", Employee.class);\n\t\t//2.Print out Employee Bean\n\t\tSystem.out.println(\"**************\");\n\t\tSystem.out.println(\"Employee Id::\"+ employee.getEmployeeId());\n\t\tSystem.out.println(\"Employee Name::\" + employee.getEmployeeName());\n\t\tSystem.out.println(\"**************\");\n\t\tappContext.close();\n\n\t}", "public static void main(final String... args) {\n\t\tAbstractApplicationContext context =\n\t new ClassPathXmlApplicationContext(\"classpath:META-INF/spring//*-context.xml\");\n\t final ExampleService service = context.getBean(ExampleService.class);\n\t System.out.println(\"endpoint:\" + service.getEndPoint());\n\t logger.info(\"endpoint:\" + service.getEndPoint());\n\t}", "public static void main(String[] args) {\n\t\tFileSystemResource res = new FileSystemResource(\"src/com/nt/cfgs/applicationContext.xml\");\r\n\t\t// crrate IOC container \r\n\t\tXmlBeanFactory factory = new XmlBeanFactory(res);\r\n\t\t//get target Spring bean class object from factoryObject\r\n\t\tWishMessageGenerator generator = (WishMessageGenerator) factory.getBean(\"wishMessageGenerator\");\r\n\t\tWishMessageGenerator generator2 = (WishMessageGenerator) factory.getBean(\"wmsg1\");\r\n\t\tWishMessageGenerator generator3 = (WishMessageGenerator) factory.getBean(\"wmsg2\");\r\n\t\tSystem.out.println(generator2.hashCode()+\" \"+generator3.hashCode()+\" \"+generator.hashCode());\r\n\t\tWishMessageGenerator generator4 = (WishMessageGenerator) factory.getBean(\"don1\");\r\n\t\tWishMessageGenerator generator5 = (WishMessageGenerator) factory.getBean(\"don2\");\r\n\t\tWishMessageGenerator generator6 = (WishMessageGenerator) factory.getBean(\"don3\");\r\n\t\tWishMessageGenerator generator7 = (WishMessageGenerator) factory.getBean(\"don4\");\r\n\t\tSystem.out.println(generator4.hashCode()+\" \"+generator5.hashCode()+\" \"+generator6.hashCode()+\" \"+generator7.hashCode());\r\n\t\t//invoke the b.logic\r\n\t\tSystem.out.println(\"result \"+ generator.generateWishMessage(\"Sushant\"));\r\n\t}", "public static void main(String[] args) {\n ApplicationContext ctx = new ClassPathXmlApplicationContext(\"beans-cp.xml\");\n \n SpringJdbc springJdbc=ctx.getBean(SpringJdbc.class);\n springJdbc.actionMethod();\n \n //Lectura de Bean \n //OrganizationDao organizationDao = (OrganizationDao) ctx.getBean(\"organizationDao\");\n \n ((ClassPathXmlApplicationContext) ctx).close();\n }", "public static void main(String[] args) {\n\t\tClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n\t\t//AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(TennisCoach.class);\n\t\t//get the bean from spring container\n\t\t//1. Default bean id\n\t\tCoach theCoach=context.getBean(\"tennisCoach\", Coach.class);\n\t\t//2. Explicit bean id\n\t\t//Coach theCoach=context.getBean(\"thatCoach\", Coach.class);\n\t\tSystem.out.println(theCoach.getDailyWorkout());\n\t\t//call method to get a daily fortune\n\t\tSystem.out.println(theCoach.getDailyFortune());\n\t\tcontext.close();\n\t}", "@Around(\"execution(public void edu.sjsu.cmpe275.aop.BlogService.*(..))\")\n\tpublic void dummyAdvice(ProceedingJoinPoint joinPoint) {\n\t\tSystem.out.printf(\"Prior to the executuion of the metohd %s\\n\", joinPoint.getSignature().getName());\n\t}", "public static void main(String[] args) {\n\t\t\r\n \r\n \r\n Resource res=null;\r\n BeanFactory bs=null;\r\n res=new FileSystemResource(\"src/com/spr/cfg/applicationContext.xml\");\r\n bs=new XmlBeanFactory(res);\r\n \r\n Object obj=bs.getBean(\"wsg\");\r\n WishApp opp=(WishApp)obj;\r\n String result=opp.WishGenrator(\"deependra\");\r\n System.out.println(result);\r\n \r\n\t}", "public static void main(String[] args) {\n\t\tApplicationContext ac=new ClassPathXmlApplicationContext(\"springcore.xml\");\n\t\t//identify bean by its id\n\t\tGreet gt=(Greet)ac.getBean(\"g1\");\n\t\tSystem.out.println(gt.getMessage());\n\n\n\t}", "@Before\n public void init() throws IOException {\n ApplicationContext context = new ClassPathXmlApplicationContext(\"config/applicationContext.xml\");\n //this.test();\n bookMapper = context.getBean(BookMapper.class);\n }", "public static void main(String[] args) {\n\tApplicationContext ctx = SpringApplication.run(AppOne.class, args);\t\n\tSystem.out.println(\"Requesting A bean from the container...\");\n\tA a1 = (A) ctx.getBean(\"a\");\n\tSystem.out.println(\"printing first a object...\");\n\tSystem.out.println(a1);\n\tSystem.out.println(\"Requesting another A bean from the container...\");\n\tA a2 = (A) ctx.getBean(\"a\");\n\tSystem.out.println(\"printing second a object...\");\n\tSystem.out.println(a2);\n\t}", "private SpringApplicationContext() {}", "public static void main(String[] args) {\n\t\tAbstractApplicationContext ctx=new ClassPathXmlApplicationContext(\"SpringConfig.xml\");\n\n\tClassificationService classificationService = ctx.getBean(\"classificationService\", ClassificationServiceImpl.class);\n\t\t\n//\t\tClassification classification = new Classification();\n//\t\tclassification.setClassificationName(\"spring\");\n//\t\t\n//\t\tclassificationService.storeClassification(classification);\n\t\t\n//\t\tfor(Classification classification:classificationService.getClassification()) {\n//\t\t\tSystem.out.println(classification.getId()+\" \"+classification.getClassificationName());\n//\t\t}\n\t\t\n\t\t\n\t}", "private SpringApplicationContextProvider() {\r\n\t}", "public static void main(String[] args) {\n\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(\"spring/config/application-context.xml\");\n\t\t\n\t\tAvengerService avengerService = (AvengerService) context.getBean(\"avengerService\");\n\t\t\n\t\tAgentService agentService = (AgentService) context.getBean(\"agentService\");\n\n\t\t\n//\t\tAvenger avenger = new Avenger();\n//\t\tavenger.setFirstName(\"Tony\");\n//\t\tavenger.setLastName(\"STARK\");\n//\t\tavenger.setAlias(\"Iron man\");\n//\t\tavenger.setPower(7);\n//\t\t\n//\t\tavengerService.save(avenger);\n//\t\t\n//\t\tSystem.out.println( avengerService.getAvenger(30).getAlias());\n//\t\t\n//\t\t\n//\t\tAgent agentFury = agentService.getAgent(10);\n//\t\t\n//\t\tSystem.out.println(\"nom : \" + agentFury.getLastName());\n//\t\tSystem.out.println(\"prénom : \" + agentFury.getFirstName());\n//\t\tSystem.out.println(\"liste des avengers recrutés : \");\n//\t\t\n//\t\t\n//\t\tfor (Avenger av : agentFury.getAvengers()) {\n//\t\t\n//\t\t\tSystem.out.println(\"-------------\");\n//\t\t\tSystem.out.println(av.getAlias());\n//\t\t}\n\t\n\t\tAvenger avengerIron = avengerService.getAvenger(30);\n\t\tavengerService.delete(avengerIron);\n\t\t\n\t}" ]
[ "0.6085769", "0.60041404", "0.5818836", "0.57847893", "0.56950444", "0.56594634", "0.55873656", "0.55007243", "0.5494411", "0.5480196", "0.54753506", "0.5464078", "0.5431344", "0.54264194", "0.5404639", "0.53904295", "0.53871", "0.53857964", "0.5370348", "0.535923", "0.53559923", "0.5354513", "0.53365755", "0.533434", "0.53202283", "0.53178304", "0.53053963", "0.53035885", "0.529281", "0.5283818", "0.5283545", "0.5280939", "0.5277969", "0.5274969", "0.52726656", "0.5265529", "0.52555776", "0.52523744", "0.52329344", "0.5223266", "0.5223119", "0.5220902", "0.5217172", "0.52007365", "0.5194035", "0.51866174", "0.517615", "0.5174058", "0.5171797", "0.5168584", "0.5163427", "0.5154957", "0.5153767", "0.51455754", "0.51408553", "0.5139387", "0.51251715", "0.51126075", "0.51111376", "0.5098158", "0.5084982", "0.5084918", "0.5082136", "0.5080185", "0.5077908", "0.5076694", "0.5070433", "0.5067304", "0.5064084", "0.5063589", "0.5038874", "0.50356567", "0.50284404", "0.5024894", "0.5021151", "0.5007203", "0.5002682", "0.5000457", "0.4998245", "0.49861446", "0.49736494", "0.49687895", "0.49685505", "0.49649152", "0.49560153", "0.49541622", "0.4950535", "0.4949938", "0.4948131", "0.49474755", "0.49339923", "0.49332863", "0.49279872", "0.4901762", "0.4899528", "0.4898832", "0.48907694", "0.4888563", "0.48807356", "0.48734933" ]
0.67797416
0
create scanner and tree
public static void main(String[] args) { Scanner kb = new Scanner(System.in); BinarySearchTree<Character> tree = buildTree(); String [] morse = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."}; // make object to hold the array and built tree MorseCode build = new MorseCode(morse, tree); // create menu and prompt user System.out.println("What would you like to do?"); System.out.println("1: Enter String."); System.out.println("2: Enter Morse Code."); System.out.println("3: Exit."); int choice = kb.nextInt(); // while the user doesn't exit while (choice != 3) { if (choice == 1) { // clear buffer kb.nextLine(); System.out.println("Enter string now."); String message = kb.nextLine().toUpperCase(); System.out.println(build.encode(message)); } else if (choice == 2) { // clear buffer kb.nextLine(); System.out.println("Enter morse code now."); String code = kb.nextLine(); System.out.println(build.decode(code, tree)); } // reprompt for menu choice System.out.println("Enter new choice."); choice = kb.nextInt(); } // end while loop System.out.println("Exit Complete."); kb.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static TreeNode parseTreeNode(Scanner in)\n {\n int numberOfChildren = in.nextInt();\n int numberOfMetadata = in.nextInt();\n TreeNode newNode = new TreeNode(numberOfChildren, numberOfMetadata);\n\n // Recursively resolve children\n for (int i = 0; i < numberOfChildren; i++)\n {\n newNode.mChildren[i] = parseTreeNode(in);\n }\n\n // Now resolve the metadata by consuming tokens\n for (int i = 0; i < numberOfMetadata; i++)\n {\n newNode.mMetadata[i] = in.nextInt();\n }\n\n return newNode;\n }", "public static Tree parseTree(Scanner in)\n {\n Tree newTree = new Tree();\n newTree.mRoot = parseTreeNode(in);\n\n return newTree;\n }", "private static void fillTree(Branch side, Scanner scanner, BinaryNode<String> parent) {\r\n\t\t//If the scanner has a next line, take in the line and see if it is \"NULL\". If it is NULL, do nothing (Base case). Else, set the left or right child\r\n\t\t//to a BinaryNode containing the next string taken in by the scanner depending on the side the method was called with. \r\n\t\t//Then execute two recursive calls to fill out the rest of that side of the tree..\r\n\t\tif(scanner.hasNext()) {\r\n\t\t\tBinaryNode <String> entry = new BinaryNode<String>(scanner.nextLine());\r\n\t\t\t//Base case: If the line is \"NULL\", do nothing\r\n\t\t\tif(entry.getData().equals(\"NULL\")) {}\r\n\t\t\telse {\r\n\t\t\t\t//If the side is LEFT, set the left node to the entry\r\n\t\t\t\tif(side == Branch.LEFT) \r\n\t\t\t\t\tparent.setLeftChild(entry);\r\n\t\t\t\t//If the side is RIGHT, set the right node to the entry\r\n\t\t\t\telse if(side == Branch.RIGHT) \r\n\t\t\t\t\tparent.setRightChild(entry);\r\n\t\t\t\t//Call the method for the left and right sides again to fill out the rest of that side of the tree\r\n\t\t\t\tfillTree(Branch.LEFT, scanner, entry);\r\n\t\t\t\tfillTree(Branch.RIGHT, scanner, entry);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private QuestionNode readTree(Scanner input){\n String type = input.nextLine();\n String data = input.nextLine();\n QuestionNode current = new QuestionNode(data);\n if(!type.equals(\"A:\")) {\n current.left = readTree(input);\n current.right = readTree(input);\n }\n return current;\n }", "void createItem(StreamTokenizer st) throws DataFormatException, IOException {\n\t\tboolean debug = false;\n\t\tboolean inComment = false;\n\t\tStringBuffer treebuf = new StringBuffer();\n\t\twhile (true) {\n\t\t\tswitch (st.nextToken()) {\n\t\t\tcase StreamTokenizer.TT_WORD:\n\t\t\t\t// inside a comment. Ignore it.\n\t\t\t\tif (inComment)\n\t\t\t\t\tbreak;\n\t\t\t\t// reached a valid piece. add it.\n\t\t\t\tif (debug) Debug.debug(debug, \"TreeItem: About to add token \"+st.sval);\n\t\t\t\ttreebuf.append(st.sval);\n\t\t\t\tbreak;\n\t\t\tcase '\"':\n\t\t\t\t// inside a comment. Ignore it.\n\t\t\t\tif (inComment)\n\t\t\t\t\tbreak;\n\t\t\t\t// reached a valid piece. add it.\n\t\t\t\t// check for length 0 and triple quote\n\t\t\t\tif (st.sval.length() == 0) {\n\t\t\t\t\tst.ordinaryChar('\"');\n\t\t\t\t\tif (st.nextToken() == '\"') {\n\t\t\t\t\t\tif (debug) Debug.debug(debug, \"Found triple quote\");\n\t\t\t\t\t\ttreebuf.append(\"\\\"\\\"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tst.pushBack();\n\t\t\t\t\t\tif (debug) Debug.debug(debug, \"Found empty double quote\");\n\t\t\t\t\t\ttreebuf.append(\"\\\"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t\tst.quoteChar('\"');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (debug) Debug.debug(debug, \"TreeItem: About to add quoted token \"+st.sval);\n\t\t\t\t\ttreebuf.append(\"\\\"\"+st.sval+\"\\\"\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '@':\n\t\t\tcase '#':\n\t\t\t\tif (debug) Debug.debug(debug, \"TreeItem: pushing symbol back\");\n\t\t\t\tst.pushBack();\n\t\t\tcase StreamTokenizer.TT_EOL:\n\t\t\tcase StreamTokenizer.TT_EOF:\n\n\t\t\t\t// in a newline. Reset any inComment aspect\n\t\t\t\tinComment = false;\n\t\t\t\tif (treebuf.length() > 0) {\n\t\t\t\t\tif (debug) Debug.debug(debug, \"TreeItem: About to process item \"+treebuf.toString());\n\t\t\t\t\tTreeItem t = new TreeItem(treebuf);\n\t\t\t\t\tchildren = t.children;\n\t\t\t\t\tnumChildren = t.numChildren;\n\t\t\t\t\tnumNodes = t.numNodes;\n\t\t\t\t\ttruncated = t.truncated;\n\t\t\t\t\tlabel = t.label;\n\t\t\t\t\tweight = t.weight;\n\t\t\t\t\tisEmptyString = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (debug) Debug.debug(debug, \"Skipping empty line\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// can't reach here, so no break\n\t\t\tcase COMMENT:\n\t\t\t\t// in a comment. Set inComment flag\n\t\t\t\tinComment = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new DataFormatException(\" Expected word, but read \"+st.ttype+\" which is \"+(char)st.ttype);\n\n\t\t\t}\n\t\t}\n\t}", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "private Node CreateTree() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tQueue<Node> q = new LinkedList<>();\n\t\tint item = sc.nextInt();\n\t\tNode nn = new Node();\n\t\tnn.val = item;\n\t\troot = nn;\n\t\tq.add(nn);\n\t\twhile (!q.isEmpty()) {\n\t\t\tNode rv = q.poll();\n\t\t\tint c1 = sc.nextInt();\n\t\t\tint c2 = sc.nextInt();\n\t\t\tif (c1 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c1;\n\t\t\t\trv.left = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t\tif (c2 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c2;\n\t\t\t\trv.right = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\n\t}", "public static void main(String[] args) {\n\n\t\n\t\tScanner sc =new Scanner(System.in);\n\t\t\n\t\tfor (int i =1; i <=10; i++) {\n\t\t\t\n\t\t\ttree=null;\n\t\t\tint n=sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\t\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tString str= sc.nextLine();\n\t\t\t\t\n\t\t\t\tstr=str.split(\"\\n\")[0];\n\t\t\t\t\n\t\t\t\tString[] spli=str.split(\" \");\n\t\t\t\t\n//\t\t\t\tSystem.out.println(Arrays.toString(spli));\n\t\t\t\t\n\t\t\t\tmakeNode(spli);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"#\"+i+\" \");\n\t\t\tinorder(tree);\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t}", "public Parser(Scanner scanner) {\n this.scanner = scanner;\n scan();\n }", "public QuestionTree() {\r\n console = new Scanner(System.in);\r\n overallRoot = new QuestionNode(\"computer\");\r\n }", "@Override\r\n\tpublic void run() {\n \tFile in = new File(\"input.txt\");\r\n\t\t String strLine;\r\n\t\t int k;\r\n\t\t Tree mytree = new Tree();\r\n\t\t try {\r\n\t\t Scanner sc = new Scanner(in);\r\n\t\t while (sc.hasNext()) {\r\n\t\t mytree.insert(sc.nextInt());\r\n\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t try(FileWriter fos=new FileWriter(\"output.txt\"))\r\n\t {\r\n\t \r\n\t\t\t mytree.PreOrderTraversal(mytree.root, fos);\r\n\t }\r\n\t catch(IOException ex){\r\n\t \tSystem.out.println(ex.getMessage());\r\n\t }\r\n \t\r\n\t}", "public QuestionTree() {\r\n console = new Scanner(System.in);\r\n finalRoot = new QuestionNode(\"computer\");\r\n }", "public QuestionsGame(Scanner input){\n //initialize questionTree by using content stored in input\n this.questionTree = this.readTree(input);\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 }", "void makeDeck(Scanner scanner) \n\t\t\tthrows IOException {\n\t\tCardNode cn = null;\n\t\tif (scanner.hasNextInt()) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = scanner.nextInt();\n\t\t\tcn.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t\twhile (scanner.hasNextInt()) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = scanner.nextInt();\n\t\t\tcn.next = deckRear.next;\n\t\t\tdeckRear.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t}", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "private void prepareScanner() {\r\n\t\tbcLocator = new BCLocator();\r\n\t\tbcGenerator = new BCGenerator();\r\n\t}", "private static BST readDataFile(Scanner in)\n\t{\n\t\tBST tree=new BST();\n\t\t\n\t\t//read the file line by line\n\t\twhile(in.hasNextLine())\n\t\t{\n\t\t\t// Scanner to read 1 line; closed before end of while loop\n\t\t\tString currentLine=in.nextLine();\n\t\t\tScanner line=new Scanner(currentLine);\n\t\t\t\n\t\t\t// makes the scanner separate the information in the line by \",\" and \";\"\n\t\t\tline.useDelimiter(\",|;\");\n\t\t\t\n\t\t\t// create a profile from the line and insert it into the tree\n\t\t\tProfile p=createProfile(line);\n\t\t\ttree.insertProfile(p);\t\n\t\t\t\t\t\n\t\t\tline.close();\n\t\t}\n\t\t\n\t\tin.close();\n\t\treturn tree;\n\t}", "private TreeItem(StringBuffer text, int level) throws DataFormatException, IOException {\n\t\tboolean debug = false;\n\t\t// is input the head of a tree?\n\t\tMatcher nodeMatch = nodePat.matcher(text.toString());\n\t\tif (nodeMatch.lookingAt()) {\n\t\t\tif (debug) Debug.debug(debug, level, \"matched \"+text+\" against node pattern\");\n\t\t\tString labStr = nodeMatch.group(2);\n\t\t\tint totalLength = nodeMatch.group(1).length();\n\t\t\tif (debug) Debug.debug(debug, level, \"Consuming [\"+nodeMatch.group(1)+\"]\");\n\t\t\tif (debug) Debug.debug(debug, level, \"label set to \"+labStr);\n\t\t\tlabel = SymbolFactory.getSymbol(labStr);\n\t\t\ttext.delete(0, totalLength);\n\t\t\t// temporary holding place for children\n\t\t\tVector<TreeItem> kids = new Vector<TreeItem>();\n\t\t\t// add children until we reach the end pattern\n\t\t\tMatcher endMatch = endPat.matcher(text.toString());\n\t\t\twhile (!endMatch.lookingAt()) {\n\t\t\t\tTreeItem kid = new TreeItem(text, level+1);\n\t\t\t\tif (debug) Debug.debug(debug, level, \"adding child \"+kid);\n\t\t\t\tkids.add(kid);\n\t\t\t\tendMatch = endPat.matcher(text.toString());\n\t\t\t}\n\t\t\ttotalLength = endMatch.group(1).length();\n\t\t\tif (debug) Debug.debug(debug, level, \"Consuming end group [\"+endMatch.group(1)+\"]\");\n\t\t\ttext.delete(0, totalLength);\n\t\t\tMatcher weightMatch = weightPat.matcher(text.toString());\n\t\t\tif (weightMatch.matches()) {\n\t\t\t\tif (weightMatch.group(2) != null) {\n\t\t\t\t\tif (debug) Debug.debug(debug, \"Reading weight \"+weightMatch.group(1));\n\t\t\t\t\tweight = Double.parseDouble(weightMatch.group(2));\n\t\t\t\t}\n\t\t\t\ttext.delete(0, weightMatch.group(1).length());\n\t\t\t}\n\t\t\tchildren = new TreeItem[kids.size()];\n\t\t\tnumChildren = children.length;\n\t\t\tkids.toArray(children);\n\t\t\treturn;\n\t\t}\n\t\t// is input a leaf?\n\t\tMatcher leafMatch = leafPat.matcher(text.toString());\n\t\tif (leafMatch.lookingAt()) {\n\t\t\tif (debug) Debug.debug(debug, level, \"matched \"+text+\" against label pattern\");\n\t\t\tString labStr = leafMatch.group(2);\n\t\t\tint totalLength = leafMatch.group(1).length();\n\t\t\tif (debug) Debug.debug(debug, level, \"Consuming [\"+leafMatch.group(1)+\"]\");\n\t\t\tlabel = SymbolFactory.getSymbol(labStr);\n\t\t\tif (debug) Debug.debug(debug, level, \"TLT label set to \"+labStr);\n\t\t\ttext.delete(0, totalLength);\n\t\t\treturn;\n\t\t}\n\t\tthrow new DataFormatException(\"Couldn't match any pattern to \"+text);\n\t}", "void createTree() throws IOException {\n\n // create root\n rootTreeItem = createTreeRoot();\n\n // create tree structure recursively\n createTree(rootTreeItem);\n\n // sort tree structure by name\n rootTreeItem.getChildren()\n .sort(Comparator.comparing(new Function<TreeItem<FilePath>, String>() {\n @Override\n public String apply(TreeItem<FilePath> t) {\n return t.getValue().toString().toLowerCase();\n }\n }));\n\n }", "private void initTree()\n {\n String currSpell;\n Node tempNode;\n String currString;\n Gestures currGest;\n for(int spellInd = 0; spellInd < SpellLibrary.spellList.length; spellInd++)\n {\n //Start casting a new spell from the root node\n tempNode = root;\n currSpell = SpellLibrary.spellList[spellInd];\n for(int currCharInd =0; currCharInd < currSpell.length(); currCharInd++)\n {\n currString = currSpell.substring(0,currCharInd+1);\n currGest = Gestures.getGestureByChar(currString.charAt(currString.length()-1));\n if(tempNode.getChild(currGest) == null) //Need to add a new node!\n {\n tempNode.addChild(currGest,new Node(currString));\n debug_node_number++;\n }\n //Walk into the existing node\n tempNode = tempNode.getChild(currGest);\n }\n\n }\n }", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(Scanner s) {super(s);}", "private Node constructParsedTree(Node[] nodes) {\n int rootIndex = 0;\n for (int i = 0; i < nodes.length; i++) {\n if (nodes[i].getFather() > 0)\n nodes[nodes[i].getFather() - 1].addChild(nodes[i]);\n else\n rootIndex = i;\n }\n return nodes[rootIndex];\n }", "public void read(Scanner input) {\r\n overallRoot = readHelper(input);\r\n }", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public static void main(final String[] args) {\n final Scanner in = new Scanner(System.in);\n System.out.print(\"Build tree with: \");\n TreeNode<String> t = treeOf(in.nextLine());\n TreeFormatter<String> formatter = new TreeFormatter<>();\n while (true) {\n // Display the tree (take the code from the Tree Lab).\n formatter.display(t);\n // Display the tree's minimum and maximum values.\n System.out.println(\"Min: \" + min(t));\n System.out.println(\"Max: \" + max(t));\n // Print the data in order from smallest to largest.\n smallToLarge(t);\n System.out.print(\"\\nI want to: \");\n String cmd = in.next().toLowerCase();\n if (cmd.startsWith(\"a\")) { // Add\n t = insert(t, in.next());\n } else if (cmd.startsWith(\"d\")) { // Delete\n String target = in.next();\n if (find(t, target)) {\n t = delete(t, target);\n } else {\n System.out.println(target + \" is not in the tree.\");\n }\n } else if (cmd.startsWith(\"e\")) { // Export\n export(t);\n } else if (cmd.startsWith(\"f\")) { // Find\n String target = in.next();\n System.out.println(target + \" is \" +\n (find(t, target) ? \"\" : \"not \") +\n \"in the tree.\");\n } else if (cmd.startsWith(\"i\")) { // Import\n t = load(t);\n } else if (cmd.startsWith(\"p\")) { // Prefix\n System.out.print(\"Infix: \");\n String infix = in.next();\n System.out.print(\"Postfix: \");\n String postfix = in.next();\n System.out.print(\"Prefix: \");\n System.out.println(toPrefix(infix, postfix));\n } else System.exit(0);\n }\n }", "public static void main(String[] args) \n\t{\n\t\ttree x = new tree(0);\n\t\t\n\t\ttreenode r = x.root;\n\t\t\n//\t\ttreenode c = r;\n//\t\tfor(int i =1;i<=4;i++)\n//\t\t{\n//\t\t\tfor(int j=0;j<=8;j=j+4)\n//\t\t\t{\n//\t\t\t\ttreenode n = new treenode(i+j);\n//\t\t\t\tif(j==0)\n//\t\t\t\t{\n//\t\t\t\t\tr.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t\telse\n//\t\t\t\t{\n//\t\t\t\t\tc.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\ttreenode c1 = r;\n\t\ttreenode c2 = r;\n\t\ttreenode c3 = r;\n\t\ttreenode c4 = r;\n\t\tfor(int i=1;i<13;i++)\n\t\t{\n\t\t\ttreenode n = new treenode(i);\n\t\t\tif(i%4==1)\n\t\t\t{\n\t\t\t\tc1.child.add(n);\n\t\t\t\tc1 = n;\n\t\t\t}\n\t\t\tif(i%4==2)\n\t\t\t{\n\t\t\t\tc2.child.add(n);\n\t\t\t\tc2 = n;\n\t\t\t}\n\t\t\tif(i%4==3)\n\t\t\t{\n\t\t\t\tc3.child.add(n);\n\t\t\t\tc3 = n;\n\t\t\t}\n\t\t\tif(i%4==0)\n\t\t\t{\n\t\t\t\tc4.child.add(n);\n\t\t\t\tc4 = n;\n\t\t\t}\n\t\t}\n\t\tx.traverse(r);\n\t}", "protected void createTree() {\n\n\t\tint nextPlayer = opponent;\n\n\t\tQueue<Node> treeQueue = new LinkedList<Node>();\n\t\tWinChecker winCheck = new WinChecker();\n\n\t\ttreeQueue.add(parent);\n\n\t\twhile (!treeQueue.isEmpty()) {\n\t\t\tNode currentNode = treeQueue.poll();\n\n\t\t\tif (currentNode.getMove().Row != -1\n\t\t\t\t\t&& currentNode.getMove().Col != -1) {\n\t\t\t\tgb.updateBoard(currentNode.getMove());\n\n\t\t\t\tif (winCheck.getWin(gb) >= 0) {\n\t\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t}\n\n\t\t\t// Restricting the depth to which we will create the tree\n\t\t\tif (currentNode.getPly() > 2) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (List<Hexagon> tempList : this.gb.getBoard()) {\n\t\t\t\tfor (Hexagon tempHex : tempList) {\n\n\t\t\t\t\tif (tempHex == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tempHex.getValue() == EMPTY) {\n\n\t\t\t\t\t\tif (currentNode.getPly() % 2 == 0) {\n\t\t\t\t\t\t\tnextPlayer = opponent;\n\t\t\t\t\t\t} else if (currentNode.getPly() % 2 == 1) {\n\t\t\t\t\t\t\tnextPlayer = player;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tMove nextMove = new Move(nextPlayer, false,\n\t\t\t\t\t\t\t\ttempHex.getRow(), tempHex.getColumn());\n\n\t\t\t\t\t\tNode newNode = new Node(currentNode.getPly() + 1,\n\t\t\t\t\t\t\t\tnextMove);\n\t\t\t\t\t\tnewNode.setParent(currentNode);\n\n\t\t\t\t\t\tcurrentNode.children.add(newNode);\n\n\t\t\t\t\t\ttreeQueue.add(newNode);\n\t\t\t\t\t\ttempHex.setValue(EMPTY);\n\t\t\t\t\t}// End of if statement\n\n\t\t\t\t}// End of inner ForLoop\n\t\t\t}// End of outer ForLoop\n\n\t\t\t// currentNode.printChildren();\n\n\t\t}// End of While Loop\n\n\t}", "public static BinaryTree<String> readBinaryTree(Scanner scan){\n\t\t\tif(scan.hasNext()) {\t\t\n\t\t\t\tString data = scan.next();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tInteger.parseInt(data);\n\t\t\t\t\t\t\treturn new BinaryTree<String>(data,null,null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception e){\t\n\t\t\t\t\t\t\tBinaryTree<String> leftTree = readBinaryTree(scan);\n\t\t\t\t\t\t\tBinaryTree<String> rightTree = readBinaryTree(scan);\n\t\t\t\t\t\t\treturn new BinaryTree<String>(data, leftTree,rightTree);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn null;\n\n\t\t}", "public XPathParser(java_cup.runtime.Scanner s) {super(s);}", "private ContentScanner(\n ContentScanner parentLevel\n )\n {\n this.parentLevel = parentLevel;\n this.contents = parentLevel.contents;\n this.objects = ((CompositeObject)parentLevel.getCurrent()).getObjects();\n\n moveStart();\n }", "public void visit(TreeBuilder tree){\n\t\tString line;\n\t\twhile ((line = file.readLine(true)) != null)\n\t {\t\t \n \t\tString[] words = line.split(\" \");\n \t\tfor(String word : words){\n \t\t\tif(!word.equals(\"\")){\n \t\t\t\ttree.insertNode(word);\n \t\t\t}\n \t\t}\n \t}\n\t}", "public ContentScanner(\n Contents contents\n )\n {\n this.parentLevel = null;\n this.objects = this.contents = contents;\n\n moveStart();\n }", "private QuestionNode readHelper(Scanner input) {\r\n String nodeType = input.nextLine();\r\n String data = input.nextLine();\r\n QuestionNode root = new QuestionNode(data);\r\n if (nodeType.equals(\"Q:\")) {\r\n root.left = readHelper(input);\r\n root.right = readHelper(input);\r\n }\r\n return root;\r\n }", "private void ScannerHuffmanCodeCreator(HuffmanNode node, String s, char c) {\n if (s.length() == 1) {\n if (s.charAt(0) == '0') {\n node.left = new HuffmanNode(c);\n } else {\n node.right = new HuffmanNode(c);\n }\n } else {\n if (s.charAt(0) == '0') {\n if (node.left == null && node.right == null) {\n node.left = new HuffmanNode();\n }\n ScannerHuffmanCodeCreator(node.left, s.substring(1), c);\n } else {\n if (node.right == null && node.right == null) {\n node.right = new HuffmanNode();\n }\n ScannerHuffmanCodeCreator(node.right, s.substring(1), c);\n }\n }\n }", "public HuffmanCode(Scanner input) {\n this.front = new HuffmanNode();\n while (input.hasNextLine()) {\n int character = Integer.parseInt(input.nextLine());\n String location = input.nextLine();\n ScannerHuffmanCodeCreator(this.front, location, (char) character);\n }\n }", "public FractalParser(java_cup.runtime.Scanner s) {super(s);}", "protected Scanner getTagScanner() {\n \tif(scanner == null)\n \t scanner = new Scanner();\n \treturn scanner;\n }", "public void visitScanner( DevCat devCat ) {}", "public void create() throws Exception {\n\t\tString[] temp = new String[2];\n\t\tString thisLine;\n\t\tint indexX;\n\t\tint indexY;\n\n\t BufferedReader br = new BufferedReader(new FileReader(\"input.txt\"));\n\n\t if ((thisLine = br.readLine()) != null) {\n\t \tnumOfEmp = Integer.parseInt(thisLine);\n\t \tSystem.out.println(numOfEmp);\n\t }\n\n\t employees = new Node[numOfEmp];\n\n if ((thisLine = br.readLine()) != null) {\n\t \ttargetX = thisLine;\n\t \tSystem.out.println(targetX);\n\t }\n\n if ((thisLine = br.readLine()) != null) {\n\t \ttargetY = thisLine;\n\t \tSystem.out.println(targetY);\n\t }\n\n if ((thisLine = br.readLine()) != null) {\n\t \ttemp = thisLine.split(\" \");\n\t \tSystem.out.println(temp[0] + \" \" + temp[1]);\n\t }\n\n\t employees[0] = new Node(temp[0]);\n\t employees[1] = new Node(temp[1]);\n\t root = employees[0];\n\n\t counter = 1;\n\t employees[0].left = employees[1];\n\t employees[1].parent = employees[0];\n\n while ((thisLine = br.readLine()) != null) {\n temp = thisLine.split(\" \");\n System.out.println(temp[0] + \" \" + temp[1]);\n indexX = findEmp(temp[0]);\n indexY = findEmp(temp[1]);\n\n if (indexX == -1) {\n \tcounter++;\n indexX = counter;\n \temployees[indexX] = new Node(temp[0]);\n }\n if (indexY == -1) {\n \tcounter++;\n \tindexY = counter;\n \temployees[indexY] = new Node(temp[1]);\n }\n\n if (employees[indexX].left == null) {\n\n \temployees[indexX].left = employees[indexY];\n \temployees[indexY].parent = employees[indexX];\n }\n else if (employees[indexX].right == null) {\n\n \temployees[indexX].right = employees[indexY];\n \temployees[indexY].parent = employees[indexX];\n }\n else {\n \tthrow new EmptyStackException();\n }\n\n }\n\n\n \n\t}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public static void main(String[] args) {\n TwoThreeTree tree = new TwoThreeTree();\n Scanner input = new Scanner(System.in);\n int numOfLines = input.nextInt();\n \n for (int i = 0; i < numOfLines + 1; i++) {\n String query = input.nextLine();\n String[] data = query.split(\" \");\n \n if (data[0].equals(\"1\")) {\n tree.insert(data[1], Integer.parseInt(data[2]), tree.root, tree.height);\n }\n else if (data[0].equals(\"2\")) {\n System.out.println(search(data[1], tree.root, tree.height));\n }\n }\n }", "public static void main(String[] args) {\n\n\n\t\tArrayList<Node> N = new ArrayList<Node>();\n\t\t\n\t\t/*\n\t\t * ##### Encoding Model 2 ###### \n\t\t */\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the privilege nodes\n\t\t */\n\t\tfor(int i=1; i<7; i++)\n\t\t{\n\t\t\tN.add(new Node(\"p\"+i, 1));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the exploit nodes\t\t \n\t\t */\n\t\tfor(int i=1; i<8; i++)\n\t\t{\n\t\t\tN.add(new Node(\"e\"+i, 2));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the child nodes\n\t\t */\n\t\tfor(int i=1; i<12; i++)\n\t\t{\n\t\t\tN.add(new Node(\"c\"+i, 0));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Assigning the children and parent(s) for each node according to model 2\n\t\t */\n\t\t\n\t\tArrayList<Node> nil = new ArrayList<Node>();\n\t\t\n\t\tN.get(0).setParents(nil);\n\t\tN.get(0).addChild(N.get(6));\n\t\t\n\t\tN.get(6).addParent(N.get(0));\n\t\tN.get(6).addChild(N.get(1));\n\t\tN.get(6).addChild(N.get(13));\n\t\tN.get(6).addChild(N.get(14));\n\t\t\n\t\tN.get(1).addParent(N.get(6));\n\t\tN.get(1).addChild(N.get(7));\n\t\tN.get(1).addChild(N.get(8));\n\t\t\n\t\tN.get(7).addParent(N.get(1));\n\t\tN.get(7).addChild(N.get(15));\n\t\tN.get(7).addChild(N.get(2));\n\t\t\n\t\tN.get(2).addParent(N.get(7));\n\t\tN.get(2).addChild(N.get(10));\t\t\n\t\t\n\t\tN.get(8).addParent(N.get(1));\n\t\tN.get(8).addChild(N.get(16));\n\t\tN.get(8).addChild(N.get(3));\n\t\t\n\t\tN.get(3).addParent(N.get(8));\n\t\tN.get(3).addChild(N.get(9));\n\t\t\n\t\tN.get(10).addParent(N.get(2));\n\t\tN.get(10).addChild(N.get(5));\n\t\tN.get(10).addChild(N.get(19));\n\t\tN.get(10).addChild(N.get(20));\n\t\t\n\t\tN.get(9).addParent(N.get(3));\n\t\tN.get(9).addChild(N.get(4));\n\t\tN.get(9).addChild(N.get(17));\n\t\tN.get(9).addChild(N.get(18));\n\t\t\n\t\tN.get(4).addParent(N.get(9));\n\t\tN.get(4).addChild(N.get(12));\n\t\t\n\t\tN.get(5).addParent(N.get(10));\n\t\tN.get(5).addChild(N.get(11));\n\t\t\n\t\tN.get(12).addParent(N.get(4));\n\t\tN.get(12).addChild(N.get(22));\n\t\tN.get(12).addChild(N.get(23));\n\t\t\n\t\tN.get(11).addParent(N.get(5));\n\t\tN.get(11).addChild(N.get(21));\n\t\tN.get(11).addChild(N.get(23));\n\t\t\n\t\tN.get(13).addParent(N.get(6));\n\t\tN.get(14).addParent(N.get(6));\n\t\tN.get(15).addParent(N.get(7));\n\t\tN.get(16).addParent(N.get(8));\n\t\tN.get(17).addParent(N.get(9));\n\t\tN.get(18).addParent(N.get(9));\n\t\tN.get(19).addParent(N.get(10));\n\t\tN.get(20).addParent(N.get(10));\n\t\tN.get(21).addParent(N.get(11));\n\t\tN.get(22).addParent(N.get(12));\n\t\tN.get(23).addParent(N.get(11));\n\t\tN.get(23).addParent(N.get(12));\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the C,I,A values for each node\n\t\t */\n\t\t\n\t\tN.get(0).setImpacts(4, 4, 4);\n\t\tN.get(1).setImpacts(1, 2, 3);\n\t\tN.get(2).setImpacts(2, 2, 1);\n\t\tN.get(3).setImpacts(1, 2, 1);\n\t\tN.get(4).setImpacts(1, 1, 1);\n\t\tN.get(5).setImpacts(3, 2, 3);\n\t\tN.get(13).setImpacts(3,3,3);\n\t\tN.get(14).setImpacts(3,3,3);\n\t\tN.get(15).setImpacts(3,3,3);\n\t\tN.get(16).setImpacts(3,3,3);\n\t\tN.get(17).setImpacts(3,3,3);\n\t\tN.get(18).setImpacts(3,3,3);\n\t\tN.get(19).setImpacts(3,3,3);\n\t\tN.get(20).setImpacts(3,3,3);\n\t\tN.get(21).setImpacts(3,3,3);\n\t\tN.get(22).setImpacts(3,3,3);\n\t\tN.get(23).setImpacts(2,2,1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * This block helps see the setup of the whole tree. \n\t\t * Comment out if not required to see the parent children relationship of each node.\n\t\t */\n\t\t\n\t\tfor(int i=0; i<24; i++)\n\t\t{\n\t\t\tSystem.out.println(\"\\n\\n\" + N.get(i).getName() + \" < C=\" + N.get(i).getImpactC() + \", I=\" + N.get(i).getImpactI() + \", A=\" + N.get(i).getImpactA() + \" >\" );\n\t\t\tSystem.out.println(\"Parents: \");\n\t\t\tfor(int j=0; j<N.get(i).getParents().size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getParents().get(j).getName() + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nChildren: \");\n\t\t\tfor(int k=0; k<N.get(i).getChildren().size(); k++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getChildren().get(k).getName() + \" \");\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Calling the method which will perform the C,I,A impact analysis \n\t\t */\n\t\t\n\t\t//Node n = new Node(); //Commented out as extended Main to Node and declared impactAnalysis() as static \n\t\t\n\t\tImpactAnalyzer ia = new ImpactAnalyzer();\n\t\tia.analyze(2, 2, 1, N);\n\t\t\n\t\t\n\t\t\n\t}", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}", "public void buildTree() throws RuntimeException, DivideByZero {\r\n // define local variable to count number of times an operator \r\n // is pushed into it's associated stack. This will be use to \r\n // count register values\r\n int i = 0;\r\n\r\n // split postfix expression enterend into the textbox into tokens using \r\n // StringTokenizer. Delimeters are used so that different inputs \r\n // can be parsed without spaces being necessary \r\n StringTokenizer token = new StringTokenizer(inputExpression, \" */+-\", true);\r\n\r\n // while loop to build tree out of the postfix expression\r\n while (token.hasMoreTokens()) {\r\n // get the next token in series\r\n String nextItem = token.nextToken();\r\n\r\n // use selection statements to determine if the next token\r\n // in the String is an operand, operator, or unknown\r\n if (nextItem.matches(\"[0-9]+\")) {\r\n // push operand to associated stack\r\n operandStk.push(nextItem);\r\n \r\n // push operand to AssemblyCode class\r\n assemblyCode.pushStack(nextItem);\r\n\r\n } else if (nextItem.equals(\"*\") || nextItem.equals(\"/\")\r\n || nextItem.equals(\"+\") || nextItem.equals(\"-\")) {\r\n // push current operator to operators stack\r\n operatorStk.push(nextItem);\r\n // call the getNodes() method to perform operation\r\n getNodes(i);\r\n // count each time an operator is pushed so registers can be counted\r\n i++;\r\n } else if (!nextItem.equals(\" \")){ \r\n // set class variable to equal invalid character\r\n invalidToken = nextItem; \r\n // throw exception if illegal operator or operand is parsed\r\n throw new RuntimeException();\r\n }\r\n } // end while loop\r\n }", "protected TreeIterator(Tree<T> tree) {\n\t\t\tsuper();\n\t\t\tthis.tree = tree;\n\t\t\tcursor = null;\n\t\t}", "public void read(Scanner input) {\r\n finalRoot = readInternal(input);\r\n }", "public HIRTree(){\r\n\t\t\r\n\t}", "public REparser (String input) throws IOException {\n fileIn = new FileReader(input);\n cout.printf(\"%nEchoing File: %s%n\", input);\n echoFile();\n fileIn = new FileReader(input);\n pbIn = new PushbackReader(fileIn);\n temp = new FileReader(input);\n currentLine = new BufferedReader(temp);\n curr_line = \"\";\n curr_line = currentLine.readLine();\n AbstractNode root;\n while(curr_line != null) {\n getToken();\n root = parse_re(0);\n printTree(root);\n curr_line = currentLine.readLine();\n }\n }", "public static void main(String[] args) throws Exception\n\t{\n\t\tSystem.out.println(\"Enter the numbers you want to add to Splay Tree. Press any alphabet once you are done inputting the numbers. The tree will be print in PreOrderTraversal after every insert\");\n\n\t\tScanner input = new Scanner(System.in);\n\t\tSplayTreeMain sTree=null;\n\t\twhile(input.hasNextInt())\n\t\t{\n\t\t\tif(sTree == null)\n\t\t\t{\n\t\t\t\tsTree = new SplayTreeMain();\n\t\t\t}\n\t\t\tsTree.add(input.nextInt());\n\t\t\tSystem.out.println(sTree);\n\t\t}\n\n\t\tSystem.out.println(\"Please enter the menu options listed i.e numbers 1 for add, 2 for remove, 3 for find, 4 for leafcount, 5 for leafSum, 6 for preOrderTraversal, 7 for exit\");\n\t\tString skipString = input.next();\n\t\twhile(input.hasNextInt())\n\t\t{\n\t\t\tint menuOption = input.nextInt();\n\n\t\t\tif(menuOption== 1)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the add operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.add(a);\n\t\t\t\tSystem.out.println(\"Tree after the add operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 2)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number you want to be removed\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the remove operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.remove(a);\n\t\t\t\tSystem.out.println(\"Tree after the remove operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 3)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number you want to be checked for its existence\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the find operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.find(a);\n\t\t\t\tSystem.out.println(\"Tree after the find operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 4)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Leaf count of the tree is \"+sTree.leafCount());\n\t\t\t}\n\t\t\telse if(menuOption == 5)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Leaf sum of the tree is \"+sTree.leafSum());\n\t\t\t}\n\t\t\telse if(menuOption == 6)\n\t\t\t{\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption == 7)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Thank You, Have a great day!!\");\n\t\t\t\tinput.close();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println(\"Please enter the menu options listed i.e numbers 1 for add, 2 for remove, 3 for find, 4 for leafcount, 5 for leafSum, 6 for preOrderTraversal, 7 for exit\");\n\n\t\t}\n\n\t}", "@Test\n public void testAllConstructions() throws IOException, LexerException, ParseException {\n TreeNode<ASTNode> tree = getTree(\"all.txt\");\n System.out.println(tree);\n }", "void buildTree(){\n while(second.hasNext()){\n String s = second.next();\n String[] arr = s.split(SPLIT);\n //descending sort according to num\n Arrays.sort(arr, (String s1, String s2)->{\n int a = this.keyToNum.getOrDefault(s1, 0);\n int b = this.keyToNum.getOrDefault(s2, 0);\n if (a <= b)\n return 1;\n else\n return -1;\n });\n\n //current node\n TreeNode curr = root;\n for (String item: arr){\n if (!keyToNum.containsKey(item))\n continue;\n if(!curr.containChild(item)){\n TreeNode node = curr.addChild(item);\n //change the current node\n curr = node;\n //add new node in table\n TableEntry e = table.get(keyToIdx.get(item));\n e.addNode(node);\n }else{\n curr = curr.getChild(item);\n curr.setNum(curr.getNum()+1);\n }\n }\n }\n /*\n this.root.print();\n for(TableEntry e: table){\n Iterator<TreeNode> it = e.getIterator();\n while(it.hasNext()){\n System.out.print(it.next().getItem()+\" \");\n }\n System.out.println();\n }\n */\n }", "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;\r\n\t}", "private Tree<Token> tree(String description) {\n Tree<String> treeOfStrings = Tree.parse(description);\n return convertToTreeOfTokens(treeOfStrings);\n }", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n Map<Integer, Set<Integer>> map = new HashMap<Integer,Set<Integer>>();\n int[] valArr = new int[n];\n int[] colArr = new int[n];\n for(int i =0;i<n;i++){\n valArr[i] = scan.nextInt();\n }\n for(int i =0;i<n;i++){\n colArr[i] = scan.nextInt();\n }\n for(int i=0;i<n-1;i++){\n //10^10 / 1024/ 1024/1024, 10GB\n int a = scan.nextInt()-1;\n int b = scan.nextInt()-1;\n \n //Tree[] treeArr = new Tree[n];\n if(map.containsKey(a)){\n map.get(a).add(b);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(b);\n map.put(a,set);\n }\n //case 1-2, 2-1\n if(map.containsKey(b)){\n map.get(b).add(a);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(a);\n map.put(b,set);\n } \n }\n Set<Integer> visited = new HashSet<Integer>();\n Tree root =buildTree(map,0,0,valArr,colArr);\n return root;\n }", "public static void main(String args[])\n {\n boolean debug = false; \n\n Scanner sc = new Scanner(System.in); \n ArrayList<Integer> arraylist = new ArrayList<Integer>();\n while (sc.hasNextInt()) \n {\n arraylist.add(sc.nextInt());\n }\n\n Tree<Integer> tree = new Tree<>(arraylist, debug);\n List<Integer> it = tree.sort(); \n \n for (int i = 0; i < it.size(); i++)\n {\n System.out.println(it.get(i));\n }\n }", "public CoolParser(java_cup.runtime.Scanner s) {super(s);}", "private void buildNewTree(PlanNode plan) {\n ILogicalOperator leftInput = plan.getLeafInput();\n skipAllIndexes(plan, leftInput);\n ILogicalOperator selOp = findSelectOrDataScan(leftInput);\n if (selOp != null) {\n addCardCostAnnotations(selOp, plan);\n }\n addCardCostAnnotations(findDataSourceScanOperator(leftInput), plan);\n }", "private void setup(){\n buildTree(2);\n }", "private static void input(String[] args) {\n try (BufferedReader scanner = new BufferedReader(\n new InputStreamReader(args.length > 0 ? new FileInputStream(args[0]) : System.in))) {\n\n String linija;\n\n // regularne definicije\n while ((linija = scanner.readLine()) != null && linija.startsWith(\"{\")) {\n String tmp[] = linija.split(\" \");\n\n tmp[0] = tmp[0].substring(1, tmp[0].length() - 1);\n String naziv = tmp[0];\n String izraz = expandRegularDefinition(tmp[1]);\n\n regularneDefinicije.put(naziv, izraz);\n\n // System.out.println(naziv + \", \" + izraz);\n }\n\n // stanja\n while (!linija.startsWith(\"%X\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, stanjaLA);\n\n // leksicke jedinke\n while (!linija.startsWith(\"%L\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, leksickeJedinke);\n\n // pravila leksickog analizatora\n\n while ((linija = scanner.readLine()) != null) {\n while (!linija.startsWith(\"<\")) {\n linija = scanner.readLine();\n }\n\n String tmp[] = linija.split(\">\", 2);\n\n String stateName = tmp[0].substring(1, tmp[0].length());\n String regDef = tmp[1];\n\n regDef = expandRegularDefinition(regDef);\n\n // System.out.println(stateName + \"<> \" + regDef);\n LexerRule lexerRule = new LexerRule(regDef, stateName, 1, \"<\" + stateName + \">\" + regDef);\n lexerRules.add(lexerRule);\n\n scanner.readLine(); // preskoci {\n\n linija = scanner.readLine().trim();\n while (linija != null && scanner.ready() && !linija.equals(\"}\")) {\n // radi nesto s naredbom\n lexerRule.addAction(linija);\n linija = scanner.readLine().trim();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "private void LL1Parser() throws IOException {\n\n LA.ReadLine(0);\n ParsStack.push(\"$\");\n ParsStack.push(\"P\");\n int prod;\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"in ll1 parser\");\n// System.out.println(token.getValue() + \" \" + token.getType());\n while (true)\n {\n// System.out.println(ParsStack.peek());\n if (!CheckTerminal(ParsStack.peek()) && (!ParsStack.peek().equals(\"$\")) && (ParsStack.peek().charAt(0) != '@'))\n {\n /**inja be nazarm bayad BUparser run she agar BE bashe sare parse stack**/\n if (ParsStack.peek().equals(\"BE\"))\n {\n// System.out.println(\"go to SLR parser\");\n SLRParser();\n// System.out.println(\"Come back from SLR parser\");\n// System.out.println(ParsStack.peek());\n ParsStack.pop();\n token = LA.Scanner();\n// System.out.println(token.getValue());\n }\n else\n {\n prod = getProduction(ParsStack.peek(), token);\n// System.out.println(ParsStack.peek() + \" \" + token.getValue() + \" \" + prod);\n if (prod == 0) {\n error(4);\n break;\n } else {\n ParsStack.pop();\n for (int i = TempGrammer.get(prod - 1).getRight().length - 2 ; i > 0 ; i--) {\n if (TempGrammer.get(prod - 1).getRight()[i].equals(\"!\"))\n break;\n ParsStack.push(TempGrammer.get(prod - 1).getRight()[i]);\n// System.out.println(\"fill stack \" + ParsStack.peek());\n }\n }\n }\n }\n else if (CheckTerminal(ParsStack.peek()))\n {\n if (!CheckTerminal(token.getValue()))\n {\n if (ParsStack.peek().equals(\"id\"))\n {\n// System.out.println(token.getValue() + \" pop\");\n ParsStack.pop();\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"new token is \" + token.getValue());\n }\n else\n {\n if (token.getValue().equals(\"$\"))\n {\n error(1);\n break;\n }\n }\n }\n else if (ParsStack.peek().equals(token.getValue()))\n {\n// System.out.println(token.getValue() + \" pop\");\n ParsStack.pop();\n token = LA.Scanner();\n while (token.getValue() == null)\n {\n token = LA.Scanner();\n }\n// System.out.println(\"new token is \" + token.getValue());\n\n }\n else\n {\n error(1);\n break;\n }\n }\n /**inja ham ye else if dige bashe baraye @semanticrule ha ke codeGenerator seda zade beshe**/\n /** nazar man ro injast **/\n else if (ParsStack.peek().charAt(0) == '@')\n {\n// System.out.println(\"see semantic role\");\n if (ParsStack.peek().equals(\"@push\"))\n terminat = CodeGen.run( ParsStack.pop() , token.getValue() , LA.Line - 1);\n else\n terminat = CodeGen.run( ParsStack.pop() , ParsStack.peek() , LA.Line - 1);\n\n\n if(terminat)\n Terminate();\n /** code generation inja seda mishe **/\n }\n else if (ParsStack.peek().equals(\"$\"))\n {\n if (token.getValue().equals(\"$\"))\n {\n Accept();\n break;\n }\n else {\n error(2);\n break;\n }\n }\n else {\n error(3);\n break;\n }\n }\n\n }", "@Override\n public TreeNode make(Parser parser) {\n Token token = parser.peek();\n if(token.getTokenID() == Token.TIDEN){\n return nAlistNode.make(parser); //alist trans (dont consume token alist will need it)\n }\n return null; //eps trans\n }", "public static void main(String[] args){\n\n// BinaryTree binaryTree = new BinaryTree(1);\n// binaryTree.insert(\"L\", 2);\n// binaryTree.insert(\"LL\", 4);\n// binaryTree.insert(\"LR\", 5);\n// binaryTree.insert(\"R\", 3);\n// binaryTree.getHeight(binaryTree.root);\n// System.out.println(binaryTree.maxDiameter);\n\n Scanner in = new Scanner(System.in);\n int T = in.nextInt();\n int X = in.nextInt();\n BinaryTree binaryTree = new BinaryTree(X);\n for(int j=0;j<T-1;j++){\n String where = in.next();\n int k = in.nextInt();\n binaryTree.insert(where, k);\n }\n binaryTree.getHeight(binaryTree.root);\n// binaryTree.traverse(binaryTree.root);\n System.out.println(binaryTree.maxDiameter);\n }", "public Scanner createScanner(File file) {\n Scanner scanner;\n try {\n scanner = new Scanner(file);\n\n } catch (FileNotFoundException e) {\n scanner = null;\n }\n return scanner;\n }", "public static void buildStage2 ()\r\n {\r\n \r\n lgt.findParent(); //4\r\n lgt.findChild(0); //6\r\n lgt.insert(12);\r\n lgt.findParent();\r\n lgt.insert(13);\r\n lgt.findParent();\r\n lgt.insert(14);\r\n \r\n lgt.findRoot();\r\n lgt.findChild(0);//2\r\n lgt.findChild(0);//5\r\n lgt.insert(8);\r\n lgt.findParent();\r\n lgt.insert(9);\r\n lgt.findParent();\r\n lgt.insert(10);\r\n lgt.findParent();\r\n lgt.insert(11);\r\n \r\n }", "public TreeEvaluator(Information info) /*throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException*/{\n\t\tthis.coms = info.cls;\n\t}", "public static void make( Scanner sc ) {\n // First worry about the gate name\n final String name\n = ScanSupport.scanName( sc, () -> \"Gate has missing name\" );\n if (name == null) {\n ScanSupport.finishLine(\n sc, () -> \"Gate: followed by\"\n );\n return;\n }\n if (findGate( name ) != null) {\n Errors.warn( \"Gate \" + name + \": name reused\" );\n ScanSupport.finishLine(\n sc, () -> \"Gate \" + name + \": followed by\"\n );\n return;\n }\n\n // Second get the gate kind\n final String kind = ScanSupport.scanName(\n sc, () -> \"Gate \" + name + \": kind missing\"\n );\n if (kind == null) {\n ScanSupport.finishLine(\n sc, () -> \"Gate \" + name + \": followed by\"\n );\n return;\n }\n\n // Finally construct the right kind of gate\n if (\"xor\".equals( kind )) {\n allGates.add( new XorGate( sc, name ) );\n } else if (\"threshold\".equals( kind )) {\n allGates.add( new ThresholdGate( sc, name ) );\n } else if (\"input\".equals( kind )) {\n allGates.add( new InputGate( sc, name ) );\n } else if (\"output\".equals( kind )) {\n allGates.add( new OutputGate( sc, name ) );\n } else {\n Errors.warn( \"Gate \" + name + \" \" + kind + \": kind unknown\" );\n ScanSupport.finishLine(\n sc, () -> \"Gate \" + name + \" \" + kind + \": followed by\"\n );\n }\n }", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\ttry {\r\n\t\tString inputfile = args[0]+\".txt\";\r\n\t\tString outputfile = args[1]+\".txt\";\r\n\t\tString outputfile2 = args[2]+\".txt\";\r\n\r\n\r\n\r\n\t\tFileInputStream textFile1 = new FileInputStream(inputfile);\r\n\t\tScanner scan = new Scanner(textFile1);\r\n\t\tBinaryTree bst = new BinaryTree();\r\n\t\t\r\n\t\t//reading input files and storing\r\n\t\twhile(scan.hasNextLine()){\r\n\t\t\t\r\n\t\tString s = scan.nextLine();\r\n\t\tchar code=s.charAt(0);\r\n\t\tint id = Integer.parseInt(s.substring(1, 8));\r\n\t\t\tString nah=s.substring(8,8+25);\r\n\t\t\tString name= nah.trim();\r\n\t\t\tString department=s.substring(33,37);\r\n\t\t\tString program=s.substring(37,40);\r\n\t\t\tchar year=s.charAt(41);\r\n\t\t\tNode n= new Node();\r\n\t\t\tStudent stu = new Student();\r\n\t\t\tn.code=code;\r\n\t\t\tstu.id=id;\r\n\t\t\tstu.name=name;\r\n\t\t\tstu.department=department;\r\n\t\t\tstu.program=program;\r\n\t\t\tstu.year=year;\r\n\t\t\tif(code=='I')\r\n\t\t\t\tbst.insert(stu);\r\n\t\t\telse if(code=='D')\r\n\t\t\t\tbst.deleteKey(stu);\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Wrong code detected in input file. Should be I or D\");\r\n\t\t\t//System.out.println(\"Code: \" + code + \" ID: \" + stu.id + \" Name: \" + stu.name+ \" Dep: \" + stu.department + \" Program: \" + stu.program + \" Year: \"+ stu.year);\r\n\t\t}\r\n\t\t //Just changing the Stream so it will print to a file instead of console.\r\n\t\t PrintStream printStream = new PrintStream(new FileOutputStream(outputfile));\r\n\t\t System.setOut(printStream);\r\n\t\t System.out.println(\"\\nInorder traversal of binary tree is \");\r\n\t\t System.out.println(String.format(\"%-10s %-7s %-4s %-4s %-4s \",\"Name\",\" ID\",\"Department\",\"Program\",\"Year\"));\r\n\t\t bst.printInorder(outputfile);\r\n\t\t PrintStream printStream2 = new PrintStream(new FileOutputStream(outputfile2));\r\n\t\t System.setOut(printStream2);\r\n\t\t System.out.println(\"\\nBreadthFirst traversal of binary tree is \");\r\n\t\t System.out.println(String.format(\"%-10s %-7s %-4s %-4s %-4s \",\"Name\",\" ID\",\"Department\",\"Program\",\"Year\"));\r\n\t\t bst.printLevelOrder(outputfile2);\r\n\t\t \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"usage\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\r\n\t}", "private QuestionNode readInternal(Scanner input) {\r\n String type = input.nextLine();\r\n String data = input.nextLine();\r\n if(type.equals(\"Q:\")) { //question node\r\n QuestionNode left = readInternal(input);\r\n QuestionNode right = readInternal(input);\r\n return new QuestionNode(data, left, right);\r\n } else if(type.equals(\"A:\")) { // answer node\r\n QuestionNode root = new QuestionNode(data);\r\n return root;\r\n } else {\r\n throw new IllegalArgumentException\r\n (\"Not a question or an answer!\");\r\n }\r\n }", "private SpTreeMan() {\n }", "public CompParser(java_cup.runtime.Scanner s) {super(s);}", "public static void main(String[] args) {\n Scanner scan = null;\n try {\n scan = new Scanner(new File(\"src/input.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found.\");\n }\n\n /** Read the minimum degree of B+Tree first */\n\n int degree = scan.nextInt();\n\n BTree bTree = new BTree(degree);\n\n /** Reading the database student.csv into B+Tree Node*/\n List<Student> studentsDB = getStudents();\n\n for (Student s : studentsDB) {\n bTree.insert(s);\n }\n \n long size = (long) studentsDB.size();\n /** Start reading the operations now from input file*/\n try {\n while (scan.hasNextLine()) {\n Scanner s2 = new Scanner(scan.nextLine());\n\n while (s2.hasNext()) {\n\n String operation = s2.next();\n //System.out.println(operation);\n switch (operation) {\n case \"insert\": {\n\n long studentId = Long.parseLong(s2.next());\n String studentName = s2.next() + \" \" + s2.next();\n String major = s2.next();\n String level = s2.next();\n int age = Integer.parseInt(s2.next());\n /** TODO: Write a logic to generate recordID*/\n\n long recordID = ++size;\n\n Student s = new Student(studentId, age, studentName, major, level, recordID);\n bTree.insert(s);\n\n break;\n }\n case \"delete\": {\n long studentId = Long.parseLong(s2.next());\n boolean result = bTree.delete(studentId);\n if (result)\n System.out.println(\"Student deleted successfully.\");\n else\n System.out.println(\"Student deletion failed.\");\n\n break;\n }\n case \"search\": {\n long studentId = Long.parseLong(s2.next());\n long recordID = bTree.search(studentId);\n if (recordID != -1)\n System.out.println(\"Student exists in the database at \" + recordID);\n else\n System.out.println(\"Student does not exist.\");\n break;\n }\n case \"print\": {\n List<Long> listOfRecordID = new ArrayList<>();\n listOfRecordID = bTree.print();\n System.out.println(\"List of recordIDs in B+Tree \" + listOfRecordID.toString());\n break;\n }\n default:\n System.out.println(\"Wrong Operation\");\n break;\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String args[]) throws IOException\r\n {\r\n // Input the number of test cases you want to run\r\n //Scanner sc = new Scanner(System.in);\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n //int t = sc.nextInt();\r\n int t= Integer.parseInt(br.readLine());\r\n while (t > 0)\r\n {\r\n HashMap<Integer, Node> m = new HashMap<Integer, Node> ();\r\n //int n = sc.nextInt();\r\n int n = Integer.parseInt(br.readLine());\r\n //System.out.println(n);\r\n Node root = null;\r\n String nums[] = br.readLine().split(\" \");\r\n //System.out.print(nums.length/3);\r\n int mm = n;\r\n for( int idx = 0; idx < mm; idx++)\r\n {\r\n //int n1 = sc.nextInt();\r\n //int n2 = sc.nextInt();\r\n //char lr = sc.next().charAt(0);\r\n int n1 = Integer.parseInt(nums[idx*3]);\r\n int n2 = Integer.parseInt(nums[idx*3+1]);\r\n //char lr = (char)nums[idx*3+2];\r\n String lr = nums[idx*3+2];\r\n //System.out.print(n1+\" \"+n2+\" \"+lr+ \" \");\r\n \r\n \r\n // cout << n1 << \" \" << n2 << \" \" << (char)lr << endl;\r\n Node parent = m.get(n1);\r\n if (parent == null)\r\n {\r\n parent = new Node(n1);\r\n m.put(n1, parent);\r\n if (root == null)\r\n root = parent;\r\n }\r\n Node child = new Node(n2);\r\n if (lr.equals(\"L\"))\r\n parent.left = child;\r\n else\r\n parent.right = child;\r\n m.put(n2, child);\r\n }\r\n //System.out.println();\r\n PostOrder g = new PostOrder();\r\n g.postOrder(root);\r\n System.out.print(\"\");\r\n t--;\r\n }\r\n \r\n br.close();\r\n \r\n }", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tString inputPath = args[0];\n\t\tinitialize(inputPath);\n\t\tSystem.out.println(\"Finished Initialization\");\n\t\t\n\t\t//following is input from CMD, so using scanner\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile(sc.hasNextLine()){\n\t\t\tString tmpString = sc.nextLine();\n\t\t\tString[] operation = new String[3];\n\t\t\toperation = tmpString.split(\" \");\n\t\t\t//System.out.println(operation.length);\n\t\t\tint arg0 = 0;\n\t\t\tint arg1 = 0;\n\t\t\tif(operation.length == 1) return;\n\t\t\tif(operation.length == 2)\n\t\t\t\targ0 = Integer.parseInt(operation[1]);\n\t\t\telse{\n\t\t\t\targ0 = Integer.parseInt(operation[1]);\n\t\t\t\targ1 = Integer.parseInt(operation[2]);\n\t\t\t}\n\t\t\tswitch(operation[0]){\n\t\t\t\tcase \"increase\":\n\t\t\t\t\tEventTree.increase(arg0, arg1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reduce\":\n\t\t\t\t\tEventTree.reduce(arg0, arg1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"count\":\n\t\t\t\t\tEventTree.count(arg0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"inrange\":\n\t\t\t\t\tEventTree.inrange(arg0, arg1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"next\":\n\t\t\t\t\tEventTree.next(arg0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"previous\":\n\t\t\t\t\tEventTree.previous(arg0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"getParent\":\n\t\t\t\t\tTreeNode start = null;\n\t\t\t\t\tTreeNode end = null;\n\t\t\t\t\tif(RBTree.search(arg0) == null) {\n\t\t\t\t\t\tstart = RBTree.getSuccessorById(RBTree.getRoot(),arg0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tstart = RBTree.search(arg0);\n\t\t\t\t\t}\n\t\t\t\t\tif(RBTree.search(arg1) == null){\n\t\t\t\t\t\tend = RBTree.getPrecursorById(RBTree.getRoot(),arg1);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tend = RBTree.search(arg1);\n\t\t\t\t\t}\n\t\t\t\t\tif(start == null || end == null) break;\n\t\t\t\t\tSystem.out.println(RBTree.getCommonParent(start, end).ID);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: \n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//AutoTester.treetc_01(); //insert & delete\n\t\t//AutoTester.treetc_02(); //successor & precursor\n\t\t//AutoTester.eventtc_01(); //increase & reduce\n\t\t//AutoTester.eventtc_02(); //common parent & inrange\n\t\t//AutoTester.eventtc_03(); //next & previous\n\t}", "public static void process(BinarySearchTree tree)\n {\n Scanner keyboard = new Scanner(System.in);\n\n boolean end = false;\n int currentValue = 0;\n int index = 0;\n\n while(end == false)\n {\n try\n {\n System.out.print(\"Enter #\" + ++index + \": \");\n\n currentValue = keyboard.nextInt();\n\n tree.add(currentValue);\n }\n catch(InputMismatchException e)\n {\n end = true;\n System.out.println(\"Ending input\");\n }\n }\n\n System.out.println(\"DATA POST POPULATION: \\n\" + tree.breadthFirstTraversal());\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n // int m = sc.nextInt();\n int n = sc.nextInt();\n Tree[] tree = new Tree[n];\n for (int i = 0; i < n; i++) {\n tree[i] = new Tree(i + 1, sc.nextInt());\n }\n // System.out.println(Arrays.toString(tree));\n\n // Arrays.sort(tree,(a,b)->b.num-a.num);\n StringBuilder sb = new StringBuilder();\n int first = 0;\n\n boolean shibai = false;\n\n while (first < n) {\n while (first < n && tree[first].num == 0) {\n first++;\n }\n int idx = first + 1;\n out:\n while (idx < n) {\n while (idx < n && tree[idx].num == 0) {\n idx++;\n\n }\n while (idx < n && first < n && tree[idx].num > 0 && tree[first].num > 0) {\n\n sb.append(tree[first].type)\n .append(\" \")\n .append(tree[idx].type)\n .append(\" \");\n tree[idx].num--;\n tree[first].num--;\n if (tree[first].num == 0) {\n first++;\n break out;\n }\n }\n }\n// System.out.println(Arrays.toString(tree));\n// System.out.println(idx);\n if (idx > n - 1) {\n if (tree[first].num == 0) break;\n if (tree[first].num == 1) {\n sb.append(tree[first].type);\n break;\n } else {\n System.out.println(\"-\");\n shibai = true;\n break;\n }\n }\n }\n\n// while (true){\n// if(tree[0].num==1){\n// sb.append(tree[0].type);\n// break;\n// }\n// if(tree[1].num==0){\n// System.out.println(\"-\");\n// shibai=true;\n// break;\n// }\n// while (tree[1].num>0){\n// sb.append(tree[0].type).append(\" \").append(tree[1].type).append(\" \");\n// tree[0].num--;\n// tree[1].num--;\n// }\n// //System.out.println(sb.toString());\n// // System.out.println(Arrays.toString(tree));\n// // Arrays.sort(tree,(a,b)->b.num-a.num);\n//\n// }\n if (!shibai) {\n System.out.println(sb.toString());\n }\n\n\n }", "private ConsoleScanner() {}", "public interface ITreeMaker {\n /**\n * Return the Huffman/coding tree.\n * @return the Huffman tree\n */\n public HuffTree makeHuffTree(InputStream stream) throws IOException;\n}", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n int[] arrayNode = new int[n + 1];\n for (int i = 1; i <= n; i++) {\n arrayNode[i] = scan.nextInt();\n }\n\n Color[] arrayColor = new Color[n + 1];\n for (int i = 1; i <= n; i++) {\n if (scan.nextInt() == 0) {\n arrayColor[i] = Color.RED;\n } else {\n arrayColor[i] = Color.GREEN;\n }\n }\n\n List<Integer>[] adjacentsList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n adjacentsList[i] = new ArrayList<Integer>();\n }\n\n for (int i = 0; i < n - 1; i++) {\n int x = scan.nextInt();\n int y = scan.nextInt();\n\n adjacentsList[x].add(y);\n adjacentsList[y].add(x);\n }\n\n scan.close();\n\n List<Integer>[] childrenList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n childrenList[i] = new ArrayList<Integer>();\n }\n\n int[] depths = new int[n + 1];\n boolean[] visited = new boolean[n + 1];\n\n Queue<Integer> queue = new LinkedList<Integer>();\n depths[1] = 0;\n queue.offer(1);\n while (!queue.isEmpty()) {\n int head = queue.poll();\n\n if (visited[head]) {\n continue;\n }\n visited[head] = true;\n\n for (int adjacent : adjacentsList[head]) {\n if (!visited[adjacent]) {\n childrenList[head].add(adjacent);\n depths[adjacent] = depths[head] + 1;\n queue.offer(adjacent);\n }\n }\n }\n\n Tree[] nodes = new Tree[n + 1];\n for (int i = 1; i <= n; i++) {\n if (childrenList[i].isEmpty()) {\n nodes[i] = new TreeLeaf(arrayNode[i], arrayColor[i], depths[i]);\n } else {\n nodes[i] = new TreeNode(arrayNode[i], arrayColor[i], depths[i]);\n }\n }\n for (int i = 1; i <= n; i++) {\n for (int child : childrenList[i]) {\n ((TreeNode) nodes[i]).addChild(nodes[child]);\n }\n }\n return nodes[1];\n }", "private static void scan() {\n\t\tt = la;\n\t\tla = Scanner.next();\n\t\tla.toString();\n\t\tsym = la.kind;\n\t}", "public void doMenu(){\n Scanner readinput = new Scanner(System.in); // needed to read the user's input\r\n System.out.println(\"Using Red Black Tree. 9 for list of commands\");\r\n while (this.userinput != -1) {\r\n \r\n this.update(); // every loop, print diagram of the tree\r\n \r\n System.out.print(\"Option: \");\r\n this.userinput = readinput.nextInt(); // input. Await user.\r\n \r\n switch(this.userinput){ // checks and matches the input to available functions\r\n \r\n case 9:\r\n System.out.println(\"\\nAvailable commands:\"\r\n + \"\\n'0': create a new empty root\"\r\n + \"\\n'-1': quits the program\"\r\n + \"\\n'1': recursively inserts new node with value\"\r\n + \"\\n'2': remove a node\"\r\n + \"\\n'3': print information about the tree\"\r\n + \"\\n'4': print information about a node\"\r\n + \"\\n'9': print this help section\"\r\n );\r\n break;\r\n \r\n case -1: // quit.\r\n System.out.println(\"Stopping.\");\r\n break;\r\n \r\n case 0: // Empty all\r\n System.out.print(\"Removing all.\");\r\n this.root = null;\r\n break;\r\n \r\n case 1: // insere objeto no conteúdo do nó.\r\n System.out.print(\">>> New Value: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.insertElement(this.root, userinput2);\r\n break;\r\n \r\n case 2: //remover certo valor\r\n System.out.print(\">>> Value to be removed: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.remove(root, userinput2);\r\n break;\r\n \r\n case 3: // imprimir informações da árvore\r\n\r\n //this.calculateNodes(root);\r\n System.out.println(\"Pre Order NLR:\");\r\n this.traversePreOrder(root);\r\n System.out.println(\"\\nPost Order LRN:\");\r\n this.traversePostOrder(root);\r\n System.out.println(\"\\nIn Order LNR:\");\r\n this.traverseInOrder(root);\r\n System.out.println(\"\\n[!] Finished printing tree information\\n\");\r\n break;\r\n \r\n case 4: \r\n System.out.print(\">>> Value of node to be fetched: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.info(this.fetch(root, userinput2));\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n }", "public static void createTree(SuccessorGenerator generator, GameState initialState)\n {\n LinkedList<GameState> currentLevel = new LinkedList<GameState>();\n currentLevel.add(initialState);\n Player currentPlayer = Player.PLAYER_MAX;\n \n int level = 0;\n while(true)\n {\n LinkedList<GameState> nextLevel = new LinkedList<GameState>();\n \n /*Gerando todas as ações possíveis para o nível atual.*/\n for(GameState state : currentLevel)\n {\n generator.generateSuccessors(state, currentPlayer);\n \n for(int i = 0; i < state.getChildren().size(); i++)\n {\n GameState successorState = state.getChildren().get(i);\n nextLevel.add(successorState);\n }\n }\n System.out.println(\"Expandindo nível \"+(level++)+\" com \"+nextLevel.size()+\" estados.\");\n \n /*Alternando jogadores*/\n currentPlayer = (currentPlayer == Player.PLAYER_MAX)?\n Player.PLAYER_MIN:\n Player.PLAYER_MAX; \n \n /*Busca termina quando todos os estados foram explorados*/\n if(nextLevel.isEmpty()) break;\n \n currentLevel.clear();\n currentLevel.addAll(nextLevel);\n }\n \n }", "public Node program() {\r\n\r\n this.CheckError(\"PROGRAM\");\r\n\r\n\r\n Node n_program = new Node(\"program\");\r\n n_program.setParent(null);\r\n System.out.println(\"read node from app: \"+n_program.getData());\r\n System.out.println(\" :parent: \"+n_program.getParent());\r\n\r\n Node n_declarations = n_program.setChildren(\"decl list\");\r\n System.out.println(\"read node from app :data: \"+n_declarations.getData());\r\n System.out.println(\" :parent: \"+n_declarations.getParent().getData());\r\n\r\n this.declaration(n_declarations);\r\n\r\n this.CheckError(\"BEGIN\");\r\n\r\n Node n_statementSequence = n_program.setChildren(\"stmt list\");\r\n this.statementSequence(n_statementSequence);\r\n\r\n this.CheckError(\"END\");\r\n\r\n System.out.println(\":::: Parsing Successful Hamid ::::\");\r\n\r\n return n_program;\r\n //////////////////////////////////////////// writeout PROGRAM treee -----------------\r\n //////////////////////////////////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////////////////////////////\r\n ///////////output test generator\r\n /////////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n /*Node iteration = n_program;\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\"|\");\r\n System.out.print(\" \");\r\n }\r\n System.out.println();\r\n iteration = n_program.getChildren(0);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\" \");\r\n iteration = n_program.getChildren(1);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println(\"\");\r\n System.out.print(\" \");\r\n Node iteration0= iteration.getChildren(0);\r\n for (int i=0; i<iteration0.childrenSize();i++){\r\n System.out.print(\"| \"+iteration0.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration1= iteration.getChildren(1);\r\n for (int i=0; i<iteration1.childrenSize();i++){\r\n System.out.print(\"| \"+iteration1.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration2= iteration.getChildren(2);\r\n for (int i=0; i<iteration2.childrenSize();i++){\r\n System.out.print(\"| \"+iteration2.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration3= iteration.getChildren(3);\r\n for (int i=0; i<iteration3.childrenSize();i++){\r\n System.out.print(\"| \"+iteration3.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration4= iteration.getChildren(4);\r\n for (int i=0; i<iteration4.childrenSize();i++){\r\n System.out.print(\"| \"+iteration4.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" w\\n\");\r\n System.out.print(\" \");\r\n Node iteration0w= iteration2.getChildren(0);\r\n for (int i=0; i<iteration0w.childrenSize();i++){\r\n System.out.print(\"| \"+iteration0w.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\"\\n \");\r\n Node iteration1w= iteration2.getChildren(1);\r\n for (int i=0; i<iteration1w.childrenSize();i++){\r\n System.out.print(\"| \"+iteration1w.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\"\\n \");\r\n iteration= iteration0w.getChildren(0);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }*/\r\n\r\n }", "public static void createTreeFromTraversals() {\n int[] preorder = {9, 2, 1, 0, 5, 3, 4, 6, 7, 8};\n int[] inorder = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n Tree tree = new Tree();\n tree.head = recur(preorder, inorder, 0, 0, inorder.length-1);\n tree.printPreOrder();\n System.out.println();\n tree.printInOrder();\n System.out.println();\n }" ]
[ "0.69811106", "0.67053753", "0.6552942", "0.63910073", "0.6136702", "0.6091346", "0.6005395", "0.5979458", "0.59532887", "0.59364593", "0.59258175", "0.58999366", "0.5891481", "0.5868589", "0.5860813", "0.581795", "0.58085036", "0.57868046", "0.57248443", "0.566735", "0.5662934", "0.56463593", "0.56463593", "0.56463593", "0.56463593", "0.56463593", "0.56463593", "0.56463593", "0.56463593", "0.5614299", "0.560111", "0.55823904", "0.5577553", "0.55765134", "0.5562558", "0.55475134", "0.55302215", "0.55252784", "0.55185634", "0.55092466", "0.55064255", "0.5496641", "0.5486438", "0.5479374", "0.5466927", "0.54412943", "0.54361117", "0.5432485", "0.54259187", "0.54259187", "0.54259187", "0.54259187", "0.54259187", "0.54259187", "0.5415575", "0.54139787", "0.54122615", "0.53934085", "0.53894967", "0.5387548", "0.5385701", "0.53841233", "0.5368038", "0.5344941", "0.53359336", "0.5334195", "0.53195155", "0.53140414", "0.5301496", "0.529875", "0.5295725", "0.52777225", "0.5275585", "0.5270103", "0.52675676", "0.52661484", "0.5251971", "0.52506346", "0.52410996", "0.52297646", "0.52292085", "0.52251816", "0.52220964", "0.52163166", "0.52157813", "0.52144516", "0.52082676", "0.5207815", "0.5202132", "0.5199973", "0.5172615", "0.51659346", "0.5165448", "0.5159748", "0.51583683", "0.5151361", "0.5149898", "0.5148495", "0.5147075", "0.5144388", "0.51414204" ]
0.0
-1
returns true if the current level is completed
public boolean completed(){ return !activeAttackers() && !attackersLeft(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isCompleted() {\n \n // set amount of bottles to complete the level\n int bottlesAmount = 3;\n \n // if player collects the set amount, level is completed\n if (player.getBottles() == bottlesAmount)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "@Override\n public boolean isCompleted() {\n return time.secondsPassed==finishLevel;\n }", "public boolean isCurrentLevelFinish() {\n return currentLevelFinish;\n }", "@Override\n public boolean isCompleted() {\n return isAllChildCompleted() || this.completion == 1;\n }", "@Override\n\tpublic boolean isComplete() {\n\t\tif (this.defeated == this.totalEnemies)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isComplete()\n {\n return (getCount() >= getGoal());\n }", "protected boolean isFinished() {\n return Robot.m_elevator.onTarget();\n }", "public abstract void levelComplete();", "protected boolean isFinished() {\n\t\treturn Robot.elevator.isInPosition(newPosition, direction);\n\t}", "boolean isComplete();", "boolean isComplete();", "@Override\r\n\tprotected boolean isFinished() {\n\t\treturn Math.abs(elevator.getWristPosition() - elevator.getWristStages()[elevator.getWristStage()]) < Math.PI/18 && !elevator.isRunning(ElevatorSubsystem.Follower.ELEVATOR);\r\n\t}", "public boolean isComplete();", "public boolean is_completed();", "public boolean levelPassed() {\r\n\t\treturn levelManager.levelPassed();\r\n\t}", "protected boolean isFinished() {\n \t\n \tif(current_time >= goal) {\n \t\t\n \t\treturn true;\n \t}else {\n \t\t\n \t\treturn false;\n \t}\n }", "public boolean isComplete()\n {\n return getStatus() == STATUS_COMPLETE;\n }", "public boolean isCompleted() {\n\t\t\n\t\treturn completed;\n\t\t\n\t}", "public boolean isCompleted() {\r\n return completed;\r\n }", "@Override\n\tprotected boolean isFinished() {\n\t\tif (!stoppable) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t// return Robot.elevator.getLevel() == Level.Bottom;\n\t\t\treturn (Robot.elevator.getLevel() == Level.Bottom && v < 0.0) || (Robot.elevator.getLevel() == Level.Top && v > 0.0);\n\t\t}\n\t}", "public boolean isComplete() {\r\n\t\treturn complete;\r\n\t}", "protected boolean isFinished() {\n\t\tif (!hasPathStarted) {\n\t\t\treturn false;\n\t\t}\n\t\tboolean leftComplete = status.activePointValid && status.isLast;\n\t\tboolean trajectoryComplete = leftComplete;\n\t\tif (trajectoryComplete) {\n\t\t\tSystem.out.println(\"Finished trajectory\");\n\t\t}\n\t\treturn trajectoryComplete || isFinished;\n\t}", "public static boolean isCompleted(){\n return isComplete;\n }", "public boolean isCompleted() {\r\n return completed;\r\n }", "public abstract boolean isComplete();", "public boolean isCompleted() {\n\t\treturn program.getBPCFG().isCompleted();\n\t}", "public boolean isCompleted() {\n return completed;\n }", "protected boolean isFinished() {\n\t\treturn false;\n\t\t//return timeOnTarget >= finishTime;\n }", "public Boolean isComplete() {\n return true;\n }", "public boolean isComplete() {\n return complete;\n }", "public boolean isComplete() {\n return complete;\n }", "public boolean isComplete( ) {\n\t\treturn complete;\n\t}", "boolean isFinished() {\n\t\tif (this.currentRoom.isExit() && this.currentRoom.getMonsters().isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n \n \tif(Math.abs(RobotMap.navx.getAngle() - this.desiredAngle) <=2) {\n \n \t\treturn true;\n \t}\n return false;\n }", "public boolean isFinished() {\n\t\t\n\t\treturn drivetrain.angleReachedTarget();\n\n\t}", "protected boolean isFinished() {\n\n \tif(weAreDoneSenor == true) {\n\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n \t\n }", "public boolean isFinished() {\n\t\tif (getRemaining() <= 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isCompleted() {\n return this.completed;\n }", "protected boolean isFinished() {\n \tif(Robot.oi.btnIdle.get()) {\n \t\treturn CommandUtils.stateChange(this, new Idle());\n \t}\n\n \tif( Robot.oi.btnShoot.get()) {\n \t\treturn CommandUtils.stateChange(this, new Shooting()); \n \t}\n \t\n \tif(Robot.oi.btnUnjam.get()){\n \t\treturn CommandUtils.stateChange(this, new Unjam());\n \t}\n return false;\n }", "protected boolean isFinished() {\n \tif(timeSinceInitialized() >= 1.75){\n \t\treturn true;\n \t}\n return false;\n }", "public boolean isComplete()\n\t{\n\t\treturn getStep() == getRepeatCount() * 2 + 1;\n\t}", "public boolean isCompleted(){\r\n\t\treturn isCompleted;\r\n\t}", "public boolean isComplete() {\n\t\treturn false;\n\t}", "public boolean completed() {\n return completed;\n }", "@Override\n\tpublic boolean isFinished() {\n\t\treturn (this.timeRemaining == 0);\n\t}", "boolean isCompleted();", "protected boolean isFinished() {\n if (waitForMovement) return (timeSinceInitialized() > Robot.intake.HOPPER_DELAY);\n return true;\n }", "boolean isComplete() {\n return complete.get();\n }", "public boolean isFinished() { \n // Check how much time has passed\n int passedTime = millis()- savedTime;\n if (passedTime > totalTime) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isComplete(){\r\n\r\n\t\t// TODO\r\n\t\t\r\n\t\tif(!isValid()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public boolean isFinished(){\n return (this.radius >= this.maxHeight/2);\n }", "protected boolean isFinished() {\n logger.info(\"Ending left drive\");\n \treturn timer.get()>howLongWeWantToMove;\n }", "protected boolean isFinished() {\n return System.currentTimeMillis() - timeStarted >= timeToGo;\n }", "boolean isGameComplete();", "public void completeLevel() {\n\n this.getCurrentRoom().setIsDoorLocked(false);\n levelsCompleted++;\n this.setCurrentRoom(currentRoom.getNextRoom());\n inventory.clearContainer();\n }", "boolean completed();", "boolean hasIsComplete();", "boolean hasIsComplete();", "protected boolean isFinished() {\r\n\t\t \tboolean ans = false;\r\n\t\t \treturn ans;\r\n\t\t }", "public boolean hasCompleted() {\n return this.tail.value != null && NotificationLite.isComplete(leaveTransform(this.tail.value));\n }", "public boolean isComplete() { \n return isComplete; \n }", "public boolean isDone()\n {\n return (this.elapsed >= this.duration);\n }", "protected boolean isFinished() {\r\n if (state == STATE_SUCCESS) {\r\n // Success\r\n return true;\r\n }\r\n if (state == STATE_FAILURE) {\r\n // Failure\r\n return true;\r\n }\r\n return false;\r\n }", "public abstract boolean isCompleted();", "protected boolean isFinished() {\n\t\t// get the current angle from the gyro\n\t\tdouble currentAngle = Robot.gyroSubsystem.GyroPosition();\n\n\t\t// see if we are within 2 degrees of the target angle (90 degrees)\n\t\tif (Math.abs(currentAngle - 90) <= 2) {\n\t\t\t// we have hit our goal of 90, end auto program\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// we are not quite there yet, keep going\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean completed()\r\n {\r\n if(pile.size() == 13)\r\n return true;\r\n return false;\r\n }", "public boolean isFinished(){\n return true;\n }", "protected boolean isFinished()\n\t{\n\t\treturn true;\n\t}", "public boolean isCompleted()\n\t{\n\t\treturn pieces.length == existing.cardinality();\n\t}", "protected boolean isFinished() {\n\t\treturn pid.onTarget();\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\treturn true;\n\t}", "protected boolean isFinished() {\n\t\tif (_timesRumbled == 40) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public boolean isCompleted() {\n return dalek.getZeitonCount() == NUM_CRYSTALS;\n }", "protected boolean isFinished() {\n return Robot.claw.isRetracted();\n }", "protected boolean isFinished() {\n \treturn (Robot.sonar.getDistance() <= distance);\n }", "public boolean checkComplete(){\n return Status;\n }", "protected boolean isFinished() {\n return finished;\n }", "@Override\n public boolean isFinished() {\n return complete;\n }", "protected boolean isFinished() {\n return (System.currentTimeMillis() - startTime) >= time;\n \t//return false;\n }", "protected boolean isFinished() {\n\t\treturn Robot.gearIntake.getPegSwitch();\n\t}", "boolean getIsComplete();", "@Override\n protected boolean isFinished() {\n return Robot.m_elevator.isDone();\n }", "protected boolean isFinished() {\n \tif(Math.abs(Robot.driveTrain.getHeading() - targetDirection) < 2) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "@Override\n\tpublic boolean isFinished() {\n\t\treturn finished;\n\t}", "protected boolean isFinished() {\r\n \tif (manipulator.isHighSwitchPressed() && speed > 0 ||\r\n \t\tmanipulator.isLowSwitchPressed() && speed < 0)\r\n \t\treturn true;\r\n \t\r\n \treturn isTimedOut();\r\n \t\r\n// \tif (targetHeight > startHeight) {\r\n// \t\treturn manipulator.getAverageElevatorHeight() >= targetHeight;\r\n// \t} else {\r\n// \t\treturn manipulator.getAverageElevatorHeight() <= targetHeight;\r\n// \t}\r\n }", "@Override\n\tpublic boolean isCompleted()\n\t{\n\t\treturn false;\n\t}", "protected boolean isFinished() {\n \tif(timer.get()>.7)\n \t\treturn true;\n \tif(Robot.gearX==0)\n \t\treturn true;\n return (Math.abs(173 - Robot.gearX) <= 5);\n }", "public boolean isFinished() {\n return true;\n }", "protected boolean isFinished() {\n //return !RobotMap.TOTE_SWITCH.get();\n \treturn false;\n }", "@Override\r\n\tpublic boolean isFinished() {\n\t\treturn finish;\r\n\t}", "protected boolean isFinished() {\n\treturn this.isDone;\n }", "public boolean isOver() {\n return this.treeNode.getBuilding().isFinished();\n }", "protected boolean isFinished() {\n return (timeRunning>timeStarted+5 || RobotMap.inPosition.get()!=OI.shooterArmed);\n }", "protected boolean isFinished() {\n //return controller.onTarget();\n return true;\n }", "protected boolean isFinished() {\n\t\t// get MP status from each talon\n\t\tleftTalon.getMotionProfileStatus(leftStatus);\n\t\trightTalon.getMotionProfileStatus(rightStatus);\n\n\t\tboolean left = (leftStatus.activePointValid && leftStatus.isLast);\n\t\tboolean right = (rightStatus.activePointValid && rightStatus.isLast);\n\t\t\n\n\t\tif (left && right) {\n\t\t\tstate = SetValueMotionProfile.Disable;\n\t\t\tleftTalon.set(ControlMode.MotionProfile, state.value);\n\t\t\trightTalon.set(ControlMode.MotionProfile, state.value);\n\t\t\tSystem.out.println(\"DriveByMotion: Finished\");\n\t\t}\n\n\t\treturn (left && right);\n\t}", "protected boolean isFinished(){\r\n return true;\r\n }", "protected boolean isFinished() {\n\t\tboolean beyondTarget = Robot.wrist.getCurrentPosition() > safePosition;\n\t\treturn isSafe || beyondTarget;\n\t}", "protected boolean isFinished() {\n return true;\n }" ]
[ "0.8294604", "0.8223921", "0.80747765", "0.7443495", "0.7287124", "0.7252094", "0.722924", "0.72175026", "0.72079915", "0.71358216", "0.71358216", "0.7127294", "0.71265113", "0.71186996", "0.7113092", "0.70987207", "0.7080407", "0.705636", "0.70025337", "0.6996202", "0.6995557", "0.6992664", "0.69839495", "0.6964411", "0.6962077", "0.6943788", "0.69299775", "0.6925025", "0.6918607", "0.690831", "0.690831", "0.6896804", "0.687085", "0.68542844", "0.684761", "0.68330115", "0.68328226", "0.6828915", "0.6824844", "0.681375", "0.68096864", "0.68043417", "0.6794125", "0.67923224", "0.67886275", "0.67812777", "0.67725027", "0.6769911", "0.67688775", "0.6765302", "0.67608565", "0.6757363", "0.67406213", "0.6740588", "0.6735232", "0.673353", "0.6711627", "0.6711627", "0.67071676", "0.67062753", "0.6705422", "0.6704277", "0.66998976", "0.66976434", "0.6697354", "0.66812307", "0.6673447", "0.6668558", "0.6666382", "0.66642284", "0.6659193", "0.6659193", "0.6659193", "0.66558677", "0.66549295", "0.66433245", "0.662513", "0.66219556", "0.6619026", "0.66189444", "0.6615197", "0.66060275", "0.6605948", "0.65983254", "0.65972036", "0.65937096", "0.659309", "0.6588485", "0.65842664", "0.6581772", "0.6580072", "0.65741605", "0.65737456", "0.6570348", "0.6556612", "0.65517294", "0.65505207", "0.65454304", "0.65446955", "0.6543009" ]
0.69837385
23
creates a new element
@Override public void newActiveElement(String elementName, Point2D.Double location){ Element newElement = getLevel().getLevelElements().get(elementName).createElementCopy(location); getActiveElements().put(newElement.getId(),newElement); addToFrontEndCommands(new CreateCommand(newElement.getId(),newElement.getImage(),newElement.getElementType(),newElement.getLocation(),newElement.getHeading(), 1, newElement.getRadius())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract M createNewElement();", "public void newElement() {\r\n }", "Element createElement();", "Object create(Element element) throws IOException, SAXException, ParserConfigurationException;", "ObjectElement createObjectElement();", "public org.ccsds.moims.mo.mal.structures.Element createElement()\n {\n return new BasicUpdate();\n }", "E createDefaultElement();", "@FactoryFunc\r\n\t@Function Element createElement(String tagName);", "DataElement createDataElement();", "BElement createBElement();", "DomainElement createDomainElement();", "Form addElement(Element element);", "public View create(Element elem) {\n return null;\n }", "@Override\n\tpublic Element newInstance() {\n\t\treturn null;\n\t}", "ElementDefinition createElementDefinition();", "HTMLElement createHTMLElement();", "public void newElement() {\n Location = null;\n Name = null;\n MyFont = FontList.FONT_LABEL;\n }", "protected XMLElement createAnotherElement() {\n return new XMLElement(this.conversionTable,\n this.skipLeadingWhitespace,\n false,\n this.ignoreCase);\n }", "public void addElement() {\n\t\tXmlNode newNode = new XmlNode(rootNode, this);// make a new default-type field\n\t\taddElement(newNode);\n\t}", "void addElement(FormElement elt);", "Element() {\n\t}", "@Override\r\n\tpublic ElectricityElement createElement() {\r\n\t\treturn new DefaultElectricityElement(\r\n\t\t\t\tgetTemplateName(), \r\n\t\t\t\tgetName(), \r\n\t\t\t\tgetOrigin(),\r\n\t\t\t\tgetDestination(),\r\n\t\t\t\tgetLifecycleModel().createLifecycleModel(), \r\n\t\t\t\tgetMaxElectricityProduction(), \r\n\t\t\t\tgetInitialElectricityProduction(), \r\n\t\t\t\tgetPetroleumIntensityOfElectricityProduction(),\r\n\t\t\t\tgetWaterIntensityOfElectricityProduction(), \r\n\t\t\t\tgetVariableOperationsCostOfElectricityProduction(),\r\n\t\t\t\tgetDistributionEfficiency(), \r\n\t\t\t\tgetMaxElectricityInput(), \r\n\t\t\t\tgetInitialElectricityInput(),\r\n\t\t\t\tgetVariableOperationsCostOfElectricityDistribution()\r\n\t\t\t);\r\n\t}", "public abstract Object create(ElementMapping elementMapping, ReadContext context);", "@Override\n\tpublic boolean create(Eleve o) {\n\t\tmap.put(o.getId(),o);\n\t\treturn true;\n\t}", "public PathElementIF createElement(String name);", "public View create(Element elem, int p0, int p1) {\n return null;\n }", "public android.renderscript.Element.Builder add(android.renderscript.Element element, java.lang.String name) { throw new RuntimeException(\"Stub!\"); }", "public android.renderscript.Element create() { throw new RuntimeException(\"Stub!\"); }", "@Override\n protected Node newNode() {\n return new WebXStyleElementImpl();\n }", "org.landxml.schema.landXML11.BridgeElementDocument.BridgeElement addNewBridgeElement();", "ElementImage createElementImage();", "private BoardElement createBoardElement(Element eElement) {\r\n\t\treturn new BoardElement(\r\n\t\t\teElement.getAttribute(\"id\")\r\n\t\t\t,new Point(Integer.parseInt(eElement.getElementsByTagName(\"topLeftX\").item(0).getTextContent())\r\n\t\t\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"topLeftY\").item(0).getTextContent()))\r\n\t\t\t,new Point(Integer.parseInt(eElement.getElementsByTagName(\"bottomRightX\").item(0).getTextContent())\r\n\t\t\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"bottomRightY\").item(0).getTextContent()))\r\n\t\t);\r\n\t}", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }", "public List Insert(Element new_elem){\n\tboolean ret_val ;\n\tList aux03 ;\n\tList aux02 ;\n\taux03 = this ;\n\taux02 = new List();\n\tret_val = aux02.InitNew(new_elem,aux03,false);\n\treturn aux02 ;\n }" ]
[ "0.81814337", "0.79831386", "0.79310507", "0.72573197", "0.70592463", "0.68763274", "0.6795663", "0.6780733", "0.67726344", "0.67372453", "0.67151904", "0.6683755", "0.66361517", "0.66286564", "0.65102845", "0.64817876", "0.6451682", "0.64392614", "0.6429875", "0.64144325", "0.6346156", "0.63281906", "0.62780404", "0.6268234", "0.6232716", "0.6231704", "0.621271", "0.6211239", "0.6183779", "0.61764526", "0.6145605", "0.6111477", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60934746", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805", "0.60929805" ]
0.67652184
9
get the registrationInfo bean from the session
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); RegistrationService registrationService = (RegistrationService) session.getAttribute("registrationService"); OutputStream out = null; try { response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=confirmation.xls"); // build the Excel confirmation WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream()); WritableSheet s = w.createSheet("Confirmation", 0); int column1 = 0; int column2 = 4; int row = 0; s.addCell(new Label(column1, row, "JOHN HOPKINS ANNUAL SOFTWARE DEVELOPMENT SEMINAR")); row = row + 2; s.addCell(new Label(column1, row, registrationService.getRegistrationInfo().getName())); row = row + 2; s.addCell(new Label(column1, row, "You are registered for the following courses as a " + registrationService.getRegistrationInfo().getEmploymentStatus() + ":")); List<String> courses = registrationService.getRegistrationInfo().getCourses(); row++; for (String course : courses) { s.addCell(new Label(column1, row, course)); s.addCell(new Label(column2, row, "$" + Double.toString(registrationService.getCostInfo().getEmployeeStatusCost()) + "0")); row++; } row++; if (!StringUtils.isEmpty(registrationService.getRegistrationInfo().getHotel())) { s.addCell(new Label(column1, row, "Hotel Accommodation")); s.addCell(new Label(column2, row, "$" + Double.toString(registrationService.getCostInfo().getHotelCost()) + "0")); row++; } if (!StringUtils.isEmpty(registrationService.getRegistrationInfo().getParking())) { s.addCell(new Label(column1, row, "Parking")); s.addCell(new Label(column2, row, "$" + Double.toString(registrationService.getCostInfo().getParkingCost()) + "0")); row++; } s.addCell(new Label(column1, row, "Total:")); s.addCell(new Label(column2, row, "$" + Double.toString(registrationService.getCostInfo().getTotal()) + "0")); w.write(); w.close(); } catch (Exception e) { throw new ServletException("Exception in Excel Sample Servlet", e); } finally { if (out != null) out.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RegistrationInfo getRegistrationInfo();", "protected AccessionSessionBean getgermplasm$AccessionSessionBean() {\n return (AccessionSessionBean) getBean(\"germplasm$AccessionSessionBean\");\n }", "protected PersonSessionBean getadmin$PersonSessionBean() {\n return (PersonSessionBean) getBean(\"admin$PersonSessionBean\");\n }", "protected GatheringSessionBean getinventory$GatheringSessionBean() {\n return (GatheringSessionBean) getBean(\"inventory$GatheringSessionBean\");\n }", "@Override\r\n\tpublic MemberBean detail() {\n\t\treturn this.session;\r\n\t}", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1) getBean(\"SessionBean1\");\n }", "public static RegistrationVO getRegistrationVO() {\r\n\t\treturn registrationVO;\r\n\t}", "public DictAccountRegistration getRegistration()\n {\n return registration;\n }", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1)getBean(\"SessionBean1\");\n }", "protected SessionBean1 getSessionBean1() {\n return (SessionBean1)getBean(\"SessionBean1\");\n }", "public abstract I_SessionInfo getSessionInfo(I_SessionName sessionName);", "SessionBeanDescriptor createSessionBeanDescriptor();", "public SessionInfo getSessionInfo() {\n\t\treturn sessionInfo;\n\t}", "protected AraSessionBean getAraSessionBean() {\n return (AraSessionBean) getBean(\"AraSessionBean\");\n }", "public abstract I_SessionInfo getSession(I_SessionName sessionName);", "@Override\n\t\t\tpublic MemberInfoShowBean doInHibernate(Session session) throws HibernateException, SQLException {\n\t\t\t\tString hql = \"select new com.yuncai.modules.lottery.bean.vo.MemberInfoShowBean(m1.account, m1.name, m1.certNo, m1.email, m1.mobile, m2.bankCard, m2.bankPart,m2.bank) from Member as m1 ,MemberInfo as m2 where m1.id=m2.memberId and m1.account=:account\";\n\t\t\t\tQuery query = session.createQuery(hql);\n\t\t\t\tquery.setParameter(\"account\", account);\n\t\t\t\tMemberInfoShowBean bean = (MemberInfoShowBean) query.uniqueResult();\n\t\t\t\t\n\t\t\t\treturn bean;\n\t\t\t}", "public ManagedBeanSession() {\r\n this.facesContext = FacesContext.getCurrentInstance();\r\n this.httpServletRequest = (HttpServletRequest) this.facesContext.getExternalContext().getRequest();\r\n if (this.httpServletRequest.getSession().getAttribute(\"sessionUsuario\") != null) {\r\n this.usuario = this.httpServletRequest.getSession().getAttribute(\"sessionUsuario\").toString();\r\n }\r\n }", "public Session getSession() { return session; }", "String getAssociatedSession();", "public String getSession() {\n return this.session;\n }", "@RequestMapping(value = \"get_user_info.do\",method = RequestMethod.POST)\r\n @ResponseBody\r\n public ServerResponse<User> getInfo(HttpSession session){\r\n User currentUser = (User)session.getAttribute(Constant.CURRENT_USER);\r\n if(currentUser == null){\r\n return ServerResponse.createByErrorCodeAndMsg(ResponseCode.NEED_LOGIN.getCode(),\"User has not logged in.\");\r\n }\r\n return iUserService.getUserInfoById(currentUser.getId());\r\n }", "public User getSession(){\n\t\treturn this.session;\n\t}", "protected Session getSession() { return session; }", "public Session getSession() {\n return session;\n }", "public Session getSession();", "@Override\n\tpublic String getRegistrationTag() {\n\t\treturn registrationTag;\n\t}", "User getBySession(String session);", "Session getSession();", "Session getSession();", "public Session getSession()\n {\n return session;\n }", "public Object getObject() {\n\t\treturn this.sessionFactory;\n\t}", "public String getSession() {\n return session;\n }", "public static Session getSession() {\n return session;\n }", "public Response getRegisterResponse(){\n\t\treturn this.registerResponse;\n\t}", "protected User getUser(HttpSession session) {\r\n\t\t// get the user form from the session\r\n\t\treturn (User) session.getAttribute(Constants.USER_KEY);\r\n\t}", "public static CustomSession get() {\r\n\t\treturn (CustomSession) Session.get();\r\n\t}", "public String getRegistrationNumber(){\n return registrationNumber;\n }", "protected SelectionListSessionBean getadmin$SelectionListSessionBean() {\n return (SelectionListSessionBean) getBean(\"admin$SelectionListSessionBean\");\n }", "String registerUserWithGetCurrentSession(User user);", "public UserInfo getUserInfo() {\r\n return userInfo;\r\n }", "private Session getSession() {\n\t\treturn factory.getCurrentSession();\n\t}", "@Override\n\tpublic MemberVO getSession() {\n\t\treturn null;\n\t}", "public Session getSession() {\n return session;\n }", "RegisterParam getRegister();", "@Override\n\tpublic RegisterHibernateDAO getRegisterDAO() {\n\t\treturn (RegisterHibernateDAO)instantiateDAO(RegisterHibernateDAO.class);\n\t}", "public String getRegistrationId() {\n\t\treturn registrationId;\n\t}", "public Session session() {\n return session;\n }", "public UserInfo getUserInfo() {\n return userInfo;\n }", "public IUser getRegistrator(){\n\t\treturn User.get().\n\t\t\t\tsetPerson(Person.get()\n\t\t\t\t\t\t.setFirstname(\"Regisytator\")\n\t\t\t\t\t\t.setLastname(\"Registrator\")\n\t\t\t\t\t\t.setEmail(\"[email protected]\")\n\t\t\t\t\t\t.build()\n\t\t\t\t\t\t)\n\t\t\t\t.setAccount(Account.get()\n\t\t\t\t\t\t.setLogin(\"registrator\")\n\t\t\t\t\t\t.setPassword(\"registrator\")\n\t\t\t\t\t\t.setRole(\"REGISTRATOR\")\n\t\t\t\t\t\t.setStatus(\"ACTIVE\")\n\t\t\t\t\t\t.setCommunity(\"Україна\")\n\t\t\t\t\t\t.build()\n\t\t\t\t\t\t.setData(\"\")\n\t\t\t\t\t\t.setRegisterNumber(\"14\")\n\t\t\t\t\t\t.setRegistratorNumber(\"804:23:17:026:79000:\")\n\t\t\t\t\t\t.setVolumeNumber(\"12345\")\n\t\t\t\t\t\t)\n\t\t\t\t.build();\t\n\t}", "@Override\n public synchronized MemberRegistration retrieveLocalRegistration()\n {\n CohortMembership registryStoreProperties = this.retrieveRegistryStoreProperties();\n\n MemberRegistration localRegistration = registryStoreProperties.getLocalRegistration();\n\n if (log.isDebugEnabled())\n {\n if (localRegistration == null)\n {\n log.debug(\"Null local registration returned from retrieveLocalRegistration\");\n }\n else\n {\n log.debug(\"Local Registration details: \" +\n \"metadataCollectionId: \" + localRegistration.getMetadataCollectionId() +\n \"; displayName: \" + localRegistration.getServerName() +\n \"; serverType: \" + localRegistration.getServerType() +\n \"; organizationName: \" + localRegistration.getOrganizationName() +\n \"; registrationTime \" + localRegistration.getRegistrationTime());\n }\n }\n\n return localRegistration;\n }", "Session getCurrentSession();", "Session getCurrentSession();", "@Override\n public synchronized List<MemberRegistration> retrieveRemoteRegistrations()\n {\n /*\n * Ensure the current properties are retrieved from the registry.\n */\n CohortMembership registryStoreProperties = this.retrieveRegistryStoreProperties();\n Map<String, MemberRegistration> remoteMemberMap = this.getRemoteMemberMap(registryStoreProperties.getRemoteRegistrations());\n\n if (remoteMemberMap.isEmpty())\n {\n return null;\n }\n else\n {\n return new ArrayList<>(remoteMemberMap.values());\n }\n }", "public SessionDetails getSessionDetails(JobStep js, Sessions s);", "public com.weizhu.proto.WeizhuProtos.Session getSession() {\n if (sessionBuilder_ == null) {\n return session_;\n } else {\n return sessionBuilder_.getMessage();\n }\n }", "public List<SessionDetails> getSessionDetails(JobStep js);", "AuthenticationSessionModel getAuthenticationSession();", "public String getSessionName();", "@Override\n\tpublic RegdetailsHibernateDAO getRegdetailsDAO() {\n\t\treturn (RegdetailsHibernateDAO)instantiateDAO(RegdetailsHibernateDAO.class);\n\t}", "private void getValues() {\n session = new UserSession(getApplicationContext());\n\n //validating session\n session.isLoggedIn();\n\n //get User details if logged in\n HashMap<String, String> user = session.getUserDetails();\n\n shopname = user.get(UserSession.KEY_NAME);\n shopemail = user.get(UserSession.KEY_EMAIL);\n shopmobile = user.get(UserSession.KEY_MOBiLE);\n System.out.println(\"nameemailmobile \" + shopname + shopemail + shopmobile);\n }", "public /*static*/ Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "public PSUserSession getSession();", "public static KmUserMstr getUserDetails(HttpServletRequest request)\r\n\t{\r\n\t\tKmUserMstr userBean = new KmUserMstr();\r\n\t\tif(request.getSession().getAttribute(\"USER_INFO\")!=null)\r\n\t\t{\r\n\t\t\tuserBean = (KmUserMstr)request.getSession().getAttribute(\"USER_INFO\");\r\n\t\t}\r\n\t\treturn userBean;\r\n\t}", "public Register.Req getRegisterReq() {\n return instance.getRegisterReq();\n }", "Register.Req getRegisterReq();", "Object getBean();", "public org.openejb.config.ejb11.Session getSession() {\n return this._session;\n }", "public com.weizhu.proto.WeizhuProtos.Session getSession() {\n return session_;\n }", "public jkt.hms.masters.business.MasSession getSession () {\n\t\treturn session;\n\t}", "public String getRegisterId()\n/* */ {\n/* 273 */ return this.registerId;\n/* */ }", "public static GridPane getRegistrationPersonPane() {\n return list;\n }", "private static void getFromCache(Session session) {\n\t\tCacheManager cm=CacheManager.getInstance();\n\t\tCache cache=cm.getCache(\"namanCache\");\n\t\tfor(int i=0;i<2;i++){\n\t\t\tif(cache.get(i)!=null){\n\t\t\t\tSystem.out.println(((UserDetails)cache.get(1).getObjectValue()).getName());\n\t\t\t}else{\n\t\t\t\tUserDetails user1=(UserDetails)session.get(UserDetails.class, i);\n\t\t\t\tSystem.out.println(user1.getName());\n\t\t\t\tcache.put(new Element(i+1,user1));\n\t\t\t}\n\t\t}\n\t\tcm.shutdown();\n\t}", "protected Session getSession() {\n\n return (Session) getExtraData().get(ProcessListener.EXTRA_DATA_SESSION);\n }", "public PacienteBean() {\r\n paciente = new Paciente();\r\n logueado = new Usuario();\r\n //datospersonales = new HelperDatosPersonales();\r\n this.resultado = \"\";\r\n pacienteSeleccionado = false;\r\n \r\n // Carga session\r\n faceContext=FacesContext.getCurrentInstance();\r\n httpServletRequest=(HttpServletRequest)faceContext.getExternalContext().getRequest();\r\n if(httpServletRequest.getSession().getAttribute(\"Usuario\") != null)\r\n {\r\n logueado = (Usuario)httpServletRequest.getSession().getAttribute(\"Usuario\");\r\n }\r\n \r\n if(httpServletRequest.getSession().getAttribute(\"Centro\") != null)\r\n {\r\n //logueadoCentro = (Centro)httpServletRequest.getSession().getAttribute(\"Centro\");\r\n CentroID = Integer.parseInt(httpServletRequest.getSession().getAttribute(\"Centro\").toString());\r\n }\r\n }", "protected final Session getSession() {\n return sessionTracker.getSession();\n }", "public static ExternalRegisterContainer retrieveFromRequest() {\r\n HttpServletRequest httpServletRequest = GrouperUiFilter.retrieveHttpServletRequest();\r\n \r\n ExternalRegisterContainer externalRegisterContainer = (ExternalRegisterContainer)httpServletRequest\r\n .getAttribute(\"inviteExternalSubjectsContainer\");\r\n if (externalRegisterContainer == null) {\r\n throw new NoSessionException(GrouperUiUtils.message(\"inviteExternalSubjects.noContainer\"));\r\n }\r\n return externalRegisterContainer;\r\n }", "private static Session getInstance() {\n return SingletonHolder.INSTANCE;\n }", "public SessionService session() {\n return service;\n }", "public Map getSessionMap() {\r\n\t\treturn sessionMap;\r\n\t}", "@Override\n\tpublic UserInfo getUserInfo() {\n\t\tHttpSession session = RpcContext.getHttpSession();\n String auth = (String)session.getAttribute(\"auth\");\n UserInfo ui = null;\n if (auth != null) {\n\t switch(AuthType.valueOf(auth)) {\n\t\t case Database: {\n\t\t String username = (String)session.getAttribute(\"username\");\n\t\t \t\tui = _uim.select(username);\n\t\t \t\tbreak;\n\t\t }\n\t\t case OAuth: {\n\t\t \t\tString googleid = (String)session.getAttribute(\"googleid\");\n\t\t \t\tui = _uim.selectByGoogleId(googleid);\n\t\t \t\tbreak;\n\t\t }\n\t }\n }\n\t\treturn ui;\n\t}", "private void getHibernateSession() {\n try {\n session = em.unwrap(Session.class)\n .getSessionFactory().openSession();\n\n } catch(Exception ex) {\n logger.error(\"Failed to invoke the getter to obtain the hibernate session \" + ex.getMessage());\n ex.printStackTrace();\n }\n\n if(session == null) {\n logger.error(\"Failed to find hibernate session from \" + em.toString());\n }\n }", "public Boolean getRegistered() {\n return registered;\n }", "public static MemberSession getMemberSession() {\n//\t\treturn getMemberSessionDo2(GPortalExecutionContext.getRequest().getSessionContext().getId());\n\t//\tGPortalExecutionContext.getRequest().getSessionContext().invalidate();\n\t\treturn getMemberSession(GPortalExecutionContext.getRequest().getSessionContext().getId());\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public Session getSession() {\n\t\treturn session;\n\t}", "public boolean canRegister(Session session);", "com.weizhu.proto.WeizhuProtos.SessionOrBuilder getSessionOrBuilder();", "public String getDeviceRegistration() {\n return this.deviceRegistration;\n }", "public static Map<SessionFactory, Session> getSession() {\n\t\tSessionFactory sf = new Configuration().configure(Constants.ONE_TO_MANY).addAnnotatedClass(Instructor.class)\n\t\t\t\t.addAnnotatedClass(InstructorDetail.class).addAnnotatedClass(Course.class).buildSessionFactory();\n\t\tSession s = sf.openSession();\n\n\t\tMap<SessionFactory, Session> tmp = new HashMap<SessionFactory, Session>();\n\t\ttmp.put(sf, s);\n\n\t\treturn tmp;\n\t}", "protected Session getSession() {\n return sessionFactory.getCurrentSession();\n }", "public AbstractSession getSession() {\n return session;\n }", "public Session getSession(){\n\t\treturn sessionFactory.openSession();\n\t}", "private TunaFacadeRemote getRemoteSession() {\n TunaFacadeRemote session = null;\n \n // CORBA properties and values and lookup taken after earlier work provided by\n // Todd Kelley (2016) Personal Communication\n System.setProperty(\"org.omg.CORBA.ORBInitialHost\", \"127.0.0.1\");\n System.setProperty(\"org.omg.CORBA.ORBInitialPort\", \"3700\");\n try {\n JOptionPane.showMessageDialog(this, \"Trying for a session...\");\n InitialContext ic = new InitialContext();\n session = (TunaFacadeRemote) ic.lookup(\"java:global/Assignment4/Assignment4-ejb/TunaFacade\");\n JOptionPane.showMessageDialog(this, \"Got a session :) \");\n\n } catch (NamingException e) {\n JOptionPane.showMessageDialog(this, \"Problem. \\n Cause: \\n\" + e.getMessage());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Problem. \\n Cause: \\n\" + e.getMessage());\n }\n return session;\n }", "public Registracija() {\n servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();\n konf = (Konfiguracija) servletContext.getAttribute(\"Konfig\");\n bpkonf = (BP_Konfiguracija) servletContext.getAttribute(\"BP_Konfig\");\n }", "com.weizhu.proto.WeizhuProtos.Session getSession();", "Object getNativeSession();", "protected Session getSession() {\n return sessionUtility.getSession();\n }", "public Object getObjFromSession(String key)\n\t{\n\t\treturn context.getSession().get(key);\n\t}", "protected XDocReportRegistry getRegistryFromHTTPSession( HttpServletRequest request )\n {\n HttpSession session = request.getSession();\n XDocReportRegistry registry = (XDocReportRegistry) session.getAttribute( XDOCREPORTREGISTRY_SESSION_KEY );\n if ( registry == null )\n {\n registry = new XDocReportRegistry();\n session.setAttribute( XDOCREPORTREGISTRY_SESSION_KEY, registry );\n }\n return registry;\n }", "@java.lang.Override\n public entities.Torrent.RegistrationResponseOrBuilder getRegistrationResponseOrBuilder() {\n return getRegistrationResponse();\n }" ]
[ "0.7315564", "0.6752224", "0.64720166", "0.63961434", "0.635786", "0.6335002", "0.62991893", "0.62792736", "0.61515343", "0.61515343", "0.611291", "0.60404927", "0.5996886", "0.5910352", "0.5894499", "0.58400005", "0.58287525", "0.5787042", "0.5785671", "0.5782046", "0.5761388", "0.5751858", "0.5742703", "0.5701929", "0.56735575", "0.56462955", "0.5609386", "0.5606332", "0.5606332", "0.5599261", "0.55659586", "0.55547273", "0.55505604", "0.5548372", "0.55399346", "0.5534611", "0.5523526", "0.55176026", "0.55158114", "0.551128", "0.5509958", "0.5496132", "0.548923", "0.54864264", "0.5478532", "0.5469153", "0.54676497", "0.5466238", "0.5449804", "0.5448013", "0.54464334", "0.54464334", "0.5442407", "0.54401284", "0.5418235", "0.54074347", "0.5404806", "0.54001397", "0.5397526", "0.538902", "0.5382195", "0.5381454", "0.53783995", "0.537265", "0.5365849", "0.5352598", "0.5341576", "0.5340644", "0.5331526", "0.5330539", "0.5326664", "0.53153455", "0.5307483", "0.52897644", "0.527462", "0.5272237", "0.5269349", "0.5267595", "0.52635217", "0.5261576", "0.52598757", "0.52597904", "0.52590096", "0.5252145", "0.5252145", "0.5252145", "0.5252039", "0.5245771", "0.52448815", "0.5242079", "0.5239997", "0.5235668", "0.5234906", "0.5228841", "0.5225594", "0.52218556", "0.5215293", "0.52072084", "0.5204023", "0.5199715", "0.5199035" ]
0.0
-1
the constructor method the parameters it takes is what port to bind to, the default tcp port for a httpserver is port 80. the other parameter is a reference to the gui, this is to pass messages to our nice interface
public Webserver(int listen_port) { port = listen_port; ip = getIP(); //this makes a new thread, as mentioned before,it's to keep gui in //one thread, server in another. You may argue that this is totally //unnecessary, but we are gonna have this on the web so it needs to //be a bit macho! Another thing is that real pro webservers handles //each request in a new thread. This server dosen't, it handles each //request one after another in the same thread. This can be a good //assignment!! To redo this code so that each request to the server //is handled in its own thread. The way it is now it blocks while //one client access the server, ex if it transferres a big file the //client have to wait real long before it gets any response. this.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ServerFrame(int port, OutputStream out, OutputStream err) {\n super(\"Server Frame\"); \n this.port = port;\n \n initComponents();\n initAddresses();\n initTextAreas(out, err);\n \n setLocationRelativeTo(null);\n setVisible(true);\n }", "public WebServer (int port)\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public WebServer (String sHost, int port)\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = sHost; \t\t\t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = port; \t\t\t\t\t\t\t\t\t\t\r\n\t}", "public static void main(String[] args) \n {\n int port = DEFAULT_PORT; //Port to listen on\n\n\n ServerGui serverGui = new ServerGui();\n serverGui.setVisible(true);\n serverGui.setSize(450, 300);\n \n \n //----------------------------------\n // EchoServer sv = new EchoServer(port);\n \n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public TCPServer(TCPViewModel viewModel, int port) {\n this.viewModel = viewModel;\n this.port = port;\n startServerMsg = \"TCP server listener successfully started on port [\"+port+\"]... listening for incoming connections.\";\n }", "public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }", "public WebServer ()\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t{\r\n\t\tthis.shost = DEF_HOST; \t\t\t\t\t\t\t\t\r\n\t\tthis.sPort = DEF_PORT; \t\t\t\t\t\t\t\t\r\n\t}", "public ServerMain( int port )\r\n\t{\r\n\t\tthis.port = port;\r\n\t\tserver = new Server( this.port );\r\n\t}", "private void init(String ip, int port, String name) {\n this.settings = new Settings(ip, port, name);\n this.network = new Network(this);\n this.clientGUI = new ClientGUI(this);\n //\n new Thread(network::start).start();\n }", "public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }", "Client(String server, int port, String username, ClientGUI cg) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.cg = cg; // Saved if in GUI mode or not\n\t}", "public Server(int port) {\r\n \r\n this.m_Port = port;\r\n this.m_Clients = new TeilnehmerListe();\r\n }", "public static void main(String[] args){\n\t\tClientGui gui = new ClientGui();\n\t\tString address = args[0];\n\t\tgui.address=address;\n\t\tint port = Integer.parseInt(args[1]);\n\t\tgui.port = port;\n\t\t//unable to connect?\n\t\treturn ; \n\n\t}", "public WOHTTPConnection(java.lang.String aHost, int portNumber){\n //TODO codavaj!!\n }", "public DefaultTCPServer(int port) throws Exception {\r\n\t\tserverSocket = new ServerSocket(port);\t}", "public CameraPiSocket(int port_arg){\n\t\tport = port_arg;\n\t}", "public GameServer(int portNum)\n\t{\n\t\tport = portNum;\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "public Server(){\r\n \r\n this.m_Clients = new TeilnehmerListe();\r\n this.m_Port = 7575;\r\n }", "public WebServer(int port) {\n\t\ttry {\n\t\t\tthis.listen_port = new ServerSocket(port);\n\t\t\tthis.pool = Executors.newFixedThreadPool(40);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args)\n {\n if(args.length < 2){\n System.out.println(\"Missing Arguments. Please Try Again\");\n System.exit(0);\n }\n else if(args.length > 2){\n System.out.println(\"Too many Arguments. Please Try Again\");\n System.exit(0);\n }\n\n serverIp = args[0];\n try {\n serverPort = Integer.parseInt(args[1]);\n }\n catch(NumberFormatException e){\n System.out.println(\"The port number must be an integer.\");\n System.exit(0);\n }\n\n try{\n Socket socket = new Socket(serverIp, serverPort);\n // Open GUI\n window = new MainWindow(socket);\n window.run();\n } catch (UnknownHostException e) {\n System.out.println(\"Unknown Host.\");\n System.exit(0);\n } catch (IOException e) {\n System.out.println(\"Connection Refused.\");\n System.exit(0);\n }\n }", "public ChatRoomServer(int portNumber){\n this.ClientPort = portNumber;\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Server(int port, String pickrequest) {\n\t\tString[] request = new String[3];\n\t\tif(pickrequest.equals(fcfs){\n\t\t\t\n\t\t}\n\t\tchannel = new TCPChannel(port);\n\t\tchannel.setMessageListener(this);\n\t\t\n\t\t\n\t}", "protected ClassServer(int aPort) throws IOException{\n this(aPort, null);\n }", "public void start(int port);", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "public ServerGUI() {\n\t\t\n\t\tinitialize();\n\n\t}", "public Server(int port, mainViewController viewController, LogViewController consoleViewController){\n isRunningOnCLI = false;\n this.viewController = viewController;\n this.port = port;\n this.consoleViewController = consoleViewController;\n viewController.serverStarting();\n log = new LoggingSystem(this.getClass().getCanonicalName(),consoleViewController);\n log.infoMessage(\"New server instance.\");\n try{\n this.serverSocket = new ServerSocket(port);\n //this.http = new PersonServlet();\n log.infoMessage(\"main.Server successfully initialised.\");\n clients = Collections.synchronizedList(new ArrayList<>());\n ServerOn = true;\n log.infoMessage(\"Connecting to datastore...\");\n //mainStore = new DataStore();\n jettyServer = new org.eclipse.jetty.server.Server(8080);\n jettyContextHandler = new ServletContextHandler(jettyServer, \"/\");\n jettyContextHandler.addServlet(servlets.PersonServlet.class, \"/person/*\");\n jettyContextHandler.addServlet(servlets.LoginServlet.class, \"/login/*\");\n jettyContextHandler.addServlet(servlets.HomeServlet.class, \"/home/*\");\n jettyContextHandler.addServlet(servlets.DashboardServlet.class, \"/dashboard/*\");\n jettyContextHandler.addServlet(servlets.UserServlet.class, \"/user/*\");\n jettyContextHandler.addServlet(servlets.JobServlet.class, \"/job/*\");\n jettyContextHandler.addServlet(servlets.AssetServlet.class, \"/assets/*\");\n jettyContextHandler.addServlet(servlets.UtilityServlet.class, \"/utilities/*\");\n jettyContextHandler.addServlet(servlets.EventServlet.class, \"/events/*\");\n //this.run();\n } catch (IOException e) {\n viewController.showAlert(\"Error initialising server\", e.getMessage());\n viewController.serverStopped();\n log.errorMessage(e.getMessage());\n }\n }", "public ConnectToServerGUI() {\n super(\"Connect to Server\");\n initComponents();\n setVisible(true);\n }", "public Server(int port)\r\n\t\t{\r\n log(\"Initialising port \" + port);\r\n\r\n\t\t// Set the port\r\n\t\tthis.port = port;\r\n\r\n // Create the server socket\r\n createServerSocket();\r\n \t}", "public Server(int port){\n\t\ttry {\n\t\t\tdatagramSocket = new DatagramSocket(port);\n\t\t\trequest = new byte[280];\n\t\t} catch (SocketException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t}", "public ServerSide(Config config, InetAddress inetAddress, int port) {\n super(config);\n this.inetAddress = inetAddress;\n this.port = port;\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "public TorrentGUI() {\n try {\n initComponents();\n seededFiles = new HashMap<String, File>();\n InetAddress thisIp = InetAddress.getLocalHost();\n ServerSocket ss = new ServerSocket(0);\n System.out.println(ss.getLocalPort());\n ContactThread ct = new ContactThread(ss, seededFiles);\n ct.start();\n user = new User(thisIp, ss.getLocalPort());\n System.out.println(\"GUI je pokrenut\");\n } catch (IOException ex) {\n Logger.getLogger(TorrentGUI.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@SuppressWarnings(\"OverridableMethodCallInConstructor\")\n public ServerFrame() {\n initComponents();\n init();\n connection();\n }", "public TCPServer(int portNumber){\r\n\t\t// Abro el socket en el puerto dado y obtengo los stream\r\n\t\ttry {\r\n\t\t\tmServerSocket = new ServerSocket(portNumber);\r\n\t\t} catch (IOException e) { e.printStackTrace(); }\r\n\t}", "public void startNetwork(int port);", "public TCPServer(int port) throws IOException {\n\tthis.socket = new ServerSocket(port);\n\tthis.clients = new ArrayList();\n\n\tSystem.out.println(\"SERVER: Started\");\n }", "public Server() {\n initComponents();\n }", "public Server() {\n initComponents();\n }", "Client(String server, int port, String username, ClientGUI clientgui) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.clientGui = clientgui;\n\t}", "public FServer() {\n initComponents();\n }", "public HttpProxy(int port)\n {\n thisPort = port;\n }", "public TCPServerEmployee(int NumPort, ControllerC controller) {\n\t\ttry\n\t\t{\n\t\t\tsocketserver = new ServerSocket(NumPort);\n\t\t\tthis.controller = controller;\n\t\t}\n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ClientThread(String ip, String port){ // initiate with IP and port\n this.Port = port;\n this.IP = ip;\n }", "public LoadBalancer(int port) throws IOException {\n super(port);\n tabServerssout = new Vector();\n tabServerssin = new Vector();\n //On se connecte aux serveurs\n addServers(8010,8013);\n }", "public ServerGame(int port)\r\n\t{\r\n\t\tsuper(NetworkMode.SERVER);\r\n\t\tserver = new Server(port, getWorld());\r\n\t}", "public Server () {\n\t\t\n\t\tsuper(\"The best messager ever! \");\n\t\t//This sets the title. (Super - JFrame).\n\t\t\n\t\tuserText = new JTextField();\n\t\tuserText.setEditable(false);\n\t\tuserText.addActionListener(\n\t\t\t\tnew ActionListener() {\n\t\t\t\t\t\n\t\t\t\t\tpublic void actionPerformed(ActionEvent event) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsendMessage(event.getActionCommand());\n\t\t\t\t\t\t//This returns whatever event was performed in the text field i.e the text typed in.\n\t\t\t\t\t\tuserText.setText(\"\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\tadd(userText,BorderLayout.NORTH);\n\t\tchatWindow = new JTextArea();\n\t\tadd(new JScrollPane (chatWindow));\n\t\tsetSize(800,600);\n\t\tsetVisible(true);\n\t\t\n\t\t\n\t\n\t\n\t}", "public TCPAdapter(int port) throws IOException {\n\t\tLOG.info(\"Binding port: \"+Integer.toString(port));\n\t\tthis.socket = new ServerSocket(port);\n\t}", "void startServer(int port) throws Exception;", "public Client(){\r\n\t\t// ask the user for a host, port, and user name\r\n\t\tString host = JOptionPane.showInputDialog(\"Host address:\");\r\n\t\t\r\n\t\tString port = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\tboolean shouldRepeat = true;\r\n\t\tint portNum = 0;\r\n\t\twhile(shouldRepeat){\r\n\t\t\ttry{\r\n\t\t\tportNum = Integer.parseInt(port);\r\n\t\t\tshouldRepeat = false;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tport = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tclientName = JOptionPane.showInputDialog(\"User name:\");\r\n\t\t\r\n\t\tif (host == null || port == null || clientName == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\ttry{\r\n\t\t\t// Open a connection to the server\r\n\t\t\tserver = new Socket(host, portNum);\r\n\t\t\tout = new ObjectOutputStream(server.getOutputStream());\r\n\t\t\tin = new ObjectInputStream(server.getInputStream());\r\n\t\t\t\r\n\t\t\tout.writeObject(clientName);\r\n\t\t\t\r\n\t\t\tsetupGUI();\r\n\t\t\t\r\n\t\t\t// start a thread for handling server events\r\n\t\t\tnew Thread(new ServerHandler()).start();\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public Server(int port) {\n this.port = port;\n try {\n sock = new ServerSocket(port);\n clientSock = sock.accept();\n\n //Connection established, do some fancy stuff here\n processReq();\n } catch (IOException e) {\n System.err.println(\"ERROR: Sth failed while creating server socket :( \");\n }\n }", "public Server(int port) {\n this.port = port;\n try {\n socket = new DatagramSocket(port);\n } catch (SocketException e) {\n e.printStackTrace();\n }\n run = new Thread(this, \"Server\");\n run.start();\n }", "public void setPort(int port);", "public void setPort(int port);", "public ServerForm() throws Exception {\n myServer = new Server(2525);\n\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Não foi possível alterar o LookAndFeel: \" + e);\n }\n setResizable(false);\n initComponents();\n }", "public Frame() {\n\t initComponents();\n\t jTabbedPane1.setEnabledAt(1, false);\n\t jTabbedPane1.setEnabledAt(2, false);\n\t jTabbedPane1.setEnabledAt(3, false);\n\t jTabbedPane1.setEnabledAt(4, false);\n\t jTabbedPane1.setEnabledAt(5, false);\n\t while(true){\n\t try {\n\t socket = new Socket(\"127.0.0.1\", 12345);\n\t break;\n\t }catch(IOException e) {\n\t int reply=JOptionPane.showConfirmDialog(null, \"Немає доступу до серверу\\nПовторити спробу?\", \"Помилка\", JOptionPane.YES_NO_OPTION);\n\t if(reply==JOptionPane.YES_OPTION){\n\t \n\t }\n\t else{\n\t System.exit(0);\n\t }\n\t \te.printStackTrace();\n\t }\n\t }\n\t try{\n\t out=new ObjectOutputStream(socket.getOutputStream());\n\t in = new ObjectInputStream(socket.getInputStream());\n\t }catch(IOException e){\n\t e.printStackTrace();\n\t }\n\t }", "public void run() {\n //we are now inside our own thread separated from the gui.\n ServerSocket serversocket = null;\n //Pay attention, this is where things starts to cook!\n try {\n //print/send message to the guiwindow\n s(\"Trying to bind to localhost on port \" + Integer.toString(port) + \"...\");\n //make a ServerSocket and bind it to given port,\n serversocket = new ServerSocket(port);\n } catch (Exception e) { //catch any errors and print errors to gui\n s(\"\\nFatal Error:\" + e.getMessage());\n return;\n }\n\n //go in a infinite loop, wait for connections, process request, send response\n while (true) {\n s(\"\\nReady, Waiting for requests...\\n\");\n try {\n //this call waits/blocks until someone connects to the port we\n //are listening to\n Socket connectionsocket = serversocket.accept();\n //figure out what ipaddress the client commes from, just for show!\n InetAddress client = connectionsocket.getInetAddress();\n //and print it to gui\n s(client.getHostName() + \" connected to server.\\n\");\n //Read the http request from the client from the socket interface\n //into a buffer.\n BufferedReader input =\n new BufferedReader(new InputStreamReader(connectionsocket.getInputStream()));\n //Prepare a outputstream from us to the client,\n //this will be used sending back our response\n //(header + requested file) to the client.\n DataOutputStream output =\n new DataOutputStream(connectionsocket.getOutputStream());\n\n //as the name suggest this method handles the http request, see further down.\n //abstraction rules\n http_handler(input, output);\n } catch (Exception e) { //catch any errors, and print them\n s(\"\\nError:\" + e.getMessage());\n }\n\n } //go back in loop, wait for next request\n }", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "public NetworkGUI(final GUIManager listener, JTextField tfield, JButton bttn, JLabel lbl){\n super();\n serverAddress = new JTextField(\"localhost\");\n connectButton = new JButton(\"Połącz\");\n connStatus = new JLabel(\"Rozłączony\");\n if (tfield != null && bttn != null && lbl != null) {\n \tserverAddress = tfield;\n \tconnectButton = bttn;\n \tconnStatus = lbl;\n }\n add(serverAddress);\n add(connectButton);\n add(connStatus);\n\n connectButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e){\n listener.handleConnectServer(serverAddress.getText());\n }\n });\n\n }", "public Server(int port, Consumer<Serializable> onReceiveCallBack)\r\n {\r\n //superclass Constructor called \r\n super(onReceiveCallBack);\r\n \r\n //\r\n this.port = port;\r\n }", "public ConnectToServerGUI(ClientGUI cg, String serverName, int port, String IPAddress) {\n this();\n if (serverName != null) {\n this.serverName = serverName;\n }\n if (IPAddress != null) {\n this.IPAddress = IPAddress;\n }\n if (port != -1) {\n this.port = port;\n }\n this.cg = cg;\n \n if (port == -1) port = 1500;\n\n serverNameField.setText(serverName);\n IPField.setText(this.IPAddress);\n portField.setText(port + \"\");\n \n \n this.addWindowListener(new WindowAdapter()\n {\n @Override\n public void windowClosing(WindowEvent e)\n {\n e.getWindow().setVisible(false);\n }\n });\n }", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public Server(){\r\n\t\tdisplayArea = new JTextArea();\r\n\t\tdisplayArea.setEditable(false);\r\n\t\tadd( new JScrollPane(displayArea));\r\n\t\tsetSize(300,150);\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetVisible(true);\r\n\t}", "public SmtpServerPanel()\r\n\t{\r\n\t\tsuper();\r\n\r\n\t\tthis.setOpaque(false);\r\n\r\n\t\tthis.port = new JFormattedTextField( NumberFormat.getIntegerInstance() );\r\n\t\tthis.port.setOpaque(false);\r\n\t\tthis.port.setText(DEFAULT_PORT);\r\n\t\tthis.host.setText(DEFAULT_HOST);\r\n\t\tthis.title.setText(DEFAULT_TITLE);\r\n\r\n\t\tadd(port);\r\n\t}", "public TCPServer(String ip, int port) throws SocketException\n\t{\n\t\tsuper(ip, port);\n\t\tsetCheck(null);\n\t}", "public SimpleGUI(String p_host, String p_name) {\r\n super();\r\n initialize();\r\n int porti=1099;\r\n String adresa=\"192.165.43.195\"; \r\n try\r\n {\r\n this.rem = (ServerInterface)Naming.lookup(\"rmi://\"+adresa+\":\"+porti+\"/RMD\");\r\n \t\r\n this.id = rem.EnterGame(p_name);\r\n System.out.println(\"Your id is : \"+ id);\r\n \t\r\n if(id == 0)\r\n {\r\n System.out.println(\"Max Connection reached\");\r\n \t\r\n }\r\n else\r\n {\r\n this.name = rem.getName(id);\r\n this.setTitle(\"Welcome \" + name);\r\n \t\r\n GiveCards();\r\n \t\r\n }\r\n \r\n }\r\n catch (MalformedURLException e)\r\n {\r\n System.err.println(\"MalformedURLException: \"+e.getMessage());\r\n }\r\n catch (RemoteException e)\r\n {\r\n System.err.println(\"RemoteException: \" + e.getMessage());\r\n }\r\n catch (NotBoundException e)\r\n {\r\n System.err.println(\"NotBoundException: \"+e.getMessage());\r\n }\r\n }", "public TCPCanSocket() throws IOException\n \t{\n \t\t// this(new ServerSocket(DEFAULT_PORT).accept());\n \t\tthis(new ServerSocket(DEFAULT_PORT, 100).accept());\n \t\tSystem.out.println( \"constructor: open server socket\" );\n \t}", "public TcpListener( URL uri, Resources resources )\n\t{\n\t\tthis( translateHost( uri.getHost() ), uri.getPort(),\n\t\t\turi.getIntegerTerm( BACKLOG, 0 ) );\n\t}", "public Server(){\r\n //Create a Random object\r\n rand = new Random();\r\n\r\n //Create the GUI\r\n //Text area for displaying console\r\n JTextArea jtaCommandHistory = new JTextArea(35,45);\r\n jtaCommandHistory.setFont(new Font(\"Helvetica\", Font.BOLD, 12));\r\n jtaCommandHistory.setBackground(Color.BLACK);\r\n jtaCommandHistory.setForeground(Color.GREEN);\r\n jtaCommandHistory.setEditable(false);\r\n //Wrap the text area in a JScrollPane\r\n JScrollPane jspCommandHistory = new JScrollPane(jtaCommandHistory);\r\n\r\n //Text field for entering commands\r\n JTextField jtfConsole = new JTextField(15);\r\n\r\n //Binding the Enter key to reset\r\n jtfConsole.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), \"sendMessage\");\r\n jtfConsole.getActionMap().put(\"sendMessage\", new AbstractAction(){\r\n public void actionPerformed(ActionEvent ae){\r\n\r\n //Store the command in history\r\n sbCommandHistory.append(\"\\n\");\r\n sbCommandHistory.append(\">>\");\r\n sbCommandHistory.append(jtfConsole.getText());\r\n sbCommandHistory.append(\"\\n\");\r\n\r\n //Execute the command\r\n parseCommand(jtfConsole.getText());\r\n\r\n //Reset the text field\r\n jtfConsole.setText(\"\");\r\n }\r\n });\r\n add(jspCommandHistory, BorderLayout.CENTER);\r\n add(jtfConsole, BorderLayout.SOUTH);\r\n\r\n //Use a Timer to set the command history area to the StringBuilder text\r\n ActionListener alRefresh = new ActionListener() {\r\n public void actionPerformed(ActionEvent ae) {\r\n jtaCommandHistory.setText(sbCommandHistory.toString());\r\n }\r\n };\r\n javax.swing.Timer timer = new javax.swing.Timer(350, alRefresh);\r\n timer.start();\r\n\r\n //JFrame Initialization\r\n setTitle(\"Portals Server\");\r\n setVisible(true);\r\n setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n setLocationRelativeTo(null);\r\n pack();\r\n\r\n //Creating a GameLogic to serve as the portal layout\r\n GameLogic glLayout = new GameLogic(10, true);\r\n boardLayout = glLayout.getUpdatedBoardInformation();\r\n\r\n //Accept and handle client connections\r\n try {\r\n Socket cs;\r\n ServerSocket ss = new ServerSocket(PORT);\r\n //Print server information\r\n InetAddress ina = InetAddress.getLocalHost();\r\n consoleAppend(\"Host name: \" + ina.getHostName());\r\n consoleAppend(\"IP Address: \" + ina.getHostAddress());\r\n while (true) {\r\n cs = ss.accept();\r\n ClientHandler ct = new ClientHandler(cs);\r\n ct.start();\r\n clientThreads.add(ct);\r\n }\r\n } catch (UnknownHostException uhe) {\r\n System.err.println(\"Could not determine host IP address.\");\r\n uhe.printStackTrace();\r\n } catch (IOException uhe) {\r\n uhe.printStackTrace();\r\n }\r\n }", "public Server(int port) throws IOException{\n\t\tsuper();\n\t\tthis.serversocket= new java.net.ServerSocket(port);\n\t\t\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n topPanel = new javax.swing.JPanel();\n hostLabel = new javax.swing.JLabel();\n portLabel = new javax.swing.JLabel();\n localhostText = new javax.swing.JTextField();\n portChoice = new javax.swing.JComboBox<>();\n connectButton = new javax.swing.JButton();\n middlePanel = new javax.swing.JPanel();\n requestCommand = new javax.swing.JTextField();\n sendButton = new javax.swing.JButton();\n bottomPane = new javax.swing.JPanel();\n scrollTextPane = new javax.swing.JScrollPane();\n terminalText = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Nathan's Client/Server GUI\");\n setMinimumSize(new java.awt.Dimension(610, 550));\n setPreferredSize(new java.awt.Dimension(610, 550));\n\n topPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 0, 0), 8, true), \"CONNECTION\", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP, new java.awt.Font(\"Tahoma\", 1, 11))); // NOI18N\n\n hostLabel.setDisplayedMnemonic('H');\n hostLabel.setLabelFor(localhostText);\n hostLabel.setText(\"Host:\");\n hostLabel.setPreferredSize(new java.awt.Dimension(40, 20));\n\n portLabel.setDisplayedMnemonic('P');\n portLabel.setLabelFor(portChoice);\n portLabel.setText(\"Port:\");\n portLabel.setPreferredSize(new java.awt.Dimension(40, 40));\n\n localhostText.setText(\"localhost\");\n localhostText.setCaretPosition(0);\n localhostText.setMargin(new java.awt.Insets(2, 5, 2, 2));\n localhostText.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n localhostTextActionPerformed(evt);\n }\n });\n\n portChoice.setEditable(true);\n portChoice.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \" \", \"8089\", \"65001\", \"65535\" }));\n portChoice.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n portChoiceFocusGained(evt);\n }\n });\n portChoice.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n portChoiceActionPerformed(evt);\n }\n });\n portChoice.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n portChoiceKeyPressed(evt);\n }\n });\n\n connectButton.setBackground(new java.awt.Color(255, 0, 0));\n connectButton.setMnemonic('c');\n connectButton.setText(\"Connect\");\n connectButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n connectButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel);\n topPanel.setLayout(topPanelLayout);\n topPanelLayout.setHorizontalGroup(\n topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(topPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(topPanelLayout.createSequentialGroup()\n .addComponent(portLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(portChoice, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(connectButton)\n .addContainerGap(124, Short.MAX_VALUE))\n .addGroup(topPanelLayout.createSequentialGroup()\n .addComponent(hostLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(localhostText))))\n );\n\n topPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {connectButton, portChoice});\n\n topPanelLayout.setVerticalGroup(\n topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(topPanelLayout.createSequentialGroup()\n .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(hostLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(localhostText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(portLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(portChoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(connectButton))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n topPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {connectButton, portChoice});\n\n middlePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 255), 8, true), \"CLIENT REQUEST\", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP, new java.awt.Font(\"Tahoma\", 1, 11))); // NOI18N\n\n requestCommand.setText(\"Type a request command\");\n requestCommand.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n requestCommandActionPerformed(evt);\n }\n });\n\n sendButton.setMnemonic('s');\n sendButton.setText(\"Send\");\n sendButton.setEnabled(false);\n sendButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n sendButtonActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout middlePanelLayout = new javax.swing.GroupLayout(middlePanel);\n middlePanel.setLayout(middlePanelLayout);\n middlePanelLayout.setHorizontalGroup(\n middlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(middlePanelLayout.createSequentialGroup()\n .addComponent(requestCommand)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(sendButton))\n );\n middlePanelLayout.setVerticalGroup(\n middlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(middlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(requestCommand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(sendButton))\n );\n\n middlePanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {requestCommand, sendButton});\n\n bottomPane.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 8, true), \"TERMINAL\", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font(\"Tahoma\", 1, 11))); // NOI18N\n\n scrollTextPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);\n\n terminalText.setEditable(false);\n terminalText.setColumns(20);\n terminalText.setRows(5);\n terminalText.setPreferredSize(new java.awt.Dimension(500, 550));\n scrollTextPane.setViewportView(terminalText);\n\n javax.swing.GroupLayout bottomPaneLayout = new javax.swing.GroupLayout(bottomPane);\n bottomPane.setLayout(bottomPaneLayout);\n bottomPaneLayout.setHorizontalGroup(\n bottomPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(scrollTextPane)\n );\n bottomPaneLayout.setVerticalGroup(\n bottomPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(scrollTextPane, javax.swing.GroupLayout.DEFAULT_SIZE, 121, 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 .addComponent(topPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(middlePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(bottomPane, 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(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(middlePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bottomPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public HttpListener(JTabbedPane _notebook, String name, int listenPort, String host,\n int targetPort, String proxyHost, int proxyPort,\n SlowLinkSimulator slowLink, Profile[] profiles, boolean httpsTargetProtool) {\n notebook = _notebook;\n this.mockDataProfiles = profiles;\n if (profiles != null && profiles.length > 0) {\n\n StringBuilder sb = new StringBuilder();\n sb.append(\" [\").append(profiles[0]);\n for (int i = 1; i < profiles.length; i++) {\n sb.append(\",\").append(profiles[i]);\n }\n sb.append(\"]\");\n profileNames = sb.toString();\n } else {\n profileNames = \"\";\n }\n\n if (name == null) {\n name = \"HTTP Port \" + listenPort;\n }\n\n // proxy\n HTTPProxyHost = proxyHost;\n HTTPProxyPort = proxyPort;\n\n // set the slow link to the passed down link\n if (slowLink != null) {\n this.slowLink = slowLink;\n } else {\n\n // or make up a no-op one.\n this.slowLink = new SlowLinkSimulator(0, 0);\n }\n this.setLayout(new BorderLayout());\n\n // 1st component is just a row of labels and 1-line entry fields\n // ///////////////////////////////////////////////////////////////////\n JPanel topControls = new JPanel();\n topControls.setLayout(new BoxLayout(topControls, BoxLayout.X_AXIS));\n topControls.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\n final String start = \"Start\";\n topControls.add(stopButton = new JButton(start));\n topControls.add(Box.createRigidArea(new Dimension(5, 0)));\n topControls.add(new JLabel(\" \" + \"Listen Port:\" + \" \", SwingConstants.RIGHT));\n topControls.add(portField = new JTextField(\"\" + listenPort, 4));\n portField.setMinimumSize(new Dimension(50, 10));\n topControls.add(new JLabel(\" \" + \"Host:\", SwingConstants.RIGHT));\n topControls.add(hostField = new JTextField(host, 30));\n hostField.setMinimumSize(new Dimension(110, 10));\n topControls.add(new JLabel(\" \" + \"Port:\" + \" \", SwingConstants.RIGHT));\n topControls.add(tPortField = new JTextField(\"\" + targetPort, 4));\n tPortField.setMinimumSize(new Dimension(50, 10));\n\n useProfilesCheckBox = new JCheckBox(\"Use Profiles\");\n useProfilesCheckBox.setSelected(profiles != null && profiles.length != 0);\n useProfilesCheckBox.setEnabled(false);\n topControls.add(useProfilesCheckBox);\n\n httpsTarget = new JCheckBox(\"HTTPS-Target\");\n httpsTarget.setSelected(httpsTargetProtool);\n httpsTarget.setEnabled(false);\n topControls.add(httpsTarget);\n\n cloneHostHeader = new JCheckBox(\"Clone Host Header\");\n topControls.add(cloneHostHeader);\n\n if (HTTPProxyHost != null) {\n useProxy = new JCheckBox(\"Use Proxy: \" + HTTPProxyHost + \":\" + proxyPort);\n useProxy.setSelected(HTTPProxyHost != null);\n topControls.add(useProxy);\n }\n\n portField.setEditable(false);\n portField.setMaximumSize(new Dimension(50, Short.MAX_VALUE));\n hostField.setEditable(false);\n hostField.setMaximumSize(new Dimension(85, Short.MAX_VALUE));\n tPortField.setEditable(false);\n tPortField.setMaximumSize(new Dimension(50, Short.MAX_VALUE));\n stopButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n if (\"Stop\".equals(event.getActionCommand())) {\n stop();\n }\n if (start.equals(event.getActionCommand())) {\n start();\n }\n }\n });\n\n JPanel top = new JPanel(new BorderLayout());\n top.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\n top.add(new JLabel(\"<html><b>Profiles: \" + profileNames + \"</b></html>\"),\n BorderLayout.NORTH);\n top.add(topControls, BorderLayout.CENTER);\n\n this.add(top, BorderLayout.NORTH);\n\n // 2nd component is a split pane with a table on the top\n // and the request/response text areas on the bottom\n // ///////////////////////////////////////////////////////////////////\n tableModel = new HttpConnectionTableModel();\n connectionTable = new JTable();\n connectionTable.setModel(tableModel);\n connectionTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n connectionTable.getColumnModel().getColumn(0).setCellRenderer(new ConnectionCellRenderer());\n\n // Reduce the STATE column and increase the REQ column\n TableColumn col;\n col = connectionTable.getColumnModel().getColumn(Main.STATE_COLUMN);\n col.setPreferredWidth(col.getPreferredWidth() / 2);\n col = connectionTable.getColumnModel().getColumn(Main.REQ_COLUMN);\n col.setPreferredWidth(col.getPreferredWidth() * 2);\n ListSelectionModel sel = connectionTable.getSelectionModel();\n sel.addListSelectionListener(new ListSelectionListener() {\n public void valueChanged(ListSelectionEvent event) {\n if (event.getValueIsAdjusting()) {\n return;\n }\n ListSelectionModel m = (ListSelectionModel) event.getSource();\n int divLoc = outPane.getDividerLocation();\n if (m.isSelectionEmpty()) {\n setLeft(new JLabel(\" Waiting for Connection...\"));\n setRight(null);\n removeButton.setEnabled(false);\n removeAllButton.setEnabled(false);\n saveButton.setEnabled(false);\n saveToClipboardButton.setEnabled(false);\n addToProfileButton.setEnabled(false);\n profileComboBox.setEnabled(false);\n } else {\n int row = connectionTable.getSelectedRow();\n if (row == 0) {\n if (tableModel.size() == 0) {\n setLeft(new JLabel(\" Waiting for connection...\"));\n setRight(null);\n removeButton.setEnabled(false);\n removeAllButton.setEnabled(false);\n saveButton.setEnabled(false);\n saveToClipboardButton.setEnabled(false);\n profileComboBox.setEnabled(false);\n addToProfileButton.setEnabled(false);\n } else {\n HttpConnection conn = tableModel.lastConnection();\n\n formatJsonIfNeeded(conn);\n setLeft(conn.inputScroll);\n setRight(conn.outputScroll);\n removeButton.setEnabled(false);\n removeAllButton.setEnabled(true);\n saveButton.setEnabled(true);\n saveToClipboardButton.setEnabled(true);\n profileComboBox.setEnabled(true);\n addToProfileButton.setEnabled(true);\n }\n } else {\n HttpConnection conn = tableModel.getConnectionByRow(row);\n\n formatJsonIfNeeded(conn);\n setLeft(conn.inputScroll);\n setRight(conn.outputScroll);\n removeButton.setEnabled(true);\n removeAllButton.setEnabled(true);\n saveButton.setEnabled(true);\n saveToClipboardButton.setEnabled(true);\n profileComboBox.setEnabled(true);\n addToProfileButton.setEnabled(true);\n }\n }\n outPane.setDividerLocation(divLoc);\n }\n });\n JPanel tablePane = new JPanel();\n tablePane.setLayout(new BorderLayout());\n JScrollPane tableScrollPane = new JScrollPane();\n tableScrollPane.setViewportView(connectionTable);\n tablePane.add(tableScrollPane, BorderLayout.CENTER);\n JPanel buttons = new JPanel();\n buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));\n buttons.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\n final String removeSelected = \"Remove Selected\";\n buttons.add(removeButton = new JButton(removeSelected));\n buttons.add(Box.createRigidArea(new Dimension(5, 0)));\n final String removeAll = \"Remove All\";\n buttons.add(removeAllButton = new JButton(removeAll));\n tablePane.add(buttons, BorderLayout.SOUTH);\n removeButton.setEnabled(false);\n removeButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n if (removeSelected.equals(event.getActionCommand())) {\n remove();\n }\n }\n });\n removeAllButton.setEnabled(false);\n removeAllButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n if (removeAll.equals(event.getActionCommand())) {\n removeAll();\n }\n }\n });\n\n // Add Response Section\n // ///////////////////////////////////////////////////////////////////\n JPanel pane2 = new JPanel();\n pane2.setLayout(new BorderLayout());\n leftPanel = new JPanel();\n leftPanel.setAlignmentX(Component.LEFT_ALIGNMENT);\n leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));\n leftPanel.add(new JLabel(\" \" + \"Request\"));\n leftPanel.add(new JLabel(\" \" + \"Waiting for connection\"));\n rightPanel = new JPanel();\n rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));\n rightPanel.add(new JLabel(\" \" + \"Response\"));\n rightPanel.add(new JLabel(\"\"));\n outPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel);\n outPane.setDividerSize(4);\n outPane.setResizeWeight(0.5);\n pane2.add(outPane, BorderLayout.CENTER);\n JPanel bottomButtons = new JPanel();\n bottomButtons.setLayout(new BoxLayout(bottomButtons, BoxLayout.X_AXIS));\n bottomButtons.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\n bottomButtons.add(jsonFormatBox = new JCheckBox(\"JSON Format\"));\n bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));\n final String save = \"Save\";\n bottomButtons.add(saveButton = new JButton(save));\n bottomButtons.add(saveToClipboardButton = new JButton(\"Save to clipboard\"));\n bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));\n final String addToProfile = \"Add to Profile\";\n bottomButtons.add(addToProfileButton = new JButton(addToProfile));\n bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));\n bottomButtons.add(profileComboBox = new JComboBox(createProfileListData()));\n bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));\n final String resend = \"Resend\";\n bottomButtons.add(resendButton = new JButton(resend));\n bottomButtons.add(Box.createHorizontalGlue());\n final String switchStr = \"Switch Layout\";\n bottomButtons.add(switchButton = new JButton(switchStr));\n bottomButtons.add(Box.createRigidArea(new Dimension(5, 0)));\n final String close = \"Close\";\n bottomButtons.add(closeButton = new JButton(close));\n pane2.add(bottomButtons, BorderLayout.SOUTH);\n\n jsonFormatBox.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n ListSelectionModel lsm = connectionTable.getSelectionModel();\n int row = lsm.getLeadSelectionIndex();\n if (row != -1 && tableModel.size() != 0) {\n HttpConnection conn = null;\n if (row == 0) {\n // recent\n conn = tableModel.lastConnection();\n } else {\n conn = tableModel.getConnectionByRow(row);\n }\n formatJsonIfNeeded(conn);\n }\n }\n });\n\n saveButton.setEnabled(false);\n saveButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n save();\n }\n });\n saveToClipboardButton.setEnabled(false);\n saveToClipboardButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n saveToClipboard();\n }\n });\n addToProfileButton.setEnabled(false);\n addToProfileButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n addToProfile();\n }\n });\n resendButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n resend();\n }\n });\n switchButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n int v = outPane.getOrientation();\n if (v == JSplitPane.VERTICAL_SPLIT) {\n // top/bottom\n outPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n } else {\n // left/right\n outPane.setOrientation(JSplitPane.VERTICAL_SPLIT);\n }\n outPane.setDividerLocation(0.5);\n }\n });\n ActionListener closeActionListener = new ActionListener() {\n public void actionPerformed(ActionEvent event) {\n close();\n }\n };\n closeButton.addActionListener(closeActionListener);\n JSplitPane pane1 = new JSplitPane(0);\n pane1.setDividerSize(4);\n pane1.setTopComponent(tablePane);\n pane1.setBottomComponent(pane2);\n pane1.setDividerLocation(150);\n pane1.setResizeWeight(0.5);\n this.add(pane1, BorderLayout.CENTER);\n\n // \n // //////////////////////////////////////////////////////////////////\n sel.setSelectionInterval(0, 0);\n notebook.addTab(name, null, this, profileNames);\n\n closeTab = new ClosableTabComponent(notebook, name, closeActionListener);\n notebook.setTabComponentAt(notebook.getTabCount() - 1, closeTab);\n start();\n }", "public GalileoConnector(String serverHostName, int serverPort) throws IOException {\r\n\t\tsuper(serverHostName, serverPort);\r\n\t}", "Builder port(int port);", "public static void CreateClient(int port, String ip, String inname, String incolor){\n Client charlie = new Client(port, ip);\n charlie.clientName = inname;\n charlie.outhexColor = incolor; \n //charlie.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n charlie.startRunning(port);\n }", "@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }", "public Client (String name, String ipAdresse, int port) {\n\t\tthis.setDaemon(true);\n\t\tthis.name = name;\n\t\tthis.ipAdresse = ipAdresse;\n\t\tthis.port = port;\n\t\tstart();\n\t}", "private void init() throws IOException {\r\n\t\tschermata = new JTabbedPane();\r\n\t\tInetAddress addr = InetAddress.getByName(ip); // ip\r\n\t\tSocket socket = new Socket(addr, port); // Port\r\n\t\tout = new ObjectOutputStream(socket.getOutputStream());\r\n\t\tin = new ObjectInputStream(socket.getInputStream());\r\n\t\t// stream con richieste del client\r\n\t\tiniziale.addWindowListener(new WindowAdapter() {\r\n\t\t\tpublic void windowClosing(WindowEvent ev) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t}\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\tiniziale.add(schermata);\r\n\r\n\t}", "public static void main(String args[]) {\n\t\tif (args.length == 1)\n\t\t\tport = Integer.parseInt(args[0]);\n\t\tnew calculatorserver();\n\t}", "public SocketIO(int port) throws UnknownHostException, IOException\n\t{\n\t\tthis((new ServerSocket(port)).accept());\n\t}", "public PingServer(int port, int noOfClients) {\n\t\tthis.port = port;\n\t\tthis.noOfClients = noOfClients;\n\t}", "public Client(String h, int p) {\n\t\thost = h;\n\t\tport = p;\n\t}", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public static void main(String[] args) throws IOException \n {\t \n\tScanner scannerIn = new Scanner(System.in);\n\tSystem.out.print(\"Please enter port number for the Chat Server to run on : \");\n\tint port = scannerIn.nextInt();\n\t//starts new ChatServer\n\tChatServer cs = new ChatServer(port);\n }", "public TCPRequest(String host, int port) {\n this.host = host;\n this.port = port;\n try {\n this.clientSock = new Socket(this.host, this.port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TcpListener( String uri, Resources resources )\n\t{\n\t\tthis( new URL( uri ), resources );\n\t}", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public void startServer() {\n System.out.println(\"Inicie\");\n httpServer = new HttpServer();\n httpServer.registerProessor(\"/App\", this);\n try {\n httpServer.start();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public GameHandler(int serverPort, String ip, int caseNr, String hostName) {\n\t\tthis.serverPort = serverPort;\n\t\tthis.hostName = hostName;\n\t\tthis.caseNr = caseNr;\n\t\tthis.ip = ip;\n\t\t\n\t\texecutorService = Executors.newFixedThreadPool(1); // Lager et pool av threads for bruk\n\t\t\n\t\tconnect();\n\t\tcreateNewLobby();\n\t}", "public ClientMenu(String host, int port, Client c) {\n\n\t\tsuper(\"Chat Client\");\n\t\tdefaultPort = port;\n\t\tdefaultHost = host;\n\t\tclient = c;\n\n\t\t// The NorthPanel with:\n\t\tJPanel northPanel = new JPanel(new GridLayout(3, 1));\n\t\t// the server name and the port number\n\t\tJPanel serverAndPort = new JPanel(new GridLayout(1, 5, 1, 3));\n\t\t// the two JTextField with default value for server address and port number\n\t\ttfServer = new JTextField(host);\n\t\ttfPort = new JTextField(\"\" + port);\n\t\ttfPort.setHorizontalAlignment(SwingConstants.RIGHT);\n\n\t\tserverAndPort.add(new JLabel(\"Server Address: \"));\n\t\tserverAndPort.add(tfServer);\n\t\tserverAndPort.add(new JLabel(\"Port Number: \"));\n\t\tserverAndPort.add(tfPort);\n\t\t// serverAndPort.add(new JLabel(\"\"));\n\t\t// adds the Server an port field to the GUI\n\t\t// northPanel.add(serverAndPort);\n\n\t\t// the Label and the TextField\n\t\tlabel = new JLabel(\"Username:\", SwingConstants.CENTER);\n\t\tserverAndPort.add(label);\n\t\tun = new JTextField(\"Anonymous\");\n\t\ttf = new JTextField(\"\");\n\t\ttf.setBackground(Color.WHITE);\n\t\tun.setBackground(Color.WHITE);\n\t\tserverAndPort.add(un);\n\t\tnorthPanel.add(serverAndPort);\n\n\t\tadd(northPanel, BorderLayout.NORTH);\n\n\t\t// The CenterPanel which is the chat room\n\t\tta = new JTextArea(\"Welcome to the Chat room\\n\", 80, 80);\n\t\tJPanel centerPanel = new JPanel(new GridLayout(1, 1));\n\t\tcenterPanel.add(new JScrollPane(ta));\n\t\tta.setEditable(false);\n\t\tadd(centerPanel, BorderLayout.CENTER);\n\n\t\t// the 3 buttons\n\t\tlogin = new JButton(\"Connect\");\n\t\tlogin.setActionCommand(\"Connect\");\n\t\tlogin.addActionListener(this);\n\t\tsend = new JButton(\"Send\");\n\t\tsend.setActionCommand(\"Send\");\n\t\tsend.addActionListener(this);\n\t\t// logout = new JButton(\"Logout\");\n\t\t// logout.addActionListener(this);\n\t\t// logout.setEnabled(false); // you have to login before being able to logout\n\n\t\tJPanel southPanel = new JPanel(new GridLayout(1, 3, 5, 5));\n\t\tserverAndPort.add(login);\n\t\t// southPanel.add(logout);\n\t\tsouthPanel.add(tf);\n\t\tsouthPanel.add(send);\n\t\tadd(southPanel, BorderLayout.SOUTH);\n\n\t\tuserListModel = new DefaultListModel<String>();\n\t\tuserList = new JList<String>(userListModel);\n\t\tuserList.setPreferredSize(new Dimension(100, 400));\n\t\tuserList.addListSelectionListener(this);\n\t\tusers_label = new JLabel(\"Users:\");\n\n\t\tJPanel eastPanel = new JPanel();\n\t\teastPanel.setPreferredSize(new Dimension(100, 50));\n\t\tusers_label.setPreferredSize(new Dimension(100, 20));\n\t\teastPanel.add(users_label);\n\t\teastPanel.add(userList);\n\t\tadd(eastPanel, BorderLayout.EAST);\n\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tsetSize(600, 600);\n\t\tsetVisible(true);\n\t\ttf.requestFocus();\n\n\t}", "public ListenerInterface(String a_hostname, int a_port) throws IllegalArgumentException\n\t{\n\t\tthis(a_hostname, a_port, PROTOCOL_TYPE_HTTP);\n\t}", "public static void main(String[] args) throws IOException, URISyntaxException {\n try {\r\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n } catch (Exception e) { \r\n \tSystem.out.println(\"algo no jalo\"); \t\r\n }\r\n\t\t\r\n \tHost host=new Host();\r\n \t \t \t\r\n \thttpServer = HttpServer.create(new InetSocketAddress(puerto), 0);\r\n \t\r\n \thttpServer.createContext(\"/\", new Principal());\t\t//esta es la pagina principal\r\n \thttpServer.createContext(\"/apagado\", new Apagado());\r\n \thttpServer.createContext(\"/descarga\", new Descarga());// llama a la pagina como video1.mp4\r\n \thttpServer.createContext(\"/openFileDialog\", new OpenFileDialog());\r\n \r\n \thttpServer.setExecutor(null);\r\n \thttpServer.start();\r\n \t\r\n\r\n \thost.abreLocalHost();\r\n \thost.cargaGPIO();\r\n\t}", "public ServerWindow(Server server) {\n initComponents();\n this.server = server;\n this.runServer();\n }", "public Server() {\n initComponents();\n\n btnStart.setEnabled(true);\n btnStop.setEnabled(false);\n }", "public KKServerGui(){\n\t\t\n\t\tsuper(\"Knock Knock Server\");\n\t\t\t\t\n\t\tloadData();\n\t\torganizeUI();\n\t\taddListeners();\n\t\t\t\n\t\tsetDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);\n\t}", "private void handlePort(String args) {\n // Extract IP address and port number from arguments\n String[] stringSplit = args.split(\",\");\n String hostName = stringSplit[0] + \".\" + stringSplit[1] + \".\" + stringSplit[2] + \".\" + stringSplit[3];\n\n int p = Integer.parseInt(stringSplit[4]) * 256 + Integer.parseInt(stringSplit[5]);\n\n // Initiate data connection to client\n openDataConnectionActive(hostName, p);\n sendMsgToClient(\"200 Command OK\");\n }" ]
[ "0.7486398", "0.7242464", "0.7168939", "0.7105168", "0.70962816", "0.7052893", "0.70490235", "0.6956323", "0.6951405", "0.69026124", "0.6776807", "0.6752473", "0.6750617", "0.6716254", "0.67092913", "0.670435", "0.6700157", "0.6692274", "0.66901857", "0.6675268", "0.6670789", "0.66636264", "0.6660269", "0.6659889", "0.66595286", "0.66578144", "0.66500574", "0.66369116", "0.66340643", "0.6628569", "0.66241014", "0.66104347", "0.6608075", "0.6589854", "0.6557871", "0.655141", "0.6549306", "0.6531038", "0.6516909", "0.6509884", "0.6500541", "0.6500541", "0.64904356", "0.64786935", "0.64778256", "0.6456167", "0.6447512", "0.6423611", "0.6414389", "0.6413993", "0.64108324", "0.6408705", "0.64068586", "0.64060897", "0.6403961", "0.6401375", "0.6401375", "0.6389747", "0.6388144", "0.6373034", "0.6367987", "0.63674796", "0.63572234", "0.6327112", "0.6326122", "0.63176405", "0.63086045", "0.6278637", "0.6275313", "0.6272129", "0.62643903", "0.62638956", "0.62636024", "0.6236435", "0.62152404", "0.62149376", "0.62057537", "0.6188131", "0.61871177", "0.61850035", "0.6182421", "0.6181665", "0.6178063", "0.61628556", "0.6152088", "0.6144602", "0.61391324", "0.61389863", "0.61387825", "0.61387557", "0.6135897", "0.6124103", "0.6122387", "0.61180586", "0.61129445", "0.6112933", "0.61116844", "0.6104007", "0.6102337", "0.610151" ]
0.72040874
2
an alias to avoid typing so much!
private void s(String s2) { System.out.println(s2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "T as(String alias);", "public interface Aliasable<T> {\n\n /**\n * Alias the instance with the given valid name.\n *\n * @param alias name\n * @return type after aliasing\n */\n T as(String alias);\n\n /**\n * @return the current alias name.\n */\n String aliasName();\n}", "protected Alias() {\n }", "AliasVariable createAliasVariable();", "@Override\n\tpublic String alias() {\n\t\treturn toString();\n\t}", "protected Object needsAnAlias(Object original)\n {\n return JMXObjectNameFix.needsAnAlias(original);\n }", "public String getAlias();", "public String getAlias();", "public static void mayAlias(Object a, Object b) {\n\t}", "public static void notAlias(Object a, Object b) {\n\t}", "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 }", "@Override\n public void setAlias(String alias) {\n throw new UnsupportedOperationException(\"View doesn't support alias\");\n }", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "public void leerAlimentos();", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "public void setAlias(String alias);", "public abstract Object mo26777y();", "public interface Layout extends Alias {\n}", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "Aliasing getVariable();", "public interface C2368d {\n\n /* renamed from: com.google.android.exoplayer2.upstream.d$a */\n public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }\n\n /* renamed from: a */\n int mo1684a(byte[] bArr, int i, int i2);\n\n /* renamed from: a */\n long mo1685a(C2369e c2369e);\n\n /* renamed from: a */\n Uri mo1686a();\n\n /* renamed from: b */\n void mo1687b();\n}", "public interface C15428f {\n\n /* renamed from: com.ss.android.ugc.asve.context.f$a */\n public static final class C15429a {\n /* renamed from: a */\n public static String m45146a(C15428f fVar) {\n return \"\";\n }\n\n /* renamed from: b */\n public static String m45147b(C15428f fVar) {\n return \"\";\n }\n }\n\n /* renamed from: a */\n boolean mo38970a();\n\n /* renamed from: b */\n String mo38971b();\n\n /* renamed from: c */\n String mo38972c();\n\n /* renamed from: d */\n int mo38973d();\n\n /* renamed from: e */\n int mo38974e();\n}", "interface C23413e {\n /* renamed from: a */\n void mo60902a(AvatarImageWithVerify avatarImageWithVerify);\n\n /* renamed from: a */\n boolean mo60903a(AvatarImageWithVerify avatarImageWithVerify, UserVerify userVerify);\n\n /* renamed from: b */\n void mo60904b(AvatarImageWithVerify avatarImageWithVerify);\n }", "private AliasAction() {\n\n\t}", "public interface AnonymousClass1Kl {\n public static final AnonymousClass1Kl A00 = new AnonymousClass1Kj(new AnonymousClass1Km().A00);\n @Deprecated\n public static final AnonymousClass1Kl A01 = new AnonymousClass1Kn();\n\n Map<String, String> A43();\n}", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "@Override\n\tpublic void jugar() {}", "String getDefaultAlias();", "public abstract Object mo1771a();", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public abstract String use();", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }", "public void setAlias(String newAlias) {\n alias = newAlias;\n }", "public interface C2836e {\n /* renamed from: a */\n InputStream mo1151a();\n\n /* renamed from: b */\n String mo1152b();\n\n /* renamed from: c */\n String[] mo1153c();\n\n /* renamed from: d */\n long mo1154d();\n}", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public void setAlias(String alias)\n {\n this.alias = alias;\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "@Override\n public Collection<GenericName> getAlias() {\n return Collections.emptyList();\n }", "public interface C1481i {\n /* renamed from: a */\n Bitmap mo6659a(Context context, String str, C1492a aVar);\n\n /* renamed from: a */\n void mo6660a(Context context, String str, ImageView imageView, C1492a aVar);\n\n /* renamed from: a */\n void mo6661a(boolean z);\n}", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public void reuse() {}", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface C7292c {\n /* renamed from: a */\n <T> T mo19025a(Object obj, Class<T> cls);\n }", "public interface C39683a {\n /* renamed from: a */\n int mo98966a(C29296g gVar);\n\n /* renamed from: b */\n int mo98967b(C29296g gVar);\n\n /* renamed from: c */\n float mo98968c(C29296g gVar);\n }", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface SrollingCallBack {\n /* renamed from: e */\n float mo106363e();\n\n /* renamed from: f */\n float mo106364f();\n\n /* renamed from: g */\n boolean mo106365g();\n\n /* renamed from: h */\n ProfileViewPager mo106366h();\n\n /* renamed from: i */\n ViewGroup mo106367i();\n}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public void setAlias(com.flexnet.opsembedded.webservices.SimpleQueryType alias) {\n this.alias = alias;\n }", "public interface C0025k {\n /* renamed from: a */\n long mo49a();\n}", "public abstract void mo27464a();", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public String getAlias() {\n return alias;\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C1590a {\n /* renamed from: a */\n Bitmap m7900a(Bitmap bitmap);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface AbstractC33066a {\n /* renamed from: a */\n long mo133613a();\n }", "public interface C1656t {\n /* renamed from: a */\n void mo7350a();\n\n /* renamed from: a */\n void mo7351a(C1655s sVar);\n\n /* renamed from: a */\n void mo7352a(C1655s sVar, AdError adError);\n\n /* renamed from: b */\n void mo7353b();\n\n /* renamed from: b */\n void mo7354b(C1655s sVar);\n\n /* renamed from: c */\n void mo7355c(C1655s sVar);\n\n /* renamed from: d */\n void mo7356d(C1655s sVar);\n\n /* renamed from: e */\n void mo7357e(C1655s sVar);\n\n /* renamed from: f */\n void mo7358f(C1655s sVar);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public abstract void mo27386d();", "void use();", "public interface C9326f extends C8877c<C9330i, C9331j, C9327g> {\n /* renamed from: a */\n void mo24142a(long j);\n}", "public interface C2331r<T> {\n /* renamed from: g */\n Bundle mo7259g();\n}", "public interface IItemHelper {\n /* renamed from: a */\n void mo66998a(int i);\n\n /* renamed from: a */\n void mo66999a(int i, int i2);\n}", "public abstract void mo30696a();", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "public interface C46870h {\n /* renamed from: a */\n long mo117970a();\n}", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C11962p<T> {\n /* renamed from: a */\n void mo30271a(C11961o<T> oVar) throws Exception;\n}", "public interface C39682m {\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$a */\n public interface C39683a {\n /* renamed from: a */\n int mo98966a(C29296g gVar);\n\n /* renamed from: b */\n int mo98967b(C29296g gVar);\n\n /* renamed from: c */\n float mo98968c(C29296g gVar);\n }\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$b */\n public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }\n}", "public void setAlias(String alias) {\r\n\t\tthis.alias = alias;\r\n\t}", "public interface C5738d<ViewState> {\n /* renamed from: a */\n void mo17615a(ViewState viewstate);\n}", "public interface C1803l extends C1813t {\n /* renamed from: b */\n C1803l mo7382b(C2778au auVar);\n\n /* renamed from: f */\n List<C1700ar> mo7233f();\n\n /* renamed from: g */\n C2841w mo7234g();\n\n /* renamed from: q */\n C1800i mo7384q();\n}", "public abstract void mo56925d();", "public interface C48855s {\n\n /* renamed from: a */\n public static final C48856a f124209a = C48856a.f124210a;\n\n /* renamed from: shark.s$a */\n public static final class C48856a {\n\n /* renamed from: a */\n static final /* synthetic */ C48856a f124210a = new C48856a();\n\n private C48856a() {\n }\n }\n\n /* renamed from: a */\n void mo123342a(C48857t tVar);\n}", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public abstract void mo42331g();", "@VisibleForTesting\n protected static String quoteAlias(String alias) {\n return String.format(\"`%s`\", alias);\n }", "public interface C5728f {\n /* renamed from: a */\n int mo33223a(C5889d dVar) throws IOException;\n\n /* renamed from: a */\n C5727e mo33224a();\n\n @Deprecated\n /* renamed from: a */\n boolean mo33287a(int i) throws IOException;\n\n int read() throws IOException;\n\n int read(byte[] bArr, int i, int i2) throws IOException;\n}", "public interface C0219dm {\n /* renamed from: b */\n <S extends C0218dl> S mo283b();\n}", "@Override\r\n\tpublic void cast() {\n\r\n\t}" ]
[ "0.6273069", "0.6206145", "0.61838454", "0.61194825", "0.5801689", "0.5740809", "0.5718309", "0.5718309", "0.5670489", "0.5645043", "0.5637926", "0.5632933", "0.5603434", "0.5597475", "0.5574748", "0.5572059", "0.55560744", "0.5549178", "0.55438846", "0.5543175", "0.55054253", "0.54975164", "0.5484311", "0.5472763", "0.54575425", "0.5431204", "0.5422081", "0.5421992", "0.54082805", "0.5408092", "0.53916574", "0.5388228", "0.53869677", "0.53860366", "0.5379113", "0.5373991", "0.5369263", "0.5363028", "0.5362186", "0.5358919", "0.5356359", "0.53537524", "0.53532493", "0.5353098", "0.53483874", "0.5340032", "0.5331986", "0.53174174", "0.5315039", "0.5314741", "0.53113294", "0.5305131", "0.5303173", "0.5302944", "0.53016055", "0.5298433", "0.5281171", "0.5279169", "0.5275537", "0.5274529", "0.5274529", "0.5274529", "0.5274503", "0.5269492", "0.52653784", "0.52617645", "0.5260339", "0.52552485", "0.52536744", "0.5249532", "0.5247753", "0.52474546", "0.5246726", "0.52414024", "0.52354765", "0.52293444", "0.5223286", "0.5221536", "0.52206796", "0.5219242", "0.5214923", "0.52137566", "0.5212057", "0.52057856", "0.52051544", "0.5203149", "0.52009", "0.52004594", "0.5195626", "0.5186224", "0.5185197", "0.51839507", "0.51796305", "0.5179138", "0.5176509", "0.5176509", "0.5174596", "0.517276", "0.51725876", "0.5171523", "0.5171212" ]
0.0
-1
port we are going to listen to this is a overridden method from the Thread class we extended from
public void run() { //we are now inside our own thread separated from the gui. ServerSocket serversocket = null; //Pay attention, this is where things starts to cook! try { //print/send message to the guiwindow s("Trying to bind to localhost on port " + Integer.toString(port) + "..."); //make a ServerSocket and bind it to given port, serversocket = new ServerSocket(port); } catch (Exception e) { //catch any errors and print errors to gui s("\nFatal Error:" + e.getMessage()); return; } //go in a infinite loop, wait for connections, process request, send response while (true) { s("\nReady, Waiting for requests...\n"); try { //this call waits/blocks until someone connects to the port we //are listening to Socket connectionsocket = serversocket.accept(); //figure out what ipaddress the client commes from, just for show! InetAddress client = connectionsocket.getInetAddress(); //and print it to gui s(client.getHostName() + " connected to server.\n"); //Read the http request from the client from the socket interface //into a buffer. BufferedReader input = new BufferedReader(new InputStreamReader(connectionsocket.getInputStream())); //Prepare a outputstream from us to the client, //this will be used sending back our response //(header + requested file) to the client. DataOutputStream output = new DataOutputStream(connectionsocket.getOutputStream()); //as the name suggest this method handles the http request, see further down. //abstraction rules http_handler(input, output); } catch (Exception e) { //catch any errors, and print them s("\nError:" + e.getMessage()); } } //go back in loop, wait for next request }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void StartListening()\n\t{\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlisten();\n\t\t\t\t}", "void onListeningStarted();", "private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }", "public void startListening();", "@Override\n public void socket() {\n }", "@Override\n public void threadStarted() {\n }", "private void newListener() {\n (new Thread(this)).start();\n }", "protected abstract void startListener();", "public void listen() {\n DeviceManager cpuUsage = new CPUUsageManager();\n cpuUsage.printStatus();\n \n }", "@Override\n protected void runInListenerThread(Runnable runnable) {\n runnable.run();\n }", "void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }", "public void ListenThread() \n {\n Thread t = new Thread(new IncomingReader(writer, reader));\n t.start();\n \n }", "@Override\n\tpublic void run() {\n\t\tLog.i(\"here\",\"listener\");\n\t\twhile(true){\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif((cs=s.accept())!=null)new Thread(new Worker(context,cs)).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n }", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\tThread thisThread = currentThread();\n\t\t\ttry {\n\t\t\t\tLog.i(\"con\", \"worked3\");\n\t\t\t\tconnectToServer();\n\t\t\t\tif (connected) {\n\t\t\t\t\tsetUpStreams();\n\t\t\t\t\tsendProfile();\n\t\t\t\t\tLog.i(\"con\", \"worked8\");\n\t\t\t\t\twhile (blinker == thisThread) {\n\t\t\t\t\t\tstartListening();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found IO Exception!: \" + e);\n\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLog.e(\"cl\", \"Found class not found exception!: \" + e);\n\t\t\t}\n\n\t\t}", "public void listen() throws IOException {\n listen(Thread.currentThread());\n }", "void watchListenerData(int port, ListenerWatcher watcher) {\n }", "@MainThread\n void onChannelScanStarted();", "void onListeningFinished();", "private void createAndListen() {\n\n\t\t\n\t}", "private void listen() {\n //Grap port/ip from UI\n String ip = m_ipField.getText().trim();\n try {\n ip = InetAddress.getByName(ip).getHostAddress(); //Validate IP Address\n } catch (UnknownHostException ex) {\n Logger.getLogger(StreamRecorderDisplay.class.getName()).log(Level.SEVERE, \"Poorly formatted IP Address: \" + m_ipField.getText(), ex);\n }\n int port = Integer.valueOf(m_portField.getText().trim());\n\n //Start detector\n m_dataDetector = new MulticastDataDetector(ip, port);\n m_dataDetector.addMulticastDataDetectionListener(this);\n new Thread(m_dataDetector).start();\n }", "public void onEvent(TCPReceiverThread receiverThread, Event event) throws IOException;", "Move listen(IListener ll);", "@Override\n\tpublic void onMessageBackgroundThread(Object arg0) {\n\t\t\n\t}", "public abstract void Listen() throws TransportLayerException;", "public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }", "public void startListening() {\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread: \" + mAcceptThread);\n }\n\n // Start the AcceptThread which listens for incoming connection requests\n if (mAcceptThread == null) {\n mAcceptThread = new AcceptThread(mContext, mHandler, services, this);\n }\n\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread.isAlive(): \" + mAcceptThread.isAlive());\n }\n\n if (!mAcceptThread.isAlive()) {\n mAcceptThread.start();\n }\n }", "public abstract void stream(int port);", "NetThread(){}", "private void ccListenerStarter(){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t//spin off new ccListener\n\t\t\t\t\n\t\t\t\tThread listenerThread = new Thread(\n\t\t\t\t\t\tnew ClientCommunicatorListener(\n\t\t\t\t\t\t\t\tccSocket.getInputStream(), db, this));\n\t\t\t\t\n\t\t\t\tlistenerThread.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n\tpublic void listenerStarted(ConnectionListenerEvent evt) {\n\t\t\n\t}", "public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}", "public void startListeningForConnection() {\n startInsecureListeningThread();\n }", "@Override\r\n\tpublic void start(Socket socket){}", "@Override\n\tvoid ioStarting()\n\t{\n\t\tif (Thread.currentThread() != this.mostRecentThread)\n\t\t{\n\t\t\tthis.mostRecentThread = Thread.currentThread();\n\t\t\tregisterThreadIsUsingSocket(this);\n\t\t}\n\t}", "@Override\r\n\tpublic void run() {\n\t boolean listen = true;\r\n\t while (listen) {\r\n\t\ttry {\r\n\t\t Socket socket = listeningSocket.accept();\r\n\t\t Thread ConnThread = new Thread (new Connection (socket, pid));\r\n\t\t ConnThread.start();\r\n\t\t connThreads.add(ConnThread);\r\n\t\t \r\n\t\t} catch (SocketException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t listen = false;\r\n\t\t} catch (Exception e) {\r\n\t\t System.err.println(\"Random exception\");\r\n\t\t}\r\n\t }\r\n\t}", "protected void listen(int backlog) throws IOException {\n return;\n }", "public interface PacketChannelListener\r\n{\r\n\r\n /**\r\n * Called when a packet is fully reassembled.\r\n *\r\n * @param pc The source of the event.\r\n * @param pckt The reassembled packet\r\n */\r\n public void packetArrived(PacketChannel pc, ByteBuffer pckt) throws InterruptedException;\r\n\r\n /**\r\n * Called when some error occurs while reading or writing to the socket.\r\n *\r\n * @param pc The source of the event.\r\n * @param ex The exception representing the error.\r\n */\r\n public void socketException(PacketChannel pc, Exception ex);\r\n\r\n /**\r\n * Called when the read operation reaches the end of stream. This means that\r\n * the socket was closed.\r\n *\r\n * @param pc The source of the event.\r\n */\r\n public void socketDisconnected(PacketChannel pc, boolean failed);\r\n}", "@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }", "public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }", "@Override\n\tpublic void run() {\n\t\trespond();\n\t\tlisten();\n\t}", "public abstract void notifyAboutEmbeddedWebServerIpPort(InetAddress ip, int port);", "@Override\n\tpublic void getListener(){\n\t}", "protected Listener(){super();}", "public PortInfoListener(App app){\r\n super(app);\r\n }", "public interface Listener {}", "public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}", "public interface Master extends Runnable{\n\n /**\n * bind port and begin to accept request\n */\n void bind(WorkerPool workerPool);\n\n /**\n * handle the income requests ,accept and register to worker thread\n */\n void handleRequest();\n}", "@Override\n\tvoid receiveCall() {\n\n\t}", "public void run() {\n try {\n this.initialize();\n Listener ln = new Listener(localDir, port);\n ln.run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void onStarted();", "public void run() {\t\r\n\ttry {\r\n\t System.out.println(\"Creating input pipe\");\r\n\t // create the input pipe\r\n\t pipeIn = pipeSvc.createInputPipe(pipeAdv,this);\r\n\t} \r\n\tcatch (Exception e) {\r\n\t System.out.println(\"Error creating input pipe.\");\r\n\t return;\r\n\t}\r\n\tif (pipeIn == null) {\r\n\t System.out.println(\"Error: cannot open InputPipe\");\r\n\t System.exit(-1);\r\n\t}\r\n\tSystem.out.println(\"Listener waiting for messages...\");\r\n\ttry {\r\n\t Thread.sleep(Integer.MAX_VALUE);\r\n\t} catch (Exception e) {\r\n\t System.out.println(\"Program interrupted\");\r\n\t}\r\n }", "protected void onConnect() {}", "ListenerThreads(Process chimera, Chimera chimeraObject, CyLogger logger) {\n\t\tthis.chimera = chimera;\n\t\tthis.chimeraObject = chimeraObject;\n\t\tthis.logger = logger;\n\t\treplyLog = new HashMap<String, List<String>>();\n \t \t// Get a line-oriented reader\n \treadChan = chimera.getInputStream();\n\t\tlineReader = new BufferedReader(new InputStreamReader(readChan));\n\t}", "public interface SocketEventListener {\n\npublic void socketReceive( String s );\n}", "@Override\r\n public void run() {}", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }", "public void startListener(){\n new Thread(() -> this.run()).start();\n }", "public void onEventMainThread(BaseEvent unused) {\n }", "protected abstract void onConnect();", "public void run() {/* THE CODE HERE IS A THE @OVERRIDE FOR START() METHOD */\n\t}", "@Override\n public void run() {\n P.print(\"Listening on port \"+P.port+\", waiting for incomming connection...\");\n try {\n ServerSocket serverSocket = new ServerSocket(P.port);\n while (P.choke_thread_running) { //read input forever.\n Receive receive_thread = new Receive();\n Socket s = serverSocket.accept();\n String addr = s.getInetAddress().toString();\n int p = s.getPort();\n int i;\n for(i = 0;i<P.peer_ip.length;i++){\n if(addr.equals(P.peer_ip[i])){\n P.sockets[i] = s;\n P.tcp_out_stream[i] = new ObjectOutputStream(s.getOutputStream());\n break;\n }\n }\n receive_thread.start(P,s,P.peer_id[--i]);\n P.print(\"Accepted incomming connection: ip = \"+addr.substring(1)+\", port = \"+p);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n\t\t\tpublic void contectStarted() {\n\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Thread 클래스를 상속\");\n\t}", "@Override\n public void run()\n {\n\n }", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\tif (FrameworkHandler.DEBUG_MODE){\n\t\t\tString strType = \"\";\n\t\t\tif (type == RULE_CONNECTION) strType = \"New RemoteRule Listener\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(strType + \" LISTENING on port: \" + listeningSocket.getLocalPort());\n\t\t}\n\t\ttry {\n\t\t\twhile (running) {\n\t\t\t\tSocket newSocket = listeningSocket.accept();\n\t\t\t\t\n\t\t\t\tif (FrameworkHandler.DEBUG_MODE)\n\t\t\t\t\tSystem.out.println(\"New request obtained on \" + newSocket.getPort() + \"|\" + newSocket.getLocalPort());\n\t\t\t\t\n\t\t\t\tcreateNewConnection(newSocket);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tFrameworkHandler.exceptionLog(FrameworkHandler.LOG_ERROR, this, e);\n\t\t}\n\t}", "@Override\n\tpublic boolean IsListening() {\n\t\treturn listening;\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public void run() {\n try {\n this.listener = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n // On new connections, start a new thread to handle communications.\n try {\n while(true) {\n new Handler(this.listener.accept()).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n this.listener.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public abstract void listen(ServiceConfig serviceConfig) throws IOException;", "public void run(){\n\n\t\tServerSocket socketEcoute;\n\t\ttry {\n\t\t\tsocketEcoute = new ServerSocket();\n\t\t\tsocketEcoute.bind(new InetSocketAddress(this.defaultPort));\n\t\t\tSystem.out.println(\"Port manager started on : \"+this.defaultPort);\n\t\t\twhile(true){\n\t\t\t\tSocket socketConnexion = socketEcoute.accept();\n\t\t\t\tSystem.out.println(\"Someone is connected on PortManager\");\n\t\t\t\t\n\t\t\t\tnew PortManagerThread(socketConnexion,this.ctrl).start();\n\t\t\t\t\n\t\t\t\t\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}\n\t}", "abstract void onConnect();", "@Override\n\tpublic void connect(int threadNumber, int handlerID) {\n\t}", "@Override\n\tprotected void setListener() {\n\n\t}", "@Override\n\tprotected void setListener() {\n\n\t}", "@Override\n public void run(){\n System.out.println(\"we are in thread : \" + this.getName());\n }", "@Override\n public void start() {}", "public void start(int port)\n\t{\n\t\t// Initialize and start the server sockets. 08/10/2014, Bing Li\n\t\tthis.port = port;\n\t\ttry\n\t\t{\n\t\t\tthis.socket = new ServerSocket(this.port);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Initialize a disposer which collects the server listener. 08/10/2014, Bing Li\n\t\tMyServerListenerDisposer disposer = new MyServerListenerDisposer();\n\t\t// Initialize the runner list. 11/25/2014, Bing Li\n\t\tthis.listenerRunnerList = new ArrayList<Runner<MyServerListener, MyServerListenerDisposer>>();\n\t\t\n\t\t// Start up the threads to listen to connecting from clients which send requests as well as receive notifications. 08/10/2014, Bing Li\n\t\tRunner<MyServerListener, MyServerListenerDisposer> runner;\n\t\tfor (int i = 0; i < ServerConfig.LISTENING_THREAD_COUNT; i++)\n\t\t{\n\t\t\trunner = new Runner<MyServerListener, MyServerListenerDisposer>(new MyServerListener(this.socket, ServerConfig.LISTENER_THREAD_POOL_SIZE, ServerConfig.LISTENER_THREAD_ALIVE_TIME), disposer, true);\n\t\t\tthis.listenerRunnerList.add(runner);\n\t\t\trunner.start();\n\t\t}\n\n\t\t// Initialize the server IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().init();\n\t\t// Initialize a client pool, which is used by the server to connect to the remote end. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().init();\n\t}", "public abstract void onConnect();", "public void run() {\n\n\t\tinitListen(new OnReceivedListener() {\n\t\t\t@Override\n\t\t\tpublic void onReceived() throws Exception {\n\n\t\t\t\tmSocket.receive(new DatagramPacket(mQuickBuffer, mQuickBuffer.length));\n\t\t\t\tPacket packet = (Packet) deserialization(mQuickBuffer);\n\t\t\t\tif (packet.isAck()) {\n\t\t\t\t\tSR.updateBufferSlotTimerSender(packet.getSeq(), BufferSlotTimer.ACKED);\n\t\t\t\t\tSR.output.append(\"(S) - Acknowledgment for Packet \" + packet.getSeq() + \" has been Received \\n\");\n\t\t\t\t\tSR.updateBaseSnd();\n\t\t\t\t\tSR.getBufferSlotTimerSender(packet.getSeq()).stopTimerTimeout();\n\t\t\t\t\tSR.output.append(\"(S) - Timer for Packet \" + packet.getSeq() + \" has been stopped \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }" ]
[ "0.7204814", "0.7019631", "0.70114034", "0.69414645", "0.67405105", "0.6646914", "0.6562875", "0.64893615", "0.6397651", "0.63935137", "0.6324486", "0.63014656", "0.6298066", "0.62787807", "0.626333", "0.62494355", "0.6235727", "0.62065727", "0.62002", "0.61785525", "0.61588573", "0.61286765", "0.6107763", "0.6103705", "0.6099761", "0.6081508", "0.60775596", "0.6066628", "0.60638875", "0.605187", "0.60510683", "0.6049949", "0.60485387", "0.6043646", "0.6033932", "0.5998752", "0.5994857", "0.59867036", "0.5952293", "0.59485006", "0.5935869", "0.5933692", "0.592266", "0.5918737", "0.590621", "0.5899915", "0.5897316", "0.58850527", "0.58838725", "0.5877026", "0.5863701", "0.58619434", "0.5857122", "0.5844468", "0.5838498", "0.5836984", "0.58340055", "0.58319986", "0.5828893", "0.5825062", "0.581769", "0.5811437", "0.57978094", "0.5797776", "0.57968915", "0.5791648", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.5789562", "0.578656", "0.57861966", "0.57819915", "0.57819915", "0.57819915", "0.5776285", "0.57741517", "0.577412", "0.5772016", "0.5767429", "0.5767047", "0.5767047", "0.57663214", "0.576163", "0.57611614", "0.5745892", "0.57454526", "0.5743389", "0.5743389" ]
0.0
-1
our implementation of the hypertext transfer protocol its very basic and stripped down
private void http_handler(BufferedReader input, DataOutputStream output) { int method = 0; //1 get, 2 head, 0 not supported String http = new String(); //a bunch of strings to hold String path = new String(); //the various things, what http v, what path, String file = new String(); //what file String user_agent = new String(); //what user_agent try { //This is the two types of request we can handle //GET /index.html HTTP/1.0 //HEAD /index.html HTTP/1.0 String tmp = input.readLine(); //read from the stream String tmp2 = new String(tmp); String line = input.readLine(); String header = ""; while (line != null && !line.equals("")) { header += line; line = input.readLine(); } if(header.contains("Content-Length")){ int offset = header.indexOf("Content-Length: ") + "Content-Length: ".length(); int cLength = Integer.parseInt(header.substring(offset, header.length())); char[] buffer = new char[cLength]; input.read(buffer); value = new String(buffer); } tmp.toUpperCase(); //convert it to uppercase if (tmp.startsWith("GET")) { //compare it is it GET method = 1; } //if we set it to method 1 if (tmp.startsWith("OPTIONS")) { //same here is it OPTIONS method = 2; } //set method to 2 if (tmp.startsWith("POST")) { //same here is it POST method = 3; } //set method to 3 if (method == 0) { // not supported try { output.writeBytes(construct_http_header(501, 0)); output.close(); return; } catch (Exception e3) { //if some error happened catch it s("error:" + e3.getMessage()); } //and display error } //} //tmp contains "GET /index.html HTTP/1.0 ......." //find first space //find next space //copy whats between minus slash, then you get "index.html" //it's a bit of dirty code, but bear with me... int start = 0; int end = 0; for (int a = 0; a < tmp2.length(); a++) { if (tmp2.charAt(a) == ' ' && start != 0) { end = a; break; } if (tmp2.charAt(a) == ' ' && start == 0) { start = a; } } path = tmp2.substring(start + 1, end); //fill in the path } catch (Exception e) { s("error" + e.getMessage()); } //catch any exception try { //send response header output.writeBytes(construct_http_header(200, 5)); if (method == 1) { //1 is GET 2 is head and skips the body //Response with data from kinect (persoon aanwezig, positie, ...) //output.writeBytes(response); } if (method == 2) { String msg = ""; //Description of the sensor sent back (OPTIONS) if (path.equals("/")) { msg = "<link rel=\"description\" type=\"text/n3\" href=\"/service\">\n<link rel=\"goal\" type=\"text/n3\" href=\"/serviceGoal\">"; } if (path.equals("/service")) { msg = "@prefix sensor: <http://example.org/sensor/>.\n"; msg += "@prefix ex: <http://example.org/example/>. \n"; msg += "@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. \n"; msg += "@prefix environment: <http://example.org/environment/>. \n"; msg += "@prefix http: <http://www.w3.org/2011/http#>. \n"; msg += "@prefix tmpl: <http://purl.org/restdesc/http-template#>. \n"; msg += "{ \n"; msg += "?sensor a sensor:Kinect. \n"; msg += "} \n"; msg += "=> \n"; msg += "{ \n"; msg += "_:request http:methodName \"POST\"; \n"; msg += "tmpl:requestURI (?sensor \"/lightValue\"); \n"; msg += "http:body ?environmentLight;\n"; msg += "http:resp [ http:body ?lightingValue]. \n"; msg += "?environmentLight a environment:lightingCondition.\n"; msg += "?sensor sensor:lightingCondition ?lightingValue. \n"; msg += "?lightingValue a xsd:String. \n"; msg += "}. \n"; msg += "<http://" + ip + "/#sensor> a sensor:Kinect.\n"; } if (path.equals("/serviceGoal")) { msg = "@prefix sensor: <http://example.org/sensor/>. \n"; msg += "@prefix environment: <http://example.org/environment/>. \n"; msg += "{ \n"; msg += "<http://" + ip + "/#sensor> sensor:lightingCondition ?value. \n"; msg += "} \n"; msg += "=> \n"; msg += "{ \n"; msg += "<http://" + ip + "/#sensor> sensor:lightingCondition ?value. \n"; msg += "}. \n"; } output.writeBytes(msg); } if (method == 3) { //Add something to sensor (LightSensor data) if (path.equals("/lightValue")) { //get Light Value, send to kinect String lightValue = value.substring(value.indexOf("=") + 1, value.length()).trim(); EnvironmentVars.getInstance().setLightValue(lightValue); output.writeBytes("OK"); } if (path.equals("/personPresent")) { EnvironmentVars.getInstance().setPersonPresent(true); output.writeBytes("OK"); } } output.close(); } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void transmit(String protocol, String message);", "java.lang.String getTransferTxt();", "private LoanProtocol ProcessTransferRequest(LoanProtocol protocol)\n\t{\n\t\t// only change the type of the protocol to answer\n\t\tprotocol.setType(messageType.TransferAnswer);\n\t\treturn protocol;\n\t}", "@Override\n\tpublic void interpretBytes() {\n\t\t\n\t}", "@Override\n public void transferred(long num) {\n }", "@Override\n public void transferred(long num) {\n }", "@Override\n\t\t\t\t\tpublic void transferred(long num) \n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t}", "boolean hasPlainTransferFrom();", "void visitTransmit(RadioInfo srcInfo, Location srcLoc, \r\n RadioInfo dstInfo, RadioInterface dstEntity, Location dstLoc, \r\n Message msg, Long durationObj);", "boolean hasPlainTransfer();", "public interface ITransportHandler {\n\n /**\n * Processing device returned messages\n * \n * @author\n * @param devReplyStr Message information returned by the device\n */\n void handlePacket(String devReplyStr);\n\n /**\n * Error information processing apparatus returns <br>\n * \n * @author\n * @param devReplyErr Error messages returned by the device\n */\n void handleError(String devReplyErr);\n\n /**\n * Device interaction with the end of the glyph packets <br>\n * \n * @author\n * @return End glyph packets\n */\n String getPacketEndTag();\n\n /**\n * Encoding packets\n * \n * @author\n * @return Encoding packets\n */\n String getCharsetName();\n\n}", "public interface Transport {\r\n /**\r\n * Prepares connection to server and returns connection output stream.\r\n * \r\n * @param info\r\n * connection information object containing target URL, content encoding, etc.\r\n * @return connection output stream\r\n * @throws TransportException\r\n */\r\n OutputStream prepare(ConnectionInfo info) throws TransportException;\r\n \r\n \r\n // this method used for wsg request -- by felix\r\n /**\r\n * Prepares connection to server and returns connection output stream.\r\n * \r\n * @param info\r\n * connection information object containing target URL, content encoding, etc.\r\n * @return connection output stream\r\n * @throws TransportException\r\n */\r\n void prepare(ConnectionInfo info,byte[] reqXml) throws TransportException;\r\n\tpublic InputStream configPrepare(ConnectionInfo info) throws TransportException;\r\n public InputStream prepareAndConnect(ConnectionInfo info) throws TransportException ;\r\n public void prepareWsgPost(ConnectionInfo info,byte[] reqXml) throws TransportException ;\r\n \r\n\r\n /**\r\n * Sends request to server and receives a response.\r\n * <em>{@link #prepare(ConnectionInfo)} should be called prior to performing an exchange.</em>\r\n * \r\n * @return input stream containing server response\r\n * \r\n * @throws TransportException\r\n */\r\n InputStream exchange() throws TransportException;\r\n\r\n /**\r\n * Closes any pending connections and frees transport resources.\r\n */\r\n void close();\r\n}", "SerialResponse transfer(PinTransferPost pinTransferPost);", "@Override\n\t\t\t\tpublic int fileTransferSend(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, ByteBuffer buffer, int size) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, byte[] buffer, int size) {\n\t\t\t\t\t\n\t\t\t\t}", "org.hyperledger.fabric.protos.token.Transaction.PlainTransferFrom getPlainTransferFrom();", "static void transfer_hl_to_sp(String passed){\n\t\tSP = hexa_to_deci(registers.get('H')+registers.get('L'));\n\t}", "public LWTRTPdu data(Object chatPdu) throws IncorrectTransitionException;", "public void testDomainTransfer() {\n\n\t\tEPPCodecTst.printStart(\"testDomainTransfer\");\n\n\t\tEPPDomainTransferCmd theCommand = new EPPDomainTransferCmd(\"ABC-12345\",\n\t\t\t\tEPPCommand.OP_REQUEST, \"example.com\",\n\t\t\t\tnew EPPAuthInfo(\"2fooBAR\"), new EPPDomainPeriod(1));\n\n\t\tEPPFeeTransfer theTransferExt = new EPPFeeTransfer(\n\t\t\t\tnew EPPFeeValue(new BigDecimal(\"5.00\")));\n\n\t\ttheCommand.addExtension(theTransferExt);\n\n\t\tEPPEncodeDecodeStats commandStats = EPPCodecTst\n\t\t\t\t.testEncodeDecode(theCommand);\n\t\tSystem.out.println(commandStats);\n\n\t\t// Create Response\n\t\tEPPDomainTransferResp theResponse;\n\t\tEPPEncodeDecodeStats responseStats;\n\n\t\tEPPTransId respTransId = new EPPTransId(theCommand.getTransId(),\n\t\t\t\t\"54321-XYZ\");\n\t\ttheResponse = new EPPDomainTransferResp(respTransId, \"example.com\");\n\t\ttheResponse.setResult(EPPResult.SUCCESS);\n\n\t\ttheResponse.setRequestClient(\"ClientX\");\n\t\ttheResponse.setActionClient(\"ClientY\");\n\t\ttheResponse.setTransferStatus(EPPResponse.TRANSFER_PENDING);\n\t\ttheResponse.setRequestDate(new GregorianCalendar(2000, 6, 8).getTime());\n\t\ttheResponse.setActionDate(new GregorianCalendar(2000, 6, 13).getTime());\n\t\ttheResponse.setExpirationDate(new GregorianCalendar(2002, 9, 8)\n\t\t\t\t.getTime());\n\n\t\tEPPFeeTrnData theRespExt = new EPPFeeTrnData(\"USD\", new EPPFeeValue(\n\t\t\t\tnew BigDecimal(\"5.00\")));\n\n\t\ttheResponse.addExtension(theRespExt);\n\n\t\tresponseStats = EPPCodecTst.testEncodeDecode(theResponse);\n\t\tSystem.out.println(responseStats);\n\n\t\t// Transfer Query Response\n\t\trespTransId = new EPPTransId(theCommand.getTransId(), \"54321-XYZ\");\n\t\ttheResponse = new EPPDomainTransferResp(respTransId, \"example.com\");\n\t\ttheResponse.setResult(EPPResult.SUCCESS);\n\n\t\ttheResponse.setRequestClient(\"ClientX\");\n\t\ttheResponse.setActionClient(\"ClientY\");\n\t\ttheResponse.setTransferStatus(EPPResponse.TRANSFER_PENDING);\n\t\ttheResponse.setRequestDate(new GregorianCalendar(2000, 6, 8).getTime());\n\t\ttheResponse.setActionDate(new GregorianCalendar(2000, 6, 13).getTime());\n\t\ttheResponse.setExpirationDate(new GregorianCalendar(2002, 9, 8)\n\t\t\t\t.getTime());\n\n\t\ttheRespExt = new EPPFeeTrnData();\n\t\ttheRespExt.setCurrency(\"USD\");\n\t\ttheRespExt.setPeriod(new EPPFeePeriod(1));\n\t\ttheRespExt.addFee(new EPPFeeValue(new BigDecimal(\"5.00\"), null, true,\n\t\t\t\t\"P5D\", EPPFeeValue.APPLIED_IMMEDIATE));\n\n\t\ttheResponse.addExtension(theRespExt);\n\n\t\tresponseStats = EPPCodecTst.testEncodeDecode(theResponse);\n\t\tSystem.out.println(responseStats);\n\n\t\tEPPCodecTst.printEnd(\"testDomainTransfer\");\n\t}", "public interface Transferable {\n\n\n\n /**\n *\n * @throws Exception\n */\n void init() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void parseHeader() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void parseBody() throws Exception;\n\n\n /**\n *\n * @throws Exception\n */\n void finish() throws Exception;\n}", "private native int cmdXfer0(byte[] request, byte[] response);", "@Override\n protected void prepareHandshakeMessageContents() {\n }", "public interface IPacketTransporter {\n\n DataInputStream getReceiveStream();\n\n DataOutputStream getSendStream();\n\n /**\n * Blocks until a packet is available. The packet identifier is returned, \n * and the packet is available for reading on the Receive stream.\n */\n int ReceivePacket();\n\n /**\n * Returns the oldest packet in the received packet queue.\n * If no packet is available this function immediately returns -1;\n * The packet identifier is returned, \n * and the packet is available for reading on the Receive stream.\n */\n int ReceiveAvailablePacket();\n\n /**\n * Sends a packet with given identifier. (non-blocking)\n * The data written to the SendStream since the last call to SendPacket is sent.\n */\n void SendPacket(int packetIdentifier);\n \n \n \n \n \n \n \n \n void onPacketReceived(int packetIdentifier, byte[] dgram, int offset, int length);\n \n \n \n}", "FJPacket( AutoBuffer ab, int ctrl ) { _ab = ab; _ctrl = ctrl; }", "public interface TCPProtocolPropertiesOperations extends org.omg.RTCORBA.ProtocolPropertiesOperations {\n int send_buffer_size();\n void send_buffer_size(int arg);\n int recv_buffer_size();\n void recv_buffer_size(int arg);\n boolean keep_alive();\n void keep_alive(boolean arg);\n boolean dont_route();\n void dont_route(boolean arg);\n boolean no_delay();\n void no_delay(boolean arg);\n}", "public boolean hasPlainTransfer() {\n return dataCase_ == 2;\n }", "org.hyperledger.fabric.protos.token.Transaction.PlainTransfer getPlainTransfer();", "public boolean hasPlainTransfer() {\n return dataCase_ == 2;\n }", "private void processSession()\n\t\tthrows ProtocolException, AtmException\n\t{\n\t\tboolean fDone = false;\n\t\ttry\n\t\t{\n\t\t\twhile(!fDone)\n\t\t\t{\n\t\t\t\t// listen for client to send data\n\t\t\t\tString dataIn = m_reader.readLine();\n\t\t\t\ttrace(\"handling client command \" + dataIn);\n\t\t\t\tif(dataIn.trim().equals(START_XFR))\n\t\t\t\t{\n\t\t\t\t\ttrace(\"starting a file transfer request\");\n\t\t\t\t\tsendOK();\n\t\t\t\t\t//m_writer.println(OK); // send the ack\n\t\t\t\t\t\n\t\t\t\t\t// get the file name\n\t\t\t\t\tdataIn = m_reader.readLine();\n\t\t\t\t\t\n\t\t\t\t\t// create the AtmObject\n//\t\t\t\t\tDocument inDom = XmlUtility.xmlDocumentFromXmlString(dataIn.trim());\n//\t\t\t\t\tAtmObject obj = XmlUtility.xmlToObject(inDom);\n//\t\t\t\t\t\n//\t\t\t\t\tAtmObject response = AtmApplication.getInstance().processAtmObject(obj);\n//\t\t\t\t\t\n//\t\t\t\t\tDocument xmlResponse = XmlUtility.objectToXml(response);\n//\t\t\t\t\tString xmlResponseString = XmlUtility.xmlDocumentToString(xmlResponse);\n//\t\t\t\t\tsendData(xmlResponseString);\n\t\t\t\t\t// process the object\n//\t\t\t\t\tif(dataIn.trim().startsWith(FILE_NAME))\n//\t\t\t\t\t{\n//\t\t\t\t\t\t// get the file name\n//\t\t\t\t\t\tString data = dataIn.trim();\n//\t\t\t\t\t\t//String fileName = data.trim();\t\n////\t\t\t\t\t\tString path = m_destDirectory.getAbsolutePath()\n////\t\t\t\t\t\t\t\t+ \"\\\\\" + fileName;\n////\t\t\t\t\t\ttrace(\"Preparing to copy file: \" + fileName + \n////\t\t\t\t\t\t\t\t\" to \" + path);\n//\t\t\t\t\t\t\n////\t\t\t\t\t\tdestFile = new File(path);\n////\t\t\t\t\t\tFileWriter writer = new FileWriter(destFile);\n////\t\t\t\t\t\tdestWriter = new BufferedWriter(writer);\n////\t\t\t\t\t\t\n//\t\t\t\t\t\ttrace(\"created destination file\");\n//\t\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().startsWith(DATA))\n//\t\t\t\t{\n//\t\t\t\t\ttrace(\"writing data to destination file\");\n//\t\t\t\t\t// don't trim now. We want whitespace if it's there.\n//\t\t\t\t\tString data = messageIn.substring(DATA.length());\n//\t\t\t\t\tdestWriter.write(data);\n//\t\t\t\t\tdestWriter.newLine();\n//\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().equals(END_FILE))\n//\t\t\t\t{\n//\t\t\t\t\tdestWriter.flush();\n//\t\t\t\t\tdestWriter.close();\n//\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t}\n//\t\t\t\telse if(messageIn.trim().equals(END_SESSION))\n//\t\t\t\t{\n//\t\t\t\t\ttrace(\" - Ending session\");\n//\t\t\t\t\tm_reader.close();\n//\t\t\t\t\tm_writer.println(OK); // send the ack\n//\t\t\t\t\tbreak;\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(IOException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\ttrace(\"Error copying file\" + ex.getMessage());\n\t\t\tthrow new ProtocolException(\"Error copying file\", ex);\t\t\t\n\t\t}\n\t}", "private void sendData() {\n final ByteBuf data = Unpooled.buffer();\n data.writeShort(input);\n data.writeShort(output);\n getCasing().sendData(getFace(), data, DATA_TYPE_UPDATE);\n }", "@Override\n\tpublic void receivedNegotiation(int arg0, int arg1) {\n\t\t\n\t}", "public boolean hasPlainTransferFrom() {\n return dataCase_ == 5;\n }", "public LWTRTPdu dataRsp(LWTRTPdu lwtrtPdu) throws IncorrectTransitionException;", "GasData receiveGasData();", "TransmissionProtocol.Type getType();", "public boolean hasPlainTransferFrom() {\n return dataCase_ == 5;\n }", "public interface VSmartCardProtocol {\n void disconnect();\n int readCommand() throws IOException;\n byte[] readData() throws IOException;\n void writeData(byte[] data) throws IOException;\n}", "com.google.protobuf.ByteString\n getTransferTxtBytes();", "public boolean transfer(double total, String sender, String receiver) {\n\n }", "public void doPack() {\n if (this._sendData == null) {\n this._sendData = new byte[13];\n }\n this._sendData[0] = 0;\n if (this.isMenu) {\n byte[] bArr = this._sendData;\n bArr[0] = (byte) (bArr[0] | 1);\n }\n if (this.isPlayback) {\n byte[] bArr2 = this._sendData;\n bArr2[0] = (byte) (bArr2[0] | 2);\n }\n if (this.isRecord) {\n byte[] bArr3 = this._sendData;\n bArr3[0] = (byte) (bArr3[0] | 4);\n }\n BytesUtil.arraycopy(generateChannelByte(), this._sendData, 1);\n this._sendData[11] = 0;\n if (this.isButton) {\n byte[] bArr4 = this._sendData;\n bArr4[11] = (byte) (bArr4[11] | 1);\n }\n byte[] bArr5 = this._sendData;\n bArr5[11] = (byte) (bArr5[11] | (this.buttonData << 1));\n byte[] bArr6 = this._sendData;\n bArr6[11] = (byte) (bArr6[11] | (this.symbol << 6));\n byte[] bArr7 = this._sendData;\n bArr7[11] = (byte) (bArr7[11] | (this.change << 7));\n byte[] bArr8 = this._sendData;\n bArr8[12] = (byte) (bArr8[12] | this.shutter);\n byte[] bArr9 = this._sendData;\n bArr9[12] = (byte) (bArr9[12] | (this.focus << 1));\n byte[] bArr10 = this._sendData;\n bArr10[12] = (byte) (bArr10[12] | (this.mode_sw << 2));\n byte[] bArr11 = this._sendData;\n bArr11[12] = (byte) (bArr11[12] | (this.transform_sw << 4));\n byte[] bArr12 = this._sendData;\n bArr12[12] = (byte) (bArr12[12] | (this.gohome << 6));\n }", "public String getFileTransferServer();", "@Override public void handleMessage(Message msg) {\n super.handleMessage(msg);\n byte[] byteArray = (byte[]) msg.obj;\n int length = msg.arg1;\n byte[] resultArray = length == -1 ? byteArray : new byte[length];\n for (int i = 0; i < byteArray.length && i < length; ++i) {\n resultArray[i] = byteArray[i];\n }\n String text = new String(resultArray, StandardCharsets.UTF_8);\n if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_WRITE) {\n Log.i(TAG, \"we just wrote... [\" + length + \"] '\" + text + \"'\");\n// mIncomingMsgs.onNext(text);\n } else if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_READ) {\n Log.i(TAG, \"we just read... [\" + length + \"] '\" + text + \"'\");\n Log.i(TAG, \" >>r \" + Arrays.toString((byte[]) msg.obj));\n mIncomingMsgs.onNext(text);\n sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// mReadTxt.setText(++ri + \"] \" + text);\n// if (mServerBound && mServerService.isConnected()) {\n// mServerService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// } else if (mClientBound && mClientService.isConnected()) {\n// mClientService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// }\n// mBluetoothStuff.mTalker.write();\n }\n }", "public abstract void onBinaryReceived(byte[] data);", "public interface Protocol {\n\n\n /**\n * Get the last line of text, which has been read from the socket.\n * @return the last line of text, which has been read from the socket.\n */\n String getCurrentLine();\n\n /**\n * Write to the Socket.\n * @param line to write to the socket.\n */\n void putLine(String line);\n\n /**\n * Change the state of the protocol.\n * @param state new state of the protocol.\n */\n void setState(State state);\n\n /**\n * Get the current state of the protocol.\n * @return the current state of the protocol.\n */\n State getState();\n\n\n}", "org.hyperledger.fabric.protos.token.Transaction.PlainTransferFromOrBuilder getPlainTransferFromOrBuilder();", "public abstract void SendData(int sock, String Data) throws LowLinkException, TransportLayerException, CommunicationException;", "int libusb_control_transfer(DeviceHandle dev_handle, short bmRequestType, short bRequest, int wValue, int wIndex,\r\n String data, int wLength, int timeout);", "public void sendOtp(String medium) {\n\r\n }", "@Test\n public void testPassingFootstepData() throws IOException\n {\n Random random = new Random(5642769L);\n\n // setup comms\n NetworkPorts port = NetworkPorts.createRandomTestPort(random);\n // QueueBasedStreamingDataProducer<FootstepData> queueBasedStreamingDataProducer = new QueueBasedStreamingDataProducer<FootstepData>(\"FootstepData\");\n PacketCommunicator tcpServer = createAndStartStreamingDataTCPServer(port);\n FootstepDataConsumer footstepDataConsumer = new FootstepDataConsumer();\n PacketCommunicator tcpClient = createStreamingDataConsumer(FootstepDataMessage.class, footstepDataConsumer, port);\n ThreadTools.sleep(SLEEP_TIME);\n // queueBasedStreamingDataProducer.startProducingData();\n\n // create test footsteps\n ArrayList<Footstep> sentFootsteps = createRandomFootsteps(50);\n for (Footstep footstep : sentFootsteps)\n {\n FootstepDataMessage footstepData = HumanoidMessageTools.createFootstepDataMessage(footstep);\n tcpServer.send(footstepData);\n // queueBasedStreamingDataProducer.queueDataToSend(footstepData);\n }\n\n ThreadTools.sleep(SLEEP_TIME);\n\n tcpClient.disconnect();\n tcpServer.disconnect();\n\n // verify received correctly\n ArrayList<Footstep> receivedFootsteps = footstepDataConsumer.getReconstructedFootsteps();\n\n compareFootstepsSentWithReceived(sentFootsteps, receivedFootsteps);\n }", "void onDataReceived(int source, byte[] data);", "public void doPack() {\n if (this._sendData == null) {\n this._sendData = new byte[26];\n }\n System.arraycopy(BytesUtil.getBytes(this.mLongtitue), 0, this._sendData, 0, 8);\n System.arraycopy(BytesUtil.getBytes(this.mLantitue), 0, this._sendData, 8, 8);\n System.arraycopy(BytesUtil.getBytes(this.mNorthSpeed), 0, this._sendData, 16, 4);\n System.arraycopy(BytesUtil.getBytes(this.mEastSpeed), 0, this._sendData, 20, 4);\n System.arraycopy(BytesUtil.getBytes(this.mAccuracy), 0, this._sendData, 24, 2);\n }", "public interface LWTRTState {\n\t\n\t/**\n\t * Aktiver Verbindungsaufbau (1. Schritt)\n\t * Dienstnehmer uebertraegt Wunsch zum Verbindungsaufbau.\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu connect() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Passiver Verbindungsaufbau (1. Schritt)\n\t * Wunsch zum Verbindungsaufbau wird ueber eine PDU mitgeteilt\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu connectReq() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Aktiver Verbindungsaufbau (2. Schritt)\n\t * Best+tigung des Verbindungsaufbaus wird +ber eine PDU mitgeteilt\n\t * @return Vorbereitet Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu connectRsp() throws IncorrectTransitionException;\n\n\t/**\n\t * Passiver Verbindungsaufbau (2. Schritt)\n\t * Dienstnehmer bestaetigt den Wunsch zum Verbindungsaufbau\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu connectAcpt() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Aktiver Verbindungsabbau (1. Schritt)\n\t * Dienstnehmer uebertraegt Wunsch zum Verbindungsabbau.\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu disConnect() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Passiver Verbindungsabbau (1. Schritt)\n\t * Wunsch zum Verbindungsabbau des Verbindungspartners wird +ber eine PDU mitgeteilt\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu disConnectReq() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Aktiver Verbindungsabbau (2. Schritt)\n\t * Best+tigung des Verbindungsaufbaus wird +ber eine PDU mitgeteilt\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu disConnectRsp() throws IncorrectTransitionException;\n\n\t/**\n\t * Passiver Verbindungsabbau (2. Schritt)\n\t * Dienstnehmer bestaetigt die abgebaute Verbindung\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu disConnectAcpt() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Timeout\n\t * Das Auslaufen eines Timer wird angezeigt\n\t * \n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu timeout() throws IncorrectTransitionException;\n\t\n\t/**\n\t * Data senden\n\t * Wunsch Daten zu senden (aktiv)\n\t * \n\t * @param chatPdu zu sendende PDU\n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu data(Object chatPdu) throws IncorrectTransitionException;\n\t\n\t/**\n\t * Daten empfangen (passiv)\n\t * Daten werden empfangen (DATA-REQ)\n\t * \n\t * @param lwtrtPdu empfangenes PDU\n\t * @return Vorbereitet Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu dataReq(LWTRTPdu lwtrtPdu) throws IncorrectTransitionException;\n\t\n\t/**\n\t * Datenempfang wurde bestaetigt (akttiv)\n\t * Eine Bestaetigung des Datenempfang wurde empfnagen (DATA-RSP)\n\t * \n\t * @param lwtrtPdu empfangene Best+tigung\n\t * @return Vorbereitete Antwort-PDU oder <code>null</code> wenn nicht geantwortet wird.\n\t * @throws IncorrectTransitionException wenn der Zustandsuebergang nicht vorgesehen ist\n\t */\n\tpublic LWTRTPdu dataRsp(LWTRTPdu lwtrtPdu) throws IncorrectTransitionException;\n\t\n}", "private AdesaNetworkCall(){ }", "private void transfer(Transfer associatedUpload) throws IOException {\n \t\ttry {\n \t\t\t_started = System.currentTimeMillis();\n \t\t\tif (_mode == 'A') {\n \t\t\t\t_out = new AddAsciiOutputStream(_out);\n \t\t\t}\n \n \t\t\tbyte[] buff = new byte[Math.max(_slave.getBufferSize(), 65535)];\n \t\t\tint count;\n \t\t\tlong currentTime = System.currentTimeMillis();\n \n \t\t\ttry {\n \t\t\t\twhile (true) {\n \t\t\t\t\tif (_abortReason != null) {\n \t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\tgetTransferStatus());\n \t\t\t\t\t}\n \t\t\t\t\tcount = _in.read(buff);\n \t\t\t\t\tif (count == -1) {\n \t\t\t\t\t\tif (associatedUpload == null) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (associatedUpload.getTransferStatus().isFinished()) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t}\n \t\t\t\t\t\tcontinue; // waiting for upload to catch up\n \t\t\t\t\t}\n \t\t\t\t\t// count != -1\n \t\t\t\t\tif ((System.currentTimeMillis() - currentTime) >= 1000) {\n \t\t\t\t\t\tTransferStatus ts = getTransferStatus();\n \t\t\t\t\t\tif (ts.isFinished()) {\n \t\t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\t\tts);\n \t\t\t\t\t\t}\n \t\t\t\t\t\t_slave\n \t\t\t\t\t\t\t\t.sendResponse(new AsyncResponseTransferStatus(\n \t\t\t\t\t\t\t\t\t\tts));\n \t\t\t\t\t\tcurrentTime = System.currentTimeMillis();\n \t\t\t\t\t}\n \t\t\t\t\t_transfered += count;\n \t\t\t\t\t_out.write(buff, 0, count);\n \t\t\t\t}\n \n \t\t\t\t_out.flush();\n \t\t\t} catch (IOException e) {\n \t\t\t\tthrow new TransferFailedException(e, getTransferStatus());\n \t\t\t}\n \t\t} finally {\n \t\t\t_finished = System.currentTimeMillis();\n \t\t\t_slave.removeTransfer(this); // transfers are added in setting up\n \t\t\t\t\t\t\t\t\t\t\t// the transfer,\n \t\t\t\t\t\t\t\t\t\t\t// issueListenToSlave()/issueConnectToSlave()\n \t\t}\n \t}", "@Override\n public boolean transfer(int destination, byte type, int startAddress, byte[] contents, \n int offset, int size) {\n if (!Packet.isTransfer(type)) {\n throw new RuntimeException(\"(bugcheck): \" + type + \" is not a transfer type\");\n }\n Packet response = doTrip(destination, type, startAddress, size, contents, offset, size);\n if (response == null) return false;\n if (!Packet.isAck(response.getType())) {\n logger.error(\"no ack response received on transfer\");\n return false;\n }\n return true;\n }", "void send();", "void mo23490a(C9067a aVar, TransferListener transferListener);", "public String rplysetpkt(byte []p1,byte[] id1,byte[] T1,byte[] ip1,byte[] no1)\r\n\t{\n\t\treturn \"hi\";\r\n\t}", "public EchoClientHandler()\n {\n String data = \"hello zhang kylin \" ;\n firstMessage = Unpooled.buffer(2914) ;\n firstMessage.writeBytes(data.getBytes()) ;\n }", "public abstract void RecvData(int sock, String Data) throws LowLinkException, TransportLayerException;", "public LWTRTPdu connectReq() throws IncorrectTransitionException;", "public interface Chord {\n\n //region: ChordLib parameters\n\n int DEFAULT_NUM_FINGERS = 19;\n int DEFAULT_NUM_SUCCESSORS = 1;\n String DEFAULT_SERVER_IP = \"127.0.0.1\";\n int DEFAULT_SERVER_PORT = 1678;\n boolean USE_PUBLIC_IP = false;\n int DEFAULT_RETRY = 5; //number of retrial lookup in case of failures (it can mask transient failures)\n int DEFAULT_CHORD_MODULE = 20; //Expressed in bit length\n int ROUTINE_PERIOD = 20000;\n int MESSAGE_PASSING_TIMEOUT = 10000;\n\n //endregion\n\n /**\n * Lookup for key in chord network\n * @return IP address of node responsible for key\n * @throws CommunicationFailureException for socket failures\n * @throws TimeoutReachedException timeout in request handling reached\n * @throws NoSuccessorsExceptions there is no living successor (Ring is unstable, actual ChordNode is Killed)\n */\n String lookupKey(String key) throws CommunicationFailureException, TimeoutReachedException, NoSuccessorsExceptions;\n\n /**\n * BasicLookup for key in chord network\n * @return IP address of node responsible for key\n * @throws CommunicationFailureException for socket failures\n * @throws TimeoutReachedException timeout in request handling reached\n * @throws NoSuccessorsExceptions there is no living successor (Ring is unstable, actual ChordNode is Killed)\n */\n String lookupKeyBasic(String key) throws CommunicationFailureException, TimeoutReachedException, NoSuccessorsExceptions;\n\n /**\n * Close ChordLib notifying it to the network\n */\n void closeNetwork();\n\n}", "@Override\n public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {\n int len = in.limit(); \n \tbyte [] dst=new byte [len]; \n \tin.get(dst); \n ByteArrayInputStream is = new ByteArrayInputStream(dst);\n HessianInput hi = new HessianInput(is);\n Object entity= hi.readObject();\n out.write(entity);\n }", "@Override\n\tpublic void sendData(int type, byte[] data) {\n\t\t\n\t}", "protected abstract void receive() throws IOException;", "@Override\n\tpublic void onEvent(String name, String params, byte[] data, int offset,\n\t\t\tint length) {\n\t\tString result = \"name:\" + name;\n\t\t//if(params != null && !params.isEmpty()){\n\t\t//\tresult+=\";params:\"+params;\n\t\t//}\n\t\tif(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_PARTIAL)){\n\t\t\tif(params.contains(\"\\\"final_result\\\"\")){\n\t\t\t\tresult += \"\\n\"+\"语义解析结果:\" + params.substring(45, 47);\n\t\t\t\tif(result.contains(\"前进\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了前进!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_FORWARD);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"后退\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了后退!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_BACKWARD);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"左转\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了左转!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_LEFT);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"右转\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了右转!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_RIGHT);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"停\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了停止!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_STOP);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"避障\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了避障!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_AVOID);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"跟踪\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了跟踪!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tsocketWriter= socket.getOutputStream();\n\t\t\t\t\t\tsocketWriter.write(COMM_FOLLOW);\n\t\t\t\t\t\tsocketWriter.flush();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Try to send message to car!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(result.contains(\"抓取\")){\n\t\t\t\t\tToast.makeText(MainActivity.this,\"识别出了抓取!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\tIntent intent = new Intent();\n\t\t\t\t\tintent.setClass(MainActivity.this, GraspActivity.class);\n\t\t\t\t\tMainActivity.this.startActivity(intent);\n\t\t\t\t\tfinish();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(data != null){\n\t\t\tresult += \";data length=\" + data.length;\n\t\t}\n\t\t\n\t\t\n\t\t/*if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_READY)){\n\t\t\tresult +=\"引擎准备就绪,可以开始说话\";\n\t\t}else if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_BEGIN)){\n\t\t\tresult += \"检测到用户已经开始说话\";\n\t\t}else if(name.equals(SpeechConstant.CALLBACK_EVENT_ASR_END)){\n\t\t\tresult += \"检测到用户已经停止说话\";\n\t\t\t\n\t\t}else if (data != null) {\n\t\t\tresult += \" ;data length=\" + data.length;\n }*/\n\t\n\t\t//show the result\n\t\tprintresult(result);\n\t\t\n\t}", "TransmissionProtocol.Status getStatus();", "void transferHunger(int transfer, ItemStack stack, ProcessType process);", "protected void encode() {\t\n\t\tsuper.rawPkt = new byte[12 + this.pktData.length];\n\t\tbyte[] tmp = StaticProcs.uIntLongToByteWord(super.ssrc);\n\t\tSystem.arraycopy(tmp, 0, super.rawPkt, 4, 4);\n\t\tSystem.arraycopy(this.pktName, 0, super.rawPkt, 8, 4);\n\t\tSystem.arraycopy(this.pktData, 0, super.rawPkt, 12, this.pktData.length);\n\t\twriteHeaders();\n\t\t//System.out.println(\"ENCODE: \" + super.length + \" \" + rawPkt.length + \" \" + pktData.length);\n\t}", "public abstract void sendData(Float data, int dataType);", "public LWTRTPdu connect() throws IncorrectTransitionException;", "public static void tranferFile() {\n\n FTPClient ftpClient = new FTPClient();\n try {\n ftpClient.connect(\"192.168.231.237\", 80);\n ftpClient.login(\"root\", \"xpsr@350\");\n ftpClient.enterLocalPassiveMode();\n\n ftpClient.setFileType(FTP.BINARY_FILE_TYPE);\n File sourceFile = new File(\"/home/sthiyagaraj/eclipse-workspace/KonnectAPI/target/APIURL.tar.gz\");\n InputStream inputStream = new FileInputStream(sourceFile);\n\n boolean done = ftpClient.storeFile(\"filename which receiver get\", inputStream);\n inputStream.close();\n if (done) {\n System.out.println(\"file is uploaded successfully..............\");\n }\n\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp : \"+e);\n } finally {\n try {\n if (ftpClient.isConnected()) {\n ftpClient.logout();\n ftpClient.disconnect();\n }\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp logout/disconnect : \"+e);\n }\n }\n\n }", "void transferred(long num);", "@Override\r\n public void onNewDatagram(SimpleAsciiProtocol.Datagram datagram) {\n }", "PToP.S2BRelay getS2BRelay();", "public pam_message(Pointer src) {\n useMemory(src);\n read();\n }", "public void handleIncoming() {\n\t\t// parse the packet payload\n\t\tPair<Packet,Integer> pp = fwdr.receivePkt();\n\t\tPacket p = pp.left; int lnk = pp.right;\n\n\t\tString[] lines = p.payload.split(\"\\n\");\n\t\tif (!lines[0].equals(\"RPv0\")) return;\n\n\t\tString[] chunks = lines[1].split(\":\");\n\t\tif (!chunks[0].equals(\"type\")) return;\n\t\tString type = chunks[1].trim();\n\t\t\n\t\t// if it's an route advert, call handleAdvert\n\t\tif (type.equals(\"advert\")){\n\t\t\thandleAdvert(lines, lnk);\n\t\t}\n\t\t// if it's an link failure advert, call handleFailureAdvert\n\t\tif (type.equals(\"fadvert\")){\n\t\t\thandleFailureAdvert(lines, lnk);\n\t\t}\n\t\t// if it's a hello, echo it back\n\t\tif (type.equals(\"hello\")){\n\t\t\tchunks = lines[2].split(\":\");\n\t\t\tif (!chunks[0].equals(\"timestamp\")) return;\n\t\t\tString timestamp = chunks[1].trim();\n\t\t\tp.payload = String.format(\"RPv0\\ntype: echo\\n\"\n\t\t\t\t\t+ \"timestamp: %s \\n\", timestamp);\n\t\t\tfwdr.sendPkt(p, lnk);\n\t\t}\n\t\t// else it's a reply to a hello packet\n\t\t// use timestamp to determine round-trip delay\n\t\t// use this to update the link cost using exponential\n\t\t// weighted moving average method\n\t\t// also, update link cost statistics\n\t\t// also, set gotReply to true\n\t\telse {\n\t\t\tchunks = lines[2].split(\":\");\n\t\t\tif (!chunks[0].equals(\"timestamp\")) return;\n\t\t\tString timeString = chunks[1].trim();\n\t\t\tdouble timestamp = Double.parseDouble(timeString);\n\t\t\tdouble rtDelay = now - timestamp;\n\n\t\t\tLinkInfo link = lnkVec.get(lnk);\n\t\t\tlink.helloState = 3;\n\t\t\tlink.cost = rtDelay/2;\n\t\t\tRoute rt = new Route();\n\t\t\trt.outLink = lnk;\n\t\t\tboolean match = false;\n\t\t\tfor (Route rte : rteTbl){\n\t\t\t\tif (rte.outLink == lnk){\n\t\t\t\t\trt = rte;\n\t\t\t\t\tmatch = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\tRoute newRt = rt;\n\t\t\tlink.count = 0;\n\t\t\tlink.totalCost = 0;\n\t\t\tfor (LinkInfo l : lnkVec){\n\t\t\t\tif(l.helloState != 0){\n\t\t\t\t\tlink.count++;\n\t\t\t\t\tlink.totalCost += l.cost;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewRt.cost = link.cost;\n\t\t\tif (updateRoute(rt,newRt)){\n\t\t\t\tlink.cost = rt.cost;\n\t\t\t}\n\t\t\tif (link.cost > link.maxCost){\n\t\t\t\tlink.maxCost = link.cost;\n\t\t\t}\n\t\t\tif (link.cost < link.minCost){\n\t\t\t\tlink.minCost = link.cost;\n\t\t\t}\n\t\t\tlink.gotReply = true;\n\t\t\tlnkVec.set(lnk, link);\n\t\t}\n\n\t}", "public interface Transport {\n\n /**\n * This method returns id of the current transport\n * @return\n */\n String id();\n\n /**\n * This methos returns Id of the upstream node\n * @return\n */\n String getUpstreamId();\n\n /**\n * This method returns random\n *\n * @param id\n * @param exclude\n * @return\n */\n String getRandomDownstreamFrom(String id, String exclude);\n\n /**\n * This method returns consumer that accepts messages for delivery\n * @return\n */\n Consumer<VoidMessage> outgoingConsumer();\n\n /**\n * This method returns flow of messages for parameter server\n * @return\n */\n Publisher<INDArrayMessage> incomingPublisher();\n\n /**\n * This method starts this Transport instance\n */\n void launch();\n\n /**\n * This method will start this Transport instance\n */\n void launchAsMaster();\n\n /**\n * This method shuts down this Transport instance\n */\n void shutdown();\n\n /**\n * This method will send message to the network, using tree structure\n * @param message\n */\n void propagateMessage(VoidMessage message, PropagationMode mode) throws IOException;\n\n /**\n * This method will send message to the node specified by Id\n *\n * @param message\n * @param id\n */\n void sendMessage(VoidMessage message, String id);\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id) throws InterruptedException;\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id, long waitTime, TimeUnit timeUnit) throws InterruptedException;\n\n /**\n * This method will be invoked for all incoming messages\n * PLEASE NOTE: this method is mostly suited for tests\n *\n * @param message\n */\n void processMessage(VoidMessage message);\n\n\n /**\n * This method allows to set callback instance, which will be called upon restart event\n * @param callback\n */\n void setRestartCallback(RestartCallback callback);\n\n /**\n * This methd allows to set callback instance for various\n * @param cls\n * @param callback\n * @param <T1> RequestMessage class\n * @param <T2> ResponseMessage class\n */\n <T extends RequestMessage> void addRequestConsumer(Class<T> cls, Consumer<T> consumer);\n\n /**\n * This method will be called if mesh update was received\n *\n * PLEASE NOTE: This method will be called ONLY if new mesh differs from current one\n * @param mesh\n */\n void onMeshUpdate(MeshOrganizer mesh);\n\n /**\n * This method will be called upon remap request\n * @param id\n */\n void onRemap(String id);\n\n /**\n * This method returns total number of nodes known to this Transport\n * @return\n */\n int totalNumberOfNodes();\n\n\n /**\n * This method returns ID of the root node\n * @return\n */\n String getRootId();\n\n /**\n * This method checks if all connections required for work are established\n * @return true\n */\n boolean isConnected();\n\n /**\n * This method checks if this node was properly introduced to driver\n * @return\n */\n boolean isIntroduced();\n\n /**\n * This method checks connection to the given node ID, and if it's not connected - establishes connection\n * @param id\n */\n void ensureConnection(String id);\n}", "@Override\n public void onReceivedData(byte[] arg0) {\n try {\n ultimoDadoRecebido = ultimoDadoRecebido + new String(arg0, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "private void forwardData(byte[] data) throws UnknownHostException,\n MalformedAddressException {\n }", "@Override\r\n\tpublic void encode() throws PCEPProtocolViolationException {\n\t\tint length=0;\r\n\r\n\t\tif (endPointIPv4!=null){\r\n\t\t\tendPointIPv4.encode();\r\n\t\t\tlength=length+endPointIPv4.getTotalTLVLength();\r\n\t\t}\r\n\t\telse if (unnumberedEndpoint!=null){\r\n\t\t\tunnumberedEndpoint.encode();\r\n\t\t\tlength=length+unnumberedEndpoint.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointStorage!=null){\r\n\t\t\tendPointStorage.encode();\r\n\t\t\tlength=length+endPointStorage.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointServer!=null){\r\n\t\t\tendPointServer.encode();\r\n\t\t\tlength=length+endPointServer.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointApplication!=null){\r\n\t\t\tendPointApplication.encode();\r\n\t\t\tlength=length+endPointApplication.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (xifiEndPointTLV != null)\r\n\t\t{\r\n\t\t\txifiEndPointTLV.encode();\r\n\t\t\tlength = length + xifiEndPointTLV.getTotalTLVLength();\r\n\t\t}\r\n\t\telse if (endPointDataPathID != null)\r\n\t\t{\r\n\t\t\t//log.info(\"EndPoint endPointDataPathID !=null \");\r\n\t\t\tendPointDataPathID.encode();\r\n\t\t\t//log.info(\"EndPoint endPointDataPathID tras encode:: \"+endPointDataPathID.toString());\r\n\t\t\tlength = length + endPointDataPathID.getTotalTLVLength();\r\n\t\t}\r\n\t\telse if (endPointUnnumberedDataPathID != null)\r\n\t\t{\r\n\t\t\t//log.info(\"EndPoint endPointDataPathID !=null \");\r\n\t\t\tendPointUnnumberedDataPathID.encode();\r\n\t\t\t//log.info(\"EndPoint endPointDataPathID tras encode:: \"+endPointDataPathID.toString());\r\n\t\t\tlength = length + endPointUnnumberedDataPathID.getTotalTLVLength();\r\n\t\t}\r\n\r\n\r\n\t\tthis.setLength(length);\r\n\t\tthis.bytes=new byte[this.getLength()];\r\n\t\tint offset=0;\r\n\r\n\t\tif (endPointIPv4!=null){\r\n\t\t\tSystem.arraycopy(endPointIPv4.getTlv_bytes(),0,this.bytes,offset,endPointIPv4.getTotalTLVLength());\r\n\t\t\toffset=offset+endPointIPv4.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (unnumberedEndpoint!=null){\r\n\t\t\tSystem.arraycopy(unnumberedEndpoint.getTlv_bytes(),0,this.bytes,offset,unnumberedEndpoint.getTotalTLVLength());\r\n\t\t\toffset=offset+unnumberedEndpoint.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointStorage!=null){\r\n\t\t\tSystem.arraycopy(endPointStorage.getTlv_bytes(),0,this.bytes,offset,endPointStorage.getTotalTLVLength());\r\n\t\t\toffset=offset+endPointStorage.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointServer!=null){\r\n\t\t\tSystem.arraycopy(endPointServer.getTlv_bytes(),0,this.bytes,offset,endPointServer.getTotalTLVLength());\r\n\t\t\toffset=offset+endPointServer.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (endPointApplication!=null){\r\n\t\t\tSystem.arraycopy(endPointApplication.getTlv_bytes(),0,this.bytes,offset,endPointApplication.getTotalTLVLength());\r\n\t\t\toffset=offset+endPointApplication.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t\telse if (xifiEndPointTLV != null)\r\n\t\t{\r\n\t\t\tSystem.arraycopy(xifiEndPointTLV.getTlv_bytes(),0,this.bytes,offset,xifiEndPointTLV.getTotalTLVLength());\r\n\t\t\toffset = offset + xifiEndPointTLV.getTotalTLVLength();\r\n\t\t}\r\n\t\telse if (endPointDataPathID != null)\r\n\t\t{\r\n\t\t\tSystem.arraycopy(endPointDataPathID.getTlv_bytes(),0,this.bytes,offset,endPointDataPathID.getTotalTLVLength());\r\n\t\t\toffset = offset + endPointDataPathID.getTotalTLVLength();\r\n\t\t}\r\n\t\telse if (endPointUnnumberedDataPathID != null)\r\n\t\t{\r\n\t\t\tSystem.arraycopy(endPointUnnumberedDataPathID.getTlv_bytes(),0,this.bytes,offset,endPointUnnumberedDataPathID.getTotalTLVLength());\r\n\t\t\toffset = offset + endPointUnnumberedDataPathID.getTotalTLVLength();\r\n\t\t}\r\n\r\n\t}", "private boolean read (SocketChannel chan, SelectionKey key) {\n HttpTransaction msg;\n boolean res;\n try {\n InputStream is = new BufferedInputStream (new NioInputStream (chan));\n String requestline = readLine (is);\n MessageHeader mhead = new MessageHeader (is);\n String clen = mhead.findValue (\"Content-Length\");\n String trferenc = mhead.findValue (\"Transfer-Encoding\");\n String data = null;\n if (trferenc != null && trferenc.equals (\"chunked\"))\n data = new String (readChunkedData (is));\n else if (clen != null)\n data = new String (readNormalData (is, Integer.parseInt (clen)));\n String[] req = requestline.split (\" \");\n if (req.length < 2) {\n /* invalid request line */\n return false;\n }\n String cmd = req[0];\n URI uri = null;\n try {\n uri = new URI (req[1]);\n msg = new HttpTransaction (this, cmd, uri, mhead, data, null, key);\n cb.request (msg);\n } catch (URISyntaxException e) {\n System.err.println (\"Invalid URI: \" + e);\n msg = new HttpTransaction (this, cmd, null, null, null, null, key);\n msg.sendResponse (501, \"Whatever\");\n }\n res = false;\n } catch (IOException e) {\n res = true;\n }\n return res;\n }", "public void transferWrite( String sContract,String sMchCode,String sMchNameDes,String sMchCodeCont,String sTestPointId,String sPmNo,String pmDescription,String insNote) \n {\n ASPManager mgr = getASPManager();\n String repby=null;\n\n cmd = trans.addEmptyCommand(\"HEAD\",\"FAULT_REPORT_API.New__\",headblk);\n cmd.setOption(\"ACTION\",\"PREPARE\");\n trans = mgr.perform(trans);\n data = trans.getBuffer(\"HEAD/DATA\");\n\n trans.clear();\n cmd = trans.addCustomFunction(\"GETUSER\",\"Fnd_Session_API.Get_Fnd_User\",\"ISUSER\");\n\n cmd = trans.addCustomFunction(\"GETREPBY\",\"Person_Info_API.Get_Id_For_User\",\"REPORTED_BY\");\n cmd.addReference(\"ISUSER\",\"GETUSER/DATA\");\n\n cmd = trans.addCustomFunction(\"REPBYID\",\"Company_Emp_API.Get_Max_Employee_Id\",\"REPORTED_BY_ID\");\n cmd.addParameter(\"COMPANY\",data.getFieldValue(\"COMPANY\"));\n cmd.addReference(\"REPORTED_BY\",\"GETREPBY/DATA\");\n\n trans = mgr.perform(trans);\n repby = trans.getValue(\"GETREPBY/DATA/REPORTED_BY\");\n reportById = trans.getValue(\"REPBYID/DATA/REPORTED_BY_ID\");\n\n data.setValue(\"REPORTED_BY\",repby);\n data.setValue(\"REPORTED_BY_ID\",reportById);\n data.setValue(\"CONTRACT\",sContract);\n data.setValue(\"MCH_CODE\",sMchCode);\n data.setValue(\"MCH_CODE_DESCRIPTION\",sMchNameDes);\n data.setValue(\"MCH_CODE_CONTRACT\",sMchCodeCont);\n data.setValue(\"TEST_POINT_ID\",sTestPointId);\n data.setValue(\"PM_NO\",sPmNo);\n data.setValue(\"PM_DESCR\",pmDescription);\n data.setValue(\"NOTE\",insNote);\n //Bug 76003, start\n data.setValue(\"CONNECTION_TYPE_DB\",\"EQUIPMENT\");\n //Bug 76003, end\n\n headset.addRow(data);\n }", "public LWTRTPdu dataReq(LWTRTPdu lwtrtPdu) throws IncorrectTransitionException;", "static void perform_sphl(String passed){\n\t\tint type = type_of_sphl(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\ttransfer_hl_to_sp(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "abstract void read();", "protected void send(O operation)\n {\n }", "public void receiveBlob( BigInteger theBlob );", "private void onReceivedResponseData(org.apache.http.HttpResponse r14, com.tencent.tmassistantsdk.protocol.jce.DownloadChunkLogInfo r15) {\n /*\n r13 = this;\n r2 = 705; // 0x2c1 float:9.88E-43 double:3.483E-321;\n r6 = 206; // 0xce float:2.89E-43 double:1.02E-321;\n r7 = 0;\n r12 = 0;\n r0 = r14.getEntity();\n r1 = r13.verifyTotalLen(r14, r0);\n if (r1 != 0) goto L_0x0022;\n L_0x0010:\n r0 = \"_DownloadTask\";\n r1 = \"verifyTotalLen false\";\n com.tencent.tmassistantsdk.util.TMLog.i(r0, r1);\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\n r1 = \"totalLen is not match the requestSize\";\n r0.<init>(r2, r1);\n throw r0;\n L_0x0022:\n r1 = r13.mDownloadInfo;\n r2 = r1.getTotalSize();\n r4 = 0;\n r1 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1));\n if (r1 != 0) goto L_0x015c;\n L_0x002e:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n r2 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;\n if (r1 != r2) goto L_0x00f9;\n L_0x003a:\n r1 = r13.mDownloadInfo;\n r2 = r0.getContentLength();\n r1.setTotalSize(r2);\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"HTTPCode 200, totalBytes:\";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.i(r1, r2);\n L_0x005f:\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"first start downloadinfoTotalSize = \";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\n if (r1 == 0) goto L_0x00a0;\n L_0x0084:\n r1 = r1.getValue();\n r1 = com.tencent.tmassistantsdk.downloadservice.ByteRange.parseContentRange(r1);\n r2 = r1.getStart();\n r15.responseRangePosition = r2;\n r2 = r1.getEnd();\n r4 = r1.getStart();\n r2 = r2 - r4;\n r4 = 1;\n r2 = r2 + r4;\n r15.responseRangeLength = r2;\n L_0x00a0:\n r1 = r13.mDownloadInfo;\n r2 = r1.getTotalSize();\n r15.responseContentLength = r2;\n L_0x00a8:\n r1 = r13.mSaveFile;\n if (r1 != 0) goto L_0x00bb;\n L_0x00ac:\n r1 = new com.tencent.tmassistantsdk.storage.TMAssistantFile;\n r2 = r13.mDownloadInfo;\n r2 = r2.mTempFileName;\n r3 = r13.mDownloadInfo;\n r3 = r3.mFileName;\n r1.<init>(r2, r3);\n r13.mSaveFile = r1;\n L_0x00bb:\n r2 = 0;\n r10 = r0.getContent();\t Catch:{ SocketException -> 0x0406 }\n r0 = \"_DownloadTask\";\n r1 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x0406 }\n r4 = \"start write file, fileName: \";\n r1.<init>(r4);\t Catch:{ SocketException -> 0x0406 }\n r4 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x0406 }\n r4 = r4.mFileName;\t Catch:{ SocketException -> 0x0406 }\n r1 = r1.append(r4);\t Catch:{ SocketException -> 0x0406 }\n r1 = r1.toString();\t Catch:{ SocketException -> 0x0406 }\n com.tencent.tmassistantsdk.util.TMLog.i(r0, r1);\t Catch:{ SocketException -> 0x0406 }\n r8 = r2;\n L_0x00dc:\n r0 = r13.mRecvBuf;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r10.read(r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r3 <= 0) goto L_0x00eb;\n L_0x00e4:\n r0 = r13.mStopTask;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0262;\n L_0x00e8:\n r10.close();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x00eb:\n r0 = r13.mSaveFile;\n if (r0 == 0) goto L_0x00f6;\n L_0x00ef:\n r0 = r13.mSaveFile;\n r0.close();\n r13.mSaveFile = r12;\n L_0x00f6:\n r15.receiveDataSize = r8;\n return;\n L_0x00f9:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n if (r1 != r6) goto L_0x0135;\n L_0x0103:\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\n r2 = r13.mDownloadInfo;\n r1 = r1.getValue();\n r4 = com.tencent.tmassistantsdk.downloadservice.ByteRange.getTotalSize(r1);\n r2.setTotalSize(r4);\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"HTTPCode 206, totalBytes:\";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.i(r1, r2);\n goto L_0x005f;\n L_0x0135:\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"statusCode=\";\n r2.<init>(r3);\n r3 = r14.getStatusLine();\n r3 = r3.getStatusCode();\n r2 = r2.append(r3);\n r3 = \" onReceivedResponseData error.\";\n r2 = r2.append(r3);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\n goto L_0x005f;\n L_0x015c:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n if (r1 != r6) goto L_0x00a8;\n L_0x0166:\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\t Catch:{ Throwable -> 0x0214 }\n r2 = r1.getValue();\t Catch:{ Throwable -> 0x0214 }\n r2 = com.tencent.tmassistantsdk.downloadservice.ByteRange.parseContentRange(r2);\t Catch:{ Throwable -> 0x0214 }\n r3 = r1.getValue();\t Catch:{ Throwable -> 0x0214 }\n r4 = com.tencent.tmassistantsdk.downloadservice.ByteRange.getTotalSize(r3);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r15.responseRangePosition = r8;\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getEnd();\t Catch:{ Throwable -> 0x0214 }\n r10 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r8 = r8 - r10;\n r10 = 1;\n r8 = r8 + r10;\n r15.responseRangeLength = r8;\t Catch:{ Throwable -> 0x0214 }\n r15.responseContentLength = r4;\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"totalSize = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r4);\t Catch:{ Throwable -> 0x0214 }\n r8 = \" downloadinfoTotalSize = \";\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r8.getTotalSize();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.w(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"mReceivedBytes = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r8.mReceivedBytes;\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.i(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"start = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = \", end = \";\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getEnd();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.i(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r2 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r6 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r6.mReceivedBytes;\t Catch:{ Throwable -> 0x0214 }\n r2 = (r2 > r8 ? 1 : (r2 == r8 ? 0 : -1));\n if (r2 == 0) goto L_0x022a;\n L_0x0209:\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ Throwable -> 0x0214 }\n r1 = 706; // 0x2c2 float:9.9E-43 double:3.49E-321;\n r2 = \"The received size is not equal with ByteRange.\";\n r0.<init>(r1, r2);\t Catch:{ Throwable -> 0x0214 }\n throw r0;\t Catch:{ Throwable -> 0x0214 }\n L_0x0214:\n r0 = move-exception;\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ all -> 0x021d }\n r2 = 704; // 0x2c0 float:9.87E-43 double:3.48E-321;\n r1.<init>(r2, r0);\t Catch:{ all -> 0x021d }\n throw r1;\t Catch:{ all -> 0x021d }\n L_0x021d:\n r0 = move-exception;\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x0229;\n L_0x0222:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n L_0x0229:\n throw r0;\n L_0x022a:\n r2 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r2 = r2.getTotalSize();\t Catch:{ Throwable -> 0x0214 }\n r2 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1));\n if (r2 == 0) goto L_0x023f;\n L_0x0234:\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ Throwable -> 0x0214 }\n r1 = 705; // 0x2c1 float:9.88E-43 double:3.483E-321;\n r2 = \"The total size is not equal with ByteRange.\";\n r0.<init>(r1, r2);\t Catch:{ Throwable -> 0x0214 }\n throw r0;\t Catch:{ Throwable -> 0x0214 }\n L_0x023f:\n r2 = \"_DownloadTask\";\n r3 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r4 = \"response ByteRange: \";\n r3.<init>(r4);\t Catch:{ Throwable -> 0x0214 }\n r1 = r3.append(r1);\t Catch:{ Throwable -> 0x0214 }\n r1 = r1.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.d(r2, r1);\t Catch:{ Throwable -> 0x0214 }\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x00a8;\n L_0x0259:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n goto L_0x00a8;\n L_0x0262:\n r0 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0 + r4;\n r2 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r2.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1));\n if (r2 > 0) goto L_0x03be;\n L_0x0272:\n r2 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r2.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1));\n if (r0 != 0) goto L_0x0315;\n L_0x027c:\n r6 = 1;\n L_0x027d:\n r0 = r13.mSaveFile;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mRecvBuf;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 0;\n r4 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r4.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.write(r1, r2, r3, r4, r6);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 != 0) goto L_0x03b4;\n L_0x028c:\n r0 = com.tencent.tmassistantsdk.storage.TMAssistantFile.getSavePathRootDir();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = com.tencent.tmassistantsdk.downloadservice.DownloadHelper.isSpaceEnough(r0, r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0367;\n L_0x029c:\n r0 = com.tencent.tmassistantsdk.storage.TMAssistantFile.isSDCardExistAndCanWrite();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0318;\n L_0x02a2:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 703; // 0x2bf float:9.85E-43 double:3.473E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x02ef:\n r0 = move-exception;\n r2 = r8;\n L_0x02f1:\n r1 = \"_DownloadTask\";\n r4 = \"\";\n r5 = 0;\n r5 = new java.lang.Object[r5];\t Catch:{ all -> 0x0305 }\n com.tencent.mm.sdk.platformtools.w.printErrStackTrace(r1, r0, r4, r5);\t Catch:{ all -> 0x0305 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ all -> 0x0305 }\n r4 = 605; // 0x25d float:8.48E-43 double:2.99E-321;\n r1.<init>(r4, r0);\t Catch:{ all -> 0x0305 }\n throw r1;\t Catch:{ all -> 0x0305 }\n L_0x0305:\n r0 = move-exception;\n r8 = r2;\n L_0x0307:\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x0312;\n L_0x030b:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n L_0x0312:\n r15.receiveDataSize = r8;\n throw r0;\n L_0x0315:\n r6 = r7;\n goto L_0x027d;\n L_0x0318:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, no sdCard! fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 711; // 0x2c7 float:9.96E-43 double:3.513E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x0365:\n r0 = move-exception;\n goto L_0x0307;\n L_0x0367:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, no enough space! fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 710; // 0x2c6 float:9.95E-43 double:3.51E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x03b4:\n r0 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0.updateReceivedSize(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r8 = r8 + r0;\n goto L_0x00dc;\n L_0x03be:\n r0 = \"write file size too long.\";\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = \"write file size too long.\\r\\nreadedLen: \";\n r2.<init>(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\nreceivedSize: \";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r3.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\ntotalSize: \";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r3.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\nisTheEndData: false\";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 703; // 0x2bf float:9.85E-43 double:3.473E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x0406:\n r0 = move-exception;\n goto L_0x02f1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.tmassistantsdk.downloadservice.DownloadTask.onReceivedResponseData(org.apache.http.HttpResponse, com.tencent.tmassistantsdk.protocol.jce.DownloadChunkLogInfo):void\");\n }", "private void receiveOutbound(ByteBuffer src) {\n\n // recv Y+E(H(X+Y)+tsB, sk, Y[239:255])\n // Read in Y, which is the first part of message #2\n if (_state == State.OB_SENT_X && src.hasRemaining()) {\n int toGet = Math.min(src.remaining(), XY_SIZE - _received);\n src.get(_Y, _received, toGet);\n _received += toGet;\n if (_received < XY_SIZE)\n return;\n\n try {\n _dh.setPeerPublicValue(_Y);\n _dh.getSessionKey(); // force the calc\n if (_log.shouldLog(Log.DEBUG))\n _log.debug(prefix()+\"DH session key calculated (\" + _dh.getSessionKey().toBase64() + \")\");\n changeState(State.OB_GOT_Y);\n _received = 0;\n } catch (DHSessionKeyBuilder.InvalidPublicParameterException e) {\n _context.statManager().addRateData(\"ntcp.invalidDH\", 1);\n fail(\"Invalid X\", e);\n return;\n } catch (IllegalStateException ise) {\n // setPeerPublicValue()\n fail(\"reused keys?\", ise);\n return;\n }\n }\n\n // Read in the rest of message #2\n if (_state == State.OB_GOT_Y && src.hasRemaining()) {\n int toGet = Math.min(src.remaining(), HXY_TSB_PAD_SIZE - _received);\n src.get(_e_hXY_tsB, _received, toGet);\n _received += toGet;\n if (_received < HXY_TSB_PAD_SIZE)\n return;\n\n if (_log.shouldLog(Log.DEBUG)) _log.debug(prefix() + \"received _e_hXY_tsB fully\");\n byte hXY_tsB[] = new byte[HXY_TSB_PAD_SIZE];\n _context.aes().decrypt(_e_hXY_tsB, 0, hXY_tsB, 0, _dh.getSessionKey(), _Y, XY_SIZE-AES_SIZE, HXY_TSB_PAD_SIZE);\n byte XY[] = new byte[XY_SIZE + XY_SIZE];\n System.arraycopy(_X, 0, XY, 0, XY_SIZE);\n System.arraycopy(_Y, 0, XY, XY_SIZE, XY_SIZE);\n byte[] h = SimpleByteCache.acquire(HXY_SIZE);\n _context.sha().calculateHash(XY, 0, XY_SIZE + XY_SIZE, h, 0);\n if (!DataHelper.eq(h, 0, hXY_tsB, 0, HXY_SIZE)) {\n SimpleByteCache.release(h);\n _context.statManager().addRateData(\"ntcp.invalidHXY\", 1);\n fail(\"Invalid H(X+Y) - mitm attack attempted?\");\n return;\n }\n SimpleByteCache.release(h);\n changeState(State.OB_GOT_HXY);\n _received = 0;\n // their (Bob's) timestamp in seconds\n _tsB = DataHelper.fromLong(hXY_tsB, HXY_SIZE, 4);\n long now = _context.clock().now();\n // rtt from sending #1 to receiving #2\n long rtt = now - _con.getCreated();\n // our (Alice's) timestamp in seconds\n _tsA = (now + 500) / 1000;\n _peerSkew = (now - (_tsB * 1000) - (rtt / 2) + 500) / 1000; \n if (_log.shouldLog(Log.DEBUG))\n _log.debug(prefix()+\"h(X+Y) is correct, skew = \" + _peerSkew);\n\n // the skew is not authenticated yet, but it is certainly fatal to\n // the establishment, so fail hard if appropriate\n long diff = 1000*Math.abs(_peerSkew);\n if (!_context.clock().getUpdatedSuccessfully()) {\n // Adjust the clock one time in desperation\n // We are Alice, he is Bob, adjust to match Bob\n _context.clock().setOffset(1000 * (0 - _peerSkew), true);\n _peerSkew = 0;\n if (diff != 0)\n _log.logAlways(Log.WARN, \"NTP failure, NTCP adjusting clock by \" + DataHelper.formatDuration(diff));\n } else if (diff >= Router.CLOCK_FUDGE_FACTOR) {\n _context.statManager().addRateData(\"ntcp.invalidOutboundSkew\", diff);\n _transport.markReachable(_con.getRemotePeer().calculateHash(), false);\n // Only banlist if we know what time it is\n _context.banlist().banlistRouter(DataHelper.formatDuration(diff),\n _con.getRemotePeer().calculateHash(),\n _x(\"Excessive clock skew: {0}\"));\n _transport.setLastBadSkew(_peerSkew);\n fail(\"Clocks too skewed (\" + diff + \" ms)\", null, true);\n return;\n } else if (_log.shouldLog(Log.DEBUG)) {\n _log.debug(prefix()+\"Clock skew: \" + diff + \" ms\");\n }\n\n // now prepare and send our response\n // send E(#+Alice.identity+tsA+padding+S(X+Y+Bob.identHash+tsA+tsB), sk, hX_xor_Bob.identHash[16:31])\n int sigSize = XY_SIZE + XY_SIZE + HXY_SIZE + 4+4;//+12;\n byte preSign[] = new byte[sigSize];\n System.arraycopy(_X, 0, preSign, 0, XY_SIZE);\n System.arraycopy(_Y, 0, preSign, XY_SIZE, XY_SIZE);\n System.arraycopy(_con.getRemotePeer().calculateHash().getData(), 0, preSign, XY_SIZE + XY_SIZE, HXY_SIZE);\n DataHelper.toLong(preSign, XY_SIZE + XY_SIZE + HXY_SIZE, 4, _tsA);\n DataHelper.toLong(preSign, XY_SIZE + XY_SIZE + HXY_SIZE + 4, 4, _tsB);\n // hXY_tsB has 12 bytes of padding (size=48, tsB=4 + hXY=32)\n Signature sig = _context.dsa().sign(preSign, _context.keyManager().getSigningPrivateKey());\n\n byte ident[] = _context.router().getRouterInfo().getIdentity().toByteArray();\n // handle variable signature size\n int min = 2 + ident.length + 4 + sig.length();\n int rem = min % AES_SIZE;\n int padding = 0;\n if (rem > 0)\n padding = AES_SIZE - rem;\n byte preEncrypt[] = new byte[min+padding];\n DataHelper.toLong(preEncrypt, 0, 2, ident.length);\n System.arraycopy(ident, 0, preEncrypt, 2, ident.length);\n DataHelper.toLong(preEncrypt, 2+ident.length, 4, _tsA);\n if (padding > 0)\n _context.random().nextBytes(preEncrypt, 2 + ident.length + 4, padding);\n System.arraycopy(sig.getData(), 0, preEncrypt, 2+ident.length+4+padding, sig.length());\n\n _prevEncrypted = new byte[preEncrypt.length];\n _context.aes().encrypt(preEncrypt, 0, _prevEncrypted, 0, _dh.getSessionKey(),\n _hX_xor_bobIdentHash, _hX_xor_bobIdentHash.length-AES_SIZE, preEncrypt.length);\n\n changeState(State.OB_SENT_RI);\n _transport.getPumper().wantsWrite(_con, _prevEncrypted);\n }\n\n // Read in message #4\n if (_state == State.OB_SENT_RI && src.hasRemaining()) {\n // we are receiving their confirmation\n\n // recv E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev)\n int off = 0;\n if (_e_bobSig == null) {\n // handle variable signature size\n int siglen = _con.getRemotePeer().getSigningPublicKey().getType().getSigLen();\n int rem = siglen % AES_SIZE;\n int padding;\n if (rem > 0)\n padding = AES_SIZE - rem;\n else\n padding = 0;\n _e_bobSig = new byte[siglen + padding];\n if (_log.shouldLog(Log.DEBUG))\n _log.debug(prefix() + \"receiving E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev) (remaining? \" +\n src.hasRemaining() + \")\");\n } else {\n off = _received;\n if (_log.shouldLog(Log.DEBUG))\n _log.debug(prefix() + \"continuing to receive E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev) (remaining? \" +\n src.hasRemaining() + \" off=\" + off + \" recv=\" + _received + \")\");\n }\n while (_state == State.OB_SENT_RI && src.hasRemaining()) {\n _e_bobSig[off++] = src.get();\n _received++;\n\n if (off >= _e_bobSig.length) {\n changeState(State.OB_GOT_SIG);\n byte bobSig[] = new byte[_e_bobSig.length];\n _context.aes().decrypt(_e_bobSig, 0, bobSig, 0, _dh.getSessionKey(),\n _e_hXY_tsB, HXY_TSB_PAD_SIZE - AES_SIZE, _e_bobSig.length);\n // ignore the padding\n // handle variable signature size\n SigType type = _con.getRemotePeer().getSigningPublicKey().getType();\n int siglen = type.getSigLen();\n // we don't need to do this if no padding!\n byte bobSigData[] = new byte[siglen];\n System.arraycopy(bobSig, 0, bobSigData, 0, siglen);\n Signature sig = new Signature(type, bobSigData);\n\n byte toVerify[] = new byte[XY_SIZE + XY_SIZE + HXY_SIZE +4+4];\n int voff = 0;\n System.arraycopy(_X, 0, toVerify, voff, XY_SIZE); voff += XY_SIZE;\n System.arraycopy(_Y, 0, toVerify, voff, XY_SIZE); voff += XY_SIZE;\n System.arraycopy(_context.routerHash().getData(), 0, toVerify, voff, HXY_SIZE); voff += HXY_SIZE;\n DataHelper.toLong(toVerify, voff, 4, _tsA); voff += 4;\n DataHelper.toLong(toVerify, voff, 4, _tsB); voff += 4;\n\n boolean ok = _context.dsa().verifySignature(sig, toVerify, _con.getRemotePeer().getSigningPublicKey());\n if (!ok) {\n _context.statManager().addRateData(\"ntcp.invalidSignature\", 1);\n fail(\"Signature was invalid - attempt to spoof \" + _con.getRemotePeer().calculateHash().toBase64() + \"?\");\n } else {\n if (_log.shouldLog(Log.DEBUG))\n _log.debug(prefix() + \"signature verified from Bob. done!\");\n byte nextWriteIV[] = SimpleByteCache.acquire(AES_SIZE);\n System.arraycopy(_prevEncrypted, _prevEncrypted.length-AES_SIZE, nextWriteIV, 0, AES_SIZE);\n // this does not copy the nextWriteIV, do not release to cache\n // We are Alice, he is Bob, clock skew is Bob - Alice\n // skew in seconds\n _con.finishOutboundEstablishment(_dh.getSessionKey(), _peerSkew, nextWriteIV, _e_bobSig);\n changeState(State.VERIFIED);\n if (src.hasRemaining()) {\n // process \"extra\" data\n // This is fairly common for outbound, where Bob may send his updated RI\n if (_log.shouldInfo())\n _log.info(\"extra data \" + src.remaining() + \" on \" + this);\n _con.recvEncryptedI2NP(src);\n }\n releaseBufs(true);\n // if socket gets closed this will be null - prevent NPE\n InetAddress ia = _con.getChannel().socket().getInetAddress();\n if (ia != null)\n _transport.setIP(_con.getRemotePeer().calculateHash(), ia.getAddress());\n }\n return;\n }\n }\n }\n\n // check for remaining data\n if ((_state == State.VERIFIED || _state == State.CORRUPT) && src.hasRemaining()) {\n if (_log.shouldWarn())\n _log.warn(\"Received unexpected \" + src.remaining() + \" on \" + this, new Exception());\n }\n }", "void updateTransmission(Transmission transmission);", "org.hyperledger.fabric.protos.token.Transaction.PlainTransferOrBuilder getPlainTransferOrBuilder();", "abstract void GetInfoPacket() ;", "public static void main(String[] args) throws CloneNotSupportedException, IOException, NoSuchAlgorithmException {\n\n InputStream source = null, source2 = null;\n try {\n //source = retrieveStream(url);\n source = new FileInputStream(\"C:\\\\1\\\\json.js\");\n source2 = new FileInputStream(\"C:\\\\1\\\\json2.js\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n Gson gson = new Gson();\n Reader reader = new InputStreamReader(source);\n Book book = gson.fromJson(reader, Book.class);\n Reader reader2 = new InputStreamReader(source2);\n Book book2 = gson.fromJson(reader2, Book.class);\n\n Transport sender = new Transport(\"95.142.192.65\", 80);\n sender.connect();\n\n SerializationUtils.setBook2(book2);\n\n // создаем req_pq\n Constructor req_pq = (Constructor) book2.getConstructorByPredicate(\"req_pq\").clone();\n byte[] b2 = new byte[16];\n new Random().nextBytes(b2);\n req_pq.getParamByName(\"nonce\").setData(b2);\n\n // отправляем req_pq\n Message m_req_pq = new Message(SerializationUtils.serialize(req_pq));\n Packet p_req_pq = new Packet(m_req_pq, 0);\n Packet p_resPQ = sender.send(p_req_pq);\n\n // получаем resPQ\n Constructor resPQ = SerializationUtils.deserialize(p_resPQ.getM().getMessage_data());\n\n // раскладываем pq на 2 простых сомножителя\n BigInteger pq = new BigInteger((byte[])resPQ.getParamByName(\"pq\").getData());\n System.out.println(\"pq = \" + pq.toString());\n\n PollardRho prho = new PollardRho();\n prho.factor(pq);\n BigInteger p = prho.getfactors2()[0];\n BigInteger q = prho.getfactors2()[1];\n prho.clear();\n\n if (p.compareTo(q) == 1){\n throw new RuntimeException(\"ERROR p > q !!!!\");\n }\n\n // создаем p_q_inner_data\n Constructor p_q_inner_data = (Constructor)book2.getConstructorByPredicate(\"p_q_inner_data\").clone();\n p_q_inner_data.getParamByName(\"pq\").setData(resPQ.getParamByName(\"pq\").getData());\n p_q_inner_data.getParamByName(\"p\").setData(p.toByteArray());\n p_q_inner_data.getParamByName(\"q\").setData(q.toByteArray());\n p_q_inner_data.getParamByName(\"nonce\").setData(resPQ.getParamByName(\"nonce\").getData());\n p_q_inner_data.getParamByName(\"server_nonce\").setData(resPQ.getParamByName(\"server_nonce\").getData());\n byte[] b = new byte[32];\n new Random().nextBytes(b);\n p_q_inner_data.getParamByName(\"new_nonce\").setData(b);\n byte[] data333 = SerializationUtils.serialize(p_q_inner_data);\n\n // шифруем p_q_inner_data\n byte[] encrypted_p_q_inner_data = CryptoUtils.encrypt_p_q_inner_data(data333);\n\n // создаем req_DH_params\n Constructor req_DH_params = (Constructor)book2.getConstructorByPredicate(\"req_DH_params\").clone();\n req_DH_params.getParamByName(\"nonce\").setData(resPQ.getParamByName(\"nonce\").getData());\n req_DH_params.getParamByName(\"server_nonce\").setData(resPQ.getParamByName(\"server_nonce\").getData());\n req_DH_params.getParamByName(\"p\").setData(p_q_inner_data.getParamByName(\"p\").getData());\n req_DH_params.getParamByName(\"q\").setData(p_q_inner_data.getParamByName(\"q\").getData());\n Long[] server_public_key_fingerprints = (Long[]) resPQ.getParamByName(\"server_public_key_fingerprints\").getData();\n req_DH_params.getParamByName(\"public_key_fingerprint\").setData(server_public_key_fingerprints[0]);\n req_DH_params.getParamByName(\"encrypted_data\").setData(encrypted_p_q_inner_data);\n\n\n // отправляем req_DH_params\n Message m_req_DH_params = new Message(SerializationUtils.serialize(req_DH_params));\n //System.out.println(Helpers.byteArrayToHex(m_req_DH_params.array()));\n Packet p_req_DH_params = new Packet(m_req_DH_params, 1);\n Packet p_server_DH_params = sender.send(p_req_DH_params);\n\n // получаем server_DH_params\n Constructor server_DH_params_ok = SerializationUtils.deserialize(p_server_DH_params.getM().getMessage_data());\n\n // расшифровываем encrypted_answer\n byte[] answer = CryptoUtils.decrypt_server_DH_params_ok(\n (byte[])server_DH_params_ok.getParamByName(\"encrypted_answer\").getData(),\n (byte[])p_q_inner_data.getParamByName(\"new_nonce\").getData(),\n (byte[])resPQ.getParamByName(\"server_nonce\").getData());\n\n // получаем server_DH_inner_data из answer\n Constructor server_DH_inner_data = SerializationUtils.deserialize(answer);\n System.out.println(server_DH_inner_data.getPredicate());\n\n\n // создаем client_DH_inner_data\n Constructor client_DH_inner_data = (Constructor)book2.getConstructorByPredicate(\"client_DH_inner_data\").clone();\n client_DH_inner_data.getParamByName(\"nonce\").setData(resPQ.getParamByName(\"nonce\").getData());\n client_DH_inner_data.getParamByName(\"server_nonce\").setData(resPQ.getParamByName(\"server_nonce\").getData());\n client_DH_inner_data.getParamByName(\"retry_id\").setData((long)0);\n byte[] bb = new byte[256];\n new Random().nextBytes(bb);\n BigInteger bi_g = new BigInteger(server_DH_inner_data.getParamByName(\"g\").getData().toString());\n BigInteger bi_b = new BigInteger(1, bb);\n BigInteger bi_dhPrime = new BigInteger(1, (byte[])server_DH_inner_data.getParamByName(\"dh_prime\").getData());\n BigInteger bi_g_b = bi_g.modPow(bi_b, bi_dhPrime);\n byte[] g_b = bi_g_b.toByteArray();\n client_DH_inner_data.getParamByName(\"g_b\").setData(g_b);\n byte[] serialized_client_DH_inner_data = SerializationUtils.serialize(client_DH_inner_data);\n\n\n // шифруем client_DH_inner_data\n byte[] encrypted_client_DH_inner_data = CryptoUtils.encrypt_client_DH_inner_data(\n serialized_client_DH_inner_data,\n (byte[])p_q_inner_data.getParamByName(\"new_nonce\").getData(),\n (byte[])resPQ.getParamByName(\"server_nonce\").getData());\n\n // создаем set_client_DH_params\n Constructor set_client_DH_params = (Constructor)book2.getConstructorByPredicate(\"set_client_DH_params\").clone();\n set_client_DH_params.getParamByName(\"nonce\").setData(resPQ.getParamByName(\"nonce\").getData());\n set_client_DH_params.getParamByName(\"server_nonce\").setData(resPQ.getParamByName(\"server_nonce\").getData());\n set_client_DH_params.getParamByName(\"encrypted_data\").setData(encrypted_client_DH_inner_data);\n\n // отправляем req_DH_params\n Message m_set_client_DH_params = new Message(SerializationUtils.serialize(set_client_DH_params));\n Packet p_set_client_DH_params = new Packet(m_set_client_DH_params, 2);\n Packet p_dh_gen = sender.send(p_set_client_DH_params);\n\n // получаем dh_gen_ok или dh_gen_retry или dh_gen_fail\n Constructor dh_gen = SerializationUtils.deserialize(p_dh_gen.getM().getMessage_data());\n System.out.println(\"dh_gen must be 1003222836 = \" + dh_gen.getId());\n\n\n sender.disconnect();\n //book2.print();\n //book.print();\n\n }", "static void unwrapTCP(byte[] packet, int i) {\n System.out.println(\"\\n----------TCP-----------\");\n System.out.println(\"Source Port : \" + getNextNBytesLong(packet, i, 2));\n i += 2;\n\n System.out.println(\"Destination Port : \" + getNextNBytesLong(packet, i, 2));\n i += 2;\n\n System.out.println(\"Sequence Number : \" + getNextNBytesLong(packet, i, 4));\n i += 4;\n\n System.out.println(\"Acknowledgement Number : \" + getNextNBytesLong(packet, i, 4));\n i += 4;\n\n System.out.println(\"Data Offset : \" +\n (((Byte.toUnsignedInt(packet[i]) & 0b11110000) >> 4)) + \" bytes\");\n i += 1;\n\n\n int isUrgent = ((packet[i] & 0b00100000) >> 5);\n int isAck = ((packet[i] & 0b00010000) >> 4);\n int isPush = ((packet[i] & 0b00001000) >> 3);\n int isReset = ((packet[i] & 0b00000100) >> 2);\n int isSyn = ((packet[i] & 0b00000010) >> 1);\n int isFin = ((packet[i] & 0b00000001));\n\n System.out.println(\"Flags : \" + Integer.toHexString(packet[i] & 0b00111111));\n System.out.printf(\"\\t..%d. .... = %s\\n\", isUrgent, (isUrgent == 1 ? \"URGENT \" : \"No urgent pointer\"));\n System.out.printf(\"\\t...%d .... = %s\\n\", isAck, (isAck == 1 ? \"Acknowledgement \" : \"No acknowledgment\"));\n System.out.printf(\"\\t.... %d... = %s\\n\", isPush, (isPush == 1 ? \"Push \" : \"No push\"));\n System.out.printf(\"\\t.... .%d.. = %s\\n\", isReset, (isReset == 1 ? \"Reset \" : \"no reset\"));\n System.out.printf(\"\\t.... ..%d. = %s\\n\", isSyn, (isSyn == 1 ? \"SYN \" : \"no syn\"));\n System.out.printf(\"\\t.... ...%d = %s\\n\", isFin, (isFin == 1 ? \"FIN \" : \"no fin\"));\n i += 1;\n\n System.out.println(\"Window = \" + getNextNBytesLong(packet, i, 2));\n i += 2;\n\n System.out.println(\"Checksum = 0x\" + getNextNBytesHex(packet, i, 2));\n i += 2;\n\n System.out.println(\"Urgent pointer = \" + getNextNBytesLong(packet, i, 2));\n i += 2;\n\n // TODO offset\n\n i += 2;\n while (i < packet.length) {\n System.out.println(getNextNBytesHex(packet, i, 16) + \"\\t\\t\\t\" + getAsciiRepresentation(packet, i, 16));\n i += 16;\n }\n }", "public interface FirmataProtocol {\n\t// Message types\n\tpublic static final byte I2C_REQUEST\t\t\t= (byte) 0x76;\n\tpublic static final byte I2C_REPLY\t\t\t\t= (byte) 0x77;\n\tpublic static final byte I2C_CONFIG\t\t\t\t= (byte) 0x78;\n\tpublic static final byte DIGITAL_IO_START\t\t= (byte) 0x90;\n\tpublic static final byte DIGITAL_IO_END\t\t\t= (byte) 0x9F;\n\tpublic static final byte ANALOG_IO_START\t\t= (byte) 0xE0;\n\tpublic static final byte ANALOG_IO_END\t\t\t= (byte) 0xEF;\n\tpublic static final byte REPORT_ANALOG_PIN\t\t= (byte) 0xC0;\n\tpublic static final byte REPORT_DIGITAL_PORT\t= (byte) 0xD0;\n\tpublic static final byte START_SYSEX\t\t\t= (byte) 0xF0;\n\tpublic static final byte SET_PIN_MODE\t\t\t= (byte) 0xF4;\n\tpublic static final byte SET_DIGITAL_PIN_VALUE\t= (byte) 0xF5;\n\tpublic static final byte END_SYSEX\t\t\t\t= (byte) 0xF7;\n\tpublic static final byte PROTOCOL_VERSION\t\t= (byte) 0xF9;\n\tpublic static final byte SYSTEM_RESET\t\t\t= (byte) 0xFF;\n\t\n\t// SysEx commands\n\tpublic static final byte EXTENDED_ID\t\t\t\t= 0x00;\t// A value of 0x00 indicates the next 2 bytes define the extended ID\n\t// IDs 0x01 - 0x0F are reserved for user defined commands\n\tpublic static final byte ANALOG_MAPPING_QUERY\t\t= 0x69;\t// ask for mapping of analog to pin numbers\n\tpublic static final byte ANALOG_MAPPING_RESPONSE\t= 0x6A;\t// reply with mapping info\n\tpublic static final byte CAPABILITY_QUERY\t\t\t= 0x6B;\t// ask for supported modes and resolution of all pins\n\tpublic static final byte CAPABILITY_RESPONSE\t\t= 0x6C;\t// reply with supported modes and resolution\n\tpublic static final byte PIN_STATE_QUERY\t\t\t= 0x6D;\t// ask for a pin's current mode and state (different than value)\n\tpublic static final byte PIN_STATE_RESPONSE\t\t\t= 0x6E;\t// reply with a pin's current mode and state (different than value)\n\tpublic static final byte EXTENDED_ANALOG\t\t\t= 0x6F;\t// analog write (PWM, Servo, etc) to any pin\n\tpublic static final byte STRING_DATA\t\t\t\t= 0x71;\t// a string message with 14-bits per char\n\tpublic static final byte REPORT_FIRMWARE\t\t\t= 0x79;\t// report name and version of the firmware\n\tpublic static final byte SAMPLING_INTERVAL\t\t\t= 0x7A;\t// the interval at which analog input is sampled (default = 19ms)\n\tpublic static final byte SYSEX_NON_REALTIME\t\t\t= 0x7E;\t// MIDI Reserved for non-realtime messages\n\tpublic static final byte SYSEX_REALTIME\t\t\t\t= 0X7F;\t// MIDI Reserved for realtime messages\n\t\n\tpublic static enum PinMode {\n\t\tDIGITAL_INPUT,\t// 0x00\n\t\tDIGITAL_OUTPUT,\t// 0x01\n\t\tANALOG_INPUT,\t// 0x02\n\t\tPWM,\t\t\t// 0x03\n\t\tSERVO,\t\t\t// 0x04\n\t\tSHIFT,\t\t\t// 0x05\n\t\tI2C,\t\t\t// 0x06\n\t\tONEWIRE,\t\t// 0x07\n\t\tSTEPPER,\t\t// 0x08\n\t\tENCODER,\t\t// 0x09\n\t\tSERIAL,\t\t\t// 0x0A\n\t\tINPUT_PULLUP,\t// 0x0B\n\t\tUNKNOWN;\n\n\t\tprivate static PinMode[] MODES = values();\n\t\t\n\t\tpublic static PinMode valueOf(int mode) {\n\t\t\tif (mode < 0 || mode >= MODES.length) {\n\t\t\t\treturn UNKNOWN;\n\t\t\t}\n\t\t\t\n\t\t\treturn MODES[mode];\n\t\t}\n\n\t\tpublic boolean isOutput() {\n\t\t\treturn this == DIGITAL_OUTPUT || this == PWM || this == SERVO;\n\t\t}\n\t}\n\t\n\tpublic static class PinCapability {\n\t\tprivate PinMode mode;\n\t\tprivate int resolution;\n\t\tprivate int max;\n\t\t\n\t\tpublic PinCapability(PinMode mode, int resolution) {\n\t\t\tthis.mode = mode;\n\t\t\tthis.resolution = resolution;\n\t\t\tthis.max = (int) Math.pow(2, resolution) - 1;\n\t\t}\n\n\t\tpublic PinMode getMode() {\n\t\t\treturn mode;\n\t\t}\n\n\t\tpublic int getResolution() {\n\t\t\treturn resolution;\n\t\t}\n\t\t\n\t\tpublic int getMax() {\n\t\t\treturn max;\n\t\t}\n\n\t\t@Override\n\t\tpublic String toString() {\n\t\t\treturn \"PinCapability [mode=\" + mode + \", resolution=\" + resolution + \"]\";\n\t\t}\n\t}\n}", "@Override\n\tprotected void flowThrough(Object in, Object d, Object out) {\n\t\t\n\t}", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "private void sendACKPacket()\n{\n \n //the values are unpacked into bytes and stored in outBufScratch\n //outBufScrIndex is used to load the array, start at position 0\n \n outBufScrIndex = 0;\n \n outBufScratch[outBufScrIndex++] = Notcher.ACK_CMD;\n \n //the byte is placed right here in this method\n outBufScratch[outBufScrIndex++] = lastPacketTypeHandled;\n \n //send header, the data, and checksum\n sendByteArray(outBufScrIndex, outBufScratch);\n \n}", "@Override\n\t\t\t\tpublic void fileTransferProgressIndication(LinphoneCore lc,\n\t\t\t\t\t\tLinphoneChatMessage message, LinphoneContent content, int progress) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public String getDescription() {\n return \"Asset transfer\";\n }" ]
[ "0.6226239", "0.61881256", "0.6168143", "0.59204143", "0.5897509", "0.5897509", "0.58626276", "0.58314383", "0.5810174", "0.57552254", "0.5752392", "0.57170165", "0.5666911", "0.5660517", "0.5650441", "0.5617271", "0.5589252", "0.55750996", "0.55458844", "0.5495331", "0.54913473", "0.5490703", "0.54743946", "0.5473016", "0.5472351", "0.54664946", "0.5463371", "0.54460084", "0.5399571", "0.5396204", "0.5391914", "0.53906745", "0.5376108", "0.53713536", "0.53532374", "0.53412", "0.53202987", "0.5312929", "0.53100216", "0.5309534", "0.5301636", "0.52976215", "0.52951866", "0.5281346", "0.5276556", "0.5270319", "0.5269452", "0.52648693", "0.5252859", "0.52498615", "0.52382135", "0.5217956", "0.5214262", "0.52128357", "0.52097577", "0.52074105", "0.52015567", "0.51877046", "0.51840895", "0.5183295", "0.5172028", "0.5166159", "0.51657265", "0.51643944", "0.5155256", "0.5151445", "0.5136529", "0.5119315", "0.5117451", "0.51160055", "0.5114916", "0.5109387", "0.510378", "0.5101714", "0.50985783", "0.50967675", "0.5096596", "0.5095575", "0.50903356", "0.5088055", "0.5085095", "0.5084779", "0.5084216", "0.5076886", "0.5075797", "0.50753146", "0.506565", "0.50652194", "0.5058291", "0.50579524", "0.5055824", "0.5055006", "0.5054788", "0.50530684", "0.50465953", "0.5042433", "0.50363356", "0.5035969", "0.503569", "0.5027717", "0.5021413" ]
0.0
-1
this method makes the HTTP header for the response the headers job is to tell the browser the result of the request among if it was successful or not.
private String construct_http_header(int return_code, int file_type) { String s = "HTTP/1.1 "; //you probably have seen these if you have been surfing the web a while switch (return_code) { case 200: s = s + "200 OK"; break; case 400: s = s + "400 Bad Request"; break; case 403: s = s + "403 Forbidden"; break; case 404: s = s + "404 Not Found"; break; case 500: s = s + "500 Internal Server Error"; break; case 501: s = s + "501 Not Implemented"; break; } s = s + "\r\n"; //other header fields, s = s + "Connection: close\r\n"; //we can't handle persistent connections s = s + "Server: SimpleHTTPtutorial v0\r\n"; //server name //Construct the right Content-Type for the header. //This is so the browser knows what to do with the //file, you may know the browser dosen't look on the file //extension, it is the servers job to let the browser know //what kind of file is being transmitted. You may have experienced //if the server is miss configured it may result in //pictures displayed as text! switch (file_type) { //plenty of types for you to fill in case 0: break; case 1: s = s + "Content-Type: image/jpeg\r\n"; break; case 2: s = s + "Content-Type: image/gif\r\n"; case 3: s = s + "Content-Type: application/x-zip-compressed\r\n"; default: s = s + "Content-Type: text/html\r\n"; break; } ////so on and so on...... s = s + "\r\n"; //this marks the end of the httpheader //and the start of the body //ok return our newly created header! return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flushHeader() {\r\n\t\t//resetBuffer();\r\n\t\tif (sc_status == 0) {\r\n\t\t\tsetStatus(200);\r\n\t\t}\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", Locale.US);\r\n\t\tdateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n StringBuffer headerVal = new StringBuffer();\r\n headerVal.append(request.getProtocol() + \" \" + sc_status + \" \" + HttpResponse.getStatusMessage(sc_status) + \"\\r\\n\");\r\n// System.out.println(\"1st line:\" + headerVal.toString());\r\n headerVal.append(\"Date: \" + dateFormat.format(new Date()) + \"\\r\\n\");\r\n for (String headerName : headersMap.keySet()) {\r\n headerVal.append(headerName + \": \" + headersMap.get(headerName).get(0) + \"\\r\\n\");\r\n }\r\n //System.out.println(\"IF request.hasSession? \" + request.hasSession());\r\n if (request.hasSession() && request.getSession().isNew()) {\r\n \tServletEngine.deleteInvalidatedSession();\r\n \tHttpServletSessionM sessionM = (HttpServletSessionM) request.getSession(false);\r\n \tCookie sessionCookie = new Cookie(\"sessionId\", sessionM.getId());\r\n \t\r\n \t//HttpSession calExpireTime = request.getSession(false);\r\n \tint maxAge = (int) ((sessionM.getLastAccessedTime() - new Date().getTime())/1000 + sessionM.getMaxInactiveInterval());\r\n \t//maxAge = maxAge/1000;\r\n \tsessionCookie.setMaxAge(maxAge*60);\r\n// \tif (!sessionM.isValid()) {\r\n// \t\tSystem.out.println(\"Here the session is invaid\");\r\n// \t\tsessionCookie.setMaxAge(0);\r\n// \t}\r\n \theaderVal.append(\"Set-Cookie: \").append(getCookieInfo(sessionCookie)).append(\"\\r\\n\");\r\n }\r\n if (cookies.size() > 0) {\r\n \tfor (Cookie cur : cookies) {\r\n \t\theaderVal.append(\"Set-Cookie: \").append(getCookieInfo(cur)).append(\"\\r\\n\");\r\n \t}\r\n }\r\n \r\n headerVal.append(\"Content-Length: \" + buffer.getContentLength() + \"\\r\\n\");\r\n //System.out.println(\"buffer.getContentLength:\" + buffer.getContentLength());\r\n headerVal.append(\"Content-Type: \" + contentType + \"\\r\\n\");\r\n headerVal.append(\"Content-Encoding: \" + encoding + \"\\r\\n\");\r\n headerVal.append(\"Connection: close\\r\\n\\r\\n\");\r\n //System.out.println(headerVal.toString());\r\n try {\r\n\t\t\tout.write(headerVal.toString().getBytes());\r\n\t\t\tout.flush();\r\n\t\t\tisCommitted = true;\r\n\t\t\t//System.out.println(\"flushed \");\r\n\t\t} catch (IOException e) {\r\n\t\t\tLogRecorder.addErrorMessage(e, \"cannot write or flush\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private String httpOk() {\n return \"HTTP/1.1 200 OK\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\";\n }", "void addHeader(HttpServletResponse response, String name, String value);", "String getResponseHeader();", "@Override\n\tprotected PortletRenderResult callInternal() throws Exception {\n\t final String characterEncoding = response.getCharacterEncoding();\n\t final RenderPortletOutputHandler renderPortletOutputHandler = new RenderPortletOutputHandler(characterEncoding);\n\t \n final PortletRenderResult result = portletRenderer.doRenderHeader(portletWindowId, request, response, renderPortletOutputHandler);\n \n this.output = renderPortletOutputHandler.getOutput();\n \n return result;\n\t}", "void setHeader(HttpServletResponse response, String name, String value);", "private void generateHeader() throws IOException {\r\n\t\tcharset = Charset.forName(encoding);\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\r\n\t\t//first line\r\n\t\tsb.append(\"HTTP/1.1 \");\r\n\t\tsb.append(statusCode);\r\n\t\tsb.append(\" \");\r\n\t\tsb.append(statusText);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//second line\r\n\t\tsb.append(\"Content-type: \");\r\n\t\tsb.append(mimeType);\r\n\t\tif (mimeType.startsWith(\"text/\")) {\r\n\t\t\tsb.append(\" ;charset= \");\r\n\t\t\tsb.append(encoding);\r\n\t\t}\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\t//third line\r\n\t\tif (contentLength > 0) {\r\n\t\t\tsb.append(\"Content-Length: \");\r\n\t\t\tsb.append(contentLength);\r\n\t\t\tsb.append(\"\\r\\n\");\r\n\t\t}\r\n\t\t\r\n\t\t//fourth line\r\n\t\tgetOutputCookies(sb);\r\n\t\tsb.append(\"\\r\\n\");\r\n\t\t\r\n\t\toutputStream.write(sb.toString().getBytes(Charset.forName(\"ISO_8859_1\")));\r\n\t\t\r\n\t\theaderGenerated = true;\r\n\t}", "@Override\n public void onSuccess(int statusCode , Header[] headers , JSONObject response)\n {\n }", "@Override\n\tpublic void succ(String name, int statusCode, Header[] headers,\n\t\t\tObject response) {\n\t\tsuper.succ(name, statusCode, headers, response);\n\t\tshowToast(\"提交成功\");\n\t\tWorkStepFragment.CallSucc(WorkStepFragment.callsucc);\n\t\tsetResult(RESULT_OK);\n\t\tfinish();\n\n\t}", "@Override\n final void onSuccess(int statusCode, Header[] headers,\n byte[] responseBytes, T responseMap) {\n\n Map<String, String> headMap = Utils.genHeaderMap(headers);\n\n // 保存缓存\n cacheHolder.saveCache(headMap, responseBytes);\n // 返回数据\n onSuccess(statusCode, headMap, responseBytes, responseMap);\n }", "public void setAsSuccessful_OK(){\n setStatus(200);\n }", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\t byte[] responseBody) {\n\t\t\t\tLog.e(\"xx\", new String(responseBody));\n\n\n\n\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\tJSONArray response) {\n\t\t\t\t\t\trepairInitBelowLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\trepairInitBelow2Layout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\tgetTopicDetailsInfos(response,\"init\");\r\n\t\t\t\t\t\tFlag = \"ok\";\r\n\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t}", "void sendSuccessMessage(int statusCode, Header[] headers, byte[] responseBody);", "public int accept(HttpResponseProlog prolog, HttpHeaders headers);", "@Override\r\n\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\tJSONObject response) {\n\t\t\t\t\t\tMessage message = new Message();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tFlag = response.getString(\"flag\");\r\n\t\t\t\t\t\t\tString empty = response.getString(\"empty\");\r\n\t\t\t\t\t\t\tLoger.i(\"test4\", \"444444444--->\"+empty);\r\n\t\t\t\t\t\t\tif(empty.equals(\"no\")){\r\n\t\t\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\t\t\trepairInitLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty yes\");//已完成 和未完成都为空\r\n\t\t\t\t\t\t\t}else if(empty.equals(\"ok\")){\r\n\t\t\t\t\t\t\t\trepairInitLayout.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\trepairInitBelowLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\trepairInitBelow2Layout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty no\");\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\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t}", "private void sendResponse(String sHTTPMethod, String sHTTPRequest, int iStatusCode, String sResponse, boolean bPersistentConnection) {\n // determine if sending file and if redirect -> determines response\n boolean bIsFileSend = sHTTPMethod.equalsIgnoreCase(\"GET\") && iStatusCode == 200;\n boolean bIsRedirect = iStatusCode == 301;\n\n // write header\n String sStatus = getStatusLine(iStatusCode) + END_LINE;\n String sLocation = (bIsRedirect) ? (\"Location: \" + sResponse) + END_LINE : (\"\"); // only if redirect\n String sServerDetails = getServerDetails() + END_LINE;\n String sContentLength = \"Content-Length: \" + sResponse.length() + END_LINE;\n String sContentType = getContentType(sHTTPRequest) + END_LINE;\n String sConnection = getConnectionLine(bPersistentConnection) + END_LINE;\n String sSpaceBetweenHeaderAndBody = END_LINE;\n FileInputStream fin = null;\n\n // update content length if sending a file -> create file input stream\n if (bIsFileSend) {\n try {\n fin = new FileInputStream(ROOT_FOLDER.toString() + \"/\" + sResponse); // if file request, then sResponse is the file path\n sContentLength = \"Content-Length: \" + Integer.toString(fin.available()) + END_LINE;\n } catch (IOException e) {\n System.out.println(\"There was an error creating the file input stream for the response:\");\n System.out.println(\" \" + e);\n }\n }\n\n try {\n // send HTTP Header\n outToClient.writeBytes(sStatus);\n if (bIsRedirect) {\n outToClient.writeBytes(sLocation); // only send Location on redirect\n }\n outToClient.writeBytes(sServerDetails);\n outToClient.writeBytes(sContentType);\n outToClient.writeBytes(sContentLength);\n outToClient.writeBytes(sConnection);\n outToClient.writeBytes(sSpaceBetweenHeaderAndBody);\n\n // send HTTP Body\n if (bIsFileSend) {\n sendFile(fin, outToClient); // send file\n } else if (!bIsRedirect && !sHTTPMethod.equalsIgnoreCase(\"HEAD\")) {\n outToClient.writeBytes(sResponse); // send HTML msg back\n }\n\n // print HTTP Header and Body to console\n System.out.println(sStatus);\n System.out.println(sServerDetails);\n System.out.println(sContentType);\n System.out.println(sContentLength);\n System.out.println(sConnection);\n if (bIsRedirect) {\n System.out.println(sLocation);\n }\n if (bIsFileSend) {\n System.out.println(\"File sent: \" + sResponse);\n } else {\n System.out.println(\"Response: \" + sResponse);\n }\n System.out.println();\n\n // close connection\n if (!bPersistentConnection) {\n outToClient.close();\n }\n\n } catch (IOException e) {\n System.out.println(\"writeBytes did not complete:\");\n System.out.println(\" \" + e + \"\\n\");\n }\n }", "@Override\n public void onSuccess(int statusCode, cz.msebera.android.httpclient.Header[] headers, JSONObject response) {\n try {\n String status = response.getString(\"status\");\n if (status.contains(\"status not ok\")) {\n lt.error();\n Toast.makeText(activity, response.getString(\"error\"), Toast.LENGTH_LONG).show();\n } else {\n lt.success();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "protected void finish() {\n writerServerTimingHeader();\n\n try {\n\n // maybe nobody ever call getOutputStream() or getWriter()\n if (bufferedOutputStream != null) {\n\n // make sure the writer flushes everything to the underlying output stream\n if (bufferedWriter != null) {\n bufferedWriter.flush();\n }\n\n // send the buffered response to the client\n bufferedOutputStream.writeBufferTo(getResponse().getOutputStream());\n\n }\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Could not flush response buffer\", e);\n }\n\n }", "protected void writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result)\n/* */ throws IOException\n/* */ {\n/* 143 */ exchange.getResponseHeaders().set(\"Content-Type\", getContentType());\n/* 144 */ exchange.sendResponseHeaders(200, 0L);\n/* 145 */ writeRemoteInvocationResult(exchange, result, exchange.getResponseBody());\n/* */ }", "@Override\n public void onSuccess(int statusCode , Header[] headers , JSONArray response)\n {\n }", "public Http11Response() {\n\t\tsuper();\n\t\tsetVersion(\"HTTP/1.1\");\n\t\taddHeader(\"Server\", \"Shreejit's server/1.2\");\n\t\taddHeader(\"Connection\", \"Close\");\n\n\t\tTimeZone timeZone = TimeZone.getTimeZone(\"GMT\");\n\t\tCalendar cal = Calendar.getInstance(timeZone);\n\t\taddHeader(\"Date\", Parser.formatDate(cal.getTime()));\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n // Hide Progress Dialog\n prgDialog.hide();\n // try {\n // JSON Object\n// String str=new String(response);\n// JSONObject obj = new JSONObject(str);\n // When the JSON response has status boolean value assigned with true\n if(statusCode==200){\n\n // Display successfully registered message using Toast\n Toast.makeText(getApplicationContext(), \"Thanks for the Donation.Our representative will contact you shortly :)\", Toast.LENGTH_LONG).show();\n navigateToHomeActivity();\n }\n\n }", "@Override\n\tpublic void sendResponse() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\t byte[] responseBody) {\n\t\t\t\tLog.e(\"xx\",new String(responseBody));\n\n\n\t\t\t}", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\t byte[] responseBody) {\n\t\t\t\tsetImdHeartBeat();\n\t\t\t}", "public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {\r\n HttpServletResponse response = ServletActionContext.getResponse();\r\n\r\n if (headers != null) {\r\n OgnlValueStack stack = ActionContext.getContext().getValueStack();\r\n\r\n for (Iterator iterator = headers.entrySet().iterator();\r\n iterator.hasNext();) {\r\n Map.Entry entry = (Map.Entry) iterator.next();\r\n String value = (String) entry.getValue();\r\n String finalValue = conditionalParse(value, invocation);\r\n response.addHeader((String) entry.getKey(), finalValue);\r\n }\r\n\r\n // log headers we've just populated\r\n if (LOG.isDebugEnabled()) {\r\n if (!headers.isEmpty()) {\r\n String log_statement = \"populated HttpServletRespons's Header with\";\r\n for(Iterator i = headers.entrySet().iterator(); i.hasNext(); ) {\r\n Map.Entry entry = (Map.Entry) i.next();\r\n log_statement = log_statement + \"\\n\\t\"+entry.getKey()+\"=\"+entry.getValue();\r\n }\r\n LOG.debug(log_statement);\r\n }\r\n else {\r\n LOG.debug(\"Nothing was populated to HttpServletResponse's header\");\r\n }\r\n }\r\n }\r\n\r\n afterHttpHeadersPopulatedExecute(finalLocation, invocation);\r\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n String decoded = null;\n try {\n decoded = new String(response, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n Log.d(TAG, \"API call onSuccess = \" + statusCode + \", Headers: \" + headers[0] + \", response.length: \" + response.length +\n \", decoded:\" + response);\n userDidLeave();\n }", "@Override\r\n\t\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\t\tJSONObject response) {\n\t\t\t\t\t\t\tMessage message = new Message();\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tFlag = response.getString(\"flag\");\r\n\t\t\t\t\t\t\t\tif(\"no\".equals(Flag)){\r\n\t\t\t\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\t\t\tnew Timer().schedule(new TimerTask() {\r\n\t\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty yes\");\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty no\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t\t}", "@Override\r\n\t\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\t\tJSONObject response) {\n\t\t\t\t\t\t\tMessage message = new Message();\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tFlag = response.getString(\"flag\");\r\n\t\t\t\t\t\t\t\tif(\"no\".equals(Flag)){\r\n\t\t\t\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\t\t\tnew Timer().schedule(new TimerTask() {\r\n\t\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\t\t\t\tPropertyRepairActivity.this.runOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnonemsgtext.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty yes\");\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty no\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t\t}", "public void generatePostHeader (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n request.getParameter(\"Blabbo\"); // Dummy read to send continue back to the client.\n BuildHtmlHeader(new PrintWriter (response.getOutputStream()), getTitle());\n }", "@Override\r\n\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\tJSONObject response) {\n\t\t\t\t\t\tMessage message = new Message();\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tFlag = response.getString(\"flag\");\r\n\t\t\t\t\t\t\tString empty=response.getString(\"empty\");\r\n\t\t\t\t\t\t\tLoger.i(\"test5\", \"5555555555--->\"+response.toString());\r\n\t\t\t\t\t\t\tif(\"no\".equals(empty)){\r\n\t\t\t\t\t\t\t\tcRequesttype = true;\r\n\t\t\t\t\t\t\t\trepairInitLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\trepairInitBelowLayout.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\trepairInitBelow2Layout.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty yes1111111111111\");\r\n\t\t\t\t\t\t\t}else if(\"ok\".equals(empty)){\r\n\t\t\t\t\t\t\t\trepairInitLayout.setVisibility(View.GONE);\r\n\t\t\t\t\t\t\t\trepairInitBelowLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\trepairInitBelow2Layout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\t\t\tLoger.i(\"test5\", \"baoxiutopic is empty no\");\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\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t}", "@Override\n\tpublic void sendResponse() {\n\n\t}", "private void setResponseHeaders(final HttpServletResponse response, final boolean isSave) {\n /* Browser will open the document only if this is set */\n LOGGER.debug(\"Inside response headers\");\n response.reset();\n response.setHeader(\"Expires\", \"0\");\n response.setHeader(\"Cache-Control\", \"must-revalidate, post-check=0,pre-check=0\");\n response.setHeader(\"Pragma\", \"public\");\n response.setHeader(\"Pragma\", \"no-cache\"); // HTTP 1.0\n response.setDateHeader(\"Expires\", 0); /* prevents caching at the proxy */\n response.setHeader(\"Cache-Control\", \"no-cache\"); // HTTP 1.1\n response.setHeader(\"Cache-Control\", \"max-age=0\");\n\n if (isSave) {\n response.setHeader(\"Content-Disposition\", \"attachment; filename=paymentReceipt.pdf\");\n } else {\n response.setHeader(\"Content-disposition\", \"inline; filename=paymentReceipt.pdf\");\n }\n /* Set content type to application / pdf */\n response.setContentType(\"application/pdf\");\n }", "@Override\r\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\tLog.i(\"支付单号\", response.toString());\r\n\t\t\t\tif (response.optBoolean(\"success\")) {\r\n\t\t\t\t\tpayInfo.setAmount(amount);\r\n\t\t\t\t\tintent.putExtra(\"payInfo\", payInfo);\r\n\t\t\t\t\tintent.putExtra(\"payNo\", response.optString(\"data\"));\r\n\t\t\t\t\tstartActivityForResult(intent, REFRESH_BACK);\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\t byte[] responseBody) {\n\t\t\t\tLog.e(\"xx\", new String(responseBody));\n\n\t\t\t}", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\t byte[] responseBody) {\n\t\t\t\tLog.e(\"xx\", new String(responseBody));\n\n\t\t\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n String resp_content = \"\";\n\n try {\n resp_content = new String(responseBody,\"UTF-8\");\n\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n try {\n\n displayLogin(view,resp_content);\n\n } catch (Throwable e) {\n Toast.makeText(LoginActivity.this, \"Koneksi Gagal ! 1\", Toast.LENGTH_LONG).show();\n }\n }", "private void writeHTTPHeader(OutputStream os, String contentType) throws Exception {\n Date d = new Date();\n DateFormat df = DateFormat.getDateTimeInstance();\n df.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n os.write(streamStatus.getBytes());\n os.write(\"Date: \".getBytes());\n os.write((df.format(d)).getBytes());\n os.write(\"\\n\".getBytes());\n os.write(\"Server: Jon's very own server\\n\".getBytes());\n //os.write(\"Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT\\n\".getBytes());\n //os.write(\"Content-Length: 438\\n\".getBytes()); //num characters in HTML line\n os.write(\"Connection: close\\n\".getBytes());\n os.write(\"Content-Type: \".getBytes());\n os.write(contentType.getBytes());\n os.write(\"\\n\\n\".getBytes()); // HTTP header ends with 2 newlines\n return;\n}", "private void send(HttpServletResponse response, int status, String message) throws IOException {\n\t\tresponse.setStatus(status);\n\t\tresponse.getOutputStream().println(message);\n\t}", "public abstract HTTPResponse finish();", "public interface Response {\n\n\tint getResponseCode();\n\n\tvoid setResponseCode(int responseCode);\n\n\tList<Object> getHeader(Object key);\n\n\tObject putHeader(String key, Object value);\n\n\tList<Object> removeHeader(Object key);\n\n\tvoid putAllHeader(Map<? extends String, ? extends List<Object>> m);\n\n//\tObject replaceHeader(String key, Object value);\n\n\tvoid append(CharSequence s) throws IOException;\n\n\tvoid append(byte[] s) throws IOException;\n\n\tList<ByteData> getOut();\n\n\tMap<String, List<Object>> getHeaders();\n\n\tvoid sendRedirect(String url);\n\n\tString getSendRedirectUrl();\n\n\tlong getContentLength();\n\n\tvoid append(ByteData buf) throws IOException;\n\n}", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n\t\t\t\tsuper.onSuccess(statusCode, headers, response);\n\t\t\t\ttry {\n\n\t\t\t\t\tif (statusCode == 200) {\n\t\t\t\t\t\tif (response != null) {\n\t\t\t\t\t\t\tif (response.has(\"status\")) {\n\t\t\t\t\t\t\t\tif (response.getInt(\"status\") == 1) {\n\t\t\t\t\t\t\t\t\tshowCustomToast(response.getString(\"message\"));\n\n\t\t\t\t\t\t\t\t\tmhandle.postDelayed(runnbale, 1000);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowCustomToast(response.getString(\"message\"));\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\n\t\t\t\t\t\t\tshowCustomToast(R.string.toast1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t}\n\t\t\t\tdismissLoadingDialog();\n\t\t\t}", "private void createResponse(KKAppEng kkAppEng, boolean ok, HttpServletRequest request,\r\n HttpServletResponse response) throws Exception\r\n {\r\n String url = kkAppEng.getConfig(ConfigConstants.KK_BASE_URL);\r\n if (url == null || url.length() == 0)\r\n {\r\n throw new KKException(\"The KK_BASE_URL has not been defined\");\r\n }\r\n if (ok)\r\n {\r\n url += \"CheckoutFinished.action\";\r\n } else\r\n {\r\n url += \"AuthorizenetDPM.action?e=t\";\r\n }\r\n\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"document.location = \" + url);\r\n }\r\n \r\n response.setContentType(\"text/html; charset=UTF-8\");\r\n response.setCharacterEncoding(\"UTF-8\");\r\n // Create page to return\r\n StringBuffer sb = new StringBuffer();\r\n sb.append(\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\" \\\"http://www.w3.org/TR/html4/loose.dtd\\\">\");\r\n sb.append(\"<html><head></head><body><script type=\\\"text/javascript\\\">\");\r\n sb.append(\"document.location = \\\"\");\r\n sb.append(url);\r\n sb.append(\"\\\";\");\r\n sb.append(\"</script></body></html>\");\r\n response.getWriter().append(sb);\r\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n Toast.makeText(getActivity().getApplicationContext(),\n \"Jam SUCCEEDED!\", Toast.LENGTH_SHORT)\n .show();\n }", "public void setResponseHeader(Response.Header header, String value) {\n setNonStandardHeader(header.code, value);\n }", "static void invokeResponse(RoutingContext rc, Method m, Object toret, String resultType) {\n String[] _corsAllowedIPs = getCORS(m);\n \n if (_corsAllowedIPs != null && _corsAllowedIPs.length > 0) {\n CORS.allow(rc, _corsAllowedIPs);\n }\n \n // Combine errors\n if (toret == null || !(toret instanceof RestResponse)){\n\n \t// Handling function didn't return a RestResponse object, return an appropriate error message\n rc.response().setStatusCode(500).setStatusMessage(\"Error: Function didn't return a RestResponse object\").end();\n \n // We don't \"have\" to throw an exception, a 500 may suffice and client may log error and message in their logs\n// new RuntimeException(\"The return type of a REST function must be a RestResponse\");\n }else {\n \t\n \t// Put the custom headers first, if any\n \tputHeaders(((RestResponse) toret).getHeaders(), rc);\n \t\n \t// PUt the custom status code/message, if any\n \tputStatus((RestResponse) toret, rc);\n \t\n if (resultType != null) {\n\n if (resultType.equals(\"file\")) {\n \t\n // Send the file\n rc.response().sendFile(((RestResponse) toret).getBody()).end();\n } else if (resultType.equals(\"json\")) {\n\n // Set the header for json content - will override any custom header for content-type\n rc.response().putHeader(\"content-type\", \"application/json; charset=utf-8\");\n \n rc.response().end(((RestResponse) toret).getBody());\n }\n } else {\n \t\n \t// New assumption: If result type not set, we're sending back whatever the custom headers say to return\n \t// or else if no custom headers for content-type, we'll return text\n \t\n \tif (!rc.response().headers().contains(\"content-type\")) {\n \t\trc.response().putHeader(\"content-type\", \"text/plain\");\n \t}\n \t\n \tString result = ((((RestResponse) toret).getBody() != null) ? ((RestResponse) toret).getBody() : \" \");\n \t\n rc.response().end(result);\n }\n }\n }", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n\t\t\t\tsuper.onSuccess(statusCode, headers, response);\n\t\t\t\ttry {\n\n\t\t\t\t\tif (statusCode == 200) {\n\t\t\t\t\t\tif (response != null) {\n\t\t\t\t\t\t\tif (response.has(\"status\")) {\n\t\t\t\t\t\t\t\tif (response.getInt(\"status\") == 1) {\n\t\t\t\t\t\t\t\t\tshowCustomToast(response.getString(\"message\"));\n\t\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tshowCustomToast(response.getString(\"message\"));\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\n\t\t\t\t\t\t\tshowCustomToast(R.string.toast1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t}\n\t\t\t\tdismissLoadingDialog();\n\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void onSuccess(int arg0, Header[] arg1,\n\t\t\t\t\t\t\t\tbyte[] arg2) {\n\t\t\t\t\t\t\tif (arg0 == 200) {\n\t\t\t\t\t\t\t\tString str = new String(arg2);\n\t\t\t\t\t\t\t\tSystem.out.println(\"坐标提交接口返回 ---> \" + str);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private void sendOk(HttpServletResponse response, String content) {\n\n try {\n response.setCharacterEncoding(\"utf-8\");\n response.setHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\n response.setStatus(HttpServletResponse.SC_OK);\n response.getWriter().append(content);\n response.flushBuffer();\n } catch (Exception e) {\n logger.error(e);\n throw new RuntimeException(e);\n }\n }", "void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "public void makeJsonResultWithHead(List resultList, HttpServletRequest request, HttpServletResponse response, String listId) throws IOException\r\n {\r\n Map result = CommonUtil.makeHeaderJsonByList(resultList, request);\r\n \r\n Gson gson = new Gson();\r\n \r\n String jsonString = gson.toJson(result);\r\n response.getWriter().print(jsonString);\r\n\r\n }", "@Override\n public boolean startContent(int statusCode, Compression compression) {\n return true;\n }", "@Override\r\n\t\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\t\tbyte[] binaryData) {\n\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tMap<String, String> map = new HashMap<String, String>();\r\n\t\t\t\t\t\t\t\tfor (Header h : headers) {\r\n\t\t\t\t\t\t\t\t\tLogger.d(\"---\", h.getName() + \"----------->\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ URLDecoder.decode(h.getValue(), \"UTF-8\"));\r\n\t\t\t\t\t\t\t\t\tmap.put(h.getName(),\r\n\t\t\t\t\t\t\t\t\t\t\tURLDecoder.decode(h.getValue(), \"UTF-8\"));\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (binaryData != null) {\r\n\t\t\t\t\t\t\t\t\tLogger.d(\"---+\", \"content : \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ new String(binaryData, \"GBK\"));\r\n\r\n\t\t\t\t\t\t\t\t\tString data = new String(binaryData, \"GBK\");\r\n\t\t\t\t\t\t\t\t\tif (map.get(\"msgcde\").equals(\"0000000\")) {\r\n\t\t\t\t\t\t\t\t\t\tString msg = data.substring(136,\r\n\t\t\t\t\t\t\t\t\t\t\t\tdata.length() - 1);\r\n//\t\t\t\t\t\t\t\t\t\tinfo = ClassicXML.readStringXmlOut(msg);\r\n//\t\t\t\t\t\t\t\t\t\tif (info.size() != 0) {\r\n//\t\t\t\t\t\t\t\t\t\t\tmAdapter = new MyAdapter(context,\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\tR.layout.cxdt_list_item, info);\r\n//\t\t\t\t\t\t\t\t\t\t\tmListView.setAdapter(mAdapter);\r\n\t//\r\n//\t\t\t\t\t\t\t\t\t\t} else {\r\n//\t\t\t\t\t\t\t\t\t\t\tTool.showToast(context, \"没有定投记录!\");\r\n//\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tTool.showToast(context, \"系统错误!\");\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n//\t\t\t\t\t\t\tif (ppd != null) {\r\n//\t\t\t\t\t\t\t\tppd.dismiss();\r\n//\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] server_response) {\n try {\n progress.dismiss();\n String response = String.valueOf(new String(server_response, \"UTF-8\"));\n // parse response\n XMLParser parser = new XMLParser();\n Document doc = parser.getDomElement(response, url);\n\n if (doc == null) {\n Dialog.simpleWarning(Lang.get(\"returned_xml_failed\"));\n } else {\n NodeList successNode = doc.getElementsByTagName(\"success\");\n if (successNode.getLength() > 0) {\n Element success = (Element) successNode.item(0);\n Config.context.setTitle(Title);\n\n login_form.setVisibility(View.VISIBLE);\n profile_layer.setVisibility(View.GONE);\n\n Account.logout();\n\n Dialog.toast(success.getTextContent());\n\n menu_logout.setVisible(false);\n menu_remove_account.setVisible(false);\n\n if (Config.activeInstances.contains(\"MyListings\")) {\n Config.activeInstances.remove(\"MyListings\");\n MyListings.removeInstance();\n\n Utils.removeContentView(\"MyListings\");\n }\n loginForm(login_form, Config.context);\n\n LoginManager.getInstance().logOut();\n dialog.dismiss();\n } else {\n NodeList errorNode = doc.getElementsByTagName(\"error\");\n\n if (errorNode.getLength() > 0) {\n // handle errors\n Element error = (Element) errorNode.item(0);\n Dialog.simpleWarning(Lang.get(error.getTextContent()));\n }\n }\n }\n\n } catch (UnsupportedEncodingException e1) {\n\n }\n }", "void httpResponse (HttpHeader response, BufferHandle bufferHandle, \n\t\t boolean keepalive, boolean isChunked, long dataSize);", "private static void initializeResponse(String contentType, String header){\r\n\t\t // Initialize response.\r\n\t response.reset(); // Some JSF component library or some Filter might have set some headers in the buffer beforehand. We want to get rid of them, else it may collide.\r\n\t response.setContentType(contentType); // Check http://www.iana.org/assignments/media-types for all types. Use if necessary ServletContext#getMimeType() for auto-detection based on filename.\r\n\t response.setHeader(\"Content-disposition\", header); // The Save As popup magic is done here. You can give it any filename you want, this only won't work in MSIE, it will use current request URL as filename instead.\r\n\r\n\t}", "protected void writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result)\r\n/* 57: */ throws IOException\r\n/* 58: */ {\r\n/* 59:137 */ exchange.getResponseHeaders().set(\"Content-Type\", getContentType());\r\n/* 60:138 */ exchange.sendResponseHeaders(200, 0L);\r\n/* 61:139 */ writeRemoteInvocationResult(exchange, result, exchange.getResponseBody());\r\n/* 62: */ }", "@Override\n public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {\n response.setContentType(\"application/json;charset=utf-8\");\n PrintWriter out = response.getWriter();\n\n Result result = new Result(null,false,\"请登录!\");\n\n out.write(JSONObject.toJSONString(result));\n out.flush();\n out.close();\n }", "protected void updateHeader() {\n\t}", "private void sendStatus(HttpRequest request, HttpResponse response) {\r\n\t\tresponse.setHeader(\"Content-Type\", MediaType.JSON_UTF_8.toString());\r\n\t\tresponse.setStatus(200);\r\n\t\ttry {\r\n\t\t\tObject status = buildStatus(request);\r\n\t\t\tString reply = json.toJson(status);\r\n\t\t\t\r\n\t\t\t// do we return the whole status or just a part of it ?\r\n\t\t\tString jsonPath = request.getQueryParameter(\"jsonpath\");\r\n\t\t\tif (jsonPath != null) {\r\n\t\t\t\tstatus = JsonPath.using(jsonPathConf).parse(reply).read(jsonPath);\r\n\t\t\t\treply = status instanceof String ? status.toString() : json.toJson(status);\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tresponse.setContent(reply.getBytes(UTF_8));\r\n\t\t} catch (Throwable e) {\r\n\t\t\tthrow new GridException(e.getMessage());\r\n\t\t}\r\n\t}", "@Override\n final public void onSuccess(int statusCode, Header[] headers, String responseBody) {\n \tif (DEBUG)\n\t\t\tLog.v(LOG_TAG, \"onSuccess statusCode = \" + statusCode\n\t\t\t\t\t+ \" responseBody = \" + responseBody);\n \tprocessResult(headers, responseBody);\n }", "public interface HttpResponseHeaders {\n\n /**\n * Http status code\n */\n int statusCode();\n\n /**\n * all commons headers(exclude request line)\n */\n List<Header> headers();\n}", "public SuccessResponse() {\r\n super(HttpStatus.OK, \"Successfully processed the request.\");\r\n }", "protected GlobalRequestResponse(boolean succeeded) {\n this.succeeded = succeeded;\n }", "private static void setResponse(HttpServletResponse response, Integer status) {\n\t\tresponse.setContentType(\"text/XML\");\n\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\ttry {\n\t\t\t//response.getWriter().write(\"<friendRequest:status id=\\\"friendRequestResponse\\\" value=\\\"\" + status + \"\\\" />\");\n\t\t\tresponse.getWriter().write(status.toString());\n\t\t} catch (Exception ignored) {};\n\t}", "private static void setResponse(HttpServletResponse response, Integer status) {\n\t\tresponse.setContentType(\"text/XML\");\n\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\ttry {\n\t\t\t//response.getWriter().write(\"<friendRequest:status id=\\\"friendRequestResponse\\\" value=\\\"\" + status + \"\\\" />\");\n\t\t\tresponse.getWriter().write(status.toString());\n\t\t} catch (Exception ignored) {};\n\t}", "public static void setDateHeader(HttpResponse response) {\n\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);\n\t\tdateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));\n\n\t\tCalendar time = new GregorianCalendar();\n\t\tresponse.setHeader(HttpHeaders.Names.DATE, dateFormatter.format(time.getTime()));\n\t}", "public void sendHeader(Pair<Integer, String> statusCode, String contentType, Integer contentLength) throws IOException {\n\n\n this.out.write((\"HTTP/1.1 \" + statusCode.getKey() + \" \" + statusCode.getValue() + CRLF).getBytes());\n this.out.write((\"Date: \" + new Date().toString() + CRLF).getBytes());\n if (contentLength != null) {\n this.out.write((\"Content-Type: \" + contentType + CRLF).getBytes());\n this.out.write((\"Content-Encoding: UTF-8\" + CRLF).getBytes());\n this.out.write((\"Content-Length: \" + contentLength + CRLF).getBytes());\n }\n this.out.write((\"\" + CRLF).getBytes());\n }", "@Override\n\tprotected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doOptions(req, resp);\n\t\tH5Utils.setHeaders(resp);\n\t}", "@Override\n\tprotected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doOptions(req, resp);\n\t\tH5Utils.setHeaders(resp);\n\t}", "public void doHead() throws IOException {\n\n // search ressource\n\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n }", "public void setDateHeader(FullHttpResponse response) {\r\n SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);\r\n dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));\r\n\r\n Calendar time = new GregorianCalendar();\r\n response.headers().set(HttpHeaders.Names.DATE, dateFormatter.format(time.getTime()));\r\n }", "@Override\n public void processResult(HttpResponseMessage response) {\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response)\n {\n super.onSuccess(statusCode, headers, response);\n System.out.println(\"申请预订接口=\" + response);\n }", "@Override\n\tpublic void commence(HttpServletRequest request, HttpServletResponse response,\n\t\t\tAuthenticationException authException) throws IOException, ServletException {\n\t\tApiResponse res = new ApiResponse(HttpServletResponse.SC_UNAUTHORIZED, \"Unauthorised\");\n\t\tres.setErrors(authException.getMessage());\n\t\tres.setStatus(false);\n OutputStream out = response.getOutputStream();\n ObjectMapper mapper = new ObjectMapper();\n mapper.writeValue(out, res);\n out.flush();\n\t}", "public void generateGetHeader (\n HttpServletRequest request, HttpServletResponse response)\n throws IOException\n {\n BuildHtmlHeader(new PrintWriter (response.getOutputStream()), getTitle());\n }", "void writeSuccessResponse(CruiseControlParameters parameters, CruiseControlRequestContext requestContext) throws IOException;", "@Override\n\tpublic void run() {\n\t\tPrintWriter out;\n\t\ttry {\n\t\t\tout = new PrintWriter(s.getOutputStream());\n\t\t\tout.print(\"HTTP/1.1 200 Ok\\n\\r\"+ \n\"Server: nginx/1.8.0\\n\\r\"+\n\"Date: Mon, 07 Dec 2015 09:11:39 GMT\\n\\r\"+ \n\"Content-Type: text/html\\n\\r\"+\n\"Connection: close\\n\\r\\n\\r\"+\n\"<html>\"+ \n\"<head><title>Test ok</title></head>\"+\n\"<body bgcolor=\\\"white\\\"> \"+\n\"<center><h1>HELLO</h1></center>\"+ \n\"</body>\"+\n\"</html>\"); \n\t\t\tout.close();\n\t\t\ts.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\n\t\t\n\t}", "public void process(Exchange exchange) throws Exception {\n Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class);\n\n response.setStatus(Status.SUCCESS_OK);\n response.setEntity(\"<response>ru.testproj.CamelRest</response>\", MediaType.TEXT_XML);\n exchange.getOut().setBody(response);\n }", "public static void setDateAndCacheHeaders(HttpResponse response, long lastModified) {\n\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);\n\t\tdateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));\n\n\t\t// Date header\n\t\tCalendar time = new GregorianCalendar();\n\t\tresponse.setHeader(HttpHeaders.Names.DATE, dateFormatter.format(time.getTime()));\n\n\t\t// Add cache headers\n\t\ttime.add(Calendar.SECOND, HTTP_CACHE_SECONDS);\n\t\tresponse.setHeader(HttpHeaders.Names.EXPIRES, dateFormatter.format(time.getTime()));\n\t\tresponse.setHeader(HttpHeaders.Names.CACHE_CONTROL, \"private, max-age=\" + HTTP_CACHE_SECONDS);\n\t\tresponse.setHeader(HttpHeaders.Names.LAST_MODIFIED, dateFormatter.format(new Date(lastModified)));\n\t}", "@Override\n\t\t\t\t\t\tpublic void onSuccess(int arg0, Header[] arg1,\n\t\t\t\t\t\t\t\tbyte[] arg2) {\n\t\t\t\t\t\t\tString msg = \"\";\n\t\t\t\t\t\t\tif (arg0 == 200) {\n\t\t\t\t\t\t\t\t// 将byte 转换 String\n\t\t\t\t\t\t\t\tString str = new String(arg2);\n\t\t\t\t\t\t\t\tLog.e(\"rr\", \"str--\" + str);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tJSONObject job = new JSONObject(str);\n\t\t\t\t\t\t\t\t\tString state = job.getString(\"state\");\n\t\t\t\t\t\t\t\t\tmsg = job.getString(\"msg\");\n\t\t\t\t\t\t\t\t\tpd.dismiss();\n\t\t\t\t\t\t\t\t\tif (state.equals(\"success\")) {\n\t\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\t\tChangeUserResumeActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\t\"保存成功!\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t\t\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\t\t\t\t\t\t\tChangeUserResumeActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\tExamineUserResumeActivity.class);\n\t\t\t\t\t\t\t\t\t\tintent.putExtra(\"isFromVipCenter\", true);\n\t\t\t\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\t\tChangeUserResumeActivity.this,\n\t\t\t\t\t\t\t\t\t\t\t\tmsg, Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\t\t\tpd.dismiss();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (JSONException 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\tpd.dismiss();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tToast.makeText(ChangeUserResumeActivity.this,\n\t\t\t\t\t\t\t\t\t\tmsg, Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\tpd.dismiss();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "void faild_response();", "private void getAppResponse(String theuri, PrintWriter out) {\n String response = spring.executeService(theuri);\n String header = \"HTTP/1.1 200 OK\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\";\n out.println(header + response);\n }", "public static void setHeaders1(String displayUrl\r\n , HttpServletRequest request\r\n , HttpServletResponse response)\r\n throws AspireServletException\r\n {\r\n AppObjects.info(\"SetHeaders.java\",\"Setting headers (1) for Aspire URL: %1s\",displayUrl);\r\n // If there is a java class call it\r\n // other wise use the old setHeaders method\r\n String setHeadersClass = AppObjects.getIConfig().getValue(\"request.\"\r\n + AspireConstants.RESPONSE_HEADERS_CLASS\r\n + \".className\", null);\r\n if (setHeadersClass == null)\r\n {\r\n AppObjects.log(\"Info: Setting headers using local code\");\r\n setHeaders(displayUrl,response);\r\n }\r\n else\r\n {\r\n try\r\n {\r\n AppObjects.log(\"Info: Setting headers using a delegate class\");\r\n ISetHeaders setHeaders = (ISetHeaders)AppObjects\r\n .getIFactory()\r\n .getObject(AspireConstants.RESPONSE_HEADERS_CLASS,null);\r\n setHeaders.setHeaders(displayUrl,request,response);\r\n }\r\n catch(RequestExecutionException x)\r\n {\r\n throw new AspireServletException(\"Error: Could not set headers due to a plugin error\",x);\r\n }\r\n }\r\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n JSONObject objeto = Helpers.ResponseBodyToJSON(responseBody);\n\n // Si está OK\n if (objeto.isNull(\"Error\"))\n {\n // Si tenemos el Google Play Services\n if (GCMRegistrar.checkPlayServices(getActivity()))\n // Registramos el ID del Google Cloud Messaging\n GCMRegistrar.registrarGCM(getActivity());\n\n // Abrimos la ventana de los ofertas\n Helpers.LoadFragment(getActivity(), new Ofertas(), \"Ofertas\");\n }\n else\n {\n try {\n // Mostramos la ventana de error\n Helpers.MostrarError(getActivity(), objeto.getString(\"Error\"));\n }\n catch (Exception ex) { }\n }\n }", "private void writeResponse(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {\n\t\tresponse.setContentType(\"text/html\");\n\t\tresponse.setCharacterEncoding(\"utf-8\");\n\t\tPrintWriter pw = response.getWriter();\n\t\tpw.print(\"This is a CQ5 Response ... \");\n\t\tpw.print(getPageContent(request, \"/content/helloworld\"));\n\t\tpw.flush();\n\t\tpw.close();\n\t}", "@Override\r\n\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\tJSONArray response) {\n\t\t\t\t\t\trepairInitLayout.setVisibility(View.GONE);\r\n\t\t\t\t\t\trepairInitBelowLayout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\trepairInitBelow2Layout.setVisibility(View.VISIBLE);\r\n\t\t\t\t\t\tgetTopicDetailsInfos(response,\"init\");\r\n\t\t\t\t\t\tFlag = \"ok\";\r\n\t\t\t\t\t\tcRequesttype = true;\r\n//\t\t\t\t\t\tmaddapter.notifyDataSetChanged();\r\n\t\t\t\t\t\tsuper.onSuccess(statusCode, headers, response);\r\n\t\t\t\t\t}", "@Override\n public void sendResponse(final Response response) {\n\n }", "public String formOk(String ContentType,long ContentLength)\r\n {\r\n\t contentLength = ContentLength;\r\n \r\n String out =new String();\r\n \t \r\n out += HTTP_PROTOCOL + \" 200 OK\" + CR;\r\n out += \"Server: \" + HTTP_SERVER + CR;\r\n out += \"MIME-version: 1.0\" + CR;\r\n\r\n if (0 < ContentType.length()) \r\n out += \"Content-type: \" + ContentType + CR;\r\n else\r\n out += \"Content-Type: text/html\" + CR;\r\n\r\n if (0 != contentLength)\r\n out += \"Content-Length: \" + Long.toString(contentLength) + CR;\r\n\r\n if (0 < lastModified.length())\r\n out +=\"Last-Modified: \" + lastModified + CR;\r\n\r\n out +=CR;\r\n\r\n return out;\r\n }", "public String execute()\n {\n return SUCCESS();\n }", "void writeChallenge(HttpServletResponse response)\n throws IOException,ServletException;", "void xhrOk();", "public void startResponse()\n\t\t\t{\n\t\t\t\tsend(\"<response>\", false);\n\t\t\t}", "private static void sendHttpResponse(\n ChannelHandlerContext ctx, FullHttpRequest req, FullHttpResponse res) {\n if (res.status().code() != 200) {\n ByteBuf buf = Unpooled.copiedBuffer(res.status().toString(), CharsetUtil.UTF_8);\n res.content().writeBytes(buf);\n buf.release();\n HttpHeaderUtil.setContentLength(res, res.content().readableBytes());\n\n }\n\n // Send the response and close the connection if necessary.\n ChannelFuture f = ctx.channel().writeAndFlush(res);\n if (!HttpHeaderUtil.isKeepAlive(req) || res.status().code() != 200) {\n f.addListener(ChannelFutureListener.CLOSE);\n }\n }", "protected void prepareHTTPResponse( String reportId, String entryName, HttpServletRequest request,\n HttpServletResponse response )\n {\n if ( isGenerateContentDisposition( reportId, null, request ) )\n {\n String contentDisposition = getContentDisposition( entryName );\n if ( StringUtils.isNotEmpty( contentDisposition ) )\n {\n response.setHeader( HttpHeaderUtils.CONTENT_DISPOSITION_HEADER, contentDisposition.toString() );\n }\n }\n\n // Disable HTTP response cache\n if ( isDisableHTTPResponCache() )\n {\n disableHTTPResponCache( response );\n }\n }", "@Override\n public void setHeader(String name, String value) {\n this._getHttpServletResponse().setHeader(name, value);\n }", "@Override\n public void addHeader(String name, String value) {\n this._getHttpServletResponse().addHeader(name, value);\n }", "private void responseVal(HttpServletResponse response, boolean processSuccess, String msg) throws IOException {\n HttpResponseModel<Serializable> result = HttpResponseModel.buildSuccessResponse();\n result.setCode(processSuccess ? INITPWDSUCCESSCODE : INITPWDFAILEDCODE);\n result.setMsg(msg);\n // send message\n WebScopeUtil.sendJsonToResponse(response, result);\n }", "public abstract void onSuccess(int statusCode, byte[] content);" ]
[ "0.6568594", "0.6530924", "0.64970744", "0.64626324", "0.6406576", "0.63047993", "0.61754084", "0.6156715", "0.60710096", "0.60698634", "0.60587615", "0.6039351", "0.6027203", "0.6017642", "0.6009352", "0.59826803", "0.5975884", "0.5973626", "0.5973489", "0.59558433", "0.5928015", "0.59118664", "0.5891432", "0.5891247", "0.5872443", "0.587064", "0.5869204", "0.5864695", "0.58596677", "0.58596677", "0.5855602", "0.58554876", "0.584074", "0.5834632", "0.58316267", "0.5822426", "0.5822426", "0.58058", "0.57895565", "0.5770997", "0.5767137", "0.57577866", "0.57539517", "0.57399076", "0.57387084", "0.57322514", "0.5729218", "0.57239795", "0.57124597", "0.5712383", "0.57086676", "0.57062936", "0.5702911", "0.5696867", "0.5676698", "0.5668448", "0.565651", "0.5647749", "0.56467783", "0.5638215", "0.5632894", "0.56320596", "0.56049585", "0.5602092", "0.5584922", "0.55694723", "0.55694723", "0.5566259", "0.55651087", "0.5560043", "0.5560043", "0.55542344", "0.5550349", "0.55500156", "0.5538245", "0.5537825", "0.5532575", "0.55321187", "0.55306", "0.55278915", "0.5519554", "0.55188835", "0.5516659", "0.55156183", "0.5505403", "0.5503777", "0.5503444", "0.5500426", "0.5496437", "0.5495066", "0.54912436", "0.5483627", "0.54712", "0.54597133", "0.54523796", "0.5446123", "0.5442449", "0.54398334", "0.5436756", "0.54302" ]
0.5854315
32
the position are checked on the attacked players, not in movements
@Override public boolean attack(Player attacker, int mode1, int[] mode2, Player[] attackedPlayers, Position[] movements, PowerupCard[] payment) { boolean done = false; if(isLoaded() && attackedPlayers.length>=1 && attacker.getPosition().reachable(attackedPlayers[0].getPosition())){ if(mode1==0 && attackedPlayers.length==1){ attackedPlayers[0].receivedDamages(attacker); attackedPlayers[0].setMarksReceived(attacker,2); attacker.setMarksGiven(attackedPlayers[0],2); attacker.setPosition(attackedPlayers[0].getPosition()); loaded=false; done=true; }else if(mode1==1){ if(attackedPlayers.length==1 && isPaid(attacker, payment)){ for(int i=0; i<2; i++) attackedPlayers[0].receivedDamages(attacker); attacker.setPosition(attackedPlayers[0].getPosition()); loaded=false; done=true; }else if(attackedPlayers.length==2 && attackedPlayers[0].getPosition().reachable(attackedPlayers[1].getPosition()) && isPaid(attacker, payment)){ boolean sameValueOfX = attacker.getPosition().getCoordinate()[0] == attackedPlayers[1].getPosition().getCoordinate()[0]; boolean sameValueOfY = attacker.getPosition().getCoordinate()[1] == attackedPlayers[1].getPosition().getCoordinate()[1]; boolean sameDirection = (sameValueOfX || sameValueOfY) && attacker.getPosition() != attackedPlayers[1].getPosition(); if(sameDirection){ for (int i = 0; i < 2; i++) { attackedPlayers[i].receivedDamages(attacker); attackedPlayers[i].receivedDamages(attacker); } attacker.setPosition(attackedPlayers[1].getPosition()); loaded = false; done = true; } } } } return done; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkPositions() {\n //check if any bullets have hit any asteroids\n for (int i = 0; i < bullets.size(); i++) {\n for (int j = 0; j < asteroids.size(); j++) {\n if (asteroids.get(j).checkIfHit(bullets.get(i).pos)) {\n shotsHit++;\n bullets.remove(i);//remove bullet\n score +=1;\n break;\n }\n }\n }\n //check if player has been hit\n if (immortalityTimer <=0) {\n for (int j = 0; j < asteroids.size(); j++) {\n if (asteroids.get(j).checkIfHitPlayer(position)) {\n playerHit();\n }\n }\n }\n }", "public int verifyPlayerMovement(int x1, int y1, int x2, int y2){\n int deltaX = abs(x2-x1);\n int deltaY = abs(y2-y1);\n \n // already chosen position\n if ((deltaX == 0 && deltaY == 0) && (matrixUserChoices[x1][y1] == 1 || matrixUserChoices[x1][y1] == -1)){\n return -1;\n }\n else if (deltaX == 0 && deltaY == 0){\n return POSITIONATTACK;\n }\n else if (deltaX == 1 && deltaY == 1){\n return AREAATTACK;\n }\n else if (deltaX == 0 && deltaY == canvasNumberOfColumns-1){\n return LINEATTACK;\n }\n else if (deltaY == 0 && deltaX == canvasNumberOfLines-1){\n return COLUMNATTACK;\n }\n if ((deltaX == 0 && deltaY == 0) && (gameMatrix[x1][y1] == 1)){\n return -1;\n }\n else{\n return -1;\n }\n \n // the -1 value means an invalid movement \n }", "public void movePlayer(String nomeArq, int px, int py) {\r\n if(Main.player1.Vez()) {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)){\r\n \tMain.player1.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player1.MudaLado(false,true);\r\n } \r\n pos = Main.player1.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0.1;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false) {\r\n \tMain.player1.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player1.Size()[0],Main.player1.Size()[1])==false)\r\n {\r\n \tMain.player1.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n Main.Fase.repinta(); \r\n }\r\n else {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)) {\r\n \tMain.player2.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player2.MudaLado(false,true);\r\n } \r\n pos = Main.player2.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false) {\r\n \tMain.player2.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false)\r\n {\r\n \tMain.player2.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n }\r\n }", "public void checkEnemy() {\n\t\tif (enemy != null)\n\t\tif (Integer.parseInt(getCurrentPositionX()) == enemy.getCurrentPositionX() && Integer.parseInt(getCurrentPositionY()) == enemy.getCurrentPositionY()) {\n\t\t\tx = spawnX;\n\t\t\ty = spawnY;\n\t\t}\n\t}", "private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }", "@Override\n\tpublic boolean updatePos(Physical_passive map) {\n\t\tupdate_animSpeed();\n\t\t// if (!map.getPhysicalRectangle().contains(getPhysicalShape()))\n\t\t// return false;\n\t\tif (!isDead()) {\n\t\t\tResolveUnreleasedMovements();\n\t\t\tgetWeapon().update();\n\t\t\tupdatePush();\n\t\t\t/*\n\t\t\t * if (!isBlock_down()) { // Por lo visto esto controla el salto if\n\t\t\t * (getJumpTTL() != 0) { moveJump(); } else // Y este 3 es la\n\t\t\t * gravedad., lo paso a un metodo de actor // para decirle q empiece\n\t\t\t * a caer fall(); // ; }\n\t\t\t */\n\t\t\t// Aqui es donde realmente cambiamos la posicion una vez calculado\n\t\t\t// donde va a ir.\n\t\t\t// updateLegsRotation(getSpeed().add(getPosition()));\n\t\t\tgetLegs().setLocation(new Point((int) getPosition().x(), (int) getPosition().y()));\n\t\t\tsetPosition(getPosition().add(getSpeed().add(getPush())));\n\t\t\tgetTorax().setLocation(new Point((int) getPosition().x(), (int) getPosition().y()));\n\t\t\t// setPosition(getPosition().add(getSpeed().add(getPush()))); //\n\t\t\t// CAmbiado;\n\t\t\tLine2D line = new Line2D.Float((float) getKillTracer().getTrace().getLine().getX1(),\n\t\t\t\t\t(float) getKillTracer().getTrace().getLine().getY1(), (float) getSpeed().x(),\n\t\t\t\t\t(float) getSpeed().y());\n\t\t\tgetKillTracer().getTrace().setLine(line);\n\t\t\tArrayList<Entity> hits = getKillTracer().getCollision(getMap());\n\t\t\tfor (Entity ent : hits) {\n\t\t\t\tif (ent instanceof Player && ent != this) {\n\t\t\t\t\tPlayer plent = (Player) ent;\n\t\t\t\t\tplent.die();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "private Point move(Point[] players, int[] chat_ids, Point self)\n\t{\n\t\t//Move to a new position within the room anywhere within 6 meters of your current position. Any conversation you were previously engaged in is terminated: you have to be stationary to chat.\n\t\t//Initiate a conversation with somebody who is standing at a distance between 0.5 meters and 2 meters of you. In this case you do not move. You can only initiate a conversation with somebody on the next turn if they and you are both not currently engaged in a conversation with somebody else. \t\n\t\tint i = 0, target = 0;\n\t\twhile (players[i].id != self_id) i++;\n\t\t//look through players who are within 6 meters => Point[] players\n\t\tPoint p = self;\n for (target = 0; target<players.length; ++target) {\n\t\t\t//if we do not contain any information on them, they are our target => W[]\n\t\t\tif (W[p.id] != -1 || p.id == self.id) continue;\n p = players[target];\n }\n if (p.equals(self)) {\n for (target = 0; target < players.length; ++target) {\n if (W[p.id] == 0 || p.id == self.id) continue;\n p = players[target];\n }\n }\n if (!p.equals(self)) {\n\t\t\t// compute squared distance\n\t\t\tdouble dx1 = self.x - p.x;\n\t\t\tdouble dy1 = self.y - p.y;\n\t\t\tdouble dd1 = dx1 * dx1 + dy1 * dy1;\n\t\t\t//check if they are engaged in conversations with someone\n\t\t\tint chatter = 0;\n\t\t\twhile (chatter<players.length && players[chatter].id != chat_ids[target]) chatter++;\n\n\t\t\t//check if they are engaged in conversations with someone and whether that person is in our vicinity\n\t\t\tif(chat_ids[target]!=p.id && chatter!=players.length)\n\t\t\t{\n\t\t\t\t//if they are, we want to stand in front of them, .5 meters in the direction of who they're conversing with => check if result is within 6meters\n\t\t\t\tPoint other = players[chatter];\n\t\t\t\tdouble dx2 = self.x - other.x;\n\t\t\t\tdouble dy2 = self.y - other.y;\n\t\t\t\tdouble dd2 = dx2 * dx2 + dy2 * dy2;\n\n\t\t\t\tdouble dx3 = dx2-dx1;\n\t\t\t\tdouble dy3 = dy2-dy1;\n\t\t\t\tdouble dd3 = Math.sqrt(dx3 * dx3 + dy3 * dy3);\n\n\t\t\t\tdouble dx4 = (dx2 - 0.5*(dx3/dd3)) * -1;\n\t\t\t\tdouble dy4 = (dy2 - 0.5*(dy3/dd3)) * -1;\n\t\t\t\tdouble dd4 = dx4 * dx4 + dy4 * dy4;\n\n\t\t\t\tif (dd4 <= 2.0)\n\t\t\t\t\treturn new Point(dx4, dy4, self.id);\n }\n\t\t\t//if not chatting to someone or don't know position of chatter, just get as close to them as possible\n\t\t\telse return new Point((dx1-0.5*(dx1/dd1)) * -1, (dy1-0.5*(dy1/dd1)) * -1, self.id);\t\t\t\t\n\t\t}\n\n\t\t\tdouble dir = random.nextDouble() * 2 * Math.PI;\n\t\t\tdouble dx = 6 * Math.cos(dir);\n\t\t\tdouble dy = 6 * Math.sin(dir);\n\t\t\treturn new Point(dx, dy, self_id);\n\t}", "@Test\n public void testAroundPlayerPositions() {\n IntStream.iterate(0, i -> i + 1).limit(LevelImpl.LEVEL_MAX).forEach(k -> {\n terrain = terrainFactory.create(level.getBlocksNumber());\n final List<Position> safePosition = new ArrayList<>();\n safePosition.add(TerrainFactoryImpl.PLAYER_POSITION);\n safePosition.add(new Position(TerrainFactoryImpl.PLAYER_POSITION.getX() + TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE,\n TerrainFactoryImpl.PLAYER_POSITION.getY()));\n safePosition.add(new Position(TerrainFactoryImpl.PLAYER_POSITION.getX(), \n TerrainFactoryImpl.PLAYER_POSITION.getY() + TerrainFactoryImpl.CELL_DIMENSION * ScreenToolUtils.SCALE));\n /*use assertFalse because they have already been removed*/\n assertFalse(terrain.getFreeTiles().stream().map(i -> i.getPosition()).collect(Collectors.toList()).containsAll(safePosition));\n level.levelUp();\n });\n }", "public boolean allowMove(Point p, int pos);", "public void simulation(){\n GameInformation gi = this.engine.getGameInformation();\n Point ball = gi.getBallPosition();\n Player playerSelected;\n int xTemp;\n team = gi.getTeam(ball.x , ball.y);\n\n //Attack\n if(team == gi.activeActor){\n selectAttackerPlayer(gi.getPlayerTeam(gi.activeActor));\n doAttackMoove(playerOne.getPosition(), gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectProtectPlayer(gi.getPlayerTeam(gi.activeActor));\n doProtectMoove(playerTwo.getPosition(), playerOne.getPosition() ,gi.cells[(int) playerTwo.getPosition().getX()][(int) playerTwo.getPosition().getY()].playerMoves);\n playerOne = null;\n playerTwo = null;\n this.engine.next();\n }\n else{//Defense\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n TacklAction tackl = new TacklAction();\n tackl.setSource(playerOne.getPosition());\n VisualArea[] area;\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n\n tackl.setSource(playerTwo.getPosition());\n\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n playerOne = null;\n playerTwo = null;\n }\n }", "private boolean hasMovements(Color playerColor){\r\n for(Point pos : getPieces(playerColor)){\r\n if(canMove(pos) || canEats(pos)) return true;\r\n }\r\n return false;\r\n }", "public void move() {\n\t\tsetHealth(getHealth() - 1);\n\t\t//status();\n\t\tint row = getPosition().getRow() ;\n\t\tint column = getPosition().getColumn();\n\t\tint randomInt = (int)((Math.random()*2) - 1);\n\t\t\n\t\tif(hunter == false && row < 33) {\n\t\t\tif(row == 32) {\n\t\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(row == 0) {\n\t\t\t\tgetPosition().setCoordinates(row + 1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 99) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column - 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 0) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column + 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t}\n\t\tif(hunter == false && row > 32) {\n\t\t\t//setHealth(100);\n\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\tsetPosition(getPosition()) ;\n\t\t}\n\t\telse {\n\t\t\tif(row < 65 && hunter == true) {\n\t\t\t\tgetPosition().setCoordinates(row + 1, column);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgetPosition().setCoordinates(65, column);\n\t\t\t\tsetPosition(getPosition());\n\t\t\t\t//Check if there is a gazelle\n\t\t\t\tPair [][] range = {{Drawer.pairs[row+1][column-1],Drawer.pairs[row+1][column],\n\t\t\t\t\t\t\t Drawer.pairs[row+1][column+1]}, {\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column-1],\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column],Drawer.pairs[row+2][column+1]}};\n\t\t\t\t\n\t\t\t\tfor(Pair [] line: range) {\n\t\t\t\t\tfor(Pair prey: line) {\n\t\t\t\t\t\tif(prey.getAnimal() instanceof Gazelle ) {\n\t\t\t\t\t\t\tattack();\n\t\t\t\t\t\t\tprey.getAnimal().die();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "private void checkIfOccupied(int row, int col) {\n if (status == MotionStatus.DOWN || AIisAttacking) {\n\n// if (player && playerAttacks != null) {\n// // Ignore touch if player has previously committed an attack on that cell.\n// for (int i = 0; i < playerAttacks.size(); i++) {\n// if (playerAttacks.get(i).equals(row,col)) {\n// Log.i(\"for\", \"You Hit this Previously!\");\n// }\n// }\n// }\n\n for (int i = 0; i < occupiedCells.size(); i++) {\n if (occupiedCells.get(i).x == row && occupiedCells.get(i).y == col) {\n Point p = new Point(row, col);\n selectedShip = findWhichShip(p); //Touching View Updated\n Log.i(\"checkIfOccupied getHit\", \"\" + getHit() + \", (\" + row + \", \" + col + \")\");\n setHit(true);\n break;\n }\n }\n\n if (selectedShip == null) {\n setHit(false);\n Log.i(\"checkIfOccupied getHit\", \"\" + getHit() + \", (\" + row + \", \" + col + \")\");\n }\n\n } else if (status == MotionStatus.MOVE) {//MotionStatus.MOVE\n if (selectedShip != null) {//Need to make sure none of the current ship parts will overlap another.\n int rowHolder = selectedShip.getHeadCoordinatePoint().x;\n int colHolder = selectedShip.getHeadCoordinatePoint().y;\n int tempRow, tempCol;\n selectedShip.moveShipTo(row, col);\n for (Ship s : ships) {\n if (s != selectedShip) {\n\n for (int i = 0; i < selectedShip.getShipSize(); i++) {\n tempRow = selectedShip.getBodyLocationPoints()[i].x;\n tempCol = selectedShip.getBodyLocationPoints()[i].y;\n\n for (int j = 0; j < s.getShipSize(); j++) {\n if (tempRow == s.getBodyLocationPoints()[j].x && tempCol == s.getBodyLocationPoints()[j].y) {\n selectedShip.moveShipTo(rowHolder, colHolder);\n }\n }//for\n }//for\n }\n }//for\n }\n }//Move\n }", "private boolean shouldAttackPlayer(EntityPlayer player) {\n ItemStack itemStack = player.inventory.armorInventory[3];\n if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))\n return false;\n Vec3 lookVec = player.getLook(1.0F).normalize();\n Vec3 posVec = Vec3.createVectorHelper(this.posX - player.posX, this.boundingBox.minY + this.height / 2.0 - player.posY - player.getEyeHeight(), this.posZ - player.posZ);\n double distance = posVec.lengthVector();\n posVec = posVec.normalize();\n double dotProduct = lookVec.dotProduct(posVec);\n return dotProduct > 1.0 - 0.025 / distance ? player.canEntityBeSeen(this) : false;\n }", "private void checkMovement() {\n\n if (getYVelocity() < 0) state = PlayerState.JUMPING;\n if (getYVelocity() == 0) /*|| getXVelocity() == 0)*/ state = PlayerState.STANDING;\n if (Keyboard.isKeyDown(Keyboard.KEY_W)) {\n\n if (!falling && !floating()) {\n\n if (getYVelocity() >= 0) {\n this.addY(-72);\n }\n\n }\n }\n\n if (Keyboard.isKeyDown(Keyboard.KEY_A)) {\n this.addX((float) -5);\n state = PlayerState.WALKLEFT;\n }\n if (Keyboard.isKeyDown(Keyboard.KEY_D)) {\n this.addX((float) 5);\n state = PlayerState.WALKRIGHT;\n }\n if (getYVelocity() > 0) state = PlayerState.FALLING;\n }", "@Override\n public void onUpdate(double tpf) {\n int x = (int)((entity.getX() + 30/2 ) / 30);\n int y = (int)((entity.getY() + 30/2 ) / 30);\n\n int px = (int)((player.getX() + 30/2 ) / 30);\n int py = (int)((player.getY() + 30/2 ) / 30);\n\n if (x == px || y == py) {\n shoot();\n }\n }", "public boolean movePlayer(MazePlayer p, Direction d) {\n//\t System.out.println(\"Player \"+p.name+\" requests to move in direction \"+d);\n// players can move through walls with some small probability!\n\t\t // calculate the new position after the move \n\t\t MazePosition oldPos = playerPosition.get(p.name);\n\t\t MazePosition newPos = theBoard.tryMove(oldPos,d);\n\n\t\t \n\t\t //make sure there is no other player at that position\n\t\t // and if there is someone there then just return without moving\n\t\t if (playerPosition.containsValue(newPos)){\n\t\t\t if (!newPos.equals(oldPos))\n\t\t\t\t if (debugging) System.out.println(\"player \"+p.name+\" tried to move into an occupied space.\");\n\t\t\t else\n\t\t\t\t if (debugging) System.out.println(p.name+\" stays at \"+oldPos);\n\t\t\t return false;\n\t\t }\n\t\t \n\t\t //otherwise, make the move\n\t\t playerPosition.put(p.name,newPos);\n\t\t if (debugging) System.out.println(p.name+\": \"+oldPos+\" -> \"+newPos);\n\t\t \n\t\t //take off points if you moved through a wall\n\t\t if (!theBoard.canMove(oldPos,d)){\n\t\t\t score.put(p.name,score.get(p.name)-2);\n\t\t\t if (debugging) System.out.println(p.name+\" moved through a wall\");\n\t\t }\n\t\t \n\t\t // mark that old space as \"free space\"\n\t\t freeSpace.add(0,oldPos);\n\t\t \n\t\t // check to see if there is a jewel in the new position.\n\t\t int i = jewelPosition.indexOf(newPos);\n\t\t if (i > -1) {\n\t\t\t // add 5 to the score\n\t\t\t score.put(p.name,score.get(p.name)+5);\n\t\t\t // remove the jewel\n\t\t\t jewelPosition.remove(i);\n\t\t\t if (debugging) System.out.println(\"and lands on a jewel!, score is now \" +score.get(p.name));\n\t\t\t // add another jewel\n\t\t\t MazePosition q = getEmptySpace();\n\t\t\t jewelPosition.add(q);\n\t\t\t if (debugging) System.out.println(\"adding a new jewel at \"+q);\n\t\t\t \n\t\t }\n\t\t else {\n\t\t\t // if no jewel, then remove the space from the freeSpace list\n\t\t\t freeSpace.remove(newPos);\n\t\t }\n\t\t return true;\n\n }", "boolean canMoveTo(Vector2d position);", "private void playerMoved(int currentPlayer, int currentUnit, boolean moved)\r\n {\r\n if(moved == true)//if player has made a legitimate move\r\n {\r\n worldPanel.repaint();\r\n int movesLeft = 0;\r\n if(currentPlayer == 1)\r\n {\r\n int myPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n\r\n //check to see if a player challenges another player\r\n for(int i = 0; i < worldPanel.player2.getNumUnits(); i++)\r\n {\r\n int pos = worldPanel.player2.units[i].getPosition();\r\n if(myPos == pos)\r\n {\r\n fight(1, currentUnit - 1, i);\r\n return;\r\n }\r\n }//end for\r\n\r\n //check to see if a player captures a city\r\n for(int i = 0; i < worldPanel.player2.getNumCities(); i++)\r\n {\r\n int pos = worldPanel.player2.cities[i].getLocation();\r\n if(myPos == pos)\r\n {\r\n captureCity(1,i);\r\n return;\r\n }\r\n }//end for\r\n movesLeft = worldPanel.player1.units[currentUnit - 1].getMovementsLeft();\r\n int temp = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n int temp1 = mapPieces[0][temp];\r\n if(temp1 == 54 || temp1 == 51 || temp1 == 52 || temp1 == 53)//if unit moves on rock or something\r\n worldPanel.player1.units[currentUnit - 1].setMovementsLeft(movesLeft - 2);\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player1.units[currentUnit - 1].getMovementsLeft();\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int myPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n\r\n //check to see if a player challenges another player\r\n for(int i = 0; i < worldPanel.player1.getNumUnits(); i++)\r\n {\r\n int pos = worldPanel.player1.units[i].getPosition();\r\n if(myPos == pos)\r\n {\r\n fight(2, currentUnit - 1, i);\r\n return;\r\n }\r\n }\r\n\r\n //check to see if a player captures a city\r\n for(int i = 0; i < worldPanel.player1.getNumCities(); i++)\r\n {\r\n int pos = worldPanel.player1.cities[i].getLocation();\r\n if(myPos == pos)\r\n {\r\n captureCity(2,i);\r\n return;\r\n }\r\n }//end for\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n int temp = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n int temp1 = mapPieces[0][temp];\r\n if(temp1 == 54 || temp1 == 51 || temp1 == 52 || temp1 == 53)//if unit moves on rock or something\r\n worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 2);\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n\r\n //worldPanel.player2.units[currentUnit - 1].setMovementsLeft(movesLeft - 1);\r\n movesLeft = worldPanel.player2.units[currentUnit - 1].getMovementsLeft();\r\n }\r\n\r\n if(movesLeft <= 0)//if unit has run out of moves\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n worldPanel.player1.units[currentUnit - 1].resetMovement();\r\n }\r\n if(currentPlayer == 2)\r\n {\r\n worldPanel.player2.units[currentUnit - 1].resetMovement();\r\n }\r\n currentUnit++;\r\n }//end if\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n\t\t\t\t\t\t{\r\n worldPanel.setCurrentPlayer(1);\r\n\t\t\t\t\t\t\t\tyear = unitPanel.getYear() + 20;//add 20 years to the game\r\n\t\t\t\t\t\t}\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n setInfoPanel();//set up the information panel\r\n }", "public boolean inRange(){\n //System.out.println(\"inRange\");\n return Math.abs(GameView.instance.player.position.x - creationPoint.x) < GameView.instance.cameraSize * attackRange;\n }", "public String playerNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-200 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+250 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}", "private boolean checkPoints() {\n\n for (Map.Entry pair : playersAgentsMap.entrySet()) {\n ArrayList<IAgent> iAgentList = (ArrayList<IAgent>) pair.getValue();\n\n int points = 0;\n try {\n points = iPlayerList.get(iAgentList.get(0).getName()).getPoints();\n } catch (RemoteException ex) {\n Logger.getLogger(ServerFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n try {\n for (Component comp : playerList.getComponents()) {\n if (comp instanceof PlayerPanel) {\n PlayerPanel panel = (PlayerPanel) comp;\n if (panel.getName().equals(iAgentList.get(0).getName())) {\n panel.setPlayerPoints(points);\n }\n }\n\n }\n } catch (RemoteException e1) {\n e1.printStackTrace();\n }\n if (points >= targetAmount) {\n try {\n System.out.println(iAgentList.get(0).getName() + \" has won with \" + points + \" points\");\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n return false;\n }\n }\n\n return true;\n }", "public void chasePlayer() {\n refreshObstructionMatrix();\n Coordinate currPosition = new Coordinate(getX(), getY());\n Player player = this.dungeon.getPlayer();\n Coordinate playerPosition = new Coordinate(player.getX(), player.getY());\n\n if (currPosition.equals(playerPosition)) {\n // Debug.printC(\"Enemy has reached the player!\", Debug.RED);\n player.useItem(this);\n } else {\n this.pathToDest = pathFinder.getPathToDest(currPosition, playerPosition);\n if (!this.pathToDest.empty()) {\n Coordinate nextPosition = this.pathToDest.pop();\n // this.setCoordinate(nextPosition);\n if (getX() + 1 == nextPosition.x) {\n moveRight();\n } else if (getX() - 1 == nextPosition.x) {\n moveLeft();\n } else if (getY() + 1 == nextPosition.y) {\n moveDown();\n } else if (getY() - 1 == nextPosition.y) {\n moveUp();\n }\n }\n }\n }", "private void checkPlayerCollisions() {\r\n\t\tGObject left = getElementAt(player.getX() - 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tGObject right = getElementAt(player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() / 2.0);\r\n\t\tif(dragon1 != null && (left == dragon1 || right == dragon1)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t\tif(dragon2 != null && (left == dragon2 || right == dragon2)) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t}", "public synchronized boolean isInPosition(){\r\n\t\tSystem.out.println(\"wheel: \" + flywheel.isFlywheelAtSpeed() + \r\n\t\t\t\t\" hood: \" + hood.isInPosition() + \r\n\t\t\t\t\" turret: \" + turret.isInPosition() + \r\n\t\t\t\t\" kicker: \" + kicker.isInPosition());\r\n\t\treturn flywheel.isFlywheelAtSpeed() && \r\n\t\t\t\thood.isInPosition() && \r\n\t\t\t\tturret.isInPosition() && \r\n\t\t\t\tkicker.isInPosition();\r\n\t}", "@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}", "public void prisonerUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tcreature.setAttacking(false);\r\n\t\troamArea();\r\n\t\tif (!checkCollision(x, y)) {\r\n\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testPlayerMovement() {\n\t\tEngine engine = new Engine(20);\n\t\tint x = engine.getMoveableObject(0).getX() + engine.getMoveableObject(0).getDisplacement().getXDisplacement();\n\t\tint y = engine.getMoveableObject(0).getY() + engine.getMoveableObject(0).getDisplacement().getYDisplacement();\n\t\tengine.update();\n\t\tassertEquals(\"failure - player's next x coordinate is not correct\", x, engine.getMoveableObject(0).getX(), 0.0);\n\t\tassertEquals(\"failure - player's next y coordinate is not correct\", y, engine.getMoveableObject(0).getY(), 0.0);\n\t}", "private boolean reachX(Position target) {\n return position.x == target.x;\n }", "public void attack() {\n\t\t\n\t\tint row = getPosition().getRow();\n\t\tint column = getPosition().getColumn();\n\t\t\n\t\tgetPosition().setCoordinates(row + 1, column);\n\t\tsetPosition(getPosition()) ;\n\t\t// restore health\n\t\tsetHealth(100);\n\t\t// end hunter mode\n\t\tthis.hunter = false;\n\t\t\n\t}", "public static boolean canPlayerMove(Player player){\r\n int playerX = 0;\r\n int playerY = 0;\r\n int nX;\r\n int nY;\r\n //finding the player on the board\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if(player.getPosition() == board[i][j]) {\r\n playerX = i;\r\n playerY = j;\r\n }\r\n }\r\n }\r\n //making sure that the player stays on the board\r\n\r\n if(playerY != board[0].length-1) {\r\n nX = playerX;\r\n nY = playerY + 1;\r\n if (board[nX][nY].west && board[playerX][playerY].east && !board[nX][nY].isOnFire) {//if the tile will accept the player\r\n return true;\r\n }\r\n }\r\n\r\n if(playerY != 0) {\r\n nX = playerX;\r\n nY = playerY - 1;\r\n if (board[nX][nY].east && board[playerX][playerY].west && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != 0) {\r\n nX = playerX - 1;\r\n nY = playerY;\r\n if (board[nX][nY].south && board[playerX][playerY].north && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != board.length-1) {\r\n nX = playerX + 1;\r\n nY = playerY;\r\n if (board[nX][nY].north && board[playerX][playerY].south && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }", "private void validPlayerMove(char moveType) {\n\n\t\t//Obtain X and Y of playerLocation\n\t\tint x = getPlayerLocation()[0];\n\t\tint y = getPlayerLocation()[1];\n\n\t\t//By default, set xOffset and yOffset to 0\n\t\tint xOffset = 0;\n\t\tint yOffset = 0;\n\n\t\t//Change xOffset and yOffset corresponding to each moveType\n\t\t//For example, RIGHT would set xOffset to +1\n\t\tswitch(moveType) {\n\t\tcase Legend.UP: \n\t\t\tyOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_LEFT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_RIGHT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN:\n\t\t\tyOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_RIGHT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_LEFT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.LEFT:\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.RIGHT:\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.JUMP:\n\n\t\t\t//Generate a random location of the jump\n\t\t\twhile (true) {\n\n\t\t\t\t//random x and y values (between 0-10)\n\t\t\t\tint randomX = 1+(int)(Math.random()*10);\n\t\t\t\tint randomY = 1+(int)(Math.random()*10);\n\n\t\t\t\t//If the new location is a BlankSpace, assign that as a Player, and assign a new move in moveList\n\t\t\t\tif(map[randomX][randomY] instanceof BlankSpace) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Player(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\n\t\t\t\t//If the new location is a Mho, completely wipe the board of the player, and initiate a gameOver procedure\n\t\t\t\telse if(map[randomX][randomY] instanceof Mho) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Mho(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tgameOver();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t//If the new location that the Player will move to will be a Player (in the case of Legend.SHRINK), or BlankSpace, change map and newMap, as well as moveList and the playerLocation \n\t\tif (map[x+xOffset][y+yOffset] instanceof BlankSpace || map[x+xOffset][y+yOffset] instanceof Player) {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tnewMap[x+xOffset][y+yOffset] = new Player(x+xOffset, y+yOffset, board);\n\t\t\tmoveList[x][y] = moveType;\n\t\t\tsetNewPlayerLocation(new int[] {x+xOffset, y+yOffset});\n\t\t\treturn;\n\t\t} \n\n\t\t//If the new location that the Player will move to will be a Fence, remove the player from the map and initiate the gameOver() process\n\t\telse {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tmoveList[x][y] = Legend.SHRINK;\n\t\t\tsetNewPlayerLocation(new int[] {x, y});\n\t\t\tgameOver();\n\t\t\treturn;\n\t\t}\n\n\t}", "public boolean isValidMultiplayerMove(int xMove, int yMove, ArrayList<Entity> objects, \r\n ArrayList<NonPlayerCharacter> npcs, ArrayList<Item> items, World world){\n for (int i = 0; i < objects.size(); i++)//collisioned an object\r\n {\r\n if (x + xMove == objects.get(i).getX() && y + yMove == objects.get(i).getY()) {\r\n objects.get(i).setCollisioned(true);\r\n return false;\r\n } else {\r\n objects.get(i).setCollisioned(false);\r\n }\r\n }\r\n\r\n //ArrayList<NonPlayerCharacter> npcs = ((GameState) game.getGameState()).getNpcs();\r\n for (int i = 0; i < npcs.size(); i++) {\r\n if (x + xMove == npcs.get(i).getX() && y + yMove == npcs.get(i).getY()) {\r\n npcs.get(i).setCollisioned(true);\r\n return false;\r\n }\r\n }\r\n\r\n //ArrayList<Item> items = ((GameState) game.getGameState()).getItems();\r\n for (int i = 0; i < items.size(); i++) {\r\n if (x + xMove == items.get(i).getX() && y + yMove == items.get(i).getY()) {\r\n items.get(i).setCollisioned(true);\r\n return false;\r\n }\r\n }\r\n\r\n /*if (((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()) {\r\n return false;\r\n }*/\r\n if (world.getTile((int) (x + xMove), (int) (y + yMove)).isSolid()) {\r\n return false;\r\n }\r\n \r\n if (world.getTile((int) (x + xMove), (int) (y + yMove)).getId() == 2) {\r\n return false;\r\n }\r\n\r\n /*if (x + xMove == ((GameState) game.getGameState()).getPlayer().getX()\r\n && y + yMove == ((GameState) game.getGameState()).getPlayer().getY()) {\r\n return false;\r\n }*/\r\n return true;\r\n }", "public void guardUpdate(){\r\n\t\t//check if a enemy has been spotted\r\n\t\tif (checkSight()){\r\n\t\t\tseen = true;\r\n\t\t} if (seen) {\r\n\t\t\tcreature.setSpeed(1.5);\r\n\t\t\tchaseEnemy(seenEnemy, 5);\r\n\t\t\treturn; //if player has been spotted end method here\r\n\t\t}\r\n\t\t//if no enemy has been spotted\r\n\t\tcreature.setSpeed(1);\r\n\t\tif (creature.getCreature().equals(CreatureType.PGuard) || creature.getCreature().equals(CreatureType.SGuard)){ //Patrol Guards and Stationary Guards\r\n\t\t\tif (index > checkpoints.size()-1){\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\tgoToLocation (checkpoints.get(index));\r\n\t\t} else if(creature.getCreature().equals(CreatureType.RGuard)){ //Roaming Guards\r\n\t\t\troamArea();\r\n\t\t} if (!checkCollision(x, y)) {\r\n\t\t\tgoToLocation(x, y);\r\n\t\t}\r\n\t}", "void move() {\r\n\t\tif (x + xa < 0){\r\n\t\t\txa = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (x + xa > game.getWidth() - diameter){\r\n\t\t\txa = -mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (y + ya < 0){\r\n\t\t\tya = mov;\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\telse if (y + ya > game.getHeight() - diameter){\r\n\t\t\tgame.gameOver();\r\n\t\t\tgame.puntuacion++;\r\n\t\t}\r\n\t\tif (colisionPalas()){\r\n\t\t\tya = -mov;\r\n\t\t}\r\n\t\telse if(colisionEstorbos()){\r\n\t\t\tgame.puntuacion+=2;\r\n\t\t}\r\n\t\t\r\n\t\tx = x + xa;\r\n\t\ty = y + ya;\r\n\t}", "public void getMovements()\n {\n if(\n Greenfoot.isKeyDown(\"Up\")||Greenfoot.isKeyDown(\"W\")||\n Greenfoot.isKeyDown(\"Down\")||Greenfoot.isKeyDown(\"S\")||\n Greenfoot.isKeyDown(\"Right\")||Greenfoot.isKeyDown(\"D\")||\n Greenfoot.isKeyDown(\"Left\") ||Greenfoot.isKeyDown(\"A\")||\n getWorld().getObjects(Traps.class).isEmpty() == false //car trap engendre un mouvement sans les touches directionnelles\n )\n {\n isMoved = true;\n }\n else{isMoved = false;}\n }", "public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }", "public void setPlayerPosition(Player player) {\n\n if (player.getPosition().equals(\"Left Wing\")) {\n\n for (int i = 0; i < 2; i++) {\n if (forwardLines[i][0] == null) {\n forwardLines[i][0] = player;\n break;\n }\n }\n }\n\n else if (player.getPosition().equals(\"Center\")) {\n for (int i = 0; i < 2; i++) {\n if (forwardLines[i][1] == null) {\n forwardLines[i][1] = player;\n break;\n }\n }\n }\n\n else if (player.getPosition().equals(\"Right Wing\")) {\n for (int i = 0; i < 2; i++) {\n if (forwardLines[i][2] == null) {\n forwardLines[i][2] = player;\n break;\n }\n }\n }\n\n else if (player.getPosition().equals(\"Left Defence\")) {\n for (int i = 0; i < 2; i++) {\n if (defenceLines[i][0] == null) {\n defenceLines[i][0] = player;\n break;\n }\n }\n }\n\n else if (player.getPosition().equals(\"Right Defence\")) {\n for (int i = 0; i < 2; i++) {\n if (defenceLines[i][1] == null) {\n defenceLines[i][1] = player;\n break;\n }\n }\n }\n }", "void playerPositionChanged(Player player);", "@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }", "@Listen\r\n public void onPacket(PacketEvent e) {\r\n\r\n if (e.getType().equalsIgnoreCase(Packet.Client.POSITION)) {\r\n if ((System.currentTimeMillis() - e.getUser().getCombatData().getLastUseEntityPacket()) < 1000L\r\n && Math.abs(e.getTo().getPitch() - e.getFrom().getPitch()) > 0.01) {\r\n double yaw = e.getUser().getMovementData().getTo().getYaw();\r\n double sensitivity = e.getUser().getMiscData().getClientSensitivity();\r\n\r\n float f = (float) (sensitivity * 0.6F + 0.2F);\r\n float gcd = f * f * f * 1.2F;\r\n\r\n yaw = -yaw % gcd;\r\n\r\n double real = Math.abs(e.getUser().getMovementData().getTo().getYaw());\r\n\r\n if (real == e.getUser().getCheckData().lastAimMDiff && yaw == e.getUser().getCheckData().lastAimMDiff2) {\r\n\r\n if ((System.currentTimeMillis() - e.getUser().getCheckData().lastAimMPossibleLag) < 1500L) {\r\n e.getUser().getCheckData().aimMVerbose++;\r\n } else {\r\n if (e.getUser().getCheckData().aimMVerbose > 0 && (System.currentTimeMillis() - e.getUser().getCheckData().lastAimMPossibleLag) > 1000l)\r\n e.getUser().getCheckData().aimMVerbose--;\r\n }\r\n\r\n e.getUser().getCheckData().lastAimMPossibleLag = System.currentTimeMillis();\r\n\r\n if (e.getUser().getCheckData().aimMVerbose > 2) {\r\n flag(e.getUser(), \"verbose=\"+e.getUser().getCheckData().aimMVerbose, \"spoof=\"+yaw, \"real=\"+real);\r\n }\r\n } else {\r\n if (e.getUser().getCheckData().aimMVerbose > 0 && TimeUtils.secondsFromLong(e.getUser().getCheckData().lastAimMPossibleLag) > 2L) {\r\n e.getUser().getCheckData().aimMVerbose--;\r\n }\r\n }\r\n\r\n e.getUser().getCheckData().lastAimMDiff = real;\r\n e.getUser().getCheckData().lastAimMDiff2 = yaw;\r\n\r\n }\r\n }\r\n }", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "public boolean check(double xDelt,double yDelt) {\r\n \tBounds pBound= player1.player.getBoundsInParent();\r\n \t\r\n \tfor( Node object: enemy1.hostileG.getChildren()) {\r\n \t\t\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\t\teHealth -= inventory.getpDamage();\r\n \t\t\tpHealth -= 1;\r\n\r\n \t\t\tSystem.out.println(\"eHealth \"+ eHealth);\r\n \t\t\tSystem.out.println(\"pHealth \"+ pHealth);\r\n \t\t\t\r\n \t\t\t//\"Deaths of the sprites\"\r\n \t\t\tif(pHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(player1.player);\r\n \t\t\t\tSystem.out.println(\"You died!\");\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(eHealth <=0) {\r\n \t\t\t\tlayout.getChildren().remove(enemy1.enemy);\r\n \t\t\t\tenemy1.enemy.setLayoutX(-10000);\r\n \t\t\t\tenemy1.enemy.setLayoutY(-10000);\r\n \t\t\t}\r\n \t\treturn false;\r\n \t\t}\r\n }\r\n \t\r\n \tfor( Node object: map1.walls.getChildren()) {\r\n \t\tif(object.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())) return false;\r\n \t}\r\n \t\r\n \tfor( Node chest: map1.chests.getChildren()) {\r\n \tif(chest.getBoundsInParent().intersects(pBound.getMinX()+xDelt, pBound.getMinY()+yDelt, pBound.getWidth(), pBound.getHeight())){\r\n \t\tmap1.chests.getChildren().remove(chest);\r\n \t chestchose=inventory.getchestchose();\r\n \t \r\n \t if(chestchose==1) {\r\n \t \tinventory.sworda.setVisible(true);\r\n \t \tinventory.setpDamage(3);\r\n \t }\r\n \t if(chestchose==2) {\r\n \t \tinventory.healthbag.setVisible(true);\r\n \t }\r\n \t \r\n \t return false;\r\n \t} \r\n }\t\r\n \t\r\n return true;\r\n }", "boolean canMove();", "public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }", "public void checkHits() {\n\t\t// your code here\n\t\tfor (int i = 0; i < enemyX.length; i++) {\n\t\t\tif (distance((int)xI, (int)yI, enemyX[i], enemyY[i]) <= DIAM_ENEMY/2 + DIAM_LAUNCHER/2) {\n\t\t\t}\n\t\t}\n\t}", "private void processPlayerCollision() {\n\t\t// This starts by converting the player vertices to global positions.\n\t\tVector3 playerGlobalPosition = player.getGlobalPositionVector();\n\t\tVector3 playerGlobalRotation = player.getGlobalRotationVector();\n\n\t\tVector3 playerVertex1 = new Vector3(player.hitboxPoints[0], player.hitboxPoints[1]);\n\t\tVector3 playerVertex2 = new Vector3(player.hitboxPoints[2], player.hitboxPoints[3]);\n\t\tVector3 playerVertex3 = new Vector3(player.hitboxPoints[4], player.hitboxPoints[5]);\n\t\t// TODO: Confirm this is correct.\n\t\tVector3 playerVertex1Global = new Vector3(playerVertex1.x * -Math.sin(Math.toRadians(playerGlobalRotation.z)), playerVertex1.y * Math.cos(Math.toRadians(playerGlobalRotation.z))).add(playerGlobalPosition);\n\t\tVector3 playerVertex2Global = new Vector3(playerVertex2.x * -Math.sin(Math.toRadians(playerGlobalRotation.z)), playerVertex2.y * Math.cos(Math.toRadians(playerGlobalRotation.z))).add(playerGlobalPosition);\n\t\tVector3 playerVertex3Global = new Vector3(playerVertex3.x * -Math.sin(Math.toRadians(playerGlobalRotation.z)), playerVertex3.y * Math.cos(Math.toRadians(playerGlobalRotation.z))).add(playerGlobalPosition);\n\n\t\tfor (AsteroidsAsteroid a : asteroids) {\n\t\t\t// If any of the vertices collide and the player is alive, lose a life.\n\t\t\tif ((a.collides(playerVertex1Global) || a.collides(playerVertex2Global) || a.collides(playerVertex3Global)) && player.isShowing()) {\n\t\t\t\tloseLife();\n\t\t\t}\n\t\t}\n\t}", "boolean hasTargetPos();", "void userMoveRequested(int playerIndex);", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "void checkCol() {\n Player player = gm.getP();\n int widthPlayer = (int) player.getImg().getWidth();\n int heightPlayer = (int) player.getImg().getHeight();\n Bullet dummyBuullet = new Bullet();\n int widthBullet = (int) dummyBuullet.getImg().getWidth();\n int heightBullet = (int) dummyBuullet.getImg().getHeight();\n for (Bullet bullet : gm.getBulletList()) {\n // the bullet must be an enemy bullet\n if (bullet.isEnemyBullet() && bullet.isActive()) {\n // the condition when the bullet location is inside the rectangle of player\n if ( Math.abs( bullet.getX() - player.getX() ) < widthPlayer / 2\n && Math.abs( bullet.getY() - player.getY() ) < heightPlayer / 2 ) {\n // 1) destroy the bullet\n // 2) decrease the life of a player\n gm.getP().setHasShield(false);\n if(gm.getP().getCurDirection() == 0){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipLeft4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if(gm.getP().getCurDirection() == 1){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipRight4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n bullet.setActive(false);\n if(gm.getP().getHasShield() == false)player.decreaseLife();\n break;\n }\n }\n }\n // 2'nd case\n // the enemy is hit with player bullet\n for (Enemy enemy : gm.getEnemyList()) {\n if (enemy.isActive()) {\n int widthEnemy = (int) enemy.getImg().getWidth();\n int heightEnemy = (int) enemy.getImg().getHeight();\n for (Bullet bullet : gm.getBulletList()) {\n if (!bullet.isEnemyBullet() && bullet.isActive()) {\n // the condition when the player bullet location is inside the rectangle of enemy\n if (Math.abs(enemy.getX() - bullet.getX()) < (widthBullet / 2 + widthEnemy / 2)\n && Math.abs(enemy.getY() - bullet.getY()) < (heightBullet / 2 + heightEnemy / 2)) {\n // 1) destroy the player bullet\n // 2) destroy the enemy\n if (destroyedEnemy % 3 == 0 && destroyedEnemy != 0) onlyOnce = 0;\n destroyedEnemy++;\n gm.increaseScore();\n enemy.setActive(false);\n\n\n if(enemy.hTitanium()) {\n gm.getTitaniumList()[gm.getTitaniumIndex()].setX(enemy.getX());\n gm.getTitaniumList()[gm.getTitaniumIndex()].setY(enemy.getY());\n gm.getTitaniumList()[gm.getTitaniumIndex()].setActive(true);\n gm.increaseTitaniumIndex();\n }\n\n if(enemy.hBonus()) {\n \tgm.getBonusList()[gm.getBonusIndex()].setX(enemy.getX());\n \tgm.getBonusList()[gm.getBonusIndex()].setY(enemy.getY());\n \tgm.getBonusList()[gm.getBonusIndex()].setActive(true);\n \tgm.increaseBonusIndex();\n }\n bullet.setActive(false);\n break;\n }\n }\n }\n }\n }\n\n // 3'rd case\n // the player collided with enemy ship\n for (Enemy enemy : gm.getEnemyList()) {\n if (enemy.isActive()) {\n int widthEnemy = (int) enemy.getImg().getWidth();\n int heightEnemy = (int) enemy.getImg().getHeight();\n // the condition when the enemy rectangle is inside the rectangle of player\n if (Math.abs(enemy.getX() - player.getX()) < (widthPlayer / 2 + widthEnemy / 2)\n && Math.abs(enemy.getY() - player.getY()) < (heightPlayer / 2 + heightEnemy / 2)) {\n // 1) destroy the enemy\n // 2) decrease the player's life\n if(gm.getP().getHasShield() == false)player.decreaseLife();\n gm.getP().setHasShield(false);\n if(gm.getP().getCurDirection() == 0){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipLeft4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if(gm.getP().getCurDirection() == 1){\n try (FileInputStream inputStream = new FileInputStream(\"MediaFiles/spaceshipRight4.png\")) {\n gm.getP().setImg(new Image(inputStream)) ;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n enemy.setActive(false);\n\n break;\n }\n }\n }\n\n for (Bonus bonus : gm.getBonusList()) {\n if (bonus.isActive()) {\n int widthBonus = (int) bonus.getImg().getWidth();\n int heightBonus = (int) bonus.getImg().getHeight();\n if (Math.abs(bonus.getX() - player.getX()) < (widthPlayer / 2 + widthBonus / 2)\n && Math.abs(bonus.getY() - player.getY()) < (heightPlayer / 2 + heightBonus / 2)) {\n bonus.setActive(false);\n if (bonus.getType() == 1) {\n if (player.getLives() < player.getMaxLives()) {\n player.setLives(player.getLives() + 1);\n }\n }\n else{\n superAttack = 1;\n }\n }\n }\n }\n\n for (Titanium titanium : gm.getTitaniumList()) {\n if (titanium.isActive()) {\n int widthBonus = (int) titanium.getImg().getWidth();\n int heightBonus = (int) titanium.getImg().getHeight();\n if (Math.abs(titanium.getX() - player.getX()) < (widthPlayer / 2 + widthBonus / 2)\n && Math.abs(titanium.getY() - player.getY()) < (heightPlayer / 2 + heightBonus / 2)) {\n titanium.setActive(false);\n gm.getP().increaseTitanium();\n }\n }\n }\n\n }", "public void doAttackMoove(Point player, int move){\n MoveAction action = new MoveAction();\n action.setSource(this.player);\n VisualArea tab[] = action.getVisualArea( this.engine.getGameInformation() );\n Point better = player;\n for( int i = 0 ; i < tab.length ; i++ ){\n if( team == 0 ){\n if( tab[i].getX() > better.getX() )better = tab[i];\n }else if ( team == 1 ) {\n if( tab[i].getX() < better.getX() )better = tab[i];\n }else{\n new JOptionPane(\"Error\");\n }\n action.setDestination(better);\n this.engine.performAction( action );\n }\n }", "public int move(int player, int p, int x, int y) throws Exception{\n if(player != next || player != p)\n throw new Exception(\"Invalid position.\");\n\n //int x = pos & 255;\n //int y = pos>>8 & 255;\n\n if(board[x][y] == 0){\n board[x][y] = player;\n next = next==1?2:1;\n stonesNum++;\n setWinFlag(x, y);\n }else{\n throw new Exception(\"Invalid move.\");\n }\n return winFlag;\n }", "public void playerAttack() {\n if (playerTurn==true) {\n myMonster.enemHealth=myMonster.enemHealth-battlePlayer.str;\n }\n playerTurn=false;\n enemyMove();\n }", "@Override\n public void action(){\n\n Position move=this.findWeed();\n if(move.getX()==0 && move.getY()==0){\n super.action();\n }\n else{\n System.out.println(this.getClass().getSimpleName());\n int actualX = this.position.getX();\n int actualY = this.position.getY();\n int xAction = actualX+move.getX();\n int yAction = actualY+move.getY();\n Organism tmpOrganism = this.WORLD.getOrganism(xAction, yAction);\n if(tmpOrganism==null){\n this.move(move.getX(), move.getY());\n this.WORLD.erasePosition(actualX,actualY);\n }\n else{\n tmpOrganism.collision(this, actualX, actualY, move);\n }\n }\n }", "public void move() {\n if (!isCollision(xMove, 0))\n moveX();\n //else\n // adjustX(xMove);\n\n if (!isCollision(0, yMove))\n moveY();\n //else\n // adjustY(yMove);\n //check isCollision(gameObject) with calculating the position for next move\n\n }", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public boolean movePiece(int player, int from, int to) {\n\n int piece = players.get(player).getPiece(from);\n\n // PIECELISTENER : Throw PieceEvent to PieceListeners\n for (PieceListener listener : pieceListeners) {\n PieceEvent pieceEvent = new PieceEvent(this, player, piece, from, to);\n listener.pieceMoved(pieceEvent);\n }\n\n if (piece != -1) {\n //last throw was a 6, but player is in starting position\n //end of turn\n if (this.lastThrow == 6 && players.get(player).inStartingPosition() && from == 0) {\n // PLAYERLISTENER : Trigger playerEvent for player that is WAITING\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, players.get(player).getColour(), PlayerEvent.WAITING);\n listener.playerStateChanged(event);\n }\n this.setNextActivePlayer();\n }\n //player didn't throw a 6\n //end of turn\n if (this.lastThrow != 6) {\n // PLAYERLISTENER : Trigger playerEvent for player that is WAITING\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, players.get(player).getColour(), PlayerEvent.WAITING);\n listener.playerStateChanged(event);\n }\n this.setNextActivePlayer();\n }\n\n //Resets the tower info when a tower is split\n if (players.get(player).getPieces().get(piece).towerPos != -1) {\n players.get(player)\n .getPieces()\n .get(piece)\n .setTower(-1);\n\n for (Piece piece2 : players.get(player).pieces) {\n if (piece2.position == from) {\n piece2.setTower(-1);\n }\n }\n }\n\n //Sets tower info when a tower is made\n for (Piece piece2 : players.get(player).pieces) {\n if (piece2.position == to) {\n //Both pieces become a tower\n piece2.setTower(piece2.position);\n players.get(player)\n .getPieces()\n .get(piece)\n .setTower(to);\n }\n }\n\n //move piece\n players.get(player)\n .getPieces()\n .get(piece)\n .setPosition(to);\n\n //set piece to in play\n if (to > 0 && to < 59) {\n players.get(player)\n .getPieces()\n .get(piece)\n .setInPlay(true);\n }\n\n checkIfAnotherPlayerLiesThere(player, to);\n\n if (to == 59) {\n\n if (players.get(player).pieceFinished()) {\n this.status = \"Finished\";\n getWinner();\n }\n }\n\n return true;\n } else {\n //doesn't work\n return false;\n }\n\n }", "private boolean checkNearbyVillagers() {\n\t\tIterator<Integer> it = sprites.keySet().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSprite as = sprites.get(it.next());\n\t\t\tif (as instanceof Villager) {\n\t\t\t\tVillager v = (Villager) as;\n\t\t\t\tif (v.checkTalkable(player.pos, player.direction)) {\n\t\t\t\t\treturn executeTalkableVillager(v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected Entity findPlayerToAttack() {\n/* 339 */ double var1 = 8.0D;\n/* 340 */ return getIsSummoned() ? null : this.field_70170_p.func_72890_a(this, var1);\n/* */ }", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}", "void check_alien_direction() {\n // Aliens are moving right, check if aliens will move off screen\n if (Alien.direction == Alien.Directions.RIGHT) {\n double max_x = rightmost_alien_x();\n // Alien1 has largest width, so we use that one to calculate if all aliens will fit\n if (max_x + Dimensions.ALIEN1_WIDTH + Dimensions.X_PADDING > scene_width){\n Alien.changeDirections();\n }\n }\n\n // Aliens are moving left, check if aliens will move off screen\n else if (Alien.direction == Alien.Directions.LEFT) {\n double min_x = leftmost_alien_x();\n if (min_x < Dimensions.X_PADDING){\n Alien.changeDirections();\n }\n }\n\n // Aliens are moving down, check if they finished moving down\n else if (Alien.direction == Alien.Directions.DOWN &&\n Alien.down_distance_travelled >= Dimensions.ALIEN_VERTICAL_SPACE){\n random_alien_fires(); // After aliens all descend one row, one of the ships fires at the player\n Alien.changeDirections();\n }\n }", "@Override\r\n public void tick() {\n playerNextTo();\r\n if (playerContact() && isCollisioned()) {\r\n if (!((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()\r\n && isValidMove(xMove, yMove)) {\r\n x += xMove;\r\n y += yMove;\r\n }\r\n }\r\n }", "public void checkwarp(){\n\t\tif(pacman.ypos > (colours[0].length*interval)-2){\r\n\t\t\tpacman.ypos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.xpos > (colours.length*interval)-2){\r\n\t\t\tpacman.xpos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.ypos < interval+2){\r\n\t\t\tpacman.ypos = (colours[0].length*interval)-2;\r\n\t\t}\r\n\t\telse if(pacman.xpos < interval+2){\r\n\t\t\tpacman.xpos = (colours.length*interval)-2;\r\n\t\t}\r\n\t\t\r\n\t}", "private void moveRobots() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == Player.PlayerType.Robot) {\n\t\t\t\tPoint old = new Point(p.getX(), p.getY());\n\t\t\t\tPoint newPoint = new Point(p.getX(), p.getY());\n\t\t\t\t\n\t\t\t\toccupiedPositions.remove(old);\n\t\t\t\t\n\t\t\t\tint playerX = p.getPlayerToFollow().getX();\n\t\t\t\tint playerY = p.getPlayerToFollow().getY();\n\t\t\t\t\n\t\t\t\t//move towards the agent\n\t\t\t\tif(p.getX() < playerX)\n\t\t\t\t\tnewPoint.x += 1;\n\t\t\t\telse if(p.getX() > playerX)\n\t\t\t\t\tnewPoint.x -= 1;\n\t\t\t\t\n\t\t\t\tif(p.getY() < playerY)\n\t\t\t\t\tnewPoint.y += 1;\n\t\t\t\telse if(p.getY() > playerY)\n\t\t\t\t\tnewPoint.y -= 1;\n\t\t\t\t\n\t\t\t\tp.setPosition(newPoint);\n\t\t\t\t\n\t\t\t\t//check if the robot has moved on to something\n\t\t\t\tif(occupiedPositions.contains(newPoint)) { \t\t// check if the position is occupied\n\t\t\t\t\tfor(Player p2 : playerList) { \t\t\t\n\t\t\t\t\t\tif(!p.getName().equals(p2.getName())) {\t// check so it not is the robot itself\n\t\t\t\t\t\t\tif(newPoint.equals(p2.getPosition())) {\n\t\t\t\t\t\t\t\tif(p2.getType() == PlayerType.Robot) { // if it is a robot, both should be rubble\n\t\t\t\t\t\t\t\t\tp2.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp2.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tp.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tHandleCommunication.broadcastToClient(null, server.getConnectedClientList(), SendSetting.ChangedType, p.getName(), p2.getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(p2.getType() == PlayerType.Rubble) { // if it is rubble\n\t\t\t\t\t\t\t\t\tp.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tHandleCommunication.broadcastToClient(null, server.getConnectedClientList(), SendSetting.ChangedType, p.getName(), p2.getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(p2.getType() == PlayerType.Agent) {\n\t\t\t\t\t\t\t\t\tString send = generateSendableHighscoreList();\n\t\t\t\t\t\t\t\t\tserver.sendMessageToClient(p2.getName(), \"@132@\" + highscore.size() + \"@\" + send);\n\t\t\t\t\t\t\t\t\tserver.addTextToLoggingWindow(\"Robot killed player (\" + p2.getName() + \")\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\toccupiedPositions.add(newPoint);\n\t\t\t\tserver.broadcastToClient(p.getName(), SendSetting.PlayerMoved, old, newPoint);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t//send that it is agents turn again\n\t\tserver.broadcastToClient(null, SendSetting.AgentsTurnToMove, null, null);\n\t}", "private boolean playerDetection() {\n\t\tAxisAlignedBB axisalignedbb = new AxisAlignedBB(posX, posY, posZ, posX + 1, posY + 1, posZ + 1).grow(DETECTION_RANGE);\n\t\tList<EntityPlayer> list = world.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb);\n\n\t\treturn !list.isEmpty();\n\t}", "public int canPoseBombAndStillBeSafe() {\n Player currentPlayer = state.getCurrentPlayer();\n List<Player> players = state.getPlayers();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n for (Player p : players) {\n if (!p.equals(currentPlayer)) {\n if (canBombThisEnemyAndRunSafe(currentPlayer,p)) {\n return 1;\n }\n }\n }\n return 0;\n }", "@Override\n public void doAction() {\n String move = agent.getBestMove(currentPosition);\n execute(move);\n\n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n\n if (w.hasWumpus(cX, cY)) {\n System.out.println(\"Wampus is here\");\n w.doAction(World.A_SHOOT);\n } else if (w.hasGlitter(cX, cY)) {\n System.out.println(\"Agent won\");\n w.doAction(World.A_GRAB);\n } else if (w.hasPit(cX, cY)) {\n System.out.println(\"Fell in the pit\");\n }\n\n// //Basic action:\n// //Grab Gold if we can.\n// if (w.hasGlitter(cX, cY)) {\n// w.doAction(World.A_GRAB);\n// return;\n// }\n//\n// //Basic action:\n// //We are in a pit. Climb up.\n// if (w.isInPit()) {\n// w.doAction(World.A_CLIMB);\n// return;\n// }\n//\n// //Test the environment\n// if (w.hasBreeze(cX, cY)) {\n// System.out.println(\"I am in a Breeze\");\n// }\n// if (w.hasStench(cX, cY)) {\n// System.out.println(\"I am in a Stench\");\n// }\n// if (w.hasPit(cX, cY)) {\n// System.out.println(\"I am in a Pit\");\n// }\n// if (w.getDirection() == World.DIR_RIGHT) {\n// System.out.println(\"I am facing Right\");\n// }\n// if (w.getDirection() == World.DIR_LEFT) {\n// System.out.println(\"I am facing Left\");\n// }\n// if (w.getDirection() == World.DIR_UP) {\n// System.out.println(\"I am facing Up\");\n// }\n// if (w.getDirection() == World.DIR_DOWN) {\n// System.out.println(\"I am facing Down\");\n// }\n//\n// //decide next move\n// rnd = decideRandomMove();\n// if (rnd == 0) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 1) {\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 2) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 3) {\n// w.doAction(World.A_TURN_RIGHT);\n// w.doAction(World.A_MOVE);\n// }\n }", "public void setPlayerPosition(Player player) {\n if (player.getPositionX() < 0 && (player.getPositionY() > screenHeight / 2 - doorSize && player.getPositionY() < screenHeight / 2 + doorSize)) {\n //left exit to right entry\n player.position.x = screenWidth - wallSize - player.getRadius();\n player.position.y = player.getPositionY();\n } else if ((player.getPositionX() > screenWidth / 2 - doorSize && player.getPositionX() < screenWidth / 2 + doorSize) && player.getPositionY() < 0) {\n //top exit to bottom entry\n player.position.x = player.getPositionX();\n player.position.y = screenHeight - wallSize - player.getRadius();\n } else if (player.getPositionX() > screenWidth && (player.getPositionY() > screenHeight / 2 - doorSize && player.getPositionY() < screenHeight / 2 + doorSize)) {\n //right exit to left entry\n player.position.x = wallSize + player.getRadius();\n player.position.y = player.getPositionY();\n } else {\n //bottom exit to top entry\n player.position.x = player.getPositionX();\n player.position.y = wallSize + player.getRadius();\n }\n }", "@Override\n protected boolean canMove(int playerIdx) {\n if(pgs.getTurnID() == playerIdx){\n return true;\n }\n return false;\n }", "public boolean shooting(){\n\t\t\tif(x==tmp || x==tmp1 || x==tmp2 || x == tmp3){\n\t\t\t\treturn true; \n\t\t\t}\n\t\t\telse \n\t\t\t\treturn false; \n\t}", "@Override\r\n public void update() {\r\n super.update();\r\n hero.checkForTileCollision(getXOverlap(hero.oldx,hero.oldx+width,hero.x,hero.x+width), getYOverlap(hero.oldy,hero.oldy+hero.height,hero.y, hero.y+hero.height));\r\n int i = 0;\r\n\r\n while (turningPoints[i]!= null)\r\n {\r\n if (intersects(turningPoints[i].x,turningPoints[i].y, turningPoints[i].width,turningPoints[i].height))\r\n {\r\n vx = -vx;\r\n vy = -vy;\r\n }\r\n i++;\r\n }\r\n }", "public void updatePosition(List<CollisionObject> collidables) {\n double start = 0;\n // If the boat does not need to regenerate stamina, then they accelerate\n if (!regen) {\n this.accelerate();\n // When stamina gets low, regen is set to true, meaning the boat will regenerate stamina\n if (stamina <= 0.2) {\n regen = true;\n }\n } else {\n //We calculate a random number here so that we can add some variety\n //to the AI boat's behaviour\n while (start <= 0.3 ) {\n start = Math.random();\n }\n if (stamina >= start ) {\n regen = false;\n }\n }\n this.check_turn(collidables);\n super.updatePosition();\n\n }", "private void handleMovement() {\n if (movements.isEmpty()) return;\n try {\n switch (movements.peek()) {\n case MOVE_UP:\n game.movePlayer(Direction.N);\n break;\n case MOVE_LEFT:\n game.movePlayer(Direction.W);\n break;\n case MOVE_DOWN:\n game.movePlayer(Direction.S);\n break;\n case MOVE_RIGHT:\n game.movePlayer(Direction.E);\n break;\n }\n } catch (Exception ignored) { }\n }", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "boolean hasPosition();", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "public void Update() {\r\n\t\t//if player is near and haven't fired in a while, fire a projectile\r\n\t\tif(!playerNear().equals(\"n\") && j > 250){\r\n\t\t\tfireProjectile(playerNear());\r\n\t\t\tj = 0;\r\n\t\t}\r\n\t\tj++;\r\n\r\n\t\t//COLLISION\r\n\t\tfor(int i = 0; i < AdventureManager.currentRoom.projectiles.size(); i++){ //Checks for collision with player projectiles\r\n\t\t\tif(((AdventureManager.currentRoom.projectiles.get(i).x + 50 > x) && (AdventureManager.currentRoom.projectiles.get(i).x + 50 < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\t\t\t\t\t|| ((AdventureManager.currentRoom.projectiles.get(i).x > x) && (AdventureManager.currentRoom.projectiles.get(i).x < x+50) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50> y) &&(AdventureManager.currentRoom.projectiles.get(i).y + 50< y+98) )\r\n\r\n\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\tswitch(AdventureManager.currentRoom.projectiles.get(i).type) {\r\n\t\t\t\t\tcase \"fireball\": health -= AdventureManager.toon.intelligence; break;\r\n\t\t\t\t\tcase \"sword\": health -= AdventureManager.toon.strength;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tAdventureManager.currentRoom.projectiles.get(i).kill();\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif((AdventureManager.toon.y < y+50) && (AdventureManager.toon.y > y+40) && //Checks for collision with player\r\n\t\t\t\t(((AdventureManager.toon.x > x) && (AdventureManager.toon.x < x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 > x) && AdventureManager.toon.x+50 < x+50))) {\r\n\t\t\tAdventureManager.toon.y = y+55; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if((AdventureManager.toon.y+100 < y) && (AdventureManager.toon.y+100 > y-5) && (((AdventureManager.toon.x >= x) && (AdventureManager.toon.x <= x+50)) //Checks for collision with player\r\n\t\t\t\t|| ((AdventureManager.toon.x+50 >= x) && (AdventureManager.toon.x+50 <= x+50))\r\n\t\t\t\t|| ((AdventureManager.toon.x+25 >= x) && AdventureManager.toon.x+25 <= x+50))) {\r\n\t\t AdventureManager.toon.y = y-105; AdventureManager.toon.repaint();\r\n\t\t AdventureManager.toon.jumpCount = 25;\r\n\t\t if(contact <= 0){\r\n\t\t\t AdventureManager.toon.damage(1);\r\n\t\t\t contact = 50;\r\n\t\t }\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x + 50) > x) && ((AdventureManager.toon.x+50)<x+20) && ( //Left Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+45)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+45))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x-51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(((AdventureManager.toon.x) > x+40) && ((AdventureManager.toon.x)<x+50) && ( //Right Collision\r\n\t\t\t\t((AdventureManager.toon.y > y) && (AdventureManager.toon.y < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 25 > y) && (AdventureManager.toon.y + 25 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 50 > y) && (AdventureManager.toon.y + 50 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 75 > y) && (AdventureManager.toon.y + 75 < y+50)) ||\r\n\t\t\t\t((AdventureManager.toon.y + 100 > y) && (AdventureManager.toon.y + 100 < y+50))\r\n\r\n\r\n\t\t\t\t) ) {\r\n\t\t\tAdventureManager.toon.x = x+51; AdventureManager.toon.repaint();\r\n\t\t\tif(contact <= 0){\r\n\t\t\t\tAdventureManager.toon.damage(1);\r\n\t\t\t\tcontact = 50;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcontact--;\r\n\t\tif(health<=0){\r\n\t\t\tsetVisible(false);\r\n\t\t\talive = false;\r\n\t\t\tAdventureManager.currentRoom.enemies.remove(this);\r\n\t\t}\r\n\r\n\r\n\r\n\t\t\tif((y+100)>=AdventureManager.floorHeight) {\r\n\t\t\t\ty= AdventureManager.floorHeight -100;\r\n\t\t\t\tgravity *= 0;\r\n\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tgravity = 3;}\r\n\r\n\t\t\ty += gravity; setLocation(x,y);\r\n\r\n\t\t\tswitch(movetype) {\r\n\t\t\tcase 0: chasePlayer(); break;\r\n\t\t\tcase 1: randomMove(); break;\r\n\t\t\tcase 2: dontMove(); break;\r\n\t\t\t}\r\n\r\n\t\t\t}", "private void movePlayer(String position, HttpSession session, HttpServletResponse response) throws IOException {\r\n String coord = \"xy\";\r\n char x = coord.charAt(0);\r\n char y = coord.charAt(1);\r\n // Get game state from session\r\n String[][] gameState = (String[][]) session.getAttribute(\"Game\");\r\n // Check for any bad request\r\n if (position.length() > 5 || position.length() < 4 || position.charAt(1) != x || position.charAt(3) != y || Character.getNumericValue(position.charAt(2)) > 3\r\n || Character.getNumericValue(position.charAt(4)) > 3 || Character.getNumericValue(position.charAt(4)) < 1 || Character.getNumericValue(position.charAt(2)) < 1) {\r\n badMove(response);\r\n }\r\n else \r\n {\r\n int xPosition = Character.getNumericValue(position.charAt(2)) - 1;\r\n int yPosition = Character.getNumericValue(position.charAt(4)) - 1;\r\n // Check if spot has already been filled\r\n if (!(\"\".equals(gameState[yPosition][xPosition]) || \"_\".equals(gameState[yPosition][xPosition]))) {\r\n badMove(response);\r\n } else {\r\n // Set x at position\r\n gameState[yPosition][xPosition] = \"x\";\r\n // Check if player has won\r\n if (!won.checkWin(gameState).equals(\"none\")) {\r\n gameOver = true;\r\n } else {\r\n moveComputer(gameState);\r\n // Check if Computer has won\r\n if (!won.checkWin(gameState).equals(\"none\")) {\r\n gameOver = true;\r\n }\r\n }\r\n }\r\n }\r\n }", "public String playerRealNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-50 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+100 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "private void moveShipLeft()\r\n\t\t{\r\n\t\t\t\tboolean moved = true;\r\n \tint currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n\r\n //if firstPlayer move unit left\r\n if(currentPlayer == 1)\r\n {\r\n int currentPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n if(currentPos == 0)\r\n {\r\n int mapTemp = mapPieces[0][mapWidth - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(mapWidth - 1);\r\n }\r\n else\r\n {\r\n int temp1 = currentPos % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos + mapWidth - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos + mapWidth - 1);\r\n }//end if\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos - 1);\r\n }//end else\r\n }//end else\r\n }//end if\r\n\r\n //if firstPlayer move unit left\r\n if(currentPlayer == 2)\r\n {\r\n int currentPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n if(currentPos == 0)\r\n {\r\n int mapTemp = mapPieces[0][mapWidth - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(mapWidth - 1);\r\n }\r\n else\r\n {\r\n int temp1 = currentPos % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos + mapWidth - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos + mapWidth - 1);\r\n }//end if\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos - 1);\r\n }//end else\r\n }//end else\r\n }//end if\r\n\r\n //set up new player once unit has moved\r\n playerMoved(currentPlayer,currentUnit,moved);\r\n\r\n //set up new mapPosition if player moved\r\n if(moved == true)\r\n setMapPos();\r\n\t\t}", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }", "private void thinkAboutNext(ArrayList<Point> pos, boolean hit, boolean destroyedIt) {\n if (!searching && hit) {\n betweenTwo = false;\n System.out.println(\"WAS A NEW TARGET\");\n if(!destroyedIt) {\n int[] d = Direction.DOWN.getDirectionVector();\n Point n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.DOWN);\n\n d = Direction.UP.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.UP);\n\n d = Direction.LEFT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.LEFT);\n\n d = Direction.RIGHT.getDirectionVector();\n n = new Point(justBefore.x + d[0], justBefore.y + d[1]);\n if (inBounds(n) && pos.contains(n))\n directionsToGo.add(Direction.RIGHT);\n\n directionLooking = directionsToGo.get(directionsToGo.size() - 1);\n }\n }\n else if (searching) {\n //FILTER OUT ALREADY ATTACKED\n\n System.out.println(\"WAS AN OLD TARGET\");\n\n //FAILED\n if(!hit) {\n justBefore = firstHit;\n int size = directionsToGo.size();\n\n for(int i = size - 1; i >= 0; i--){\n Point n = new Point(justBefore.x + directionsToGo.get(i).getDirectionVector()[0],\n justBefore.y + directionsToGo.get(i).getDirectionVector()[1]);\n if(!pos.contains(n))\n directionsToGo.remove(i);\n }\n directionLooking = directionsToGo.get(0);\n }\n else\n if(!pos.contains(pWD(justBefore, directionLooking))) {\n justBefore = firstHit;\n directionLooking = directionLooking.getOpposite();\n }\n\n }\n if(hit) {\n searching = !destroyedIt;\n }\n }", "void collisionHappened(int position);", "private boolean isMyWormInShootingRange(Direction d) {\n MyWorm currentWorm = getCurrentWorm(gameState);\n // direction N(0, -1), NE(1, -1), E(1, 0), SE(1, 1), S(0, 1), SW(-1, 1), W(-1,0), NW(-1, -1)\n Worm[] myWorms = player.worms;\n int i = 0;\n boolean found = false;\n while ((i < myWorms.length) && (!found)) {\n int weaponRange = currentWorm.weapon.range;\n if(myWorms[i].id != currentWorm.id && myWorms[i].health > 0){\n if ((d.name().equals(\"N\")) && (between(myWorms[i].position.y, currentWorm.position.y - weaponRange, currentWorm.position.y) && currentWorm.position.x == myWorms[i].position.x)) {\n found = true;\n }\n else if ((d.name().equals(\"E\")) && (between(myWorms[i].position.x, currentWorm.position.x + weaponRange, currentWorm.position.x) && currentWorm.position.y == myWorms[i].position.y)) {\n found = true;\n }\n else if ((d.name().equals(\"S\")) && (between(myWorms[i].position.y, currentWorm.position.y + weaponRange, currentWorm.position.y) && currentWorm.position.x == myWorms[i].position.x)) {\n found = true;\n }\n else if ((d.name().equals(\"W\")) && (between(myWorms[i].position.x, currentWorm.position.x - weaponRange, currentWorm.position.x) && currentWorm.position.y == myWorms[i].position.y)) {\n found = true;\n }\n else if ((d.name().equals(\"NE\")) && (between(myWorms[i].position.x, currentWorm.position.x + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"SE\")) && (between(myWorms[i].position.x, currentWorm.position.x + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"SW\")) && (between(myWorms[i].position.x, currentWorm.position.x - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y + (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n else if ((d.name().equals(\"NW\")) && (between(myWorms[i].position.x, currentWorm.position.x - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.x) && between(myWorms[i].position.y, currentWorm.position.y - (int) (weaponRange/Math.sqrt(2)), currentWorm.position.y) && isDiagonal(currentWorm, myWorms[i]))) {\n found = true;\n }\n\n }\n i++;\n }\n return found;\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "boolean checkLegalMove(int posx, int posy) {\n\t\tBoolean bool;\n\t\tint change;\n\t\tchange = curPlayer > 1 ? (change = 1) : (change = -1);\n\t\tif (kingJumping(posx, posy, change)){\n\t\t\tbool = true;\n\t\t} else if (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\tSystem.out.println(\"Normal move\");\n\t\t\tbool = true;\n\t\t} else if (jump(posx, posy, prevPiece) && (prevPosX == posx + (change * 2) && (prevPosY == posy - 2 || prevPosY == posy + 2))) {\n\t\t\tbool = true;\n\t\t} else if (((JLabel)prevComp).getIcon().equals(Playboard.rKing) || ((JLabel)prevComp).getIcon().equals(Playboard.bKing) || ((JLabel)prevComp).getIcon().equals(Playboard.blackSKing) || ((JLabel)prevComp).getIcon().equals(Playboard.redSKing)){\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\t\tbool = true;\n\t\t\t} else\n\t\t\t\tbool = false;\n\t\t} else if (prevPiece == 4 && (prevPosX == posx + 1 || prevPosX == posx -1) && (prevPosY == posy - 1 || prevPosY == posy +1)) { // King moves\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1))\n\t\t\t\tbool = true;\n\t\t\telse\n\t\t\t\tbool = false;\n\t\t} else {\n\t\t\tbool = false;\n\t\t}\n\t\treturn bool;\n\t}", "private void checkBounds() {\n\t\t// checks to see if playerX is to the left of the left side of the display\n\t\tif (player.getX() < 0)\n\t\t\tplayer.setX(0);\n\t\t// checks to see if playerX is greater than the width of the display\n\t\tif (player.getX() > displayWidth - sprite.get(\"playerSprite\").getWidth())\n\t\t\tplayer.setX(displayWidth - sprite.get(\"playerSprite\").getWidth());\n\t\t// checks to see if playerY is lower than the bottom of the display\n\t\tif (player.getY() < 0)\n\t\t\tplayer.setY(0);\n\t\t// checks to see if playerY is greater than the height of the display\n\t\tif (player.getY() > displayHeight - sprite.get(\"playerSprite\").getHeight())\n\t\t\tplayer.setY(displayHeight - sprite.get(\"playerSprite\").getHeight());\n\t}", "public boolean checkCheck(Player p){\n\t\tPosition position = null;\n\t\tfor (int i = Position.MAX_ROW; i >= Position.MIN_ROW; i--) {\n\t\t\tfor (char c = Position.MIN_COLUMN; c <= Position.MAX_COLUMN; c++) {\n\t Piece piece = gameState.getPieceAt(String.valueOf(c) + i);\n\t if(piece!=null &&piece.getClass().equals(King.class) && piece.getOwner()==p){\n\t \tposition = new Position(c,i);\n\t \tbreak;\n\t }\n\t\t\t}\n\t\t}\n\t\t//Find out if a move of other player contains position of king\n\t\tList<Move> moves = gameState.listAllMoves(p==Player.Black?Player.White:Player.Black,false);\n\t\tfor(Move move : moves){\n\t\t\tif(move.getDestination().equals(position)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "protected static boolean checkStartPos(Level level, int x, int y, int playerDist, int soloRadius) {\r\n\t\tif (level.player != null) {\r\n\t\t\tint xd = level.player.x - x;\r\n\t\t\tint yd = level.player.y - y;\r\n\t\t\t\r\n\t\t\tif (xd * xd + yd * yd < playerDist * playerDist) return false;\r\n\t\t}\r\n\t\t\r\n\t\tint r = level.monsterDensity * soloRadius; // get no-mob radius\r\n\t\t\r\n\t\tif (level.getEntities(x - r, y - r, x + r, y + r).size() > 0) return false;\r\n\t\t\r\n\t\treturn level.getTile(x >> 4, y >> 4).maySpawn; // the last check.\r\n\t}", "public Location attack() {\n resetBoard();\n\n if (getHits().isEmpty()) {\n// System.out.println(\"Hunting\");\n\n for (final int[] r : board) {\n for (int c = 0; c < r.length; c++) {\n if (getIntegers().contains(5) && (c < (r.length - 4)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3]) && (-1 != r[c + 4])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n ++r[c + 4];\n }\n\n if (getIntegers().contains(4) && (c < (r.length - 3)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2]) && (-1 != r[c + 3])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n ++r[c + 3];\n }\n if (getIntegers().contains(3) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (c < (r.length - 2)))\n if ((-1 != r[c]) && (-1 != r[c + 1]) && (-1 != r[c + 2])) {\n ++r[c];\n ++r[c + 1];\n ++r[c + 2];\n\n }\n if (getIntegers().contains(2) && (c < (r.length - 1)))\n if ((-1 != r[c]) && (-1 != r[c + 1])) {\n ++r[c];\n ++r[c + 1];\n }\n }\n }\n\n for (int c = 0; c < board[0].length; c++) {\n for (int r = 0; r < board.length; r++) {\n if (getIntegers().contains(5) && (r < (board.length - 4)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n\n if (getIntegers().contains(4) && (r < (board.length - 3)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n if (getIntegers().contains(3) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(3) && (2 == Collections.frequency(getIntegers(), 3)) && (r < (board.length - 2)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n\n\n }\n if (getIntegers().contains(2) && (r < (board.length - 1)))\n if ((-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n }\n }\n } else {\n// System.out.println(\"Hitting\");\n\n for (final Location hit : getHits()) {\n final int r = hit.getRow();\n final int c = hit.getCol();\n\n if (getIntegers().contains(2)) {\n if ((0 <= (c - 1)) && (-1 != board[r][c]) && (-1 != board[r][c - 1])) {\n ++board[r][c];\n ++board[r][c - 1];\n }\n\n\n if (((c + 1) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1])) {\n ++board[r][c];\n ++board[r][c + 1];\n }\n\n if ((0 <= (r - 1)) && (-1 != board[r][c]) && (-1 != board[r - 1][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n }\n\n if (((r + 1) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n }\n\n\n }\n if (getIntegers().contains(3)) {\n final int inc = Collections.frequency(getIntegers(), 3);\n\n if ((0 <= (c - 2)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2])) {\n board[r][c] += inc;\n board[r][c - 1] += inc;\n board[r][c - 2] += inc;\n }\n if (((c + 2) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2])) {\n board[r][c] += inc;\n board[r][c + 1] += inc;\n board[r][c + 2] += inc;\n }\n if ((0 <= (r - 2)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c])) {\n board[r][c] += inc;\n board[r - 1][c] += inc;\n board[r - 2][c] += inc;\n }\n if (((r + 2) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c])) {\n board[r][c] += inc;\n board[r + 1][c] += inc;\n board[r + 2][c] += inc;\n }\n\n\n }\n if (getIntegers().contains(4)) {\n if ((0 <= (c - 3)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n }\n if (((c + 3) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n }\n if ((0 <= (r - 3)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n }\n if (((r + 3) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n }\n\n\n }\n if (getIntegers().contains(5)) {\n if ((0 <= (c - 4)) && (-1 != board[r][c]) && (-1 != board[r][c - 1]) && (-1 != board[r][c - 2]) && (-1 != board[r][c - 3]) && (-1 != board[r][c - 4])) {\n ++board[r][c];\n ++board[r][c - 1];\n ++board[r][c - 2];\n ++board[r][c - 3];\n ++board[r][c - 4];\n }\n if (((c + 4) < board[0].length) && (-1 != board[r][c]) && (-1 != board[r][c + 1]) && (-1 != board[r][c + 2]) && (-1 != board[r][c + 3]) && (-1 != board[r][c + 4])) {\n ++board[r][c];\n ++board[r][c + 1];\n ++board[r][c + 2];\n ++board[r][c + 3];\n ++board[r][c + 4];\n }\n if ((0 <= (r - 4)) && (-1 != board[r][c]) && (-1 != board[r - 1][c]) && (-1 != board[r - 2][c]) && (-1 != board[r - 3][c]) && (-1 != board[r - 4][c])) {\n ++board[r][c];\n ++board[r - 1][c];\n ++board[r - 2][c];\n ++board[r - 3][c];\n ++board[r - 4][c];\n }\n if (((r + 4) < board.length) && (-1 != board[r][c]) && (-1 != board[r + 1][c]) && (-1 != board[r + 2][c]) && (-1 != board[r + 3][c]) && (-1 != board[r + 4][c])) {\n ++board[r][c];\n ++board[r + 1][c];\n ++board[r + 2][c];\n ++board[r + 3][c];\n ++board[r + 4][c];\n }\n }\n }\n\n for (final Location hit : getHits()) {\n board[hit.getRow()][hit.getCol()] = 0;\n }\n }\n\n// for (int[] i : board)\n// System.out.println(Arrays.toString(i));\n return findLargest();\n }", "MazePoint getActivePlayerCoordinates();", "private void enemyMove() {\n\n\t\tboolean goAgain = false;\n\n\t\tint x = (int) (Math.random() * 10);\n\t\tint y = (int) (Math.random() * 10);\n\n\t\t// Make sure the enemy hits in a checkerboard pattern.\n\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\tif (y % 2 == 0) {\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t\t}\n\t\t} else { // if x is odd, y should be even\n\t\t\tif (y % 2 == 1)\n\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\ty++;\n\t\t\t\telse\n\t\t\t\t\ty--;\n\t\t}\n\n\t\tif (enemyLastShotHit && getDifficulty() > 0) { // /if last shot was a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hit, enemy\n\t\t\t// will try to\n\t\t\t// check around it only run if difficulty is\n\t\t\t// normal or above\n\t\t\tx = enemyLastHitX;\n\t\t\ty = enemyLastHitY;\n\n\t\t\tif (getDifficulty() != 2) {\n\n\t\t\t\tif (conflictX == 4) {\n\t\t\t\t\tconflictX = 0;\n\t\t\t\t} else if (conflictY == 4) {\n\t\t\t\t\tconflictY = 0;\n\t\t\t\t\t// System.out.println(\"conflict has been reset \");\n\t\t\t\t}\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\t// System.out.println(\"checking down\");\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\n\t\t\t\t\tif (checkDirection == 0) // checks in each direction\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse if (checkDirection == 1)\n\t\t\t\t\t\tx--;\n\t\t\t\t\telse if (checkDirection == 2)\n\t\t\t\t\t\ty++;\n\t\t\t\t\telse if (checkDirection == 3) {\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (x < 0) // making sure coordinates stay within bounds\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\telse if (x > 9)\n\t\t\t\t\t\tx = 9;\n\t\t\t\t\tif (y < 0)\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\telse if (y > 9)\n\t\t\t\t\t\ty = 9;\n\t\t\t\t}\n\t\t\t} // medium diff\n\n\t\t\telse if (getDifficulty() == 2) {// hard difficulty\n\t\t\t\t// gives enemy unfair advantage\n\n\t\t\t\tif (conflictX == 4)\n\t\t\t\t\tconflictX = 0;\n\t\t\t\tif (conflictY == 4)\n\t\t\t\t\tconflictY = 0;\n\n\t\t\t\tif (conflictX != 0) {\n\t\t\t\t\tif (conflictX == 1)\n\t\t\t\t\t\tx++;\n\t\t\t\t\telse {\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\tconflictX = 4;\n\t\t\t\t} else if (conflictY == 1) {\n\t\t\t\t\tconflictY = 4;\n\t\t\t\t\ty++;\n\t\t\t\t}\n\n\t\t\t\tif (x + 1 < 10 && x - 1 >= 0) {// branch for multiple hits\n\t\t\t\t\tif (egrid[x + 1][y] == 1 && egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tif (x + 2 < 10) {\n\t\t\t\t\t\t\tif (egrid[x + 2][y] == 1) {\n\t\t\t\t\t\t\t\tconflictX = 1;\n\t\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconflictX = 2;\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (y + 1 < 10 && y - 1 >= 0) {// branch for multiple vertical\n\t\t\t\t\t\t\t\t\t\t\t\t// hits\n\t\t\t\t\tif (egrid[x][y + 1] == 1 && egrid[x][y - 1] == 1) {\n\t\t\t\t\t\t// System.out.println(\"conflict at \"+ex+\",\"+ey);\n\t\t\t\t\t\tenemyLastHitX = x;\n\t\t\t\t\t\tenemyLastHitY = y;\n\t\t\t\t\t\tconflictY = 1;\n\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\t\tif (y + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x][y + 1] == 1)// if y+1 is a hit and it is\n\t\t\t\t\t\t\t\t\t\t\t\t\t// within bounds, it will go\n\t\t\t\t\t\t\t\t\t\t\t\t\t// there\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (y - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x][y - 1] == 1)\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t\tif (x + 1 < 10) {\n\t\t\t\t\t\tif (egrid[x + 1][y] == 1)\n\t\t\t\t\t\t\tx++;\n\t\t\t\t\t}\n\t\t\t\t\tif (x - 1 >= 0) {\n\t\t\t\t\t\tif (egrid[x - 1][y] == 1) {\n\t\t\t\t\t\t\tx--;\n\t\t\t\t\t\t\tenemyLastShotHit = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} // hard diff\n\t\t\tcheckDirection++;\n\t\t} // lasthit\n\n\t\tint tryCount = 0;\n\t\twhile (egrid[x][y] == 3) { // makes sure enemy doesn't hit same spot\n\t\t\t\t\t\t\t\t\t// twice\n\t\t\tx = (int) (Math.random() * 10);\n\t\t\ty = (int) (Math.random() * 10);\n\t\t\tif (tryCount < 20 && getDifficulty() > 0) {\n\t\t\t\tif (x % 2 == 0) { // if x is even, y should be odd\n\t\t\t\t\tif (y % 2 == 0) { // for checkerboard pattern\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t\t}\n\t\t\t\t} else { // if x is odd, y should be even\n\t\t\t\t\tif (y % 2 == 1)\n\t\t\t\t\t\tif (y + 1 < 10)\n\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty--;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttryCount++;\n\t\t}\n\n\t\tif (egrid[x][y] == 1) { // hit branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilehit.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a hit\");\n\t\t\tenemyLastShotHit = true; // starts ai\n\t\t\tcheckDirection = 0;\n\t\t\tif (conflictX == 0 && conflictY == 0) {\n\t\t\t\tenemyLastHitX = x; // stores x and y values\n\t\t\t\tenemyLastHitY = y;\n\t\t\t}\n\t\t\tehits--; // keeps score\n\t\t}\n\n\t\telse if (egrid[x][y] == 2) { // poweup branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilepower.jpg\"));\n\t\t\tstatus.setText(\" Enemy got a PowerUp\");\n\t\t\tgoAgain = true;\n\t\t}\n\n\t\telse\n\t\t\t// miss branch\n\t\t\tenemyBoard[x][y].setIcon(createImageIcon(\"tilemiss.jpg\"));\n\n\t\tegrid[x][y] = 3;\n\n\t\tcheckEnemyWin();\n\n\t\tif (goAgain)\n\t\t\tenemyMove();\n\n\t}", "void playerHit() {\n if (lives == 0) {//if no lives left\n isDead = true;\n } else {//remove a life and reset positions\n lives -=1;\n immortalityTimer = 100;\n resetPositions();\n }\n }" ]
[ "0.69887644", "0.67475855", "0.6654417", "0.6599678", "0.657542", "0.65642715", "0.6504923", "0.64551985", "0.64472586", "0.6429044", "0.6383354", "0.6381849", "0.63775337", "0.6377182", "0.63571346", "0.6351657", "0.62750906", "0.62657344", "0.62542164", "0.6249937", "0.6249545", "0.6245367", "0.62449825", "0.622815", "0.61912453", "0.6172797", "0.61549556", "0.615493", "0.6152325", "0.6152035", "0.6142777", "0.6142641", "0.6137811", "0.6136862", "0.61219275", "0.61130154", "0.61079615", "0.6104868", "0.610322", "0.61025363", "0.6090977", "0.6086376", "0.6082828", "0.60702163", "0.60661864", "0.6062766", "0.6049571", "0.6043568", "0.60401225", "0.6037169", "0.6034965", "0.6025711", "0.6020391", "0.601855", "0.6010081", "0.6008127", "0.6003907", "0.60032666", "0.6000216", "0.59967804", "0.5994998", "0.59938854", "0.59923553", "0.599148", "0.5987451", "0.59768736", "0.5976465", "0.59763265", "0.59692764", "0.5951409", "0.594888", "0.5947631", "0.59320736", "0.5930833", "0.5929564", "0.5929358", "0.59283745", "0.59283745", "0.59283745", "0.59283745", "0.59240973", "0.5922631", "0.59212697", "0.59159166", "0.59140474", "0.59104663", "0.59091204", "0.59059435", "0.5902345", "0.5900399", "0.58965313", "0.58907986", "0.588484", "0.5879275", "0.5878697", "0.58762693", "0.5876055", "0.5869573", "0.5867671", "0.5867641" ]
0.6327506
16
Write a Java program to find whether a region in the current string matches a region in another string
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String str1 = Exercise1.getString(scanner); String str2 = Exercise1.getString(scanner); int[] rangeStr1 = getRange(scanner, str1); int[] rangeStr2 = getRange(scanner, str2); // Arrays.stream(range) // .forEach(System.out::println); boolean value = checkStringRangeEquality(str1, str2, rangeStr1, rangeStr2); System.out.println("Strings are equal: " + value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isIn(String s1, String s2) {\n\t for(int i = 0; i <= s2.length() - s1.length(); i++) {\n\t \n\t if(s2.substring(i, i+s1.length()).equals(s1) ) {\n\t // System.out.println(\"+ \" + s2.substring(i, i+s1.length()) + \" \" + s1);\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }", "public static void main( String[] args )\r\n {\n String s1 = new String( \"hello\" ); // s1 is a copy of \"hello\"\r\n String s2 = \"goodbye\";\r\n String s3 = \"Happy Birthday\";\r\n String s4 = \"happy birthday\";\r\n\r\n System.out.printf(\"s1 = %s\\ns2 = %s\\ns3 = %s\\ns4 = %s\\n\\n\", s1, s2, s3, s4 );\r\n\r\n // test for equality with equals() method\r\n if ( s1.equals( \"hello\" ) ) // true\r\n System.out.println( \"s1 equals \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 does not equal \\\"hello\\\"\" );\r\n\r\n // test for equality with ==\r\n if ( s1 == \"hello\" ) // false; they are not the same object\r\n System.out.println( \"s1 is the same object as \\\"hello\\\"\" );\r\n else\r\n System.out.println( \"s1 is not the same object as \\\"hello\\\"\" );\r\n\r\n // test for equality (ignore case)\r\n if ( s3.equalsIgnoreCase( s4 ) ) // true\r\n System.out.printf( \"%s equals %s with case ignored\\n\", s3, s4 );\r\n else\r\n System.out.println( \"s3 does not equal s4\" );\r\n\r\n // test compareTo\r\n // the compareTo() method comparison is based on the Unicode value of each character in the string\r\n // if the strings are equal, the method returns 0\r\n\r\n System.out.printf(\"\\ns1.compareTo( s2 ) is %d\", s1.compareTo( s2 ) );\r\n System.out.printf(\"\\ns2.compareTo( s1 ) is %d\", s2.compareTo( s1 ) );\r\n System.out.printf(\"\\ns1.compareTo( s1 ) is %d\", s1.compareTo( s1 ) );\r\n System.out.printf(\"\\ns3.compareTo( s4 ) is %d\", s3.compareTo( s4 ) );\r\n System.out.printf(\"\\ns4.compareTo( s3 ) is %d\\n\\n\", s4.compareTo( s3 ) );\r\n\r\n // test regionMatches (case sensitive)\r\n if ( s3.regionMatches( 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n\r\n // test regionMatches (ignore case)\r\n if ( s3.regionMatches( true, 0, s4, 0, 5 ) )\r\n System.out.println(\"First 5 characters of s3 and s4 match with case ignored\" );\r\n else\r\n System.out.println(\"First 5 characters of s3 and s4 do not match\" );\r\n }", "private boolean containedIn(String a, String b){\n if(a.length() > b.length())return false;\n int aInd = 0;\n int bInd = 0;\n\n while(bInd < b.length()){\n if(aInd >= a.length())return true;\n char bChar = b.charAt(bInd);\n char aChar = a.charAt(aInd);\n if(bChar == aChar){\n aInd++;\n }\n bInd++;\n }\n return false;\n }", "private boolean matchSequences ( String sequence1, String sequence2 )\n{\n int matches = 0;\n\n // Check for sequences with less than 20 characters.\n if ( ( sequence1.length () <= 20 ) ||\n ( sequence2.length () <= 20 ) )\n {\n return sequence1.equalsIgnoreCase ( sequence2 );\n } // if\n\n // Count the matching bases in the first 20 characters.\n for ( int i = 0; i < 20; i++ )\n\n // Count the matching characters (but not N bases).\n if ( ( sequence1.charAt ( i ) == sequence2.charAt ( i ) ) &&\n ( sequence1.charAt ( i ) != 'x' ) &&\n ( sequence1.charAt ( i ) != 'n' ) )\n\n matches++;\n\n // Check for 90% identity (18/20) for a valid match\n if ( matches >= 18 ) return true;\n return false;\n}", "public boolean checkInclusion(String s1, String s2) {\n int left = 0;\n int right = 0;\n int count = s1.length();\n int len = s2.length();\n int[] map = new int[256];\n \n // fill the map\n for (int i = 0; i < s1.length(); i++)\n map[s1.charAt(i)]++;\n \n while (right < len) {\n // if contains a character from s1, decrement count\n if (map[s2.charAt(right)] >= 1)\n count--;\n \n // decrase used value and move right\n map[s2.charAt(right)]--;\n right++;\n \n // check for answer\n if (count == 0)\n return true;\n \n // if boundary is crossed, move left pointer\n if (right - left == s1.length()) {\n // restoration\n if (map[s2.charAt(left)] >= 0)\n count++;\n map[s2.charAt(left)]++;\n \n left++;\n }\n \n }\n \n return false;\n }", "public boolean findRegionDesc(String regAux);", "public static boolean stringIntersect(String a, String b, int len) {\n\t\tHashSet<String> mySet = new HashSet<String>();\n\t\tfor (int i=0; i+len <= a.length(); i++){\n\t\t\tmySet.add(a.substring(i, i+len));\n\t\t}\n\t\tfor (int i=0; i+len <= b.length(); i++){\n\t\t\tif (mySet.contains(b.substring(i, i+len))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false; // TO DO ADD YOUR CODE HERE\n\t}", "public String match(String state) {\n\t\tSet<Entry<String, String>> set = mapList.entrySet(); \t// Converting to Set in order to traverse\n\t\tIterator<Entry<String, String>> i = set.iterator(); \n\t\tString result = new String();\n\t\t\n\t\t// Iterate until you find the state and region\n\t\twhile (i.hasNext()) {\n\t\t\t\n\t\t\t// Convert to Map.Entry to get key and value separately\n\t\t\tMap.Entry<String, String> entry = (Map.Entry<String, String>) i.next(); \n\t\t\t\n\t\t\t// Finding values from map in order to get the correct value associated with the state\n\t\t\tString compareState = entry.getKey().toString();\n\t\t\tString[] region = entry.getKey().toString().split(\",\");\n\t\t\tString match = entry.getValue().toString().split(\",\")[region.length - 1]; \n\t\t\t\n\t\t\t// Found match\n\t\t\tif (compareState.equals(state)) {\n\t\t\t\tresult = match;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\t// Returns the match of given state, i.e. State: ID Region: West\n\t}", "public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }", "static int isSubstring(String s1, String s2) {\n int m = s1.length();\n int n = s2.length();\n\n // A loop to slide pat[] one by one\n for (int i = 0; i <= n - m; i++) {\n int j;\n\n // For current index i, check for pattern match\n for (j = 0; j < m; j++) {\n if (s2.charAt(i + j) != s1.charAt(j)) {\n break;\n }\n }\n\n if (j == m) {\n return i;\n }\n }\n return -1;\n }", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "public boolean isMatch(String str1, String str2) {\n \r\n if( str1 == null || str2 == null)\r\n return false;\r\n \r\n int i = 0;\r\n int j = 0;\r\n char preChar = ' ';\r\n \r\n while( i < str1.length() && j < str2.length() ){\r\n char c1 = str1.charAt(i);\r\n char c2 = str2.charAt(j);\r\n \r\n if( c1 == c2 || c2 == '.' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j++;\r\n }\r\n else{\r\n if( c2 == '*' ){\r\n if( c1 == preChar || preChar == '.' ){\r\n i++;\r\n }\r\n else if( j+1 < str2.length() ){\r\n if( c1 == str2.charAt(j+1) || str2.charAt(j+1) == '.' ){\r\n i++;\r\n \r\n preChar = str2.charAt(j+1);\r\n j = j+2;\r\n }\r\n else\r\n return false;\r\n }\r\n else\r\n return false;\r\n }\r\n else{\r\n if( j+1 < str2.length() && str2.charAt(j+1) == '*' ){\r\n i++;\r\n \r\n preChar = c2;\r\n j = j+2;\r\n } \r\n else\r\n return false;\r\n }\r\n }\r\n }\r\n \r\n if( i == str1.length() ){\r\n if( j == str2.length() )\r\n return true;\r\n else if( str2.charAt(j)=='*' ){\r\n \r\n int countStr1 = 0;\r\n for(int k = str1.length()-1; k >= 0; k--){\r\n if( str1.charAt(k) == preChar )\r\n countStr1++;\r\n else\r\n break;\r\n }\r\n \r\n int countStr2 = 0;\r\n int countStarInStr2 = 0;\r\n for(int k = str2.length()-1; k >= 0; k--){\r\n if( str2.charAt(k) == preChar || str2.charAt(k) == '.' )\r\n countStr2++;\r\n else if( str2.charAt(k) == '*' )\r\n countStarInStr2++;\r\n else\r\n break;\r\n } \r\n \r\n if( countStr2 - countStarInStr2 <= countStr1 )\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n }\r\n else \r\n return false;\r\n }", "boolean isPartOf(String genomeName);", "private Boolean solution(String s1, String s2){\n\t\t\n\t\tint k = s1.length();\n\t\tchar[] input1 = s1.toCharArray();\n\t\t\n\t\tint m =0 ,count=0;\n\t\t\n\t\twhile(m < s2.length()-1){\n\t\t\t\n\t\tchar[] temp1 = s2.substring(m, m+k).toCharArray();\n\t\t\t\n\t\t\tfor(int i=0; i<s1.length(); i++){\n\t\t\t\tfor(int j=0; j<s1.length(); j++){\n\t\t\t\t\tif(input1[i] == temp1[j] ){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tif(count == s1.length())\n\t\t\t\treturn true;\n\t\tcount =0;\n\t\tm++;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public static void main(String[] args) {\n\t\r\n\t\t {\r\n\t\t String str1 = \"Hello Java and Welcome to Java\";\r\n\t\t String str2 = \"Java\";\r\n\t\t System.out.println(\"Original String: \" + str1);\r\n\t\t System.out.println(\"Specified sequence of char values: \" + str2);\r\n\t\t System.out.println(str1.contains(str2));\r\n\t\t }\r\n\t\t}", "public boolean isARotation(String s1, String s2) {\n\t\tif(s1.length() != s2.length()) return false;\n\t\t\n\t\tStringBuilder stb = new StringBuilder();\n\t\tint i = 0;\n\t\twhile(i < s1.length()) {\n\t\t\tif(s1.charAt(i) == s1.charAt(i)) {\n\t\t\t\treturn subString(s1.substring(0, i), s2) \n\t\t\t\t\t\t&& stb.toString().compareTo(s2.substring(i, s2.length()-1)) == 0;\n\t\t\t}\n\t\t\ti++;\n\t\t\tstb.append(s1.charAt(i));\n\t\t}\n\t\treturn false;\n\t}", "public static void main(String[] args) {\n char[][] grid1 = {\n {'c', 'c', 'c', 't', 'i', 'b'},\n {'c', 'c', 'a', 't', 'n', 'i'},\n {'a', 'c', 'n', 'n', 't', 't'},\n {'t', 'c', 's', 'i', 'p', 't'},\n {'a', 'o', 'o', 'o', 'a', 'a'},\n {'o', 'a', 'a', 'a', 'o', 'o'},\n {'k', 'a', 'i', 'c', 'k', 'i'}\n };\n String word1 = \"catnip\";\n String word2 = \"cccc\";\n String word3 = \"s\";\n String word4 = \"bit\";\n String word5 = \"aoi\";\n String word6 = \"ki\";\n String word7 = \"aaa\";\n String word8 = \"ooo\";\n\n char[][] grid2 = {{'a'}};\n String word9 = \"a\";\n System.out.println(find_word_location(grid1, word1));\n System.out.println(find_word_location(grid1, word2));\n System.out.println(find_word_location(grid1, word3));\n System.out.println(find_word_location(grid1, word4));\n System.out.println(find_word_location(grid1, word5));\n System.out.println(find_word_location(grid1, word6));\n System.out.println(find_word_location(grid1, word7));\n System.out.println(find_word_location(grid1, word8));\n System.out.println(find_word_location(grid2, word9));\n }", "public boolean match(String string1, String string2) {\n\t\tMap<Character, Character>hash_map = new HashMap<Character, Character>();\n\n\t\t//If string length is not same, then it will return false\n\t\tif(string1.length()>string2.length() || string1.length()<string2.length()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int i=0; i<string1.length(); i++) {\t\n\t\t\tif(!hash_map.containsKey(string1.charAt(i))) {\n\t\t\t\thash_map.put(string1.charAt(i), string2.charAt(i));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!hash_map.get(string1.charAt(i)).equals(string2.charAt(i))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean myContains(String str2, String search2) {\n if (search2.length() == 0) {\n return true;\n }\n int k = 0;\n int f = 0;\n String str = str2.toLowerCase();\n String search = search2.toLowerCase();\n for (int i = 0; i < str.length(); i++) {\n if (str.charAt(i) == search.charAt(k)) {\n k += 1;\n f += 1;\n if (f == search.length()) {\n return true;\n }\n } else {\n k = 0;\n f = 0;\n }\n }\n return false;\n }", "public boolean findPattern(String s1, String s2) {\n\tchar[] chars1 = new char[26];\n\tchar[] chars2 = new char[26];\n\tint[] map = new int[26];\n\tfor (int i = 0; i < s1.length(); i++) {\n\t\tchars1[s1.charAt(i) - 'A']++;\n\t}\n\tfor (int i = 0; i < s2.length(); i++) {\n\t\tchars2[s2.charAt(i) - 'A']++;\n\t\tif (map[] == 0) map[s2.charAt(i) - 'A'] = i;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tif (chars1[i] > 0 && chars2[i] == 0) return false;\n\t}\n\treturn true;\n}", "public boolean checkSam(String stringA, String stringB) {\r\n\t\tString[] s1 = stringA.split(\" \");\r\n\t\tString[] s2 = stringB.split(\" \");\r\n\t\tif(s1.length == s2.length){\r\n\t\t\tint count = 0;\r\n\t\t\tfor (String sB : s2) {\r\n\t\t\t\tfor (String sA : s1) {\r\n\t\t\t\t\tif(sA.equals(sB)){\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == s2.length){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n }", "private static boolean search(String substring1, String substring2) {\n\t\tHashMap<Character, Integer> hm = new HashMap<Character, Integer>();\n\t\tfor (int i = 0; i < substring1.length(); i++) {\n\t\t\thm.put(substring1.charAt(i), hm.getOrDefault(substring1.charAt(i), 0)+1);\n\t\t}\n\n\t\tfor (int i = 0; i < substring2.length(); i++) {\n\t\t\tchar c = substring2.charAt(i);\n\t\t\tif (hm.containsKey(c)) {\n\t\t\t\thm.put(c, hm.get(c)-1);\n\t\t\t\tif (hm.get(c) == 0) {\n\t\t\t\t\thm.remove(c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hm.isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }", "public static boolean stringIntersect(String a, String b, int len) {\n\t\tif(len == 0) return true;\n\t\tSet<String> first = new HashSet<String>();\n\t\tSet<String> second = new HashSet<String>();\n\t\tfor(int i = 0; i < a.length() - len + 1; i++){\n\t\t\tfirst.add(a.substring(i, i + len));\n\t\t}\n\t\tfor(int i = 0; i < b.length() - len + 1; i++){\n\t\t\tsecond.add(b.substring(i, i + len));\n\t\t}\n\t\tboolean intersects = !Collections.disjoint(first, second);\n\t\treturn intersects;\n\t}", "public double _compare_by_location (String a, String b)\n\t\t\t{\n\t\t\t\tStopWords sw = new StopWords();\n\t\t\t\ta = a.replace(\",\", \"\");\n\t\t\t\ta = a.replace(\"Professor\", \"\");\n\t\t\t\tString _a = sw.get_clean_text(a);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"_b: \" + b);\n\t\t\t\t\n\t\t\t\tString _b = b;\n\t\t\t\tString [] __a = _a.split(\" \");\n\t\t\t\tString [] __b = _b.split(\" \");\n\t\t\t\t\n\t\t\t\tStanfordNER sner = new StanfordNER();\n\t\t\t\tString loc = \"\";\n\t\t\t\tString _loc = \"\";\n\t\t\t\t\n\t\t\t\t//search for the location tag using stanford ner \n\t\t\t\tfor(int t = 0; t < __a.length; t++)\n\t\t\t\t{\n\t\t\t\t\tString l = sner.getTAG(__a[t]);\n\t\t\t\t\t\n\t\t\t\t\tif(l.toLowerCase().equals(\"location\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tloc = __a[t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//search for the location tag using stanford ner \n\t\t\t\tfor(int t = 0; t < __b.length; t++)\n\t\t\t\t{\n\t\t\t\t\tString _l = sner.getTAG(__b[t]);\n\t\t\t\t\t\n\t\t\t\t\tif(_l.toLowerCase().equals(\"location\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t_loc = __b[t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"iam in compare with :: \" + loc + \" and : \" + _loc);\n\t\t\t\t\n\t\t\t\tCosineSimilarity cs = new CosineSimilarity();\n\t\t\t\tdouble _x = cs.Cosine_Similarity_Score(loc, _loc);\n\t\t\t\tSystem.out.println(\"comparing \" +loc + \" and \" + _loc + \" is: \" + cs.Cosine_Similarity_Score(loc, _loc));\n\t\t\t\treturn _x;\n\t\t\t}", "public boolean isMatch(String s, String p) {\n if(s == null || p == null){\n return false;\n }\n int pPoint = 0;\n int sPoint = 0;\n int starPoint =-1;\n int sMatch = 0;\n while(sPoint < s.length()){\n // there is no star, then we should match char by char\n if(pPoint < p.length() && (p.charAt(pPoint) == '?' || s.charAt(sPoint) == p.charAt(pPoint))){\n pPoint ++;\n sPoint ++;\n }else if( pPoint < p.length() && p.charAt(pPoint) == '*'){\n //if there is start, we mark the start position and pos in s\n // compare pPoint +1 and sPoint;\n starPoint = pPoint;\n sMatch = sPoint;\n pPoint++;\n }else if(starPoint != -1){\n // if there is a start already and there is mismatch between pPoint and sPoint\n // we use the * to match the sPoint\n // bring back the point to startPoint+1 for pPoint \n // sMatch ++\n pPoint = starPoint+1;\n sPoint = sMatch+1;\n sMatch ++;\n }else{\n return false;\n }\n }\n while(pPoint < p.length()){\n if(p.charAt(pPoint) != '*'){\n return false;\n }\n pPoint++;\n }\n return true;\n }", "public static boolean isStringInterleafing(String a, String b, String inter) {\n\t\tchar[] ca = a.toCharArray();\r\n\t\tchar[] cb = b.toCharArray();\r\n\t\t\r\n\t\tchar[] ic = inter.toCharArray();\r\n\t\t\r\n\t\t\r\n\t\tboolean DP[][] = new boolean[ca.length+1][cb.length+1];\r\n\t\t\r\n\t\t// initialize the table:\r\n\t\tDP[0][0] = true;\r\n\t\tfor(int i = 1; i < ca.length; i++) {\r\n\t\t\tDP[i][0] = (ic[i-1] == ca[i-1] && DP[i-1][0] == true) ? true : false;\r\n\t\t}\r\n\r\n\t\tfor(int j = 1; j < cb.length; j++) {\r\n\t\t\tDP[0][j] = (ic[j-1] == cb[j-1] && DP[0][j-1] == true) ? true : false;\r\n\t\t}\r\n\t\t\r\n\t\t// now we can fill the table\r\n\t\tfor(int i = 1; i <= ca.length; i++) {\r\n\t\t\tfor(int j = 1; j <= cb.length; j++) {\r\n\t\t\t\tboolean canTakeFromAbove = ic[i+j-1] == ca[i-1] && DP[i-1][j];\r\n\t\t\t\tboolean canTakeFromLeft = ic[i+j-1] == cb[j-1] && DP[i][j-1];\r\n\t\t\t\tDP[i][j] = canTakeFromAbove || canTakeFromLeft;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn DP[ca.length][cb.length];\r\n\t}", "public boolean isSubSequence(String x, String y){\n\t\tint j = 0;\n\t\tfor(int i = 0 ; i < x.length() && j< y.length(); i++){\n\t\t\tif(x.charAt(j) == y.charAt(i)){\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\treturn j == x.length();\n\t}", "public static void main(String[] args) {\n\r\n\t\tString s1=\"abcd\";\r\n\t\tString s2=\"vbvabcdqwe\";\r\n\t\tchar arr1[]=s1.toCharArray();\r\n\t\tchar arr2[]=s2.toCharArray();\r\n\r\n\t\tint flag=0;\r\n\t\tfor(int i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tfor(int j=i;j<arr2.length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(arr1[i]==arr2[j])\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tString s = \"adceb\";\r\n\t\tString p = \"*a*b\";\r\n\t\t\r\n//\t\tString s = \"\";\r\n//\t\tString p = \"**\";\r\n\t\t\r\n\t\tSolution sln = new Solution();\r\n\t\t\r\n\t\tSystem.out.println(sln.isMatch(s, p));\r\n\r\n\t}", "public static String contains(String input1, String input2){\n\t\tif((input1 == null && input2 ==null)){\n\t\t\treturn \"yes\";\n\t\t}else if (input1 == null || input2 == null){\n\t\t\treturn \"no\";\n\t\t}\n\t\tchar []input1Arr = input1.toCharArray();\n\t\tchar []input2Arr = input2.toCharArray();\n\t\tint []charMap = new int [256];\n\t\tfor (char ch:input1Arr){\n\t\t\tcharMap[ch] ++;\n\t\t}\n\t\tfor (char ch:input2Arr){\n\t\t\tif(charMap[ch]>=1){\n\t\t\t\tcharMap[ch]--;\n\t\t\t}else {\n\t\t\t\treturn \"no\";\n\t\t\t}\n\t\t}\n\t\treturn \"yes\";\n\t}", "public 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 static boolean is_rotation_of_another_string(String word1, String word2) {\n\n String s3 = word1 + word1;\n\n if (s3.contains(word2))\n return true;\n else\n return false;\n }", "private boolean isSubSequence(char str1[], char str2[]) {\n int j = 0;\n int m = str1.length;\n int n = str2.length;\n for (int i=0; i<n&&j<m; i++)\n if (str1[j] == str2[i])\n j++;\n return (j==m);\n }", "public static Boolean stringMatchesTo(String searchString, String targetString) {\r\n\t\tsearchString = searchString.toUpperCase().replaceAll(\"[.,\\\\-]\", \" \").replaceAll(\"\\\\b\" + \"(WAY|DR|ST)\" + \"\\\\b\", \"\"); ; // Park-ville dr. way -> PARK VILLE \r\n\t\t//System.out.println(\"searchstring is \" + searchString + \".\");\r\n\t\tString[] searchStrings = searchString.split(\"\\\\s+\");\r\n\t\ttargetString = targetString.toUpperCase().replaceAll(\"\\\\W\",\"\"); // Park-Ville Secondary -> \"PARKVILLESECONDARY\"\r\n\t\t//System.out.println(\"targetString is \" +targetString + \".\");\r\n\t\t//System.out.println(\"searchStrings.length:\" + searchStrings.length);\r\n\t\tfor (int i = 0; i < searchStrings.length; i++) {\r\n\t\t\t//System.out.println(\"searchStrings[i] is \\\"\" + searchStrings[i] + \"\\\"\");\r\n\t\t\tif (targetString.contains(searchStrings[i]) && !searchStrings[i].isEmpty()) {\r\n\t\t\t\t//System.out.println(\"match!\"); \r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(isMatch(\"daa\", \"d*ada*\"));\n\t\tSystem.out.println(isMatch(\"daa\", \"d*aa\"));\n\t}", "private boolean overlapsWith(IRegion range1, IRegion range2) {\n \t\treturn overlapsWith(range1.getOffset(), range1.getLength(), range2.getOffset(), range2.getLength());\n \t}", "public static void main(String[] args) {\r\n\t\tString a = \"aab\";\r\n\t\tString b = \"axy\";\r\n\t\tSystem.out.println(isStringInterleafing(b,a,\"aaxaby\"));\r\n\t\tSystem.out.println(isStringInterleafing(b,a,\"abaaxy\"));\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tString s = \"a\";\n\t\tString p = \"ab*\";\n\t\tSystem.out.println(isMatch(s, p));\n\t}", "public static boolean checkInclusion(String s1, String s2) {\n\n if (s1.length() > s2.length()) {\n return false;\n }\n\n // Assume the input strings contain only lower case letters [a-z] <-> [97-123] in ASCII\n int[] aux1 = generateFrequencyArray(s1);\n\n for (int i = 0; i <= s2.length() - s1.length(); i++) {\n String temp = s2.substring(i, i + s1.length());\n int[] aux = generateFrequencyArray(temp);\n if (Arrays.equals(aux1, aux)) {\n return true;\n }\n }\n return false;\n }", "public boolean isMatch(String s, String p) {\n mem= new int[s.length()+1][p.length()+1];\n return match(s,p);\n }", "private static int scs(String a, String b){\n int la=a.length();\n int lb=b.length();\n int [][]matrix=new int[la+1][lb+1];\n \n for(int i=1;i<=la;i++)\n matrix[i][0]=i;\n for(int i=1;i<=lb;i++)\n matrix[0][i]=i;\n \n for(int i=1;i<=la;i++){\n for(int j=1;j<=lb;j++){\n if(a.charAt(i-1)==b.charAt(j-1))\n matrix[i][j]=matrix[i-1][j-1]+1;\n else\n matrix[i][j]=Math.min(matrix[i-1][j], matrix[i][j-1])+1;\n }\n }\n\n //Printing the SCS matrix\n for(int i=0;i<=la;i++){\n for(int j=0;j<=lb;j++){\n System.out.print(matrix[i][j]+\" \");\n }\n System.out.println(\" \");\n }\n \n return matrix[la][lb];\n }", "public static void main(String[] args) {\n String s = \"acdcb\", p = \"a*?b\";//true\n System.out.println(isMatch(s, p));\n }", "public static void main(String[] args) {\n\t\tString s=\"geeks\";\r\n\t\tString s1=\"egeks\";\r\n\t\tint m=s.length();\r\n\t\tint n=s1.length();\r\n\t\tfor(int i=0;i<m;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<n;j++)\r\n\t\t\t{\r\n\t\t\t\tif(s.charAt(i)!=s1.charAt(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"no of index\"+i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "static boolean isSubstringUsingIndexOf(String big, String small) {\n return big.contains(small);\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\r\n\r\n\t\t// uzimamo unos od korisnika\r\n\t\tSystem.out.print(\"Unesite prvi string: \");\r\n\t\tString str1 = input.nextLine();\r\n\t\tSystem.out.print(\"Unesite drugi string: \");\r\n\t\tString str2 = input.nextLine();\r\n\r\n\t\t// zatvaramo scanner\r\n\t\tinput.close();\r\n\r\n\t\tif (str1.contains(str2)) {\r\n\t\t\t// ako prvi string sadrzi drugi string ispisujemo odgovarajucu\r\n\t\t\t// poruku\r\n\t\t\tSystem.out.println(\"'\" + str2 + \"' je substring '\" + str1\r\n\t\t\t\t\t+ \"' stringa.\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"String '\" + str2 + \"' nije substring '\" + str1\r\n\t\t\t\t\t+ \"' stringa.\");\r\n\t\t}\r\n\r\n\t}", "public int match(String s1, String s2) {\n\t\tchar ch1;\n\t\t\n\t\tif (s1.length() == 0 && s2.length() == 0) // s1,s2がともにからであれば0を返す\n\t\t\treturn 0;\n\t\tfor (int i1 = 0; i1 < s1.length(); i1++) {\n\t\t\tch1 = s1.charAt(i1);\n\n\t\t\tif (s2.length() > 0) {\n\t\t\t\tif (s2.charAt(0) == ch1) {\n\t\t\t\t\tif (matchChar(s1, s2, i1)) {\n\t\t\t\t\t\treturn i1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (s2.length() == 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public static int findIndex(String string1, String string2) {\n char c;\n char d;\n int index = -1;\n boolean match = true;\n int count = 1;\n int counter = 0;\n boolean matchFound = false;\n for (int i = 0; i < string2.length(); i++) {\n c = string2.charAt(i);\n if (string2.length() > string1.length()) {\n match = false;\n break;\n }\n // Checks if the characters after the first of string 2 match in string 1\n if (matchFound == true) {\n for (int j = count + counter; j < string1.length(); j++) {\n d = string1.charAt(j);\n if (d != c) {\n \n match = false;\n } else {\n counter++;\n index = j -1;\n matchFound = true;\n break;\n }\n }\n } \n // Checks for the first character in string2 in string1\n if (matchFound == false) {\n for (int k = 0; k < string1.length(); k++) {\n d = string1.charAt(k); \n if (d != c) {\n count ++;\n \n matchFound = false;\n } else {\n index = k;\n matchFound = true;\n break;\n } \n match = true;\n } \n } \n }\n // returns the index number\n return index;\n \n \n }", "private boolean isSubSequence(String s, String word){\n int startPointer = 0;\n for(int i=0; i<word.length(); i++){\n int location = s.indexOf(word.charAt(i), startPointer);\n if(location < 0)\n return false;\n startPointer = location+1;\n }\n return true;\n }", "static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }", "private boolean isSameFaRegion( String areas ) {\n\t\t\n\t\treturn ( areas.equalsIgnoreCase( Gfa.BOS + \"-\" + Gfa.MIA ) ||\n\t\t\t\t areas.equalsIgnoreCase( Gfa.MIA + \"-\" + Gfa.BOS ) || \n\t\t\t\t areas.equalsIgnoreCase( Gfa.SLC + \"-\" + Gfa.SFO ) ||\n\t\t\t\t areas.equalsIgnoreCase( Gfa.SFO + \"-\" + Gfa.SLC ) || \n\t\t\t\t areas.equalsIgnoreCase( Gfa.CHI + \"-\" + Gfa.DFW ) ||\n\t\t\t\t areas.equalsIgnoreCase( Gfa.DFW + \"-\" + Gfa.CHI ) );\n\t}", "public static void main (String[] args)\n {\n String test = \"software\";\n \n CharSequence seq = \"soft\";\n boolean bool = test.contains(seq);\n System.out.println(\"Found soft?: \" + bool);\n \n // it returns true substring if found.\n boolean seqFound = test.contains(\"war\");\n System.out.println(\"Found war? \" + seqFound);\n \n // it returns true substring if found otherwise\n // return false.\n boolean sqFound = test.contains(\"wr\");\n System.out.println(\"Found wr?: \" + sqFound);\n }", "public boolean isMatch2(){\r\n if(str==null ||pattern==null) return false; \r\n boolean[][] match=new boolean[lens+1][lenp+1];\r\n match[0][0]=true; \r\n for (int i = 0; i <lenp; i++) {\r\n if (pattern.charAt(i) == '*' && match[0][i-1]) \r\n match[0][i+1] = true; \r\n }\r\n for (int i = 0 ; i < lens; i++) {\r\n for (int j = 0; j < lenp; j++) {\r\n if (pattern.charAt(j) == '.') {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == str.charAt(i)) {\r\n match[i+1][j+1] = match[i][j];\r\n }\r\n if (pattern.charAt(j) == '*') {\r\n if (pattern.charAt(j-1) != str.charAt(i) && pattern.charAt(j-1) != '.') {\r\n match[i+1][j+1] = match[i+1][j-1];\r\n } else {\r\n match[i+1][j+1] = (match[i+1][j] || match[i][j+1] || match[i+1][j-1]);\r\n }\r\n }\r\n }\r\n }\r\n return match[lens][lenp];\r\n }", "static String abbreviation(String a, String b) {\r\n \r\n HashSet<Character> aSet = new HashSet<>();\r\n\r\n for(int i = 0 ; i< a.length() ; i++){\r\n aSet.add(a.charAt(i));\r\n }\r\n \r\n for(int i = 0 ; i < b.length() ; i++){\r\n \r\n if(aSet.contains(b.charAt(i)) ){\r\n aSet.remove(b.charAt(i));\r\n }\r\n else if(aSet.contains(Character.toLowerCase(b.charAt(i)))){\r\n aSet.remove(Character.toLowerCase(b.charAt(i)));\r\n }\r\n else{\r\n return \"NO\";\r\n }\r\n \r\n\r\n }\r\n\r\n Iterator<Character> it = aSet.iterator();\r\n while(it.hasNext()){\r\n\r\n if(!isLowerCase(it.next())){\r\n return \"NO\";\r\n }\r\n }\r\n return \"YES\";\r\n \r\n /*\r\n String regex = \"\";\r\n for(int i = 0 ; i < b.length() ; i++){\r\n regex += \"[a-z]*\" + \"[\" + b.charAt(i) + \"|\" + Character.toLowerCase(b.charAt(i)) + \"]\";\r\n }\r\n regex += \"[a-z]*\";\r\n Pattern ptrn = Pattern.compile(regex);\r\n Matcher matcher = ptrn.matcher(a);\r\n\r\n return matcher.matches() ? \"YES\" : \"NO\";\r\n*/\r\n \r\n /*\r\n int aPtr = 0;\r\n\r\n //b e F g H\r\n // E F H\r\n for(int i = 0 ; i < b.length() ; i++){\r\n\r\n if(aPtr + 1 >= a.length())\r\n return \"NO\";\r\n //if(aPtr + 1 == a.length() && i + 1 == b.length())\r\n // return \"YES\";\r\n\r\n System.out.println(b.charAt(i) + \" \" + a.charAt(aPtr));\r\n if(b.charAt(i) == a.charAt(aPtr)){\r\n aPtr++;\r\n }else if(b.charAt(i) == Character.toUpperCase(a.charAt(aPtr)) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n\r\n } else if(b.charAt(i) != a.charAt(aPtr) && !isLowerCase(a.charAt(aPtr))){\r\n return \"NO\";\r\n }else if(b.charAt(i) != a.charAt(aPtr) && isLowerCase(a.charAt(aPtr))){\r\n aPtr++;\r\n i--;\r\n }\r\n\r\n\r\n\r\n }\r\n for(int i = aPtr ; i < a.length() ; i++){\r\n if(!isLowerCase(a.charAt(i)))\r\n return \"NO\";\r\n }\r\n\r\n return \"YES\";\r\n */\r\n\r\n }", "public static boolean contains(final String string, final String sub) {\n final int tl = sub.length();\n if(tl == 0) return true;\n final int sl = string.length() - tl;\n for(int s = 0; s <= sl; s++) {\n int t = 0;\n while(equals(string.charAt(s + t), sub.charAt(t))) {\n if(++t == tl) return true;\n }\n }\n return false;\n }", "public static void main(String[] args) {\n\t\t\n\t\tString str1 = \"snow\";\n\t\tString str2 = \"wons\";\n\t\tint count = 0;\t\t\n\t\tfor(int i=0; i<str1.length() && i<str2.length(); i++){\n\t\t\tif(str1.toLowerCase().charAt(i) != str2.toLowerCase().charAt(i)){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tif(count >1) System.out.println(\"fasle==>>\"+count);\n\t\telse System.out.println(\"true\");\n\t}", "public static void main(String[] args) {\n String s = \"abc\";\n String t = \"ahbgdc\";\n boolean res = isSubsequence(s,t);\n System.out.println(res);\n }", "public int repeatedStringMatch(String a, String b) {\n \n int count = 0;\n StringBuilder sb = new StringBuilder();\n \n while(sb.length() < b.length()){\n sb.append(a); //O(roundUp(M/N) * N) < O(M*N)\n count++;\n }\n \n if(sb.indexOf(b) != -1) return count; //check at max O(M*N) characters\n \n //handles rotated array case\n if(sb.append(a).indexOf(b) != -1) return count + 1; //append takes O(N), indexOf takes in the worst case (missing match) ~O(M*N)\n \n return -1;\n }", "public boolean search(String s, String p) {\n int i,j,start=0;\n for(i=0,j=0;i<s.length()&&j<p.length();i++) {\n if(p.charAt(j)=='*') {\n start = ++j;\n i--;\n } else if(match(p.charAt(j),s.charAt(i))) {\n j++;\n } else {\n i-=j-start;\n j=start;\n }\n }\n while(j<p.length() && p.charAt(j)=='*') {\n j++;\n }\n return j>=p.length();\n }", "public static boolean igual(String str){\n\t\tboolean resp = false;\n\t\tif(str.length() != 3){\n\t\t\treturn resp;\n\t\t}// End if\n\t\tif(str.charAt(0) == 'F' && str.charAt(1) == 'I' && str.charAt(2) == 'M'){\n\t\t\tresp = true;\n\t\t}// End if\n\t\treturn resp;\t\n\t}", "public static void main(String[] args) {\n\n\t\tString s=\"xxxxxabcxxxx\";\n\t\tint m=s.length()/2;\n\t\t\n\t\tif(s.substring(m-1, m+2).equals(\"abc\")) {\n\t\t\t\n\t\tSystem.out.println(\"middle\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"no inmid\");\n\t\t\n\n}\n}", "public static void main(String[] args) {\n\n String firstString = \"this is what I'm searching in\";\n String secondString = \"I\";\n\n System.out.println(subStringIn(firstString, secondString));\n }", "public static void main(String[] args)\r\n\t{\n\t\tSystem.out.print(\"enter string - \");\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString whole = input.next();\r\n\t\tSystem.out.print(\"enter sub-string to be searched - \");\r\n\t\tString part = input.next();\r\n\t\tinput.close();\r\n\t\tImplementStrStr sample = new ImplementStrStr();\r\n\t\tString result = sample.findSubString(whole, part);\r\n\t\tif(result==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SubString not present\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SubString is present - \"+result);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tString str = \"ABba\";\n\t\tSystem.out.println(findMatchingPair(str));\n\t\t\n\t\tString str1 = \"ABbCca\";\n\t\tSystem.out.println(findMatchingPair(str1));\n\t\t\n\t}", "public boolean isInterleave(String s1, String s2, String s3) {\n // write your code here\n\n int l1 = s1.length();\n int l2 = s2.length();\n int l3 = s3.length();\n\n // interleaving condition\n if (l1 + l2 != l3)\n return false;\n\n boolean[][] dp = new boolean[l1+1][l2+2];\n dp[0][0] = true;\n\n // initializing the table based on first string\n for (int i = 1; i <= l1; i++){\n if (s3.charAt(i-1) == s1.charAt(i-1) && dp[i-1][0])\n dp[i][0] = true;\n }\n\n // initializing the table based on second string\n for (int i = 1; i <= l2; i++){\n if (s3.charAt(i-1) == s2.charAt(i-1) && dp[0][i-1])\n dp[0][i] = true;\n }\n\n for (int i = 1; i<=l1; i++){\n for (int j=1; j<=l2; j++){\n if (dp[i][j-1] && (s3.charAt(i+j-1) == s2.charAt(j-1)) ||\n dp[i-1][j] && (s3.charAt(i+j-1) == s1.charAt(i-1)))\n dp[i][j] = true;\n }\n\n }\n return dp[l1][l2];\n }", "public boolean checkInclusion(String s1, String s2) {\n\t\tif (s1.length() > s2.length())\n\t\t\treturn false;\n\t\tint[] s1map = new int[26];\n\t\tfor (int i = 0; i < s1.length(); i++)\n\t\t\ts1map[s1.charAt(i) - 'a']++;\n\t\tfor (int i = 0; i <= s2.length() - s1.length(); i++) {\n\t\t\tint[] s2map = new int[26];\n\t\t\tfor (int j = 0; j < s1.length(); j++) {\n\t\t\t\ts2map[s2.charAt(i + j) - 'a']++;\n\t\t\t}\n\t\t\tif (matches(s1map, s2map))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean compare_same(String x, String y) {\n\t\tint fuzzy = 0;\n\t\tif (x.length() != y.length()) return false;\n\t\tfor (int i = 0, j = 0; i<x.length() && j<y.length();) {\n\t\t\tif (i>0 && x.charAt(i-1)=='_' && '0'<=x.charAt(i) && x.charAt(i)<='9') {\n\t\t\t\twhile (i<x.length() && '0'<=x.charAt(i) && x.charAt(i)<='9') i++;\n\t\t\t}\n\t\t\tif (j>0 && y.charAt(j-1)=='_' && '0'<=y.charAt(j) && y.charAt(j)<='9') {\n\t\t\t\twhile (j<y.length() && '0'<=y.charAt(j) && y.charAt(j)<='9') j++;\n\t\t\t}\n\t\t\tif (i<x.length() && j<y.length() && x.charAt(i) != y.charAt(j)) {\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++; j++;\n\t\t}\n\t\treturn true;\n\t}", "boolean comparison(String str, String pattern) {\n int s = 0, p = 0, match = 0, starIdx = -1;\n while (s < str.length()){\n /**\n * advancing both pointers\n */\n if (p < pattern.length() && (pattern.charAt(p) == '?' || str.charAt(s) == pattern.charAt(p))){\n s++;\n p++;\n }\n\n /**\n * '*' found, only advancing pattern pointer\n *\n * check the situation when '*' matches no char\n *\n * starIdx : remember location of '*' in pattern\n * match : remember index in s when the last '*\" appears\n */\n else if (p < pattern.length() && pattern.charAt(p) == '*'){\n starIdx = p;\n match = s;\n p++;\n }\n\n /**\n * the last pattern pointer was *, advancing string pointer\n *\n * !!!\n * If pattern character != string character\n * OR\n * pattern is used up\n * AND\n * there was '*' character in pattern before :\n *\n * Backtrack check the situation when '*' matches one more character\n */\n else if (starIdx != -1){\n p = starIdx + 1;\n match++;\n s = match;\n }\n\n /**\n * current pattern pointer is not star, last pattern pointer was not *\n * characters do not match\n */\n else return false;\n }\n\n /**\n * check for remaining characters in pattern\n */\n while (p < pattern.length() && pattern.charAt(p) == '*') {\n p++;\n }\n\n return p == pattern.length();\n }", "boolean matches(String medium, CSSCanvas canvas);", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tString s1=s.nextLine();\r\n\t\tString s2=s.nextLine();\r\n\t\tint c=0;\r\n\t\tfor (int i=0;i<s2.length();i++) {\r\n\t\t\tchar c1=s2.charAt(i);\r\n\t\t\tfor(int j=0;j<s1.length();j++) {\r\n\t\t\t\tif (c1==s1.charAt(j) && s1.charAt(j)!=' ')\r\n\t\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif (c==s1.length())\r\n\t\t\tSystem.out.print(\"yes\");\r\n\r\n\t}", "public static void main(String[] args) {\n\n\t\tSolution49 s49 = new Solution49();\n\t\tint result=s49.strstr1(\"bcabc\", \"ab\");\n\t\tSystem.out.println(result);\n\t\tresult=s49.strstr2(\"bcabc\", \"aab\");\n\t\tSystem.out.println(result);\n\t\treturn;\n\t}", "public static boolean isRotation(String str1, String str2) {\n if ((str1.length() != str2.length()) || str1.isEmpty() || str2.isEmpty()\n || str1 == null || str2 == null) {\n return false;\n }\n return isSubString(str1, str2 + str2);\n // return (str2 + str2).contains(str1);\n // return ((str2 + str2).indexOf(str1) > -1);\n }", "String isIntersect(pair pair1){\n\t\tString s;\n\t\tif(pair1.z==true){\n\t\t\tif(pair1.x>=xRange.x && pair1.x<=xRange.y){ s=\"mid\";\n\t\t\treturn s;\n\t\t\t}\n\t\t\telse if(pair1.x<xRange.x){s=\"right\";\n\t\t\treturn s;\n\t\t\t}\n\t\t\telse{s=\"left\";\n\t\t\treturn s;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t}\n\t\telse{\n\t\t\tif(pair1.y>=yRange.x && pair1.y<=yRange.y){ s=\"mid\";\n\t\t\treturn s;}\n\t\t\telse if(pair1.y<yRange.x){s=\"right\";\n\t\t\treturn s;\n\t\t\t} \n\t\t\telse{s=\"left\";\n\t\t\treturn s;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t}\t\t\t\t \n\t}", "public static boolean isIntersecting(Coord p1, Coord q1, Coord p2, Coord q2) \n { \n // Find the four orientations needed for general and \n // special cases \n int o1 = orientation(p1, q1, p2); \n int o2 = orientation(p1, q1, q2); \n int o3 = orientation(p2, q2, p1); \n int o4 = orientation(p2, q2, q1); \n \n // General case \n if(o1 != o2 && o3 != o4) \n return true; \n \n // Special Cases \n // p1, q1 and p2 are colinear and p2 lies on segment p1q1 \n if (o1 == 0 && isOnSegment(p1, q1, p2)) return true; \n \n // p1, q1 and q2 are colinear and q2 lies on segment p1q1 \n if (o2 == 0 && isOnSegment(p1, q1, q2)) return true; \n \n // p2, q2 and p1 are colinear and p1 lies on segment p2q2 \n if (o3 == 0 && isOnSegment(p2, q2, p1)) return true; \n \n // p2, q2 and q1 are colinear and q1 lies on segment p2q2 \n if (o4 == 0 && isOnSegment(p2, q2, q1)) return true; \n \n return false; // Doesn't fall in any of the above cases \n }", "private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }", "public static String isMatching(String str){\n\t\tint l=str.length();\n\t\tSolution obj = new Solution();\n\t\tfor(int i=0;i<l;i++){\n\t\t\tchar temp = str.charAt(i);\n\t\t\tif(temp=='{' || temp=='[' || temp=='('){\n\t\t\t\tobj.push(temp);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tchar top=obj.peek();\n\t\t\t\tif((top=='{' && temp=='}') || (top=='(' && temp==')') ||(top=='[' && temp==']'))\n\t\t\t\t\tobj.pop();\n\t\t\t\telse\n\t\t\t\t\treturn \"NO\";\n\t\t\t}\n\t\t}\n\t\tif(obj.isEmpty()){\n\t\t\treturn \"YES\";\n\t\t}\n\t\telse{\n\t\t\treturn \"NO\";\n\t\t}\n\t}", "public static void main(String[] args){\n\n String NO=\"张xin\";\n String Name=\"张xin(123)\";\n Boolean B=Name.contains(NO);\n System.out.println(B);\n\n\n\n }", "private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }", "public static boolean isMatch2(String s, String p) {\n\t\t\n\t\tint len1 = s.length();\n\t\tint len2 = p.length();\n\t\t\n\t\tboolean[][] check = new boolean[ len1 + 1 ][ len2 + 1 ];\n\t\t\n\t\tcheck[0][0] = true;\n\t\t\n\t\tfor( int i = 1; i< check[0].length; i++ ){\n\t\t\tif( p.charAt( i - 1) == '*' ){\n\t\t\t\tcheck[0][i] = check[0][i - 2];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor( int i = 1; i<check.length; i++ ){\n\t\t\tfor( int j = 1; j<check[0].length; j++ ){\n\n\t\t\t\tif( p.charAt( j - 1 ) == '.' || p.charAt( j - 1 ) == s.charAt( i - 1 ) ){\n\t\t\t\t\tcheck[i][j] = check[i - 1][j - 1];\n\t\t\t\t}\n\t\t\t\telse if( p.charAt(j - 1) == '*' ){\n\n\t\t\t\t\tcheck[i][j] = check[i][ j - 2 ];\n\n\t\t\t\t\tif( p.charAt( j - 2 ) == '.' || p.charAt( j - 2 ) == s.charAt( i - 1 ) ){\n\t\t\t\t\t\tcheck[i][j] = check[i][j] || check[i - 1][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcheck[i][j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn check[ len1 ][ len2 ];\t\n\t}", "public static boolean isSubString(String shortStr, String longStr) {\n if ((shortStr.length() > longStr.length()) || shortStr.isEmpty() || longStr.isEmpty()) {\n return false;\n }\n for (int i = 0; i < longStr.length() - shortStr.length() + 1; i++) {\n int j = 0;\n for (; j < shortStr.length(); j++) {\n if (shortStr.charAt(j) == longStr.charAt(i + j)) {\n continue;\n } else {\n break;\n }\n }\n if (j == shortStr.length()) {\n return true;\n }\n }\n return false;\n }", "public boolean doWeHaveSameStops(String corridorA, String corridorB);", "public boolean isMatch(String s, String p) {\n boolean[][] dp = new boolean[s.length()+1][p.length()+1];\n dp[0][0] = true;\n for(int i = 0; i < p.length(); i++) {\n if(p.charAt(i) == '*' && dp[0][i-1]) {\n dp[0][i+1] = true;\n }\n }\n for(int i = 0; i < s.length(); i++) {\n for(int j = 0; j < p.length(); j++) {\n char sc = s.charAt(i);\n char pc = p.charAt(j);\n if(sc == pc) {\n dp[i+1][j+1] = dp[i][j];\n } else if(pc == '.') {\n dp[i+1][j+1] = dp[i][j];\n } else if(pc == '*') {\n if(p.charAt(j-1) != '.' && p.charAt(j-1) != s.charAt(i)) {\n dp[i+1][j+1] = dp[i+1][j-1];\n } else {\n dp[i+1][j+1] = (dp[i+1][j] || dp[i+1][j-1] || dp[i][j+1]);\n }\n } else if(pc == '+') {\n if(p.charAt(j-1) == '.' || p.charAt(j-1) == s.charAt(i)) {\n dp[i+1][j+1] = (dp[i][j+1] || dp[i+1][j]);\n }\n }\n }\n }\n return dp[s.length()][p.length()];\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Input string: \");\n String string = scanner.nextLine();\n System.out.print(\"Input substring: \");\n String substring = scanner.nextLine();\n\n if (string.contains(substring)){\n System.out.println(\"String contains the substring.\");\n }else {\n System.out.println(\"String no contains the substring.\");\n }\n }", "public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public static boolean substring(String first,String second)\r\n {\r\n return second.toLowerCase().contains(first.toLowerCase());\r\n }", "public void containsString() {\n\t\t\tString name = \"martin\";\n\t\t\tboolean contains = name.contains(\"rti\");\n\t\t\tif(contains) {\n\t\t\t\tSystem.out.println(\"it contains\");\n\t\t\t}\n\t\t}", "boolean isSubStr(String s, String t) {\n\t\tint k = 0;\n\t\tfor (int i = 0; i < s.length(); ++i) {\n\t\t\tboolean found = false;\n\t\t\tfor (; k < t.length(); ++k) if (found = (t.charAt(k) == s.charAt(i))) break;\n\t\t\tif (!found) return false;\n\t\t\t++k;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean compareSubstring(List<String> pieces, String s)\n {\n\n boolean result = true;\n int len = pieces.size();\n\n int index = 0;\n\nloop: for (int i = 0; i < len; i++)\n {\n String piece = pieces.get(i);\n\n // If this is the first piece, then make sure the\n // string starts with it.\n if (i == 0)\n {\n if (!s.startsWith(piece))\n {\n result = false;\n break loop;\n }\n }\n\n // If this is the last piece, then make sure the\n // string ends with it.\n if (i == len - 1)\n {\n result = s.endsWith(piece);\n break loop;\n }\n\n // If this is neither the first or last piece, then\n // make sure the string contains it.\n if ((i > 0) && (i < (len - 1)))\n {\n index = s.indexOf(piece, index);\n if (index < 0)\n {\n result = false;\n break loop;\n }\n }\n\n // Move string index beyond the matching piece.\n index += piece.length();\n }\n\n return result;\n }", "private boolean m81839a(String str) {\n return C6969H.m41409d(\"G738BDC12AA\").equals(str) || C6969H.m41409d(\"G738BDC12AA39A528F61E\").equals(str);\n }", "private boolean overlapsWith(int offset1, int length1, int offset2, int length2) {\n \t\tint end= offset2 + length2;\n \t\tint thisEnd= offset1 + length1;\n \n \t\tif (length2 > 0) {\n \t\t\tif (length1 > 0)\n \t\t\t\treturn offset1 < end && offset2 < thisEnd;\n \t\t\treturn offset2 <= offset1 && offset1 < end;\n \t\t}\n \n \t\tif (length1 > 0)\n \t\t\treturn offset1 <= offset2 && offset2 < thisEnd;\n \t\treturn offset1 == offset2;\n \t}", "public static boolean charsOccurIn(final String string, final String sub) {\n final int sl = string.length(), tl = sub.length();\n int t = 0;\n for(int s = 0; s < sl && t < tl; s++) {\n if(equals(string.charAt(s), sub.charAt(t))) t++;\n }\n return t == tl;\n }", "@Override\r\n\tpublic boolean matches(String first, String last) {\n\t\treturn false;\r\n\t}", "public static boolean stringRotation(String str1, String str2) {\n String temp = str2 + str2;\n return temp.contains(str1);\n }", "public static void main(String[] args) {\n\t\t\tString str=\"Four score and seven years ago\";\n\t\t\tSystem.out.println(\"The letter r appears at the following locations: \");\n\t\t\tint position = str.indexOf('r');\n\t\t\twhile (position!= -1) {\n\t\t\t\tSystem.out.print(position + \" \");\n\t\t\t\tposition = str.indexOf('r',position+1);\n\t\t\t}\n\t\t\t\n\t\t\tString str2 = \"and a one and two and a three\";\n\t\t\tSystem.out.println(\"The word \\\" and\\\" appears at the following location: \");\n\t\t\tint positionAnd = str2.indexOf(\"and\");\n\t\t\twhile(positionAnd != -1) {\n\t\t\t\tSystem.out.print(positionAnd + \" \");;\n\t\t\t\tpositionAnd = str2.indexOf(\"and\", positionAnd+1);\n\t\t\t}\n}", "public static void main(String[] args)\n\t{\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"enter string A\");\n\t\tString A = scan.nextLine();\n\t\tSystem.out.println(\"enter string B\");\n\t\tString B = scan.nextLine();\n\t\tint indexOfOccurance = strStr(A, B);\n\t\tSystem.out.println(indexOfOccurance);\n\n\t}", "private static int matchValue(TrieNode existing, TrieNode toAdd, String[] allWords){\n\t\tSystem.out.println(allWords[existing.substr.wordIndex]);\n\t\tSystem.out.println(allWords[toAdd.substr.wordIndex]);\n\n\t\tString first=allWords[existing.substr.wordIndex].substring(existing.substr.startIndex,existing.substr.endIndex+1);\n\t\tString second=allWords[toAdd.substr.wordIndex].substring(toAdd.substr.startIndex,toAdd.substr.endIndex+1);\n\t\tSystem.out.println(\"Compare: \"+first+ \"\\twith\" +\"\\t\"+ second);\n\t\t\n\t\tint count=1;\n\t\tint matchValue=0;\n\t/*\tif(first.charAt(0)!=second.charAt(0)){\n\t\t\treturn 0;\n\t\t}*/\n\t\t\n\t\t//System.out.println(\"From: \"+ existing.substr.startIndex+\" To: \"+existing.substr.endIndex);\n\t\tif(first.length()<=second.length()){\n\t\t\tint imax=(short)(existing.substr.endIndex-existing.substr.startIndex+1);\n\t\tfor(int i=0;i<imax;i++){\n\t\t\t\n\t\t\t//System.out.println(\"UM WE RUN COUNT: \" );\n\t\t\tif(first.charAt(i)==second.charAt(i)){\n\t\t\t\tmatchValue++;\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(first.charAt(i)!=second.charAt(i)){\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t}\n\t\telse{\n\t\t\tint imax=(short)(toAdd.substr.endIndex-toAdd.substr.startIndex+1);\n\t\t\tfor(int i=0;i<imax;i++){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(first.charAt(i)==second.charAt(i)){\n\t\t\t\t\tmatchValue++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(first.charAt(i)!=second.charAt(i)){\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t}\t\n\t\t}\n\t\treturn matchValue;\n\t}", "public static void main(String[] args) {\n\n\t\tString str = \"What's the difference between java, javascript and python?\";\n\t\t\n\t\tint countJava = 0;\n\t\tint countPython = 0;\n\t\t\n\t\tString str1 = \"java\";\n\t\tString str2 = \"python\";\n\t\t\n\t\tfor(int i=0; i<str.length()-3; i++) {\n\t\t\tif(str.substring(i, i+4).equals(str1)) {\n\t\t\t\tcountJava++;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<str.length()-5; i++) {\n\t\t\tif(str.substring(i, i+6).equals(str2)) {\n\t\t\t\tcountPython++;\n\t\t\t}\n\t\t}\n\t\tif(countJava == countPython) {\n\t\t\tSystem.out.println(true);\n\t\t}else {\n\t\t\tSystem.out.println(false);\n\t\t}\n\t\t\n\t}", "public boolean checkPalindromeFormation(String a, String b) {\n int n = a.length();\n return findCommonSubstring(a.toCharArray(), b.toCharArray(), 0, n - 1) ||\n findCommonSubstring(b.toCharArray(), a.toCharArray(), 0, n - 1);\n }", "public static void main(String[] args) {\n\n String pattern = \"abba\", inStr = \"dog cat cat fish\";\n System.out.println(matchWithSpace(pattern, inStr));\n\n //Given a pattern and a string str, find if str follows the same pattern. NO SPACE IN STRING\n // pattern = \"abab\", str = \"redblueredblue\" => true\n // pattern = \"aaaa\", str = \"asdasdasdasd\" => true\n // pattern = \"aabb\", str = \"xyzabcxyzabc\" => false\n\n System.out.println(matchNoSpace(\"abab\",\"redblueredblue\"));\n System.out.println(matchNoSpace(\"aabb\",\"xyzabcxzyabc\"));\n\n }" ]
[ "0.6915913", "0.6599885", "0.65887916", "0.6515347", "0.6301663", "0.62970203", "0.6262822", "0.62361145", "0.62081224", "0.6204541", "0.61976385", "0.61687946", "0.616627", "0.6164789", "0.6092869", "0.6087595", "0.6040051", "0.60266477", "0.6019055", "0.60071826", "0.59757674", "0.5948521", "0.5933201", "0.59329957", "0.5921725", "0.59119743", "0.5909595", "0.5907554", "0.5907437", "0.58886015", "0.58798677", "0.58517796", "0.5827436", "0.5795263", "0.577294", "0.5755169", "0.5737478", "0.57063556", "0.567994", "0.5676222", "0.5675634", "0.5657238", "0.5652635", "0.5635088", "0.56330526", "0.562028", "0.5602223", "0.55953425", "0.55917776", "0.55916303", "0.5588554", "0.5584829", "0.5582152", "0.55612314", "0.5554276", "0.553844", "0.55370015", "0.55369216", "0.5536382", "0.5528413", "0.55282456", "0.5513027", "0.5512273", "0.55121046", "0.5504637", "0.5502946", "0.54986393", "0.5486578", "0.5482593", "0.5454713", "0.5451918", "0.54355234", "0.54351866", "0.54327357", "0.54245913", "0.54201037", "0.54181993", "0.5417492", "0.5416503", "0.5414998", "0.54084325", "0.54041165", "0.53944856", "0.53855443", "0.5368059", "0.53676444", "0.5366756", "0.5359803", "0.53557956", "0.5355746", "0.5350778", "0.5344775", "0.53335804", "0.5330388", "0.532976", "0.53290975", "0.5322826", "0.5321639", "0.5320188", "0.5317767" ]
0.6084444
16
Updates position of the rope.
private void updatePos() { var ballBounds = ball.getMesh().getRelativeRectangleBounds().getBounds2D(); var hookBallBounds = hook.getHookBall().getMesh().getRelativeRectangleBounds().getBounds2D(); var ballCenter = new Vector2(ballBounds.getCenterX(), ballBounds.getCenterY()); var hookBallCenter = new Vector2(hookBallBounds.getCenterX(), hookBallBounds.getCenterY()); fullDirection = hookBallCenter.subtracted(ballCenter); var oposDir = ballCenter.subtracted(hookBallCenter).normalized(); oposDir.multiplyBy(hookBallBounds.getWidth() / 2); hookBallCenter.add(oposDir); direction = hookBallCenter.subtracted(ballCenter); getTransform().setPosition(ballCenter); getTransform().setRotation(GeometryHelper.vectorToAngle(hookBallCenter.subtracted(ballCenter))); getTransform().translate(0, -GameSettings.ROPE_HEIGHT / 2 - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void move() {\n this.pposX = this.posX;\n this.pposY = this.posY;\n this.posX = newPosX;\n this.posY = newPosY;\n }", "private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }", "public void frogReposition() {\n\t\tsetY(FrogPositionY);\n\t\tsetX(FrogPositionX);\t\t\n\t\t}", "@Override\n\tpublic void updatePosition() {\n\t\t\n\t}", "public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\n\t}", "public void setPosition(Point newPosition);", "public void updatePosition() {\n\n this.x = this.temp_x;\n this.y = this.temp_y;\n this.ax = 0;\n this.ay = 0;\n\t\tthis.axplusone = 0;\n this.ayplusone = 0;\n \n }", "void updatePosition() {\n\t\t\n\t\tcoords.x = body.getPosition().x*Simulation.meterToPixel;\n\t\tcoords.y = body.getPosition().y*Simulation.meterToPixel;\n\t\tspeed.x = body.m_linearVelocity.x;\n\t\tspeed.y = body.m_linearVelocity.y;\n\t}", "@Override\n public void move() {\n _location.x++;\n }", "protected void update(){\n\t\t_offx = _x.valueToPosition(0);\n\t\t_offy = _y.valueToPosition(0);\n\t}", "public void move(){\n super.move();\n load.updateCoordinates(this.x,this.y);\n }", "void setPosition(Position p);", "@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}", "public void move()\n\t{\n\t\tx = x + frogVelocityX;\n\t}", "public void changePos(double xP, double yP){ \n this.xCoor += xP;\n this.yCoor += yP;\n \n }", "public void update(){\n posX += velX;\n posY += velY;\n }", "public void redoMove(){\n circleObj.setX(newX);\n circleObj.setY(newY);\n }", "public void setPosition(Position p);", "void setPosition(Position position);", "void setPosition(Position position);", "void setPos(float x, float y);", "public void setPosition(Position pos);", "@Override\n public void tick() {\n setPosition(getPosition().add(getSpeed())); \n }", "public void move() {\r\n posX += movementX;\r\n posY += movementY;\r\n anchorX += movementX;\r\n anchorY += movementY;\r\n }", "public void incrementPos(double elapsedTime) {\n this.setY(this.getY() + this.getY_vel() * elapsedTime);\n }", "@Override\n public void move() {\n this.point.x += vector.x * getCurrentSpeed();\n this.point.y += vector.y * getCurrentSpeed();\n }", "public void setPosition(Point position);", "void setPosition(double xPos, double yPos);", "public void updatePosition(double timestep){\n\t\tx = x + vx * timestep;\n\t y = y + vy * timestep;\n\t}", "public void moveTo(int newX, int newY) {\n xPosition = newX-radius;\n yPosition = newY-radius;\n }", "public void updatePosition(int xPos, int yPos) {\n this.pos.x = xPos;\n this.pos.y = yPos;\n }", "public void setPosition(float x, float y);", "public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}", "public void updatePositioningData(PositioningData data);", "void setPosition(Point point);", "@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 moveRight() {\n locX = locX + 1;\n }", "public void move() {\r\n\t\tx = x + speed;\r\n\t}", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "public abstract void setPosition(Position position);", "protected void setPosition(Position p) {\n\t\tposition = p;\n\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 }", "protected void updatePosition() {\n\t\tif(motion == null) {\n\t\t\tmotion = new Motion3D(player, true);\n\t\t} else motion.update(player, true);\n\t\t\n\t\tmotion.applyToEntity(this);\n\t\tthis.rotationPitch = player.rotationPitch;\n\t\tthis.rotationYaw = player.rotationYaw;\n\t}", "public void moveRobber(HexLocation loc) {\n\n\t}", "public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}", "public void move() {\n\t\tdouble xv = 0;\r\n\t\tdouble yv = 0;\r\n\t\t//this method allows the entity to hold both up and down (or left and right) and not move. gives for smooth direction change and movement\r\n\t\tif (moveRight) {\r\n\t\t\txv+=getSpeed();\r\n\t\t\torientation = Orientation.EAST;\r\n\t\t}\r\n\t\tif (moveLeft) {\r\n\t\t\txv-=getSpeed();\r\n\t\t\torientation = Orientation.WEST;\r\n\t\t}\r\n\t\tif (moveUp)\r\n\t\t\tyv-=getSpeed();\r\n\t\tif (moveDown)\r\n\t\t\tyv+=getSpeed();\r\n\t\tif (!doubleEquals(xv,0) || !doubleEquals(yv,0)) {\r\n\t\t\t((Player)this).useMana(0.1);\r\n\t\t\tImageIcon img = new ImageIcon(\"lib/assets/images/fireball.png\");\r\n\t\t\tBufferedImage image = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);\r\n\t\t\tGraphics g = image.getGraphics();\r\n\t\t\tg.drawImage(img.getImage(), 0, 0, image.getWidth(), image.getHeight(), null);\r\n\t\t\tColor n = loop[ind%loop.length];\r\n\t\t\tind++;\r\n\t\t\timage = ImageProcessor.scaleToColor(image, n);\r\n\t\t\t//PopMessage.addPopMessage(new PopMessage(image,getX(),getY()));\r\n\t\t}\r\n\t\telse\r\n\t\t\t((Player)this).useMana(-0.1);\r\n\t\tmove(xv,yv);\r\n\t}", "public void move() {\n\t\tthis.move(velocity.x, velocity.y);\n\t}", "@Override\n\tpublic void update() {\n\t\tposX -= ninja.getSpeedX();\n\t\t\n\t}", "public void move(Point p) {\n\t\tchange = new Point(p.x - point.x, p.y - point.y);\n\t\tmoveProgress = 1;\n\t\t// moves();\n\t}", "public void setPos(int pos);", "public void setPos(int pos);", "private void move(double newXPos){\n this.setX(newXPos);\n }", "public void moveRight() {\n\t\tposX += speed;\n\t}", "private void move() {\n acceleration.accelerate(velocity, position);\r\n }", "public void updatePosition(float x, float y){\n rect = new Rectangle2D.Float(x,y,width,height);\n this.x = x;\n this.y = y;\n }", "@Override\n public void setPosition(float x, float y) {\n }", "public void SetPosition(Vector2 position)\n\t{\n\t\tTransform transform = parent.transform;\n\t\ttransform.position = position;\n\t\t// Dont loose your dP!\n\t\tpreviousPosition = Vector2.Add(position,velocity.negate());\n\t}", "public void setPosition(int position, boolean passThroughGoSquare)\n\t{\n\t\tsomethingChanged = true;\n\t\tif ((position >= 40 || this.position > position) && passThroughGoSquare)\n\t\t{\n\t\t\taddMoney(200);\n\t\t}\n\t\tsetPreviousPosition(this.position);\n\t\tthis.position = position;\n\t\tthis.position %= 40;\n\t}", "public void setPosition(Vector2 position);", "public void move(){\n x+=xDirection;\n y+=yDirection;\n }", "@Override\n\tpublic void posModify() {\n\t\t\n\t}", "@Override\n\tpublic void posModify() {\n\t\t\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 abstract void move(Position position);", "public void refreshPosition() {\n\n this.setTransform(getTransform());\n }", "public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }", "public void setPosition(int position);", "public void updatePos(double elapsedTime) {\n\t\tif(falling) {\n\t\t\tsetX(getOwner().getX() + getOwner().getWidth() / 2 - getBoundsInParent().getWidth() / 2);\n\t\t\tsetY(getOwner().getY() + getOwner().getHeight() / 2 - getBoundsInParent().getHeight() / 2);\n\t\t} else setY(this.getY() + elapsedTime * getYSpeed());\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 setPosition(){\r\n currentPosition = 0; \r\n }", "@Override\r\n\tpublic void updatePosition(int id, float[] pos) {\n\r\n\t}", "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 }", "void setPos(Vec3 pos);", "public void updatePosition(int xPos, int yPos, Port.PortName newPort) {\n this.pos.x = xPos;\n this.pos.y = yPos;\n this.currentPort = newPort;\n }", "public void pos1 () throws InterruptedException {\n pos = 1;\n mainFlop.setPosition(0.7);\n subFlop.setPosition(0.35);\n Thread.sleep(400);\n }", "public void updateSprites() {\n this.model.getSprites().values().forEach(x -> x.setPosition(this.x, this.y));\n }", "public abstract Point move(Point position);", "@Override\n\tpublic void setPosition(Position p) {\n\t\tthis.position = p;\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 setPosition(Vector2 p) {\n\t\tpos = p;\n\t}", "public void updateLocation();", "public void move()\n\t{\n time++;\n\t\tif (time % 10 == 0)\n\t\t{\n\t\t\thistogramFrame.clearData();\n\t\t}\n\t\tfor (int i = 0; i < nwalkers; i++)\n\t\t{\n\t\t\tdouble r = random.nextDouble();\n\t\t\tif (r <= pRight)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] + 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] - 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft + pDown)\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] + 1;\n\t\t\t}\n\t\t\tif (time % 10 == 0)\n\t\t\t{\n\t\t\t\thistogramFrame.append(Math.sqrt(xpositions[i] * xpositions[i]\n\t\t\t\t\t\t+ ypositions[i] * ypositions[i]));\n\t\t\t}\n\t\t\txmax = Math.max(xpositions[i], xmax);\n\t\t\tymax = Math.max(ypositions[i], ymax);\n\t\t\txmin = Math.min(xpositions[i], xmin);\n\t\t\tymin = Math.min(ypositions[i], ymin);\n\t\t}\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}", "public void moveRelative(int x, int y) {\n this.x = this.x + x;\n this.y = this.y + y;\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}", "public final void setPosition(int p) {\n this.position = p;\n }", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "@Override\r\n\tpublic void move()\r\n\t{\r\n\t\t//Updates the X and Y position by using dx and dy\r\n float x = location.getX() + dx;\r\n float y = location.getY() + dy;\r\n \r\n //Updates the particle emitter's position to the missiles current position\r\n emitter.setPosition(this.getPositionX(), this.getPositionY(),false);\r\n \r\n //Updates the location of the missile\n setLocation(x, y);\n\t}", "public void setPosition(Point p) {\r\n\t\tthis.position = p;\r\n\t\tc.setPosition(p);\r\n\t}", "public void update(){\n\t\tx+=xspeed; \n\t\ty+=yspeed;\t\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 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 static void new_position( Body body, double t ){\r\n body.lastState.copyStateVectors( body.currentState );\r\n body.currentState.x = body.currentState.x + body.currentState.vx * t; // new x\r\n body.currentState.y = body.currentState.y + body.currentState.vy * t; // new y\r\n body.currentState.z = body.currentState.z + body.currentState.vz * t; // new z\r\n }", "public void reload() {\n\t\tpause();\n\t\tsetPosition(0);\n\t}", "@Override\n public UpdateResourcePositionResult updateResourcePosition(UpdateResourcePositionRequest request) {\n request = beforeClientExecution(request);\n return executeUpdateResourcePosition(request);\n }", "public void move() {\n\t\tif (isLuck) {\n\t\t\tif (rand.nextBoolean()) {\n\t\t\t\txPos++;\n\t\t\t}\n\t\t} else {\n\t\t\tif (rightCount < skill) {\n\t\t\t\trightCount++;\n\t\t\t\txPos++;\n\t\t\t}\n\t\t}\n\t}", "public void move(){\n\t\t\n\t}", "public void setPosition(Position pos) {\n \tthis.position = pos;\n \t//setGrade();\n }", "@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }", "public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}" ]
[ "0.7414124", "0.6995244", "0.6969571", "0.6940488", "0.690569", "0.6875388", "0.6831086", "0.67887545", "0.65729755", "0.6567342", "0.65593034", "0.65415436", "0.653873", "0.6530402", "0.65237445", "0.64973485", "0.644934", "0.6448745", "0.64435303", "0.64435303", "0.6443105", "0.6410324", "0.6409359", "0.6376326", "0.636472", "0.6351361", "0.6348858", "0.6337714", "0.63160443", "0.63108", "0.6305366", "0.6297546", "0.62889826", "0.62597156", "0.6253558", "0.62529945", "0.6247221", "0.6246886", "0.62116826", "0.62043583", "0.6185815", "0.6179865", "0.6174416", "0.61601037", "0.6155334", "0.61534244", "0.61468923", "0.6142232", "0.6115408", "0.6114001", "0.6114001", "0.61108553", "0.6101494", "0.609881", "0.60976493", "0.60957116", "0.60942894", "0.60936517", "0.6093165", "0.6092584", "0.6084107", "0.6084107", "0.608404", "0.60829234", "0.6082854", "0.6072102", "0.6070196", "0.60687125", "0.6065042", "0.6060474", "0.6051748", "0.6047814", "0.6045787", "0.6037531", "0.6035257", "0.6033554", "0.6026521", "0.60214484", "0.60195243", "0.6011615", "0.60091597", "0.6005381", "0.6003988", "0.6001851", "0.6000064", "0.59995145", "0.59811854", "0.59787756", "0.5975576", "0.59707683", "0.59695065", "0.5963736", "0.59627473", "0.59600013", "0.5958721", "0.5957657", "0.59561014", "0.59515595", "0.59488225", "0.5947605" ]
0.6293621
32
Draws rope in the direction.
@Override public void draw(Graphics2D graphics, int layer) { if (this.layer == layer && direction != null) { curImage = ImageHelper.rescale(image, (int) fullDirection.magnitude(), GameSettings.ROPE_HEIGHT); if (alive && curImage != null) graphics.drawImage(curImage, transform.getFullAffine(), null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}", "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\r\n\t\t\t//door\r\n\t\t\tpen.setColor(Color.blue);\r\n\t\t\tpen.setWidth(10);\r\n\t\t\tpen.move(50,0);\r\n\t\t\tpen.move(50,100);\r\n\t\t\tpen.move(-50,100);\r\n\t\t\tpen.move(-50,0);\r\n\t\t\tpen.move(0,0);\r\n\r\n\t\t\t//windows\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(-150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\r\n\t\t\t//extra\r\n\t\t\tpen.move(-45,120);\r\n\t\t\tpen.down();\r\n\t\t\tpen.setColor(Color.black);\r\n\t\t\tpen.drawString(\"This is a house\");\r\n\t}", "public void draw(){\n if (! this.isFinished() ){\n UI.setColor(this.color);\n double left = this.xPos-this.radius;\n double top = GROUND-this.ht-this.radius;\n UI.fillOval(left, top, this.radius*2, this.radius*2);\n }\n }", "@Override\r\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(this.color);\r\n\t\tg.fillOval((int)x, (int)y, side, side);\r\n\t\tg.setColor(this.color2);\r\n\t\tg.fillOval((int)x+5, (int)y+2, side/2, side/2);\r\n\t}", "public void drawRoad(int player, int location, Graphics g){\n\t}", "public void draw(){\n\t\tSystem.out.println(\"You are drawing a CIRCLE\");\n\t}", "@Override\n public void draw() {\n super.draw(); \n double radius = (this.getLevel() * 0.0001 + 0.025) * 2.5e10;\n double x = this.getR().cartesian(0) - Math.cos(rot) * radius;\n double y = this.getR().cartesian(1) - Math.sin(rot) * radius;\n StdDraw.setPenRadius(0.01);\n StdDraw.setPenColor(StdDraw.RED);\n StdDraw.point(x, y);\n \n }", "public void draw() {\n if (!myTurn()) {\n return;\n }\n draw(4 - handPile.size());\n }", "public void draw()\n {\n myPencil.up();\n myPencil.backward(100);\n myPencil.down();\n myPencil.turnRight(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(400);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n myPencil.turnLeft(90);\n myPencil.forward(200);\n // Roof\n myPencil.up();\n myPencil.move(0,200);\n myPencil.down();\n myPencil.setDirection(333.435);\n myPencil.forward(223.607);\n myPencil.setColor(new Color(2, 0, 0));\n myPencil.up();\n myPencil.move(0,200);\n myPencil.setDirection(206.565);\n myPencil.down();\n myPencil.forward(223.607);\n // Windows\n myPencil.up();\n myPencil.move(-150,0);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(75,0);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(-50,-100);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.turnLeft(90);\n myPencil.forward(100);\n myPencil.turnLeft(90);\n myPencil.forward(50);\n myPencil.turnLeft(90);\n myPencil.forward(100);\n myPencil.up();\n myPencil.move(-50,-100);\n myPencil.setDirection(60);\n myPencil.down();\n myPencil.backward(150);\n myPencil.up();\n myPencil.move(50,-100);\n myPencil.setDirection(120);\n myPencil.down();\n myPencil.backward(150);\n myPencil.up();\n myPencil.move(150,-150);\n myPencil.down();\n myPencil.drawCircle(25);\n myPencil.up();\n myPencil.move(-150,-150);\n myPencil.down();\n myPencil.drawCircle(25);\n myPencil.up();\n myPencil.move(-150,-175);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.backward(20);\n myPencil.up();\n myPencil.move(150,-175);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.backward(20);\n myPencil.up();\n myPencil.move(-150,37.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(75,37.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(-112.5,0);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.forward(75);\n myPencil.up();\n myPencil.move(112.5,0);\n myPencil.setDirection(90);\n myPencil.down();\n myPencil.forward(75);\n // House Sidewalk\n myPencil.up();\n myPencil.move(-250,-112.5);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(192.5);\n myPencil.up();\n myPencil.move(250,-112.5);\n myPencil.setDirection(180);\n myPencil.down();\n myPencil.forward(192.5);\n myPencil.up();\n myPencil.move(-250,-100);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(90);\n myPencil.forward(193);\n myPencil.up();\n myPencil.move(250,-100);\n myPencil.setDirection(180);\n myPencil.down();\n myPencil.forward(90);\n myPencil.up();\n myPencil.move(-75,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-100,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-125,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-150,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-175,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-200,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-225,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(-250,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(75,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(100,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(125,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(150,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(175,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(200,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(225,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n myPencil.up();\n myPencil.move(250,-100);\n myPencil.setDirection(240);\n myPencil.down();\n myPencil.forward(15);\n // Chimney\n myPencil.up();\n myPencil.move(125,190);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(52);\n myPencil.up();\n myPencil.move(100,190);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(40);\n myPencil.up();\n myPencil.move(100,190);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(25);\n // Door window\n myPencil.up();\n myPencil.move(0,-25);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.drawCircle(8);\n myPencil.up();\n myPencil.move(-8,-25);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.forward(16);\n myPencil.up();\n myPencil.move(0,-17);\n myPencil.setDirection(270);\n myPencil.down();\n myPencil.forward(16);\n // Door knob\n myPencil.up();\n myPencil.move(14,-55);\n myPencil.setDirection(0);\n myPencil.down();\n myPencil.drawCircle(2);\n }", "public void drawRadar () {\n // material red (229,28,35)\n // philo red 204,17, 17 \n stroke(229,28,35, 255-cursorRad*(255/cursorRadMax));\n if (cursorRad < cursorRadMax) {\n ellipse(mouseX, mouseY, cursorRad, cursorRad);\n }\n else if (cursorRad > (cursorRadMax + cursorThreshold)) {\n cursorRad = 5;\n }\n cursorRad = cursorRad + cursorDelta;\n noStroke();\n }", "public void draw() {\n \n // TODO\n }", "public void draw() {\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setPenRadius(0.01);\n for (Point2D point : points) {\n StdDraw.point(point.x(), point.y());\n }\n StdDraw.setPenRadius();\n }", "public static void drawPicture1(Graphics2D g2) {\r\n\r\n\tRodent r1 = new Rodent(100,250,50);\r\n\tg2.setColor(Color.CYAN); g2.draw(r1);\r\n\t\r\n\t// Make a black rodent that's half the size, \r\n\t// and moved over 150 pixels in x direction\r\n\r\n\tShape r2 = ShapeTransforms.scaledCopyOfLL(r1,0.5,0.5);\r\n\tr2 = ShapeTransforms.translatedCopyOf(r2,150,0);\r\n\tg2.setColor(Color.BLACK); g2.draw(r2);\r\n\t\r\n\t// Here's a rodent that's 4x as big (2x the original)\r\n\t// and moved over 150 more pixels to right.\r\n\tr2 = ShapeTransforms.scaledCopyOfLL(r2,4,4);\r\n\tr2 = ShapeTransforms.translatedCopyOf(r2,150,0);\r\n\t\r\n\t// We'll draw this with a thicker stroke\r\n\tStroke thick = new BasicStroke (4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); \r\n\t\r\n\t// for hex colors, see (e.g.) http://en.wikipedia.org/wiki/List_of_colors\r\n\t// #002FA7 is \"International Klein Blue\" according to Wikipedia\r\n\t// In HTML we use #, but in Java (and C/C++) its 0x\r\n\t\r\n\tStroke orig=g2.getStroke();\r\n\tg2.setStroke(thick);\r\n\tg2.setColor(new Color(0x002FA7)); \r\n\tg2.draw(r2); \r\n\t\r\n\t// Draw two Rabbits\r\n\t\r\n\tRabbit ra1 = new Rabbit(50,350,40);\r\n\tRabbit ra2 = new Rabbit(200,350,200);\r\n\t\r\n\tg2.draw(ra1);\r\n\tg2.setColor(new Color(0x8F00FF)); g2.draw(ra2);\r\n\t\r\n\t// @@@ FINALLY, SIGN AND LABEL YOUR DRAWING\r\n\t\r\n\tg2.setStroke(orig);\r\n\tg2.setColor(Color.BLACK); \r\n\tg2.drawString(\"A few rabbits by Josephine Vo\", 20,20);\r\n }", "@Override\n public void paintPedestrian(Graphics g) {\n\n g.setColor(Color.RED);\n g.fillOval(x, y, 10, 10);\n g.setColor(Color.BLACK);\n g.drawOval(x, y, 10, 10);\n }", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "public void draw() {\n\t\tapplyColors();\n\n\t\tfloat halfHeight = height / 2,\n\t\t\t\tdiameter = 2 * radius;\n\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\t\t// Draw top of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, -height);\n\t\t// Draw bottom of the cylinder\n\t\tRobotRun.getInstance().ellipse(0f, 0f, diameter, diameter);\n\t\tRobotRun.getInstance().translate(0f, 0f, halfHeight);\n\n\t\tRobotRun.getInstance().beginShape(RobotRun.TRIANGLE_STRIP);\n\t\t// Draw a string of triangles around the circumference of the Cylinders top and bottom.\n\t\tfor (int degree = 0; degree <= 360; ++degree) {\n\t\t\tfloat pos_x = RobotRun.cos(RobotRun.DEG_TO_RAD * degree) * radius,\n\t\t\t\t\tpos_y = RobotRun.sin(RobotRun.DEG_TO_RAD * degree) * radius;\n\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, halfHeight);\n\t\t\tRobotRun.getInstance().vertex(pos_x, pos_y, -halfHeight);\n\t\t}\n\n\t\tRobotRun.getInstance().endShape();\n\t}", "@Override\n public void paintPedestrian(Graphics g) {\n g.setColor(Color.BLUE);\n g.fillOval(x, y, 10, 10);\n g.setColor(Color.BLACK);\n g.drawOval(x, y, 10, 10);\n }", "@Override\r\n public final void draw(final Rectangle r, final BufferedImage paper) {\n String red;\r\n String green;\r\n String blue;\r\n if (Integer.toHexString(r.getBorderColor().getRed()).length() == 1) {\r\n red = \"0\" + Integer.toHexString(r.getBorderColor().getRed());\r\n } else {\r\n red = Integer.toHexString(r.getBorderColor().getRed());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getGreen()).length() == 1) {\r\n green = \"0\" + Integer.toHexString(r.getBorderColor().getGreen());\r\n } else {\r\n green = Integer.toHexString(r.getBorderColor().getGreen());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getBlue()).length() == 1) {\r\n blue = \"0\" + Integer.toHexString(r.getBorderColor().getBlue());\r\n } else {\r\n blue = Integer.toHexString(r.getBorderColor().getBlue());\r\n }\r\n String color = \"#\" + red + green + blue;\r\n\r\n draw(new Line((String.valueOf(r.getxSus())), String.valueOf(r.getySus()),\r\n String.valueOf(r.getxSus() + r.getLungime() - 1), String.valueOf(r.getySus()),\r\n color, String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus()), String.valueOf(r.getxSus() + r.getLungime() - 1),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus())),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus()), color, String.valueOf(r.getBorderColor().getAlpha()),\r\n paper), paper);\r\n\r\n for (int i = r.getxSus() + 1; i < r.getxSus() + r.getLungime() - 1; i++) {\r\n for (int j = r.getySus() + 1; j < r.getySus() + r.getInaltime() - 1; j++) {\r\n if (checkBorder(i, j, paper)) {\r\n paper.setRGB(i, j, r.getFillColor().getRGB());\r\n }\r\n }\r\n }\r\n }", "@Override\r\n \tpublic void paintComponent(Graphics g) {\r\n \t\tsuper.paintComponent(g);\r\n \t\tdrawSnake(g);\r\n \t}", "public void render() {\n float theta = velocity.heading2D() + radians(90);\n\n\n fill(255, 0, 0);\n stroke(0, 0, 0);\n strokeWeight(0.5f);\n pushMatrix();\n translate(position.x, position.y);\n rotate(theta);\n beginShape(QUAD);\n fill(130);\n vertex(r, -r*2);\n\n vertex(-r, -r*2);\n vertex(-r, r*2);\n vertex(r, r*2);\n\n endShape();\n strokeWeight(0.5f);\n beginShape(TRIANGLES);\n vertex(r,-r*2);\n vertex(r*2.5f,r);\n vertex(r,r);\n endShape();\n strokeWeight(0.5f);\n beginShape(TRIANGLES);\n vertex(-r, -r*2);\n vertex(r, -r*2);\n vertex(0, -r*4);\n endShape();\n beginShape(TRIANGLES);\n vertex(-r, r*5);\n vertex(r, r*5);\n vertex(0, r*2);\n endShape();\n strokeWeight(1.7f*r);\n stroke(255);\n fill(255);\n point(0, -r*2.5f);\n stroke(0);\n fill(0);\n strokeWeight(0.75f*r);\n point(0, -r*2.5f);\n popMatrix();\n }", "private void drawFallingPiece() {\r\n\t\t// loops through each rectangle of the shape type (always 4), and draws it\r\n\t\t// based on it's status and position.\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tdrawSquare(game.fallingPiece.x + game.fallingPiece.coord[game.fallingPiece.status][i][0],\r\n\t\t\t\t\t game.fallingPiece.y + game.fallingPiece.coord[game.fallingPiece.status][i][1],\r\n\t\t\t\t\t game.fallingPiece.color);\r\n\t\t}\r\n\t}", "@Override\n public void draw() {\n /** preparacion de la ventana **/\n background(255);\n lights();\n directionalLight(40, 90, 100, 1, 40, 40);\n\n translate(origin.x,origin.y);\n scale(zoom);\n\n\n /** entrada del usuario **/\n userInput();\n /** ejes X Y Z **/\n drawAxes();\n /** aplicar ik **/\n writePos();\n\n /** escala de los objetos**/\n scale(-1.2f);\n\n /** esfera que muestra la posicion en coord X Y Z\n *\n * X -> coord[0]\n * Y -> coord[1]\n * Z -> coord[2]\n *\n * **/\n pushMatrix();\n noStroke();\n fill(250, 100, 1);\n translate(-coord_cartesian[1] ,-coord_cartesian[2] -11,-coord_cartesian[0] );\n sphere(2);\n popMatrix();\n\n\n /**\n * Dibuja el brazo\n */\n pushMatrix();\n arm.drawArm();\n popMatrix();\n }", "private void doDraw(Canvas canvas) {\n\t\t// Draw the background image. Operations on the Canvas accumulate\n\t\t// so this is like clearing the screen.\n\t\tcanvas.drawBitmap(mBackgroundImage, 0, 0, null);\n\t\tcanvas.save();\n\n\t\t// rotate rocket so it always faces where it is headed\n\t\tcanvas.save();\n\t\t\n\t\t\n\t\t//rotates rocket in the direction it is moving based on x and y velocity\n\t\t//http://gamedev.stackexchange.com/questions/19209/rotate-entity-to-match-current-velocity\n//\t\tcanvas.rotate((int) -(Math.tan(mRocket.xVel / mRocket.yVel) * 57.2957795), mRocket.xPos,\n\t\tcanvas.rotate((int) (-270 + Math.atan2(mRocket.yVel, mRocket.xVel) * 57.2957795), mRocket.xPos,\n\t\t\t\tmRocket.yPos);\n\t\tmRocket.setBounds();\n\t\tmRocket.image.draw(canvas);\n\t\tcanvas.restore();\n\n\t\tfor (Satellite s : mLevel.satellites) {\n\t\t\ts.setBounds();\n\t\t\ts.image.draw(canvas);\n\t\t}\n\t\t\n\t\t//draw line\n\t\tif(mState == GameState.PLANNING_LVL && currXPos != Float.MIN_VALUE){\n\t\t\tPaint p = new Paint();\n\t\t\tp.setAlpha(255);\n\t\t\tp.setStrokeWidth(3);\n\t\t\tp.setColor(Color.WHITE);\n\t\t\tp.setStyle(Style.FILL_AND_STROKE);\n\t\t\tp.setPathEffect(new DashPathEffect(new float[]{15,4}, 0));\n//\t\t\tLineSegment ls = new LineSegment(new Point(mRocket.xPos, mRocket.yPos), new Point(currXPos, currYPos));\n//\t\t\tls.extendLine(mCanvasHeight/2);\n//\t\t\tcanvas.drawLine((float)ls.a.x, (float)ls.a.y, (float)ls.b.x, (float)ls.b.y, p);\n\t\t\tcanvas.drawLine(mRocket.xPos, mRocket.yPos, currXPos, currYPos, p);\t\n\t\t}\n\t}", "public void paint (Graphics g)\n {\n g.setColor(color);\n for(Point pellet : pellets)\n {\n g.fillOval(5+MunchGame.SEGMENT_SIZE*pellet.x+2,\n 15+MunchGame.SEGMENT_SIZE*pellet.y+2, \n MunchGame.SEGMENT_SIZE-4,\n MunchGame.SEGMENT_SIZE-4);\n }\n }", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"You are drawing a RECTANGLE\");\n\t}", "public void draw() {\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setPenRadius(.01);\n for (Point2D p : s) {\n p.draw();\n }\n }", "@Override\r\n\tpublic void BuildArmRight() {\n\t\tg.drawLine(70, 50, 90, 100);\r\n\t}", "public void pintarRines(Graphics2D pG) {\n\n\n double cos = 0.829;\n double sin = 0.559;\n int radius = DIAMETER / 2;\n int diameter1 = 2 * DIAMETER / 5;\n int diameter2 = DIAMETER / 5;\n int diameter3 = DIAMETER / 10;\n int delta0 = DIAMETER / 5;\n int delta1 = radius - diameter1 / 2;\n int delta2 = radius - diameter2 / 2;\n int delta3 = radius - diameter3 / 2;\n int d2 = (int) (diameter1 * cos / 2);\n int d1 = (int) (diameter1 * sin / 2);\n\n // Points\n int x1 = x + radius - d2; // Represents the x value in QII and QIII\n int y1 = y + radius - d1; // Represents the y value in QI and QII\n int x2 = x + radius + d2; // Represents the x value in QI and QIV\n int y2 = y + radius + d1; // Represents the y value in QIII and QIV\n int vertX = x+ radius;\n int topY = y + radius - diameter1/2;\n int bottomY = y + radius+diameter1/2;\n\n // Paints circle with diameter1\n pG.setColor(new Color(14, 14, 14));\n pG.fillOval(x + delta1, y + delta1, diameter1, diameter1);\n\n\n // Paint circle with diamater 2\n pG.setColor(Color.DARK_GRAY);\n pG.fillOval(x + delta2, y + delta2, diameter2, diameter2);\n\n\n pG.setColor(Color.DARK_GRAY);\n BasicStroke stroke = new BasicStroke(DIAMETER / 15);\n pG.setStroke(stroke);\n pG.drawLine(x1, y1, x2, y2);\n pG.drawLine(x1,y2,x2,y1);\n pG.drawLine(vertX, topY, vertX, bottomY);\n\n // Draw center donut shape\n pG.setColor(Color.GRAY);\n BasicStroke stroke1 = new BasicStroke(DIAMETER / 50);\n pG.setStroke(stroke1);\n pG.drawOval(x + delta3, y + delta3, diameter3, diameter3);\n\n\n }", "public void draw() {\n \n }", "@Override\r\n\tpublic void perimetre(Graphics g) {\n\t\tswitch(this.getAngle()){\r\n\t\tcase 0 :\r\n\t\t\tg.drawRect(this.getX()+(this.getTaille()/4), this.getY(), this.getTaille()/2, this.getTaille());\r\n\t\t\tbreak;\r\n\t\tcase 90:\r\n\t\t\tg.drawRect(this.getX(), this.getY()+(this.getTaille()/4), this.getTaille(), this.getTaille()/2);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void paint(Graphics g) {\n\t\tswitch(this.getAngle()){\r\n\t\tcase 0 :\r\n\t\t\tg.fillRect(this.getX()+(this.getTaille()/4), this.getY(), this.getTaille()/2, this.getTaille());\r\n\t\t\tbreak;\r\n\t\tcase 90:\r\n\t\t\tg.fillRect(this.getX(), this.getY()+(this.getTaille()/4), this.getTaille(), this.getTaille()/2);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void drawTheImage(Graphics g)\r\n\t{\r\n\t\tg.setColor(Color.BLACK);\r\n\t\tg.fillOval(theX, theY, 10,10);\r\n\t\ttheX+=velX;\r\n\t\ttheY+=velY;\r\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\t\tsuper.draw(g);\n\t\tif(!satillite){\n\t\t\tdrawTrace(g);\n\t\t}\n\t\t\n \t\tmove();\n\t}", "public void paint( Graphics g ){\n g.drawOval(-4, -4, 8, 8);\n g.drawLine(-2, 2, 2,-2);\n g.drawLine(-2,-2, 2, 2);\n }", "@Override\n public void draw() {\n drawAPI.drawCircle(radius, x, y); \n }", "@Override\n\tpublic void draw(int radus,int x, int y) {\n\t\tSystem.out.printf(\"draw red circle in %d ,%d by radus is %d %n\",x,y,radus);\n\t}", "public void draw(Graphics g) {\r\n // The pipe goes back to the right side when it hits the left boarder.\r\n if (coordX + 40 <= 0) {\r\n coordX = 1200;\r\n }\r\n\r\n // Draw the pipe.\r\n g.drawImage(img, coordX, COORD_Y, panel);\r\n\r\n /* When the first pipe goes pass the 100 pixels horizontally (based on mario's\r\n starting position) for the first time we set the flag to true (we start \r\n counting each jump as a point). */\r\n if (Gameplay.pipes[0].coordX <= 100) {\r\n Gameplay.passed = true;\r\n }\r\n\r\n // If the pipe touches mario we lose.\r\n if (new Rectangle(coordX, COORD_Y, 40, 70).intersects(\r\n new Rectangle(Mario.MARIO_X, panel.getMarioY(), 30, 30))) {\r\n\r\n Gameplay.play = false;\r\n }\r\n\r\n // Move the pipe left.\r\n coordX = coordX - 11;\r\n }", "public void paintRubberband(Point2D pt1, Point2D pt2, Graphics g) {\n paintLine(pt1, pt2, g);\n paintCircle(pt1, pt2, g);\n }", "public void render() {\n float theta = velocity.heading2D() + radians(90);\n\n\n fill(255, 0, 0);\n stroke(255, 0, 0);\n strokeWeight(0.5f);\n pushMatrix();\n translate(position.x, position.y);\n rotate(theta);\n beginShape(QUAD);\n fill(255, 0, 0);\n vertex(r, -r*2);\n\n vertex(-r, -r*2);\n vertex(-r, r*2);\n vertex(r, r*2);\n\n endShape();\n beginShape(TRIANGLES);\n vertex(-r, -r*2);\n vertex(r, -r*2);\n vertex(0, -r*4);\n endShape();\n beginShape(TRIANGLES);\n vertex(-r, r*5);\n vertex(r, r*5);\n vertex(0, r*2);\n endShape();\n fill(0);\n stroke(255);\n fill(255);\n strokeWeight(1.7f*r);\n\n point(0, -r*2.5f);\n stroke(0);\n fill(0);\n strokeWeight(0.75f*r);\n point(0, -r*2.5f);\n\n\n popMatrix();\n textSize(6+(this.kidsHad/2));\n textMode(CENTER);\n stroke(0);\n text(\" g:\"+this.gen+\"/\"+kidsHad + \"/id: \" + (this.id+1), this.position.x, this.position.y);\n }", "public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}", "public void paintComponent(Graphics g) \r\n\t{\r\n\t\tsuper.paintComponent(g);\r\n\t\t\r\n\t\tg.setColor(Color.GREEN);\r\n\t\tg.fillRect(120, 20, 17, 40); //draws green chimney\r\n\t\t\r\n\t\tg.setColor(Color.RED);\r\n\t\tg.fillRect(30, 40, 130, 45); //draws red rectangle for house \r\n\t\t\r\n\t\tg.setColor(Color.BLUE);\r\n\t\tPolygon roof = new Polygon(); //draws shape of the roof\r\n\t\troof.addPoint(30, 40);\t //}\r\n\t\troof.addPoint(160, 40); //} corners of roof\r\n\t\troof.addPoint(95, 20);\t //}\r\n\t\tg.fillPolygon(roof); //fills roof w/ the color blue\r\n\t}", "public void draw(Graphics g) {\n\t\tif (isRoom()) {\n\t\t\tg.setColor(Color.LIGHT_GRAY);\n\t\t\tg.fillRect(column * CELL_WIDTH, row * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);\n\t\t}\n\t\telse if (isDoorway()) {\n\t\t\tg.setColor(Color.LIGHT_GRAY);\n\t\t\tg.fillRect(column * CELL_WIDTH, row * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);\n\t\t\tif (direction == DoorDirection.UP) {\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(column * CELL_WIDTH, row * CELL_HEIGHT, CELL_WIDTH, SMALL_RECT);\n\t\t\t}\n\t\t\telse if (direction == DoorDirection.RIGHT) {\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(column * CELL_WIDTH + CELL_WIDTH - SMALL_RECT, row * CELL_HEIGHT, SMALL_RECT, CELL_HEIGHT);\n\t\t\t}\n\t\t\telse if (direction == DoorDirection.DOWN) {\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(column * CELL_WIDTH, row * CELL_HEIGHT + CELL_HEIGHT - SMALL_RECT, CELL_WIDTH, 5);\n\t\t\t}\n\t\t\telse if (direction == DoorDirection.LEFT) {\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(column * CELL_WIDTH, row * CELL_HEIGHT, SMALL_RECT, CELL_HEIGHT);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tg.setFont(new Font(\"SansSerif\", Font.BOLD, 12));\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.drawString(roomName, column * CELL_WIDTH, row * CELL_HEIGHT);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawRect(column * CELL_WIDTH, row * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);\n\t\t}\n\t}", "public void draw() {\n for (Point2D p: mPoints) {\n StdDraw.filledCircle(p.x(), p.y(), 0.002);\n }\n }", "public void draw(Graphics g) {\n g.setColor(Color.red);\r\n //g2d.rotate(Math.toRadians(degree), restX-X_SIZE/2 , restY-Y_SIZE/2 );\r\n g.fillOval(deltaX-xSize/2, deltaY-ySize/2, xSize, ySize);\r\n //g2d.setTransform(old);\r\n }", "private void renderRobot(Graphics g, Location robotLocation, Direction robotDirection, GridLocation gridPosition){\n g.setColor(Color.RED);\n g.fillRect(gridPosition.getX() + robotLocation.getX()*CELL_SIZE, gridPosition.getY() + robotLocation.getY()*CELL_SIZE,CELL_SIZE, CELL_SIZE);\n g.setColor(Color.BLUE);\n\n if (robotDirection == Direction.UP || robotDirection == Direction.DOWN){\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE , gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE);\n if(robotDirection == Direction.UP){\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 4);\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + 3 * CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 4);\n }\n else{\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 3 * CELL_SIZE / 4);\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + 3 * CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 3 * CELL_SIZE / 4);\n }\n }\n\n else if (robotDirection == Direction.LEFT || robotDirection == Direction.RIGHT){\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE , gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2);\n if(robotDirection == Direction.LEFT){\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE , gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 1 * CELL_SIZE / 4);\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE , gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 3 * CELL_SIZE / 4);\n }\n else{\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + 3 * CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 1 * CELL_SIZE / 4);\n g.drawLine(gridPosition.getX() + robotLocation.getX()*CELL_SIZE + CELL_SIZE, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + CELL_SIZE / 2, gridPosition.getX() + robotLocation.getX()*CELL_SIZE + 3 * CELL_SIZE / 4, gridPosition.getY() + robotLocation.getY()*CELL_SIZE + 3 * CELL_SIZE / 4);\n }\n }\n }", "@Override\r\n\tprotected void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\r\n\t\tg.setColor(new Color(255, 0, 0));\r\n\t\tg.drawOval(mp1.getX(), mp1.getY(), 3*length, 3*length);\r\n\t\tg.setColor(new Color(0,0,255));\r\n\t\tg.drawOval(enenmy.getX(), enenmy.getY(), 3, 3);\r\n\t}", "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 redraw(double angle, double speed) {\n }", "@Override\n\tpublic void buildArmRight() {\n\t\tg.drawLine(70, 50, 100, 80);\n\t}", "public void drawPokemon() {\n setAttackText();\n drawImage();\n }", "public void paint(Graphics gfx) {\r\n\t\tif (x== -5) {\r\n\t\t\tx = this.getWidth()/2;\r\n\t\t}\r\n\t\tif (y == -5) {\r\n\t\t\ty = this.getHeight()/2;\r\n\t\t}\r\n\t\tsuper.paint(gfx);\r\n\t\tSnake head = game.getSnake();\r\n\r\n\t\tgfx.setColor(Color.green);\r\n\t\tgfx.drawRect(head.x, head.y, head.width, head.height);\r\n\t\tSegment current = head.tailFirst;\r\n\t\twhile(current!=null) {\r\n\t\t\tgfx.drawRect(current.x, current.y, current.width, current.height);\r\n\t\t\tcurrent=current.next;\r\n\t\t}\r\n\t\tfor(Mushroom i : game.getMushrooms()) {\r\n\t\t\tgfx.drawImage(i.mushroomImage.getImage(), i.x, i.y, i.width, i.height , null);\r\n\r\n\t\t}\r\n\t}", "void reDraw();", "public void paint(Graphics g) {\n\t\t\tGraphics2D graphicSettings = (Graphics2D)g;\n\t\t\tAffineTransform identity = new AffineTransform();\n\t\t\t\n\t\t\t// draw a rectangle that is the size of the GameBoard\n\t\t\tgraphicSettings.setColor(Color.BLACK);\n\t\t\tgraphicSettings.fillRect(0, 0, getWidth(), getHeight());\n\t\t\t\n\t\t\t// set the rules of rendoring (Anti-Aliasing is important)\n\t\t\tgraphicSettings.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\n\t\t\t// make the color white for the asteroids\n\t\t\tgraphicSettings.setPaint(Color.WHITE);\n\t\t\t\n\t\t\t// Cycle through all of the rock objects\n\t\t\tfor(Rock rock : rocks) {\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t// Draw the rock if its supposed to be onScreen\n\t\t\t\tif (rock.onScreen)\n\t\t\t\t{\n\t\t\t\t\t// the rock moves\n\t\t\t\t\trock.move(ship, GameBoard.blasters);\n\t\t\t\t\t\n\t\t\t\t\tgraphicSettings.draw(rock);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t// press 'd'\n\t\t\tif (GameBoard.keyHeld == true && GameBoard.keyHeldCode == 68 )\n\t\t\t{\n\t\t\t\tship.increaseRotationAngle();\n\t\t\t\tSystem.out.println(\"angle Decreased to \" + ship.getRotationAngle());\n\t\t\t}\n\t\t\t\n\t\t\t// press 'a'\n\t\t\tif (GameBoard.keyHeld == true && GameBoard.keyHeldCode == 65 )\n\t\t\t{\n\t\t\t\tship.decreaseRotationAngle();\n\t\t\t\tSystem.out.println(\"angle Increased to \" + ship.getRotationAngle());\n\t\t\t}\n\t\t\t\n\t\t\t// press the 'w'\n\t\t\tif (GameBoard.keyHeld == true && GameBoard.keyHeldCode == 87 )\n\t\t\t{\n\t\t\t\tship.setMoveAngle(ship.getRotationAngle());\n\t\t\t\t\n\t\t\t\tship.IncreaseVelocityX(ship.MoveAngleX(ship.getMoveAngle())*.1);\n\t\t\t\tship.IncreaseVelocityY(ship.MoveAngleY(ship.getMoveAngle())*.1);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"move speed Increased\");\n\t\t\t}\n\t\t\t\n\t\t\t// press the 's'\n\t\t\tif (GameBoard.keyHeld == true && GameBoard.keyHeldCode == 83 )\n\t\t\t{\n\t\t\t\tship.setMoveAngle(ship.getRotationAngle());\n\t\t\t\t\n\t\t\t\tship.IncreaseVelocityX(-ship.MoveAngleX(ship.getMoveAngle())*.1);\n\t\t\t\tship.IncreaseVelocityY(-ship.MoveAngleY(ship.getMoveAngle())*.1);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"move speed decreased\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\t\t\tship.move();\n\t\t\t\n\t\t\t// set the origin to the screen so that the rotation of the ship occurs properly\n\t\t\tgraphicSettings.setTransform(identity);\n\t\t\t\n\t\t\t// move the ship\n\t\t\tgraphicSettings.translate(ship.getCenterX(), ship.getCenterY());\n\t\t\t\n\t\t\t// rotate the ship\n\t\t\tgraphicSettings.rotate(Math.toRadians(ship.getRotationAngle()));\n\t\t\t\n\t\t\t// keep the ship drawn on the screen\n\t\t\tgraphicSettings.draw(ship);\n\t\t\t\n\t\t\t// draw blasters\n\t\t\tfor(Blaster blasters: GameBoard.blasters)\n\t\t\t{\n\t\t\t\tblasters.move();\n\t\t\t\t\n\t\t\t\t// if the blasters not on screen don't calculate for the blaster\n\t\t\t\tif (blasters.onScreen)\n\t\t\t\t{\n\t\t\t\t\tgraphicSettings.setTransform(identity);\n\t\t\t\t\tgraphicSettings.translate(blasters.getCenterX(), blasters.getCenterY());\n\t\t\t\t\tgraphicSettings.draw(blasters);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "public void draw() {\n }", "public void moveAndDraw(Graphics window)\r\n {\n Color temp = getColor();\r\n\t\tdraw(window, Color.WHITE);\r\n\t\tsetPos(getXSpeed()+xSpeed, getYSpeed()+ySpeed);\r\n\t\tdraw(window, temp);\r\n\t\t//setY\r\n\r\n\t\t//draw the ball at its new location\r\n }", "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "@Override\n\tpublic void paint(Graphics g) {\n\t\n\t\tg.drawImage(desk,0,0,null);\n\t\tg.drawImage(ball,(int)x,(int)y,null);\n\t\t\n\t\t\n\t\tif(right)\n\t\t\tx+=10;\n\t\telse x-=10;\n\t\t\n\t\tif(x>856-40-30){ //856是窗口宽度,40是桌子边框的宽度,30是小球的直径\n right = false;\n }\n \n if(x<40){ //40是桌子边框的宽度\n right = true;\n }\n\t\t\n\t}", "@Override\r\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.PINK);\r\n\t\tg.fillRect(getX(), getY(), getWidth(), getHeight());\r\n\t\t\r\n\t}", "@Override\n\tprotected void drawPit(Graphics2D g2) {\n\t\tg2.setColor(PIT_FILL_COLOR);\n\t\tg2.fill(pit);\n\n\t\tg2.setColor(PIT_OUTLINE_COLOR);\n\t\tint strokeWidth = (int) ((getWidth() + getHeight()) / 2 * STROKE_WEIGHT);\n\t\tg2.setStroke(new BasicStroke(strokeWidth));\n\t\tg2.draw(pit);\n\t}", "public void draw(){\n }", "public void draw(Graphics g) {\n int x = super.getX();\n int y = super.getY();\n int d = (int)radius*2; //d = diameter\n g.setColor(Color.BLACK);\n g.drawOval(265/2,235,265,265);\n g.drawLine(265, 115, 265, 500);\n\n int [ ] x2 = {27, 500, 265}; //lets work on that line?\n int [ ] y2 = {500, 500, 115};\n g.setColor(Color.black);\n g.drawPolygon(x2, y2, 3);\n\n }", "public void drawOval(int x, int y, int width, int height);", "public void paint(Graphics g)\n {\n robot.readPosition(robotPos);\n // draws the shape\n Polygon globalShape = new Polygon();\n Point2D point = new Point2D.Double();\n for (int i = 0; i < shape.npoints; i++)\n {\n point.setLocation(shape.xpoints[i], shape.ypoints[i]);\n // calculates the coordinates of the point according to the local position\n localPos.rototras(point);\n // calculates the coordinates of the point according to the robot position\n robotPos.rototras(point);\n // adds the point to the global shape\n globalShape.addPoint((int) Math.round(point.getX()), (int) Math.round(point.getY()));\n }\n ((Graphics2D) g).setColor(bgColor);\n if (fillShape) ((Graphics2D) g).fillPolygon(globalShape);\n ((Graphics2D) g).setColor(fgColor);\n ((Graphics2D) g).drawPolygon(globalShape);\n }", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double land= new Rectangle2D.Double(xleft, ybottom, 10000, 100);\n Color mycolor= new Color(255, 222, 156);\n g2.setColor(mycolor);\n g2.draw(land);\n g2.fill(land);\n g2.draw(land);\n \n }", "public void draw() {\n\t\t\r\n\t\tSystem.out.println(\"drawing...\");\r\n\t\t\r\n\t}", "public void draw();", "public void draw();", "public void draw();", "public void draw(Graphics2D g2)\n {\n Random randomGenerator = new Random();\n Ellipse2D.Double object = new Ellipse2D.Double(xLeft, yTop, 50,50);\n g2.setPaint(stars);\n int randomNum = randomGenerator.nextInt(20) + 10;\n for(int i = 0; i < randomNum; i++)\n {\n int randomX = randomGenerator.nextInt(1200);\n int randomY = randomGenerator.nextInt(280);\n g2.fillArc(randomX, randomY, 5,5,0,360);\n }\n g2.setPaint(main);\n g2.fillArc(xLeft,yTop,75,75,0,360);\n g2.setPaint(secondary);\n g2.fillArc(xLeft + 45, yTop + 10,10,10, 0, 360);\n g2.fillArc(xLeft + 20, yTop + 15,15,15, 0, 360);\n g2.fillArc(xLeft + 55, yTop + 50,10,10, 0, 360);\n g2.fillArc(xLeft + 35, yTop + 45,12,12, 0, 360);\n }", "private void draw() {\n this.player.getMap().DrawBackground(this.cameraSystem);\n\n //Dibujamos al jugador\n player.draw();\n\n for (Character character : this.characters) {\n if (character.getMap() == this.player.getMap()) {\n character.draw();\n }\n }\n\n //Dibujamos la parte \"superior\"\n this.player.getMap().DrawForeground();\n\n //Sistema de notificaciones\n this.notificationsSystem.draw();\n\n this.player.getInventorySystem().draw();\n\n //Hacemos que la cámara se actualice\n cameraSystem.draw();\n }", "@Override\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.PINK);\n\t\tg.fillRect(getx(), gety(), getwidth(), getheight());\n\t}", "void draw();", "public void drawPlayerDown(Graphics g, Player p) {\r\n g.setColor(Color.black);\r\n // head\r\n g.drawOval(p.positionX, p.positionY, 25, 25);\r\n // left arm \r\n g.drawLine(p.positionX + 5, p.positionY + 1, p.positionX - 16, p.positionY + 12);\r\n g.drawLine(p.positionX + 5, p.positionY + 23, p.positionX - 16, p.positionY + 12);\r\n // right arm\r\n g.drawLine(p.positionX + 19, p.positionY + 1, p.positionX + 41, p.positionY + 12);\r\n g.drawLine(p.positionX + 19, p.positionY + 23, p.positionX + 41, p.positionY + 12);\r\n // backpack\r\n g.drawRect(p.positionX + 2, p.positionY + 25 - 33, 22, 8);\r\n // gun\r\n g.drawLine(p.positionX - 7, p.positionY + 6 + 12, p.positionX + 22, p.positionY - 17 + 55);\r\n g.drawLine(p.positionX + 30, p.positionY + 6 + 12, p.positionX + 14, p.positionY - 37 + 90);\r\n }", "void draw(Graphics g){\n\t\t\tg.drawImage(GamePanel.rocketImg, x, y, width, height, null);\n\t\t}", "@Override\n\tpublic void paintObject(Graphics g) {\n\t\tg.setColor(this.color);\n\t\tGraphics2D g2d = (Graphics2D) g;\n\t\tg2d.setStroke(new BasicStroke(3));\n\t\tg2d.drawOval(x, y, width, height);\n\t\tg2d.fillOval(x, y, width, height);\n\t}", "private void DrawOval(GL gl, float x, float y, float size, float r, float g, float b) {\n\t\t// Degeneracy = do not want\n\t\tif (m_length == 0.0f || m_width == 0.0f) {\n\t\t\treturn;\n\t\t}\n\n\n\t\t////int mct = (int) (1 / this.GetPEngine().m_uniscale);\n\t\t////mct = (mct / 2) / 100 * 100;\n\t\tgl.glPushMatrix();\n\t\tfloat theta = (float) Math.toRadians(m_slope);\n\t\t// Draw our line:\n\t\tgl.glLineWidth(2.0f);\n\n\t\tif (Iteration != 0) {\n\t\t\tfor (int i = 0; i < Iteration; i++) {\n\n\n\t\t\t\tif ((m_slope >= 0 && m_slope <= 45) || (m_slope >= 315 && m_slope <= 360)) {\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (0 + i * 200) * ((float) Math.cos(theta)), 100 + y_Start * 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (-50 + i * 200) * ((float) Math.cos(theta)), 100 + y_Start * 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\n\t\t\t\t\tgl.glEnd();\n\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (-100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (-100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (-50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + -20 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (40 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 20 + (40 + i * 200) * ((float) Math.sin(theta)));\n\n\n\n\t\t\t\t\tgl.glEnd();\n\t\t\t\t} else if ((m_slope >= 135 && m_slope < 225)) {\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + 100 + (50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (-100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 - 100 + (-100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + (-50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 - 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\n\n\t\t\t\t\tgl.glEnd();\n\n\t\t\t\t} else if (m_slope > 45 && m_slope < 135) {\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + -100 + (100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + -100 + (50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (-50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\n\t\t\t\t\tgl.glEnd();\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 - 100 + (-100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 - 100 + (-50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 20 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + -20 + (40 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (40 + i * 200) * ((float) Math.sin(theta)));\n\n\n\n\t\t\t\t\tgl.glEnd();\n\t\t\t\t} else {\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (-100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (-50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 - 100 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 - 100 + (50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (50 + i * 200) * ((float) Math.sin(theta)));\n\n\t\t\t\t\tgl.glEnd();\n\t\t\t\t\tgl.glBegin(gl.GL_QUAD_STRIP);\n\t\t\t\t\t// Draw x- and y-axes:\n\t\t\t\t\tgl.glColor3f(0.0f, 0.0f, 0.0f);\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (100 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (100 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 100 + (50 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (50 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 - 20 + (0 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (0 + i * 200) * ((float) Math.sin(theta)));\n\t\t\t\t\tgl.glVertex2d(x_Start * 100 + 20 + (-40 + i * 200) * ((float) Math.cos(theta)), y_Start * 100 + (-40 + i * 200) * ((float) Math.sin(theta)));\n\n\n\n\t\t\t\t\tgl.glEnd();\n\n\t\t\t\t}\n\n\t\t\t\tgl.glPopMatrix();\n\t\t\t}\n\t\t}\n\t}", "public void draw(Graphics g){\n\n g.setColor(Color.red);\n g.drawLine(x1,y1,x2,y2);\n g.drawLine(x2,y2,x3,y3);\n g.drawLine(x3,y3,x1,y1);\n g.setFont(new Font(\"Courier\", Font.BOLD, 12));\n DecimalFormat fmt = new DecimalFormat(\"0.##\"); \n g.setColor(Color.blue);\n g.drawString(fmt.format(perimeter()) + \" \" + name,x1+2 , y1 -2);\n \n }", "public void draw() {\n\n }", "private void drawRunway(Graphics2D g2){\n\t\t// Get the start and end X.\n\t\tint startX = Math.min(toScaledX(0), toScaledX(getDefaultTORA()));\n\t\tint endX = Math.max(toScaledX(0), toScaledX(getDefaultTORA()));\n\t\t// Create the rectangle shape.\n\t\tRectangle run = new Rectangle\n\t\t\t\t(\t\n\t\t\t\t\t\tstartX,\t\t// x coordinate \n\t\t\t\t\t\ttoScaledY(0) , // y coordinate\n\t\t\t\t\t\tendX-startX, //width of runway\n\t\t\t\t\t\tverticalRunwayHeight\n\t\t\t\t);\n\t\t// Draw the runway area.\n\t\tif( isUsingTextures() ){\n\t\t\tg2.setPaint( tarmacTexture );\n\t\t}else{\n\t\t\tg2.setPaint( ColourSchema.tarmac );\n\t\t}\n\t\tg2.fill(run);\n\t\t\n\t\t// Draw the stopway in the current direction.\n\t\tfloat facing_stopway_length = getFacingStopway();\n\t\tRectangle facing_stopway = new Rectangle(\n\t\t\t\t\tendX,\n\t\t\t\t\ttoScaledY(0) , // y coordinate\n\t\t\t\t\tscaleAbsX(facing_stopway_length), //width of runway\n\t\t\t\t\tverticalRunwayHeight-5 //height of runway\t\n\t\t);\n\t\tif( isUsingTextures() ){\n\t\t\tg2.setPaint( stopwayTexture );\n\t\t}else{\n\t\t\tg2.setPaint(ColourSchema.stopway);\n\t\t}\n\t\tg2.fill(facing_stopway);\n\t\t\n\t\t// Draw the stopway in the opposite direction.\n\t\tfloat opposite_stopway_length = getOppositeDirectionStopway();\n\t\tRectangle opposite_stopway = new Rectangle(\n\t\t\t\t\tstartX-scaleAbsX(opposite_stopway_length),\n\t\t\t\t\ttoScaledY(0), // y coordinate\n\t\t\t\t\tscaleAbsX(opposite_stopway_length), //width of runway\n\t\t\t\t\tverticalRunwayHeight-5 //height of runway\t\n\t\t);\n\t\tif( isUsingTextures() ){\n\t\t\tg2.setPaint( stopwayTexture );\n\t\t}else{\n\t\t\tg2.setPaint(ColourSchema.stopway);\n\t\t}\n\t\tg2.fill(opposite_stopway);\n\t}", "public void paintRoute(Graphics g, String[] ruteData, int begin, int end, int color) {\n //System.out.println(\"painting rute\");\n end += RUTE_FLOOR + 1;\n begin += RUTE_FLOOR + 1;\n if (begin > end || end > ruteData.length || begin < 0 || g == null || ruteData == null) {\n return;\n }\n g.setColor(color);\n //paint the rute\n int x = 0, y = 0, lastx = 0, lasty = 0, i = begin;\n int floor = Integer.parseInt(ruteData[RUTE_FLOOR]);\n for (; i < end; i++) {\n //System.out.println(ruteData[i]);\n point = getPoint(ruteData[i]);\n x = point[0] + currMatrixX + transformCoordenate(floor, X_COORD);\n y = point[1] + currMatrixY + transformCoordenate(floor, Y_COORD);\n //dot\n g.fillRoundRect(x - 5, y - 5, 10, 10, 5, 5);\n //line\n if (!(lastx == 0 && lasty == 0)) {\n g.drawLine(x - 1, y - 1, lastx - 1, lasty - 1);\n g.drawLine(x, y - 1, lastx, lasty - 1);\n g.drawLine(x - 1, y, lastx - 1, lasty);\n g.drawLine(x, y, lastx, lasty);\n g.drawLine(x, y + 1, lastx, lasty + 1);\n g.drawLine(x + 1, y, lastx + 1, lasty);\n g.drawLine(x + 1, y + 1, lastx + 1, lasty + 1);\n }\n lastx = x;\n lasty = y;\n //System.out.println(\"point \" + (i-begin) + \": \" + x + \",\" + y + \" floor \" + floor);\n }\n }", "public void Display() \n {\n float theta = velocity.heading() + PI/2;\n fill(175);\n stroke(0);\n pushMatrix();\n translate(pos.x,pos.y);\n rotate(theta);\n beginShape();\n vertex(0, -birdSize*2);\n vertex(-birdSize, birdSize*2);\n vertex(birdSize, birdSize*2);\n endShape(CLOSE);\n popMatrix();\n }", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "public void draw()\r\n {\r\n\tfinal GraphicsLibrary g = GraphicsLibrary.getInstance();\r\n\t_level.draw(g);\r\n\t_printText.draw(\"x\" + Mario.getTotalCoins(), 30, _height - 36, false);\r\n\t_printText.draw(\"C 000\", _width - 120, _height - 36, false);\r\n\t_printText.draw(Mario.getLives() + \"UP\", 240, _height - 36, false);\r\n\t_printText.draw(Mario.getPoints() + \"\", 400, _height - 36, false);\r\n\t_coin.draw();\r\n\t_1UP.draw();\r\n }", "Rover(){\n\t\tthis.id = 0;\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.orientation = Directions.NORTH;\n\t\tthis.mapW=this.defaultMapW;\n\t\tthis.mapH=this.defaultMapH;\n\t}", "private void redrawLines()\n {\n for(int i =0; i<currentRide;i++)\n {\n rides[i].moveTogether(650,60 + 40*i);//move all elemetnts of ride lines\n \n }\n }", "void draw(Graphics2D g2d) {\n this.golfBall.draw(g2d);\n if (this.golfBall.stopped) {\n this.arrow.draw(g2d);\n }\n }", "@Override\r\n\tpublic String moveRight() {\n\t\tif((0<=x && x<50) && (0<=y && y<=10) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (40<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=10))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<10) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (40<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((40<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\treturn getFormatedCoordinates();\r\n\t}", "@Override\n\tpublic void draw(Graphics2D graphics) {\n\t\tdrawRays(graphics);\n\t\t\n\t\t//Debug Info\n\t\tif(r_debug) {\n\t\t\tgraphics.setColor(Color.RED);\n\t\t\tgraphics.drawString(posxString + eye.position.getX(), 10, 20);\n\t\t\tgraphics.drawString(posyString + eye.position.getY(), 10, 35);\n\t\t\tgraphics.drawString(angleString + eye.angle, 10, 50);\n\t\t}\n\t\t\n\t\t//Let's increment our frame-count.\n\t\tframeCount++;\n\t}", "public void draw(Graphics g){\r\n\r\n /*\r\n we want to create 2D graphics for better performance\r\n g.create() will create a new reference so that we don't use the old one and create problems\r\n */\r\n\r\n Graphics2D graphics2D = (Graphics2D)g.create();\r\n\r\n //this makes graphics more smooth\r\n graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n\r\n //this rotates the obstacle to that angle and it rotates around a position around its own\r\n graphics2D.rotate(Math.toRadians(angle),getXPosition(),getYPosition());\r\n\r\n //set the color and draw the object frame into the screen\r\n graphics2D.setColor(getFrame().getColor());\r\n graphics2D.fill(getFrame().getModel());\r\n\r\n //set the color and draw the object into the screen\r\n graphics2D.setColor(getColor());\r\n graphics2D.fill(getModel());\r\n\r\n //in order to not use too much memory, and because we don't need it any more, we will dispose the graphics object\r\n graphics2D.dispose();\r\n\r\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "public void draw(Graphics g){\n g.setColor(c);\n if (this.fill){\n g.fillOval(x, y, width, height);\n }else{\n g.drawOval(x, y, width, height);\n }\n }", "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 draw(){\n textAlign(CENTER);\n route.update(pp, qq);\n SoundSys();\n fill(0xff31F0FF, 127);\n noStroke();\n ellipse(mouseX, mouseY, 30, 30);\n}", "public void paint(Graphics g)\n {\n int X_x;\n int X_y;\n int Y_x;\n int Y_y;\n int Z_x;\n int Z_y;\n\n X_x = 0;\n X_y = 0;\n Y_x = 500;\n Y_y = 0;\n Z_x = 250;\n Z_y = 500;\n\n int currentX = X_x;\n int currentY = X_y;\n int targetX, targetY;\n int midwayX, midwayY;\n Random r = new Random();\n\n for(int i = 0; i < 10000; i++)\n {\n int random = r.nextInt(3);\n if(random == 0)\n {\n targetX = X_x;\n targetY = X_y;\n }\n else if(random == 1)\n {\n targetX = Y_x;\n targetY = Y_y;\n }\n else\n {\n targetX = Z_x;\n targetY = Z_y;\n }\n\n //halfway between\n currentX = (targetX + currentX) / 2;\n currentY = (targetY + currentY) / 2;\n g.drawLine(currentX, currentY, currentX, currentY);\n }\n }", "private void render()\n\t{\n\t\ttheta = (float) (velocity.heading() + Math.toRadians(90.0));\n\n\t\t// se baser sur le temps écoulé depuis le lancement\n\t\tf = parent.frameCount / 4;\n\t\tint fi = f + 1;\n\t\tfloat x = fi % DIM * W;\n\t\tfloat y = fi / DIM % DIM * H;\n\n\t\tparent.pushMatrix();\n\t\tparent.translate(location.x, location.y);\n\t\tparent.rotate(theta);\n\t\tparent.beginShape();\n\t\tparent.texture(spritesheet);\n\t\tparent.vertex(0, 0, x, y);\n\t\tparent.vertex(100, 0, x + W, y);\n\t\tparent.vertex(100, 100, x + W, y + H);\n\t\tparent.vertex(0, 100, x, y + H);\n\t\tparent.endShape();\n\t\tparent.popMatrix();\n\t}", "@Override\n\tpublic void paint(Graphics2D g) {\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawOval(this.x,this.y, width,height);\n\t\tg.fillOval(this.x,this.y, width,height);\n\t}" ]
[ "0.65932584", "0.6364227", "0.6351168", "0.63379395", "0.6307393", "0.62912095", "0.6289113", "0.6255174", "0.6225802", "0.60966164", "0.6010057", "0.59947604", "0.5976289", "0.59704924", "0.5961899", "0.59612954", "0.59359914", "0.5924763", "0.5909874", "0.590284", "0.5889983", "0.588767", "0.58800274", "0.5872567", "0.5854919", "0.58500385", "0.584763", "0.583635", "0.5835733", "0.5827436", "0.58240545", "0.58182716", "0.5816215", "0.5812022", "0.5807098", "0.5799434", "0.5799322", "0.5770742", "0.57696944", "0.57640153", "0.5760918", "0.5755374", "0.57384676", "0.5727266", "0.5725019", "0.5724346", "0.57158905", "0.57158905", "0.57158905", "0.57158905", "0.5710187", "0.57100946", "0.57072747", "0.5706924", "0.5701951", "0.5699706", "0.5694961", "0.5692062", "0.56728345", "0.5671325", "0.56712234", "0.5658806", "0.56583554", "0.5656194", "0.5655582", "0.5653464", "0.5648358", "0.5642569", "0.5640538", "0.5638847", "0.5638847", "0.5638847", "0.5635494", "0.5635133", "0.56344074", "0.5625688", "0.5623165", "0.56226003", "0.5621631", "0.5614291", "0.56093055", "0.560871", "0.5604194", "0.5602537", "0.55982006", "0.5589125", "0.55845124", "0.55826956", "0.5582554", "0.5581762", "0.5578911", "0.55786777", "0.557527", "0.5571409", "0.5571409", "0.5554058", "0.55525815", "0.5549398", "0.5548998", "0.5542988", "0.5541469" ]
0.0
-1
maxElement method This method accepts an array and a starting subscript as arguments. It returns the largest value in the array, starting at the specified subscript.
public static int maxElement(int[] array, int start) { int maxRemaining = 0; // compiler required initialization if (start == (array.length - 1)) { System.out.println("I just entered MaxElement with start at: " + start + " and maxRemaining at: " + maxRemaining); return array[start]; } else { maxRemaining = maxElement(array, start + 1); if (array[start] > maxRemaining) { System.out.println("I am in Array with start at: " + start + " maxRemaining at: " + maxRemaining + " array[start] at: " + array[start]); return array[start]; } else { System.out.println("I am in Array with start at: " + start + " maxRemaining at: " + maxRemaining + " array[start] at: " + array[start]); return maxRemaining; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int max(){\r\n int auxMax = array[0];\r\n for (int i=1;i<array.length;i++){\r\n if(array[i] > auxMax){\r\n auxMax = array[i];\r\n }\r\n }\r\n return auxMax;\r\n }", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }", "public int max()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tint maxNumber = array[0];\n\t\t\tfor (int index = 0; index < arraySize; index++) \n\t\t\t{\n\t\t\t\tif (array[index] > maxNumber)\n\t\t\t\t{\n\t\t\t\t\tmaxNumber = array[index];\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn maxNumber;\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "private static int max(int[] array) {\n int result = array[0];\n for (int x : array)\n result = Math.max(x, result);\n return result;\n }", "static int getMax(int[] array) {\n\n\t\tif (array.length > 6 && array.length < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"There is no that index in this array.\");\n\t\t}\n\t\tint max = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (max < array[i]) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\n\t}", "public static int findMax(int[] a) {\r\n int max = a[0];\r\n\r\n //10th error , n = 1\r\n for (int n = 1; n < a.length; n++) {\r\n if (a[n] > max) {\r\n max = a[n];\r\n }\r\n }\r\n return max;\r\n\r\n }", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }", "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "public static int max(int[] arr){\n return maxInRange(arr, 0, arr.length-1);\n }", "public static int max(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n\t\t\tif( m < a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "static double getMax(double[] array) {\n\t\tif (array.length < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Arrays start from index 0\");\n\t\t}\n\t\tdouble max = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (max < array[i]) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static int getMax(int[] array) {\n //TODO: write code here\n int max = array[0];\n for(int a : array) {\n max = a > max ? a : max;\n }\n return max;\n }", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "public int findMax(int[] arr) {\n return 0;\n }", "public static int getMaximum(int[] array) {\n int length = array.length;\n int max = array[0];\n for (int i = 1; i < length; i++) {\n if(max < array[i]) {\n max = array[i];\n }\n }\n\n Arrays.sort(array);\n// return array[length - 1];\n return max;\n }", "public static int maxValue(int [] array){\n int hold = array[0];\n for(int i = 1; i < array.length; i++){\n if(array[i] > hold){\n hold = array[i];\n }\n }\n return hold;\n }", "public int getMaxIndex(int[] paraArray) {\r\n\t\tint maxIndex = 0;\r\n\t\tint tempIndex = 0;\r\n\t\tint max = paraArray[0];\r\n\r\n\t\tfor (int i = 0; i < paraArray.length; i++) {\r\n\t\t\tif (paraArray[i] > max) {\r\n\t\t\t\tmax = paraArray[i];\r\n\t\t\t\ttempIndex = i;\r\n\t\t\t} // of if\r\n\t\t} // of for i\r\n\t\tmaxIndex = tempIndex;\r\n\t\treturn maxIndex;\r\n\t}", "public static int getMaxIndex(double[] array)\r\n\t{\r\n\t\tdouble max = Double.NEGATIVE_INFINITY;\r\n\t\tint maxIndex = 0;\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tif (max < array[i]) {\r\n\t\t\t\tmax = array[i];\r\n\t\t\t\tmaxIndex = i;\r\n\t\t\t}\r\n\t\treturn maxIndex;\r\n\t}", "public static int getIndexOfMax(double[] x) {\n Objects.requireNonNull(x, \"The supplied array was null\");\n int index = 0;\n double max = Double.MIN_VALUE;\n for (int i = 0; i < x.length; i++) {\n if (x[i] > max) {\n max = x[i];\n index = i;\n }\n }\n return (index);\n }", "public abstract int maxIndex();", "static public long max(long[] valarray) {\r\n long max = 0;\r\n for (long i : valarray) {\r\n if (i > max)\r\n max = i;\r\n }\r\n return max;\r\n }", "public static int arrayMax(int[] arr, int starting, int ending) {\n int ans = 0;\n for (int i = starting; i < ending; i++) {\n ans = Math.max(ans, arr[i]);\n }\n return ans;\n }", "public static void arrayMax(){\n int [] array={12,3,4,5,6,1,0,3};\n //using the for loop to iterate through the numbers in the array\n int max=array[0];\n int size=array.length;\n\n for(int i = 0; i<size; i++){\n if(array[i]>max){\n max=array[i];\n }\n }\n System.out.println(new StringBuilder().append(max).append(\": is the maximum number in the given array.\").toString());\n\n }", "public static int findMaxSubarray(int[] array) {\r\n\t\tint max = Integer.MIN_VALUE;\r\n//\t\tint index = 0;\r\n\t\tint currMax = 0;\r\n\t\tfor(int v : array) {\r\n\t\t\tcurrMax += v;\r\n\t\t\tif(currMax > max) {\r\n\t\t\t\tmax = currMax;\r\n\t\t\t} \r\n\t\t\tif(currMax < 0) {\r\n\t\t\t\tcurrMax = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "public static int maximo (int[] array) {\n\t\tint max = array[0], i;\n\t\t\n\t\tfor (i = 1; i < array.length; i++) {\n\t\t\tif (array[i] > max) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn max;\n\t}", "Object getMaximumValue(Object elementID) throws Exception;", "public int getIndexOfMaxNumber(int[] array) {\n\t\tint left = 0, right = array.length - 1;\n\t\twhile (left < right - 1) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\tif (array[mid - 1] > array[mid]) {\n\t\t\t\treturn mid - 1;\n\t\t\t}\n\t\t\tif (array[mid] > array[mid + 1]) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\t// up to this point,\n\t\t\t// mid == right || array[mid] < array[mid + 1] ||\n\t\t\t// mid == left || array[mid - 1] < array[mid]\n\t\t\tif (array[mid] <= array[left]) {\n\t\t\t\tright = mid;\n\t\t\t} else {\n\t\t\t\tleft = mid;\n\t\t\t}\n\t\t}\n\t\t// up to this point, left == right - 1;\n\t\treturn array[left] >= array[right] ? left : right;\n\t}", "public int calculateMaximumPosition() {\n\t\tdouble[] maxVal = { inputArray[0], 0 };\n\t\tfor (int i = 0; i < inputArray.length; i++) {\n\t\t\tif (inputArray[i] > maxVal[0]) {\n\t\t\t\tmaxVal[0] = inputArray[i];\n\t\t\t\tmaxVal[1] = i;\n\t\t\t}\n\t\t}\n\t\treturn (int) maxVal[1];\n\t}", "public static int max(int[] theArray) {\n\n int biggest = theArray[0];\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n //get the biggest by streaming the list and using min which gets the min value by using the Integer Comparator.comparing().\n //which means it will loop through the array and compare all the values for the biggest values\n biggest= values.stream().max(Integer::compare).get();\n\n// //Alternative code does the samething\n// for (int number : theArray) {\n//\n// if (biggest < number) {\n// biggest = number;\n// }\n// }\n\n return biggest;\n\n }", "public int maxSubArray(int[] A) {\n\t\tint n = A.length;\n\t\tint left = A[0];\n\t\tint max = A[0];\n\t\tfor (int i = 1; i < n; ++i) {\n\t\t\tif (left < 0)\n\t\t\t\tleft = A[i];\n\t\t\telse\n\t\t\t\tleft = left + A[i];\n\t\t\tmax = Math.max(max, left);\n\t\t}\n\t\treturn max;\n\t}", "public static int maxProductSubarray(int[] nums){\n int[] max= new int[nums.length];\n int[] min= new int[nums.length];\n int result=nums[0];\n max[0]=nums[0];min[0]=nums[0];\n for(int i=1;i<nums.length;i++) {\n if (nums[i] >= 0) {\n max[i] = Math.max(max[i - 1] * nums[i], nums[i]);\n min[i] = Math.min(min[i - 1] * nums[i], nums[i]);\n }\n //when the current number is negative ,the max number will be given\n //by multiplying current value with the min value so far\n //and the min will be obtained by applying with the most maximum value obtained\n //so far\n else {\n max[i] = Math.max(min[i - 1] * nums[i], nums[i]);\n min[i] = Math.min(max[i - 1] * nums[i], nums[i]);\n }\n result=Math.max(result,max[i]);\n }\n return result;\n }", "public int maxSubArray(int[] nums) {\n return helper(nums, 0, nums.length - 1);\n }", "public static <E extends Comparable<E>> E compare(E[] element){\n Arrays.sort(element);\n int length = element.length;\n E max = element[length -1];\n System.out.println(\"max\"+max); //std to give the max value\n return max;\n\n }", "public int maxSubArray(int[] nums) {\n int maxNow = Integer.MIN_VALUE, maxEnd = 0;\n for (int i = 0; i < nums.length; i++) {\n maxEnd = maxEnd + nums[i];\n if (maxNow < maxEnd) {\n maxNow = maxEnd;\n }\n if (maxEnd < 0) {\n maxEnd = 0;\n }\n }\n return maxNow;\n\n }", "private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }", "public static int indexOfMax(int[] array)\n {\n int max = array[0];\n int maxIndex = 0;\n for(int i = 1; i < array.length; i++)\n {\n if(array[i] > max)\n {\n max = array[i];\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "private static int maximumSubarray(int[] array) {\n\t\tint max = array[0];\n for (int i = 0; i < array.length; i++)\n {\n int sum = 0;\n for (int j = i; j < array.length; j++)\n {\n sum += array[j];\n if (sum > max)\n max = sum;\n }\n }\n return max; \n\t}", "static int findHighestNumber(int [] array){\n int highestNumber = array [0];\n for (int x=0; x< array.length; x++){\n if (highestNumber<array[x]){\n highestNumber=array[x];\n }\n }\nreturn highestNumber;\n}", "E maxVal();", "public static void main(String[] args) {\n int[] input = {-1};\n ArrayMaxSub arrayMaxSub = new ArrayMaxSub();\n int ret = arrayMaxSub.maxSubArray(input);\n System.out.println(\"ret : \" + ret);\n }", "public static int ArrayMax(int[] A, int n){\r\n int temp,max;\r\n // Se guarda el ultimo valor del arreglo\r\n max = A[n];\r\n \r\n if (n != 0){\r\n // Se almacena la siguiente posicion en temp\r\n temp = ArrayMax(A,n-1);\r\n // Si temp es mayopr entonces es el actual maximo\r\n if (temp > max){\r\n max = temp;\r\n }\r\n }\r\n return max;\r\n }", "@Override\n public int iamax(INDArray x) {\n return NativeBlas.isamax(x.length(), x.data(), x.offset(), x.stride()[0]) - 1;\n }", "include<stdio.h>\nint main()\n{\n int arr_size;\n scanf(\"%d\",&arr_size);\n int arr[10];\n // Get the array elements\n for(int idx = 0; idx <= arr_size - 1; idx++)\n {\n scanf(\"%d\",&arr[idx]);\n }\n // Get the searching element 1\n int max;\n if(arr[0]>arr[1])\n {\n max=arr[0];\n }\n else\n {\n max=arr[1];\n }\n \n for(int idx = 2; idx <= arr_size - 1; idx++)\n {\n if(max< arr[idx])\n {\n max= arr[idx];\n }\n }\n printf(\"%d\\n\",max);\n return 0;\n}", "public static int argmax(float[] array) {\n\t\tfloat max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static int argmax(double[] array) {\n\t\tdouble max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public int maxValue( int[ ] n ) {\n int max = Integer.MIN_VALUE;\n for(int each: n){\n if(each > max){\n max = each;\n }\n }\n return max;\n }", "public static void main(String[] args) {\n int[] nums = {24, 32, 1, 0, -57, 982, 446, 11, 177, 390, 2923, 7648, 242, 234, 1123, 875};\n int maxValue = nums[0];\n\n for(int i = 0; i < nums.length; i++) {\n if (nums[i] > maxValue) {\n maxValue = nums[i];\n }\n }\n System.out.println(\"Max Value in Array: \" + maxValue);\n }", "int max();", "public int getMax(){\n return tab[rangMax()];\n }", "public void findMax(int[] arr){\n int max = arr[0];\n for(int val : arr){\n if(max < val){\n max = val;\n }\n }\n System.out.println( \"Maximum values: \" + max );\n }", "@Override\n public int iamax(IComplexNDArray x) {\n return NativeBlas.icamax(x.length(), x.data(), x.offset(), 1) - 1;\n }", "private static int getMax(int[] original) {\n int max = original[0];\n for(int i = 1; i < original.length; i++) {\n if(original[i] > max) max = original[i];\n }\n return max;\n }", "public static int max(int[] mainArray) {\r\n\t\tint max1 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray[greaterThan]>mainArray[max1]) {\r\n\t\t\t\tmax1 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max1;\r\n\t}", "public int maxSubArray(final List<Integer> A) {\n int n = A.size();\n int ans = A.get(0),curr = A.get(0);\n \n for(int i=1;i<n;i++){\n curr = Math.max(A.get(i),A.get(i)+curr);\n ans = Math.max(curr,ans);\n }\n return ans;\n }", "public static void main(String[] args) {\nint arr[]=new int[] {10,20,36,50,30};\nint max=0,i;\nfor(i=0;i<arr.length;i++)\n{\n\tif(arr[i]>max)\n\t{\n\t\tmax=arr[i];\n\t}\n}\nSystem.out.println(max);\n\t}", "public static int max(int[] array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n int max = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n if(array[i] > max){\n max = array[i];\n }\n }\n return max;\n }", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "public static int getMax(int arr[], int n)\n {\n int mx = arr[0];\n for (int i = 1; i < n; i++)\n {\n if (arr[i] > mx)\n {\n mx = arr[i];\n }\n }\n return mx;\n }", "int getMaximum();", "public static int getMaxValue(int[] numberArray)\n\t{\n\t\tint maxValue = numberArray[0];\n\t\tfor (int i = 1; i < numberArray.length; i++)\n\t\t{\n\t\t\tif (numberArray[i] > maxValue)\n\t\t\t\tmaxValue = numberArray[i];\n\t\t}\n\t\treturn maxValue;\n\t}", "public int maxSubArray(int[] nums) {\n int[] dp = new int[nums.length];\n dp[0] = nums[0];\n int res = nums[0];\n for (int i = 1; i < nums.length; i++) {\n dp[i] = nums[i] + (dp[i - 1] < 0 ? 0 : dp[i - 1]);\n res = Math.max(res, dp[i]);\n }\n return res;\n }", "@Test\n void testMaxIntegerFullRange() {\n Integer[] array = {3,8,2,9,6,5,1};\n assertEquals(new Integer(9), Max.max(array,0,7));\n }", "public static double getMax(double[] arr) \n { \n double max = arr[0]; \n for(int i=1;i<arr.length;i++) \n { \n if(arr[i]>max) \n max = arr[i]; \n } \n return max; \n }", "public int maxSubArray(int[] nums) {\n\t\tint max;\n\n\t\tif (nums.length == 0)\n\t\t\tmax = 0;\n\t\telse {\n\t\t\tmax = nums[0];\n\n\t\t\tint curMax = nums[0];\n\t\t\tfor (int idxEnd = 1; idxEnd < nums.length; idxEnd++) {\n\t\t\t\tint curr = nums[idxEnd];\n\t\t\t\tcurMax = curMax + curr;\n\t\t\t\tif (curr > curMax) {\n\t\t\t\t\tcurMax = curr;\n\t\t\t\t}\n\n\t\t\t\tif (curMax > max) {\n\t\t\t\t\tmax = curMax;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\t\treturn max;\n\t}", "public Integer findLargestNumber() {\r\n\t\t// take base index element as largest number\r\n\t\tInteger largestNumber = numArray[0];\r\n\t\t// smallest number find logic\r\n\t\tfor (int i = 1; i < numArray.length; i++) {\r\n\t\t\tif (numArray[i] != null && numArray[i] > largestNumber) {\r\n\t\t\t\tlargestNumber = numArray[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t// return smallest number from the given array\r\n\t\treturn largestNumber;\r\n\t}", "public long findMax(long[] incomes) {\n long current_max_index = 0;\n long current_max = incomes[0];\n for (long income : incomes)\n if (current_max < income)\n current_max = income;\n return current_max;\n }", "private static int getMax(int[] arr, int i) {\n\t\tif (i == 0) {\n\t\t\treturn arr[0];\n\t\t}\n\t\treturn Math.max(getMax(arr,i-1),arr[i]);\n\t}", "public int maxSubArray(int[] nums) {\n int maxValue = Integer.MIN_VALUE;\n int currentSum = 0;\n for(int i = 0; i < nums.length;i++){\n currentSum = Math.max(currentSum + nums[i],nums[i]);\n maxValue = Math.max(maxValue,currentSum);\n }\n return maxValue;\n }", "int arraykey(int max);", "public static int getMax(float[][] storage) {\n float []arr=new float[WINDOW];\n for (int i = 0;i<WINDOW;i++){\n arr[i]=storage[i][1];\n }\n\n if(arr==null||arr.length==0){\n return 0;//如果数组为空 或者是长度为0 就返回null\n }\n int maxIndex=0;//假设第一个元素为最小值 那么下标设为0\n int[] arrnew=new int[2];//设置一个 长度为2的数组 用作记录 规定第一个元素存储最小值 第二个元素存储下标\n for(int i =0;i<arr.length-1;i++){\n if(arr[maxIndex]<arr[i+1]){\n maxIndex=i+1;\n }\n }\n arrnew[0]=(int)arr[maxIndex];\n arrnew[1]=maxIndex;\n\n return arrnew[0];\n }", "public static int maxValue(int[] numArr) {\r\n\t\tint temp = numArr[0] > numArr[1] ? numArr[0] : numArr[1];\r\n\t\tfor (int i = 2; i < numArr.length; i++) {\r\n\t\t\ttemp = temp > numArr[i] ? temp : numArr[i];\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public static <T extends Comparable<T>> int findMaxIndex(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n return findMaxIndexInRange(arr, arr.length);\n }", "public static void main(String[] args) {\n MaximumSubarray subarray = new MaximumSubarray();\n int[] data = {-2,1,-3,4,-1,2,1,-5,4};\n System.out.println(subarray.maxSubArray(data));\n }", "int getMax();", "public static int getMax(int[] scores) {\r\n\t\r\n\t\tint temp = scores[0];\r\n\t\tfor(int i = 1; i < scores.length; ++i) {\r\n\t\t\r\n\t\t\tif (scores[i] > temp) {\r\n\t\t\t\ttemp = scores[i];\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn temp;\r\n\t\r\n\t}", "int getMax( int max );", "public static double max(double[] v) {\n double max = v[0];\n for (int ktr = 0; ktr < v.length; ktr++) {\n if (v[ktr] > max) {\n max = v[ktr];\n }\n }\n return max;\n}", "public static <T extends Comparable<T>> T findMax(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n\n T max = arr[0];\n for (int i = 1; i < arr.length; i++) {\n max = MathUtils.max(arr[i], max);\n }\n return max;\n }", "@In Integer max();", "@In Integer max();", "public static int findMax(Integer[] X, int low, int high)\n\t\t{if (low + 1 > high) {return X[low];}\n\t\telse {return Math.max(Math.abs(X[low]), Math.abs(findMax(X, low + 1, high)));}\n\t\t}", "public int heapExtractMax(){\n\t\tint max = a[0];\t\n\t\ta[0] = a[n-1];\n\t\ta[n-1] = Integer.MIN_VALUE;\n\t\tn--;\n\t\tmaxHeapfy(0);\t\t\n\t\treturn max;\n\t}", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "public static double max(double[] array) {\n\t\tif (array.length==0) return Double.NEGATIVE_INFINITY;\n\t\tdouble re = array[0];\n\t\tfor (int i=1; i<array.length; i++)\n\t\t\tre = Math.max(re, array[i]);\n\t\treturn re;\n\t}", "public int maxSubArray(int[] nums) {\n if (nums == null || nums.length == 0) return 0;\n int max = Integer.MIN_VALUE, min = 0;\n int sum = 0;\n for (int i = 0; i < nums.length; i++){\n sum += nums[i];\n max = Math.max(max, sum - min);\n min = Math.min(min, sum);\n }\n return max;\n }", "private int maxIndex(int[] values){\n int curMaxIndex = 0;\n int curMax = values[0];\n for(int i = 1; i < values.length; i++){\n if(values[i] > curMax){\n curMaxIndex = i;\n curMax = values[i];\n }\n }\n return curMaxIndex;\n }", "public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}", "public static void main(String[] args) {\n\t\tint[] nums = {-2,1,-3,4,-1,2,1,-5,4} ;\n\t\t\n\t\tSolution_Maximum_Subarray_53 s = new Solution_Maximum_Subarray_53() ;\n\t\tint ans = s.maxSubArray(nums) ;\n\t\t\n\t\tSystem.out.println(\"ans: \" + ans) ;\n\t}", "private static int findMaxInArr(int[] arr) {\n\n\t\tint max = arr[0];\n\t\tfor (int elem : arr) {\n\t\t\tif (elem > max) {\n\t\t\t\tmax = elem;\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static void main(String[] args) {\n int[] arr = {123,100,200,345,456,678,89,90,10,56};\n Arrays.sort(arr);\n System.out.println(Arrays.toString(arr));\n int lastIndex = arr.length-1;\n int secondIndexNUm =lastIndex-1; //arr.length-1-1;\n int secondMaxNum = arr[secondIndexNUm];\n System.out.println(secondMaxNum);\n\n int[]arr2 = {1,2,3,4,5,6};\n int num2 =secondMax(arr2);\n System.out.println(num2 );\n\n }", "private static int maxIndex(int[] vals) {\n \n int indOfMax = 0;\n int maxSoFar = vals[0];\n \n for (int i=1;i<vals.length;i++){\n \n if (vals[i]>maxSoFar) {\n maxSoFar = vals[i];\n indOfMax = i;\n }\n }\n \n return indOfMax;\n }", "public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }", "public static int findMax(int[] elements) {\n int max = 0;\n for (int i = 0; i < elements.length; i++) {\n int element = elements[i];\n\n if (element > max) {\n max = element;\n }\n }\n return max;\n }" ]
[ "0.7152972", "0.6977475", "0.6970452", "0.6880207", "0.6806094", "0.6760066", "0.6726266", "0.66858447", "0.66509175", "0.6640966", "0.66392034", "0.6622927", "0.6578592", "0.654514", "0.6533811", "0.6516847", "0.6489516", "0.64814496", "0.6478724", "0.6454999", "0.6451379", "0.64461815", "0.6431421", "0.6405544", "0.640246", "0.63954806", "0.6395117", "0.63896394", "0.6387756", "0.6374576", "0.6339698", "0.6335693", "0.6322608", "0.63071644", "0.63055706", "0.6285499", "0.6283783", "0.6276738", "0.62705284", "0.62671995", "0.6255195", "0.6250848", "0.6249894", "0.62389", "0.6237802", "0.62322783", "0.62276644", "0.6224374", "0.62142706", "0.6203058", "0.6201715", "0.62009484", "0.61663437", "0.6166195", "0.61504483", "0.6148717", "0.61464596", "0.6143446", "0.61286736", "0.6127438", "0.6126337", "0.6122402", "0.6121172", "0.6115596", "0.6113508", "0.6110852", "0.6110071", "0.609991", "0.60988456", "0.6098477", "0.6098064", "0.6091644", "0.6091255", "0.6079714", "0.60762143", "0.60751086", "0.6072105", "0.6068987", "0.6067051", "0.6059825", "0.6056008", "0.60503536", "0.60365933", "0.6026458", "0.6025201", "0.6024565", "0.6024565", "0.602297", "0.6011799", "0.5999294", "0.5998317", "0.5997874", "0.599757", "0.5978837", "0.5974366", "0.59671056", "0.5960443", "0.59526426", "0.5950924", "0.5946727" ]
0.65866995
12
Construct an RSA object with the given p, q, and e.
protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2) throws NullPointerException, IllegalArgumentException, ArithmeticException { if ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0) throw new IllegalArgumentException(); } else if (p.equals(q)) { // i.e., p == q throw new IllegalArgumentException(); } // (0 < p) && (0 < q) && (0 < e) && (p != q) // Set p and q. this.p = p; this.q = q; // Save p - 1 and ensure that it is positive. final BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1 if (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0 throw new IllegalArgumentException(); } // 0 < p - 1 // i.e., 1 < p // Save q - 1 and ensure that it is positive. final BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1 if (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0 throw new IllegalArgumentException(); } // 0 < q - 1 // i.e., 1 < q // Compute the value of Euler's totient function for the cipher modulus. final BigInteger phi = p_minus_1.multiply(q_minus_1); if (phi.compareTo(e) <= 0) { // i.e., phi <= e throw new IllegalArgumentException(); } // e < phi // Set n, e, and d. this.n = this.p.multiply(this.q); this.e = e; this.d = this.e.modInverse(phi); // Set dP, dQ, and qInv. this.dP = this.d.mod(p_minus_1); this.dQ = this.d.mod(q_minus_1); this.qInv = this.q.modInverse(this.p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException {\r\n\t\tif ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(e) <= 0) { // i.e., n <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(d) <= 0) { // i.e., n <= d\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n)\r\n\t\t// i.e., (0 < e) && (0 < d) && (max(e, d) < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = d;\r\n\t}", "public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(p, q, e, null, null);\r\n\t}", "protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(phi) <= 0) { // i.e., n <= phi\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi)\r\n\t\t// i.e., (0 < e) && (e < phi) && (phi < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\t}", "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException {\r\n\t\treturn new RSA(n, e, d);\r\n\t}", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "public RSAKeyPairGenerator() {\n }", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(phi, n, e, null);\r\n\t}", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "static public BigInteger bPrivateKey(BigInteger e, BigInteger p, BigInteger q)\n {\n return Utils.bigModInverse(e, RSA.bPhi(p, q));\n }", "public GenRSAKey() {\n initComponents();\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "public QPEvent(Event event) {\n this.eventName = event.getEventName();\n this.eventTime = event.getEventTime();\n this.eventType = event.getEventType();\n this.parameters = event.getParameters();\n this.unitId = event.getUnitId();\n if (event.getParameters() != null) {\n for (String key : event.getParameters().keySet()) {\n this.setParameter(key, event.getParameters().get(key));\n }\n }\n }", "public RSAESOAEPparams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void\");\n }", "public SmppException(Exception e) {\n\t\tsuper(e);\n\t}", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "P createP();", "public PriQOverflowException() {\n\t}", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "public ECP getPublicEphemeralKey(){return epk;}", "public ECKey() {\n this(secureRandom);\n }", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "public Nodo(Elemento e, Nodo<Elemento> p) {\n\t\tthis.proximo = p;\n\t\tthis.elemento = e;\n\t}", "private static BigInteger generatePFactor(\n Random randomSeed,\n SComplexity complexity,\n int certainty,\n BigInteger q) {\n long time = System.nanoTime();\n BigInteger m;\n BigInteger mR;\n BigInteger p = null;\n int step = 0;\n while ((step++) < MAX_STEPS) {\n m = new BigInteger(complexity.getPBitLength(), randomSeed);\n mR = m.mod(q.multiply(MathUtils.INTEGER_2));\n p = m.subtract(mR).add(BigInteger.ONE);\n if (p.isProbablePrime(certainty)) {\n LOGGER.info(\n String.format(\n \"Generated p number, took=%dms\\nq=%s\",\n TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - time),\n p.toString(RADIX)\n )\n );\n break;\n }\n }\n return p;\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub) {\n return new ECKey(priv, pub);\n }", "public Potencia(int b, int e){\n base = b;\n expo = e;\n pot = (int)Math.pow(b, e);\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "public PQR() {}", "public MersennePrimeStream(){\n super();\n }", "private EventProducer createProducer(long anAddress, int ppid) {\n\t\treturn createProducer(String.valueOf(anAddress), ppid);\n\t}", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public PAES(Problem problem) {\r\n\t\tsuper(problem);\r\n\t}", "protected abstract PlayerAuth createPlayerAuthObject(P params);", "public static void main(final String[] args) throws Exception {\n Security.addProvider(new BouncyCastleProvider());\n\n // --- setup key pair (generated in advance)\n final String passphrase = \"owlstead\";\n final KeyPair kp = generateRSAKeyPair(1024);\n final RSAPublicKey rsaPublicKey = (RSAPublicKey) kp.getPublic();\n final RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) kp.getPrivate();\n\n // --- encode and wrap\n byte[] x509EncodedRSAPublicKey = encodeRSAPublicKey(rsaPublicKey);\n final byte[] saltedAndEncryptedPrivate = wrapRSAPrivateKey(\n passphrase, rsaPrivateKey);\n\n // --- decode and unwrap\n final RSAPublicKey retrievedRSAPublicKey = decodeRSAPublicKey(x509EncodedRSAPublicKey);\n final RSAPrivateKey retrievedRSAPrivateKey = unwrapRSAPrivateKey(passphrase,\n saltedAndEncryptedPrivate);\n\n // --- check result\n System.out.println(retrievedRSAPublicKey);\n System.out.println(retrievedRSAPrivateKey);\n }", "public MCMCSampleProducer(BayesianNetwork bn, Variable[] X, Variable[] Y, Variable[] E, int[] e) {\n super(bn, X, Y, E, e);\n this.generateResamplingActions();\n }", "public PublicKey reconstructPublicKey(\n byte[] identifyingInfo, byte[] reconstructionPoint, PublicKey qCa) throws IOException {\n // Reconstruct the point Pu from the reconstruction point\n ECPoint rPoint =\n ((BCECPublicKey) BouncyCastleProvider.getPublicKey(\n new SubjectPublicKeyInfo(algorithmId, reconstructionPoint))).getQ();\n BigInteger n = curveParameters.getN(); // curve point order\n ECPoint caPoint = ((BCECPublicKey) qCa).getQ(); // Massage caPublicKey bytes into ECPoint\n\n // Calculate H(Certu)\n for (byte b : identifyingInfo) {\n digest.update(b);\n }\n\n for (byte b : reconstructionPoint) {\n digest.update(b);\n }\n\n // Hash the implicit certificate Certu and compute the integer e from H(Certu)\n BigInteger e = calculateE(n, digest.digest()).mod(n);\n\n // compute the point Qu = ePu + Qca\n SubjectPublicKeyInfo publicKeyInfo =\n new SubjectPublicKeyInfo(algorithmId, rPoint.multiply(e).add(caPoint).getEncoded(false));\n\n return BouncyCastleProvider.getPublicKey(publicKeyInfo);\n }", "private BigInteger()\n {\n }", "private E() {}", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "public Pub build() {\n return new Pub(keyId, algo, keyLen, creationDate, expirationDate, flags);\n }", "public PGPPublicKey( \n int algorithm,\n PublicKey pubKey,\n Date time,\n String provider) \n throws PGPException, NoSuchProviderException\n {\n PublicKeyPacket pubPk;\n\n if (pubKey instanceof RSAPublicKey)\n {\n RSAPublicKey rK = (RSAPublicKey)pubKey;\n \n pubPk = new PublicKeyPacket(algorithm, time, new RSAPublicBCPGKey(rK.getModulus(), rK.getPublicExponent()));\n }\n else if (pubKey instanceof DSAPublicKey)\n {\n DSAPublicKey dK = (DSAPublicKey)pubKey;\n DSAParams dP = dK.getParams();\n \n pubPk = new PublicKeyPacket(algorithm, time, new DSAPublicBCPGKey(dP.getP(), dP.getQ(), dP.getG(), dK.getY()));\n }\n else if (pubKey instanceof ElGamalPublicKey)\n {\n ElGamalPublicKey eK = (ElGamalPublicKey)pubKey;\n ElGamalParameterSpec eS = eK.getParameters();\n \n pubPk = new PublicKeyPacket(algorithm, time, new ElGamalPublicBCPGKey(eS.getP(), eS.getG(), eK.getY()));\n }\n else\n {\n throw new PGPException(\"unknown key class\");\n }\n \n this.publicPk = pubPk;\n this.ids = new ArrayList();\n this.idSigs = new ArrayList();\n \n try\n {\n init();\n }\n catch (IOException e)\n {\n throw new PGPException(\"exception calculating keyID\", e);\n }\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "public GenEncryptionParams() {\n }", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "public NumberP(NumberP numberP)\n\t{\n\t\tif (numberP == null)\n\t\t{\n\t\t\tError = ErrorTypesNumber.InvalidInput;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBaseTenExponent = numberP.BaseTenExponent;\n\t\t\tValue = numberP.Value;\n\t\t\tOriginalString = numberP.OriginalString;\n\t\t\tConfig = new ParseConfig(numberP.Config);\n\t\t\tError = numberP.Error;\n\t\t}\n\t}", "public SmppException(String s, Exception e) {\n\t\tsuper(s, e);\n\t}", "public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\treturn new BigInteger(cipher.doFinal(message.toByteArray()));\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "public void calculateKeypair() {\n\n BigInteger nTotient = p.subtract(BigInteger.ONE).multiply(q.subtract(BigInteger.ONE));\n\n ExtendedEuclideanAlgorithm eea = new ExtendedEuclideanAlgorithm();\n d = eea.calculateEea(nTotient, e);\n\n while(d.signum() == -1) d = d.add(nTotient);\n\n sbPrivate.append(\"(\");\n sbPrivate.append(n.toString());\n sbPrivate.append(\",\");\n sbPrivate.append(d.toString());\n sbPrivate.append(\")\");\n\n sbPublic.append(\"(\");\n sbPublic.append(n.toString());\n sbPublic.append(\",\");\n sbPublic.append(e.toString());\n sbPublic.append(\")\");\n\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "public BigInteger getP() {return(p);}", "PEKSInitial() {\n\t\tprimeP = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tprimeQ = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tgenerator = new BigInteger(512, new Random());// a 512 bit number, may\n\t\t \t\t\t\t\t\t\t\t\t\t// not prime\n\t\tprimeM = primeP.multiply(primeQ);// compute m=p*q\n\t\tfainM = (primeP.subtract(BigInteger.ONE)).multiply(primeQ\n\t\t\t\t.subtract(BigInteger.ONE));// eluer function of m\n\t\t//keyVector.add(generator);\n\t\t//File outputFile = new File(\"Data Records\\\\123456.txt\");\n\t\t//ht.put(generator,outputFile.getAbsolutePath());\n\t}", "public ECKey build() {\n\n\t\t\ttry {\n\t\t\t\tif (d == null && priv == null) {\n\t\t\t\t\t// Public key\n\t\t\t\t\treturn new ECKey(crv, x, y, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (priv != null) {\n\t\t\t\t\t// PKCS#11 reference to private key\n\t\t\t\t\treturn new ECKey(crv, x, y, priv, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\n\t\t\t\t// Public / private key pair with 'd'\n\t\t\t\treturn new ECKey(crv, x, y, d, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tthrow new IllegalStateException(e.getMessage(), e);\n\t\t\t}\n\t\t}", "public PublicKey getKey(\n String provider)\n throws PGPException, NoSuchProviderException\n {\n KeyFactory fact;\n \n try\n {\n switch (publicPk.getAlgorithm())\n {\n case RSA_ENCRYPT:\n case RSA_GENERAL:\n case RSA_SIGN:\n RSAPublicBCPGKey rsaK = (RSAPublicBCPGKey)publicPk.getKey();\n RSAPublicKeySpec rsaSpec = new RSAPublicKeySpec(rsaK.getModulus(), rsaK.getPublicExponent());\n \n fact = KeyFactory.getInstance(\"RSA\", provider);\n \n return fact.generatePublic(rsaSpec);\n case DSA:\n DSAPublicBCPGKey dsaK = (DSAPublicBCPGKey)publicPk.getKey();\n DSAPublicKeySpec dsaSpec = new DSAPublicKeySpec(dsaK.getY(), dsaK.getP(), dsaK.getQ(), dsaK.getG());\n \n fact = KeyFactory.getInstance(\"DSA\", provider);\n \n return fact.generatePublic(dsaSpec);\n case ELGAMAL_ENCRYPT:\n case ELGAMAL_GENERAL:\n ElGamalPublicBCPGKey elK = (ElGamalPublicBCPGKey)publicPk.getKey();\n ElGamalPublicKeySpec elSpec = new ElGamalPublicKeySpec(elK.getY(), new ElGamalParameterSpec(elK.getP(), elK.getG()));\n \n fact = KeyFactory.getInstance(\"ElGamal\", provider);\n \n return fact.generatePublic(elSpec);\n default:\n throw new PGPException(\"unknown public key algorithm encountered\");\n }\n }\n catch (PGPException e)\n {\n throw e;\n }\n catch (Exception e)\n {\n throw new PGPException(\"exception constructing public key\", e);\n }\n }", "BigInteger getCEP();", "public Enigma(){ \r\n randNumber = new Random(); \r\n }", "EnigmaException(String msg) {\n super(msg);\n }", "public EnigmaMachine()\n\t{\n\t\t//Instantiating a plugboard inside the enigma\n\t\tplugboard = new Plugboard();\n\t\t//Instantiating the three rotors of the enigma\n\t\trotors = new BasicRotor[3];\n\t}", "public EnScrypt() {}", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "public T participationPublicKeyBase64(String pk) {\n this.votePK = new ParticipationPublicKey(Encoder.decodeFromBase64(pk));\n return (T) this;\n\n }", "protected AbstractEvent(long t, EventEngine eng, String p) {\n // this sets the public final variables: time and engine\n time = t;\n engine = eng;\n parameters = p;\n }", "Node(Object e, Node p, Node n) {\n element = e;\n previous = p;\n next = n;\n }", "public static void main(String[] args) throws IOException {\n RSAServer server = new RSAServer();\n server.run();\n }", "public void testPubliKeyField() throws Exception {\r\n // Create new key pair\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n\r\n PublicKeyRSA rsa1 = (PublicKeyRSA)KeyFactory.createInstance(keyPair.getPublic(), \"SHA1WITHRSA\", null);\r\n byte[] der = rsa1.getEncoded();\r\n\r\n CVCObject cvcObj = CertificateParser.parseCVCObject(der);\r\n assertTrue(\"Parsed array was not a PublicKeyRSA\", (cvcObj instanceof PublicKeyRSA));\r\n\r\n RSAPublicKey rsaKey = (RSAPublicKey)keyPair.getPublic();\r\n\r\n RSAPublicKey rsa2 = (RSAPublicKey)cvcObj; // This casting should be successful\r\n assertEquals(\"Key modulus\", rsaKey.getModulus(), rsa2.getModulus());\r\n assertEquals(\"Key exponent\", rsaKey.getPublicExponent(), rsa2.getPublicExponent());\r\n assertEquals(\"Key algorithm\", \"RSA\", rsa2.getAlgorithm());\r\n \r\n PublicKeyRSA rsa3 = (PublicKeyRSA)rsa2;\r\n assertEquals(\"OIDs\", rsa1.getObjectIdentifier(), rsa3.getObjectIdentifier());\r\n }", "public Player(String name, String email, String address, long phone, int password, Playground_Registration pgr) {\n this.name = name;\n this.email = email;\n this.address = address;\n this.phone = phone;\n this.password = password;\n this.pgr = pgr;\n }", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "protected static LargeInteger computeE(int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \t\t// TODO check this\r\n \t\t// int length = Ne + 7;\r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\tLargeInteger E = LargeInteger.ONE;\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = new LargeInteger(\"2\").power(Ne);\r\n \t\t\tLargeInteger a = t.mod(pow);\r\n \t\t\tE = E.multiply(a);\r\n \t\t}\r\n \r\n \t\t// TODO\r\n \t\tSystem.out.println(\"E :\" + E);\r\n \r\n \t\treturn E;\r\n \t}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "BigInteger getEBigInteger();", "public static ECKey fromPublicOnly(byte[] pub) {\n return new ECKey(null, EccCurve.getCurve().decodePoint(pub));\n }", "public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public Circle(Point p, Point q, double r) {\n // TODO: Question 2.1\n\n }", "public Resume(Person p){\n this.p = p;\n ed = new ArrayList<>();\n ex = new ArrayList<>();}", "public PghModulo() {\r\n }", "public QPEvent() {}", "static EnigmaException error(String msgFormat, Object... arguments) {\n return new EnigmaException(String.format(msgFormat, arguments));\n }" ]
[ "0.78877956", "0.7425359", "0.7287999", "0.7283945", "0.71201235", "0.69375986", "0.6869221", "0.67876107", "0.67655766", "0.64109033", "0.6174885", "0.5951566", "0.5923638", "0.5910881", "0.5887429", "0.5844218", "0.58192194", "0.58170646", "0.5783346", "0.56916827", "0.5663268", "0.5536879", "0.54288846", "0.54267436", "0.5416127", "0.5381015", "0.5344564", "0.534083", "0.5310732", "0.5293966", "0.52310425", "0.5180608", "0.5167538", "0.5158482", "0.5144482", "0.5143019", "0.5127064", "0.50702065", "0.50491285", "0.5045642", "0.50381833", "0.5030686", "0.50147384", "0.5012811", "0.50072753", "0.49907622", "0.49899268", "0.4971027", "0.49666488", "0.4955871", "0.4946385", "0.49372417", "0.49347374", "0.49300253", "0.49260318", "0.49259177", "0.49228624", "0.49189615", "0.4916045", "0.49031824", "0.49002284", "0.48770073", "0.48624885", "0.48570278", "0.48490304", "0.4822053", "0.48159778", "0.48140633", "0.48034266", "0.48026118", "0.48011893", "0.47905818", "0.47840393", "0.47757846", "0.47666973", "0.47350228", "0.4720378", "0.4699677", "0.46966642", "0.46875829", "0.46829703", "0.46790767", "0.46737748", "0.46698746", "0.46633273", "0.46609274", "0.46549845", "0.46538335", "0.4647027", "0.46427992", "0.46394262", "0.4637672", "0.4635798", "0.4631547", "0.46218324", "0.4606173", "0.45995617", "0.45969394", "0.45946485", "0.45931733" ]
0.7731227
1
Construct an RSA object with the given phi, n, and e.
protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy) throws NullPointerException, IllegalArgumentException, ArithmeticException { if ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0) throw new IllegalArgumentException(); } else if (n.compareTo(phi) <= 0) { // i.e., n <= phi throw new IllegalArgumentException(); } else if (phi.compareTo(e) <= 0) { // i.e., phi <= e throw new IllegalArgumentException(); } // (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi) // i.e., (0 < e) && (e < phi) && (phi < n) // Set p, q, dP, dQ, and qInv. this.p = this.q = this.dP = this.dQ = this.qInv = null; // Set n, e, and d. this.n = n; this.e = e; this.d = this.e.modInverse(phi); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(phi, n, e, null);\r\n\t}", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException {\r\n\t\treturn new RSA(n, e, d);\r\n\t}", "protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException {\r\n\t\tif ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(e) <= 0) { // i.e., n <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(d) <= 0) { // i.e., n <= d\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n)\r\n\t\t// i.e., (0 < e) && (0 < d) && (max(e, d) < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = d;\r\n\t}", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (p.equals(q)) { // i.e., p == q\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < p) && (0 < q) && (0 < e) && (p != q)\r\n\r\n\t\t// Set p and q.\r\n\t\tthis.p = p;\r\n\t\tthis.q = q;\r\n\r\n\t\t// Save p - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1\r\n\t\tif (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < p - 1\r\n\t\t// i.e., 1 < p\r\n\t\t// Save q - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1\r\n\t\tif (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < q - 1\r\n\t\t// i.e., 1 < q\r\n\t\t// Compute the value of Euler's totient function for the cipher modulus.\r\n\t\tfinal BigInteger phi = p_minus_1.multiply(q_minus_1);\r\n\t\tif (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// e < phi\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = this.p.multiply(this.q);\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\r\n\t\t// Set dP, dQ, and qInv.\r\n\t\tthis.dP = this.d.mod(p_minus_1);\r\n\t\tthis.dQ = this.d.mod(q_minus_1);\r\n\t\tthis.qInv = this.q.modInverse(this.p);\r\n\t}", "public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(p, q, e, null, null);\r\n\t}", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "public RSAKeyPairGenerator() {\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "public GenRSAKey() {\n initComponents();\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "protected static LargeInteger computeE(int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \t\t// TODO check this\r\n \t\t// int length = Ne + 7;\r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\tLargeInteger E = LargeInteger.ONE;\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = new LargeInteger(\"2\").power(Ne);\r\n \t\t\tLargeInteger a = t.mod(pow);\r\n \t\t\tE = E.multiply(a);\r\n \t\t}\r\n \r\n \t\t// TODO\r\n \t\tSystem.out.println(\"E :\" + E);\r\n \r\n \t\treturn E;\r\n \t}", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "public Potencia(int b, int e){\n base = b;\n expo = e;\n pot = (int)Math.pow(b, e);\n }", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "public int gcd(int e, int phi) {\r\n if(e == 0)\r\n return phi; \r\n else\r\n return gcd(phi % e, e);\r\n }", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "E cos(final E n);", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "public String[] keyGen(){\n \n p1 = BigInteger.probablePrime(N / 2, random);\n p2 = BigInteger.probablePrime(N / 2, random);\n phi0 = (p1.subtract(one)).multiply(p2.subtract(one));\n \n BigInteger modulus = p1.multiply(p2);\n BigInteger privateKey = setPrivateKey(modulus);\n BigInteger publicKey = privateKey.modInverse(phi0);\n \n /* Retourne un tableau de 3 chaine de caractere contenant dans cette ordre */\n /* cle publique, modulus, cle prive */\n String tab[] = {publicKey + \"\", modulus + \"\", privateKey + \"\"};\n return tab;\n \n }", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "private Etapa nuevaEtapa(Etapa e) {\n if(debug) {\n System.out.println(\"**********************nuevaEtapa\");\n }\n \n Etapa ret = new Etapa();\n ret.i = e.i;\n ret.k = e.k+1;\n \n return ret;\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "static public BigInteger bPrivateKey(BigInteger e, BigInteger p, BigInteger q)\n {\n return Utils.bigModInverse(e, RSA.bPhi(p, q));\n }", "public Nodo(Elemento e, Nodo<Elemento> p) {\n\t\tthis.proximo = p;\n\t\tthis.elemento = e;\n\t}", "E sin(final E n);", "public Enigma(){ \r\n randNumber = new Random(); \r\n }", "E tan(final E n);", "public PghModulo() {\r\n }", "E atan(final E n);", "Nexo createNexo();", "public static int EulerPhi(int n) {\n\t\tif(n<1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tint amountOfCoPrimes = 0;\n\n\t\t// Check for every number smaller than n if they are relatively prime.\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif ( gcd(n, i) == 1)\n\t\t\t\tamountOfCoPrimes++;\n\t\t}\n\n\t\treturn amountOfCoPrimes;\n\t}", "public HypergeometricDistribution(int m, int r, int n){\n\t\tsetParameters(m, r, n);\n\t}", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "BigInteger getEBigInteger();", "E cot(final E n);", "E acos(final E n);", "Node(Object e, Node p, Node n) {\n element = e;\n previous = p;\n next = n;\n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "public PigHouse(int n){\r\n super(n,50, 17.5,50);\r\n }", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public RSAESOAEPparams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void\");\n }", "public static HugeUInt modPow(HugeUInt m, HugeUInt e, HugeUInt n) {\r\n \tHugeUInt two = new HugeUInt(2);\r\n \tHugeUInt one = new HugeUInt(1);\r\n \tHugeUInt zero = new HugeUInt(0);\r\n \tHugeUInt acc = one;\r\n \tif(e.compareTo(zero)==0){\r\n \t\treturn one;\r\n \t}\r\n \tHugeUInt c = one.multiply(m);\r\n \twhile(e.compareTo(one)>0){\r\n \t\tif(e.mod(two).compareTo(zero)==0){\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\telse if(e.mod(two).compareTo(one)==0){\r\n \t\t\tacc = acc.multiply(c).mod(n);\r\n \t\t\tc = c.multiply(c).mod(n);\r\n \t\t}\r\n \t\te = e.divide(two);\r\n \t}\r\n \treturn c.multiply(acc).mod(n);\r\n }", "public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }", "private BigInteger calculateE(BigInteger n, byte[] messageDigest) {\n // n.bitLength() == ceil(log2(n < 0 ? -n : n+1)\n // we actually want floor(log_2(n)) which is n.bitLength()-1\n int log2n = n.bitLength() - 1;\n int messageBitLength = messageDigest.length * 8;\n\n if (log2n >= messageBitLength) {\n return new BigInteger(1, messageDigest);\n } else {\n BigInteger trunc = new BigInteger(1, messageDigest);\n\n trunc = trunc.shiftRight(messageBitLength - log2n);\n\n return trunc;\n }\n }", "public static Long elevaARecursivoNoFinal(Integer exponente, Integer n) {\n\t\t\n\t\tLong resultado;\n\t\t\n\t\tif (n > 0) {\n\t\t\t\n\t\t\tresultado = elevaARecursivoNoFinal(exponente, (n / 2));\n\t\t\t\n\t\t\tif (n % 2 == 1) {\n\t\t\t\t\n\t\t\t\tresultado = ((resultado * resultado) * exponente);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresultado *= resultado;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tresultado = 1L;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn resultado;\n\t\t\n\t}", "public static boolean isProbablePrime(BigInteger n, int degreeOfCertainty) //The actual calculator\n\t{\n\t\t\t//The first two are special cases\n \t\tif (n.compareTo(ONE) == 0) //Is the number 1?\n \t\t\t return false; //Then it's not prime\n\n if (n.compareTo(THREE) < 0) //Is it less than 3?\n \t\t\t return true; //Then it is prime\n\n\t\t\t//Start the tough stuff, write n-1 = 2^s + d\n int s = 0;\n \t\tBigInteger d = n.subtract(ONE); //Start with d = n-1\n \t\twhile (d.mod(TWO).equals(ZERO)) //While still even\n\t\t\t{\n \t\t\ts++;\t//Increment exponent\n \t\t\td = d.divide(TWO); //Divide by 2\n \t\t}\n\n\t\t\t//Now choose k=degreeOfCertainty random numbers between 2 and n-2\n for (int i = 0; i < degreeOfCertainty; i++) //For each of those numbers\n\t\t\t{\n \t\t\tBigInteger a = uniformRandom(TWO, n.subtract(ONE)); //Assign it a value\n \t\t\tBigInteger x = a.modPow(d, n); //Calculate x = a^d mod n\n\n if (x.equals(ONE) || x.equals(n.subtract(ONE))) //If x=1 or x=n-1\n \t\t\t\t continue; //Stop here, move on to the next random number\n\n int r;\n \t\t\tfor (r=0; r < s; r++) //This part runs s-1 times\n\t\t\t\t\t{\n \t\t\t\tx = x.modPow(TWO, n); //Calculate (new) x = (old) x^2 mod n\n\n \t\t\t\tif (x.equals(ONE)) //If this new x=1\n \t\t\t\t\t return false;\t//The number is composite\n\n \t\t\t\tif (x.equals(n.subtract(ONE))) //If this new x=n-1\n \t\t\t\t\t break; //Stop here, move on to next random number\n \t\t\t}\n \t\t\tif (r == s) //If for some k, no r made x=n-1, n is composite\n \t\t\t\t return false;\n \t\t}\n \t\treturn true; //If we make it all the way here, n is probably prime\n\t}", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "public Primes(int n) {\n this.n = n;\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "public static Node<Token> makeNPiOverM(double n, double m) {\n Node<Token> piOverTwo = new Node<Token>(OperatorFactory.makeDivide());\n Node<Token> multiply = new Node<Token>(OperatorFactory.makeMultiply());\n\n multiply.addChild(new Node<Token>(new Number(n)));\n multiply.addChild(new Node<Token>(VariableFactory.makePI()));\n\n piOverTwo.addChild(multiply);\n piOverTwo.addChild(new Node<Token>(new Number(m)));\n\n return piOverTwo;\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public PermutationGenerator (int n) {\n\t\tif (n < 1 && n > 20) {\tthrow new IllegalArgumentException (\"PermutationGenerator can only accept argument n >= 1 && n <=20\"); }\n total = getFactorial(n);\n initialize(n);\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "public Inverse(int m, int n) \n { \n super(m, n); \n }", "PEKSInitial() {\n\t\tprimeP = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tprimeQ = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tgenerator = new BigInteger(512, new Random());// a 512 bit number, may\n\t\t \t\t\t\t\t\t\t\t\t\t// not prime\n\t\tprimeM = primeP.multiply(primeQ);// compute m=p*q\n\t\tfainM = (primeP.subtract(BigInteger.ONE)).multiply(primeQ\n\t\t\t\t.subtract(BigInteger.ONE));// eluer function of m\n\t\t//keyVector.add(generator);\n\t\t//File outputFile = new File(\"Data Records\\\\123456.txt\");\n\t\t//ht.put(generator,outputFile.getAbsolutePath());\n\t}", "public static ExPar create(String n) {\r\n\t\t// System.out.println(\"ExPar.create(): Trying to create parameter \" + n\r\n\t\t// + \" for the runtime table. \");\r\n\t\tExPar p = null;\r\n\t\tif (get(n, false) == null) {\r\n\t\t\tp = new ExPar(UNKNOWN, new ExParValueUndefined(), null);\r\n\t\t\truntimePars.put(n, p);\r\n\t\t}\r\n\t\t// System.out.println(\"ExPar.create(): Runtime Parameter \" + n +\r\n\t\t// \" created. \");\r\n\t\treturn (p);\r\n\t}", "public static ECDomainParameters NIST_B_571() {\n\t\tF2m.setModulus(571, 10, 5, 2, 0);\n\t\tECDomainParameters NIST_B_571 =\n\t\t\tnew ECDomainParameters(\n\t\t\t\t571,\n\t\t\t\t10,\n\t\t\t\t5,\n\t\t\t\t2,\n\t\t\t\tnew ECurveF2m(\n\t\t\t\t\tnew F2m(\"1\", 16),\n\t\t\t\t\tnew F2m(\"2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a\", 16)),\n\t\t\t\tnew BigInteger(\n\t\t\t\t\t\"3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703\",\n\t\t\t\t\t10),\n\t\t\t\tnew ECPointF2m(\n\t\t\t\t\tnew F2m(\"303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19\", 16),\n\t\t\t\t\tnew F2m(\"37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b\", 16)),\n\t\t\t\tBigInteger.valueOf(2));\n\t\treturn NIST_B_571;\n\t}", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public static DiffieHellman recreate(BigInteger privateKey, \n\t\t\t\t\t BigInteger modulus)\n {\n if (privateKey == null || modulus == null) {\n\t throw new IllegalArgumentException(\"Null parameter\");\n\t}\n\tDiffieHellman dh = new DiffieHellman();\n\tdh.setPrivateKey(privateKey);\n\tdh.setModulus(modulus);\n\treturn dh;\n }", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "Degree createDegree();", "public MersennePrimeStream(){\n super();\n }", "public static long nPr(int n, int r)\n throws IllegalArgumentException\n {\n if ((r > n) || (r < 0) || (n < 0))\n throw new IllegalArgumentException();\n long npr = 1;\n for (int p = n - r + 1; p <= n; p++)\n npr *= p;\n return npr;\n }", "public static void main(String[] args) throws IOException {\n RSAServer server = new RSAServer();\n server.run();\n }", "Persoana createPersoana(String nume, int varsta) {\n return new Persoana(nume, varsta);\n }", "public static Node<Token> makePiOverN(boolean negative, double n) {\n Node<Token> piOverTwo = new Node<Token>(OperatorFactory.makeDivide());\n Variable pi = VariableFactory.makePI();\n pi.setNegative(negative);\n piOverTwo.addChild(new Node<Token>(pi));\n piOverTwo.addChild(new Node<Token>(new Number(n)));\n return piOverTwo;\n }", "public Node(E e, Node<E> n) {\r\n this.element = e;\r\n this.next = n;\r\n }", "public static void main(String[] args) {\r\n\t\tUHEPRNG prng = new NumberHg();\r\n\r\n\t\tString key = prng.getKey(UHEPRNG.DEFAULT_KEY_LENGTH);\r\n\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t\tSystem.out.println(prng.generate(10000, key));\r\n\t}", "static BigInteger Product(int N) { \n BigInteger f = new BigInteger(\"1\"); \n for (int i = 2; i <= N; i++) \n f = f.multiply(BigInteger.valueOf(i)); \n \treturn f; \n }", "public Persona(String n,String a, byte e,\n String na,float s,Mascota[] masc){\n super(n,e);\n this.setApellido(a);\n this.setNacionalidad(na);\n this.setSaldo(s);\n this.setMascota(masc);\n }", "public void generateKeys()\n\t{\n\t\tmyP = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tmyQ = BigInteger.probablePrime(myView.getBitLength(), rand());\n\t\tif(confirmPrimes(myP, myQ))\n\t\t{\n\t\t\tpublicKey = myP.multiply(myQ);\n\t\t\tmyView.displayPublicKey(publicKey.toString());\n\t\t\tmyPhi = (myP.subtract(BigInteger.ONE).multiply(myQ.subtract(BigInteger.ONE)));\n\t\t\tprivateKey = E.modInverse(myPhi);\n\t\t\tmyView.displayPrivateKey(privateKey.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgenerateKeys();\n\t\t}\n\t}", "public Profesor (String apellidos, String nombre, String nif, Persona.sexo genero, int edad, int expediente){\n this.apellidos = apellidos;\n this.nombre = nombre;\n this.nif = nif;\n this.genero = genero;\n this.edad = edad;\n this.expediente = expediente;\n }", "private BigInteger()\n {\n }", "public Profesor(int _NoEmpleado) {\r\n\t\tsuper();\r\n\t\tthis._NoEmpleado = _NoEmpleado;\r\n\t}", "private Binomial(int n) {\n N = n;\n }", "@Override\r\n\tpublic RandomGenerator_Exponential clone() {\r\n\t\tRandomGenerator_Exponential rg = new RandomGenerator_Exponential();\r\n\t\trg.lambda=lambda;\r\n\t\treturn rg;\r\n\t}", "public Carta(String face, String naipe) {\r\n this.face = face; // inicializa face da carta\r\n this.naipe = naipe; // inicializa naipe da carta\r\n }", "E asin(final E n);", "public HEC_FibonacciSphere() {\n\t\tsuper();\n\t\tR = 1.0;\n\t\tN = 100;\n\t}", "public void setPhi(float phi) {\n this.phi = phi;\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public EnigmaMachine()\n\t{\n\t\t//Instantiating a plugboard inside the enigma\n\t\tplugboard = new Plugboard();\n\t\t//Instantiating the three rotors of the enigma\n\t\trotors = new BasicRotor[3];\n\t}" ]
[ "0.79891723", "0.7933818", "0.78176767", "0.7087877", "0.66707844", "0.6632001", "0.65703577", "0.6559237", "0.6360677", "0.6279198", "0.62572044", "0.6026164", "0.56115454", "0.5492514", "0.545918", "0.5406759", "0.540369", "0.5392061", "0.5351414", "0.5300528", "0.52051795", "0.5197485", "0.5191476", "0.51437324", "0.51427364", "0.5120891", "0.51184684", "0.5110772", "0.5096222", "0.5094", "0.50622016", "0.5059144", "0.50306654", "0.5005753", "0.49938783", "0.49536836", "0.49028042", "0.48906526", "0.48887858", "0.48626134", "0.4832648", "0.48266703", "0.4819792", "0.48163107", "0.4801665", "0.47985747", "0.4792729", "0.4777185", "0.4772312", "0.47553116", "0.47333285", "0.47075483", "0.46938685", "0.46671098", "0.46612865", "0.4621906", "0.462148", "0.4609947", "0.46068314", "0.460506", "0.45689526", "0.45586795", "0.4552922", "0.45513102", "0.454879", "0.45337555", "0.4526278", "0.45158616", "0.45147082", "0.4513746", "0.45042425", "0.44997692", "0.44936854", "0.44918525", "0.44826755", "0.44776434", "0.44668463", "0.44661033", "0.44646484", "0.44503087", "0.4438096", "0.44255683", "0.44250634", "0.4424815", "0.4413299", "0.44114193", "0.43993482", "0.43948415", "0.43941417", "0.43928763", "0.43918118", "0.43736425", "0.43724474", "0.43693072", "0.43677112", "0.43505085", "0.4346411", "0.43449488", "0.43348622", "0.43236" ]
0.7741673
3
Construct an RSA object with the given n, e, and d.
protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException { if ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0) throw new IllegalArgumentException(); } else if (n.compareTo(e) <= 0) { // i.e., n <= e throw new IllegalArgumentException(); } else if (n.compareTo(d) <= 0) { // i.e., n <= d throw new IllegalArgumentException(); } // (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n) // i.e., (0 < e) && (0 < d) && (max(e, d) < n) // Set p, q, dP, dQ, and qInv. this.p = this.q = this.dP = this.dQ = this.qInv = null; // Set n, e, and d. this.n = n; this.e = e; this.d = d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException {\r\n\t\treturn new RSA(n, e, d);\r\n\t}", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(phi) <= 0) { // i.e., n <= phi\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi)\r\n\t\t// i.e., (0 < e) && (e < phi) && (phi < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\t}", "protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (p.equals(q)) { // i.e., p == q\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < p) && (0 < q) && (0 < e) && (p != q)\r\n\r\n\t\t// Set p and q.\r\n\t\tthis.p = p;\r\n\t\tthis.q = q;\r\n\r\n\t\t// Save p - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1\r\n\t\tif (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < p - 1\r\n\t\t// i.e., 1 < p\r\n\t\t// Save q - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1\r\n\t\tif (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < q - 1\r\n\t\t// i.e., 1 < q\r\n\t\t// Compute the value of Euler's totient function for the cipher modulus.\r\n\t\tfinal BigInteger phi = p_minus_1.multiply(q_minus_1);\r\n\t\tif (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// e < phi\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = this.p.multiply(this.q);\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\r\n\t\t// Set dP, dQ, and qInv.\r\n\t\tthis.dP = this.d.mod(p_minus_1);\r\n\t\tthis.dQ = this.d.mod(q_minus_1);\r\n\t\tthis.qInv = this.q.modInverse(this.p);\r\n\t}", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(p, q, e, null, null);\r\n\t}", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(phi, n, e, null);\r\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public RSAKeyPairGenerator() {\n }", "public Persona(String n,String a, byte e,String d){\n this.nombre=n;\n this.apellido=a;\n this.edad=e;\n this.dni=d;\n }", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "public GenRSAKey() {\n initComponents();\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public EventPlanner(int N, double d) {\n this.N = N;\n this.d = d;\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "public ECKey build() {\n\n\t\t\ttry {\n\t\t\t\tif (d == null && priv == null) {\n\t\t\t\t\t// Public key\n\t\t\t\t\treturn new ECKey(crv, x, y, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (priv != null) {\n\t\t\t\t\t// PKCS#11 reference to private key\n\t\t\t\t\treturn new ECKey(crv, x, y, priv, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\n\t\t\t\t// Public / private key pair with 'd'\n\t\t\t\treturn new ECKey(crv, x, y, d, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tthrow new IllegalStateException(e.getMessage(), e);\n\t\t\t}\n\t\t}", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "public Fraction( int n, int d )\n\t{\tint gcd = gcd( n, d );\n\t\tsetNumer(n/gcd);\n\t\tsetDenom(d/gcd);\n\t}", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "private static String encode(String license,String D, String N) {\n int MAX_ENCRYPT_BLOCK = 128;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.ENCRYPT_MODE,privateKey);\n\n byte[] data = license.getBytes(StandardCharsets.UTF_8);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n System.out.println(\"datas:\"+datas.length);\n\n // byte[] datas = datas = cipher.doFinal(license.getBytes());\n datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }", "protected static LargeInteger computeE(int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \t\t// TODO check this\r\n \t\t// int length = Ne + 7;\r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\tLargeInteger E = LargeInteger.ONE;\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = new LargeInteger(\"2\").power(Ne);\r\n \t\t\tLargeInteger a = t.mod(pow);\r\n \t\t\tE = E.multiply(a);\r\n \t\t}\r\n \r\n \t\t// TODO\r\n \t\tSystem.out.println(\"E :\" + E);\r\n \r\n \t\treturn E;\r\n \t}", "public NumberP(NumberD numberD)\n\t{\n\t\tNumberD tempVar = Constructors.ExtractDynamicToNumberD(numberD);\n\n\t\tif (!tempVar.getError().equals(ErrorTypesNumber.None))\n\t\t{\n\t\t\tError = tempVar.getError();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBaseTenExponent = numberD.getBaseTenExponent();\n\t\t\tValue = numberD.getValue();\n\t\t\tConfig = new ParseConfig(numberD.getType());\n\t\t}\n\t}", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "public Nodo(Elemento e, Nodo<Elemento> p) {\n\t\tthis.proximo = p;\n\t\tthis.elemento = e;\n\t}", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public ECKey() {\n this(secureRandom);\n }", "private BigInteger calculateE(BigInteger n, byte[] messageDigest) {\n // n.bitLength() == ceil(log2(n < 0 ? -n : n+1)\n // we actually want floor(log_2(n)) which is n.bitLength()-1\n int log2n = n.bitLength() - 1;\n int messageBitLength = messageDigest.length * 8;\n\n if (log2n >= messageBitLength) {\n return new BigInteger(1, messageDigest);\n } else {\n BigInteger trunc = new BigInteger(1, messageDigest);\n\n trunc = trunc.shiftRight(messageBitLength - log2n);\n\n return trunc;\n }\n }", "public Persona(String NumeroId, String Nombre, String PrimerApellido, String SegundoApellido, int Edad, float Peso) \r\n {\r\n this.NumeroId = NumeroId;\r\n this.Nombre = Nombre;\r\n this.PrimerApellido = PrimerApellido;\r\n this.SegundoApellido = SegundoApellido;\r\n this.Edad = Edad;\r\n this.Peso = Peso;\r\n }", "public numero(char s, char d)\n {\n this.sign = s;\n this.raw_value = new char[1];\n this.raw_value[0] = d;\n }", "private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }", "public HypergeometricDistribution(int m, int r, int n){\n\t\tsetParameters(m, r, n);\n\t}", "public Profesor (String apellidos, String nombre, String nif, Persona.sexo genero, int edad, int expediente){\n this.apellidos = apellidos;\n this.nombre = nombre;\n this.nif = nif;\n this.genero = genero;\n this.edad = edad;\n this.expediente = expediente;\n }", "private BigInteger()\n {\n }", "public DebitCard(String n, int c, int p, Date e, Customer h, Provider p) {}", "public Nodo (String d, Nodo n){\n\t\tdato = d;\n\t\tsiguiente=n;\n\t}", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "public Node(D d, Node<D> n){\n\t\tdata = d;\n\t\tnext = n;\n\t}", "public Rational(int n, int d) {\n\tif ( d == 0 ) {\n\t System.out.println(\"Nope.\");\n\t numerator = 0;\n\t denominator = 1;\n\t}\n\telse {\n\t numerator = n;\n\t denominator = d;\n\t}\n }", "public void calculateKeypair() {\n\n BigInteger nTotient = p.subtract(BigInteger.ONE).multiply(q.subtract(BigInteger.ONE));\n\n ExtendedEuclideanAlgorithm eea = new ExtendedEuclideanAlgorithm();\n d = eea.calculateEea(nTotient, e);\n\n while(d.signum() == -1) d = d.add(nTotient);\n\n sbPrivate.append(\"(\");\n sbPrivate.append(n.toString());\n sbPrivate.append(\",\");\n sbPrivate.append(d.toString());\n sbPrivate.append(\")\");\n\n sbPublic.append(\"(\");\n sbPublic.append(n.toString());\n sbPublic.append(\",\");\n sbPublic.append(e.toString());\n sbPublic.append(\")\");\n\n }", "Nexo createNexo();", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub) {\n return new ECKey(priv, pub);\n }", "DomainNumber createDomainNumber();", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "public Node(E e, Node<E> n) {\r\n this.element = e;\r\n this.next = n;\r\n }", "private Noder(E data) {\n this.data = data;\n }", "public JogoDigital(String titulo, Double preco, int codigo) {\n super(titulo, preco);\n this.codigo = codigo;\n }", "public EmvDdaData(byte[] iccCert, byte[] iccPublicKeyRemainder, byte[] iccPublicKeyExponent, byte[] iccPublicKeyModulus,\n byte[] encryptedCrtP, byte[] encryptedCrtQ, byte[] encryptedCrtDP,\n byte[] encryptedCrtDQ, byte[] encryptedCrtU, byte[] encryptedPrivateExponent,\n byte[] encryptedModulus)\n {\n this.iccCert = iccCert;\n this.iccPublicKeyRemainder = iccPublicKeyRemainder;\n this.iccPublicExponent = iccPublicKeyExponent;\n this.iccPublicModulus = iccPublicKeyModulus;\n this.encryptedCrtP = encryptedCrtP;\n this.encryptedCrtQ = encryptedCrtQ;\n this.encryptedCrtDP = encryptedCrtDP;\n this.encryptedCrtDQ = encryptedCrtDQ;\n this.encryptedCrtU = encryptedCrtU;\n this.encryptedPrivateExponent = encryptedPrivateExponent;\n this.encryptedModulus = encryptedModulus;\n }", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "public Node(Key key, int N) {\n this.key = key;\n this.N = N;\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public InternalNode(int d, Node p0, int k1, Node p1, Node n, Node p) {\n\t\tsuper (d, n, p);\n\t\tptrs[0] = p0;\n\t\tkeys[1] = k1;\n\t\tptrs[1] = p1;\n\t\tlastindex = 1;\n\t\tif (p0 != null) {\n\t\t\tp0.setParent(new Reference (this, 0, false));\n\t\t}\n\t\tif (p1 != null) {\n\t\t\tp1.setParent(new Reference (this, 1, false));\n\t\t}\n\t}", "public static ECDomainParameters NIST_B_571() {\n\t\tF2m.setModulus(571, 10, 5, 2, 0);\n\t\tECDomainParameters NIST_B_571 =\n\t\t\tnew ECDomainParameters(\n\t\t\t\t571,\n\t\t\t\t10,\n\t\t\t\t5,\n\t\t\t\t2,\n\t\t\t\tnew ECurveF2m(\n\t\t\t\t\tnew F2m(\"1\", 16),\n\t\t\t\t\tnew F2m(\"2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a\", 16)),\n\t\t\t\tnew BigInteger(\n\t\t\t\t\t\"3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703\",\n\t\t\t\t\t10),\n\t\t\t\tnew ECPointF2m(\n\t\t\t\t\tnew F2m(\"303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19\", 16),\n\t\t\t\t\tnew F2m(\"37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b\", 16)),\n\t\t\t\tBigInteger.valueOf(2));\n\t\treturn NIST_B_571;\n\t}", "private Etapa nuevaEtapa(Etapa e) {\n if(debug) {\n System.out.println(\"**********************nuevaEtapa\");\n }\n \n Etapa ret = new Etapa();\n ret.i = e.i;\n ret.k = e.k+1;\n \n return ret;\n }", "ECNONet createECNONet();", "BigInteger getEBigInteger();", "Node(Object e, Node p, Node n) {\n element = e;\n previous = p;\n next = n;\n }", "public Nodo(Elemento e) {\n\t\tthis(e, null);\n\t}", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public InternalNode (int d, Node p0, String k1, Node p1, Node n, Node p){\n\n super (d, n, p);\n ptrs [0] = p0;\n keys [1] = k1;\n ptrs [1] = p1;\n lastindex = 1;\n\n if (p0 != null) p0.setParent (new Reference (this, 0, false));\n if (p1 != null) p1.setParent (new Reference (this, 1, false));\n }", "static public BigInteger bPrivateKey(BigInteger e, BigInteger p, BigInteger q)\n {\n return Utils.bigModInverse(e, RSA.bPhi(p, q));\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "public void testPubliKeyField() throws Exception {\r\n // Create new key pair\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n\r\n PublicKeyRSA rsa1 = (PublicKeyRSA)KeyFactory.createInstance(keyPair.getPublic(), \"SHA1WITHRSA\", null);\r\n byte[] der = rsa1.getEncoded();\r\n\r\n CVCObject cvcObj = CertificateParser.parseCVCObject(der);\r\n assertTrue(\"Parsed array was not a PublicKeyRSA\", (cvcObj instanceof PublicKeyRSA));\r\n\r\n RSAPublicKey rsaKey = (RSAPublicKey)keyPair.getPublic();\r\n\r\n RSAPublicKey rsa2 = (RSAPublicKey)cvcObj; // This casting should be successful\r\n assertEquals(\"Key modulus\", rsaKey.getModulus(), rsa2.getModulus());\r\n assertEquals(\"Key exponent\", rsaKey.getPublicExponent(), rsa2.getPublicExponent());\r\n assertEquals(\"Key algorithm\", \"RSA\", rsa2.getAlgorithm());\r\n \r\n PublicKeyRSA rsa3 = (PublicKeyRSA)rsa2;\r\n assertEquals(\"OIDs\", rsa1.getObjectIdentifier(), rsa3.getObjectIdentifier());\r\n }", "public static void main(final String[] args) throws Exception {\n Security.addProvider(new BouncyCastleProvider());\n\n // --- setup key pair (generated in advance)\n final String passphrase = \"owlstead\";\n final KeyPair kp = generateRSAKeyPair(1024);\n final RSAPublicKey rsaPublicKey = (RSAPublicKey) kp.getPublic();\n final RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) kp.getPrivate();\n\n // --- encode and wrap\n byte[] x509EncodedRSAPublicKey = encodeRSAPublicKey(rsaPublicKey);\n final byte[] saltedAndEncryptedPrivate = wrapRSAPrivateKey(\n passphrase, rsaPrivateKey);\n\n // --- decode and unwrap\n final RSAPublicKey retrievedRSAPublicKey = decodeRSAPublicKey(x509EncodedRSAPublicKey);\n final RSAPrivateKey retrievedRSAPrivateKey = unwrapRSAPrivateKey(passphrase,\n saltedAndEncryptedPrivate);\n\n // --- check result\n System.out.println(retrievedRSAPublicKey);\n System.out.println(retrievedRSAPrivateKey);\n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public static void main(String[] args) {\n generateKeys(\"DSA\", 1024);\n\n // Generate a 576-bit DH key pair\n generateKeys(\"DH\", 576);\n\n // Generate a 1024-bit RSA key pair\n generateKeys(\"RSA\", 1024);\n }", "public Empleado(String n, int ed, float es, float s){\r\n super(n, ed, es);\r\n this.sueldo=s;\r\n System.out.println(\"Constructor Empleado\");\r\n \r\n }", "public static ECKey fromPrivate(BigInteger privKey) {\n return fromPrivate(privKey, true);\n }", "protected static IGroupElement computeD(ArrayOfElements<IGroupElement> B,\r\n \t\t\tArrayOfElements<IGroupElement> h, int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\t// LargeInteger E = LargeInteger.ONE;\r\n \t\tLargeInteger e;\r\n \t\tIGroupElement tempH = h.getAt(0);\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = (new LargeInteger(\"2\")).power(Ne);\r\n \t\t\te = t.mod(pow);\r\n \t\t\ttempH = tempH.power(e);\r\n \t\t}\r\n \r\n \t\t//TODO printouts\r\n \t\tSystem.out.println(\"h0^pi(e) : \" + tempH);\r\n \r\n \t\tIGroupElement D = B.getAt(N - 1).divide(tempH);\r\n \t\treturn D;\r\n \t}", "public static X509V3CertificateGenerator GenerateSelfSignedCerteficate(X500Principal dnName1,X500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey, PrivateKey myprivateKey, KeyUsage Keyus ) throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t \n\n\t\t\t //certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new DERSequence(new DERObjectIdentifier(\"2.23.43.6.1.2\")));\n\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t certGen.setIssuerDN(dnName1); // use the same\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t // yesterday\n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t // in 2 years\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\n\t\t\t \n\t \treturn certGen;\n\t \t\n\t }", "public Persona(String n,String a, byte e,\n String na,float s,Mascota[] masc){\n super(n,e);\n this.setApellido(a);\n this.setNacionalidad(na);\n this.setSaldo(s);\n this.setMascota(masc);\n }", "private static String decode(String license,String E, String N) {\n int MAX_ENCRYPT_BLOCK = 256;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n\n /* license = \"etUdTQItPKlVrnPBX1A8zcaY+fcUll3Dn8E8yi0SvJ6WUQYzeOULSS6AcYWWQUJmHqIb0Fus4C7mMiOyHwJR5GAlBMSHFaPY04DSsskOQGn6e+T+np36TBGqVni8gGy6tiVAtMZoAI4cvMnhKdBje5O0k8JDYYGTSucF7GG7qEQ=\";\n E =\"65537\";\n N=\"93404748948314261182510261942864295898258175879892385978035344597790445446504317921638797307057942358993444530477227542470937133210636664882127277394224518895745377444518784380608860269975398795636906397601429785563717386132657879369166968560149045561478169342346120365085034049235188005429804012931375615719\";\n */\n\n\n E = \"65537\";\n license=\"O6cgtIkNkhvTrhfXgyi8xRUEZWYMK9QzjTxQ7SolNgUJA9yNJtAFTEdLXsr8rHhQEk8o5M60zGInTuZUv21J9RhbtnESFvGsJbeqLAyyr9BfeZ7J4ydrB6nk8f3+Iu71BpwLxff1q7cn8Nah3eGBAFboAk56PE3Sn3qmXe3TdTJc2IpyV4otmB9il9+RH8XzJ1iSMMwlDMOtUEfIK5kbG4dhoOBs/2tat1RewXko/kwzzVqLHZj2UD5dbiFxQeJZSJyA4XfOhB1qYXH9eKIQhorD0gYG/sLtKb5EDZVn5umFSxU7mKFblTNEncZpZhm2bgLldteU/AsbKSv7PBCw7gJJkPz6TvNDmHy9mtMzXv4G/pZnFn8q5BjmC/Ql0WgspKVvaOaXcNIC40xRsF0v9df89lheVGenwOVm3dHgrqvFltDyR9GCnlRDuTT3rpoelgcmaLwvU5940F5h0d321TZHXwc5QRYMS7CaTV3Ose7aQ/Byy0tubAdFqoMDEDmDGCjumuUSU3VjkubXHsOuGJWPnkIbvHdv+wrXYru2E3JxB8GecSOAvA8h5hvFHlXuv9LQRUeOfVUeKKq2PnY8/JkqjBSITHyOg18p+RyuU90kDWAze0tIRRQSAVRqhrKolF1VCEi96+jgZEzIqhztAIhFCVaewXqh+CCTqyMt4G5zhzPy94nnvKE6vqmi9D33JmWWJyfwsh6xpYyY2AUopXDS0SYvPr5K+LhrAUTn2DRabO7Gc7+Otl6FaQLvMW1MmVLa/5xCQ0/PrH6hLgVqsZcSSXtcmN7a6+pxUrldSLQGMYoYCbUq+NkhSsTA3gwA+h2Mtx7N/pgnSfTccpc1hRR6RINdlIhZr0TbcZawpFhfNm9J6mzocr2hBkzuPkyyymwjv4CierE9rLlZHm0mIvvnW8QPYigYcDJ1wjbfd1j6FRH/SCl3U5w3h/u76seW9BEVrYUOxtA0xAm3ft7AJq+YbpDP4XnaaLwCxFKsFYMTq++fCEH09kJwzVppSrpO\";\n N=\"17940310759273821186091581584347644044532110653611418699399056760535726181949455909144061033504176046416709472278996844000450948857220538550053615420925570802434732707421445671477723887387914317469612014260650051468786981006855259611418439128933224994326497684896586953029899510145805760405843701781804218344837909274948803595405675987967173096900321030771190203653250898572215814821822532134516026113119288551182967270982365478632519526369244532509171907932412232634363383953554099707402311802908794637876801835946089556255898817291537076439262510079546459483035933240627147365281467516137748986227401106139071070769\";\n\n RSAPublicKeySpec rsaPublicKeySpec = new java.security.spec.RSAPublicKeySpec(new BigInteger(N),new BigInteger(E));\n\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(rsaPublicKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE,publicKey);\n System.out.println(\"data length:\"+license.getBytes(StandardCharsets.UTF_8).length);\n byte[] data = org.apache.commons.codec.binary.Base64.decodeBase64(license.getBytes(StandardCharsets.UTF_8));\n\n System.out.println(\"data length:\"+data.length);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n // datas = cipher.doFinal(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "private BigInteger encrypt(BigInteger message) {\n return message.modPow(e, n);\n }", "private byte[][] ECDSAgeneratePublicAndPrivateKey(){\r\n int length = 0;\r\n byte[][] keys;\r\n \r\n do{\r\n \r\n\tECKeyPairGenerator gen = new ECKeyPairGenerator();\r\n\tSecureRandom secureRandom = new SecureRandom();\r\n X9ECParameters secnamecurves = SECNamedCurves.getByName(\"secp256k1\");\r\n\tECDomainParameters ecParams = new ECDomainParameters(secnamecurves.getCurve(), secnamecurves.getG(), secnamecurves.getN(), secnamecurves.getH());\r\n\tECKeyGenerationParameters keyGenParam = new ECKeyGenerationParameters(ecParams, secureRandom);\r\n\tgen.init(keyGenParam);\r\n\tAsymmetricCipherKeyPair kp = gen.generateKeyPair();\r\n\tECPrivateKeyParameters privatekey = (ECPrivateKeyParameters)kp.getPrivate();\r\n\tECPoint dd = secnamecurves.getG().multiply(privatekey.getD());\r\n\tbyte[] publickey=new byte[65];\r\n\tSystem.arraycopy(dd.getY().toBigInteger().toByteArray(), 0, publickey, 64-dd.getY().toBigInteger().toByteArray().length+1, dd.getY().toBigInteger().toByteArray().length);\r\n\tSystem.arraycopy(dd.getX().toBigInteger().toByteArray(), 0, publickey, 32-dd.getX().toBigInteger().toByteArray().length+1, dd.getX().toBigInteger().toByteArray().length);\r\n\tpublickey[0]=4;\r\n length = privatekey.getD().toByteArray().length;\r\n keys = new byte[][]{privatekey.getD().toByteArray(),publickey};\r\n \r\n }while(length != 32);\r\n\treturn keys;\r\n}", "@Test\n // boundary\n public void testGenerateNextLikelyPrime_4() {\n NaturalNumber n = new NaturalNumber2(4);\n CryptoUtilities.generateNextLikelyPrime(n);\n assertEquals(\"5\", n.toString());\n }", "public Enigma(){ \r\n randNumber = new Random(); \r\n }", "public ECP getPublicEphemeralKey(){return epk;}", "public Ed25519PublicKey derivePublicKey() {\r\n\t\tif(this.pubKey==null) {\r\n\t\t\tthis.pubKey = new Ed25519PublicKey(new EdDSAPublicKey(new EdDSAPublicKeySpec(this.key.getA(), this.key.getParams())));\r\n\t\t}\r\n\t\treturn this.pubKey;\r\n\t}", "private E() {}", "public Node(Node<D> n) {\n\t\tdata = n.getData();\n\t\tnext = n.getNext();\n\t}" ]
[ "0.80752957", "0.7790987", "0.76860183", "0.758123", "0.7266809", "0.69987226", "0.69012743", "0.6141707", "0.6084722", "0.6077586", "0.60379064", "0.5883822", "0.58769286", "0.57351524", "0.5690756", "0.5679285", "0.563859", "0.5632738", "0.5613138", "0.55779535", "0.55499643", "0.55272514", "0.54913473", "0.5380324", "0.53677803", "0.53555125", "0.53163594", "0.5312965", "0.5309358", "0.529629", "0.5285728", "0.5199533", "0.5184596", "0.518092", "0.51612264", "0.51435614", "0.5141644", "0.513591", "0.51078105", "0.5103894", "0.50917673", "0.5075311", "0.49842486", "0.49732533", "0.4968868", "0.4967158", "0.4956236", "0.49434543", "0.49387354", "0.4921642", "0.49040556", "0.4884647", "0.48839012", "0.4869319", "0.4859138", "0.48549637", "0.48540163", "0.48495722", "0.4837254", "0.48366332", "0.48318636", "0.48309427", "0.48295915", "0.48291397", "0.48049077", "0.4790891", "0.47759062", "0.47690758", "0.4752414", "0.47457162", "0.4740356", "0.47348383", "0.47326228", "0.472629", "0.4722769", "0.47212762", "0.47180066", "0.4703295", "0.46840602", "0.46766338", "0.4674961", "0.46692738", "0.4662867", "0.46612749", "0.465882", "0.46553782", "0.46517336", "0.46496293", "0.46401498", "0.46398938", "0.46337917", "0.46324512", "0.46278596", "0.4593073", "0.45868933", "0.45855066", "0.45853886", "0.45713535", "0.4566911", "0.45641524" ]
0.79392934
1
Since this class is immutable, there is no need for a copy ctor.
@Override protected Object clone() throws CloneNotSupportedException { // semi-copy throw new CloneNotSupportedException(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void copyConstructor(){\n\t}", "public Clone() {}", "private ImmutablePerson(ImmutablePerson other) {\n firstName = other.firstName;\n middleName = other.middleName;\n lastName = other.lastName;\n nickNames = new ArrayList<>(other.nickNames);\n }", "private UniqueChromosomeReconstructor() { }", "@Override\n public Object clone() {\n return super.clone();\n }", "Reproducible newInstance();", "@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "private Value() {\n\t}", "public Value(){}", "public Value() {}", "public Changes() {\n }", "public ImmutableRetrieve() {\n super();\n }", "protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}", "public Change() {\n // Required for WebServices to work. Comment added to please Sonar.\n }", "@Override \n public Score clone()\n {\n try\n { \n return (Score)super.clone();\n }\n catch(CloneNotSupportedException e)\n {\n throw new InternalError();\n }\n }", "@Override\n public boolean isMutable() {\n return true;\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public StandardValues() {\n super(ForwardingMap.this);\n }", "protected Coord() {\n\t}", "@Override\r\n @GwtIncompatible\r\n public Object clone() {\r\n try {\r\n @SuppressWarnings(\"unchecked\")\r\n PairBuilder<L, R> result = (PairBuilder<L, R>)super.clone();\r\n result.self = result;\r\n return result;\r\n } catch (CloneNotSupportedException e) {\r\n throw new InternalError(e.getMessage());\r\n }\r\n }", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "private Item(){}", "public Value() {\n }", "public MossClone() {\n super();\n }", "public abstract B copy();", "public BlacklistedValueObject() {\n super();\n }", "private DiffProperty() {\n\t\t// No implementation\n\t}", "private Source() {\n throw new AssertionError(\"This class should not be instantiated.\");\n }", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "private Tuples() {\n // prevent instantiation.\n }", "@SuppressWarnings(\"unused\")\n public Coordinate() {}", "protected MapImpl() {\n }", "public Data() {}", "protected AbstractPathElement(AbstractPathElement<V, E> original)\r\n/* */ {\r\n/* 117 */ this.nHops = original.nHops;\r\n/* 118 */ this.prevEdge = original.prevEdge;\r\n/* 119 */ this.prevPathElement = original.prevPathElement;\r\n/* 120 */ this.vertex = original.vertex;\r\n/* */ }", "public /*@ non_null @*/ Object clone() {\n return this;\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "private Sequence() {\n this(\"<Sequence>\", null, null);\n }", "private SingleObject(){}", "@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }", "@Override\n protected Object clone() throws CloneNotSupportedException {\n\n return super.clone();\n }", "public O copy() {\n return value();\n }", "Prototype makeCopy();", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public ObjectUtils() {\n super();\n }", "@Override\n public SharedObject clone() {\n SharedObject c;\n try {\n c = (SharedObject)super.clone();\n } catch (CloneNotSupportedException e) {\n // Should never happen.\n throw new ICUCloneNotSupportedException(e);\n }\n c.refCount = new AtomicInteger();\n return c;\n }", "public BabbleValue() {}", "@Override\n public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "public Object clone() {\n return this.copy();\n }", "public AllDifferent()\n {\n this(0);\n }", "@Override\n public boolean isMutable()\n {\n return true;\n }", "public Tuple() {\n this(new ArrayList<Object>());\n }", "public Pleasure() {\r\n\t\t}", "private ChainingMethods() {\n // private constructor\n\n }", "private IdentifiableComparator() {\n\t\t// This class is not intended to create own objects from it.\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Object clone() {\n\t\tLongOpenHashSet c;\n\t\ttry {\n\t\t\tc = (LongOpenHashSet) super.clone();\n\t\t} catch (CloneNotSupportedException cantHappen) {\n\t\t\tthrow new InternalError();\n\t\t}\n\t\tc.key = key.clone();\n\t\tc.state = state.clone();\n\t\treturn c;\n\t}", "protected VersionData() {}", "public JsonFactory copy()\n/* */ {\n/* 324 */ _checkInvalidCopy(JsonFactory.class);\n/* */ \n/* 326 */ return new JsonFactory(this, null);\n/* */ }", "public Reference() {\n super();\n }", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "private Set() {\n this(\"<Set>\", null, null);\n }", "@Override\r\n public Object clone() {\r\n\r\n Coordinate c = new Coordinate( this );\r\n return c;\r\n }", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "public abstract Instance duplicate();", "private Values(){}", "private InternalStorage() {}", "protected AbstractReadablePacket() {\n this.constructor = createConstructor();\n }", "@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }", "private SingleObject()\r\n {\r\n }", "@SuppressWarnings(\"unused\")\n public Item() {\n }", "public Holder() {\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "public Item(){}", "public ImmutableStudent(int id, String name, Age age) {\n this.name = name;\n this.id = id;\n //this.age = age; //si la Age implementara la interface clonable y el metodo clone desarrolado podriamos =age.clone() poner directo la copia\n //pero como no es asi crearemos un nuevo objeto el cual sera enviado para evitar que modifiquemos el original\n Age cloneAge = new Age();//creamos un nuevo objeto lleno con los mismos parametros que el original\n cloneAge.setDay(age.getDay());//llenamos\n cloneAge.setMonth(age.getMonth());//llenamos\n cloneAge.setYear(age.getYear());//llenamos\n this.age = cloneAge;\n }", "public State(){}", "@Override \n public Object clone() {\n try {\n Resource2Builder result = (Resource2Builder)super.clone();\n result.self = result;\n return result;\n } catch (CloneNotSupportedException e) {\n throw new InternalError(e.getMessage());\n }\n }", "Constructor() {\r\n\t\t \r\n\t }", "O() { super(null); }", "public abstract Player freshCopy();", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}", "private History() {}", "public MyHashSet() {\n \n }", "@Override\n\tpublic Object clone() {\n\t\treturn null;\n\t}", "@Override\n public String getObjectCopy() {\n return null;\n }", "protected Item() {\n }", "protected Value(Value v) {\n flags = v.flags;\n num = v.num;\n str = v.str;\n object_labels = v.object_labels;\n getters = v.getters;\n setters = v.setters;\n excluded_strings = v.excluded_strings;\n included_strings = v.included_strings;\n functionPartitions = v.functionPartitions;\n functionTypeSignatures = v.functionTypeSignatures;\n var = v.var;\n hashcode = v.hashcode;\n }", "public Data() {\n \n }", "public Constructor(){\n\t\t\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}", "@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}" ]
[ "0.6609604", "0.63094866", "0.6293578", "0.6214499", "0.62005854", "0.61879194", "0.6157276", "0.6150356", "0.61107534", "0.610368", "0.60711855", "0.60557353", "0.6048785", "0.60419697", "0.603692", "0.60341054", "0.6026094", "0.60081434", "0.5990625", "0.5984014", "0.59791607", "0.5976543", "0.5964996", "0.5936726", "0.5919799", "0.5913854", "0.5912373", "0.59115076", "0.59110284", "0.5910088", "0.59100205", "0.5904339", "0.589808", "0.58970934", "0.58961296", "0.58948535", "0.58942705", "0.58940506", "0.58824384", "0.5882347", "0.5881283", "0.5879873", "0.5874215", "0.58694476", "0.5864211", "0.5856055", "0.58555984", "0.5849661", "0.58472013", "0.5846089", "0.5846089", "0.5846089", "0.58444726", "0.5844286", "0.5837495", "0.5835281", "0.5822771", "0.5820633", "0.5817225", "0.5816074", "0.58097047", "0.57998204", "0.5799619", "0.57981795", "0.5797249", "0.5795565", "0.5793883", "0.5793316", "0.5785979", "0.5784008", "0.57783204", "0.5762965", "0.57599", "0.57589513", "0.5757839", "0.5744967", "0.57447755", "0.57417965", "0.573947", "0.5736969", "0.5736803", "0.57359624", "0.57349336", "0.5732492", "0.5731479", "0.57287216", "0.5728011", "0.5717035", "0.57168216", "0.5713173", "0.5710517", "0.57081276", "0.5704322", "0.5704322", "0.5704322", "0.5704322", "0.5704322", "0.5704322", "0.5704322", "0.5704322" ]
0.5885789
38
RSA static factory: construct an RSA object with the given p, q, and e.
public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e) throws NullPointerException, IllegalArgumentException, ArithmeticException { return new RSA(p, q, e, null, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (p.equals(q)) { // i.e., p == q\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < p) && (0 < q) && (0 < e) && (p != q)\r\n\r\n\t\t// Set p and q.\r\n\t\tthis.p = p;\r\n\t\tthis.q = q;\r\n\r\n\t\t// Save p - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1\r\n\t\tif (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < p - 1\r\n\t\t// i.e., 1 < p\r\n\t\t// Save q - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1\r\n\t\tif (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < q - 1\r\n\t\t// i.e., 1 < q\r\n\t\t// Compute the value of Euler's totient function for the cipher modulus.\r\n\t\tfinal BigInteger phi = p_minus_1.multiply(q_minus_1);\r\n\t\tif (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// e < phi\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = this.p.multiply(this.q);\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\r\n\t\t// Set dP, dQ, and qInv.\r\n\t\tthis.dP = this.d.mod(p_minus_1);\r\n\t\tthis.dQ = this.d.mod(q_minus_1);\r\n\t\tthis.qInv = this.q.modInverse(this.p);\r\n\t}", "protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException {\r\n\t\tif ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(e) <= 0) { // i.e., n <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(d) <= 0) { // i.e., n <= d\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n)\r\n\t\t// i.e., (0 < e) && (0 < d) && (max(e, d) < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = d;\r\n\t}", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(phi) <= 0) { // i.e., n <= phi\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi)\r\n\t\t// i.e., (0 < e) && (e < phi) && (phi < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\t}", "public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException {\r\n\t\treturn new RSA(n, e, d);\r\n\t}", "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "public RSAKeyPairGenerator() {\n }", "public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(phi, n, e, null);\r\n\t}", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public GenRSAKey() {\n initComponents();\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "public Cipher getCipherRSA() throws NoSuchPaddingException, NoSuchAlgorithmException {\n return Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n }", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public RSAESOAEPparams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void\");\n }", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "static public BigInteger bPrivateKey(BigInteger e, BigInteger p, BigInteger q)\n {\n return Utils.bigModInverse(e, RSA.bPhi(p, q));\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub) {\n return new ECKey(priv, pub);\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "P createP();", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "public PublicKey getKey(\n String provider)\n throws PGPException, NoSuchProviderException\n {\n KeyFactory fact;\n \n try\n {\n switch (publicPk.getAlgorithm())\n {\n case RSA_ENCRYPT:\n case RSA_GENERAL:\n case RSA_SIGN:\n RSAPublicBCPGKey rsaK = (RSAPublicBCPGKey)publicPk.getKey();\n RSAPublicKeySpec rsaSpec = new RSAPublicKeySpec(rsaK.getModulus(), rsaK.getPublicExponent());\n \n fact = KeyFactory.getInstance(\"RSA\", provider);\n \n return fact.generatePublic(rsaSpec);\n case DSA:\n DSAPublicBCPGKey dsaK = (DSAPublicBCPGKey)publicPk.getKey();\n DSAPublicKeySpec dsaSpec = new DSAPublicKeySpec(dsaK.getY(), dsaK.getP(), dsaK.getQ(), dsaK.getG());\n \n fact = KeyFactory.getInstance(\"DSA\", provider);\n \n return fact.generatePublic(dsaSpec);\n case ELGAMAL_ENCRYPT:\n case ELGAMAL_GENERAL:\n ElGamalPublicBCPGKey elK = (ElGamalPublicBCPGKey)publicPk.getKey();\n ElGamalPublicKeySpec elSpec = new ElGamalPublicKeySpec(elK.getY(), new ElGamalParameterSpec(elK.getP(), elK.getG()));\n \n fact = KeyFactory.getInstance(\"ElGamal\", provider);\n \n return fact.generatePublic(elSpec);\n default:\n throw new PGPException(\"unknown public key algorithm encountered\");\n }\n }\n catch (PGPException e)\n {\n throw e;\n }\n catch (Exception e)\n {\n throw new PGPException(\"exception constructing public key\", e);\n }\n }", "public ECKey() {\n this(secureRandom);\n }", "protected abstract PlayerAuth createPlayerAuthObject(P params);", "public static void main(final String[] args) throws Exception {\n Security.addProvider(new BouncyCastleProvider());\n\n // --- setup key pair (generated in advance)\n final String passphrase = \"owlstead\";\n final KeyPair kp = generateRSAKeyPair(1024);\n final RSAPublicKey rsaPublicKey = (RSAPublicKey) kp.getPublic();\n final RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) kp.getPrivate();\n\n // --- encode and wrap\n byte[] x509EncodedRSAPublicKey = encodeRSAPublicKey(rsaPublicKey);\n final byte[] saltedAndEncryptedPrivate = wrapRSAPrivateKey(\n passphrase, rsaPrivateKey);\n\n // --- decode and unwrap\n final RSAPublicKey retrievedRSAPublicKey = decodeRSAPublicKey(x509EncodedRSAPublicKey);\n final RSAPrivateKey retrievedRSAPrivateKey = unwrapRSAPrivateKey(passphrase,\n saltedAndEncryptedPrivate);\n\n // --- check result\n System.out.println(retrievedRSAPublicKey);\n System.out.println(retrievedRSAPrivateKey);\n }", "public MersennePrimeStream(){\n super();\n }", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "private BigInteger()\n {\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public GenEncryptionParams() {\n }", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "public PQR() {}", "public PGPPublicKey( \n int algorithm,\n PublicKey pubKey,\n Date time,\n String provider) \n throws PGPException, NoSuchProviderException\n {\n PublicKeyPacket pubPk;\n\n if (pubKey instanceof RSAPublicKey)\n {\n RSAPublicKey rK = (RSAPublicKey)pubKey;\n \n pubPk = new PublicKeyPacket(algorithm, time, new RSAPublicBCPGKey(rK.getModulus(), rK.getPublicExponent()));\n }\n else if (pubKey instanceof DSAPublicKey)\n {\n DSAPublicKey dK = (DSAPublicKey)pubKey;\n DSAParams dP = dK.getParams();\n \n pubPk = new PublicKeyPacket(algorithm, time, new DSAPublicBCPGKey(dP.getP(), dP.getQ(), dP.getG(), dK.getY()));\n }\n else if (pubKey instanceof ElGamalPublicKey)\n {\n ElGamalPublicKey eK = (ElGamalPublicKey)pubKey;\n ElGamalParameterSpec eS = eK.getParameters();\n \n pubPk = new PublicKeyPacket(algorithm, time, new ElGamalPublicBCPGKey(eS.getP(), eS.getG(), eK.getY()));\n }\n else\n {\n throw new PGPException(\"unknown key class\");\n }\n \n this.publicPk = pubPk;\n this.ids = new ArrayList();\n this.idSigs = new ArrayList();\n \n try\n {\n init();\n }\n catch (IOException e)\n {\n throw new PGPException(\"exception calculating keyID\", e);\n }\n }", "public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\treturn new BigInteger(cipher.doFinal(message.toByteArray()));\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "BigInteger getCEP();", "public void testPubliKeyField() throws Exception {\r\n // Create new key pair\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n\r\n PublicKeyRSA rsa1 = (PublicKeyRSA)KeyFactory.createInstance(keyPair.getPublic(), \"SHA1WITHRSA\", null);\r\n byte[] der = rsa1.getEncoded();\r\n\r\n CVCObject cvcObj = CertificateParser.parseCVCObject(der);\r\n assertTrue(\"Parsed array was not a PublicKeyRSA\", (cvcObj instanceof PublicKeyRSA));\r\n\r\n RSAPublicKey rsaKey = (RSAPublicKey)keyPair.getPublic();\r\n\r\n RSAPublicKey rsa2 = (RSAPublicKey)cvcObj; // This casting should be successful\r\n assertEquals(\"Key modulus\", rsaKey.getModulus(), rsa2.getModulus());\r\n assertEquals(\"Key exponent\", rsaKey.getPublicExponent(), rsa2.getPublicExponent());\r\n assertEquals(\"Key algorithm\", \"RSA\", rsa2.getAlgorithm());\r\n \r\n PublicKeyRSA rsa3 = (PublicKeyRSA)rsa2;\r\n assertEquals(\"OIDs\", rsa1.getObjectIdentifier(), rsa3.getObjectIdentifier());\r\n }", "public PriQOverflowException() {\n\t}", "public Pub build() {\n return new Pub(keyId, algo, keyLen, creationDate, expirationDate, flags);\n }", "public Cipher()\n {\n CodecInterface base64UriCodec = new Base64UriCodec();\n AsymmetricBlockCipher rsaCipher = new OAEPEncoding(\n new RSAEngine(),\n new SHA1Digest()\n );\n BufferedBlockCipher aesCipher = new PaddedBufferedBlockCipher(\n new CBCBlockCipher(new AESEngine()),\n new PKCS7Padding()\n );\n Digest sha1Digest = new SHA1Digest();\n SecureRandom random = new SecureRandom();\n\n this.encryptionCipher = new EncryptionCipher(\n base64UriCodec,\n rsaCipher,\n aesCipher,\n sha1Digest,\n random\n );\n this.decryptionCipher = new DecryptionCipher(\n base64UriCodec,\n rsaCipher,\n aesCipher,\n sha1Digest\n );\n }", "private static BigInteger generatePFactor(\n Random randomSeed,\n SComplexity complexity,\n int certainty,\n BigInteger q) {\n long time = System.nanoTime();\n BigInteger m;\n BigInteger mR;\n BigInteger p = null;\n int step = 0;\n while ((step++) < MAX_STEPS) {\n m = new BigInteger(complexity.getPBitLength(), randomSeed);\n mR = m.mod(q.multiply(MathUtils.INTEGER_2));\n p = m.subtract(mR).add(BigInteger.ONE);\n if (p.isProbablePrime(certainty)) {\n LOGGER.info(\n String.format(\n \"Generated p number, took=%dms\\nq=%s\",\n TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - time),\n p.toString(RADIX)\n )\n );\n break;\n }\n }\n return p;\n }", "public ECP getPublicEphemeralKey(){return epk;}", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }", "public static ECKey fromPrivate(BigInteger privKey) {\n return fromPrivate(privKey, true);\n }", "@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/243905306\"})\n @Test\n public void testNoDefaultForParameters() {\n // An X509 encoded 2048-bit RSA public key.\n String pubKey =\n \"30820122300d06092a864886f70d01010105000382010f003082010a02820101\"\n + \"00bdf90898577911c71c4d9520c5f75108548e8dfd389afdbf9c997769b8594e\"\n + \"7dc51c6a1b88d1670ec4bb03fa550ba6a13d02c430bfe88ae4e2075163017f4d\"\n + \"8926ce2e46e068e88962f38112fc2dbd033e84e648d4a816c0f5bd89cadba0b4\"\n + \"d6cac01832103061cbb704ebacd895def6cff9d988c5395f2169a6807207333d\"\n + \"569150d7f569f7ebf4718ddbfa2cdbde4d82a9d5d8caeb467f71bfc0099b0625\"\n + \"a59d2bad12e3ff48f2fd50867b89f5f876ce6c126ced25f28b1996ee21142235\"\n + \"fb3aef9fe58d9e4ef6e4922711a3bbcd8adcfe868481fd1aa9c13e5c658f5172\"\n + \"617204314665092b4d8dca1b05dc7f4ecd7578b61edeb949275be8751a5a1fab\"\n + \"c30203010001\";\n PublicKey key;\n Signature verifier;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(TestUtil.hexToBytes(pubKey));\n key = kf.generatePublic(x509keySpec);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key is not supported\");\n return;\n }\n try {\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n verifier.initVerify(key);\n } catch (NoSuchAlgorithmException | InvalidKeyException ex) {\n TestUtil.skipTest(\"RSASSA-PSS is not supported.\");\n return;\n }\n AlgorithmParameters params = verifier.getParameters();\n if (params != null) {\n PSSParameterSpec pssParams;\n try {\n pssParams = params.getParameterSpec(PSSParameterSpec.class);\n } catch (InvalidParameterSpecException ex) {\n fail(\"Can't generate PSSParameterSpec from \" + params.getClass().getName());\n return;\n }\n // The provider uses some default parameters. This easily leads to weak or\n // incompatible implementations.\n fail(\"RSASSA-PSS uses default parameters:\" + pssParameterSpecToString(pssParams));\n }\n }", "public interface RSAPrivateCrtKey extends PrivateKey {\n\n /**\n * Sets the value of the P parameter.\n * The plaintext data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte). Input P parameter data is copied into the internal representation.\n * @param buffer the input buffer\n * @param offset the offset into the input buffer at which the parameter value begins\n * @param length the length of the parameter\n * @exception CryptoException with the following reason code:<ul>\n * <li><code>CryptoException.ILLEGAL_VALUE</code> if the input parameter data length is inconsistent\n * with the implementation or if input data decryption is required and fails.\n * </ul>\n * <p>Note:<ul>\n * <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em>\n * interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em>\n * is not </em><code>null</code><em>, the P parameter value is decrypted using the </em><code>Cipher</code><em> object.</em>\n * </ul>\n */\n void setP( byte[] buffer, short offset, short length) throws CryptoException;\n\n /**\n * Sets the value of the Q parameter.\n * The plaintext data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte). Input Q parameter data is copied into the internal representation.\n * @param buffer the input buffer\n * @param offset the offset into the input buffer at which the parameter value begins\n * @param length the length of the parameter\n * @exception CryptoException with the following reason code:<ul>\n * <li><code>CryptoException.ILLEGAL_VALUE</code> if the input parameter data length is inconsistent\n * with the implementation or if input data decryption is required and fails.\n * </ul>\n * <p>Note:<ul>\n * <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em>\n * interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em>\n * is not </em><code>null</code><em>, the Q parameter value is decrypted using the </em><code>Cipher</code><em> object.</em>\n * </ul>\n */\n void setQ( byte[] buffer, short offset, short length) throws CryptoException;\n\n /**\n * Sets the value of the DP1 parameter.\n * The plaintext data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte). Input DP1 parameter data is copied into the internal representation.\n * @param buffer the input buffer\n * @param offset the offset into the input buffer at which the parameter value begins\n * @param length the length of the parameter\n * @exception CryptoException with the following reason code:<ul>\n * <li><code>CryptoException.ILLEGAL_VALUE</code> if the input parameter data length is inconsistent\n * with the implementation or if input data decryption is required and fails.\n * </ul>\n * <p>Note:<ul>\n * <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em>\n * interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em>\n * is not </em><code>null</code><em>, the DP1 parameter value is decrypted using the </em><code>Cipher</code><em> object.</em>\n * </ul>\n */\n void setDP1( byte[] buffer, short offset, short length) throws CryptoException;\n\n /**\n * Sets the value of the DQ1 parameter.\n * The plaintext data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte). Input DQ1 parameter data is copied into the internal representation.\n * @param buffer the input buffer\n * @param offset the offset into the input buffer at which the parameter value begins\n * @param length the length of the parameter\n * @exception CryptoException with the following reason code:<ul>\n * <li><code>CryptoException.ILLEGAL_VALUE</code> if the input parameter data length is inconsistent\n * with the implementation or if input data decryption is required and fails.\n * </ul>\n * <p>Note:<ul>\n * <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em>\n * interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em>\n * is not </em><code>null</code><em>, the DQ1 parameter value is decrypted using the </em><code>Cipher</code><em> object.</em>\n * </ul>\n */\n void setDQ1( byte[] buffer, short offset, short length) throws CryptoException;\n\n /**\n * Sets the value of the PQ parameter.\n * The plaintext data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte). Input PQ parameter data is copied into the internal representation.\n * @param buffer the input buffer\n * @param offset the offset into the input buffer at which the parameter value begins\n * @param length the length of the parameter\n * @exception CryptoException with the following reason code:<ul>\n * <li><code>CryptoException.ILLEGAL_VALUE</code> if the input parameter data length is inconsistent\n * with the implementation or if input data decryption is required and fails.\n * </ul>\n * <p>Note:<ul>\n * <li><em>If the key object implements the </em><code>javacardx.crypto.KeyEncryption</code><em>\n * interface and the </em><code>Cipher</code><em> object specified via </em><code>setKeyCipher()</code><em>\n * is not </em><code>null</code><em>, the PQ parameter value is decrypted using the </em><code>Cipher</code><em> object.</em>\n * </ul>\n */\n void setPQ( byte[] buffer, short offset, short length) throws CryptoException;\n\n /**\n * Returns the value of the P parameter in plain text.\n * The data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte).\n * @param buffer the output buffer\n * @param offset the offset into the output buffer at which the parameter value begins\n * @return the byte length of the P parameter value returned\n */\n short getP( byte[] buffer, short offset );\n\n /**\n * Returns the value of the Q parameter in plain text.\n * The data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte).\n * @param buffer the output buffer\n * @param offset the offset into the output buffer at which the parameter value begins\n * @return the byte length of the Q parameter value returned\n */\n short getQ( byte[] buffer, short offset );\n\n /**\n * Returns the value of the DP1 parameter in plain text.\n * The data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte).\n * @param buffer the output buffer\n * @param offset the offset into the output buffer at which the parameter value begins\n * @return the byte length of the DP1 parameter value returned\n */\n short getDP1( byte[] buffer, short offset );\n\n /**\n * Returns the value of the DQ1 parameter in plain text.\n * The data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte).\n * @param buffer the output buffer\n * @param offset the offset into the output buffer at which the parameter value begins\n * @return the byte length of the DQ1 parameter value returned\n */\n short getDQ1( byte[] buffer, short offset );\n\n /**\n * Returns the value of the PQ parameter in plain text.\n * The data format is big-endian and right-aligned (the least significant bit is the least significant\n * bit of last byte).\n * @param buffer the output buffer\n * @param offset the offset into the output buffer at which the parameter value begins\n * @return the byte length of the PQ parameter value returned\n */\n short getPQ( byte[] buffer, short offset );\n\n }", "public PghModulo() {\r\n }", "OpenSSLKey mo134201a();", "public static void main(String[] args) throws IOException {\n RSAServer server = new RSAServer();\n server.run();\n }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "private PerksFactory() {\n\n\t}", "public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String r1, java.lang.String r2) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator\");\n }", "private E() {}", "static KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);\n\n keyGen.initialize(2048);\n\n //Log.e(TAG, \"generateKeyPair: this is public key encoding \" + Arrays.toString(generateKeyPair.getPrivate().getEncoded()));\n\n return keyGen.generateKeyPair();\n }", "public static ECKey fromPublicOnly(ECPoint pub) {\n return new ECKey(null, pub);\n }", "public RSAKeyGenParameterSpec getPssAlgorithmParameters(\n int keySizeInBits,\n String sha,\n String mgf,\n String mgfSha,\n int saltLength) {\n BigInteger publicExponent = new BigInteger(\"65537\");\n PSSParameterSpec params =\n new PSSParameterSpec(sha, mgf, new MGF1ParameterSpec(mgfSha), saltLength, 1);\n return new RSAKeyGenParameterSpec(keySizeInBits, publicExponent, params);\n }", "public PAES(Problem problem) {\r\n\t\tsuper(problem);\r\n\t}", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "Persoana createPersoana(String nume, int varsta) {\n return new Persoana(nume, varsta);\n }", "public ECKey build() {\n\n\t\t\ttry {\n\t\t\t\tif (d == null && priv == null) {\n\t\t\t\t\t// Public key\n\t\t\t\t\treturn new ECKey(crv, x, y, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (priv != null) {\n\t\t\t\t\t// PKCS#11 reference to private key\n\t\t\t\t\treturn new ECKey(crv, x, y, priv, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\n\t\t\t\t// Public / private key pair with 'd'\n\t\t\t\treturn new ECKey(crv, x, y, d, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tthrow new IllegalStateException(e.getMessage(), e);\n\t\t\t}\n\t\t}", "public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String r1) throws java.security.NoSuchAlgorithmException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String):java.security.AlgorithmParameterGenerator, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String):java.security.AlgorithmParameterGenerator\");\n }", "public T participationPublicKeyBase64(String pk) {\n this.votePK = new ParticipationPublicKey(Encoder.decodeFromBase64(pk));\n return (T) this;\n\n }", "java.lang.String getPublicEciesKey();", "public p7p2() {\n }", "public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }", "@Override\n public PGPPublicKey getPGPPublicKeyById(String id) throws IOException, PGPException {\n // TODO: bring that back after LocalEGA key server becomes able to register itself against Eureka\n // ResponseEntity<Resource> responseEntity =\n // restTemplate.getForEntity(keyServiceURL + \"/pgp/\" + id, Resource.class);\n\n InputStream in = PGPUtil.getDecoderStream(new URL(cegaURL + \"/pgp/\" + id).openStream());\n PGPPublicKeyRingCollection pgpPublicKeyRings = new PGPPublicKeyRingCollection(in, new BcKeyFingerprintCalculator());\n PGPPublicKey pgpPublicKey = null;\n Iterator keyRings = pgpPublicKeyRings.getKeyRings();\n while (pgpPublicKey == null && keyRings.hasNext()) {\n PGPPublicKeyRing kRing = (PGPPublicKeyRing) keyRings.next();\n Iterator publicKeys = kRing.getPublicKeys();\n while (publicKeys.hasNext()) {\n PGPPublicKey key = (PGPPublicKey) publicKeys.next();\n if (key.isEncryptionKey()) {\n pgpPublicKey = key;\n break;\n }\n }\n }\n if (pgpPublicKey == null) {\n throw new IllegalArgumentException(\"Can't find encryption key in key ring.\");\n }\n return pgpPublicKey;\n }", "private EncryptionKey() {\n }", "public static ECKey fromPublicOnly(byte[] pub) {\n return new ECKey(null, EccCurve.getCurve().decodePoint(pub));\n }", "@VisibleForTesting\n KeyStore.PrivateKeyEntry getRSAKeyEntry() throws CryptoException, IncompatibleDeviceException {\n try {\n KeyStore keyStore = KeyStore.getInstance(ANDROID_KEY_STORE);\n keyStore.load(null);\n if (keyStore.containsAlias(OLD_KEY_ALIAS)) {\n //Return existing key. On weird cases, the alias would be present but the key not\n KeyStore.PrivateKeyEntry existingKey = getKeyEntryCompat(keyStore, OLD_KEY_ALIAS);\n if (existingKey != null) {\n return existingKey;\n }\n } else if (keyStore.containsAlias(KEY_ALIAS)) {\n KeyStore.PrivateKeyEntry existingKey = getKeyEntryCompat(keyStore, KEY_ALIAS);\n if (existingKey != null) {\n return existingKey;\n }\n }\n\n Calendar start = Calendar.getInstance();\n Calendar end = Calendar.getInstance();\n end.add(Calendar.YEAR, 25);\n AlgorithmParameterSpec spec;\n X500Principal principal = new X500Principal(\"CN=Auth0.Android,O=Auth0\");\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n spec = new KeyGenParameterSpec.Builder(KEY_ALIAS, KeyProperties.PURPOSE_DECRYPT | KeyProperties.PURPOSE_ENCRYPT)\n .setCertificateSubject(principal)\n .setCertificateSerialNumber(BigInteger.ONE)\n .setCertificateNotBefore(start.getTime())\n .setCertificateNotAfter(end.getTime())\n .setKeySize(RSA_KEY_SIZE)\n .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1)\n .setBlockModes(KeyProperties.BLOCK_MODE_ECB)\n .build();\n } else {\n //Following code is for API 18-22\n //Generate new RSA KeyPair and save it on the KeyStore\n KeyPairGeneratorSpec.Builder specBuilder = new KeyPairGeneratorSpec.Builder(context)\n .setAlias(KEY_ALIAS)\n .setSubject(principal)\n .setKeySize(RSA_KEY_SIZE)\n .setSerialNumber(BigInteger.ONE)\n .setStartDate(start.getTime())\n .setEndDate(end.getTime());\n\n KeyguardManager kManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n //The next call can return null when the LockScreen is not configured\n Intent authIntent = kManager.createConfirmDeviceCredentialIntent(null, null);\n boolean keyguardEnabled = kManager.isKeyguardSecure() && authIntent != null;\n if (keyguardEnabled) {\n //If a ScreenLock is setup, protect this key pair.\n specBuilder.setEncryptionRequired();\n }\n }\n spec = specBuilder.build();\n }\n\n KeyPairGenerator generator = KeyPairGenerator.getInstance(ALGORITHM_RSA, ANDROID_KEY_STORE);\n generator.initialize(spec);\n generator.generateKeyPair();\n\n return getKeyEntryCompat(keyStore, KEY_ALIAS);\n } catch (CertificateException | InvalidAlgorithmParameterException | NoSuchProviderException | NoSuchAlgorithmException | KeyStoreException | ProviderException e) {\n /*\n * This exceptions are safe to be ignored:\n *\n * - CertificateException:\n * Thrown when certificate has expired (25 years..) or couldn't be loaded\n * - KeyStoreException:\n * - NoSuchProviderException:\n * Thrown when \"AndroidKeyStore\" is not available. Was introduced on API 18.\n * - NoSuchAlgorithmException:\n * Thrown when \"RSA\" algorithm is not available. Was introduced on API 18.\n * - InvalidAlgorithmParameterException:\n * Thrown if Key Size is other than 512, 768, 1024, 2048, 3072, 4096\n * or if Padding is other than RSA/ECB/PKCS1Padding, introduced on API 18\n * or if Block Mode is other than ECB\n * - ProviderException:\n * Thrown on some modified devices when KeyPairGenerator#generateKeyPair is called.\n * See: https://www.bountysource.com/issues/45527093-keystore-issues\n *\n * However if any of this exceptions happens to be thrown (OEMs often change their Android distribution source code),\n * all the checks performed in this class wouldn't matter and the device would not be compatible at all with it.\n *\n * Read more in https://developer.android.com/training/articles/keystore#SupportedAlgorithms\n */\n Log.e(TAG, \"The device can't generate a new RSA Key pair.\", e);\n throw new IncompatibleDeviceException(e);\n } catch (IOException | UnrecoverableEntryException e) {\n /*\n * Any of this exceptions mean the old key pair is somehow corrupted.\n * We can delete both the RSA and the AES keys and let the user retry the operation.\n *\n * - IOException:\n * Thrown when there is an I/O or format problem with the keystore data.\n * - UnrecoverableEntryException:\n * Thrown when the key cannot be recovered. Probably because it was invalidated by a Lock Screen change.\n */\n deleteRSAKeys();\n deleteAESKeys();\n throw new CryptoException(\"The existing RSA key pair could not be recovered and has been deleted. \" +\n \"This occasionally happens when the Lock Screen settings are changed. You can safely retry this operation.\", e);\n }\n }", "private EventProducer createProducer(long anAddress, int ppid) {\n\t\treturn createProducer(String.valueOf(anAddress), ppid);\n\t}", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }", "PEKSInitial() {\n\t\tprimeP = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tprimeQ = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tgenerator = new BigInteger(512, new Random());// a 512 bit number, may\n\t\t \t\t\t\t\t\t\t\t\t\t// not prime\n\t\tprimeM = primeP.multiply(primeQ);// compute m=p*q\n\t\tfainM = (primeP.subtract(BigInteger.ONE)).multiply(primeQ\n\t\t\t\t.subtract(BigInteger.ONE));// eluer function of m\n\t\t//keyVector.add(generator);\n\t\t//File outputFile = new File(\"Data Records\\\\123456.txt\");\n\t\t//ht.put(generator,outputFile.getAbsolutePath());\n\t}", "public Potencia(int b, int e){\n base = b;\n expo = e;\n pot = (int)Math.pow(b, e);\n }", "public BigInteger getP() {return(p);}" ]
[ "0.77184784", "0.7699345", "0.75835097", "0.7185757", "0.71849394", "0.71564716", "0.713692", "0.6957344", "0.6504324", "0.65012383", "0.6233595", "0.621354", "0.6179771", "0.6076711", "0.59967494", "0.5958961", "0.5882674", "0.582608", "0.58170724", "0.57965493", "0.5735209", "0.5730741", "0.57149374", "0.5574207", "0.55233324", "0.5487758", "0.54727775", "0.54061973", "0.54045385", "0.5376064", "0.53707093", "0.53457445", "0.5340298", "0.5332647", "0.5328711", "0.53256875", "0.53200036", "0.53009915", "0.5279934", "0.52367073", "0.52257687", "0.5215433", "0.51945186", "0.518791", "0.51818883", "0.51706946", "0.5138059", "0.5115623", "0.5101723", "0.50923777", "0.50820386", "0.50551623", "0.5023556", "0.5005861", "0.5003917", "0.49980602", "0.49728027", "0.4965754", "0.4940305", "0.4916096", "0.4908548", "0.48699734", "0.48621303", "0.4798095", "0.47923854", "0.47879723", "0.4787235", "0.47790143", "0.4775775", "0.47688964", "0.47654057", "0.47574073", "0.47453973", "0.47444203", "0.4720872", "0.472087", "0.47172436", "0.47111073", "0.4709327", "0.47085646", "0.4704777", "0.46817562", "0.468163", "0.46806735", "0.46784213", "0.46591166", "0.46336237", "0.4629739", "0.46229446", "0.46189985", "0.4616268", "0.46132088", "0.46111295", "0.4609862", "0.4608118", "0.46025625", "0.46020803", "0.4582561", "0.45781654", "0.45779344" ]
0.72799957
3
RSA static factory: construct an RSA object with the given phi, n, and e.
public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e) throws NullPointerException, IllegalArgumentException, ArithmeticException { return new RSA(phi, n, e, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(phi) <= 0) { // i.e., n <= phi\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi)\r\n\t\t// i.e., (0 < e) && (e < phi) && (phi < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\t}", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException {\r\n\t\treturn new RSA(n, e, d);\r\n\t}", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (p.equals(q)) { // i.e., p == q\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < p) && (0 < q) && (0 < e) && (p != q)\r\n\r\n\t\t// Set p and q.\r\n\t\tthis.p = p;\r\n\t\tthis.q = q;\r\n\r\n\t\t// Save p - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1\r\n\t\tif (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < p - 1\r\n\t\t// i.e., 1 < p\r\n\t\t// Save q - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1\r\n\t\tif (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < q - 1\r\n\t\t// i.e., 1 < q\r\n\t\t// Compute the value of Euler's totient function for the cipher modulus.\r\n\t\tfinal BigInteger phi = p_minus_1.multiply(q_minus_1);\r\n\t\tif (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// e < phi\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = this.p.multiply(this.q);\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\r\n\t\t// Set dP, dQ, and qInv.\r\n\t\tthis.dP = this.d.mod(p_minus_1);\r\n\t\tthis.dQ = this.d.mod(q_minus_1);\r\n\t\tthis.qInv = this.q.modInverse(this.p);\r\n\t}", "protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException {\r\n\t\tif ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(e) <= 0) { // i.e., n <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(d) <= 0) { // i.e., n <= d\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n)\r\n\t\t// i.e., (0 < e) && (0 < d) && (max(e, d) < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = d;\r\n\t}", "public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(p, q, e, null, null);\r\n\t}", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public RSAKeyPairGenerator() {\n }", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "public GenRSAKey() {\n initComponents();\n }", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "public Cipher getCipherRSA() throws NoSuchPaddingException, NoSuchAlgorithmException {\n return Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "public PublicKey getKey(\n String provider)\n throws PGPException, NoSuchProviderException\n {\n KeyFactory fact;\n \n try\n {\n switch (publicPk.getAlgorithm())\n {\n case RSA_ENCRYPT:\n case RSA_GENERAL:\n case RSA_SIGN:\n RSAPublicBCPGKey rsaK = (RSAPublicBCPGKey)publicPk.getKey();\n RSAPublicKeySpec rsaSpec = new RSAPublicKeySpec(rsaK.getModulus(), rsaK.getPublicExponent());\n \n fact = KeyFactory.getInstance(\"RSA\", provider);\n \n return fact.generatePublic(rsaSpec);\n case DSA:\n DSAPublicBCPGKey dsaK = (DSAPublicBCPGKey)publicPk.getKey();\n DSAPublicKeySpec dsaSpec = new DSAPublicKeySpec(dsaK.getY(), dsaK.getP(), dsaK.getQ(), dsaK.getG());\n \n fact = KeyFactory.getInstance(\"DSA\", provider);\n \n return fact.generatePublic(dsaSpec);\n case ELGAMAL_ENCRYPT:\n case ELGAMAL_GENERAL:\n ElGamalPublicBCPGKey elK = (ElGamalPublicBCPGKey)publicPk.getKey();\n ElGamalPublicKeySpec elSpec = new ElGamalPublicKeySpec(elK.getY(), new ElGamalParameterSpec(elK.getP(), elK.getG()));\n \n fact = KeyFactory.getInstance(\"ElGamal\", provider);\n \n return fact.generatePublic(elSpec);\n default:\n throw new PGPException(\"unknown public key algorithm encountered\");\n }\n }\n catch (PGPException e)\n {\n throw e;\n }\n catch (Exception e)\n {\n throw new PGPException(\"exception constructing public key\", e);\n }\n }", "public String[] keyGen(){\n \n p1 = BigInteger.probablePrime(N / 2, random);\n p2 = BigInteger.probablePrime(N / 2, random);\n phi0 = (p1.subtract(one)).multiply(p2.subtract(one));\n \n BigInteger modulus = p1.multiply(p2);\n BigInteger privateKey = setPrivateKey(modulus);\n BigInteger publicKey = privateKey.modInverse(phi0);\n \n /* Retourne un tableau de 3 chaine de caractere contenant dans cette ordre */\n /* cle publique, modulus, cle prive */\n String tab[] = {publicKey + \"\", modulus + \"\", privateKey + \"\"};\n return tab;\n \n }", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public RSAESOAEPparams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void\");\n }", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "Persoana createPersoana(String nume, int varsta) {\n return new Persoana(nume, varsta);\n }", "public PghModulo() {\r\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub) {\n return new ECKey(priv, pub);\n }", "public static void main(final String[] args) throws Exception {\n Security.addProvider(new BouncyCastleProvider());\n\n // --- setup key pair (generated in advance)\n final String passphrase = \"owlstead\";\n final KeyPair kp = generateRSAKeyPair(1024);\n final RSAPublicKey rsaPublicKey = (RSAPublicKey) kp.getPublic();\n final RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) kp.getPrivate();\n\n // --- encode and wrap\n byte[] x509EncodedRSAPublicKey = encodeRSAPublicKey(rsaPublicKey);\n final byte[] saltedAndEncryptedPrivate = wrapRSAPrivateKey(\n passphrase, rsaPrivateKey);\n\n // --- decode and unwrap\n final RSAPublicKey retrievedRSAPublicKey = decodeRSAPublicKey(x509EncodedRSAPublicKey);\n final RSAPrivateKey retrievedRSAPrivateKey = unwrapRSAPrivateKey(passphrase,\n saltedAndEncryptedPrivate);\n\n // --- check result\n System.out.println(retrievedRSAPublicKey);\n System.out.println(retrievedRSAPrivateKey);\n }", "public static DiffieHellman recreate(BigInteger privateKey, \n\t\t\t\t\t BigInteger modulus)\n {\n if (privateKey == null || modulus == null) {\n\t throw new IllegalArgumentException(\"Null parameter\");\n\t}\n\tDiffieHellman dh = new DiffieHellman();\n\tdh.setPrivateKey(privateKey);\n\tdh.setModulus(modulus);\n\treturn dh;\n }", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "protected static LargeInteger computeE(int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \t\t// TODO check this\r\n \t\t// int length = Ne + 7;\r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\tLargeInteger E = LargeInteger.ONE;\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = new LargeInteger(\"2\").power(Ne);\r\n \t\t\tLargeInteger a = t.mod(pow);\r\n \t\t\tE = E.multiply(a);\r\n \t\t}\r\n \r\n \t\t// TODO\r\n \t\tSystem.out.println(\"E :\" + E);\r\n \r\n \t\treturn E;\r\n \t}", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "protected abstract PlayerAuth createPlayerAuthObject(P params);", "static public BigInteger bPrivateKey(BigInteger e, BigInteger p, BigInteger q)\n {\n return Utils.bigModInverse(e, RSA.bPhi(p, q));\n }", "public MersennePrimeStream(){\n super();\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "@Override\n\tpublic AbstractReine createReine() {\n\t\treturn new ReineSN();\n\t}", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public GenEncryptionParams() {\n }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "public ECKey() {\n this(secureRandom);\n }", "public int gcd(int e, int phi) {\r\n if(e == 0)\r\n return phi; \r\n else\r\n return gcd(phi % e, e);\r\n }", "private BigInteger()\n {\n }", "Nexo createNexo();", "public static void main(String[] args) throws IOException {\n RSAServer server = new RSAServer();\n server.run();\n }", "public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }", "public static long nPr(int n, int r)\n throws IllegalArgumentException\n {\n if ((r > n) || (r < 0) || (n < 0))\n throw new IllegalArgumentException();\n long npr = 1;\n for (int p = n - r + 1; p <= n; p++)\n npr *= p;\n return npr;\n }", "public Potencia(int b, int e){\n base = b;\n expo = e;\n pot = (int)Math.pow(b, e);\n }", "BigInteger getCEP();", "public interface ComplexNumberAbstractFactory {\n /**\n * Permet la creation du nombre complexe à l'aide d'un nombre complexe cartesien\n * @param real Le reel du nombre complexe que l'on souhaite créer\n * @param imaginary L'imaginaire du nombre complexe que l'on souhaite créer\n * @return Le nouveau nombre complexe\n */\n ComplexNumber createComplexNumberFromCartesian(double real, double imaginary);\n /**\n * Permet la creation du nombre complexe à l'aide d'un nombre complexe polaire\n * @param modulus Le module du nombre complexe que l'on souhaite créer\n * @param argument L'argument du nombre complexe que l'on souhaite créer\n * @return Le nouveau nombre complexe complexe\n */\n ComplexNumber createComplexNumberFromPolar(double modulus, double argument);\n}", "P createP();", "public static ExPar create(String n) {\r\n\t\t// System.out.println(\"ExPar.create(): Trying to create parameter \" + n\r\n\t\t// + \" for the runtime table. \");\r\n\t\tExPar p = null;\r\n\t\tif (get(n, false) == null) {\r\n\t\t\tp = new ExPar(UNKNOWN, new ExParValueUndefined(), null);\r\n\t\t\truntimePars.put(n, p);\r\n\t\t}\r\n\t\t// System.out.println(\"ExPar.create(): Runtime Parameter \" + n +\r\n\t\t// \" created. \");\r\n\t\treturn (p);\r\n\t}", "Degree createDegree();", "public static ECKey fromPrivate(BigInteger privKey) {\n return fromPrivate(privKey, true);\n }", "public static CacheKey newInstance(OrmUjo bo, MetaPKey pkey) {\n return new UjoCacheKey(bo, pkey);\n }", "public PrivateKey makePrivateKey() {\n return new PrivateKey(decryptingBigInt, primesMultiplied);\n }", "@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/243905306\"})\n @Test\n public void testNoDefaultForParameters() {\n // An X509 encoded 2048-bit RSA public key.\n String pubKey =\n \"30820122300d06092a864886f70d01010105000382010f003082010a02820101\"\n + \"00bdf90898577911c71c4d9520c5f75108548e8dfd389afdbf9c997769b8594e\"\n + \"7dc51c6a1b88d1670ec4bb03fa550ba6a13d02c430bfe88ae4e2075163017f4d\"\n + \"8926ce2e46e068e88962f38112fc2dbd033e84e648d4a816c0f5bd89cadba0b4\"\n + \"d6cac01832103061cbb704ebacd895def6cff9d988c5395f2169a6807207333d\"\n + \"569150d7f569f7ebf4718ddbfa2cdbde4d82a9d5d8caeb467f71bfc0099b0625\"\n + \"a59d2bad12e3ff48f2fd50867b89f5f876ce6c126ced25f28b1996ee21142235\"\n + \"fb3aef9fe58d9e4ef6e4922711a3bbcd8adcfe868481fd1aa9c13e5c658f5172\"\n + \"617204314665092b4d8dca1b05dc7f4ecd7578b61edeb949275be8751a5a1fab\"\n + \"c30203010001\";\n PublicKey key;\n Signature verifier;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(TestUtil.hexToBytes(pubKey));\n key = kf.generatePublic(x509keySpec);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key is not supported\");\n return;\n }\n try {\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n verifier.initVerify(key);\n } catch (NoSuchAlgorithmException | InvalidKeyException ex) {\n TestUtil.skipTest(\"RSASSA-PSS is not supported.\");\n return;\n }\n AlgorithmParameters params = verifier.getParameters();\n if (params != null) {\n PSSParameterSpec pssParams;\n try {\n pssParams = params.getParameterSpec(PSSParameterSpec.class);\n } catch (InvalidParameterSpecException ex) {\n fail(\"Can't generate PSSParameterSpec from \" + params.getClass().getName());\n return;\n }\n // The provider uses some default parameters. This easily leads to weak or\n // incompatible implementations.\n fail(\"RSASSA-PSS uses default parameters:\" + pssParameterSpecToString(pssParams));\n }\n }", "public PrivatePublicTuple generateKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secureRandom = generateNewSecureRandom();\n keyPairGenerator.initialize(PRIVATE_KEY_LENGTH, secureRandom);\n KeyPair pair = keyPairGenerator.generateKeyPair();\n PrivateKey privateKey = pair.getPrivate();\n PublicKey publicKey = pair.getPublic();\n return new PrivatePublicTuple(getDEREncodingFromPrivateKey(privateKey), getDEREncodingFromPublicKey(publicKey));\n } catch (Exception e) {\n LOG.error(\"There was an error generating key pair: \", e);\n }\n return null;\n }", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "public static ECDomainParameters NIST_B_571() {\n\t\tF2m.setModulus(571, 10, 5, 2, 0);\n\t\tECDomainParameters NIST_B_571 =\n\t\t\tnew ECDomainParameters(\n\t\t\t\t571,\n\t\t\t\t10,\n\t\t\t\t5,\n\t\t\t\t2,\n\t\t\t\tnew ECurveF2m(\n\t\t\t\t\tnew F2m(\"1\", 16),\n\t\t\t\t\tnew F2m(\"2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a\", 16)),\n\t\t\t\tnew BigInteger(\n\t\t\t\t\t\"3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703\",\n\t\t\t\t\t10),\n\t\t\t\tnew ECPointF2m(\n\t\t\t\t\tnew F2m(\"303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19\", 16),\n\t\t\t\t\tnew F2m(\"37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b\", 16)),\n\t\t\t\tBigInteger.valueOf(2));\n\t\treturn NIST_B_571;\n\t}", "static KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);\n\n keyGen.initialize(2048);\n\n //Log.e(TAG, \"generateKeyPair: this is public key encoding \" + Arrays.toString(generateKeyPair.getPrivate().getEncoded()));\n\n return keyGen.generateKeyPair();\n }", "public void testVerifyCertificateRSA() throws Exception\n\t{\n\t\tm_random.setSeed(47989202);\n\t\ttestVerifyCertificate(new RSATestKeyPairGenerator(m_random));\n\t}", "private static String bigIntegerNChooseRModP(int N, int R, int P) {\n if (R == 0) return \"1\";\n BigInteger num = BigInteger.ONE;\n BigInteger den = BigInteger.ONE;\n while (R > 0) {\n num = num.multiply(BigInteger.valueOf(N));\n den = den.multiply(BigInteger.valueOf(R));\n BigInteger gcd = num.gcd(den);\n num = num.divide(gcd);\n den = den.divide(gcd);\n N--;\n R--;\n }\n num = num.divide(den);\n num = num.mod(BigInteger.valueOf(P));\n return num.toString();\n }", "public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }", "BigInteger getEBigInteger();", "public static void main(String[] args) throws Exception {\n \t\t\n \t\tSystem.out.println(new String(RSAdecryptByPublicKey(\"9ff782468e12e04a0229f0b2846c09eggo\".getBytes(), \n \t\t\t\t\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP8ig8yOrDyWDIisI2ra8PTe7fS086nVG3t2vMTlueb7xwqUmeSvirQxvSYeRSpWBHfaUTBWgsrCgA0cSKFyJJvPOABIEORycYhSVqrPqYtbbqdyxKqC56km6viXTQqmSjco133MDuzWeQjGXneR24wzxTZc2dgy/TlZr06miJAwIDAQAB\")));\n\t}", "public Enigma(){ \r\n randNumber = new Random(); \r\n }", "public void testPubliKeyField() throws Exception {\r\n // Create new key pair\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n\r\n PublicKeyRSA rsa1 = (PublicKeyRSA)KeyFactory.createInstance(keyPair.getPublic(), \"SHA1WITHRSA\", null);\r\n byte[] der = rsa1.getEncoded();\r\n\r\n CVCObject cvcObj = CertificateParser.parseCVCObject(der);\r\n assertTrue(\"Parsed array was not a PublicKeyRSA\", (cvcObj instanceof PublicKeyRSA));\r\n\r\n RSAPublicKey rsaKey = (RSAPublicKey)keyPair.getPublic();\r\n\r\n RSAPublicKey rsa2 = (RSAPublicKey)cvcObj; // This casting should be successful\r\n assertEquals(\"Key modulus\", rsaKey.getModulus(), rsa2.getModulus());\r\n assertEquals(\"Key exponent\", rsaKey.getPublicExponent(), rsa2.getPublicExponent());\r\n assertEquals(\"Key algorithm\", \"RSA\", rsa2.getAlgorithm());\r\n \r\n PublicKeyRSA rsa3 = (PublicKeyRSA)rsa2;\r\n assertEquals(\"OIDs\", rsa1.getObjectIdentifier(), rsa3.getObjectIdentifier());\r\n }", "public static Player make(String n) {\n\t\treturn new NewPlayer(n);\n\t}", "private Etapa nuevaEtapa(Etapa e) {\n if(debug) {\n System.out.println(\"**********************nuevaEtapa\");\n }\n \n Etapa ret = new Etapa();\n ret.i = e.i;\n ret.k = e.k+1;\n \n return ret;\n }", "public static Long elevaARecursivoNoFinal(Integer exponente, Integer n) {\n\t\t\n\t\tLong resultado;\n\t\t\n\t\tif (n > 0) {\n\t\t\t\n\t\t\tresultado = elevaARecursivoNoFinal(exponente, (n / 2));\n\t\t\t\n\t\t\tif (n % 2 == 1) {\n\t\t\t\t\n\t\t\t\tresultado = ((resultado * resultado) * exponente);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresultado *= resultado;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tresultado = 1L;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn resultado;\n\t\t\n\t}", "public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String r1, java.lang.String r2) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator\");\n }", "protected ImsInteger createRandomTestNumber(ImsInteger modulus){\r\n\t\t\r\n\t\t// get a random number\r\n\t\tImsInteger testNumber = new ImsInteger(modulus.bitLength(), new Random());\r\n\t\t\r\n\t\t// assure that it is positive and smaller modulus\r\n\t\ttestNumber = testNumber.mod(modulus);\r\n\t\t\r\n\t\t// assure that it is non zero\r\n\t\tif(testNumber.compareTo(ImsInteger.ZERO)==0){\r\n\t\t\ttestNumber = modulus.subtract(ImsInteger.ONE);\r\n\t\t}\r\n\t\treturn testNumber;\r\n\t}", "public static PageGeneratorLanguareFactory init()\n {\n try\n {\n PageGeneratorLanguareFactory thePageGeneratorLanguareFactory = (PageGeneratorLanguareFactory)EPackage.Registry.INSTANCE.getEFactory(PageGeneratorLanguarePackage.eNS_URI);\n if (thePageGeneratorLanguareFactory != null)\n {\n return thePageGeneratorLanguareFactory;\n }\n }\n catch (Exception exception)\n {\n EcorePlugin.INSTANCE.log(exception);\n }\n return new PageGeneratorLanguareFactoryImpl();\n }", "OpenSSLKey mo134201a();", "public static KeyPair generatePublicKeyPair(){\r\n\t\ttry {\r\n\t\t\tKeyPairGenerator keyGen = KeyPairGenerator.getInstance(publicKeyAlgorithm);\r\n\t\t\tkeyGen.initialize(PUBLIC_KEY_LENGTH, new SecureRandom());\r\n\t\t\treturn keyGen.generateKeyPair();\r\n\t\t} catch (Exception e) {\r\n\t\t\t// should not happen\r\n\t\t\tthrow new ModelException(\"Internal key generation error - \"+publicKeyAlgorithm+\"[\"+PUBLIC_KEY_LENGTH+\"]\",e);\r\n\t\t}\r\n\t}", "public void initRsaOperations(byte[] privateKeyFragment1, byte[] privateKeyFragment2, byte[] publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, Base64DecodingException, UnsupportedEncodingException, DestroyFailedException {\n initPrivateKey(privateKeyFragment1, privateKeyFragment2);\n this.rsaPublicKey = KeyFactory.getInstance(\"RSA\").generatePublic(new X509EncodedKeySpec(publicKey));\n this.rsaDecryptCipher = Cipher.getInstance(\"RSA\");\n this.rsaDecryptCipher.init(Cipher.DECRYPT_MODE, this.rsaPrivateKey);\n this.rsaEncryptCipher = Cipher.getInstance(\"RSA\");\n this.rsaEncryptCipher.init(Cipher.ENCRYPT_MODE, this.rsaPublicKey);\n }", "public Cipher()\n {\n CodecInterface base64UriCodec = new Base64UriCodec();\n AsymmetricBlockCipher rsaCipher = new OAEPEncoding(\n new RSAEngine(),\n new SHA1Digest()\n );\n BufferedBlockCipher aesCipher = new PaddedBufferedBlockCipher(\n new CBCBlockCipher(new AESEngine()),\n new PKCS7Padding()\n );\n Digest sha1Digest = new SHA1Digest();\n SecureRandom random = new SecureRandom();\n\n this.encryptionCipher = new EncryptionCipher(\n base64UriCodec,\n rsaCipher,\n aesCipher,\n sha1Digest,\n random\n );\n this.decryptionCipher = new DecryptionCipher(\n base64UriCodec,\n rsaCipher,\n aesCipher,\n sha1Digest\n );\n }" ]
[ "0.77741885", "0.77402097", "0.75804013", "0.7406603", "0.69485754", "0.6741423", "0.6688083", "0.66249776", "0.6502009", "0.64623946", "0.6305431", "0.6170089", "0.6021572", "0.5880289", "0.5783087", "0.56739354", "0.56382006", "0.55912226", "0.5547132", "0.54826254", "0.5421548", "0.5392984", "0.53872746", "0.5385922", "0.53849065", "0.5362327", "0.52992356", "0.5241593", "0.52379197", "0.5203043", "0.5202916", "0.51747257", "0.51445687", "0.5106947", "0.50668734", "0.50288016", "0.5025335", "0.5020247", "0.50139195", "0.50134915", "0.4995257", "0.4952116", "0.4922705", "0.49175972", "0.49108836", "0.4864139", "0.48622364", "0.48476708", "0.4837015", "0.48276863", "0.48177987", "0.48142964", "0.48140863", "0.47951755", "0.47916573", "0.47857532", "0.47479486", "0.4733457", "0.46800953", "0.46668544", "0.46594715", "0.46549225", "0.4654724", "0.46493787", "0.46406293", "0.46402568", "0.4640041", "0.46390885", "0.4637954", "0.4635753", "0.4631598", "0.46299982", "0.46205664", "0.4611459", "0.45999962", "0.4578295", "0.45665637", "0.45602584", "0.45387286", "0.45381752", "0.45152962", "0.4514432", "0.45019484", "0.44984433", "0.4497783", "0.44936734", "0.44925588", "0.44756073", "0.44748497", "0.44721633", "0.44682083", "0.44669157", "0.44626456", "0.44601128", "0.44563818", "0.44448185", "0.4427734", "0.44225764", "0.4421074", "0.44201896" ]
0.77101976
2
RSA static factory: construct an RSA object with the given n, e, and d.
public static RSA knownKeys(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException { return new RSA(n, e, d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }", "protected RSA(BigInteger n, BigInteger e, BigInteger d) throws NullPointerException, IllegalArgumentException {\r\n\t\tif ((n.signum() != 1) || (e.signum() != 1) || (d.signum() != 1)) { // i.e., (n <= 0) || (e <= 0) || (d <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(e) <= 0) { // i.e., n <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(d) <= 0) { // i.e., n <= d\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < n) && (0 < e) && (0 < d) && (e < n) && (d < n)\r\n\t\t// i.e., (0 < e) && (0 < d) && (max(e, d) < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = d;\r\n\t}", "public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }", "RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }", "public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }", "protected RSA(BigInteger phi, BigInteger n, BigInteger e, Object dummy)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((phi.signum() != 1) || (n.signum() != 1) || (e.signum() != 1)) { // i.e., (phi <= 0) || (n <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (n.compareTo(phi) <= 0) { // i.e., n <= phi\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < phi) && (0 < n) && (0 < e) && (phi < n) && (e < phi)\r\n\t\t// i.e., (0 < e) && (e < phi) && (phi < n)\r\n\r\n\t\t// Set p, q, dP, dQ, and qInv.\r\n\t\tthis.p = this.q = this.dP = this.dQ = this.qInv = null;\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = n;\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\t}", "protected RSA(BigInteger p, BigInteger q, BigInteger e, Object dummy1, Object dummy2)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif ((p.signum() != 1) || (q.signum() != 1) || (e.signum() != 1)) { // i.e., (p <= 0) || (q <= 0) || (e <= 0)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t} else if (p.equals(q)) { // i.e., p == q\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// (0 < p) && (0 < q) && (0 < e) && (p != q)\r\n\r\n\t\t// Set p and q.\r\n\t\tthis.p = p;\r\n\t\tthis.q = q;\r\n\r\n\t\t// Save p - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger p_minus_1 = this.p.subtract(BigInteger.ONE); // 0 <= p_minus_1\r\n\t\tif (p_minus_1.signum() != 1) { // i.e., p - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < p - 1\r\n\t\t// i.e., 1 < p\r\n\t\t// Save q - 1 and ensure that it is positive.\r\n\t\tfinal BigInteger q_minus_1 = this.q.subtract(BigInteger.ONE); // 0 <= q_minus_1\r\n\t\tif (q_minus_1.signum() != 1) { // i.e., q - 1 <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < q - 1\r\n\t\t// i.e., 1 < q\r\n\t\t// Compute the value of Euler's totient function for the cipher modulus.\r\n\t\tfinal BigInteger phi = p_minus_1.multiply(q_minus_1);\r\n\t\tif (phi.compareTo(e) <= 0) { // i.e., phi <= e\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// e < phi\r\n\r\n\t\t// Set n, e, and d.\r\n\t\tthis.n = this.p.multiply(this.q);\r\n\t\tthis.e = e;\r\n\t\tthis.d = this.e.modInverse(phi);\r\n\r\n\t\t// Set dP, dQ, and qInv.\r\n\t\tthis.dP = this.d.mod(p_minus_1);\r\n\t\tthis.dQ = this.d.mod(q_minus_1);\r\n\t\tthis.qInv = this.q.modInverse(this.p);\r\n\t}", "RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }", "public RSAKeyPairGenerator() {\n }", "public static RSA knownFactors(BigInteger p, BigInteger q, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(p, q, e, null, null);\r\n\t}", "public static RSA knownTotient(BigInteger phi, BigInteger n, BigInteger e)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn new RSA(phi, n, e, null);\r\n\t}", "public GenRSAKey() {\n initComponents();\n }", "public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }", "public OPE(BigInteger modulus)\n\t{\t\t\n\t\tthis.modulus = modulus;\n\t}", "public Key(BigInteger exponent, BigInteger modulus) {\n this.exponent = exponent;\n this.modulus = modulus;\n }", "public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }", "private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }", "public ProyectoRSA(int tamPrimo) {\n this.tamPrimo = tamPrimo;\n\n generaClaves(); //Generamos e y d\n\n }", "static void generate() throws Exception {\n\t\t\n\t\tKeyPairGenerator keyGenerator = KeyPairGenerator.getInstance(\"RSA\");\n\t\tkeyGenerator.initialize(2048);\n\t\tKeyPair kp = keyGenerator.genKeyPair();\n\t\tRSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();\n\t\tRSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();\n\t\t\n\t\tSystem.out.println(\"RSA_public_key=\"+Base64.getEncoder().encodeToString(publicKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_private_key=\"+Base64.getEncoder().encodeToString(privateKey.getEncoded()));\n\t\tSystem.out.println(\"RSA_public_key_exponent=\"+ Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(publicKey.getPublicExponent())));\n\t\tSystem.out.println(\"RSA_private_key_exponent=\"+Base64.getEncoder().encodeToString(BigIntegerUtils.toBytesUnsigned(privateKey.getPrivateExponent())));\n\t}", "public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\r\n BigInteger a = ECConstants.ZERO;\r\n BigInteger b = BigInteger.valueOf(3);\r\n byte[] S = null;\r\n BigInteger n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"03\"\r\n //+ \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\r\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r1, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r2, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier, com.android.org.bouncycastle.asn1.x509.AlgorithmIdentifier):void\");\n }", "private static ECDomainParameters init(String name) {\n BigInteger p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\r\n BigInteger a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70\");\r\n BigInteger b = fromHex(\"B4E134D3FB59EB8BAB57274904664D5AF50388BA\");\r\n byte[] S = Hex.decode(\"B99B99B099B323E02709A4D696E6768756151751\");\r\n BigInteger n = fromHex(\"0100000000000000000000351EE786A818F3A1A16B\");\r\n BigInteger h = BigInteger.valueOf(1);\r\n\r\n ECCurve curve = new ECCurve.Fp(p, a, b);\r\n //ECPoint G = curve.decodePoint(Hex.decode(\"02\"\r\n //+ \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"));\r\n ECPoint G = curve.decodePoint(Hex.decode(\"04\"\r\n + \"52DCB034293A117E1F4FF11B30F7199D3144CE6D\"\r\n + \"FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E\"));\r\n\r\n\t\treturn new NamedECDomainParameters(curve, G, n, h, S, name);\r\n\t}", "private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }", "BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }", "public static void init(BigInteger modulus,BigInteger exponent)\n {\n Security.modulus=modulus;\n Security.exponent=exponent;\n }", "public KeyPair createKeyPair() {\n try {\n KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(\"RSA\");\n keyPairGenerator.initialize(4096);\n return keyPairGenerator.generateKeyPair();\n } catch (RuntimeException | NoSuchAlgorithmException e) {\n throw new RuntimeException(\"Failed to create public/private key pair\", e);\n }\n }", "public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }", "public void genKeyPair(BigInteger p, BigInteger q)\n {\n n = p.multiply(q);\n BigInteger PhiN = RSA.bPhi(p, q);\n do {\n e = new BigInteger(2 * SIZE, new Random());\n } while ((e.compareTo(PhiN) != 1)\n || (Utils.bigGCD(e,PhiN).compareTo(BigInteger.ONE) != 0));\n d = RSA.bPrivateKey(e, p, q);\n }", "@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }", "public ECKey() {\n this(secureRandom);\n }", "public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }", "public Cipher getCipherRSA() throws NoSuchPaddingException, NoSuchAlgorithmException {\n return Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub) {\n return new ECKey(priv, pub);\n }", "public void testExtensionsRSA() throws Exception\n\t{\n\t\t//TODO: test does not validate: either fix test or fix the function\n\t\tm_random.setSeed(355582912);\n\t\ttestExtensions(new RSATestKeyPairGenerator(m_random));\n\t}", "public KeyPair generadorAleatori() {\n KeyPair keys = null;\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(2048);\n keys = keyGen.genKeyPair();\n } catch (Exception e) {\n System.err.println(\"Generador no disponible.\");\n }\n return keys;\n }", "public ECKey build() {\n\n\t\t\ttry {\n\t\t\t\tif (d == null && priv == null) {\n\t\t\t\t\t// Public key\n\t\t\t\t\treturn new ECKey(crv, x, y, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (priv != null) {\n\t\t\t\t\t// PKCS#11 reference to private key\n\t\t\t\t\treturn new ECKey(crv, x, y, priv, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\t\t\t\t}\n\n\t\t\t\t// Public / private key pair with 'd'\n\t\t\t\treturn new ECKey(crv, x, y, d, use, ops, alg, kid, x5u, x5t, x5t256, x5c, ks);\n\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tthrow new IllegalStateException(e.getMessage(), e);\n\t\t\t}\n\t\t}", "public RSAESOAEPparams(com.android.org.bouncycastle.asn1.ASN1Sequence r1) {\n /*\n // Can't load method instructions: Load method exception: null in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>(com.android.org.bouncycastle.asn1.ASN1Sequence):void\");\n }", "public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}", "private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }", "@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }", "private BigInteger()\n {\n }", "public PublicKey getKey(\n String provider)\n throws PGPException, NoSuchProviderException\n {\n KeyFactory fact;\n \n try\n {\n switch (publicPk.getAlgorithm())\n {\n case RSA_ENCRYPT:\n case RSA_GENERAL:\n case RSA_SIGN:\n RSAPublicBCPGKey rsaK = (RSAPublicBCPGKey)publicPk.getKey();\n RSAPublicKeySpec rsaSpec = new RSAPublicKeySpec(rsaK.getModulus(), rsaK.getPublicExponent());\n \n fact = KeyFactory.getInstance(\"RSA\", provider);\n \n return fact.generatePublic(rsaSpec);\n case DSA:\n DSAPublicBCPGKey dsaK = (DSAPublicBCPGKey)publicPk.getKey();\n DSAPublicKeySpec dsaSpec = new DSAPublicKeySpec(dsaK.getY(), dsaK.getP(), dsaK.getQ(), dsaK.getG());\n \n fact = KeyFactory.getInstance(\"DSA\", provider);\n \n return fact.generatePublic(dsaSpec);\n case ELGAMAL_ENCRYPT:\n case ELGAMAL_GENERAL:\n ElGamalPublicBCPGKey elK = (ElGamalPublicBCPGKey)publicPk.getKey();\n ElGamalPublicKeySpec elSpec = new ElGamalPublicKeySpec(elK.getY(), new ElGamalParameterSpec(elK.getP(), elK.getG()));\n \n fact = KeyFactory.getInstance(\"ElGamal\", provider);\n \n return fact.generatePublic(elSpec);\n default:\n throw new PGPException(\"unknown public key algorithm encountered\");\n }\n }\n catch (PGPException e)\n {\n throw e;\n }\n catch (Exception e)\n {\n throw new PGPException(\"exception constructing public key\", e);\n }\n }", "private KeyPair generateKeyPair() {\n try {\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\", \"SUN\");\n keyGen.initialize(2048, random);\n return keyGen.generateKeyPair();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchProviderException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "public PublicKey makePublicKey() {\n return new PublicKey(encryptingBigInt, primesMultiplied);\n }", "public static void main(final String[] args) throws Exception {\n Security.addProvider(new BouncyCastleProvider());\n\n // --- setup key pair (generated in advance)\n final String passphrase = \"owlstead\";\n final KeyPair kp = generateRSAKeyPair(1024);\n final RSAPublicKey rsaPublicKey = (RSAPublicKey) kp.getPublic();\n final RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) kp.getPrivate();\n\n // --- encode and wrap\n byte[] x509EncodedRSAPublicKey = encodeRSAPublicKey(rsaPublicKey);\n final byte[] saltedAndEncryptedPrivate = wrapRSAPrivateKey(\n passphrase, rsaPrivateKey);\n\n // --- decode and unwrap\n final RSAPublicKey retrievedRSAPublicKey = decodeRSAPublicKey(x509EncodedRSAPublicKey);\n final RSAPrivateKey retrievedRSAPrivateKey = unwrapRSAPrivateKey(passphrase,\n saltedAndEncryptedPrivate);\n\n // --- check result\n System.out.println(retrievedRSAPublicKey);\n System.out.println(retrievedRSAPrivateKey);\n }", "private static String encode(String license,String D, String N) {\n int MAX_ENCRYPT_BLOCK = 128;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.ENCRYPT_MODE,privateKey);\n\n byte[] data = license.getBytes(StandardCharsets.UTF_8);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n System.out.println(\"datas:\"+datas.length);\n\n // byte[] datas = datas = cipher.doFinal(license.getBytes());\n datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}", "public void testPubliKeyField() throws Exception {\r\n // Create new key pair\r\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", \"BC\");\r\n keyGen.initialize(1024, new SecureRandom());\r\n KeyPair keyPair = keyGen.generateKeyPair();\r\n\r\n PublicKeyRSA rsa1 = (PublicKeyRSA)KeyFactory.createInstance(keyPair.getPublic(), \"SHA1WITHRSA\", null);\r\n byte[] der = rsa1.getEncoded();\r\n\r\n CVCObject cvcObj = CertificateParser.parseCVCObject(der);\r\n assertTrue(\"Parsed array was not a PublicKeyRSA\", (cvcObj instanceof PublicKeyRSA));\r\n\r\n RSAPublicKey rsaKey = (RSAPublicKey)keyPair.getPublic();\r\n\r\n RSAPublicKey rsa2 = (RSAPublicKey)cvcObj; // This casting should be successful\r\n assertEquals(\"Key modulus\", rsaKey.getModulus(), rsa2.getModulus());\r\n assertEquals(\"Key exponent\", rsaKey.getPublicExponent(), rsa2.getPublicExponent());\r\n assertEquals(\"Key algorithm\", \"RSA\", rsa2.getAlgorithm());\r\n \r\n PublicKeyRSA rsa3 = (PublicKeyRSA)rsa2;\r\n assertEquals(\"OIDs\", rsa1.getObjectIdentifier(), rsa3.getObjectIdentifier());\r\n }", "public static ECKey fromPrivate(BigInteger privKey) {\n return fromPrivate(privKey, true);\n }", "private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}", "static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}", "public void generateEphemeralKey(){\n esk = BIG.randomnum(order, rng); //ephemeral secret key, x\n epk = gen.mul(esk); //ephemeral public key, X = x*P\n }", "public Persona(String n,String a, byte e,String d){\n this.nombre=n;\n this.apellido=a;\n this.edad=e;\n this.dni=d;\n }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "public static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub) {\n checkNotNull(priv);\n checkNotNull(pub);\n return new ECKey(new BigInteger(1, priv), EccCurve.getCurve().decodePoint(pub));\n }", "public X509CRLEntryImpl(java.math.BigInteger r1, java.util.Date r2) {\n /*\n // Can't load method instructions: Load method exception: null in method: sun.security.x509.X509CRLEntryImpl.<init>(java.math.BigInteger, java.util.Date):void, dex: in method: sun.security.x509.X509CRLEntryImpl.<init>(java.math.BigInteger, java.util.Date):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: sun.security.x509.X509CRLEntryImpl.<init>(java.math.BigInteger, java.util.Date):void\");\n }", "public RSAESOAEPparams() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.asn1.pkcs.RSAESOAEPparams.<init>():void\");\n }", "protected static LargeInteger computeE(int N, int Ne, byte[] seed,\r\n \t\t\tPseudoRandomGenerator prg) {\r\n \t\t// TODO check this\r\n \t\t// int length = Ne + 7;\r\n \t\tint length = 8 * ((int) Math.ceil((double) (Ne / 8.0)));\r\n \t\tprg.setSeed(seed);\r\n \t\tbyte[] byteArrToBigInt;\r\n \t\tLargeInteger t;\r\n \t\tLargeInteger E = LargeInteger.ONE;\r\n \r\n \t\tfor (int i = 0; i < N; i++) {\r\n \t\t\tbyteArrToBigInt = prg.getNextPRGOutput(length);\r\n \t\t\tt = byteArrayToPosLargeInteger(byteArrToBigInt);\r\n \t\t\tLargeInteger pow = new LargeInteger(\"2\").power(Ne);\r\n \t\t\tLargeInteger a = t.mod(pow);\r\n \t\t\tE = E.multiply(a);\r\n \t\t}\r\n \r\n \t\t// TODO\r\n \t\tSystem.out.println(\"E :\" + E);\r\n \r\n \t\treturn E;\r\n \t}", "OpenSSLKey mo134201a();", "@Override\n\tpublic AbstractReine createReine() {\n\t\treturn new ReineSN();\n\t}", "public static long nPr(int n, int r)\n throws IllegalArgumentException\n {\n if ((r > n) || (r < 0) || (n < 0))\n throw new IllegalArgumentException();\n long npr = 1;\n for (int p = n - r + 1; p <= n; p++)\n npr *= p;\n return npr;\n }", "DomainNumber createDomainNumber();", "Persoana createPersoana(String nume, int varsta) {\n return new Persoana(nume, varsta);\n }", "public EventPlanner(int N, double d) {\n this.N = N;\n this.d = d;\n }", "public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}", "ProjetoRN createProjetoRN();", "public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String r1, java.lang.String r2) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String, java.lang.String):java.security.AlgorithmParameterGenerator\");\n }", "public static X509V3CertificateGenerator GenerateSelfSignedCerteficate(X500Principal dnName1,X500Principal dnName2, BigInteger serialNumber ,PublicKey mypublicKey, PrivateKey myprivateKey, KeyUsage Keyus ) throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException\n\t {\n\t\t\t X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();\n\t\t \n\n\t\t\t //certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new DERSequence(new DERObjectIdentifier(\"2.23.43.6.1.2\")));\n\n\t\t\t certGen.setSerialNumber(serialNumber);\n\t\t\t certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));\n\t\t certGen.setIssuerDN(dnName1); // use the same\n\t\t\t certGen.setSubjectDN(dnName2);\n\t\t\t // yesterday\n\t\t\t certGen.setNotBefore(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000));\n\t\t\t // in 2 years\n\t\t\t certGen.setNotAfter(new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000));\n\t\t\t certGen.setPublicKey(mypublicKey);\n\t\t\t certGen.setSignatureAlgorithm(\"SHA256WithRSAEncryption\");\n\t\t\t certGen.addExtension(X509Extensions.KeyUsage, true, Keyus);\n\t\t\t certGen.addExtension(X509Extensions.ExtendedKeyUsage, true, new ExtendedKeyUsage(KeyPurposeId.id_kp_serverAuth));\n\n\t\t\t \n\t \treturn certGen;\n\t \t\n\t }", "public PrivateKey makePrivateKey() {\n return new PrivateKey(decryptingBigInt, primesMultiplied);\n }", "@VisibleForTesting\n KeyStore.PrivateKeyEntry getRSAKeyEntry() throws CryptoException, IncompatibleDeviceException {\n try {\n KeyStore keyStore = KeyStore.getInstance(ANDROID_KEY_STORE);\n keyStore.load(null);\n if (keyStore.containsAlias(OLD_KEY_ALIAS)) {\n //Return existing key. On weird cases, the alias would be present but the key not\n KeyStore.PrivateKeyEntry existingKey = getKeyEntryCompat(keyStore, OLD_KEY_ALIAS);\n if (existingKey != null) {\n return existingKey;\n }\n } else if (keyStore.containsAlias(KEY_ALIAS)) {\n KeyStore.PrivateKeyEntry existingKey = getKeyEntryCompat(keyStore, KEY_ALIAS);\n if (existingKey != null) {\n return existingKey;\n }\n }\n\n Calendar start = Calendar.getInstance();\n Calendar end = Calendar.getInstance();\n end.add(Calendar.YEAR, 25);\n AlgorithmParameterSpec spec;\n X500Principal principal = new X500Principal(\"CN=Auth0.Android,O=Auth0\");\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n spec = new KeyGenParameterSpec.Builder(KEY_ALIAS, KeyProperties.PURPOSE_DECRYPT | KeyProperties.PURPOSE_ENCRYPT)\n .setCertificateSubject(principal)\n .setCertificateSerialNumber(BigInteger.ONE)\n .setCertificateNotBefore(start.getTime())\n .setCertificateNotAfter(end.getTime())\n .setKeySize(RSA_KEY_SIZE)\n .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1)\n .setBlockModes(KeyProperties.BLOCK_MODE_ECB)\n .build();\n } else {\n //Following code is for API 18-22\n //Generate new RSA KeyPair and save it on the KeyStore\n KeyPairGeneratorSpec.Builder specBuilder = new KeyPairGeneratorSpec.Builder(context)\n .setAlias(KEY_ALIAS)\n .setSubject(principal)\n .setKeySize(RSA_KEY_SIZE)\n .setSerialNumber(BigInteger.ONE)\n .setStartDate(start.getTime())\n .setEndDate(end.getTime());\n\n KeyguardManager kManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n //The next call can return null when the LockScreen is not configured\n Intent authIntent = kManager.createConfirmDeviceCredentialIntent(null, null);\n boolean keyguardEnabled = kManager.isKeyguardSecure() && authIntent != null;\n if (keyguardEnabled) {\n //If a ScreenLock is setup, protect this key pair.\n specBuilder.setEncryptionRequired();\n }\n }\n spec = specBuilder.build();\n }\n\n KeyPairGenerator generator = KeyPairGenerator.getInstance(ALGORITHM_RSA, ANDROID_KEY_STORE);\n generator.initialize(spec);\n generator.generateKeyPair();\n\n return getKeyEntryCompat(keyStore, KEY_ALIAS);\n } catch (CertificateException | InvalidAlgorithmParameterException | NoSuchProviderException | NoSuchAlgorithmException | KeyStoreException | ProviderException e) {\n /*\n * This exceptions are safe to be ignored:\n *\n * - CertificateException:\n * Thrown when certificate has expired (25 years..) or couldn't be loaded\n * - KeyStoreException:\n * - NoSuchProviderException:\n * Thrown when \"AndroidKeyStore\" is not available. Was introduced on API 18.\n * - NoSuchAlgorithmException:\n * Thrown when \"RSA\" algorithm is not available. Was introduced on API 18.\n * - InvalidAlgorithmParameterException:\n * Thrown if Key Size is other than 512, 768, 1024, 2048, 3072, 4096\n * or if Padding is other than RSA/ECB/PKCS1Padding, introduced on API 18\n * or if Block Mode is other than ECB\n * - ProviderException:\n * Thrown on some modified devices when KeyPairGenerator#generateKeyPair is called.\n * See: https://www.bountysource.com/issues/45527093-keystore-issues\n *\n * However if any of this exceptions happens to be thrown (OEMs often change their Android distribution source code),\n * all the checks performed in this class wouldn't matter and the device would not be compatible at all with it.\n *\n * Read more in https://developer.android.com/training/articles/keystore#SupportedAlgorithms\n */\n Log.e(TAG, \"The device can't generate a new RSA Key pair.\", e);\n throw new IncompatibleDeviceException(e);\n } catch (IOException | UnrecoverableEntryException e) {\n /*\n * Any of this exceptions mean the old key pair is somehow corrupted.\n * We can delete both the RSA and the AES keys and let the user retry the operation.\n *\n * - IOException:\n * Thrown when there is an I/O or format problem with the keystore data.\n * - UnrecoverableEntryException:\n * Thrown when the key cannot be recovered. Probably because it was invalidated by a Lock Screen change.\n */\n deleteRSAKeys();\n deleteAESKeys();\n throw new CryptoException(\"The existing RSA key pair could not be recovered and has been deleted. \" +\n \"This occasionally happens when the Lock Screen settings are changed. You can safely retry this operation.\", e);\n }\n }", "protected ImsInteger createRandomTestNumber(ImsInteger modulus){\r\n\t\t\r\n\t\t// get a random number\r\n\t\tImsInteger testNumber = new ImsInteger(modulus.bitLength(), new Random());\r\n\t\t\r\n\t\t// assure that it is positive and smaller modulus\r\n\t\ttestNumber = testNumber.mod(modulus);\r\n\t\t\r\n\t\t// assure that it is non zero\r\n\t\tif(testNumber.compareTo(ImsInteger.ZERO)==0){\r\n\t\t\ttestNumber = modulus.subtract(ImsInteger.ONE);\r\n\t\t}\r\n\t\treturn testNumber;\r\n\t}", "BigInteger getCEP();", "public static DiffieHellman recreate(BigInteger privateKey, \n\t\t\t\t\t BigInteger modulus)\n {\n if (privateKey == null || modulus == null) {\n\t throw new IllegalArgumentException(\"Null parameter\");\n\t}\n\tDiffieHellman dh = new DiffieHellman();\n\tdh.setPrivateKey(privateKey);\n\tdh.setModulus(modulus);\n\treturn dh;\n }", "public static ECDomainParameters NIST_B_571() {\n\t\tF2m.setModulus(571, 10, 5, 2, 0);\n\t\tECDomainParameters NIST_B_571 =\n\t\t\tnew ECDomainParameters(\n\t\t\t\t571,\n\t\t\t\t10,\n\t\t\t\t5,\n\t\t\t\t2,\n\t\t\t\tnew ECurveF2m(\n\t\t\t\t\tnew F2m(\"1\", 16),\n\t\t\t\t\tnew F2m(\"2f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a\", 16)),\n\t\t\t\tnew BigInteger(\n\t\t\t\t\t\"3864537523017258344695351890931987344298927329706434998657235251451519142289560424536143999389415773083133881121926944486246872462816813070234528288303332411393191105285703\",\n\t\t\t\t\t10),\n\t\t\t\tnew ECPointF2m(\n\t\t\t\t\tnew F2m(\"303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19\", 16),\n\t\t\t\t\tnew F2m(\"37bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b\", 16)),\n\t\t\t\tBigInteger.valueOf(2));\n\t\treturn NIST_B_571;\n\t}", "public static void main(String[] args) {\n generateKeys(\"DSA\", 1024);\n\n // Generate a 576-bit DH key pair\n generateKeys(\"DH\", 576);\n\n // Generate a 1024-bit RSA key pair\n generateKeys(\"RSA\", 1024);\n }", "@Test\n // boundary\n public void testGenerateNextLikelyPrime_4() {\n NaturalNumber n = new NaturalNumber2(4);\n CryptoUtilities.generateNextLikelyPrime(n);\n assertEquals(\"5\", n.toString());\n }", "public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }", "ECNONet createECNONet();", "Nexo createNexo();", "protected abstract PlayerAuth createPlayerAuthObject(P params);", "public static ExPar create(String n) {\r\n\t\t// System.out.println(\"ExPar.create(): Trying to create parameter \" + n\r\n\t\t// + \" for the runtime table. \");\r\n\t\tExPar p = null;\r\n\t\tif (get(n, false) == null) {\r\n\t\t\tp = new ExPar(UNKNOWN, new ExParValueUndefined(), null);\r\n\t\t\truntimePars.put(n, p);\r\n\t\t}\r\n\t\t// System.out.println(\"ExPar.create(): Runtime Parameter \" + n +\r\n\t\t// \" created. \");\r\n\t\treturn (p);\r\n\t}", "DigitalPin createDigitalPin();", "public static java.security.AlgorithmParameterGenerator getInstance(java.lang.String r1) throws java.security.NoSuchAlgorithmException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String):java.security.AlgorithmParameterGenerator, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.AlgorithmParameterGenerator.getInstance(java.lang.String):java.security.AlgorithmParameterGenerator\");\n }", "public Persona(String NumeroId, String Nombre, String PrimerApellido, String SegundoApellido, int Edad, float Peso) \r\n {\r\n this.NumeroId = NumeroId;\r\n this.Nombre = Nombre;\r\n this.PrimerApellido = PrimerApellido;\r\n this.SegundoApellido = SegundoApellido;\r\n this.Edad = Edad;\r\n this.Peso = Peso;\r\n }", "@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/243905306\"})\n @Test\n public void testNoDefaultForParameters() {\n // An X509 encoded 2048-bit RSA public key.\n String pubKey =\n \"30820122300d06092a864886f70d01010105000382010f003082010a02820101\"\n + \"00bdf90898577911c71c4d9520c5f75108548e8dfd389afdbf9c997769b8594e\"\n + \"7dc51c6a1b88d1670ec4bb03fa550ba6a13d02c430bfe88ae4e2075163017f4d\"\n + \"8926ce2e46e068e88962f38112fc2dbd033e84e648d4a816c0f5bd89cadba0b4\"\n + \"d6cac01832103061cbb704ebacd895def6cff9d988c5395f2169a6807207333d\"\n + \"569150d7f569f7ebf4718ddbfa2cdbde4d82a9d5d8caeb467f71bfc0099b0625\"\n + \"a59d2bad12e3ff48f2fd50867b89f5f876ce6c126ced25f28b1996ee21142235\"\n + \"fb3aef9fe58d9e4ef6e4922711a3bbcd8adcfe868481fd1aa9c13e5c658f5172\"\n + \"617204314665092b4d8dca1b05dc7f4ecd7578b61edeb949275be8751a5a1fab\"\n + \"c30203010001\";\n PublicKey key;\n Signature verifier;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(TestUtil.hexToBytes(pubKey));\n key = kf.generatePublic(x509keySpec);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key is not supported\");\n return;\n }\n try {\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n verifier.initVerify(key);\n } catch (NoSuchAlgorithmException | InvalidKeyException ex) {\n TestUtil.skipTest(\"RSASSA-PSS is not supported.\");\n return;\n }\n AlgorithmParameters params = verifier.getParameters();\n if (params != null) {\n PSSParameterSpec pssParams;\n try {\n pssParams = params.getParameterSpec(PSSParameterSpec.class);\n } catch (InvalidParameterSpecException ex) {\n fail(\"Can't generate PSSParameterSpec from \" + params.getClass().getName());\n return;\n }\n // The provider uses some default parameters. This easily leads to weak or\n // incompatible implementations.\n fail(\"RSASSA-PSS uses default parameters:\" + pssParameterSpecToString(pssParams));\n }\n }", "private EncryptionKey() {\n }", "Degree createDegree();", "public Profesor (String apellidos, String nombre, String nif, Persona.sexo genero, int edad, int expediente){\n this.apellidos = apellidos;\n this.nombre = nombre;\n this.nif = nif;\n this.genero = genero;\n this.edad = edad;\n this.expediente = expediente;\n }", "public GenEncryptionParams() {\n }", "public PublicKey readPublicKeyFromFile(String fileName)throws IOException {\n FileInputStream fis = null;\n ObjectInputStream ois = null;\n try{\n fis = new FileInputStream(new File(fileName));\n ois = new ObjectInputStream(fis);\n BigInteger modulus = (BigInteger) ois.readObject();\n BigInteger Exponent = (BigInteger) ois.readObject();\n \n RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec(modulus, Exponent);\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = fact.generatePublic(rsaPublicKeySpec);\n return publicKey;\n }\n catch(ClassNotFoundException | NoSuchAlgorithmException | InvalidKeySpecException e){\n e.printStackTrace();\n }\n finally{\n if(ois != null){\n ois.close();\n if(fis != null){\n fis.close();\n }\n }\n }\n return null;\n \n }", "private static PublicKey getPublicKey(String keyStr)\n throws Exception\n {\n return KeyFactory.getInstance(RSA).generatePublic(new X509EncodedKeySpec(Base64.decode(keyStr)));\n }", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "public static PublicKey\nparseRecord(DNSKEYRecord r) {\n\tint alg = r.getAlgorithm();\n\tbyte [] data = r.getKey();\n\treturn parseRecord(alg, data);\n}", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "public MersennePrimeStream(){\n super();\n }", "private static String bigIntegerNChooseRModP(int N, int R, int P) {\n if (R == 0) return \"1\";\n BigInteger num = BigInteger.ONE;\n BigInteger den = BigInteger.ONE;\n while (R > 0) {\n num = num.multiply(BigInteger.valueOf(N));\n den = den.multiply(BigInteger.valueOf(R));\n BigInteger gcd = num.gcd(den);\n num = num.divide(gcd);\n den = den.divide(gcd);\n N--;\n R--;\n }\n num = num.divide(den);\n num = num.mod(BigInteger.valueOf(P));\n return num.toString();\n }", "static KeyPair generateKeyPair() throws NoSuchAlgorithmException {\n\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);\n\n keyGen.initialize(2048);\n\n //Log.e(TAG, \"generateKeyPair: this is public key encoding \" + Arrays.toString(generateKeyPair.getPrivate().getEncoded()));\n\n return keyGen.generateKeyPair();\n }", "public interface IKeyCreator {\n byte[] generateKey(int n);\n\n byte[] getKeyFromFile(String p);\n\n byte[] inputKey(String s);\n}" ]
[ "0.78569376", "0.76422733", "0.75337774", "0.7445968", "0.7238221", "0.7022059", "0.69163257", "0.66465884", "0.6327204", "0.631269", "0.6205295", "0.61161983", "0.5969527", "0.5912436", "0.5906693", "0.5832308", "0.573262", "0.57261896", "0.5704184", "0.5690419", "0.56700695", "0.56623363", "0.5605749", "0.55249214", "0.5452166", "0.5378885", "0.5375741", "0.5334539", "0.53342295", "0.5289697", "0.52436024", "0.5221315", "0.5170315", "0.5160563", "0.51425207", "0.5123292", "0.5122253", "0.51096606", "0.509692", "0.5088769", "0.50795776", "0.50609475", "0.5044861", "0.50405824", "0.503501", "0.50299966", "0.50294876", "0.50088936", "0.4989696", "0.49852657", "0.49723747", "0.49544904", "0.49541515", "0.49515763", "0.49295637", "0.4900534", "0.48917565", "0.4864411", "0.48371083", "0.4815229", "0.48073596", "0.47865847", "0.4783034", "0.47736877", "0.47727948", "0.4770459", "0.4756898", "0.4753081", "0.47528794", "0.4742352", "0.47419018", "0.47379795", "0.4736887", "0.47357294", "0.47313225", "0.47308195", "0.47305983", "0.4713736", "0.469986", "0.46981946", "0.46862602", "0.46858898", "0.46837857", "0.4663937", "0.46577308", "0.46549547", "0.4652913", "0.4636511", "0.46333843", "0.46326086", "0.46283576", "0.46214962", "0.46197915", "0.4614637", "0.4611332", "0.46055686", "0.46033317", "0.45945016", "0.45918635", "0.4584976" ]
0.780671
1
Apply the requested key (either public or private) to the given message.
public BigInteger apply(BigInteger m, boolean publicKey) throws NullPointerException, IllegalArgumentException, ArithmeticException { if (m.signum() != 1) { // i.e, m <= 0 throw new IllegalArgumentException(); } // 0 < m /* * Apply the public key since it should be small enough that will not merit using the Chinese * Remainder Theorem. */ if (publicKey) { return m.modPow(this.e, this.n); } /* * Check to see if we can use the Chinese Remainder Theorem instead of using the private key * directly. */ if (this.p != null) { /** * Due to class invariants, we know that: <br> * 1. <code>this.q != null</code>. <br> * 2. <code>this.dP != null</code>. <br> * 3. <code>this.dQ != null</code>. <br> * 4. <code>this.qInv != null</code>. <br> * * Therefore, we can do the following: <br> * 1. <code>m = [(mP - mQ) * this.q * this.qInv + mQ] (mod this.n)</code>. */ final BigInteger mP = m.modPow(this.dP, this.p); final BigInteger mQ = m.modPow(this.dQ, this.q); BigInteger result = mP.subtract(mQ); result = result.multiply(this.q).multiply(this.qInv); result = result.add(mQ).mod(this.n); return result; } /* * At this point, we know that publicKey is false and that the Chinese Remainder Theorem cannot be * used. Therefore, just perform the standard calculation. */ return m.modPow(this.d, this.n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void process(Key msg) throws IOException {\n relay(msg);\n }", "public void process(PublicKey msg) throws IOException {\n usersConnected.get(msg.getSource()).setPublicKeyPair(msg.getMessage());\n bradcast(msg);\n }", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "public void setMessage(String message){\r\n this.message = message;\r\n key = randNumber.nextInt(50) + 1; \r\n\r\n encode();\r\n }", "private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }", "public boolean addKey (Message msg) {\n return addKey(Crypto.decodeKey(msg.ADDKEYgetKey()));\n }", "public static void publishMessage(final String key,final String message) throws IOException{\n\t\tString msg=null;\n\t\ttry {\n\t\t\t\n\t\t\t//If we need to make any Transformation on the message.\n\t\t\tif(Boolean.parseBoolean(ConfigLoader.getProp(Constants.ENABLETRANSFORMATION))){\n\t\t\t\tmsg = CBMessageTransformerFactory.INSTANCE.createCBMessageConverter().convert(key, message);\n\t\t\t}else{\n\t\t\t\tmsg=message;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t//If any exception, perform no conversion\n\t\t}\n\t\t\n\t\tif(msg!=null && msg.trim().length()>0){\n\t\t\t//Wrap KEY/VALUE in JSON -format {\\\"KEY\\\":\\\"<CBKEY>\\\",\\\"VALUE\\\":<CBVALUE>}\n\t\t\tString cbmessage=Constants.KAFKA_MESSAGE.replace(\"[CBKEY]\", key);\n\t\t\tcbmessage=cbmessage.replace(\"[CBVALUE]\", msg);\n\t\t\t\n\t\t\tKeyedMessage<String, String> data = new KeyedMessage<String, String>(ConfigLoader.getKafkaConfigProps().getProperty(Constants.TOPIC_NAME), key, cbmessage);\n\t\t\t\n\t\t\t//property producer.type indicates async/sync message\n\t\t\tif(data!=null) producer.send(data);\n\t\t}\n\t}", "public Message(String key) {\n this.key = key;\n }", "public void setKey(MessageKey key) {\n\tthis.key = key;\n }", "public String encrypt(String message, int key)\n\t{\n\t\tString encryptedMessage = \"\";\n\t\tchar ch;\n \n\t\tfor(int i = 0; i < message.length(); ++i){\n\t\t\tch = message.charAt(i);\n\t\t\t\n\t\t\tif(ch >= 'a' && ch <= 'z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'z'){\n\t ch = (char)(ch - 'z' + 'a' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else if(ch >= 'A' && ch <= 'Z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'Z'){\n\t ch = (char)(ch - 'Z' + 'A' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else {\n\t \tencryptedMessage += ch;\n\t }\n\t\t}\n return encryptedMessage;\n\t}", "public void setMessageKey(String messageKey) {\n this.messageKey = messageKey;\n }", "@Override\n\tpublic void setMessageKey(String key) {\n\t\tsuper.setMessageKey(key);\n\t}", "public void AddMsgToKeyView(int viewID, String message)\n\t{\n\t\tMessage msg = mKeyViewHandler.obtainMessage(viewID, message);\n\t\tmKeyViewHandler.sendMessage(msg);\n\t}", "public XoxoMessage encrypt(String message) {\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey));\n }", "public byte[] encrypt(final String message) throws KeyException {\n if (key == null) {\n throw new KeyException(\"Secret key not set\");\n }\n\n try {\n final Cipher cipher = Cipher.getInstance(\"AES\");\n cipher.init(Cipher.ENCRYPT_MODE, key);\n\n return cipher.doFinal(message.getBytes());\n } catch (NoSuchAlgorithmException |\n NoSuchPaddingException |\n InvalidKeyException |\n BadPaddingException |\n IllegalBlockSizeException e) {\n e.printStackTrace();\n throw new UnsupportedOperationException();\n }\n }", "public void putMessage (Message message);", "public boolean apply(Message<?> msg);", "public String encrypt(String message) {\t\n\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//this creates an array with the numbers that are keys \n\t\tint [] numberOfLetters = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i< newMessage.length(); i++){\n\t\t\tfor(int j=0; j< alphabet.length(); j++){\n\t\t\t\tif(newMessage.charAt(i) == alphabet.charAt(j)){ //if they have the same letter\n\t\t\t\t\tnumberOfLetters[i]=j+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\n\t\t//creates an array of the keys\n\t\tint [] key = new int[numberOfLetters.length];\n\t\tint keys;\n\t\tfor(int i=0; i< numberOfLetters.length; i++){\n\t\t\tkeys = getKey();\n\t\t\tkey[i] = keys;\n\t\t}\n\t\n\t\t//create an array for what we encrypted \n\t\tint [] encryptNum = new int[key.length];\n\t\tfor(int i=0; i< key.length; i++){\n\t\t\tint value = numberOfLetters[i] + key[i];\n\t\t\tif(value > 26){\n\t\t\t\tvalue = value-26;\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}else{\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}\n\t\t}\n\n\t\t//turn encryption into letters \n\t\tString encrypt = \"\";\n\t\tchar [] let = new char [encryptNum.length];\n\n\t\tfor(int i=0; i< encryptNum.length; i++){\n\t\t\tint x = encryptNum[i]-1;\n\t\t\tlet[i] = alphabet.charAt(x);\n\t\t}\n\n\t\tfor(int j=0; j< let.length; j++){\n\t\t\tencrypt += let[j];\n\t\t}\n\n\t\t// COMPLETE THIS METHOD\n\t\t// THE FOLLOWING LINE HAS BEEN ADDED TO MAKE THE METHOD COMPILE\n\n\t\treturn encrypt;\n\t}", "public void dispatchMessage(KeyedMessage<byte[], byte[]> msg);", "String setKey(String newKey);", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "private void sendMessage(String message) {\n\n // we need to encrypt message using destination public-key\n if (destinationPublicKey == null) return;\n\n /**\n * Encrypt Message Here\n */\n PublicKey publicKey = getPublicKey(Base64.decode(destinationPublicKey, Base64.URL_SAFE));\n KeyPair keyPair = new KeyPair(publicKey, null);\n SecurityKey securityKey = new SecurityKey(keyPair);\n String encryptedMessage = securityKey.encrypt(message);\n\n socket.emit(\"message\", encryptedMessage);\n\n // add raw text to recycler_view\n messages.add(new Message(nickname,messageEditText.getText().toString(),0));\n\n ChatAdapter adapter = new ChatAdapter(getApplicationContext(),messages);\n adapter.notifyDataSetChanged();\n\n chatRecyclerView.setAdapter(adapter);\n\n // clear text box\n messageEditText.setText(\"\");\n }", "public void send(String providedTopic,V msg,K providedKey);", "public void setCodedMessage(String codedMessage, int key){ \r\n this.codedMessage = codedMessage;\r\n this.key = key;\r\n decode();\r\n }", "public void process(RSAMessage msg) throws IOException {\n relay(msg);\n }", "public static BigInteger blind(BigInteger message, BigInteger r, RSAPublicKey publicKey) {\n\t\tBigInteger e = publicKey.getPublicExponent();\n\t\tBigInteger N = publicKey.getModulus();\n\n\t\treturn message.multiply(r.modPow(e, N)).mod(N);\n\t}", "public void process(SymmetricMessage msg) throws IOException {\n relay(msg);\n }", "public CryptObject encrypt(BigIntegerMod message);", "public XoxoMessage encrypt(String message, int seed) {\n //TODO: throw RangeExceededException for seed requirements\n if(seed > 36 || seed < 0){\n\n throw new RangeExceededException();\n }\n\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey, seed));\n }", "@Override\n public void handleMessage(Message message) {\n super.handleMessage(message);\n\n ImportKeysActivity.this.handleMessage(message);\n }", "public void produceMessage(String message) {\n KeyedMessage<String, String> keyedMessage = new KeyedMessage<String, String>(topic, null, message);\n producer.send(keyedMessage);\n }", "@Override\n\tpublic void processMessage(byte[] message) {\n\t}", "public abstract String encryptMsg(String msg);", "@Override\n\tpublic void messageFromServer(String message, SimpleAttributeSet keyWord) throws RemoteException {\t\t\t\n\t\ttry { \n\t\t\t// first argument sets the position of the meesage to go in\n \tchatGUI.doc.insertString(chatGUI.doc.getLength(), message + \"\\n\", keyWord); \n }\n catch (BadLocationException e){\n \tSystem.out.print(e);\n } \n\n\t}", "public byte[] decrypt(byte[] message, PrivateKey key) throws GeneralSecurityException {\n ByteBuffer buffer = ByteBuffer.wrap(message);\n int keyLength = buffer.getInt();\n byte[] encyptedPublicKey = new byte[keyLength];\n buffer.get(encyptedPublicKey);\n\n Cipher cipher = Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n\n byte[] encodedPublicKey = cipher.doFinal(encyptedPublicKey);\n\n aes.setKeyValue(new String(encodedPublicKey));\n byte[] encryptedMessage = new byte[buffer.remaining()];\n buffer.get(encryptedMessage);\n String decrypt_message = \"\";\n try {\n decrypt_message = aes.decrypt(new String(encryptedMessage));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return decrypt_message.getBytes();\n }", "public String deciphe(List<Integer> message) {\n\n\t String result = \"\", candidateKey= \"\", encodedKey = \"\", mapKey = \"\";\n\t boolean foundKeyPrefix = false, foundKey = false, consume = false;\n\t int subListStart = 0, subListEnd = 1; \t//Define the start and end of the candidate key, start with the smallest size (1)\n\t int lastKeyEnd = 0; \t\t\t\t\t\t//Defines the end of the last candidate key that has been recognized as a map key \n\t Iterator<String> iterator;\n\t \n\t while (subListEnd < message.size()+1) {\n\n\t \tcandidateKey = messageToKey(message.subList(subListStart, subListEnd));\n\t \tconsume = true;\n\t \t\n\t \titerator = keySet.iterator();\n\t \twhile (iterator.hasNext()) {\n\t \t\t\n\t \t\tmapKey = iterator.next();\n\t \t\tfoundKey = mapKey.equals(candidateKey);\n\t \t\tfoundKeyPrefix = mapKey.startsWith(candidateKey);\n\t \t\t\n\t \t\tif (foundKey){ \t\t\t\t\t\t\t\t\t/* CASE 1: If subList is a valid key, annotate the input position so that we can return to this point in case of not finding a larger key */\n \t\t\t\tlastKeyEnd = subListEnd;\n \t\t\t\tencodedKey = mapKey; \t\t\n\t \t\t}\n \t\t\telse if (foundKeyPrefix){ \t\t\t\t\t\t/* The current substring is a key prefix, stop searching over the map key set because larger keys have precedence */\n \t\t\t\tconsume = (subListEnd == message.size());\n \t\t\t\tbreak; \t\t\t\t\t\n\t \t\t}\n\t \t}\n \t\t\n\t\tif (consume) {\n\t\t\t\n\t\t\tif (!foundKey) {\n\n\t\t\t\tif (lastKeyEnd != 0) { \t\t\t\t\t\t/* CASE 2 */\n\t\t\t\t\t\n\t\t\t\t\tsubListEnd = lastKeyEnd;\n\t\t\t\t\tlastKeyEnd = 0;\n\t \t\t\t \tcandidateKey = messageToKey(message.subList(subListStart, subListEnd));\n\t \t\t\t\tencodedKey = this.map.get(Integer.parseInt(candidateKey)).toString();\t\t\n\t\t\t\t}\n\t \t\t\telse { \t\t\t\t\t\t\t\t\t\t/* CASE 3 */\n\t \t\t\t\t\n\t \t\t\t\tif (subListEnd > subListStart+1) subListEnd--;\t \t\t\t\n\t \t\t\t \tcandidateKey = messageToKey(message.subList(subListStart, subListEnd));\n\t \t\t\t encodedKey = candidateKey;\n\t \t\t\t}\n\t\t\t}\n\n \t\t\t/*\n \t\t\t * Update the output message and move to the next candidate key\n \t\t\t */\n\t\t\t\n\t\t\tresult = result.concat(encodedKey);\n \t\t\tsubListStart = subListEnd;\n \t\t\tsubListEnd = subListStart+1;\n\t\t}\n\t\telse {\n\t\t\tsubListEnd++;\n\t\t}\n\n\t }\n\t\n\t logger.info(\"Result: \"+result);\n\t return result;\n }", "public int replace(int key, String newMsg)\n\t{\n\t\tif(user_list.containsKey(key) && is_valid_message(newMsg))\n\t\t{\n\t\t// get the message at the supplied key\n\t\t\tString usr_id = user_list.get(key);\n\t\t\tLinkedList<Message> msg_list = messages.get(usr_id);\n\t\t\tint pos = -1;\n\t\t\tfor (int i = 0; i < msg_list.size(); ++i) {\n\t\t\t\tif (msg_list.get(i).getID() == key) {\n\t\t\t\t\tpos = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pos == -1) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tMessage msg = msg_list.get(pos);\n msg.setMessage(newMsg);\n return key;\n\t\t}\n\t\treturn -1;\n\t}", "public void handleMessage(Message message) {\r\n\r\n\t try { \r\n\t \t//only authenticate if you are trying to write to the db... \r\n\t \tHttpServletRequest req = (HttpServletRequest) message.get(\"HTTP.REQUEST\");\r\n\t \tString method = req.getMethod();\r\n\t \t\r\n\t \tif (method!=HttpMethod.GET && method!=HttpMethod.OPTIONS && method!=HttpMethod.HEAD){\r\n \t \r\n\t\t \tAuthorizationPolicy policy = apiUserService.getCurrentAuthPolicy();\r\n\t\t \tString accessKey = policy.getUserName();\r\n\t\t \tString secret = policy.getPassword();\r\n\t\t \r\n\t\t\t\tif (accessKey==null || accessKey.length()==0\r\n\t\t\t\t\t\t|| secret==null || secret.length()==0)\t{\r\n\t\t\t \tthrow new RMapTransformApiException(ErrorCode.ER_NO_USER_TOKEN_PROVIDED);\r\n\t\t\t\t}\t\t\r\n\t\t\t\r\n\t\t\t\tapiUserService.validateKey(accessKey, secret);\r\n\t \t}\r\n\t \t\r\n\t } catch (RMapTransformApiException ex){ \r\n\t \t//generate a response to intercept default message\r\n\t \tRMapTransformApiExceptionHandler exceptionhandler = new RMapTransformApiExceptionHandler();\r\n\t \tResponse response = exceptionhandler.toResponse(ex);\r\n\t \tmessage.getExchange().put(Response.class, response); \t\r\n\t }\r\n\t\t\r\n }", "@Override\n\tpublic void processMessage(Message message) {\n\t\t\n\t}", "static private String applyPattern(String key, Object[] messageArguments) {\n String message = getString(key);\n MessageFormat formatter = new MessageFormat(message);\n String output = formatter.format(message, messageArguments);\n return output;\n }", "protected void succeed(String message) throws InvalidKeyException {\n task.succeed(message);\n }", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n encMsg[ind] = (char) ((letter + key) % 65536);\n }\n return new String(encMsg);\n }\n }", "private BigInteger encrypt(BigInteger message) {\n return message.modPow(e, n);\n }", "public K setKey(K key);", "void configureWith(Message message);", "@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n int temp = letter - 'a' - key;\n decMsg[ind] = (char) ('a' + (char) ((temp < 0) ? temp + 26 : temp));\n } else if (letter >= 'A' && letter <= 'Z') {\n int temp = letter - 'A' - key;\n decMsg[ind] = (char) ('A' + (char) ((temp < 0) ? temp + 26 : temp));\n } else {\n decMsg[ind] = letter;\n }\n }\n return new String(decMsg);\n }\n }", "@Override\n public void send(String key, String data) throws IOException {\n\n }", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n encMsg[ind] = (char) ('a' + ((letter - 'a' + key) % 26));\n } else if (letter >= 'A' && letter <= 'Z') {\n encMsg[ind] = (char) ('A' + ((letter - 'A' + key) % 26));\n } else {\n encMsg[ind] = letter;\n }\n }\n return new String(encMsg);\n }\n }", "@Override\n public void setKey(byte[] key) {\n }", "private String getValueFromMessage(TextMessage message, String key){\n Map data = new Gson().fromJson(message.getPayload(),Map.class);\n return (String) data.get(key);\n }", "@Override\r\n public void update(String message) {\r\n send(message);\r\n }", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "OpenSSLKey mo134201a();", "public void processMessage(String message);", "int updateByPrimaryKeySelective(MessageGroup record);", "public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }", "@Override\n public Message converseMessage(final Message message) {\n //Preconditions\n assert message != null : \"message must not be null\";\n\n // handle operations\n return Message.notUnderstoodMessage(\n message, // receivedMessage\n this); // skill\n }", "public boolean sendHipChatMessage(String hipChatKey, String message) {\n\t\tthrow new NotImplementedException();\n\t}", "String process_key () throws BaseException;", "public MessageClackData(String userName, String message, String key, int type) {\n super(userName, type);\n this.message = encrypt(message, key);\n }", "void setKey(K key);", "short generateKeyAndWrap(byte[] applicationParameter, short applicationParameterOffset, byte[] publicKey, short publicKeyOffset, byte[] keyHandle, short keyHandleOffset, byte info);", "public String decrypt(String message) {\t\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//new message is the string that needs to be decrypted now \n\t\t//change the letters into numbers\n\t\tint [] decryptNums = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i < newMessage.length(); i++){\n\t\t\tchar c = newMessage.charAt(i);\n\t\t\tint x = alphabet.indexOf(c) + 1;\n\t\t\tdecryptNums[i] = x;\n\t\t}\n\n\n\t\t//generate key from those numbers\n\t\tint[] keyNum = new int [decryptNums.length];\n\t\tfor(int i=0; i<decryptNums.length; i++){\n\t\t\tint x = getKey();\n\t\t\tkeyNum[i] = x;\n\t\t}\n\n\t\t//subtract letter number from key number\n\t\tint[] finalNum = new int [keyNum.length];\n\t\tfor(int i=0; i<keyNum.length; i++){\n\t\t\tint x= decryptNums[i]-keyNum[i];\n\t\t\tif(keyNum[i] >=decryptNums[i] ){\n\t\t\t\tx = x+26;\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}else{\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}\n\t\t}\n\n\t\t//now re match the alphabet to it \n\t\tchar[] finalChar = new char [finalNum.length];\n\n\t\tfor(int i=0; i< finalNum.length; i++){\n\t\t\tint x = finalNum[i]-1;\n\t\t\tchar c = alphabet.charAt(x);\n\t\t\tfinalChar[i]=c;\n\t\t}\n\n\t\tString decrypt = \"\";\n\t\tfor(int i=0; i< finalChar.length; i++){\n\t\t\tdecrypt += finalChar[i];\n\t\t}\n\t\t\n\t\treturn decrypt;\n\t}", "public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }", "public static BigInteger blindSign(BigInteger message, RSAPrivateKey key) {\n\t\tBigInteger d = key.getPrivateExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\treturn message.modPow(d, N);\t\n\t}", "private void encode(){\r\n \r\n StringBuilder sb = new StringBuilder();\r\n \r\n /*\r\n *if a character code is >126 after adding the encryption key, subtract \r\n *95 to wrap\r\n */\r\n for(int i = 0; i < message.length(); i++){\r\n if(message.charAt(i) + key > 126){\r\n int wrappedKey = message.charAt(i) + key - 95;\r\n \r\n sb.append((char) wrappedKey);\r\n \r\n /*\r\n *if a character code ins't > 126 after adding the encryption key\r\n */\r\n } else{\r\n int wrappedKey = message.charAt(i) + key;\r\n sb.append( (char) wrappedKey);\r\n }\r\n }\r\n /*\r\n *case coded message to a string\r\n */\r\n codedMessage = sb.toString();\r\n }", "public static byte[] decrypt(byte[] message, byte[] key) throws Exception {\n byte[] initialValue = new byte[initialValueSize];\r\n System.arraycopy(message, 0, initialValue, 0, initialValueSize);\r\n IvParameterSpec initialValueSpec = new IvParameterSpec(initialValue);\r\n //get ciphertext from byte array input\r\n byte[] ciphertext = new byte[message.length - initialValueSize];\r\n\t\tSystem.arraycopy(message, initialValueSize, ciphertext, 0, message.length - initialValueSize);\r\n //initialize key, only 128 bits key for AES in Java\r\n key = Arrays.copyOf(hashMessage(key), 16);\r\n //initialize AES decryption algorithm\r\n\t\tSecretKeySpec keySpec = new SecretKeySpec(key, \"AES\");\r\n\t\tCipher aesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n\t\taesCipher.init(Cipher.DECRYPT_MODE, keySpec, initialValueSpec);\r\n //decrypt message by applying the decryption algorithm\r\n\t\tbyte[] decryptedMessage = aesCipher.doFinal(ciphertext);\r\n return decryptedMessage;\r\n\t}", "void privateSetAgregateKey(com.hps.july.persistence.StorageCardKey inKey) throws java.rmi.RemoteException;", "private static void keyExchange() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException {\r\n\t\t//receive from server\r\n\t\tPublicKey keyserver = cryptoMessaging.recvPublicKey(auctioneer.getInputStream());\r\n\t\t//receive from clients\r\n\t\tPublicKey keyclients[] = new PublicKey[3];\r\n\t\tbiddersigs = new PublicKey[3];\r\n\t\tInputStream stream;\r\n\t\tfor (int i=0; i < bidders.size(); i++) {\r\n\t\t\tstream=(bidders.get(i)).getInputStream();\r\n\t\t\tkeyclients[i] = cryptoMessaging.recvPublicKey(stream);\r\n\t\t\tbiddersigs[i] = keyclients[i];\r\n\t\t}\r\n\t\t//send to auctioneer\r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[0]); \r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[1]); \r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[2]); \r\n\t\t//send to clients\r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(0)).getOutputStream(), keyserver); \r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(1)).getOutputStream(), keyserver); \r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(2)).getOutputStream(), keyserver); \r\n\t\t\r\n\t\t\r\n\t\t// now receive paillier public keys from bidders and auctioneer\r\n\t\tauctioneer_pk = cryptoMessaging.recvPaillier(auctioneer.getInputStream());\r\n\t\tpk[0] = cryptoMessaging.recvPaillier((bidders.get(0)).getInputStream());\r\n\t\tpk[1] = cryptoMessaging.recvPaillier((bidders.get(1)).getInputStream());\r\n\t\tpk[2] = cryptoMessaging.recvPaillier((bidders.get(2)).getInputStream());\r\n\t}", "int updateByPrimaryKeySelective(TbMessage record);", "void respondToMessage(Map<String, String> message);", "void interpretMessage(final Message message);", "public void setKey(int key);", "public void setKey(int key);", "public abstract String decryptMsg(String msg);", "public byte[] apply(byte[] m, boolean publicKey)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\treturn this.apply(new BigInteger(m), publicKey).toByteArray();\r\n\t}", "protected PKIMessage protectPKIMessage(PKIMessage msg, boolean badObjectId, String password, String keyId, int iterations) throws NoSuchAlgorithmException,\n NoSuchProviderException, InvalidKeyException {\n PKIHeader head = msg.getHeader();\n if(keyId != null) {\n \thead.setSenderKID(new DEROctetString(keyId.getBytes()));\n }\n // SHA1\n AlgorithmIdentifier owfAlg = new AlgorithmIdentifier(\"1.3.14.3.2.26\");\n // 567 iterations\n int iterationCount = iterations;\n DERInteger iteration = new DERInteger(iterationCount);\n // HMAC/SHA1\n AlgorithmIdentifier macAlg = new AlgorithmIdentifier(\"1.2.840.113549.2.7\");\n byte[] salt = \"foo123\".getBytes();\n DEROctetString derSalt = new DEROctetString(salt);\n\n // Create the new protected return message\n String objectId = \"1.2.840.113533.7.66.13\";\n if (badObjectId) {\n objectId += \".7\";\n }\n PBMParameter pp = new PBMParameter(derSalt, owfAlg, iteration, macAlg);\n AlgorithmIdentifier pAlg = new AlgorithmIdentifier(new DERObjectIdentifier(objectId), pp);\n head.setProtectionAlg(pAlg);\n PKIBody body = msg.getBody();\n PKIMessage ret = new PKIMessage(head, body);\n\n // Calculate the protection bits\n byte[] raSecret = password.getBytes();\n byte[] basekey = new byte[raSecret.length + salt.length];\n for (int i = 0; i < raSecret.length; i++) {\n basekey[i] = raSecret[i];\n }\n for (int i = 0; i < salt.length; i++) {\n basekey[raSecret.length + i] = salt[i];\n }\n // Construct the base key according to rfc4210, section 5.1.3.1\n MessageDigest dig = MessageDigest.getInstance(owfAlg.getObjectId().getId(), \"BC\");\n for (int i = 0; i < iterationCount; i++) {\n basekey = dig.digest(basekey);\n dig.reset();\n }\n // For HMAC/SHA1 there is another oid, that is not known in BC, but the\n // result is the same so...\n String macOid = macAlg.getObjectId().getId();\n byte[] protectedBytes = ret.getProtectedBytes();\n Mac mac = Mac.getInstance(macOid, \"BC\");\n SecretKey key = new SecretKeySpec(basekey, macOid);\n mac.init(key);\n mac.reset();\n mac.update(protectedBytes, 0, protectedBytes.length);\n byte[] out = mac.doFinal();\n DERBitString bs = new DERBitString(out);\n\n // Finally store the protection bytes in the msg\n ret.setProtection(bs);\n return ret;\n }", "public void setKey(final String key);", "public void setKey(final String key);", "public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\treturn new BigInteger(cipher.doFinal(message.toByteArray()));\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "void setKey(java.lang.String key);", "public void setKey(byte[] argKey) {\n this.key = argKey;\n }", "boolean editMessage(int roomId, long messageId, String updatedMessage) throws RoomNotFoundException, RoomPermissionException, IOException;", "@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n int actKey = key % 65536;\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n decMsg[ind] = (char) ((letter - actKey < 0) ? letter - actKey + 65536 : letter - actKey);\n }\n return new String(decMsg);\n }\n }", "@Override\n\tpublic void visit(SendRSAKey srsak) {\n\t\t\n\t}", "public abstract void update(Message message);", "void setKey(final String key);", "Object routeMessage(Message message) throws IOException;", "String encode(File message, File key,File crypted);", "public static void setUserKey(Key newKey) {\n\t\tlocalKey.set(newKey);\n\t}", "@Override\n public void sendMessage(String from, String to, Message message){\n this.sendingPolicy.sendViaPolicy(from, to, message);\n //local persistence\n updateMessage(message);\n }", "public static String encrypt(String message, String randomkey) throws GeneralSecurityException {\n //Log.d(\"Jsonmessage\",message);\n try {\n final SecretKeySpec key = new SecretKeySpec(ENCRYPTION_SECRET_KEY.getBytes(), \"AES\");\n\n // byte[] cipherText = encrypt(key, ApiConfig.ENCRYPTION_IV_KEY.getBytes(), message.getBytes(CHARSET));\n byte[] cipherText = encrypt(key, randomkey.getBytes(), message.getBytes(CHARSET));\n //Log.d(\"SecretKey123\",cipherText.toString());\n String encoded = Base64.encodeToString(cipherText, Base64.NO_WRAP);\n //Log.d(\"SecretKey\",encoded);\n return encoded;\n } catch (UnsupportedEncodingException e) {\n if (DEBUG_LOG_ENABLED)\n Log.e(TAG, \"UnsupportedEncodingException \", e);\n throw new GeneralSecurityException(e);\n }\n }", "void setKey(String key);", "String encryption(Long key, String encryptionContent);", "String getPublicKeyActorReceive();", "public abstract void sendPrivateMessage(String nickname, String message);", "int updateByPrimaryKeySelective(MessageRelation record);", "public void inject(@NotNull ApiRequestMessage message) {\n String key = getHashKey(message);\n Map<String, String> cookies = redisTemplate.<String, String>opsForHash().entries(key);\n StringBuilder sb = new StringBuilder();\n for (Map.Entry<String, String> cookie : cookies.entrySet()) {\n sb.append(cookie.getKey()).append(\"=\\\"\").append(cookie.getValue()).append(\"\\\";\");\n }\n // delete last <code>;</code>\n sb.deleteCharAt(sb.length() - 1);\n ApiRequestMessageHelper.addCookies(message, sb.toString());\n }", "public String tselEncrypt(String key, String message)\n\t{\n\n\t\tif (key == null || key.equals(\"\")) \n\t\t{\n\t\t\treturn message;\n\t\t}\n\n\t\tif (message == null || message.equals(\"\")) \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\tCryptoUtils enc = new CryptoUtils(key, Cipher.ENCRYPT_MODE);\n\n\t\tString messageEnc = enc.process(message);\n\n\t\treturn messageEnc;\n\t}", "public void processMessage(DeviceMateMessage m);" ]
[ "0.61313874", "0.5535448", "0.5534232", "0.53950053", "0.53553337", "0.53515285", "0.53339976", "0.53294563", "0.5312902", "0.52978766", "0.52834445", "0.5233329", "0.52206445", "0.5145952", "0.5134504", "0.5132007", "0.5103837", "0.5085589", "0.5081412", "0.5049221", "0.5020259", "0.4990713", "0.49816", "0.49737474", "0.49423945", "0.49299613", "0.49208897", "0.4916115", "0.48860714", "0.48788318", "0.4853103", "0.4851814", "0.48488295", "0.48414093", "0.48411018", "0.48391324", "0.48372674", "0.48198876", "0.4788458", "0.47704637", "0.47658014", "0.47618416", "0.47613886", "0.47256857", "0.47228497", "0.46934646", "0.46828714", "0.46801174", "0.46644542", "0.46644112", "0.4649071", "0.4645658", "0.46441028", "0.46245834", "0.4617429", "0.4607342", "0.45924196", "0.4589615", "0.4589546", "0.4588372", "0.4578422", "0.45752922", "0.45678523", "0.4559707", "0.4557922", "0.45550624", "0.45547688", "0.45498228", "0.45400903", "0.45296803", "0.45260614", "0.45248526", "0.45206884", "0.45206884", "0.45087025", "0.4503919", "0.4496891", "0.44948623", "0.44948623", "0.44912934", "0.4491047", "0.44862962", "0.44826144", "0.4478238", "0.4471916", "0.4470922", "0.4457987", "0.4454981", "0.44511405", "0.44500682", "0.44484925", "0.44482774", "0.44450688", "0.44435278", "0.44344553", "0.44256696", "0.442507", "0.44188008", "0.44173288", "0.4417125" ]
0.4665744
48
Apply the requested key (either public or private) to the given message byte array.
public byte[] apply(byte[] m, boolean publicKey) throws NullPointerException, IllegalArgumentException, ArithmeticException { return this.apply(new BigInteger(m), publicKey).toByteArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dispatchMessage(KeyedMessage<byte[], byte[]> msg);", "@Override\n\tpublic void processMessage(byte[] message) {\n\t}", "@Override\n public void setKey(byte[] key) {\n }", "public byte[] get(byte[] key);", "public boolean put(byte[] key, byte[] value) throws Exception;", "public byte[] decrypt(byte[] message, PrivateKey key) throws GeneralSecurityException {\n ByteBuffer buffer = ByteBuffer.wrap(message);\n int keyLength = buffer.getInt();\n byte[] encyptedPublicKey = new byte[keyLength];\n buffer.get(encyptedPublicKey);\n\n Cipher cipher = Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n\n byte[] encodedPublicKey = cipher.doFinal(encyptedPublicKey);\n\n aes.setKeyValue(new String(encodedPublicKey));\n byte[] encryptedMessage = new byte[buffer.remaining()];\n buffer.get(encryptedMessage);\n String decrypt_message = \"\";\n try {\n decrypt_message = aes.decrypt(new String(encryptedMessage));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return decrypt_message.getBytes();\n }", "public static byte[] decrypt(byte[] message, byte[] key) throws Exception {\n byte[] initialValue = new byte[initialValueSize];\r\n System.arraycopy(message, 0, initialValue, 0, initialValueSize);\r\n IvParameterSpec initialValueSpec = new IvParameterSpec(initialValue);\r\n //get ciphertext from byte array input\r\n byte[] ciphertext = new byte[message.length - initialValueSize];\r\n\t\tSystem.arraycopy(message, initialValueSize, ciphertext, 0, message.length - initialValueSize);\r\n //initialize key, only 128 bits key for AES in Java\r\n key = Arrays.copyOf(hashMessage(key), 16);\r\n //initialize AES decryption algorithm\r\n\t\tSecretKeySpec keySpec = new SecretKeySpec(key, \"AES\");\r\n\t\tCipher aesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n\t\taesCipher.init(Cipher.DECRYPT_MODE, keySpec, initialValueSpec);\r\n //decrypt message by applying the decryption algorithm\r\n\t\tbyte[] decryptedMessage = aesCipher.doFinal(ciphertext);\r\n return decryptedMessage;\r\n\t}", "public void process(Key msg) throws IOException {\n relay(msg);\n }", "public void setKey(byte[] argKey) {\n this.key = argKey;\n }", "public byte[] encrypt(final String message) throws KeyException {\n if (key == null) {\n throw new KeyException(\"Secret key not set\");\n }\n\n try {\n final Cipher cipher = Cipher.getInstance(\"AES\");\n cipher.init(Cipher.ENCRYPT_MODE, key);\n\n return cipher.doFinal(message.getBytes());\n } catch (NoSuchAlgorithmException |\n NoSuchPaddingException |\n InvalidKeyException |\n BadPaddingException |\n IllegalBlockSizeException e) {\n e.printStackTrace();\n throw new UnsupportedOperationException();\n }\n }", "public void processMessage(byte[] message) {\n try {\n Object receivedMessage = Serializer.deserialize(message);\n processMessage(receivedMessage);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "public byte[] encrypt(byte[] input, KeyPair keyPair) throws Exception {\n\t\treturn encrypt(input, keyPair.getPublic());\n\t}", "public byte[] encrypt(byte[] input, Key pubKey) throws Exception {\n\t\tcipher.init(Cipher.ENCRYPT_MODE, pubKey);\n\t\treturn cipher.doFinal(input);\n\t}", "@Override\n int doCryptoOperation(byte[] arrby, byte[] object) throws BadPaddingException, IllegalBlockSizeException {\n if (this.encrypting) {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n try {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n catch (SignatureException signatureException) {\n object = new IllegalBlockSizeException();\n ((Throwable)object).initCause(signatureException);\n throw object;\n }\n }", "public void process(PublicKey msg) throws IOException {\n usersConnected.get(msg.getSource()).setPublicKeyPair(msg.getMessage());\n bradcast(msg);\n }", "byte[] getKey();", "public void setKeyBytes(byte[] key){\n\t\t\n\t\tsetKey(new String(key));\n\t}", "@Override\n public void setKey(byte[] key) throws IllegalArgumentException{\n if ( key.length != keySize() ) throw new IllegalArgumentException(\"key not the right length.\");\n System.arraycopy(key,ciper.keySize(),nonce,0,8);\n System.arraycopy(key, 0, this.key, 0, ciper.keySize());\n ciper.setKey(this.key);\n ciper.encrypt(nonce);\n }", "public abstract void processMsg(ConsumerRecord<byte[], byte[]> record);", "byte unwrap(byte[] keyHandle, short keyHandleOffset, short keyHandleLength, byte[] applicationParameter, short applicationParameterOffset, ECPrivateKey unwrappedPrivateKey);", "public HNSHK(byte[] message) {\n super(message);\n }", "short generateKeyAndWrap(byte[] applicationParameter, short applicationParameterOffset, byte[] publicKey, short publicKeyOffset, byte[] keyHandle, short keyHandleOffset, byte info);", "public static byte[] encrypt(byte[] message, SecretKeySpec keySpec)\n {\n\tbyte[] ret = null;\n\t\t\n\ttry {\n\t // Initialize the cipher with the given key\n\t Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t cipher.init(Cipher.ENCRYPT_MODE, keySpec);\n\t\t\t\n\t // encrypt the message\n\t byte[] cipherText = cipher.doFinal(message);\n\t byte[] params = cipher.getParameters().getEncoded();\n\t\t\t\n\t // Combine the ciphertext and cipher parameters into one byte array\n\t ret = new byte[cipherText.length+params.length];\n\t System.arraycopy(cipherText, 0, ret, 0, cipherText.length); \n\t System.arraycopy(params, 0, ret, cipherText.length, params.length);\n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t}\n\t\t\n\treturn ret;\n }", "private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }", "public byte[] Cypher(byte[] bArr)\r\n {\r\n for(int i = 0; i < bArr.length; i++)\r\n bArr[i] = (byte)(bArr[i] ^ key);\r\n return bArr;\r\n }", "public void addMessage(byte[] message) throws RemoteException;", "public abstract Key translateKey(Key key) throws InvalidKeyException;", "private void process(ByteBuffer output, final byte[] input, int inPos, KeyStream keyStream) {\n ByteBuffer buf = ByteBuffer.allocate(BLOCK_SIZE_IN_BYTES).order(ByteOrder.LITTLE_ENDIAN);\n int pos = inPos;\n int inLen = input.length - inPos;\n int todo;\n while (inLen > 0) {\n todo = inLen < BLOCK_SIZE_IN_BYTES ? inLen : BLOCK_SIZE_IN_BYTES;\n buf.asIntBuffer().put(keyStream.next());\n for (int j = 0; j < todo; j++, pos++) {\n output.put((byte) (input[pos] ^ buf.get(j)));\n }\n inLen -= todo;\n }\n }", "boolean remove(byte[] key);", "public void put(@NonNull final String key, final byte[] value) {\n put(key, value, -1);\n }", "public boolean addKey (Message msg) {\n return addKey(Crypto.decodeKey(msg.ADDKEYgetKey()));\n }", "public CryptObject encrypt(BigIntegerMod message);", "public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);", "public void update(byte[] paramArrayOfbyte) throws XMLSignatureException {\n/* 207 */ this.signatureAlgorithm.engineUpdate(paramArrayOfbyte);\n/* */ }", "byte[] getActualRowKey(ConsumerConfig consumerConfig, byte[] originalRowKey);", "void passMessageToReceiver(String ccid, byte[] serializedMessage);", "public void setMessage(String message){\r\n this.message = message;\r\n key = randNumber.nextInt(50) + 1; \r\n\r\n encode();\r\n }", "public String encrypt(String message) {\t\n\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//this creates an array with the numbers that are keys \n\t\tint [] numberOfLetters = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i< newMessage.length(); i++){\n\t\t\tfor(int j=0; j< alphabet.length(); j++){\n\t\t\t\tif(newMessage.charAt(i) == alphabet.charAt(j)){ //if they have the same letter\n\t\t\t\t\tnumberOfLetters[i]=j+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\n\t\t//creates an array of the keys\n\t\tint [] key = new int[numberOfLetters.length];\n\t\tint keys;\n\t\tfor(int i=0; i< numberOfLetters.length; i++){\n\t\t\tkeys = getKey();\n\t\t\tkey[i] = keys;\n\t\t}\n\t\n\t\t//create an array for what we encrypted \n\t\tint [] encryptNum = new int[key.length];\n\t\tfor(int i=0; i< key.length; i++){\n\t\t\tint value = numberOfLetters[i] + key[i];\n\t\t\tif(value > 26){\n\t\t\t\tvalue = value-26;\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}else{\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}\n\t\t}\n\n\t\t//turn encryption into letters \n\t\tString encrypt = \"\";\n\t\tchar [] let = new char [encryptNum.length];\n\n\t\tfor(int i=0; i< encryptNum.length; i++){\n\t\t\tint x = encryptNum[i]-1;\n\t\t\tlet[i] = alphabet.charAt(x);\n\t\t}\n\n\t\tfor(int j=0; j< let.length; j++){\n\t\t\tencrypt += let[j];\n\t\t}\n\n\t\t// COMPLETE THIS METHOD\n\t\t// THE FOLLOWING LINE HAS BEEN ADDED TO MAKE THE METHOD COMPILE\n\n\t\treturn encrypt;\n\t}", "public byte[] decrypt(byte[] input, KeyPair keyPair) throws Exception {\n\t\treturn decrypt(input, keyPair.getPrivate());\t\n\t}", "void encode(ByteBuffer buffer, Message message);", "byte[] encode(IMessage message) throws IOException;", "public void sendMessageAsByte(byte [] message) {\r\n try {\r\n out.writeInt(message.length);\r\n out.write(message);\r\n out.flush();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void setKey(MessageKey key) {\n\tthis.key = key;\n }", "public byte[] signMessage(PrivateKey key, byte[] message) {\n\t\ttry {\n\t\t\tif (signatureEngine == null) {\n\t\t\t\tsignatureEngine = TOMUtil.getSigEngine();\n\t\t\t}\n\t\t\tbyte[] result = null;\n\n\t\t\tsignatureEngine.initSign(key);\n\t\t\tsignatureEngine.update(message);\n\t\t\tresult = signatureEngine.sign();\n\n\t\t\t// st.store(System.nanoTime() - startTime);\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Failed to sign message\", e);\n\t\t\treturn null;\n\t\t}\n\t}", "abstract void onMessage(byte[] message);", "public void setCodedMessage(String codedMessage, int key){ \r\n this.codedMessage = codedMessage;\r\n this.key = key;\r\n decode();\r\n }", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n encMsg[ind] = (char) ((letter + key) % 65536);\n }\n return new String(encMsg);\n }\n }", "public static void publishMessage(final String key,final String message) throws IOException{\n\t\tString msg=null;\n\t\ttry {\n\t\t\t\n\t\t\t//If we need to make any Transformation on the message.\n\t\t\tif(Boolean.parseBoolean(ConfigLoader.getProp(Constants.ENABLETRANSFORMATION))){\n\t\t\t\tmsg = CBMessageTransformerFactory.INSTANCE.createCBMessageConverter().convert(key, message);\n\t\t\t}else{\n\t\t\t\tmsg=message;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t//If any exception, perform no conversion\n\t\t}\n\t\t\n\t\tif(msg!=null && msg.trim().length()>0){\n\t\t\t//Wrap KEY/VALUE in JSON -format {\\\"KEY\\\":\\\"<CBKEY>\\\",\\\"VALUE\\\":<CBVALUE>}\n\t\t\tString cbmessage=Constants.KAFKA_MESSAGE.replace(\"[CBKEY]\", key);\n\t\t\tcbmessage=cbmessage.replace(\"[CBVALUE]\", msg);\n\t\t\t\n\t\t\tKeyedMessage<String, String> data = new KeyedMessage<String, String>(ConfigLoader.getKafkaConfigProps().getProperty(Constants.TOPIC_NAME), key, cbmessage);\n\t\t\t\n\t\t\t//property producer.type indicates async/sync message\n\t\t\tif(data!=null) producer.send(data);\n\t\t}\n\t}", "OpenSSLKey mo134201a();", "public byte[][] keyExpansion(byte[] key) {\n\n int keySizeBits = key.length*8;\n\n //Define N as the length of the key in 32-bit words:\n //4 words for AES-128, 6 words for AES-192, and 8 words for AES-256\n int N = 0;\n if(keySizeBits == 128) N = 4;\n else if (keySizeBits == 192) N = 6;\n else if(keySizeBits == 256)N = 8;\n else throw new RuntimeException(\"UnsupportedKeySizeException\");\n\n //Define K_0, K_1, ... K_(N-1) as the 32-bit words of the original key\n byte[][] K = new byte[N][4];\n byte[] keyBytes = key;\n for(int i = 0; i < N; i++) {\n byte[] subBytes = new byte[]{keyBytes[4*i], keyBytes[4*i+1], keyBytes[4*i+2], keyBytes[4*i+3]};\n K[i] = subBytes;\n }\n\n //Define W_0, W_1, ... W_(4R-1) as the 32-bit words of the expanded key\n int R = 0;\n if(keySizeBits == 128) R = 11;\n else if (keySizeBits == 192) R = 13;\n else if(keySizeBits == 256)R = 15;\n else throw new RuntimeException(\"UnsupportedKeySizeException\");\n byte[][] W = new byte[4*R][4];\n\n for(int i = 0; i < 4*R; i++) {\n if(i < N)\n W[i] = K[i];\n else if(i >= N && i%N == 0)\n W[i] = applyXor(applyXor(W[i-N],subWord(rotWord(W[i-1]),false)),\n new byte[]{(byte)rConst(i/N), 0, 0, 0});\n else if(i >= N && N > 6 && i%4 == 0)\n W[i] = applyXor(W[i-N], rotWord(W[i-1]));\n else W[i] = applyXor(W[i-N], W[i-1]);\n\n /*\n StringBuilder builder = new StringBuilder();\n builder.append(\"W[\"+i+\"]=\");\n builder.append(Integer.toHexString(W[i][0])+\" \");\n builder.append(Integer.toHexString(W[i][1])+\" \");\n builder.append(Integer.toHexString(W[i][2])+\" \");\n builder.append(Integer.toHexString(W[i][3])+\" \");\n\n System.out.println(new String(builder));\n */\n\n }\n\n return W;\n }", "boolean containsKey(byte[] key);", "public void sendBytes(byte[] msg);", "public abstract String encryptMsg(String msg);", "public byte[] fromMessage(Message message) throws IOException, JMSException;", "public void send(String providedTopic,V msg,K providedKey);", "public Add128(byte[] bytekey) {\n key=bytekey;\n }", "public String encrypt(String message, int key)\n\t{\n\t\tString encryptedMessage = \"\";\n\t\tchar ch;\n \n\t\tfor(int i = 0; i < message.length(); ++i){\n\t\t\tch = message.charAt(i);\n\t\t\t\n\t\t\tif(ch >= 'a' && ch <= 'z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'z'){\n\t ch = (char)(ch - 'z' + 'a' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else if(ch >= 'A' && ch <= 'Z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'Z'){\n\t ch = (char)(ch - 'Z' + 'A' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else {\n\t \tencryptedMessage += ch;\n\t }\n\t\t}\n return encryptedMessage;\n\t}", "private void sendMessage(String message) {\n\n // we need to encrypt message using destination public-key\n if (destinationPublicKey == null) return;\n\n /**\n * Encrypt Message Here\n */\n PublicKey publicKey = getPublicKey(Base64.decode(destinationPublicKey, Base64.URL_SAFE));\n KeyPair keyPair = new KeyPair(publicKey, null);\n SecurityKey securityKey = new SecurityKey(keyPair);\n String encryptedMessage = securityKey.encrypt(message);\n\n socket.emit(\"message\", encryptedMessage);\n\n // add raw text to recycler_view\n messages.add(new Message(nickname,messageEditText.getText().toString(),0));\n\n ChatAdapter adapter = new ChatAdapter(getApplicationContext(),messages);\n adapter.notifyDataSetChanged();\n\n chatRecyclerView.setAdapter(adapter);\n\n // clear text box\n messageEditText.setText(\"\");\n }", "private static byte[] generate(final byte[] buffer, final PrivateKey key) {\r\n\r\n\t\tbyte[] data = null;\r\n\r\n\t\ttry {\r\n\t\t\tfinal X509EncodedKeySpec spec = new X509EncodedKeySpec(buffer);\r\n\t\t\tfinal KeyFactory kf = getKeyFactory();\r\n\t\t\tfinal PublicKey pk = kf.generatePublic(spec);\r\n\t\t\tdata = SharedSecret.doKeyExchange(key, pk);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfinal String msg = Utils.toMessage(e);\r\n\t\t\tLOG.error(msg);\r\n\t\t\tLOG.debug(msg, e);\r\n\t\t\tdata = new byte[0];\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}", "MapBuilder<K,V> keyInjection(Injection<K, byte[]> keyInjection);", "private void handle(BytesMessage<?> message) {\n\t\tByteArrayOutputStream stream = new ByteArrayOutputStream();\n\t\tfor(byte[] i: this.messages) {\n\t\t\ttry {\n\t\t\t\tstream.write(i);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tbyte[] buffer = stream.toByteArray();\n\t\ttry {\n\t\t\tstream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t//deserialize message\n\t\tKryo kryo = new Kryo();\n\t\tFieldSerializer fieldSerializer = new FieldSerializer(kryo, LargeMessage.class);\n\t\t//deserialize message, receiver attribute is not serialized\n\t\tfieldSerializer.removeField(\"receiver\");\n\t\tkryo.register(LargeMessage.class, fieldSerializer);\n\n\t\tInput input = new Input(new ByteArrayInputStream(buffer));\n\t\tLargeMessage deserializedMessage = kryo.readObject(input, LargeMessage.class);\n\t\tinput.close();\n\n\t\tmessage.getReceiver().tell(deserializedMessage.getMessage(), message.getSender());\n\t}", "public void setMessageKey(String messageKey) {\n this.messageKey = messageKey;\n }", "public byte[] Tencryption() {\n int[] ciphertext = new int[message.length];\n\n for (int j = 0, k = 1; j < message.length && k < message.length; j = j + 2, k = k + 2) {\n sum = 0;\n l = message[j];\n r = message[k];\n for (int i = 0; i < 32; i++) {\n sum = sum + delta;\n l = l + (((r << 4) + key[0]) ^ (r + sum) ^ ((r >> 5) + key[1]));\n r = r + (((l << 4) + key[2]) ^ (l + sum) ^ ((l >> 5) + key[3]));\n }\n ciphertext[j] = l;\n ciphertext[k] = r;\n }\n return this.Inttobyte(ciphertext);\n\n }", "public byte[] encrypt(byte[] data, PublicKey publicUserKey) throws EncryptingException {\n try {\n return RSA.encrypt(data, publicUserKey);\n } catch (Exception e) {\n throw new EncryptingException();\n }\n }", "public byte[] pad(byte[] message)\n {\n final int blockBits = 512;\n final int blockBytes = blockBits / 8;\n\n // new message length: original + 1-bit and padding + 8-byte length\n int newMessageLength = message.length + 1 + 8;\n int padBytes = blockBytes - (newMessageLength % blockBytes);\n newMessageLength += padBytes;\n\n // copy message to extended array\n final byte[] paddedMessage = new byte[newMessageLength];\n System.arraycopy(message, 0, paddedMessage, 0, message.length);\n\n // write 1-bit\n paddedMessage[message.length] = (byte) 0b10000000;\n\n // skip padBytes many bytes (they are already 0)\n\n // write 8-byte integer describing the original message length\n int lenPos = message.length + 1 + padBytes;\n ByteBuffer.wrap(paddedMessage, lenPos, 8).putLong(message.length * 8);\n\n return paddedMessage;\n }", "@Override\n\tpublic void setMessageKey(String key) {\n\t\tsuper.setMessageKey(key);\n\t}", "@Override\n\tpublic void decodeMsg(byte[] message) {\n\t\t\n\t\tIoBuffer buf = IoBuffer.allocate(message.length).setAutoExpand(true);\n\t\tbuf.put(message);\n\t\tbuf.flip();\n\t\t\n\t\tslaveId = buf.get();\n\t\tcode = buf.get();\n\t\toffset = buf.getShort();\n\t\tdata = buf.getShort();\n\n\t\tif(buf.remaining() >= 2)\n\t\t\tcrc16 = buf.getShort();\n\t}", "protected abstract void mergeFrom(byte[] data, int offset, int length, Message message, Schema schema) \r\n throws IOException;", "public static void setKey(byte[] key) {\n SquareAttack.key = key.clone();\n MainFrame.printToConsole(\"Chosen key:\");\n for (byte b : key) {\n MainFrame.printToConsole(\" \".concat(MainFrame.byteToHex(b)));\n }\n MainFrame.printToConsole(\"\\n\");\n }", "private byte[] processPayload(byte[] message) {\n\t\treturn ComMethods.processPayload(currentUser.getBytes(), message, counter-1, currentSessionKey, simMode);\n\t}", "@Override\n\t\t\tpublic IAMQPPublishAction message(byte[] message) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic IAMQPPublishAction message(byte[] message) {\n\t\t\t\treturn null;\n\t\t\t}", "byte[] encrypt(String message) throws SatispayException {\n\t\tString key;\n\t\tSignature privateSignature;\n\t\ttry {\n\t\t\tkey = new String(Files.readAllBytes(new File(privateKeyPath).toPath()), Charset.defaultCharset());\n\t\t\tString privateKeyPEM = key.replace(\"-----BEGIN PRIVATE KEY-----\", \"\").replaceAll(System.lineSeparator(), \"\")\n\t\t\t\t\t.replaceAll(\"\\\\R\", \"\").replace(\"-----END PRIVATE KEY-----\", \"\");\n\t\t\tbyte[] keyBytes = Base64.getDecoder().decode(privateKeyPEM);\n\t\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\t\tPKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);\n\t\t\t\n\t\t\tprivateSignature = Signature.getInstance(\"SHA256withRSA\");\n\t\t\tprivateSignature.initSign(keyFactory.generatePrivate(keySpec));\n\t privateSignature.update(message.getBytes(\"UTF-8\"));\n\t\t} catch (IOException e) {\n\t\t\tthrow new SatispayException(\"Cannot read key\", e.getCause());\n\t\t} catch (InvalidKeyException e) {\n\t\t\tthrow new SatispayException(\"Invalid key\", e.getCause());\n\t\t} catch (InvalidKeySpecException e) {\n\t\t\tthrow new SatispayException(\"Invalid spec\", e.getCause());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new SatispayException(\"Wrong algorithm\", e.getCause());\n\t\t} catch (SignatureException e) {\n\t\t\tthrow new SatispayException(\"Wrong instance\", e.getCause());\n\t\t}\n\n\t\ttry {\n\t\t\treturn privateSignature.sign();\n\t\t} catch (SignatureException e) {\n\t\t\tthrow new SatispayException(\"error in sign\", e.getCause());\n\t\t}\n\t}", "public static BigInteger blind(BigInteger message, BigInteger r, RSAPublicKey publicKey) {\n\t\tBigInteger e = publicKey.getPublicExponent();\n\t\tBigInteger N = publicKey.getModulus();\n\n\t\treturn message.multiply(r.modPow(e, N)).mod(N);\n\t}", "private void handleHandshakeMessage(UUID peerID, byte[] message) {\n UUID newPeerID = ByteAuxiliary.recoverUUID(message);\n\n handler.handleHandshakeMessage(peerID, newPeerID);\n }", "public byte[] encrypt(byte[] input, String publicKeyFilePath) throws Exception {\n\t\treturn encrypt(input, getPublicKey(publicKeyFilePath));\n\t}", "public void AddMsgToKeyView(int viewID, String message)\n\t{\n\t\tMessage msg = mKeyViewHandler.obtainMessage(viewID, message);\n\t\tmKeyViewHandler.sendMessage(msg);\n\t}", "public Message(String key) {\n this.key = key;\n }", "byte[] encrypt(String plaintext);", "public abstract void handleMessage(byte[] messageBytes,\n String senderHostName) throws IOException;", "@Override\n public void send(String key, String data) throws IOException {\n\n }", "public boolean delete(byte[] key) throws Exception;", "public static BiFunction<String, Message, Object> byteProvider(Function<byte[], Object> fun)\n {\n \n return (string, msg) -> {\n byte[] src = null;\n if (string != null)\n src = StringUtil.toUtfBytes(string);\n else\n src = msg.bytes();\n \n return fun.apply(src);\n };\n \n }", "public static byte[] rc4(byte[] data, byte[] key) {\n if (data == null || data.length == 0 || key == null) return null;\n if (key.length < 1 || key.length > 256) {\n throw new IllegalArgumentException(\"key must be between 1 and 256 bytes\");\n }\n final byte[] iS = new byte[256];\n final byte[] iK = new byte[256];\n int keyLen = key.length;\n for (int i = 0; i < 256; i++) {\n iS[i] = (byte) i;\n iK[i] = key[i % keyLen];\n }\n int j = 0;\n byte tmp;\n for (int i = 0; i < 256; i++) {\n j = (j + iS[i] + iK[i]) & 0xFF;\n tmp = iS[j];\n iS[j] = iS[i];\n iS[i] = tmp;\n }\n\n final byte[] ret = new byte[data.length];\n int i = 0, k, t;\n for (int counter = 0; counter < data.length; counter++) {\n i = (i + 1) & 0xFF;\n j = (j + iS[i]) & 0xFF;\n tmp = iS[j];\n iS[j] = iS[i];\n iS[i] = tmp;\n t = (iS[i] + iS[j]) & 0xFF;\n k = iS[t];\n ret[counter] = (byte) (data[counter] ^ k);\n }\n return ret;\n }", "public byte[] encrypt(final PrivateKeyInterface key, final byte[] data)\n {\n return this.encryptionCipher().encrypt(key, data);\n }", "PublicKey decodePublicKey(byte[] encoded) throws IOException;", "private byte[] handleUpdate(byte[] message) {\n\t\tbyte[] newSecretBytes = Arrays.copyOfRange(message, \"update:\".getBytes().length, message.length);\n\n/*\n\t\tSystem.out.println(\"THIS IS A TEST:\");\n\t\tSystem.out.println(\"newSecretBytes:\");\n\t\tComMethods.charByChar(newSecretBytes, true);\n\t\tSystem.out.println(\"newSecretBytes, reversed:\");\n\t\tString toStr = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tbyte[] fromStr = DatatypeConverter.parseBase64Binary(toStr);\n\t\tComMethods.charByChar(fromStr, true);\n*/\n\t\tString newSecret = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tboolean success = replaceSecretWith(currentUser, newSecret);\n\t\t\n\t\tif (success) {\n\t\t\tComMethods.report(\"SecretServer has replaced \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"secretupdated\".getBytes());\n\t\t} else {\n\t\t\tComMethods.report(\"SecretServer has FAILED to replace \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"writingfailure\".getBytes());\n\t\t}\n\t}", "public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }", "private synchronized void makeKey (Key key)\n throws KeyException {\n\n byte[] userkey = key.getEncoded();\n if (userkey == null)\n throw new KeyException(\"Null LOKI91 key\");\n\n // consider only 8 bytes if user data is longer than that\n if (userkey.length < 8)\n throw new KeyException(\"Invalid LOKI91 user key length\");\n\n // If native library available then use it. If not or if\n // native method returned error then revert to 100% Java.\n\n if (native_lock != null) {\n synchronized(native_lock) {\n try {\n linkStatus.check(native_ks(native_cookie, userkey));\n return;\n } catch (Error error) {\n native_finalize();\n native_lock = null;\nif (DEBUG && debuglevel > 0) debug(error + \". Will use 100% Java.\");\n }\n }\n }\n\n sKey[0] = (userkey[0] & 0xFF) << 24 |\n (userkey[1] & 0xFF) << 16 |\n (userkey[2] & 0xFF) << 8 |\n (userkey[3] & 0xFF);\n sKey[1] = sKey[0] << 12 | sKey[0] >>> 20;\n sKey[2] = (userkey[4] & 0xFF) << 24 |\n (userkey[5] & 0xFF) << 16 |\n (userkey[6] & 0xFF) << 8 |\n (userkey[7] & 0xFF);\n sKey[3] = sKey[2] << 12 | sKey[2] >>> 20;\n\n for (int i = 4; i < ROUNDS; i += 4) {\n sKey[i ] = sKey[i - 3] << 13 | sKey[i - 3] >>> 19;\n sKey[i + 1] = sKey[i ] << 12 | sKey[i ] >>> 20;\n sKey[i + 2] = sKey[i - 1] << 13 | sKey[i - 1] >>> 19;\n sKey[i + 3] = sKey[i + 2] << 12 | sKey[i + 2] >>> 20;\n }\n }", "int updateByPrimaryKeyWithBLOBs(TbMessage record);", "public XoxoMessage encrypt(String message) {\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey));\n }", "void setP( byte[] buffer, short offset, short length) throws CryptoException;", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n encMsg[ind] = (char) ('a' + ((letter - 'a' + key) % 26));\n } else if (letter >= 'A' && letter <= 'Z') {\n encMsg[ind] = (char) ('A' + ((letter - 'A' + key) % 26));\n } else {\n encMsg[ind] = letter;\n }\n }\n return new String(encMsg);\n }\n }", "public void update(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) throws XMLSignatureException {\n/* 231 */ this.signatureAlgorithm.engineUpdate(paramArrayOfbyte, paramInt1, paramInt2);\n/* */ }", "public byte[] updateKey(String keyName, byte[] keyValue, int size, String token) throws InternalSkiException {\n byte[] newKey = null;\n byte[] systemKey = getSystemKey();\n byte[] tokenKey = getTokenKey();\n ISki skiDao = getSkiDao();\n\n byte[] oldkey = retrieveKey(keyName, token);\n if (oldkey!=null) {\n\n Token tkn = th.decodeToken(token, tokenKey);\n if (tkn != null) {\n try {\n byte[] comboKey = SkiKeyGen.getComboKey(tkn.getKey(), systemKey);\n\n if (keyValue != null) {\n newKey = keyValue;\n }\n if (newKey == null) {\n newKey = SkiKeyGen.generateKey(size);\n }\n\n byte[] encryptedKey = crypter.encrypt(newKey, comboKey);\n String strEncryptedKey = SkiUtils.b64encode(encryptedKey);\n int saved = skiDao.updateKeyPair(keyName, strEncryptedKey);\n if (saved != 1) {\n throw new InternalSkiException(\"Failed to save key pair to database! Check logs...\");\n }\n } catch (SkiException e) {\n log.warning(\"Unable to create new key. Access denied. Check logs for error: \" + e.getMessage());\n log.log(Level.WARNING, e.getMessage(), e);\n newKey = null;\n }\n } else {\n log.warning(\"Unable to decode token during key creation! Access denied.\");\n newKey = null;\n }\n } else {\n // token not valud.. access denied\n log.warning(\"Token now valid for key. Access denied.\");\n newKey = null;\n }\n return newKey;\n }", "static public frog_IterKey[] hashKey(byte[] binaryKey)\r\n {\r\n\r\n byte[] buffer = new byte[frog_Algorithm.BLOCK_SIZE];\r\n frog_IterKey[] simpleKey = new frog_IterKey[ frog_procs.numIter ];\r\n frog_IterKey[] internalKey = new frog_IterKey[ frog_procs.numIter ];\r\n int iSeed, iFrase;\r\n int sizeKey,i,posi,size;\r\n int keyLen, last;\r\n for ( i = 0; i < frog_procs.numIter; i++ ) simpleKey[i] = new frog_IterKey();\r\n for ( i = 0; i < frog_procs.numIter; i++ ) internalKey[i] = new frog_IterKey();\r\n keyLen = binaryKey.length;\r\n sizeKey = frog_IterKey.size() * frog_procs.numIter;\r\n\r\n\t/* Initialize SimpleKey with user supplied key material and random seed.\r\n See B.1.2a */\r\n\r\n iSeed = 0; iFrase = 0;\r\n for ( i = 0; i < sizeKey; i++ )\r\n {\r\n simpleKey[i / frog_IterKey.size()].setValue(\r\n\t i%frog_IterKey.size(), \r\n\t\trandomSeed[iSeed] ^ binaryKey[iFrase]\r\n\t );\r\n\t if ( iSeed<250 ) iSeed++; else iSeed = 0;\r\n\t if ( iFrase<keyLen-1 ) iFrase++; else iFrase = 0;\r\n }\r\n\r\n /* Convert simpleKey into a valid internal key (see B.1.2b) */\r\n\r\n simpleKey = makeInternalKey( frog_Algorithm.DIR_ENCRYPT, simpleKey );\r\n for ( i = 0; i < frog_Algorithm.BLOCK_SIZE; buffer[i++] = 0 );\r\n\r\n\t/* Initialize IV vector (see B.1.2c) */\r\n\r\n last = keyLen - 1;\r\n if ( last > frog_Algorithm.BLOCK_SIZE ) last = frog_Algorithm.BLOCK_SIZE-1;\r\n for ( i = 0; i <= last; buffer[i] ^= binaryKey[i], i++ );\r\n buffer[0] ^= keyLen;\r\n\r\n posi = 0;\r\n\r\n /* Fill randomKey with the cipher texts produced successive\r\n encryptions (see B.1.2.c) */\r\n\r\n do {\r\n buffer = encryptFrog( buffer, simpleKey );\r\n\t size = sizeKey - posi;\r\n\t if ( size > frog_Algorithm.BLOCK_SIZE ) size = frog_Algorithm.BLOCK_SIZE;\r\n\t for (i=0;i<frog_Algorithm.BLOCK_SIZE;i++)\r\n\t if ( buffer[i] < 0 )\r\n\t internalKey[(posi+i)/frog_IterKey.size()].setValue((posi+i)%frog_IterKey.size(), buffer[i]+256 ); \r\n\t\telse\r\n\t internalKey[(posi+i)/frog_IterKey.size()].setValue((posi+i)%frog_IterKey.size(), buffer[i] ); \r\n\t posi += size;\r\n } while ( posi != sizeKey );\r\n return internalKey;\r\n }", "void setKeyArray(com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key[] keyArray);", "private static void SendToAuctioneer(BigInteger msg) {\r\n\t\tmsg=auctioneer_pk.encrypt(msg)[0];\r\n\t\tsendToClient(auctioneer,msg);\r\n\t}", "public static ECKey fromPublicOnly(byte[] pub) {\n return new ECKey(null, EccCurve.getCurve().decodePoint(pub));\n }", "private static void keyExchange() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException {\r\n\t\t//receive from server\r\n\t\tPublicKey keyserver = cryptoMessaging.recvPublicKey(auctioneer.getInputStream());\r\n\t\t//receive from clients\r\n\t\tPublicKey keyclients[] = new PublicKey[3];\r\n\t\tbiddersigs = new PublicKey[3];\r\n\t\tInputStream stream;\r\n\t\tfor (int i=0; i < bidders.size(); i++) {\r\n\t\t\tstream=(bidders.get(i)).getInputStream();\r\n\t\t\tkeyclients[i] = cryptoMessaging.recvPublicKey(stream);\r\n\t\t\tbiddersigs[i] = keyclients[i];\r\n\t\t}\r\n\t\t//send to auctioneer\r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[0]); \r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[1]); \r\n\t\tcryptoMessaging.sendPublicKey(auctioneer.getOutputStream(), keyclients[2]); \r\n\t\t//send to clients\r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(0)).getOutputStream(), keyserver); \r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(1)).getOutputStream(), keyserver); \r\n\t\tcryptoMessaging.sendPublicKey((bidders.get(2)).getOutputStream(), keyserver); \r\n\t\t\r\n\t\t\r\n\t\t// now receive paillier public keys from bidders and auctioneer\r\n\t\tauctioneer_pk = cryptoMessaging.recvPaillier(auctioneer.getInputStream());\r\n\t\tpk[0] = cryptoMessaging.recvPaillier((bidders.get(0)).getInputStream());\r\n\t\tpk[1] = cryptoMessaging.recvPaillier((bidders.get(1)).getInputStream());\r\n\t\tpk[2] = cryptoMessaging.recvPaillier((bidders.get(2)).getInputStream());\r\n\t}" ]
[ "0.61558366", "0.58756876", "0.58337915", "0.5627155", "0.5569667", "0.55429065", "0.5534875", "0.5485159", "0.5479403", "0.54536945", "0.54032403", "0.53876615", "0.53848904", "0.5351807", "0.5347937", "0.5279915", "0.5244239", "0.5241501", "0.5206752", "0.51927805", "0.51840645", "0.5164198", "0.5125107", "0.5120904", "0.5100047", "0.5090422", "0.508564", "0.50837237", "0.50721717", "0.5054598", "0.5046999", "0.5012085", "0.50097483", "0.5008484", "0.5001265", "0.49906427", "0.49790826", "0.4969638", "0.49696043", "0.4968283", "0.49555886", "0.4955536", "0.4951362", "0.49511284", "0.49409688", "0.49358016", "0.49262053", "0.4919445", "0.4915278", "0.4911118", "0.48913845", "0.48880413", "0.48718008", "0.48635364", "0.4859371", "0.48525378", "0.48414072", "0.48374727", "0.48356447", "0.48182082", "0.4815133", "0.4812335", "0.4809836", "0.48082882", "0.48076642", "0.48066726", "0.48021123", "0.48006734", "0.47968867", "0.4796088", "0.47947112", "0.47947112", "0.47866505", "0.47748992", "0.47742593", "0.47703514", "0.47633532", "0.47583714", "0.47441012", "0.47359428", "0.47170934", "0.47161987", "0.4713734", "0.47071007", "0.47031587", "0.46985027", "0.4687277", "0.46832627", "0.46636873", "0.4661096", "0.4659981", "0.46578285", "0.46490654", "0.46463597", "0.46437305", "0.46399352", "0.46335712", "0.46296802", "0.46232146", "0.4622796" ]
0.55944747
4
updateFndOutline updates campus outline with each action perform on a KIX. this helps speed up the retrieval process because all KIX by campuses are always available.
public static void updateFndOutline(Connection conn,String kix,String campus,String alpha,String num,String type) throws SQLException { //Logger logger = Logger.getLogger("test"); try { boolean debug = false; if(debug){ logger.info("kix: " + kix); logger.info("campus: " + campus); logger.info("alpha: " + alpha+ "<br>"); logger.info("num: " + num); logger.info("type: " + type); } String sql = "UPDATE tblfndoutlines SET " + campus + "=? " + "WHERE category=? AND coursealpha=? AND coursenum=? AND coursetype=? "; if(debug) logger.info("sql: " + sql); PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1,kix); ps.setString(2,"Outline"); ps.setString(3,alpha); ps.setString(4,num); ps.setString(5,type); int rowsAffected = ps.executeUpdate(); if(debug) logger.info("rowsAffected: " + rowsAffected); // if == 0, row does not exist for update. add new row if (rowsAffected == 0){ sql = "INSERT INTO tblfndoutlines " + "(category,coursealpha,coursenum,coursetype,"+campus+") " + "VALUES('Outline',?,?,?,?)"; if(debug) logger.info("sql: " + sql); ps = conn.prepareStatement(sql); ps.setString(1,alpha); ps.setString(2,num); ps.setString(3,type); ps.setString(4,kix); rowsAffected = ps.executeUpdate(); } ps.close(); } catch (SQLException e) { logger.fatal("FndDB.updateFndOutline - " + e.toString()); } catch (Exception e) { logger.fatal("FndDB.updateFndOutline - " + e.toString()); } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateFjlx(Fjlx fx) {\n\r\n\t}", "public void updateFaith(int i){\n this.gameboardPanel.faithPathPane.updateIndicator(i);\n }", "@Override\r\n\tpublic void updateDetailsTable(Kit kitToUpdate) {\n\t\tTableItem tblItems[]= tblCinCoutDetails.getItems();\r\n\t\tfor(TableItem tblItem:tblItems){\r\n\t\t\tif(tblItem.getText(0).equalsIgnoreCase(kitToUpdate.getKitSerialNum())){\r\n\t\t\t\t//tblItem.setText(0, kitToUpdate.getKitSerialNum());\r\n\t\t\t\ttblItem.setText(1, kitToUpdate.getKitCheckInDate().toString());\r\n\t\t\t\t//tblItem.setText(2, kitToUpdate.getKitCheckOutDate().toString());\r\n\t\t\t\t//tblItem.setText(3, kitToUpdate.getKitCourse().getCourseName());\r\n\t\t\t\t//tblItem.setText(4, kitToUpdate.getKitPenalty()+\"\");\r\n\t\t\t\t//tblItem.setText(5, kitToUpdate.getKitType());\r\n\t\t\t\t//tblItem.setText(6, kitToUpdate.getStudentEmailKit());\r\n\t\t\t\t//tblItem.setText(7, kitToUpdate.getStudentNameForKit());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setOutline(AssignmentOutline newOutline){\n this.outline = newOutline;\n }", "public void updateSchduleTime_actionPerformed(ActionEvent e) throws Exception {\n\t\tMap<String,Integer> pcidMap = new HashMap<String,Integer>();\r\n\t\tfor(int i = 0; i < kdtEntries.getRowCount(); i++) {\r\n//\t\t\tpcids.add(kdtEntries.getCell(i,\"id\").getValue());\r\n\t\t\tpcidMap.put(((BOSUuid)kdtEntries.getCell(i,\"id\").getValue()).toString(),i);\r\n\t\t}\r\n\t\tif(pcidMap.size() > 0){\r\n\t\t\tStringBuffer sb = new StringBuffer();\r\n\t\t\tfor(Iterator<String> it=pcidMap.keySet().iterator(); it.hasNext();) {\r\n\t\t\t\tsb.append(\"'\");\r\n\t\t \tsb.append(it.next());\r\n\t\t \tsb.append(\"',\");\r\n\t\t\t}\r\n\t\t\tif(sb.length() > 1){\r\n\t\t \tsb.setLength(sb.length()-1);\r\n\t\t }\r\n\t\t\tFDCSQLBuilder builder = new FDCSQLBuilder();\r\n\t\t\tbuilder.appendSql(\"select entry.CFProgammingID,entry.CFStartDate,entry.CFEndDate from CT_SCH_DahuaScheduleEntry entry left join CT_SCH_DahuaSchedule \");\r\n\t\t\tbuilder.appendSql(\"sched on sched.fid=entry.fparentid where sched.CFProjectID='\"+editData.getProject().getId().toString()+\"' and entry.CFProgammingID in (\"+sb.toString()+\")\");\r\n\t\t\tIRowSet rs = builder.executeQuery();\r\n\t\t\tif(rs.size() == 0){\r\n\t\t\t\tFDCMsgBox.showInfo(\"合约规划与明源进度项未关联!\");\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\twhile(rs.next()){\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void setOutline(RMXString.Outline anOutline) { }", "private void updISTRN() \n\t{\n\t\ttry\n\t\t{\n\t\t\tM_strSQLQRY = \"Update FG_ISTRN set \";\n\t\t\tM_strSQLQRY += \"IST_STSFL = '1',\";\n\t\t\tM_strSQLQRY += \"IST_TRNFL = '0',\";\n\t\t\tM_strSQLQRY += \"IST_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\tM_strSQLQRY += \"IST_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst ))+\"'\";\n\t\t\tM_strSQLQRY += \" where ist_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and ist_wrhtp = '\"+strWRHTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_isstp = '\"+strISSTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_issno = '\"+txtISSNO.getText().toString() .trim() +\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdcd = '\"+strPRDCD+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_prdtp = '\"+strPRDTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_lotno = '\"+strLOTNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_rclno = '\"+strRCLNO+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_pkgtp = '\"+strPKGTP+\"'\";\n\t\t\tM_strSQLQRY += \" and ist_mnlcd = '\"+strMNLCD+\"'\";\n\t\t\t\n\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t//System.out.println(\"update fgistrn table :\"+M_strSQLQRY);\n\t\t\t\n\t\t}catch(Exception L_EX)\n\t\t{\n\t\t\tsetMSG(L_EX,\"updISTRN\");\n\t\t}\n\t}", "SaveUpdateCodeListResult updateQDStoMeasure(MatValueSetTransferObject matValueSetTransferObject);", "int updateByPrimaryKey(County record);", "private void exportOutline() {\n boolean modOK = modIfChanged();\n boolean sectionOpen = false;\n int exported = 0;\n if (modOK) {\n fileChooser.setDialogTitle (\"Export Agenda to OPML\");\n fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n File selectedFile = fileChooser.showSaveDialog (this);\n if (selectedFile != null) {\n MarkupWriter writer \n = new MarkupWriter(selectedFile, MarkupWriter.OPML_FORMAT);\n boolean ok = writer.openForOutput();\n if (ok) {\n textMergeScript.clearSortAndFilterSettings();\n int lastSeq = -1;\n for (int i = 0; i < clubEventList.size(); i++) {\n ClubEvent nextClubEvent = clubEventList.get(i);\n if (nextClubEvent != null\n && nextClubEvent.getStatusAsString().contains(\"Current\")) {\n String what = nextClubEvent.getWhat();\n if (exported == 0) {\n writer.startHead();\n writer.writeTitle(\"Minutes for \" + what);\n writer.endHead();\n writer.startBody();\n }\n String seqStr = nextClubEvent.getSeq();\n int seq = Integer.parseInt(seqStr);\n String seqTitle = \"\";\n switch (seq) {\n case 1:\n seqTitle = \"Open Meeting\";\n break;\n case 2:\n seqTitle = \"Finance\";\n break;\n case 3:\n seqTitle = \"Board Info\";\n break;\n case 4:\n seqTitle = \"Recent Events\";\n break;\n case 5:\n seqTitle = \"Upcoming\";\n break;\n case 8:\n seqTitle = \"Communication\";\n break;\n case 9:\n seqTitle = \"Close Meeting\";\n break;\n }\n String category = nextClubEvent.getCategory();\n \n // Start a new outline section for each type of agenda item\n if (seq != lastSeq) {\n if (sectionOpen) {\n writer.endOutline();\n }\n writer.startOutline(seqTitle);\n sectionOpen = true;\n lastSeq = seq;\n }\n \n // Start a new outline item for each event\n writer.startOutline(what);\n String ymd = nextClubEvent.getYmd();\n String when = nextClubEvent.getWhen();\n if (nextClubEvent.hasWhoWithData()) {\n writer.writeOutline(\"Who: \" + nextClubEvent.getWho());\n }\n if (nextClubEvent.hasWhenWithData()) {\n writer.writeOutline(\"When: \" + nextClubEvent.getWhen());\n }\n if (nextClubEvent.hasItemTypeWithData()) {\n writer.writeOutline(\"Item Type: \" + nextClubEvent.getItemType());\n }\n if (nextClubEvent.hasCategoryWithData()) {\n writer.writeOutline(\"Category: \" + nextClubEvent.getCategory());\n }\n if (nextClubEvent.hasStatusWithData()) {\n writer.writeOutline(\"Status: \" + nextClubEvent.getStatusAsString());\n }\n if (nextClubEvent.hasDiscussWithData()) {\n writer.writeOutline(\"To Discuss: \" + nextClubEvent.getDiscuss());\n }\n \n // Action Items\n if (nextClubEvent.hasActionsWithData()) {\n writer.startOutline(\"Action Items\");\n for (int j = 0; j < nextClubEvent.sizeEventActionList(); j++) {\n EventAction action = nextClubEvent.getEventAction(j);\n TextBuilder actionText = new TextBuilder();\n String actionee = action.getActionee();\n if (actionee != null && actionee.length() > 0) {\n actionText.append(actionee + \": \");\n }\n actionText.append(action.getAction());\n writer.writeOutline(actionText.toString());\n }\n writer.endOutline();\n }\n \n // Numbers\n if (nextClubEvent.hasOverUnderWithData()\n || nextClubEvent.hasFinanceProjectionWithData()) {\n writer.startOutline(\"Numbers\");\n \n if (nextClubEvent.hasCost()) {\n writer.writeOutline(\"Cost per Person: \" \n + nextClubEvent.getCost());\n }\n if (nextClubEvent.hasTickets()) {\n writer.writeOutline(\"To Receive Tickets: \" \n + nextClubEvent.getTickets());\n }\n if (nextClubEvent.hasQuantity()) {\n writer.writeOutline(\"Quantity available: \" \n + nextClubEvent.getQuantity());\n }\n if (nextClubEvent.hasPlannedAttendance()) {\n writer.writeOutline(\"Planned Attendance: \" \n + nextClubEvent.getPlannedAttendance());\n }\n if (nextClubEvent.hasActualAttendance()) {\n writer.writeOutline(\"Actual Attendance: \" \n + nextClubEvent.getActualAttendance());\n }\n if (nextClubEvent.hasPlannedIncome()) {\n writer.writeOutline(\"Planned Income: \" \n + nextClubEvent.getPlannedIncome());\n }\n if (nextClubEvent.hasActualIncome()) {\n writer.writeOutline(\"Actual Income: \" \n + nextClubEvent.getActualIncome());\n }\n if (nextClubEvent.hasPlannedExpense()) {\n writer.writeOutline(\"Planned Expense: \" \n + nextClubEvent.getPlannedExpense());\n }\n if (nextClubEvent.hasActualExpense()) {\n writer.writeOutline(\"Actual Expense: \" \n + nextClubEvent.getActualExpense());\n }\n writer.writeOutline(\"Over/Under: \" \n + nextClubEvent.getOverUnder());\n writer.writeOutline(\"Projection: \" \n + nextClubEvent.getFinanceProjection());\n \n writer.endOutline();\n }\n \n // Notes\n if (nextClubEvent.hasNotesWithData()) {\n writer.startOutline(\"Notes\");\n for (int n = 0; n < nextClubEvent.sizeEventNoteList(); n++) {\n EventNote note = nextClubEvent.getEventNote(n);\n TextBuilder noteText = new TextBuilder();\n writer.startOutline(ClubEventCalc.calcNoteHeaderLine(note));\n markdownReader = new StringLineReader(note.getNote());\n MarkdownInitialParser mdParser\n = new MarkdownInitialParser(this);\n MarkdownLine mdLine = mdParser.getNextLine();\n while (mdLine != null) {\n writer.writeOutline(mdLine.getLine());\n mdLine = mdParser.getNextLine();\n }\n writer.endOutline();\n }\n writer.endOutline();\n }\n \n /*\n StringBuilder h3 = new StringBuilder();\n if (ymd != null && ymd.length() > 7) {\n h3.append(when);\n h3.append(\" -- \");\n }\n if (category != null && category.length() > 0) {\n h3.append(category);\n h3.append(\": \");\n }\n h3.append(what);\n writer.writeHeading(3, h3.toString(), \"\");\n \n // Print Who\n exportMinutesField \n (writer, \n \"Who\", \n nextClubEvent.getWho());\n \n // Print Where\n exportMinutesField \n (writer, \n \"Where\", \n nextClubEvent.getWhere());\n \n // Print Finance Projection\n exportMinutesField \n (writer, \n \"Finance Projection\", \n nextClubEvent.getFinanceProjection());\n \n // Print Finance Projection\n exportMinutesField \n (writer, \n \"Over/Under\", \n nextClubEvent.getOverUnder());\n \n // Print Discussion\n exportMinutesField \n (writer, \"For Discussion\", nextClubEvent.getDiscuss());\n \n if (nextClubEvent.sizeEventNoteList() > 0) {\n EventNote note = nextClubEvent.getEventNote(0);\n String via = note.getNoteVia();\n if (via != null && via.equalsIgnoreCase(\"Minutes\")) {\n writer.writeLine(\"Minutes: \");\n writer.writeLine(note.getNote());\n }\n } */\n writer.endOutline();\n exported++;\n } // end if next event not null\n } // end for each item in list\n if (sectionOpen) {\n writer.endOutline();\n }\n writer.endBody();\n writer.close();\n JOptionPane.showMessageDialog(this,\n String.valueOf(exported) + \" Club Events exported successfully to\"\n + GlobalConstants.LINE_FEED\n + selectedFile.toString(),\n \"Export Results\",\n JOptionPane.INFORMATION_MESSAGE,\n Home.getShared().getIcon());\n logger.recordEvent (LogEvent.NORMAL, String.valueOf(exported) \n + \" Club Events exported as minutes to \" \n + selectedFile.toString(),\n false);\n statusBar.setStatus(String.valueOf(exported) \n + \" Club Events exported\");\n } \n if (! ok) {\n logger.recordEvent (LogEvent.MEDIUM,\n \"Problem exporting Club Events as minutes to \" + selectedFile.toString(),\n false);\n trouble.report (\"I/O error attempting to export club events to \" \n + selectedFile.toString(),\n \"I/O Error\");\n statusBar.setStatus(\"Trouble exporting Club Events\");\n } // end if I/O error\n } // end if user selected an output file\n } // end if were able to save the last modified record\n }", "public void changeSpecs(int Idx) {\n\n tb_rule.setText(\"\");\n b_doApply = false;\n /* clear the image panel */\n if (b_gotImagePnl == true) {\n pnl_image.repaint();\n }\n\n\n switch (Idx) {\n case 0:\n /* quadratic Koch Island 1 pg. 13 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"2\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F+F-F-FF+F+F-F\");\n\n break;\n\n\n case 1: /* Quadratic Koch Island 2 pg. 14 */\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"2\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F-FF+FF+F+F-F-FF+F+F-F-FF-FF+F\");\n break;\n\n case 2: /* Island & Lake Combo. pg. 15 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F-F-F-F\");\n tb_ignore.setText(\"Ff+-\");\n tb_depth.setText(\"2\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F-f+FF-F-FF-Ff-FF+f-FF+F+FF+Ff+FFF\");\n lst_rules.add(\"* <f> * --> ffffff\");\n break;\n\n case 3:\t /* Koch Curve A pg. 16 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+F+F+F+F+F-F\");\n break;\n\n case 4:\t /* Koch Curve B pg. 16 */\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+F+F+F+FF\");\n\n\n break;\n\n case 5:\t /* Koch Curve C pg. 16 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"3\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+F-F+F+FF\");\n break;\n\n\n case 6: /* Koch Curve D pg. 16 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+F++F+F\");\n break;\n\n case 7:\t /* Koch Curve E pg. 16 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F+FF++F+F\");\n break;\n\n case 8: /* Koch Curve F pg. 16 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F+F-F+F+F\");\n break;\n\n case 9: /* Mod of snowflake pg. 14*/\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F-F+F+F-F\");\n\n break;\n\n case 10: /* Dragon Curve pg. 17 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"Fl\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"14\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <l> * --> l+rF+\");\n lst_rules.add(\"* <r> * --> -Fl-r\");\n break;\n\n case 11: /* Hexagonal Gosper Curve pg. 19 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"XF\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"6\");\n lst_rules.removeAll();\n lst_rules.add(\"* <XF> * --> XF+YF++YF-XF--XFXF-YF+\");\n lst_rules.add(\"* <YF> * --> -XF+YFYF++YF+XF--XF-YF\");\n break;\n\n case 12: /* Sierpinski Arrowhead pg. 19 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"YF\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"6\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"6\");\n lst_rules.removeAll();\n lst_rules.add(\"* <XF> * --> YF+XF+YF\");\n lst_rules.add(\"* <YF> * --> XF-YF-XF\");\n break;\n\n case 13: /* Peano Curve pg. 18 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"3\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XFYFX+F+YFXFY-F-XFYFX\");\n lst_rules.add(\"* <Y> * --> YFXFY-F-XFYFX+F+YFXFY\");\n break;\n\n case 14: /* Hilbert Curve pg. 18 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> -YF+XFX+FY-\");\n lst_rules.add(\"* <Y> * --> +XF-YFY-FX+\");\n break;\n\n case 15: /* Approx of Sierpinski pg. 18 */\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+XF+F+XF\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XF-F+F-XF+F+XF-F+F-X\");\n break;\n\n case 16: /* Tree A pg. 25 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"14\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F[+F]F[-F]F\");\n break;\n\n case 17: /* Tree B pg. 25 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"16\");\n lst_rules.removeAll();\n lst_rules.add(\" * <X> * --> F-[[X]+X]+F[+FX]-X\");\n lst_rules.add(\" * <F> * --> FF\");\n break;\n\n\n case 18: /* Tree C pg. 25 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"Y\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"6\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"14\");\n lst_rules.removeAll();\n lst_rules.add(\" * <Y> * --> YFX[+Y][-Y]\");\n lst_rules.add(\" * <X> * --> X[-FFF][+FFF]FX\");\n break;\n\n case 19: /* Tree D pg. 25 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"16\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+[+F-F-F]-[-F+F+F]\");\n break;\n\n case 20: /* Tree E pg. 25 */\n\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"7\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"18\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> F[+X]F[-X]+X\");\n lst_rules.add(\"* <F> * --> FF\");\n\n break;\n\n case 21: /* Tree B pg. 43 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F1F1F1\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"30\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"16\");\n lst_rules.clear();\n lst_rules.add(\"0 <0> 0 --> 1\");\n lst_rules.add(\"0 <0> 1 --> 1[-F1F1]\");\n lst_rules.add(\"0 <1> 0 --> 1\");\n lst_rules.add(\"0 <1> 1 --> 1\");\n lst_rules.add(\"1 <0> 0 --> 0\");\n lst_rules.add(\"1 <0> 1 --> 1F1\");\n lst_rules.add(\"1 <1> 0 --> 1\");\n lst_rules.add(\"1 <1> 1 --> 0\");\n lst_rules.add(\"* <-> * --> +\");\n lst_rules.add(\"* <+> * --> -\");\n break;\n\n\n case 22: /* Tree C pg. 43 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F1F1F1\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"26\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"14\");\n lst_rules.clear();\n lst_rules.add(\"0 <0> 0 --> 0\");\n lst_rules.add(\"0 <0> 1 --> 1\");\n lst_rules.add(\"0 <1> 0 --> 0\");\n lst_rules.add(\"0 <1> 1 --> 1[+F1F1]\");\n lst_rules.add(\"1 <0> 0 --> 0\");\n lst_rules.add(\"1 <0> 1 --> 1F1\");\n lst_rules.add(\"1 <1> 0 --> 0\");\n lst_rules.add(\"1 <1> 1--> 0\");\n lst_rules.add(\"* <-> * --> +\");\n lst_rules.add(\"* <+> * --> -\");\n break;\n\n\n case 23: /* Spiral Tiling pg. 70 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"AAAA\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"24\");\n lst_rules.removeAll();\n lst_rules.add(\"* <A> * --> X+X+X+X+X+X+\");\n lst_rules.add(\"* <X> * --> [F+F+F+F[---X-Y]+++++F++++++++F-F-F-F]\");\n lst_rules.add(\"* <Y> * --> [F+F+F+F[---Y]+++++F++++++++F-F-F-F]\");\n\n break;\n\n\n case 24: /* BSpline Triangle pg. 20 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"3\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> F-F+F\");\n\n break;\n\n case 25: /* Snake Kolam pg. 72 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+XF+F+XF\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XF-F-F+XF+F+XF-F-F+X\");\n\n break;\n\n\n case 26: /* Anklets of Krishna pg. 73 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"-X--X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"8\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XFX--XFX\");\n\n break;\n\n case 27: /* Color, Koch Curve B */\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+F+F+F\");\n tb_ignore.setText(\"F+\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> FF+F+;;;;;F:::::+F+FF\");\n\n break;\n\n case 28: /* Color, Koch Curve B */\n\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"###F+F+F+F\");\n tb_ignore.setText(\"F+\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * -->;FF+F+F+F+FF\");\n\n break;\n\n\n case 29: /* Color X, Spiral Tiling */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"AAAA\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"24\");\n lst_rules.removeAll();\n lst_rules.add(\"* <A> * --> ;;;;;;;;X::::::::+X+X+X+X+X+\");\n lst_rules.add(\"* <X> * --> [F+F+F+F[---X-Y]+++++F++++++++F-F-F-F]\");\n lst_rules.add(\"* <Y> * --> [F+F+F+F[---Y]+++++F++++++++F-F-F-F]\");\n break;\n\n case 30: /* Color Center, Spiral Tiling */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"AAAA\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"24\");\n lst_rules.removeAll();\n lst_rules.add(\"* <A> * --> X+X+X+X+X+X+\");\n lst_rules.add(\"* <X> * --> [;;;;;F+F+F+F:::::[---X-Y]+++++F++++++++F-F-F-F]\");\n lst_rules.add(\"* <Y> * --> [F+F+F+F[---Y]+++++F++++++++F-F-F-F]\");\n break;\n\n case 31: /* Color Spokes, Spiral Tiling */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"AAAA\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"24\");\n lst_rules.removeAll();\n lst_rules.add(\"* <A> * --> X+X+X+X+X+X+\");\n lst_rules.add(\"* <X> * --> [F+F+F+F[---X-Y]+++++F++++++++;;;;F-F-F-F::::]\");\n lst_rules.add(\"* <Y> * --> [F+F+F+F[---Y]+++++F++++++++F-F-F-F]\");\n break;\n\n case 32: /* Color, Quad Koch Island 1 */\n /* quadratic Koch Island 1 pg. 13 */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"###F+F+F+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"2\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> ;F+F-F-FF+F+F-F\");\n\n break;\n\n case 33: /* Color, Tree E */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"7\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"18\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> F[+X]F[-X]+X\");\n lst_rules.add(\"* <F> * --> ;;FF::\");\n\n break;\n\n\n case 34: /* Color, Mod of Snowflake */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"###+F\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <F> * --> ;F-F+F+F-F\");\n\n break;\n\n case 35: /* Color, Anklets of Krishna */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"-X--X\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"5\");\n tb_scale.setText(\"100\");\n tb_angle.setText(\"8\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XFX--X;;;;;;F::::::X\");\n break;\n\n case 36: /* Color, Snake Kolam */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"F+XF+F+;;;XF:::\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"4\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"4\");\n lst_rules.removeAll();\n lst_rules.add(\"* <X> * --> XF-F-F+XF+F+XF-F-F+X\");\n\n break;\n\n case 37: /* Simple Branch */\n tb_clr.setText(\"16\");\n tb_axiom.setText(\"FFF[-FFF][--FFF][FFF][+FFF][++FFF]\");\n tb_ignore.setText(\"F+-\");\n tb_depth.setText(\"1\");\n tb_scale.setText(\"90\");\n tb_angle.setText(\"8\");\n lst_rules.removeAll();\n\n break;\n\n\n\n\n default:\n tb_axiom.setText(\"\");\n tb_ignore.setText(\"\");\n tb_depth.setText(\"\");\n tb_scale.setText(\"\");\n tb_angle.setText(\"\");\n lst_rules.removeAll();\n break;\n\n }\n\n }", "public void updateCertificateExit(String certificateId, double fee) throws ClassNotFoundException, SQLException;", "public void setOutline(String outline) {\n this.outline = outline == null ? null : outline.trim();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tft2.setText(null);\n\t\t\t\tft3.setText(null);\n\t\t\t\tl71.setText(null);\n\t\t\t\tdept2=\"\";\n\t\t\t\tft5.setText(null);\n\t\t\t\tft6.setText(null);\n\t\t\t}", "public Hashtable<String, Hashtable<Integer, Obs>> Update_obs_table(\n\t\t\tHashtable<String, Hashtable<Integer, Obs>> obs_table, Hashtable<Integer, Vertex> towers_list,\n\t\t\tboolean weekend) {\n\n\t\tHashtable<String, Hashtable<Integer, Obs>> obs_stops_table = new Hashtable<>();\n\t\tfor (Map.Entry<String, Hashtable<Integer, Obs>> entrySet : obs_table.entrySet()) {\n\t\t\tString day_key = entrySet.getKey();\n\t\t\tif (!weekend) {\n\t\t\t\tif (day_key.contains(\"Saturday\") || day_key.contains(\"Sunday\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tHashtable<Integer, Obs> usr_obs = entrySet.getValue();\n\t\t\tHashtable<Integer, Obs> obs_tmp = new Hashtable<>();\n\t\t\tfor (Map.Entry<Integer, Obs> entrySet1 : usr_obs.entrySet()) {\n\t\t\t\tInteger usr_key = entrySet1.getKey();\n\t\t\t\tObs obs_val = entrySet1.getValue();\n\t\t\t\tString seq = obs_val.getSeq();\n\t\t\t\tString tstamps = obs_val.getTimeStamp();\n\t\t\t\t// change it to algorithm 2_3 after finishing the current test\n\t\t\t\tobs_val = algorithm2_3(seq.split(CLM), tstamps.split(CLM), towers_list);\n\n\t\t\t\tobs_tmp.put(usr_key, obs_val);\n\n\t\t\t}\n\t\t\tobs_stops_table.put(day_key, obs_tmp);\n\t\t}\n\t\treturn obs_stops_table;\n\t}", "@LogMethod\r\n private void editResults()\r\n {\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n waitAndClickAndWait(Locator.linkWithText(\"view results\"));\r\n DataRegionTable table = new DataRegionTable(\"Data\", getDriver());\r\n assertEquals(\"No rows should be editable\", 0, DataRegionTable.updateLinkLocator().findElements(table.getComponentElement()).size());\r\n assertElementNotPresent(Locator.button(\"Delete\"));\r\n\r\n // Edit the design to make them editable\r\n ReactAssayDesignerPage assayDesignerPage = _assayHelper.clickEditAssayDesign(true);\r\n assayDesignerPage.setEditableResults(true);\r\n assayDesignerPage.clickFinish();\r\n\r\n // Try an edit\r\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n clickAndWait(Locator.linkWithText(\"view results\"));\r\n DataRegionTable dataTable = new DataRegionTable(\"Data\", getDriver());\r\n assertEquals(\"Incorrect number of results shown.\", 10, table.getDataRowCount());\r\n doAndWaitForPageToLoad(() -> dataTable.updateLink(dataTable.getRowIndex(\"Specimen ID\", \"AAA07XK5-05\")).click());\r\n setFormElement(Locator.name(\"quf_SpecimenID\"), \"EditedSpecimenID\");\r\n setFormElement(Locator.name(\"quf_VisitID\"), \"601.5\");\r\n setFormElement(Locator.name(\"quf_testAssayDataProp5\"), \"notAnumber\");\r\n clickButton(\"Submit\");\r\n assertTextPresent(\"Could not convert value: \" + \"notAnumber\");\r\n setFormElement(Locator.name(\"quf_testAssayDataProp5\"), \"514801\");\r\n setFormElement(Locator.name(\"quf_Flags\"), \"This Flag Has Been Edited\");\r\n clickButton(\"Submit\");\r\n assertTextPresent(\"EditedSpecimenID\", \"601.5\", \"514801\");\r\n assertElementPresent(Locator.xpath(\"//img[@src='/labkey/Experiment/flagDefault.gif'][@title='This Flag Has Been Edited']\"), 1);\r\n assertElementPresent(Locator.xpath(\"//img[@src='/labkey/Experiment/unflagDefault.gif'][@title='Flag for review']\"), 9);\r\n\r\n // Try a delete\r\n dataTable.checkCheckbox(table.getRowIndex(\"Specimen ID\", \"EditedSpecimenID\"));\r\n doAndWaitForPageToLoad(() ->\r\n {\r\n dataTable.clickHeaderButton(\"Delete\");\r\n assertAlert(\"Are you sure you want to delete the selected row?\");\r\n });\r\n\r\n // Verify that the edit was audited\r\n goToSchemaBrowser();\r\n viewQueryData(\"auditLog\", \"ExperimentAuditEvent\");\r\n assertTextPresent(\r\n \"Data row, id \",\r\n \", edited in \" + TEST_ASSAY + \".\",\r\n \"Specimen ID changed from 'AAA07XK5-05' to 'EditedSpecimenID'\",\r\n \"Visit ID changed from '601.0' to '601.5\",\r\n \"testAssayDataProp5 changed from blank to '514801'\",\r\n \"Deleted data row.\");\r\n }", "public void updateStaffDetails(String action, String name, String branch) {\n fillCreateOrEditForm(name, branch);\n clickOnBtn(action);\n waitForElementInvisibility(xpathBtn.replace(\"*btn*\", action));\n logger.info(\"# Updated staff details\");\n }", "@Override\n\tpublic void setOutLineFill(String outlinefill) {\n\t\tthis.outLineFill=outlinefill;\n\t}", "int updateByPrimaryKeySelective(County record);", "int updateByPrimaryKey(NeeqCompanyAccountingFirmOnline record);", "int updateRecalcularFechas(final Long srvcId);", "public void updateStudentFees(double fees){\n feesPaid+=fees;\n school.updateMoneyEarned(feesPaid);\n }", "int updateByPrimaryKeySelective(NeeqCompanyAccountingFirmOnline record);", "public void unlockCashDrawer(String campusCode, String documentId);", "private void multiLeafUpdate()\r\n {\n \t\tfor (int i=0;i<this.allCols.size();i++)\r\n \t{\r\n \t\t\tif (this.allCols.get(i).endsWith(HEADER))\r\n \t\t\t{\r\n \t\t\t\tString headerCol=this.allCols.get(i);\r\n \t\t\t\tString col=this.allCols.get(i).replace(HEADER, \"\");\r\n \t\t\t\t\r\n \t\t\t\tthis.requete.append(\"\\n UPDATE \"+this.tempTableA+\" SET i_\"+headerCol+\"=i_\"+col+\" WHERE i_\"+headerCol+\" IS NULL and i_\"+col+\" IS NOT NULL;\");\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n }", "public static void updateCourses(String termCode) throws Exception\r\n {\r\n if (isValidTermCode(termCode))\r\n {\r\n\r\n DatabaseHelper.open();\r\n\r\n subjects = (ArrayList<Subject>) Subject.selectAllSubjects(\"\", DatabaseHelper.getConnection());\r\n teachers = (ArrayList<Teacher>) Teacher.selectAllTeacher(\"\", DatabaseHelper.getConnection());\r\n courses = (ArrayList<Course>) Course.selectAllCourse(\"\", DatabaseHelper.getConnection());\r\n categories = (ArrayList<Category>) Category.selectAllCategory(\"\", DatabaseHelper.getConnection());\r\n\r\n if (teachers.size() > 0)\r\n {\r\n autoIncValTeach = teachers.get(teachers.size() - 1).getTeacherID();\r\n System.out.println(\"AUTO INC Teachers: \" + autoIncValTeach);\r\n }\r\n\r\n if (subjects.size() > 0)\r\n {\r\n autoIncValSub = subjects.get(subjects.size() - 1).getSubjectID();\r\n System.out.println(\"AUTO INC SUBJECTS: \" + autoIncValSub);\r\n }\r\n\r\n if (courses.size() > 0)\r\n {\r\n autoIncValCourse = courses.get(courses.size() - 1).getCourseID();\r\n }\r\n\r\n\r\n URL url = new URL(\"http://apps.hpu.edu/cis/web/index.php/search/search?term=\" + termCode);\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\r\n\r\n String line;\r\n boolean concat = false;\r\n boolean read = false;\r\n\r\n\r\n String content = \"\";\r\n int count = 0;\r\n String lname = \"\", fname = \"\", abbrev = \"\";\r\n int level = 0;\r\n\r\n while ((line = reader.readLine()) != null)\r\n {\r\n\r\n if (line.contains(\"<td>\"))\r\n {\r\n concat = true;\r\n }\r\n if (line.contains(\"</td>\"))\r\n {\r\n content += line;\r\n concat = false;\r\n read = true;\r\n }\r\n if (concat)\r\n {\r\n content += line;\r\n }\r\n\r\n if (read)\r\n {\r\n String value = content.substring(content.indexOf(\">\") + 1, content.lastIndexOf(\"<\")).trim();\r\n\r\n read = false;\r\n content = \"\";\r\n count++;\r\n\r\n if (count % 5 == 2)\r\n {\r\n String[] values = value.split(\" \");\r\n abbrev = values[0].trim();\r\n level = Integer.parseInt(values[1].trim());\r\n }\r\n else if (count % 5 == 4)\r\n {\r\n String[] values = value.split(\" \");\r\n fname = values[0].trim();\r\n lname = values[1].trim();\r\n\r\n insertData(lname, fname, abbrev, level);\r\n }\r\n }\r\n }\r\n\r\n for (int s = 0; s < newsubjects.size(); s++)\r\n {\r\n DatabaseHelper.insert(Subject.getValues(newsubjects.get(s)), Subject.SubjectTable.getTable());\r\n }\r\n for (int s = 0; s < newteachers.size(); s++)\r\n {\r\n DatabaseHelper.insert(Teacher.getValues(newteachers.get(s)), Teacher.TeacherTable.getTable());\r\n }\r\n for (int s = 0; s < newcourses.size(); s++)\r\n {\r\n DatabaseHelper.insert(Course.getValues(newcourses.get(s)), Course.CourseTable.getTable());\r\n }\r\n\r\n DatabaseHelper.close();\r\n if (newsubjects.size() > 0 || newteachers.size() > 0 || newcourses.size() > 0)\r\n {\r\n JOptionPane.showMessageDialog(null, \"Term successfully imported\");\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null, \"Term courses/teachers/subjects are already in database\");\r\n }\r\n\r\n\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null, \"The term code entered is not valid! Or the web address has changed\");\r\n }\r\n }", "private int updateStructure(int id, Task task, Integer outlineLevel)\r\n {\r\n task.setID(Integer.valueOf(id++));\r\n task.setOutlineLevel(outlineLevel);\r\n outlineLevel = Integer.valueOf(outlineLevel.intValue() + 1);\r\n for (Task childTask : task.getChildTasks())\r\n {\r\n id = updateStructure(id, childTask, outlineLevel);\r\n }\r\n return id;\r\n }", "private synchronized void updateFolds(final FoldHierarchyTransaction tran) {\r\n final FoldHierarchy fh = getOperation().getHierarchy();\r\n final BaseDocument doc = (BaseDocument)getOperation().getHierarchy().getComponent().getDocument();\r\n try {\r\n //parse document and create an array of folds\r\n List/*<FoldInfo>*/ generated = generateFolds2(doc);\r\n logger.fine(\"generated \" + generated.size());\r\n \r\n //get existing folds\r\n List existingFolds = FoldUtilities.findRecursive(fh.getRootFold());\r\n Iterator itr = existingFolds.iterator();\r\n \r\n final ArrayList newborns = new ArrayList(generated.size() / 2);\r\n final ArrayList/*<Fold>*/ zombies = new ArrayList(generated.size() / 2);\r\n \r\n //delete unexisting\r\n while(itr.hasNext()) {\r\n Fold f = (Fold)itr.next();\r\n if(!generated.contains(new FoldInfo(f.getStartOffset(), f.getEndOffset(), -1, \"\"))) {\r\n //delete this one\r\n logger.fine(\"adding \" + f + \" to zombies\");\r\n zombies.add(f);\r\n }\r\n }\r\n \r\n //and create new ones\r\n itr = generated.iterator();\r\n while(itr.hasNext()) {\r\n FoldInfo fi = (FoldInfo)itr.next();\r\n Iterator existingItr = existingFolds.iterator();\r\n boolean add = true;\r\n while(existingItr.hasNext()) {\r\n Fold f = (Fold)existingItr.next();\r\n if(f.getStartOffset() == fi.startOffset && f.getEndOffset() == fi.endOffset) {\r\n add = false;\r\n }\r\n }\r\n if(add) {\r\n newborns.add(fi);\r\n logger.fine(\"adding \" + fi + \" to newborns\");\r\n }\r\n }\r\n \r\n //run folds update in event dispatching thread\r\n Runnable updateTask = new Runnable() {\r\n public void run() {\r\n //lock the document for changes\r\n doc.readLock();\r\n try {\r\n //lock the hierarchy\r\n fh.lock();\r\n try {\r\n try {\r\n //remove outdated folds\r\n Iterator i = zombies.iterator();\r\n while(i.hasNext()) {\r\n Fold f = (Fold)i.next();\r\n getOperation().removeFromHierarchy(f, tran);\r\n }\r\n \r\n //add new folds\r\n Iterator newFolds = newborns.iterator();\r\n while(newFolds.hasNext()) {\r\n FoldInfo f = (FoldInfo)newFolds.next();\r\n getOperation().addToHierarchy(GROUP, f.label, false, f.startOffset , f.endOffset , 0, 0, null, tran);\r\n }\r\n }catch(BadLocationException ble) {\r\n //when the document is closing the hierarchy returns different empty document, grrrr\r\n ErrorManager.getDefault().notify(ble);\r\n }\r\n// }finally {\r\n// tran.commit();\r\n// }\r\n } finally {\r\n fh.unlock();\r\n }\r\n } finally {\r\n doc.readUnlock();\r\n }\r\n }\r\n };\r\n \r\n if(SwingUtilities.isEventDispatchThread()) {\r\n updateTask.run();\r\n } else {\r\n SwingUtilities.invokeAndWait(updateTask);\r\n }\r\n \r\n \r\n }catch(BadLocationException e) {\r\n ErrorManager.getDefault().notify(e);\r\n }catch(InterruptedException ie) {\r\n ;\r\n }catch(InvocationTargetException ite) {\r\n ErrorManager.getDefault().notify(ite);\r\n }\r\n }", "public final void setOutlinePaint(final Paint outlinePaint) {\n Paint oldOutlinePaint = this.outlinePaint;\n this.outlinePaint = outlinePaint;\n firePropertyChange(-1, \"outlinePaint\", oldOutlinePaint,\n this.outlinePaint);\n }", "public void setUpdateStatement(EdaContext xContext) \n\tthrows IcofException {\n\n\t\t// Define the query.\n\t\tString query = \"update \" + TABLE_NAME + \n\t\t \" set \" + RELATIONSHIP_COL + \" = ? \" + \n\t\t \" where \" + ID_COL + \" = ? \";\n\n\t\t// Set and prepare the query and statement.\n\t\tsetQuery(xContext, query);\n\n\t}", "protected void updateCaseWorkItems() throws NbaBaseException {\n NbaDst nbaDst;\n Iterator it = it = getCaseWorkItems().values().iterator();\n while (it.hasNext()) {\n nbaDst = (NbaDst) it.next();\n //NBA208-32\n if (\"Y\".equals(nbaDst.getCase().getUpdate())) {\n\t\t\t\tupdateWork(getUser(), nbaDst); //NBA213\n }\n\t\t\tunlockWork(getUser(), nbaDst); //NBA213\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinfomation.drawSet();\n\t\t\t}", "@FXML\n public void editSet(MouseEvent e) {\n AnchorPane root = null;\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/learn_update.fxml\"));\n try {\n root = loader.load();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n LearnUpdateController controller = loader.getController();\n controller.initData(txtTitle.getText(), rootController, learnController, apnLearn);\n rootController.setActivity(root);\n root.requestFocus();\n }", "private void updateCFRCFR(int num) {\r\n if (num < 0) {\r\n window.removeAllShapes();\r\n }\r\n else {\r\n State currentState = covidCalculator.getLL().get(num);\r\n ArrayList<Race> currentRacesSorted = covidCalculator.sortByCFR(\r\n currentState);\r\n\r\n for (int i = 0; i < currentRacesSorted.size(); i++) {\r\n String cfrPercentage = String.valueOf(currentRacesSorted.get(i)\r\n .getCFR());\r\n\r\n if (!cfrPercentage.equals(\"-1%\")) {\r\n TextShape cfrName = new TextShape(0, 0, cfrPercentage);\r\n cfrName.moveTo(barXPos + (spacingSize * spacingCounter),\r\n +barYPos + 25);\r\n window.addShape(cfrName);\r\n }\r\n spacingCounter++;\r\n }\r\n }\r\n lastStateMemory = num;\r\n spacingCounter = 1;\r\n }", "void drawOutline(DrawContext dc, Object shape);", "public void updateStylesheet(Pathway pathway, String espece) {\n\t\tfor (Reaction r : pathway.getReactionList()) {\n\t\t\tfor (String org : r.getEspece()) {\n\t\t\t\tif (org.equals(espece)) {\n\t\t\t\t\tgetNode(r.getEnzymeList().get(0)).setAttribute(\"ui.class\", \"enzyme\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void updateCFRABC(int num) {\r\n if (num < 0) {\r\n window.removeAllShapes();\r\n }\r\n else {\r\n State currentState = covidCalculator.getLL().get(num);\r\n ArrayList<Race> currentRacesSorted = covidCalculator.sortByABC(\r\n currentState);\r\n\r\n for (int i = 0; i < currentRacesSorted.size(); i++) {\r\n String cfrPercentage = String.valueOf(currentRacesSorted.get(i)\r\n .getCFR());\r\n\r\n if (!cfrPercentage.equals(\"-1%\")) {\r\n TextShape cfrName = new TextShape(0, 0, cfrPercentage);\r\n cfrName.moveTo(barXPos + (spacingSize * spacingCounter),\r\n +barYPos + 25);\r\n window.addShape(cfrName);\r\n }\r\n spacingCounter++;\r\n }\r\n }\r\n lastStateMemory = num;\r\n spacingCounter = 1;\r\n }", "int updateByPrimaryKey(FctWorkguide record);", "private void _generateAFullProf(int index) {\n String id;\n\n id = _getId(CS_C_FULLPROF, index);\n writer_.startSection(CS_C_FULLPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#FullProfessor\", true); \t\n }\n _generateAProf_a(CS_C_FULLPROF, index, id);\n if (index == chair_) {\n writer_.addProperty(CS_P_HEADOF,\n _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#headOf\", _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true); \t\n }\n } \n writer_.endSection(CS_C_FULLPROF);\n _assignFacultyPublications(id, FULLPROF_PUB_MIN, FULLPROF_PUB_MAX);\n }", "void updateListFromRecordSet(Cursor csr)\n\t\t{\n\t\t\tContentValues aC= getContentValues(csr);\n\t\t\taddNewMemo(new CurrentMemo(aC.getAsString(\"memo_date\"), aC.getAsString(\"memo_subject\"),\n\t\t\t\t\taC.getAsString(\"memo_athor\"), aC.getAsString(\"author_citizen_id\"),\n\t\t\t\t\taC.getAsString(\"memo_description\"), aC.getAsString(\"recv_time\")));\n\t\t\t//csr.moveToNext();\n\t\t}", "@Override\r\n\tpublic void updateEncore(Encore encore) {\n\t\tint i = sqlSession.update(ns3+\".updateEncore\", encore);\r\n\t\tif(i>0) System.out.println(\"update encore table completed\");\r\n\t}", "@SneakyThrows\n private void editInstructors(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/EditInstructorList.fxml\"));\n final Parent parent = fxmlLoader.load();\n EditInstructorListController editInstructorListController = fxmlLoader.getController();\n editInstructorListController.loadInstructors(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 }", "void updateCourseDetails(String courseId, String courseName, String courseFaculty);", "public int updateByFormId(FCouncilSummaryDO FCouncilSummary) throws DataAccessException {\n \tif (FCouncilSummary == null) {\n \t\tthrow new IllegalArgumentException(\"Can't update by a null data object.\");\n \t}\n\n\n return getSqlMapClientTemplate().update(\"MS-F-COUNCIL-SUMMARY-UPDATE-BY-FORM-ID\", FCouncilSummary);\n }", "private void updateEntry() {\n String desiredId = idField.getText();\n Student student = studentHashMap.get(desiredId);\n\n try {\n if (student == null) {\n throw new NoMatchFoundException();\n } else if (this.checkInput(student) == false) {\n throw new InputMismatchException();\n }\n } catch(NoMatchFoundException ex) {\n this.displayStatusPanel(\n \"Error: Entry not found.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n return;\n } catch(InputMismatchException e) {\n this.displayStatusPanel(\n \"Error: Information does not match data on file.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n return;\n }\n\n String grade = this.updateGrade(letterGrades);\n Integer credit = this.updateCredits(credits);\n\n if (grade == null || credit == null) {\n this.displayStatusPanel(\n \"Success: Update cancelled.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n } else {\n // Inspired by gpacalculator.net/college-gpa-calculator\n Integer numericGrade = Arrays.asList(\"F\", \"D\", \"C\", \"B\", \"A\").indexOf(grade);\n\n student.courseCompleted(numericGrade, credit);\n\n this.displayStatusPanel(\n \"Success: Grade has been updated.\\nGrade: \" + grade + \"\\nCredits: \" + credit,\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "public ToggleLinkingAction(ScriptOutlinePage outlinePage) {\n \t\t\tboolean isLinkingEnabled = DLTKUIPlugin\n \t\t\t\t\t.getDefault()\n \t\t\t\t\t.getPreferenceStore()\n \t\t\t\t\t.getBoolean(\n \t\t\t\t\t\t\tPreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);\n \t\t\tsetChecked(isLinkingEnabled);\n \t\t\tfJavaOutlinePage = outlinePage;\n \t\t}", "protected static void update() {\n\t\tstepsTable.update();\n\t\tactive.update();\n\t\tmeals.update();\n\t\t\n\t}", "private void _generateAFaculty(int index) {\n writer_.startSection(CS_C_FACULTY, _getId(CS_C_FACULTY, index));\n _generateAFaculty_a(CS_C_FACULTY, index, _getId(CS_C_FACULTY, index));\n writer_.endSection(CS_C_FACULTY);\n }", "private void updrec() {\n\t\tsavedata();\n\t\tcontractDetail.retrieve(stateVariable.getXwordn(), stateVariable.getXwabcd());\n\t\tnmfkpinds.setPgmInd36(! lastIO.isFound());\n\t\tnmfkpinds.setPgmInd66(isLastError());\n\t\t// BR00011 Product found on Contract_Detail and NOT ERROR(CONDET)\n\t\tif (! nmfkpinds.pgmInd36() && ! nmfkpinds.pgmInd66()) {\n\t\t\trestoredata();\n\t\t\tcontractDetail.update();\n\t\t\tnmfkpinds.setPgmInd99(isLastError());\n\t\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\t\tmsgObjIdx = setMsgObj(\"Y2U0007\", \"\", msgObjIdx, messages);\n\t\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tstateVariable.setZmsage(subString(errmsg, 1, 78));\n\t\t}\n\t}", "public static void createFoundation(String campus,String user,String kix) throws Exception {\n\nboolean debug = true;\n\n\t\tboolean compressed = true;\n\n\t\tFileWriter fstream = null;\n\t\tBufferedWriter output = null;\n\n Connection conn = null;\n\n\t\tString type = \"PRE\";\n\t\tString sql = \"\";\n\t\tString documents = \"\";\n\t\tString fileName = \"\";\n\n\t\tString alpha = \"\";\n\t\tString num = \"\";\n\t\tString courseTitle = \"\";\n\t\tString fndType = \"\";\n\n\t\tint rowsAffected = 0;\n\n\t\tPreparedStatement ps = null;\n\n\t\tboolean htmlCreated = false;\n\n\t\tString currentDrive = AseUtil.getCurrentDrive();\n\n\t\ttry {\n\t\t\tconn = AsePool.createLongConnection();\n\n\t\t\tif (conn != null){\n\n\t\t\t\tString[] info = getKixInfo(conn,kix);\n\t\t\t\talpha = info[Constant.KIX_ALPHA];\n\t\t\t\tnum = info[Constant.KIX_NUM];\n\t\t\t\tcourseTitle = info[Constant.KIX_COURSETITLE];\n\t\t\t\tfndType = info[Constant.KIX_ROUTE];\n\t\t\t\ttype = info[Constant.KIX_TYPE];\n\n\t\t\t\tinfo = Helper.getKixRoute(conn,campus,alpha,num,\"CUR\");\n\t\t\t\tString courseKix = info[0];\n\n\t\t\t\tint id = NumericUtil.getInt(getFndItem(conn,kix,\"id\"),0);\n\n\t\t\t\tif (debug) {\n\t\t\t\t\tlogger.info(\"campus: \" + campus);\n\t\t\t\t\tlogger.info(\"kix: \" + kix);\n\t\t\t\t\tlogger.info(\"alpha: \" + alpha);\n\t\t\t\t\tlogger.info(\"num: \" + num);\n\t\t\t\t\tlogger.info(\"courseTitle: \" + courseTitle);\n\t\t\t\t\tlogger.info(\"fndType: \" + fndType);\n\t\t\t\t\tlogger.info(\"type: \" + type);\n\t\t\t\t}\n\n\t\t\t\tString htmlHeader = Util.getResourceString(\"fndheader.ase\");\n\t\t\t\tString htmlFooter = Util.getResourceString(\"fndfooter.ase\");\n\t\t\t\tif (debug) logger.info(\"resource HTML\");\n\n\t\t\t\tdocuments = SysDB.getSys(conn,\"documents\");\n\t\t\t\tif (debug) logger.info(\"obtained document folder\");\n\n\t\t\t\ttry {\n\t\t\t\t\tfileName = currentDrive\n\t\t\t\t\t\t\t\t\t+ \":\"\n\t\t\t\t\t\t\t\t\t+ documents\n\t\t\t\t\t\t\t\t\t+ \"fnd\\\\\"\n\t\t\t\t\t\t\t\t\t+ campus\n\t\t\t\t\t\t\t\t\t+ \"\\\\\"\n\t\t\t\t\t\t\t\t\t+ kix\n\t\t\t\t\t\t\t\t\t+ \".html\";\n\n\t\t\t\t\tif (debug) logger.info(fileName);\n\n\t\t\t\t\tfstream = new FileWriter(fileName);\n\n\t\t\t\t\toutput = new BufferedWriter(fstream);\n\n\t\t\t\t\toutput.write(htmlHeader);\n\n\t\t\t\t\thtmlCreated = false;\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString junk = viewFoundation(conn,kix);\n\n\t\t\t\t\t\tif(CompDB.hasSLOs(conn,courseKix)){\n\t\t\t\t\t\t\tjunk += \"<hr size=\\\"1\\\" noshade=\\\"\\\"><br/><br/>\" + getLinkedItems(conn,campus,user,id,kix,Constant.COURSE_OBJECTIVES,true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tjunk = junk.replace(\"<br>\",\"<br/>\");\n\n\t\t\t\t\t\toutput.write(junk);\n\n\t\t\t\t\t\tHtml.updateHtml(conn,Constant.FOUNDATION,kix);\n\n\t\t\t\t\t\thtmlCreated = true;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tlogger.fatal(\"FndDB.createFoundation - fail to create foundation - \"\n\t\t\t\t\t\t\t+ campus + \" - \" + kix + \"\\n\" + e.toString());\n\t\t\t\t\t}\n\n\t\t\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\t\t\tString copyRight = \"\" + calendar.get(Calendar.YEAR);\n\n\t\t\t\t\thtmlFooter = htmlFooter.replace(\"[FOOTER_COPYRIGHT]\",\"Copyright ©1999-\"+copyRight+\" All rights reserved.\")\n\t\t\t\t\t\t\t\t.replace(\"[FOOTER_STATUS_DATE]\",footerStatus(conn,kix,type));\n\n\t\t\t\t\tif (debug) logger.info(\"obtained document folder\");\n\n\t\t\t\t\toutput.write(htmlFooter);\n\n\t\t\t\t\tif (debug) logger.info(\"HTML created\");\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tlogger.fatal(\"FndDB.createFoundation - fail to open/create file - \"\n\t\t\t\t\t\t\t+ campus + \" - \" + kix + \" - \" + \"\\n\" + e.toString());\n\t\t\t\t} finally {\n\t\t\t\t\toutput.close();\n\t\t\t\t}\n\n\t\t\t\tconn.close();\n\t\t\t\tconn = null;\n\n\t\t\t\tif (debug) logger.info(\"connection closed\");\n\n\t\t\t} // if conn != null\n\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"FndDB.createFoundation FAILED3 - \"\n\t\t\t\t\t+ campus + \" - \" + kix + \" - \" + \"\\n\" + e.toString());\n\t\t}\n\t\tfinally{\n\t\t\ttry{\n\t\t\t\tif (conn != null){\n\t\t\t\t\tconn.close();\n\t\t\t\t\tconn = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tlogger.fatal(\"FndDB.createFoundation\\n\" + kix + \"\\n\" + e.toString());\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "public abstract boolean updateBlackboard(Furniture c);", "public void updateOccupancy() {\n currentOccupancyMatrix = new int[numRows][numCols];\n\n int i, j;\n Bag people = station.area.getAllObjects();\n for (int x = 0; x < people.size(); x++) {\n Double2D location = ((Person) people.get(x)).getLocation();\n i = (int) (location.getY() / (station.area.getHeight() / numRows));\n j = (int) (location.getX() / (station.area.getWidth() / numCols));\n if (j >= numCols) {\n j = numCols - 1;\n }\n occupancyMatrix[i][j]++;\n currentOccupancyMatrix[i][j]++;\n //System.out.println(\"updated\");\n }\n }", "private void prmtRepairItem_dataChange(KDTable kdTable,\r\n\t\t\tRepairItemEntryInfo[] repairItemEntryInfos) {\n\t\ttry {\r\n\t\t\tsuper.isNotNull();\r\n\t\t} catch (Exception e) {\r\n\t\t\tUIUtils.handUIExceptionAndAbort(e);\r\n\t\t}\r\n\r\n\t\tif (PublicUtils.isEmpty(txtMile.getText())) {\r\n\t\t\tMsgBoxEx.showInfo(\"进厂行驶里程不能为空\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if(selectBlock == null)\r\n\t\tint beginRowIndex = kdTable.getRowCount();\r\n\t\t// else beginRowIndex = selectBlock.getBeginRow();\r\n\t\t// if (beginRowIndex > 0 && selectBlock == null)\r\n\t\t// beginRowIndex--;\r\n\t\t// boolean isFirstRowIndex = true;\r\n\t\t// 已全部结算,不允许添加数据\r\n\t\ttry {\r\n\t\t\tif (!canChangeBillHeadValue()) {\r\n\t\t\t\tMsgBoxEx.showInfo(\"已全部结算,不允许添加新项目!\");\r\n\t\t\t\tprmtRepairItem.setValue(null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} catch (Exception exc) {\r\n\t\t\tUIUtils.handUIException(exc);\r\n\t\t}\r\n\t\tisModify = true;\r\n\t\tint i = 0;\r\n\t\tint rowIndex = beginRowIndex;\r\n\t\tfor (int length = repairItemEntryInfos.length; i < length; i++) {\r\n\r\n\t\t\tRepairItemEntryInfo repairItemEntryInfo = repairItemEntryInfos[i];\r\n\t\t\tRepairItemInfo repairItemInfo = repairItemEntryInfo.getParent();\r\n\t\t\t// repairItemNums = repairItemNums + repairItemInfo.getNumber() +\r\n\t\t\t// \";\";\r\n\t\t\t/*\r\n\t\t\t * if(isFirstRowIndex) { if (beginRowIndex==0) insertLine(kdTable,\r\n\t\t\t * rowIndex); else if (kdTable.getCell(rowIndex,\r\n\t\t\t * \"repairItem\").getValue() != null || kdTable.getCell(rowIndex,\r\n\t\t\t * \"material\").getValue() != null) insertLine(kdTable, rowIndex);\r\n\t\t\t * \r\n\t\t\t * } else { insertLine(kdTable, rowIndex);\r\n\t\t\t * \r\n\t\t\t * }\r\n\t\t\t */\r\n\t\t\tinsertLine(kdTable, rowIndex);\r\n\t\t\tkdTable.getCell(rowIndex, \"repairItem\").setValue(repairItemInfo);\r\n\t\t\tkdTable.getCell(rowIndex, \"t\").setValue(TEnum.L);\r\n\t\t\tkdTable.getCell(rowIndex, \"itemspNum\").setValue(\r\n\t\t\t\t\trepairItemInfo.getNumber());\r\n\t\t\tkdTable.getCell(rowIndex, \"itemspName\").setValue(\r\n\t\t\t\t\trepairItemInfo.getName());\r\n\t\t\tkdTable.getCell(rowIndex, \"issueQty\").setValue(null);\r\n\t\t\tkdTable.getCell(rowIndex, \"unIssueQty\").setValue(null);\r\n\r\n\t\t\ttry {\r\n\t\t\t\t/** 计算标准工时、工时单价、工时成本 */\r\n\t\t\t\tBigDecimal workTimeQty = getRepairItemWorkTimeQty(repairItemInfo);\r\n\t\t\t\tkdTable.getCell(rowIndex, \"worktimeQty\").setValue(workTimeQty);\r\n\t\t\t\tkdTable.getCell(rowIndex, \"worktimePrice\").setValue(workTimeStdPrice);\r\n\t\t\t\tkdTable.getCell(rowIndex, \"worktimeCost\").setValue(workTimeQty.multiply(workTimeStdPrice));\r\n\r\n\t\t\t\t// 出关联配件\r\n\t\t\t\tRepairItemSpEntryCollection repairItemSpEntryCol = getRepairItemSPEntryCollection(repairItemInfo);\r\n\t\t\t\tBigDecimal defaultRepairItemTaxPrice = repairItemInfo.getBigDecimal(\"price\"); // 参考售价(含税)\r\n\r\n\t\t\t\tif (PublicUtils.equals(repairItemInfo, defaultRepairItemForTXT)) {\r\n\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").setValue(BIGDEC0);\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif (defaultRepairItemTaxPrice != null && defaultRepairItemTaxPrice.compareTo(BIGDEC0) != 0) {\r\n\t\t\t\t\t\tBigDecimal taxRate = PublicUtils.getBigDecimal(kdTable.getRow(rowIndex).getCell(\"taxRate\").getValue());\r\n\t\t\t\t\t\tBigDecimal defaultPrice = defaultRepairItemTaxPrice.divide(BIGDEC1.add(taxRate.divide(BIGDEC100,10, BigDecimal.ROUND_HALF_UP)), 10,BigDecimal.ROUND_HALF_UP);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").setValue(defaultPrice);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (PublicUtils.isEmpty(repairItemSpEntryCol)) { // 无关联配件时\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\t// 默认39\r\n\t\t\t\t\t\t\t// ,\r\n\t\t\t\t\t\t\t// 否则为0\r\n\t\t\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").setValue(new BigDecimal(39));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").setValue(BIGDEC0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (repairItemInfo.getNumber().startsWith(\"FDJQ\")) {\r\n\t\t\t\t\tkdTable.getCell(rowIndex, \"qty\").setValue(new BigDecimal(-1));\r\n\t\t\t\t}\r\n\t\t\t\tif (rowIndex > 0) {\r\n\t\t\t\t\tWInfo wInfo = (WInfo) kdTable.getRow(0).getCell(\"w\")\r\n\t\t\t\t\t\t\t.getValue();\r\n\t\t\t\t\tif (wInfo != null) {\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"w\").setValue(wInfo);\r\n\t\t\t\t\t\tkdtRWOItemSpEntry.getRow(rowIndex).getCell(\"settlementObject\").setValue(wInfo.getSettleObject());\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcalItemSpEntryAmount(kdTable.getRow(rowIndex));\r\n\t\t\t\t// 维修项目分录ID\r\n\t\t\t\tString repairItemEntryId = ((RepairWORWOItemSpEntryInfo) kdTable.getRow(rowIndex).getUserObject()).getString(\"id\");\r\n\t\t\t\trowIndex++;\r\n\t\t\t\t// 自动带出关联配件\r\n\t\t\t\tif (!PublicUtils.isEmpty(repairItemSpEntryCol)) {\r\n\r\n\t\t\t\t\tString orgId = orgUnitInfo.getString(\"id\");\r\n\t\t\t\t\tfor (int j = 0; j < repairItemSpEntryCol.size(); j++) {\r\n\t\t\t\t\t\tRepairItemSpEntryInfo repairItemSpEntryInfo = repairItemSpEntryCol.get(j);\r\n\t\t\t\t\t\tMaterialInfo materialInfo = repairItemSpEntryInfo.getMaterial();\r\n\t\t\t\t\t\tBigDecimal qty = PublicUtils.getBigDecimal(repairItemSpEntryInfo.getBigDecimal(\"qty\"));\r\n\t\t\t\t\t\tBigDecimal price = PublicUtils.getBigDecimal(repairItemSpEntryInfo.getBigDecimal(\"price\"));\r\n\t\t\t\t\t\tBigDecimal discountRate = PublicUtils.getBigDecimal(repairItemSpEntryInfo.getBigDecimal(\"discountRate\"));\r\n\r\n\t\t\t\t\t\tBigDecimal costPrice = getMaterialCostPrice(orgId,materialInfo);\r\n\t\t\t\t\t\tinsertLine(kdTable, rowIndex);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"costAmount\").setValue(costPrice);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"material\").setValue(materialInfo);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"t\").setValue(TEnum.P);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"itemspNum\").setValue(materialInfo.getNumber());\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"itemspName\").setValue(materialInfo.getName());\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"qty\").setValue(qty);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString sql = String.format(\"select isnull(FPrice,0) FPrice,FTaxRate from T_BD_MaterialSales where FMaterialID='%s' and FOrgUnit='%s'\",\r\n\t\t\t\t\t\t\t\tmaterialInfo.getString(\"id\"), orgUnitInfo.getString(\"id\"));\r\n\t\t\t\t\r\n\t\t\t\t\t\tIRowSet rs = DBUtils.executeQuery(null, sql);\r\n\t\t\t\t\t\tif (rs != null && rs.next()) {\r\n\t\t\t\t\t\t\tif (rs.getBigDecimal(\"FTaxRate\") != null && !PublicUtils.equals(BigDecimal.ZERO, rs.getBigDecimal(\"FTaxRate\"))) {\r\n\t\t\t\t\t\t\t\tkdTable.getCell(rowIndex, \"taxRate\").setValue(rs.getBigDecimal(\"FTaxRate\"));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tBigDecimal retailDiscountRate = BIGDEC0;\r\n\t\t\t\t\t\tHashMap<String, BigDecimal> hashDiscountRate = getDiscountRate();\r\n\t\t\t\t\t\tif (!PublicUtils.isEmpty(hashDiscountRate)) {\r\n\t\t\t\t\t\t\tretailDiscountRate = hashDiscountRate.get(DiscountDate_Retail);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"discountRate\").setValue(retailDiscountRate);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"unIssueQty\").setValue(qty);\r\n\t\t\t\t\t\tif (rowIndex > 0) {\r\n\t\t\t\t\t\t\tWInfo wInfo = (WInfo) kdTable.getRow(0).getCell(\"w\").getValue();\r\n\t\t\t\t\t\t\tif (wInfo != null) {\r\n\t\t\t\t\t\t\t\tkdTable.getCell(rowIndex, \"w\").setValue(wInfo);\r\n\t\t\t\t\t\t\t\tkdtRWOItemSpEntry.getRow(rowIndex).getCell(\"settlementObject\").setValue(wInfo.getSettleObject());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tkdTable.getRow(rowIndex).getCell(\"itemspName\").getStyleAttributes().setLocked(!hasPermission_OprtRetailItemspName);\r\n\r\n\t\t\t\t\t\t// 关联维修项目参考售价未配置或为0时,关联配件取自身的参考售价,否则为0----取消\r\n\t\t\t\t\t\t// if (defaultRepairItemTaxPrice == null ||\r\n\t\t\t\t\t\t// defaultRepairItemTaxPrice.compareTo(BIGDEC0) == 0) {\r\n\t\t\t\t\t\t// String sql = String.format(\r\n\t\t\t\t\t\t// \"select isnull(FPrice,0) from T_BD_MaterialSales where FMaterialID='%s' and FOrgUnit='%s'\"\r\n\t\t\t\t\t\t// ,\r\n\t\t\t\t\t\t//materialInfo.getString(\"id\"),orgUnitInfo.getString(\"id\"\r\n\t\t\t\t\t\t// ));\r\n\t\t\t\t\t\t// IRowSet rs = DBUtils.executeQuery(null, sql);\r\n\t\t\t\t\t\t// if (rs != null && rs.next()) {\r\n\t\t\t\t\t\t// kdTable.getCell(rowIndex,\r\n\t\t\t\t\t\t// \"price\").setValue(rs.getBigDecimal(1));\r\n\t\t\t\t\t\t//\t\t\t\t\r\n\t\t\t\t\t\t// } else {\r\n\t\t\t\t\t\t// throw new EASBizException(new\r\n\t\t\t\t\t\t// NumericExceptionSubItem(\r\n\t\t\t\t\t\t// \"\",String.format(\"物料[%s],销售组织[%s]未分配销售页签,请先分配\"\r\n\t\t\t\t\t\t// ,materialInfo\r\n\t\t\t\t\t\t// .getName(),orgUnitInfo.getString(\"name\"))));\r\n\t\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t\t// } else {\r\n\t\t\t\t\t\t// kdTable.getCell(rowIndex, \"price\").setValue(BIGDEC0);\r\n\t\t\t\t\t\t// }\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").setValue(price);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"discountRate\").setValue(discountRate);\r\n\r\n\t\t\t\t\t\tIRow row = kdTable.getRow(rowIndex);\r\n\t\t\t\t\t\tcalItemSpEntryAmount(row);\r\n\t\t\t\t\t\t// 默认首次计算出初始的实际含税单价\r\n\t\t\t\t\t\tBigDecimal taxPrice = (BigDecimal) row.getCell(\"taxPrice\").getValue(); // 含税\r\n\t\t\t\t\t\t// BigDecimal discountRate = (BigDecimal)\r\n\t\t\t\t\t\t// row.getCell(\"discountRate\").getValue();\r\n\t\t\t\t\t\tBigDecimal initFactPrice = taxPrice.multiply(BIGDEC1.subtract(discountRate.divide(BIGDEC100, 10,BigDecimal.ROUND_HALF_UP)));\r\n\t\t\t\t\t\trow.getCell(\"initFactPrice\").setValue(initFactPrice);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"price\").getStyleAttributes().setLocked(!hasPermission_OprtRetailPrice);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"taxPrice\").getStyleAttributes().setLocked(!hasPermission_OprtRetailPrice);\r\n\t\t\t\t\t\tkdTable.getCell(rowIndex, \"relateItemEntryId\").setValue(repairItemEntryId);\r\n\r\n\t\t\t\t\t\tresetItemSpEditorLocked(kdTable.getRow(rowIndex));\r\n\r\n\t\t\t\t\t\trowIndex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tstoreFields();\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tUIUtils.handUIException(e);\r\n\t\t\t}\r\n\t\t\t// isFirstRowIndex = false;\r\n\t\t}\r\n\t\tint qtyIndex = kdTable.getColumnIndex(\"qty\");\r\n\t\tkdTable.getEditManager().editCellAt(beginRowIndex, qtyIndex);\r\n\r\n\t}", "@Override\n public void updateTotalScore(String faculty) throws IOException {\n\n String sql = \"UPDATE sep2_schema.house_cup SET totalscore = (SELECT sum(score) FROM sep2_schema.player_scores \"\n + \"JOIN sep2_schema.player ON player.nickname = player_scores.playernick WHERE player.faculty = ?) \"\n + \"WHERE faculty = ?;\";\n\n try {\n db.update(sql, faculty);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "private void addISTRN()\n\t{\n\t\t\n\t\tif(cl_dat.M_flgLCUPD_pbst)\n\t\t{\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tM_strSQLQRY = \"Select IST_WRHTP,IST_ISSTP,IST_PRDCD,IST_PRDTP,IST_LOTNO,IST_RCLNO,IST_PKGTP,IST_PKGCT,IST_MNLCD,IST_ISSQT from FG_ISTRN where IST_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and IST_ISSNO='\"+txtISSNO.getText().toString().trim() +\"' and IST_STSFL='2'\";\n\t\t\t\t//System.out.println(M_strSQLQRY);\n\t\t\t\tM_rstRSSET = cl_dat.exeSQLQRY1(M_strSQLQRY);\n\t\t\t\twhile(M_rstRSSET.next())\n\t\t\t\t{\n\t\t\t\t\tstrWRHTP = M_rstRSSET.getString(\"IST_WRHTP\");\n\t\t\t\t\tstrISSTP = M_rstRSSET.getString(\"IST_ISSTP\");\n\t\t\t\t\tstrPRDCD = M_rstRSSET.getString(\"IST_PRDCD\");\n\t\t\t\t\tstrPRDTP = M_rstRSSET.getString(\"IST_PRDTP\");\n\t\t\t\t\tstrLOTNO = M_rstRSSET.getString(\"IST_LOTNO\");\n\t\t\t\t\tstrRCLNO = M_rstRSSET.getString(\"IST_RCLNO\");\n\t\t\t\t\tstrPKGTP = M_rstRSSET.getString(\"IST_PKGTP\");\n\t\t\t\t\tstrMNLCD = M_rstRSSET.getString(\"IST_MNLCD\");\n\t\t\t\t\tstrPKGCT = M_rstRSSET.getString(\"IST_PKGCT\");\n\t\t\t\t\tstrISSQT = M_rstRSSET.getString(\"IST_ISSQT\");\n\t\t\t\t\t//System.out.println(strISSQT);\n\t\t\t\t\tsetMSG(\"Updating FG_LCMST\",'N');\n\t\t\t\t//\tchkLCMST();\n\t\t\t\t\tsetMSG(\"Updating FG_STMST\",'N'); \n\t\t\t\t\t//chkSTMST();\n\t\t\t\t\tsetMSG(\"Updating FG_ISTRN\",'N');\n\t\t\t\t\t//System.out.println(\"updating\");\n\t\t\t\t\tupdISTRN();\n\t\t\t\t\tsetMSG(\"Updating CO_PRMST\",'N');\n\t\t\t\t\tchkPRMST();\n\t\t\t\t\tsetMSG(\"Updating PR_LTMST\",'N');\n\t\t\t\t\tchkLTMST();\n\t\t\t\t\t}\n\t\t\t\tif(M_rstRSSET !=null)\n\t\t\t\t\tM_rstRSSET.close();\t\n\t\t\t}catch(Exception L_EX)\n\t\t\t{\n\t\t\tsetMSG(L_EX,\"addISTRN\");\n\t\t\t}\n\t\t}\n\t}", "private void updLCMST(){ \n\t\ttry{\n\t\t\t\tM_strSQLQRY = \"Update FG_LCMST set \";\n\t\t\t\tM_strSQLQRY += \"LC_STKQT = LC_STKQT + \"+strISSQT+\",\";\n\t\t\t\tM_strSQLQRY += \"LC_TRNFL = '0',\";\n\t\t\t\tM_strSQLQRY += \"LC_LUSBY = '\"+cl_dat.M_strUSRCD_pbst+\"',\";\n\t\t\t\tM_strSQLQRY += \"LC_LUPDT = '\"+M_fmtDBDAT.format(M_fmtLCDAT.parse(cl_dat.M_strLOGDT_pbst))+\"'\";\n\t\t\t\tM_strSQLQRY += \" where lc_CMPCD = '\"+cl_dat.M_strCMPCD_pbst+\"' and lc_wrhtp = '\"+strWRHTP+\"'\";\n\t\t\t\tM_strSQLQRY += \" and lc_mnlcd = '\"+strMNLCD+\"'\";\n\t\t\t\t\n\t\t\t\tcl_dat.exeSQLUPD(M_strSQLQRY,\"setLCLUPD\");\n\t\t\t\t//System.out.println(M_strSQLQRY);\n\t\t\t\t\n\t\t}catch(Exception L_EX){\n\t\t\tsetMSG(L_EX,\"updLCMST\");\n\t\t}\n\t}", "@Override\n public int update(J34SiscomexPaises j34SiscomexPaises) {\n return super.doUpdate(j34SiscomexPaises);\n }", "public void unlockCashDrawer(CashDrawer cd, String documentId);", "public void update(TheatreMashup todo) {\n\t\t\n\t}", "protected void prepareToDrawOutline(DrawContext dc, ShapeAttributes activeAttrs, ShapeAttributes defaultAttrs)\n {\n if (activeAttrs == null || !activeAttrs.isDrawOutline())\n return;\n\n GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.\n\n if (!dc.isPickingMode())\n {\n Material material = activeAttrs.getOutlineMaterial();\n if (material == null)\n material = defaultAttrs.getOutlineMaterial();\n\n if (this.mustApplyLighting(dc, activeAttrs))\n {\n material.apply(gl, GL2.GL_FRONT_AND_BACK, (float) activeAttrs.getOutlineOpacity());\n\n gl.glEnable(GL2.GL_LIGHTING);\n gl.glEnableClientState(GL2.GL_NORMAL_ARRAY);\n }\n else\n {\n Color sc = material.getDiffuse();\n double opacity = activeAttrs.getOutlineOpacity();\n gl.glColor4ub((byte) sc.getRed(), (byte) sc.getGreen(), (byte) sc.getBlue(),\n (byte) (opacity < 1 ? (int) (opacity * 255 + 0.5) : 255));\n\n gl.glDisable(GL2.GL_LIGHTING);\n gl.glDisableClientState(GL2.GL_NORMAL_ARRAY);\n }\n\n gl.glHint(GL.GL_LINE_SMOOTH_HINT, activeAttrs.isEnableAntialiasing() ? GL.GL_NICEST : GL.GL_DONT_CARE);\n }\n\n if (dc.isPickingMode() && activeAttrs.getOutlineWidth() < this.getOutlinePickWidth())\n gl.glLineWidth(this.getOutlinePickWidth());\n else\n gl.glLineWidth((float) activeAttrs.getOutlineWidth());\n\n if (activeAttrs.getOutlineStippleFactor() > 0)\n {\n gl.glEnable(GL2.GL_LINE_STIPPLE);\n gl.glLineStipple(activeAttrs.getOutlineStippleFactor(), activeAttrs.getOutlineStipplePattern());\n }\n else\n {\n gl.glDisable(GL2.GL_LINE_STIPPLE);\n }\n\n gl.glDisable(GL.GL_TEXTURE_2D);\n }", "int updateByExample(County record, CountyExample example);", "public void getLandmarksToBeDrawn(){\n ((Pane) mapImage.getParent()).getChildren().removeIf(x->x instanceof Circle || x instanceof Text || x instanceof Line);\n int landmark1 = l1.getSelectionModel().getSelectedIndex();\n int landmark2 = l2.getSelectionModel().getSelectedIndex();\n GraphNodeAL<MapPoint> lm1 = landmarkList.get(landmark1);\n GraphNodeAL<MapPoint> lm2 = landmarkList.get(landmark2);\n CostedPath path=shortestRouteDij(lm1,lm2); \n GraphNodeAL<MapPoint> prev=null;\n for(GraphNodeAL<?> n : path.pathList) { \n drawLandmarks((GraphNodeAL<MapPoint>) n);\n if(prev!=null) lineDraw(prev, (GraphNodeAL<MapPoint>) n);\n prev= (GraphNodeAL<MapPoint>) n;\n }\n }", "public void updateStudentCOOP(StudentCOOP toUpdate) {\n openConnection();\n try {\n updateStudent = conn.prepareStatement(\"update app.studentcoop set firstname=?, lastname=?, gender=?, address=?,\"\n + \" contact=?, email=?, workemail=?, notes=?, subject=?, semestercompleted=?, mark=?, wam=?\");\n \n updateStudent.setString(1, toUpdate.getZID());\n updateStudent.setString(1, toUpdate.getFName());\n updateStudent.setString(2, toUpdate.getLName());\n updateStudent.setString(3, toUpdate.getGEnder());\n updateStudent.setString(4, toUpdate.getADdress());\n updateStudent.setInt(5, toUpdate.getCOntact());\n updateStudent.setString(6, toUpdate.getEMail());\n updateStudent.setString(7, toUpdate.getWOrkemail());\n updateStudent.setString(8, toUpdate.getNOtes());\n updateStudent.setString(9, toUpdate.getSUbject());\n updateStudent.setInt(10, toUpdate.getSEmestercompleted());\n updateStudent.setDouble(11, toUpdate.getMArk());\n updateStudent.setDouble(12, toUpdate.getWAm());\n\n updateStudent.executeUpdate();\n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n closeConnection();\n }", "int updateByPrimaryKeySelective(FctWorkguide record);", "public void updateFeatue(Long id, FeatureLookup feature) {\n\r\n\t}", "private void addUpdateAPI(FunctionGenerator fg) throws EQException\n\t{\n\t\tAPIFieldSet apiFieldSet = FunctionToolbox.getAPIFieldSet(session, \"LID\", \"MCD\", \"G01M\", \"Maintain Customer Details\", \"M\");\n\t\tfg.addUpdateAPIFieldSet(apiFieldSet);\n\t}", "private void updateRaceCFR(int num) {\r\n window.removeAllShapes();\r\n\r\n if (!(num < 0)) {\r\n State currentState = covidCalculator.getLL().get(num); // state\r\n ArrayList<Race> currentRacesSorted = covidCalculator.sortByCFR(\r\n currentState);\r\n\r\n for (int i = 0; i < currentRacesSorted.size(); i++) {\r\n String currentRace = currentRacesSorted.get(i).getRaceName();\r\n TextShape raceNameShape = new TextShape(0, 0, currentRace);\r\n\r\n raceNameShape.moveTo(barXPos + (spacingSize * spacingCounter),\r\n barYPos);\r\n window.addShape(raceNameShape);\r\n spacingCounter++;\r\n }\r\n\r\n }\r\n lastStateMemory = num;\r\n spacingCounter = 1;\r\n }", "public void expandCells() {\n\t\t//For the first pollutant create a new set of files\n\t\tString[] pollutants = factorsTable.keySet().toArray(new String[1]);\n\t\t\n\t\t//Now, for each row, we need to expand the total flow for each \n\t\t//type of day and for each hour of the day.\n\t\tdouble[] factorsRow = null;\n\t\tString key = null;\n\t\tfor(String type:types){\n\t\t\ttotalsTable = new TableTotal(0, 83, 84);\n\t\t\ttotalsTable.setLabels(pollutants);\n\t\t\tfor(int i=0;i<nHours;i++){\t\n\t\t\t\tkey = pollutants[0];\n\t\t\t\tfactorsRow = factorsTable.get(key);\n\t\t\t\t//Open the output file\n\t\t\t\tOutputSheet outputSheet =new OutputSheet(outputModel);\n\t\t\t\toutputSheet.setPost(\"_\"+key+\"_\"+type+\"_\"+(i*100));\n\t\t\t\t\n\t\t\t\t//Get iterator to all the rows in current sheet\n\t\t\t\tIterator<Row> rowIterator = cells.iterator();\n\t\t\t\trowIterator.next();//Ignore the column names. We actually know it.\n\t\t\t\tRow row = null;//The current cell\n\t\t\t\t//int k=0;\n\t\t\t\twhile(rowIterator.hasNext()){\n\t\t\t\t\t//System.out.println(k++);\n\t\t\t\t\trow = rowIterator.next();\n\t\t\t\t\tdouble sharedKey = row.getCell(CELLKEY).getNumericCellValue();\n\t\t\t\t\tint fidGrid = (int)row.getCell(CELL_FID_GRID).getNumericCellValue();\n\t\t\t\t\t//double total = row.getCell(CELLQUERY).getNumericCellValue();\n\t\t\t\t\tdouble longitude = row.getCell(CELL_LONGUITUDE).getNumericCellValue();\n\t\t\t\t\t\n\t\t\t\t\tString fullKey = Math.round(sharedKey)+type+i*100;\n\t\t\t\t\tdouble[] values = null;\n\t\t\t\t\tif(tableValues.containsKey(fullKey)){\n\t\t\t\t\t\tvalues = tableValues.get(fullKey);\n\t\t\t\t\t\toutputSheet.push(values, fidGrid, longitude);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toutputSheet.replaceFactors(factorsRow);\n\t\t\t\toutputSheet.save();\n\t\t\t\t//Update the total\n\t\t\t\ttotalsTable.updateTotals(outputSheet.getSheet(), 0);\n\t\t\t\t\n\t\t\t\t//Now, for each other contaminant a new set of files have to be created\n\t\t\t\tfor(int k=pollutants.length-1;k>0;k--){\n\t\t\t\t\tkey=pollutants[k];\n\t\t\t\t\tfactorsRow = factorsTable.get(key);\n\t\t\t\t\toutputSheet.setPost(\"_\"+key+\"_\"+type+\"_\"+(i*100));\n\t\t\t\t\toutputSheet.replaceFactors(factorsRow);\n\t\t\t\t\toutputSheet.save();\n\t\t\t\t\t\n\t\t\t\t\t//Update the total\n\t\t\t\t\ttotalsTable.updateTotals(outputSheet.getSheet(), k);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\ttotalsTable.save(new File(outputModel.getAbsolutePath().replace(\"output.xlsx\", \"outputTotals_\"+type+\".csv\")));\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"The totals file could not be saved\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void updateAll() {\n updateAction();\n updateQueryViews();\n }", "private void update() {\r\n\t\t\r\n\t\tfor(int r = 0; r < seatGrid.length; r++) {\r\n\t\t\tfor(int c =0; c< seatGrid[0].length; c++) {\r\n\t\t\t\tseatGrid[r][c].setText(chart.getStudentName(r, c));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void ClearLine6() throws SQLException {\r\n try (Statement s = DBConnect.connection.createStatement()) {\r\n String clearLine = \"Update \" +StFrmNm+ \" Set Sku = null, Qty = null, Description1 = null, Orig_Sku = null, \"\r\n + \"Description2 = null, Attribute2 = null, Size2 = null, Orig_Retail = null, Manuf_Inspection = null, \"\r\n + \"New_Used = null, Reason = null, Desc_Damage = null, Cust_Satisf = null, Warranty = null, Second_Cost = null, \"\r\n + \"Form_Name = null, Second_Sku_Vendor = null, Ln_Date = null, Second_Sku_VPNum = null, Ord_C$ = null, First_DCS = null, Second_DCS = null \"\r\n + \"WHERE Line = '\" + EBAS.L6.getText() + \"'\";\r\n s.execute(clearLine);\r\n }\r\n }", "private void updateExpensesCategoriesBreakdown() {\n TextView amountEntertainment = (TextView) findViewById(R.id.amount_categoryBreakdown_entertainment);\n TextView amountFood = (TextView) findViewById(R.id.amount_categoryBreakdown_food);\n TextView amountGifts = (TextView) findViewById(R.id.amount_categoryBreakdown_gifts);\n TextView amountMisc = (TextView) findViewById(R.id.amount_categoryBreakdown_misc);\n TextView amountShopping = (TextView) findViewById(R.id.amount_categoryBreakdown_shopping);\n TextView amountTravel = (TextView) findViewById(R.id.amount_categoryBreakdown_travel);\n\n amountEntertainment.setText(R.string.str_dollarSign);\n amountFood.setText(R.string.str_dollarSign);\n amountGifts.setText(R.string.str_dollarSign);\n amountMisc.setText(R.string.str_dollarSign);\n amountShopping.setText(R.string.str_dollarSign);\n amountTravel.setText(R.string.str_dollarSign);\n\n amountEntertainment.append(database.getCategoryExpenditure(\"entertainment\", selectedMonth).toString());\n amountFood.append(database.getCategoryExpenditure(\"food\", selectedMonth).toString());\n amountGifts.append(database.getCategoryExpenditure(\"gifts\", selectedMonth).toString());\n amountMisc.append(database.getCategoryExpenditure(\"misc\", selectedMonth).toString());\n amountShopping.append(database.getCategoryExpenditure(\"shopping\", selectedMonth).toString());\n amountTravel.append(database.getCategoryExpenditure(\"travel\", selectedMonth).toString());\n }", "void update(Employee nurse);", "public void setOutline2(java.lang.String value) {\n\t\tsetValue(org.jooq.examples.oracle.sys.packages.dbms_xplan.DiffPlanOutline.OUTLINE2, value);\n\t}", "private void editEvent(VBox day, String descript, String termID) {\n Label dayLbl = (Label)day.getChildren().get(0);\n Model.getInstance().event_day = Integer.parseInt(dayLbl.getText());\n Model.getInstance().eventEnd_day = Integer.parseInt(dayLbl.getText());\n Model.getInstance().event_month = Model.getInstance().getMonthIndex(monthSelect.getSelectionModel().getSelectedItem()); \n Model.getInstance().event_year = Integer.parseInt(selectedYear.getValue());\n Model.getInstance().eventEnd_month = Model.getInstance().getMonthIndex(monthSelect.getSelectionModel().getSelectedItem()); \n Model.getInstance().eventEnd_year = Integer.parseInt(selectedYear.getValue());\n Model.getInstance().event_subject = descript;\n Model.getInstance().event_term_id = Integer.parseInt(termID);\n\n // When user clicks on any date in the calendar, event editor window opens\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(getClass().getResource(\"/views/planings/edit_event.fxml\"));\n \n AnchorPane rootLayout = (AnchorPane) loader.load();\n Stage stage = new Stage(StageStyle.UNDECORATED);\n stage.initModality(Modality.APPLICATION_MODAL); \n\n // Pass main controller reference to view\n EditEventController eventController = loader.getController();\n eventController.setMainController(this);\n \n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout);\n stage.setScene(scene);\n stage.show();\n } catch (IOException ex) {\n Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "@Override\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tjDialog.dispose();\n\t\t\t\t\t\tEditOnlineShelf editOnlineShelf=new EditOnlineShelf(nodeText,jTextArea.getText());\n\t\t\t\t\t}", "public void update() {\n int id = this.id;\n String name = person_name.getText().toString().trim();\n if (name.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Name\", Toast.LENGTH_LONG).show();\n return;\n }\n String no = contact_no.getText().toString().trim();\n if (no.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Contact No.\", Toast.LENGTH_LONG).show();\n return;\n }\n String nickname = nickName.getText().toString().trim();\n if (nickname.equals(\"\")) {\n nickname = \"N/A\";\n }\n String Custno = rootNo.getText().toString().trim();\n if (Custno.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Customer No.\", Toast.LENGTH_LONG).show();\n return;\n }\n float custNo = Float.parseFloat(Custno);\n\n String Fees = monthly_fees.getText().toString().trim();\n if (Fees.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the monthly fees\", Toast.LENGTH_LONG).show();\n return;\n }\n int fees = Integer.parseInt(Fees);\n\n String Balance = balance_.getText().toString().trim();\n if (Balance.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the balance\", Toast.LENGTH_LONG).show();\n return;\n }\n int balance = Integer.parseInt(Balance);\n String date = startdate.getText().toString().trim();\n if (startdate.equals(\"\")) {\n Toast.makeText(getApplicationContext(), \"Enter the Start Date\", Toast.LENGTH_LONG).show();\n return;\n }\n\n\n dbHendler.updateInfo(new PersonInfo(id, name, no, custNo, fees, balance, areaId, date, nickname));\n person_name.setText(\"\");\n contact_no.setText(\"\");\n rootNo.setText(\"\");\n monthly_fees.setText(\"\");\n balance_.setText(\"\");\n nickName.setText(\"\");\n //changeButton.setEnabled(false);\n finish();\n viewAll();\n\n }", "public void updateUf() {\n ArrayList<FunctionalUnit> updateList = new ArrayList<>();\n updateList = FU.get(typeFU.GENERIC);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n updateList = FU.get(typeFU.ADD);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n updateList = FU.get(typeFU.MULT);\n for (int i = 0; i < updateList.size(); i++) {\n if (updateList.get(i).isExecFinish() == true) {\n updateList.get(i).setActive(true); \n }\n }\n }", "@FXML void expandc1p2(MouseEvent event) { \n\ttry {\n\t\tFXMLLoader loader = new FXMLLoader (getClass().getResource(\"/resources/Fxml/ShowCandidate.fxml\"));\n Parent root = (Parent) loader.load();\n ShowCandidateController SCController=loader.getController();\n SCController.mailFunction(mailc1p2.getText());\n SCController.TitleFunction(TitleLabel1.getText());\n SCController.ExpFunction(ExpLabel1.getText());\n SCController.SectorFunction(SectorLabel1.getText());\n SCController.RegionFunction(RegionLabel1.getText()); \n Stage stage = new Stage();\n stage.setScene(new Scene(root));\n stage.setResizable(false);\n stage.show(); \n\t} catch (IOException e) {\n\t\te.printStackTrace(); }\t\n}", "public static void createFoundation(String campus,String kix) throws Exception {\n\n\t\tcreateFoundation(campus,\"\",kix);\n\n\t}", "private void createCNSHIsFull() {\r\n createStudentList(new Student(\"Vasile Ana\", 10), new Student(\"Marin Alina\", 6), new Student(\"Ilie David\", 8), new Student(\"Gheorghe Alex\", 9));\r\n createSchoolList(new School(\"C.N.S.H.\", 0), new School(\"C.N.C.H.\", 8), new School(\"C.N.A.E.\", 10));\r\n createStudentPreferences(new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1])), new LinkedList<>(Arrays.asList(schools[0], schools[2])));\r\n createSchoolPreferences(new LinkedList<>(Arrays.asList(students[0], students[1], students[2], students[3])), new LinkedList<>(Arrays.asList(students[0], students[1], students[2])), new LinkedList<>(Arrays.asList(students[1], students[3], students[0])));\r\n }", "public int update(FCouncilSummaryDO FCouncilSummary) throws DataAccessException {\n \tif (FCouncilSummary == null) {\n \t\tthrow new IllegalArgumentException(\"Can't update by a null data object.\");\n \t}\n\n\n return getSqlMapClientTemplate().update(\"MS-F-COUNCIL-SUMMARY-UPDATE\", FCouncilSummary);\n }", "public static int updateFo(HashMap<String, String> fomap) {\r\n\r\n\t\tStatement st = null;\r\n\t\tint row = 0;\r\n\t\ttry (Connection con = Connect.getConnection();) {\r\n\t\t\tcon.setAutoCommit(false);\r\n\t\t\tString query = \"\";\r\n\t\t\tif (fomap.get(\"imageId1\").equals(\"0\")) {\r\n\t\t\t\tquery = \"UPDATE field_officer SET fo_name = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"firstName\") + \"', fo_priamary_phone = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"phone1\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_secondary_phone = '\" + fomap.get(\"phone2\")\r\n\t\t\t\t\t\t+ \"', fo_gender = '\" + fomap.get(\"gender\")\r\n\t\t\t\t\t\t+ \"', fo_date_of_birth = '\" + fomap.get(\"dateOfBirth\")\r\n\t\t\t\t\t\t+ \"'\" + \", fo_cnic = '\" + fomap.get(\"cnic\")\r\n\t\t\t\t\t\t+ \"', fo_date_of_joining = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"joiningDate\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_blood_group = '\" + fomap.get(\"bloodGroup\")\r\n\t\t\t\t\t\t+ \"', fo_marital_status = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"marritalStatus\") + \"', fo_vehical = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"vehicle\") + \"'\" + \", fo_address = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"address\") + \"', fo_educated = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"educated\")\r\n\t\t\t\t\t\t+ \"', fo_college_university = '\" + fomap.get(\"college\")\r\n\t\t\t\t\t\t+ \"'\" + \", fo_certificate = '\" + fomap.get(\"degree\")\r\n\t\t\t\t\t\t+ \"', fo_education_start_date = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"dateOfStart\")\r\n\t\t\t\t\t\t+ \"', fo_education_end_date = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"dateOfEnd\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_education_percentage = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"percentage\") + \"', fo_base_salary = '\"\r\n\t\t\t\t\t\t+ Double.parseDouble(fomap.get(\"salary\")) + \"'\"\r\n\t\t\t\t\t\t+ \", fo_before_time = '\"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"beforeTime\"))\r\n\t\t\t\t\t\t+ \"', fo_after_time = '\"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"afterTime\")) + \"'\"\r\n\t\t\t\t\t\t+ \", fo_on_time = '\"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"onTime\"))\r\n\t\t\t\t\t\t+ \"', password = \" + fomap.get(\"password\")\r\n\t\t\t\t\t\t+ \", per_sale = '\" + fomap.get(\"percellcomm\")\r\n\t\t\t\t\t\t+ \"', fo_acount_no = \" + fomap.get(\"accnumber\")\r\n\t\t\t\t\t\t+ \" WHERE fo_id = \" + fomap.get(\"foId\") + \"\";\r\n\r\n\t\t\t} else {\r\n\t\t\t\tquery = \"UPDATE field_officer SET fo_name = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"firstName\") + \"', fo_priamary_phone = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"phone1\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_secondary_phone = '\" + fomap.get(\"phone2\")\r\n\t\t\t\t\t\t+ \"', fo_gender = '\" + fomap.get(\"gender\")\r\n\t\t\t\t\t\t+ \"', fo_date_of_birth = '\" + fomap.get(\"dateOfBirth\")\r\n\t\t\t\t\t\t+ \"'\" + \", fo_cnic = '\" + fomap.get(\"cnic\")\r\n\t\t\t\t\t\t+ \"', fo_date_of_joining = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"joiningDate\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_blood_group = '\" + fomap.get(\"bloodGroup\")\r\n\t\t\t\t\t\t+ \"', fo_marital_status = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"marritalStatus\") + \"', fo_vehical = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"vehicle\") + \"'\" + \", fo_address = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"address\") + \"', fo_educated = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"educated\")\r\n\t\t\t\t\t\t+ \"', fo_college_university = '\" + fomap.get(\"college\")\r\n\t\t\t\t\t\t+ \"'\" + \", fo_certificate = '\" + fomap.get(\"degree\")\r\n\t\t\t\t\t\t+ \"', fo_education_start_date = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"dateOfStart\")\r\n\t\t\t\t\t\t+ \"', fo_education_end_date = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"dateOfEnd\") + \"'\"\r\n\t\t\t\t\t\t+ \", fo_education_percentage = '\"\r\n\t\t\t\t\t\t+ fomap.get(\"percentage\") + \"', fo_base_salary = '\"\r\n\t\t\t\t\t\t+ Double.parseDouble(fomap.get(\"salary\")) + \"'\"\r\n\t\t\t\t\t\t+ \", fo_before_time = '\"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"beforeTime\"))\r\n\t\t\t\t\t\t+ \"', fo_after_time = \"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"afterTime\")) + \"\"\r\n\t\t\t\t\t\t+ \", fo_on_time = '\"\r\n\t\t\t\t\t\t+ Integer.parseInt(fomap.get(\"onTime\"))\r\n\t\t\t\t\t\t+ \"', password = '\" + fomap.get(\"password\")\r\n\t\t\t\t\t\t+ \"', image_id = \" + fomap.get(\"imageId1\")\r\n\t\t\t\t\t\t+ \", per_sale = '\" + fomap.get(\"percellcomm\")\r\n\t\t\t\t\t\t+ \"', fo_acount_no = \" + fomap.get(\"accnumber\")\r\n\t\t\t\t\t\t+ \" WHERE fo_id = \" + fomap.get(\"foId\") + \"\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Query :\" + query);\r\n\t\t\tst = con.createStatement();\r\n\t\t\trow = st.executeUpdate(query);\r\n\t\t\tcon.commit();\r\n\t\t\treturn row;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"\", ex);\r\n\t\t\trow = 0;\r\n\t\t\tSystem.err.println(ex.getMessage());\r\n\t\t\trow = 0;\r\n\r\n\t\t}\r\n\t\treturn row;\r\n\t}", "int updateByPrimaryKeySelective(FinMonthlySnapModel record);", "@Override\n\tpublic void update(int timeStep)\n\t{\n\t\tthis.checkForNewAppliancesAndUpdateConstants();\n\n\t\tdouble[] ownersCostSignal = this.owner.getPredictedCostSignal();\n\t\tthis.dayPredictedCostSignal = Arrays.copyOfRange(ownersCostSignal, timeStep % ownersCostSignal.length, timeStep\n\t\t\t\t% ownersCostSignal.length + this.ticksPerDay);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"update\");\n\t\t}\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tthis.dayPredictedCostSignal = ArrayUtils\n\t\t\t\t.offset(ArrayUtils.multiply(this.dayPredictedCostSignal, this.predictedCostToRealCostA), this.realCostOffsetb);\n\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"afterOffset dayPredictedCostSignal: \" + Arrays.toString(this.dayPredictedCostSignal));\n\t\t}\n\n\t\tif (this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tthis.setPointProfile = Arrays.copyOf(this.owner.getSetPointProfile(), this.owner.getSetPointProfile().length);\n\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.currentTempProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tthis.heatPumpDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\t\t// (20/01/12) Check if sum of <heatPumpDemandProfile> is consistent\n\t\t\t// at end day\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger\n\t\t\t\t\t\t.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \" + ArrayUtils.sum(this.heatPumpDemandProfile));\n\t\t\t}\nif (\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\tthis.mainContext.logger.trace(\"Sum(Wattbox estimated heatPumpDemandProfile): \"\n\t\t\t\t\t+ ArrayUtils.sum(this.calculateEstimatedSpaceHeatPumpDemand(this.optimisedSetPointProfile)));\n}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.heatPumpDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.hotWaterVolumeDemandProfile = Arrays.copyOfRange(this.owner.getBaselineHotWaterVolumeProfile(), (timeStep % this.owner\n\t\t\t\t\t.getBaselineHotWaterVolumeProfile().length), (timeStep % this.owner.getBaselineHotWaterVolumeProfile().length)\n\t\t\t\t\t+ this.ticksPerDay);\n\t\t\tthis.waterHeatDemandProfile = ArrayUtils.multiply(this.hotWaterVolumeDemandProfile, Consts.WATER_SPECIFIC_HEAT_CAPACITY\n\t\t\t\t\t/ Consts.KWH_TO_JOULE_CONVERSION_FACTOR\n\t\t\t\t\t* (this.owner.waterSetPoint - ArrayUtils.min(Consts.MONTHLY_MAINS_WATER_TEMP) / Consts.DOMESTIC_HEAT_PUMP_WATER_COP));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.waterHeatDemandProfile = Arrays.copyOf(this.noElecHeatingDemand, this.noElecHeatingDemand.length);\n\t\t}\n\n\t\tif (this.coldAppliancesControlled && this.owner.isHasColdAppliances())\n\t\t{\n\t\t\tthis.optimiseColdProfile(timeStep);\n\t\t}\n\n\t\tif (this.wetAppliancesControlled && this.owner.isHasWetAppliances())\n\t\t{\n\t\t\tthis.optimiseWetProfile(timeStep);\n\t\t}\n\n\t\t// Note - optimise space heating first. This is so that we can look for\n\t\t// absolute\n\t\t// heat pump limit and add the cost of using immersion heater (COP 0.9)\n\t\t// to top\n\t\t// up water heating if the heat pump is too great\n\t\tif (this.spaceHeatingControlled && this.owner.isHasElectricalSpaceHeat())\n\t\t{\n\t\t\tif (this.owner.hasStorageHeater)\n\t\t\t{\n\t\t\t\tthis.optimiseStorageChargeProfile();\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Optimised storage heater profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tthis.optimiseSetPointProfile();\n\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t{\n\t\t\t\tthis.mainContext.logger.trace(\"Optimised set point profile = \" + Arrays.toString(this.heatPumpOnOffProfile));\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.waterHeatingControlled && this.owner.isHasElectricalWaterHeat())\n\t\t{\n\t\t\tthis.optimiseWaterHeatProfileWithSpreading();\n\t\t}\n\n\t\tif (this.eVehicleControlled && this.owner.isHasElectricVehicle())\n\t\t{\n\t\t\tthis.optimiseEVProfile();\n\t\t}\n\n\t\t// At the end of the step, set the temperature profile for today's\n\t\t// (which will be yesterday's when it is used)\n\t\tthis.priorDayExternalTempProfile = this.owner.getContext().getAirTemperature(timeStep, this.ticksPerDay);\n\t}", "void fcalcHelper(LinkedList<Edge> l[], LinkedList<Integer> path[], int sn, int cn, int n, FibonacciHeap fh, Nodefh a[],double currentCost[]){\n\t\ttry{\n\t\t\tif(fh.isEmpty()==true){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tIterator<Edge> it = l[cn].iterator();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tint tempcost=0;\n\t\t\t\tEdge e= (Edge)it.next();\n\t\t\t\tif(a[cn].dist == Double.POSITIVE_INFINITY)\n\t\t\t\t\ttempcost = e.cost;\n\t\t\t\telse\n\t\t\t\t\ttempcost= (int)(e.cost+a[cn].dist);\n\t\t\t\tif(tempcost < a[e.adjIndex].dist){\n\t\t\t\t\tfh.decreasekey(a[e.adjIndex], tempcost);\n\t\t\t\t\tcurrentCost[e.adjIndex] = tempcost;\n\t\t\t\t\tpath[e.adjIndex].clear();\n\t\t\t\t\tfor(int i=0; i < path[cn].size(); i++){\n\t\t\t\t\t\tpath[e.adjIndex].add(path[cn].get(i));\n\t\t\t\t\t}\n\t\t\t\t\tpath[e.adjIndex].add(e.adjIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tNodefh temp = fh.removeMin();\n\t\t\tint prevcn = cn;\n\t\t\tcn = temp.index;\n\t\t\tif(cn != -1){\n\t\t\t\tfcalcHelper(l,path, sn,cn,n,fh,a,currentCost);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcn = prevcn;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{System.out.println(e);}\n\t}", "public int bookmarkUpdate(int ffid,String bookstate) {\n\t FileFolderMapper mapper = sqlSession.getMapper(FileFolderMapper.class);\r\n\t HashMap<String, Object> map = new HashMap<>();\r\n\t map.put(\"ffid\", ffid);\r\n\t map.put(\"bookstate\", bookstate);\r\n\t return mapper.bookmarkUpdate(map);\r\n\t }", "@FXML void expandc1p3(MouseEvent event) {\n\ttry {\n\t\tFXMLLoader loader = new FXMLLoader (getClass().getResource(\"/resources/Fxml/ShowCandidate.fxml\"));\n Parent root = (Parent) loader.load(); \n ShowCandidateController SCController=loader.getController();\n SCController.mailFunction(mailc1p3.getText());\n SCController.TitleFunction(TitleLabel11.getText());\n SCController.ExpFunction(ExpLabel11.getText());\n SCController.SectorFunction(SectorLabel11.getText());\n SCController.RegionFunction(RegionLabel11.getText()); \n Stage stage = new Stage();\n stage.setScene(new Scene(root));\n stage.setResizable(false);\n stage.show(); \n\t} catch (IOException e) {\n\t\te.printStackTrace(); }\t\n}", "DetalleMedicamentoSucursal update(DetalleMedicamentoSucursal update);", "@Override\r\n\tpublic int updateCensusForm(String status,String empClock) {\n\t\treturn exemptTeamMemberDAO.updateCensusForm(status,empClock);\r\n\t}", "public void update_teacherIssuedDetailTable(){ \r\n teacher_columnID.setCellValueFactory(new PropertyValueFactory<>(\"teacherID\"));\r\n teacher_columnName.setCellValueFactory(new PropertyValueFactory<>(\"teacherName\"));\r\n teacher_columnDepart.setCellValueFactory(new PropertyValueFactory<>(\"teacherDepart\"));\r\n teacher_columnQuantity.setCellValueFactory(new PropertyValueFactory<>(\"bookQuantity\"));\r\n teacher_columnBookTitle.setCellValueFactory(new PropertyValueFactory<>(\"bookTitle\"));\r\n teacher_columnBookClass.setCellValueFactory(new PropertyValueFactory<>(\"bookClass\"));\r\n teacher_columnDateIssued.setCellValueFactory(new PropertyValueFactory<>(\"dateIssued\"));\r\n try { \r\n String sql = \"SELECT * FROM teacherissued\";\r\n pstmt = con.prepareStatement(sql);\r\n rs = pstmt.executeQuery();\r\n while(rs.next()){\r\n teacherBooksData.add( new TeacherBookIssue(\r\n rs.getString(\"teacher_ID\"),\r\n rs.getString(\"teacher_name\"),\r\n rs.getString(\"teacher_depart\"),\r\n rs.getString(\"quantity_issued\"), \r\n rs.getString(\"book_title\"),\r\n rs.getString(\"book_class\"),\r\n rs.getString(\"date_issued\") \r\n )); \r\n }\r\n //load items to the table\r\n teachserIssuedTable.setItems(teacherBooksData);\r\n pstmt.close();\r\n rs.close();\r\n } catch (SQLException e) {\r\n } finally {\r\n try {\r\n rs.close();\r\n pstmt.close();\r\n } catch (Exception e) {\r\n } \r\n }\r\n }", "public static void updategra(String stuid2, String cno2, int stugrade2, double stupoint2) {\n\t\ttry {\n\t\t\tps = conn.prepareStatement(\"update result set Grade = ?, Point = ? where Sno = ? and Cno = ? \");\n\t\t\tps.setInt(1, stugrade2);\n\t\t\tps.setDouble(2, stupoint2);\n\t\t\tps.setString(3, stuid2);\n\t\t\tps.setString(4, cno2);\n\t\t\tps.executeUpdate();\n\t\t\t\n\t\t\tJOptionPane.showMessageDialog(null, \"成绩修改成功!\", \"提示消息\", JOptionPane.INFORMATION_MESSAGE);\n\t\t}catch(Exception e){\n\t\t\tJOptionPane.showMessageDialog(null, \"数据修改失败!\", \"提示消息\", JOptionPane.ERROR_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "int updateByPrimaryKey(OrgIntegralDeductRule record);", "int updateByPrimaryKeySelective(CostAccountingStatisticByLineDetail record);", "public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }", "public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {\n\r\n //spriteID = new SpriteSheet(\"Images/Free/Main Characters/Pink Man/Run2 (32x32).png\",32,32);\r\n //CA = new Animation(spriteID,50);\r\n \r\n Franklen.CheckMove(gc);\r\n \r\n if(ground.getY()<=Franklen.getYP()+32){\r\n Franklen.setGround(true);\r\n }\r\n else{\r\n Franklen.setGround(false);\r\n }\r\n for (int k = 0; k < Apples.length; k++) {\r\n if(Franklen.getHitBox().intersects(Apples[k].getHitbox())&&Apples.length>0){\r\n \r\n Apples[k].setX(1000);\r\n \r\n apples++;\r\n }\r\n }\r\n \r\n\r\n if(finish.intersects(Franklen.getHitBox())&&apples==10){\r\n sbg.enterState(1, new FadeOutTransition(), new FadeInTransition());\r\n }\r\n }", "protected void updateCustomTables(HttpServletRequest request, Db db)\n {\n\t String strain = getServerItemValue(ItemType.STRAIN);\n\t if(bNewStrain)\n\t {\n\t\t\tCode.info(\"Updating custom table record for strain \" + strain);\n\t\t\tsetMessage(\"Successfully imported new strain(s)\");\n\t\t\t\n\n\t\t\tArrayList<String> params = new ArrayList<String>();\n\t\t params.add(strain);\n\t\t params.add(getServerItemValue(\"StrainName\"));\n\t\t params.add(getStrainType());\n\t\t params.add(getServerItemValue(ItemType.PROJECT));\n\t\t params.add(getServerItemValue(DataType.NOTEBOOK_REF));\n\t\t params.add(getServerItemValue(DataType.COMMENT));\n\t\t params.add(getTranId() + \"\");\n\t\t \n\t\t String sql = \"spMet_InsertStrain\";\n\t\t \n\t\t db.getHelper().callStoredProc(db, sql, params, false, true);\n\t\t \n\n\t\t \t // set multiple location values from rowset\t\n\t\t // warning: relies on specific 'location index' (position in LinxML)\n\t\t \n\t\t //lets get the straintype\n\t\t String strainType = getStrainType(strain);\n\t\t //long strainTypeId = dbHelper.getAppValueIdAsLong(\"StrainType\", strainType, null, false, true, this, db);\n\t\t List<String> locations = new ArrayList<String>();\n\t\t if(bHaveFile)\n\t\t {\n\t\t \t //locations should be set in the dom\n\t\t \t locations = getServerItemValues(\"Location\");\n\t\t }\n\t\t else\n\t\t {\n\t\t \t TableDataMap rowMap = new TableDataMap(request, ROWSET);\n\t\t\t int numRows = rowMap.getRowcount();\n\t\t\t //do we have the correct number of locations\n\t\t\t if(numRows != this.getLocationRowCount())\n\t\t\t \t throw new LinxUserException(\"Invalid number of freezer locations. This task expects \" \n\t\t\t \t\t\t + getLocationRowCount() + \" rows.\");\n\t\t\t\t for(int rowIdx = 1; rowIdx <= numRows; rowIdx++)\n\t\t\t\t {\n\t\t\t\t\t String location = (String)rowMap.getValue(rowIdx, COLUMN_LOCATION);\n\t\t\t\t\t if(location.indexOf(\":\") < 1)\n\t\t\t\t\t {\n\t\t\t\t\t\t throw new LinxUserException(\"Please provide a location in the format FRZ:BOX:POS,\"\n\t\t\t\t\t\t\t\t + \" then try again.\");\n\t\t\t\t\t }\n\t\t\t\t\t locations.add(location);\n\t\t\t\t }\n\t\t }\n\t\t\t //if we're here we have all of the locations\n\t\t if(locations.size() != getLocationRowCount())\n\t\t \t throw new LinxUserException(\"Invalid number of freezer locations. This task expects \" \n\t\t \t\t\t + getLocationRowCount() + \" rows.\");\n\t\t int rowIdx = 1;\n\t\t for(String location : locations)\n\t\t {\n\t\t \t String[] alLocs = location.split(\":\");\n\t\t\t\t String freezer = alLocs[0];\n\t\t\t\t String box = alLocs[1];\n\t\t\t\t String coord = alLocs[2];\n\t\t\t\t \n\t\t\t\t try\n\t\t\t\t {\n\t\t\t\t\t int idxLastColon = location.lastIndexOf(':');\n\t\t\t\t\t String pos = location.substring(idxLastColon + 1);\n\t\t\t\t\t //now lets zero pad the position\n\t\t\t\t\t if(pos.length() < 2)\n\t\t\t\t\t {\n\t\t\t\t\t\t pos = zeroPadPosition(pos);\n\t\t\t\t\t\t coord = pos;\n\t\t\t\t\t\t location = location.substring(0,idxLastColon) + \":\" + pos;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t catch(Exception ex)\n\t\t\t\t {\n\t\t\t\t\t throw new LinxUserException(\"Unable to parse location [\" + location + \"]: \" + ex.getMessage());\n\t\t\t\t }\n\t\t\t\t String boxType = box.substring(0,box.length() - 2);\n\t\t\t\t String transferPlan = strainType + \" Freezer \" + freezer + \" Box \" + boxType;\n\t\t\t\t String transferPlanId = db.getHelper().getDbValue(\"exec spMet_getTransferPlanId '\" \n\t\t\t\t\t + transferPlan + \"','\" + coord + \"'\", db);\n\n\t\t\t\t \n\t\t\t\t params.clear();\n\t\t\t\t params.add(strain);\n\t\t\t\t params.add(freezer); \n\t\t\t\t params.add(box);\n\t\t\t\t params.add(coord);\n\t\t\t\t params.add(rowIdx+\"\"); //location index\n\t\t\t\t params.add(strainType);\n\t\t\t\t params.add(transferPlanId);\n\t\t\t\t params.add(getTranId()+\"\");\n\t\t\t\t\n\t\t \t sql = \"spEMRE_insertStrainLocation\";\n\t\t\t\t dbHelper.callStoredProc(db, sql, params, false, true);\n\t\t\t\t rowIdx++;\n\t\t\t }// next loc index \n\t\t\t // at exit, have updated strain locations\n\t }\n\t\n\t else\n\t {\n\t \t//sql = \"spMet_UpdateStrain\";\n\t\t\t//setMessage(\"Successfully updated strain \" + strain);\n\t \t//as of June 2010 v1.11.0 do not allow updating of existing strain information\n\t \t//only allow updating of comments.\n\t\t \n\t\t String comment = getServerItemValue(DataType.COMMENT);\n\t\t if(WtUtils.isNullOrBlank(comment))\n\t\t {\n\t\t\t throw new LinxUserException(\"Only comments are allowed to be updated if the strain already exists. Please enter comments and try again.\");\n\t\t }\n\t\t else\n\t\t {\n\t\t\t String strainId = dbHelper.getItemId(strain, ItemType.STRAIN, db);\n\t\t\t String sql = \"spEMRE_updateStrainComment \" + strainId + \",'\" + comment + \"'\";\n\t\t\t dbHelper.executeSQL(sql, db);\n\t\t\t setMessage(\"Successfully updated strain '\" + strain + \"' comments.\");\n\t\t }\n\t }\n \n\t \t \n }", "@Override\n public void editExpense(int index) {\n Expense expense = this.outingExpenses.get(index);\n Intent newExpenseIntent = new Intent(this, ExpenseEditActivity.class);\n newExpenseIntent.putExtra(ExpenseEditActivity.BUNDLE_KEY_OUTING_ID, this.outing.getIdentifier());\n newExpenseIntent.putExtra(ExpenseEditActivity.BUNDLE_KEY_EXPENSE_ID, expense.getIdentifier());\n startActivity(newExpenseIntent);\n }", "public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType);", "@SuppressWarnings({\"checkstyle:npathcomplexity\", \"checkstyle:cyclomaticcomplexity\"})\n\tprotected String updateOutline(String content) {\n\t\tfinal Pattern sectionPattern = Pattern.compile(\n\t\t\t\tisAutoSectionNumbering() ? SECTION_PATTERN_AUTONUMBERING : SECTION_PATTERN_NO_AUTONUMBERING,\n\t\t\t\t\t\tPattern.MULTILINE);\n\t\tfinal Matcher matcher = sectionPattern.matcher(content);\n\n\t\tfinal Set<String> identifiers = new TreeSet<>();\n\t\tfinal StringBuilder outline = new StringBuilder();\n\t\toutline.append(\"\\n\"); //$NON-NLS-1$\n\t\tfinal String outlineStyleId = getOutlineStyleId();\n\t\tfinal boolean styledOutline = !Strings.isEmpty(outlineStyleId);\n\t\tif (styledOutline) {\n\t\t\toutline.append(\"<ul class=\\\"\").append(Strings.convertToJavaString(outlineStyleId)); //$NON-NLS-1$\n\t\t\toutline.append(\"\\\" id=\\\"\").append(Strings.convertToJavaString(outlineStyleId)); //$NON-NLS-1$\n\t\t\toutline.append(\"\\\">\\n\\n\"); //$NON-NLS-1$\n\t\t}\n\t\tfinal IntegerRange outlineDepthRange = getOutlineDepthRange();\n\n\t\tfinal StringBuffer output;\n\t\tfinal SectionNumber sections;\n\t\tfinal int titleGroupId;\n\t\tif (isAutoSectionNumbering()) {\n\t\t\toutput = new StringBuffer();\n\t\t\tsections = new SectionNumber();\n\t\t\ttitleGroupId = 3;\n\t\t} else {\n\t\t\toutput = null;\n\t\t\tsections = null;\n\t\t\ttitleGroupId = 2;\n\t\t}\n\n\t\tint prevLevel = 0;\n\t\tint nbOpened = 0;\n\n\t\twhile (matcher.find()) {\n\t\t\tfinal String prefix = matcher.group(1);\n\t\t\tfinal int clevel = prefix.length();\n\t\t\tif (outlineDepthRange.contains(clevel)) {\n\t\t\t\tfinal int relLevel = clevel - outlineDepthRange.getStart();\n\t\t\t\tfinal String title = matcher.group(titleGroupId);\n\t\t\t\tString sectionId = matcher.group(titleGroupId + 1);\n\n\t\t\t\tif (output != null) {\n\t\t\t\t\tassert sections != null;\n\n\t\t\t\t\tString sectionNumber = matcher.group(2);\n\t\t\t\t\tif (!Strings.isEmpty(sectionNumber)) {\n\t\t\t\t\t\tsections.setFromString(sectionNumber, relLevel + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsections.increment(relLevel + 1);\n\t\t\t\t\t}\n\t\t\t\t\tsectionNumber = formatSectionNumber(sections);\n\n\t\t\t\t\tif (Strings.isEmpty(sectionId)) {\n\t\t\t\t\t\tsectionId = computeHeaderId(sectionNumber, title);\n\t\t\t\t\t\tif (!identifiers.add(sectionId)) {\n\t\t\t\t\t\t\tint idNum = 1;\n\t\t\t\t\t\t\tString nbId = sectionId + \"-\" + idNum; //$NON-NLS-1$\n\t\t\t\t\t\t\twhile (!identifiers.add(nbId)) {\n\t\t\t\t\t\t\t\t++idNum;\n\t\t\t\t\t\t\t\tnbId = sectionId + \"-\" + idNum; //$NON-NLS-1$\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsectionId = nbId;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmatcher.appendReplacement(output, formatSectionTitle(prefix, sectionNumber, title, sectionId));\n\n\t\t\t\t\tif (styledOutline && (relLevel > 0 || prevLevel > 0) && relLevel != prevLevel) {\n\t\t\t\t\t\tif (relLevel > prevLevel) {\n\t\t\t\t\t\t\tfor (int i = prevLevel; i < relLevel; ++i) {\n\t\t\t\t\t\t\t\toutline.append(\"<ul>\\n\"); //$NON-NLS-1$\n\t\t\t\t\t\t\t\t++nbOpened;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (int i = relLevel; i < prevLevel; ++i) {\n\t\t\t\t\t\t\t\toutline.append(\"</ul>\\n\"); //$NON-NLS-1$\n\t\t\t\t\t\t\t\t--nbOpened;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\taddOutlineEntry(outline, relLevel + 1, sectionNumber, title, sectionId, styledOutline);\n\t\t\t\t} else {\n\t\t\t\t\tif (Strings.isEmpty(sectionId)) {\n\t\t\t\t\t\tsectionId = computeHeaderId(null, title);\n\t\t\t\t\t\tif (!identifiers.add(sectionId)) {\n\t\t\t\t\t\t\tint idNum = 1;\n\t\t\t\t\t\t\tString nbId = sectionId + \"-\" + idNum; //$NON-NLS-1$\n\t\t\t\t\t\t\twhile (!identifiers.add(nbId)) {\n\t\t\t\t\t\t\t\t++idNum;\n\t\t\t\t\t\t\t\tnbId = sectionId + \"-\" + idNum; //$NON-NLS-1$\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsectionId = nbId;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\taddOutlineEntry(outline, relLevel + 1, null, title, sectionId, styledOutline);\n\t\t\t\t}\n\t\t\t\tprevLevel = relLevel;\n\t\t\t}\n\t\t}\n\n\t\tfinal String newContent;\n\t\tif (output != null) {\n\t\t\tmatcher.appendTail(output);\n\t\t\tnewContent = output.toString();\n\t\t} else {\n\t\t\tnewContent = content;\n\t\t}\n\n\t\toutline.append(\"\\n\"); //$NON-NLS-1$\n\t\tif (styledOutline) {\n\t\t\tfor (int i = 0; i <= nbOpened; ++i) {\n\t\t\t\toutline.append(\"</ul>\\n\"); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\n\t\tfinal String outlineTag = getDocumentParser().getOutlineOutputTag();\n\t\tif (isOutlineGeneration()) {\n\t\t\tfinal String externalMarker = getOutlineExternalMarker();\n\t\t\tif (!Strings.isEmpty(externalMarker)) {\n\t\t\t\treturn newContent.replaceAll(Pattern.quote(outlineTag), Matcher.quoteReplacement(externalMarker));\n\t\t\t}\n\t\t\treturn newContent.replaceAll(Pattern.quote(outlineTag), outline.toString());\n\t\t}\n\t\treturn newContent.replaceAll(Pattern.quote(outlineTag), \"\"); //$NON-NLS-1$\n\t}" ]
[ "0.49620143", "0.4896633", "0.48168063", "0.4775635", "0.45862538", "0.45823377", "0.44718704", "0.43759292", "0.43466192", "0.4288559", "0.4283861", "0.42783695", "0.42724508", "0.42474234", "0.42388847", "0.4203559", "0.42000902", "0.41935164", "0.4178954", "0.41724452", "0.41696432", "0.41505995", "0.4137709", "0.41353136", "0.41338864", "0.41220912", "0.41141325", "0.41123965", "0.41082388", "0.41072357", "0.41049024", "0.40997282", "0.4097784", "0.40875453", "0.40833974", "0.40780336", "0.40720427", "0.40697804", "0.40621352", "0.40583202", "0.40576115", "0.40559685", "0.40402845", "0.40399998", "0.40352392", "0.40350285", "0.4030392", "0.40248775", "0.40236568", "0.4014581", "0.40099484", "0.40088224", "0.40054438", "0.39958164", "0.39857936", "0.39600566", "0.39599383", "0.39527497", "0.39506152", "0.39477047", "0.39404556", "0.39394355", "0.3935671", "0.3934675", "0.3932353", "0.39294717", "0.39220157", "0.39201117", "0.39172998", "0.3916098", "0.39008445", "0.3890577", "0.38899142", "0.38871634", "0.38868508", "0.38857514", "0.38856938", "0.38787383", "0.38780618", "0.38774496", "0.3876434", "0.38715512", "0.38713646", "0.38703743", "0.38673657", "0.38641748", "0.38633952", "0.3859993", "0.38586146", "0.38564438", "0.3853827", "0.3850728", "0.3847261", "0.3846058", "0.3844665", "0.38446486", "0.3843942", "0.38417715", "0.38370356", "0.38349876" ]
0.6815049
0
/ A course is cancallable only if: edit flag = true and progress = modify and canceller = proposer
public static boolean isCourseCancellable(Connection conn,String kix,String user) throws SQLException { //Logger logger = Logger.getLogger("test"); boolean cancellable = false; String proposer = ""; String progress = ""; try { String[] info = getKixInfo(conn,kix); String alpha = info[0]; String num = info[1]; String campus = info[4]; String sql = "SELECT edit,proposer,progress FROM tblfnd WHERE historyid=?"; PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1,kix); ResultSet rs = ps.executeQuery(); if (rs.next()) { cancellable = rs.getBoolean(1); proposer = rs.getString(2); progress = rs.getString(3); } // only the proposer may cancel a pending course if (cancellable && user.equals(proposer) && ( progress.equals(Constant.FND_MODIFY_TEXT) || progress.equals(Constant.FND_DELETE_TEXT) || progress.equals(Constant.FND_REVISE_TEXT) )){ cancellable = true; } else{ cancellable = false; } rs.close(); ps.close(); } catch (SQLException e) { logger.fatal("FndDB.isCourseCancellable - " + e.toString()); cancellable = false; } catch (Exception e) { logger.fatal("FndDB.isCourseCancellable - " + e.toString()); cancellable = false; } return cancellable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract boolean approvedForClass(Course c);", "@Override\n\tpublic boolean canEdit(IAccounterServerCore clientObject,\n\t\t\tboolean goingToBeEdit) throws AccounterException {\n\t\treturn true;\n\t}", "public boolean updateCourse(Course c) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean updateCourse(Course course) {\n\t\treturn false;\r\n\t}", "protected abstract boolean isCancelEnabled();", "private boolean checkCanModifyStatus() {\r\n \r\n RequesterBean requesterBean = new RequesterBean();\r\n ResponderBean responderBean = new ResponderBean();\r\n try{\r\n requesterBean.setFunctionType('c');\r\n String connectTo = CoeusGuiConstants.CONNECTION_URL + \"/rolMntServlet\";\r\n AppletServletCommunicator ascomm = new AppletServletCommunicator(connectTo,requesterBean);\r\n ascomm.setRequest(requesterBean);\r\n ascomm.send();\r\n responderBean = ascomm.getResponse(); \r\n \r\n }catch(Exception e) {\r\n CoeusOptionPane.showErrorDialog(e.getMessage());\r\n }\r\n return (Boolean)responderBean.getDataObject();\r\n }", "boolean canCrit();", "protected boolean isEdit(){\n\t\treturn getArguments().getBoolean(ARG_KEY_IS_EDIT);\n\t}", "boolean isEdit();", "public abstract LearningEditProposal getBestEdit (boolean onlyAllowedEdits, boolean onlyPositiveEdits);", "private boolean hardCode(int index, boolean isCourse)\n\t{\n\t\tboolean isValid = testValue;\n\n\t\tif(isCourse)\n\t\t{\n\t\t\tCourses course = parser.coursesVector.get(index);\n\t\t\t\n\t\t\t//for the CPSC 813/913 courses\t\n\t\t\tif((course.getCourseNumber().equals(\"813\") || course.getCourseNumber().equals(\"913\")) && course.getDepartment().equals(\"CPSC\"))\n\t\t\t{\n\t\t\t\tisValid = child.assign13(index, parser.labSlotsVector.get(course.getPartAssign().get(0))) && course.constr(child, index) && parser.labSlotsVector.get(course.getPartAssign().get(0)).constr(child, index, !isCourse);\t\t\t\t\n\t\t\t}\n\n\t\t\telse if (course.getPartAssign().size() > 0)\n\t\t\t{//do the partial assignment\n\t\t\t\tisValid = child.assign(index, parser.courseSlotsVector.get(course.getPartAssign().get(0)), isCourse) && course.constr(child, index) && parser.courseSlotsVector.get(course.getPartAssign().get(0)).constr(child, index, isCourse);\n\t\t\t}\n\n\t\t\t//System.out.println(course);\n\t\t} \n\t\telse //its a lab\n\t\t{\n\t\t\tLabs lab = parser.labsVector.get(index) ;\n\t\t\n\t\t\tif (lab.getPartAssign().size() > 0)\n\t\t\t{//do the partial assignment\n\t\t\t\tisValid = child.assign(index, parser.labSlotsVector.get(lab.getPartAssign().get(0)), isCourse) && lab.constr(child, index) && parser.labSlotsVector.get(lab.getPartAssign().get(0)).constr(child, index, isCourse);\n\t\t\t}\t\t\n\n\t\t\t//System.out.println(lab);\n\t\t}//end if-else (not a lecture)\t\t\n\t\t\n\t\treturn isValid;\n\t}", "@Override\n\tpublic boolean checkCourse(String code) {\n\t\treturn false;\n\t}", "private boolean modifiable() {\n // Only allow un-answered tests/surveys to be modified\n return this.completed.size() == 0;\n }", "protected abstract boolean isChannelEditable( Flow f );", "public boolean isSelectedPredefinedCourse(){\n if(predefinedCourseName == null) return false;\n else return true;\n }", "@Override\r\n\tpublic boolean takeCourse(String studentId,Course course) {\n\t\tList<String> hasTaken=db.findStudentCourseHistory( studentId);\r\n\t\tList<String> prerequisite=getPrerequisite(course.getDescription());\r\n\t\treturn false;\r\n\t}", "boolean isCallableAccess();", "static void setNotEdit(){isEditing=false;}", "public abstract void checkEditing();", "@objid (\"41b411f8-e0e5-49a4-a7fc-7eed29779401\")\n @Override\n public boolean canExecute() {\n if (!MTools.getAuthTool().canModify(this.layer.getRelatedElement())) {\n return false;\n }\n return true;\n }", "public abstract boolean canEditAccessRights(OwObject object_p) throws Exception;", "public boolean isEditableByUser() {\r\n if ((this.currentStatusChange == null) ||\r\n (this.currentStatusChange.equals(PoStatusCode.PROPOSED)))\r\n return true;\r\n return false;\r\n }", "@Override\r\n public boolean canCancel(Document document) {\n return false;\r\n }", "@Override\n protected boolean calculateEnabled() {\n if (!super.calculateEnabled())\n return false;\n // allows only the editing of non-readonly parts\n return EditPartUtil.isEditable(getSelectedObjects().get(0));\n }", "@SystemAPI\n\tboolean needsApproval();", "public static void courseEditOption(){\n System.out.println(\"Choose 0 to repeat the option List\");\n System.out.println(\"Choose 1 to add new Course to the List\");\n System.out.println(\"Choose 2 to edit the exisiting List\");\n System.out.println(\"Choose 3 to quit editing\");\n }", "private boolean shouldRegisterCourse(Progress progress) {\n return progress.name.equals(Progress.courseRegistration)\n || progress.name.equals(Progress.courseRegistrationCanceled)\n || progress.name.equals(Progress.courseRegistrationResponseNegative);\n }", "public boolean canEditAllRequiredFields() throws OculusException;", "public abstract boolean isEdible();", "boolean canPerformQuest(int currentWorkCred);", "public boolean estaEnModoAvion();", "private void setButton(boolean a) {\n//Vo hieu hoac co hieu luc cho cac JButton\n this.btnCourseAdd.setEnabled(a);\n this.btnCourseDelete.setEnabled(a);\n this.btnCourseEdit.setEnabled(a);\n this.btnCourseSave.setEnabled(!a);\n this.btnCourseReport.setEnabled(!a);\n this.btnCourseReset.setEnabled(!a);\n this.btnCourseClose.setEnabled(a);\n }", "boolean getMission();", "public boolean isEditaConceptoYBase()\r\n/* 692: */ {\r\n/* 693:761 */ return (this.facturaProveedorSRI.getMensajeSRI() != null) && (!this.facturaProveedorSRI.getMensajeSRI().toLowerCase().contains(\"guardado\")) && (this.facturaProveedorSRI.isTraCorregirDatos());\r\n/* 694: */ }", "@Override\n public boolean adminEditClass(ShibbolethAuth.Token token, int courseID, String courseName, int courseCredits,\n int instructorID, String firstDay, String lastDay, String classBeginTime, String classEndTime,\n String weekDays, String location, String type, String prerequisite, String description, String department) {\n try {\n adminEditClass1(token, courseID, courseName, courseCredits, instructorID, firstDay, lastDay, classBeginTime,\n classEndTime, weekDays, location, type, prerequisite, description, department);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n return false;\n }\n return true;\n }", "private boolean setLab(Course course) {\n if (course.getLabs().size() > 0) {\n for (DetailedSection lab : course.getLabs()) {\n if (canBeAdded(lab)) {\n course.setSelectedLab(lab);\n return true;\n }\n }\n return false;\n }\n return true;\n }", "public void changeIsInvincible()\r\n\t{\r\n\t\tisInvincible = !isInvincible;\r\n\t}", "public boolean getAllowModifications() {\n return true;\n }", "int setCanStatus(int canRegno, int action);", "public boolean addCourse(Course c) {\n\t\treturn false;\n\t}", "boolean isExecuteAccess();", "public boolean shouldEditButtonBePresent();", "boolean contemProfessor(Professor p);", "@Override\n\tpublic boolean checkEnrolment(Users userid, Course courseid) {\n\t\treturn false;\n\t}", "private boolean setLecture(Course course) {\n if (course.getLectures().size() > 0) {\n for (DetailedSection lecture : course.getLectures()) {\n if (canBeAdded(lecture)) {\n course.setSelectedLecture(lecture);\n if(setDiscussion(course)) {\n return true;\n }\n }\n }\n return false;\n }\n return setDiscussion(course);\n }", "public boolean canEdit() {\r\n\t\treturn !dslView.isContainsErrors();\r\n\t}", "@Override\r\n public boolean isEditable(AuthenticationInfo obj) {\n if (CFG_GUI.CFG.isPresentationModeEnabled()) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isEditable() {\n/* 1014 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "private void courseEffects() {\n\t\t\n\t}", "Update withCancelRequested(Boolean cancelRequested);", "public void editEnabled(boolean enabled){\n }", "public abstract String enableSubmission(ISubmissionProject project);", "boolean isSetCit();", "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "private void addSavedCourseToACL() {\n System.out.println(\"(note that selecting a saved course will extract it and it will need to be saved again)\\n\");\n int numSavedCourses = courseList.getCourseList().size();\n if (numSavedCourses == 0) {\n System.out.println(\"There are no saved courses at the moment\");\n return;\n }\n System.out.println(\"The current saved courses are \\n\");\n printSavedCoursesNames();\n System.out.println(\"Select which one you want to add (select number) \");\n int courseSelected = obtainIntSafely(1, numSavedCourses,\n \"Please choose the number next to a course\");\n\n activeCourseList.add(courseList.getCourseList().get(courseSelected - 1));\n courseList.removeCourseFromList(courseSelected - 1);\n System.out.println(\"Added!\");\n }", "public boolean isApproved();", "public boolean isApproved();", "public Boolean getCanEdit() {\r\n return getAttributeAsBoolean(\"canEdit\");\r\n }", "public boolean canEdit() throws GTClientException\n {\n return isNewEntity();\n }", "private void courseOptions(int choice) {\n switch (choice) {\n case 1:\n obtainCourseSafely();\n break;\n case 2:\n addSavedCourseToACL();\n break;\n case 3:\n viewActiveCourseList();\n break;\n case 4:\n viewSavedCourseList();\n break;\n case 5:\n removeFromActiveCourseList();\n break;\n case 6:\n removeFromSavedCourseList();\n break;\n case 7:\n addActiveCourseListToCourseList();\n break;\n }\n }", "public boolean allowsEditing() {\n\t\tif (type==SOURCE) return true;\n\t\telse return false;\n\t}", "void setUserIsActiveEditable(boolean b);", "private boolean isEditableRecipe() {\n\t\tUser user = User.getInstance();\n\t\tString userEmail = user.getEmail();\n\t\tString creatorEmail = currentRecipe.getCreatorEmail();\n\t\tif (userEmail.equalsIgnoreCase(creatorEmail)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public boolean canEdit(Context context, Item item) throws java.sql.SQLException\n {\n // can this person write to the item?\n return authorizeService.authorizeActionBoolean(context, item, Constants.WRITE, true);\n }", "public boolean isReadOnlyRemainingWork(FieldContext fieldContext) {\n\t\treturn false;\n\t}", "public boolean isActivo()\r\n/* 110: */ {\r\n/* 111:138 */ return this.activo;\r\n/* 112: */ }", "boolean shouldModify();", "@Override\n\tpublic boolean isApproved();", "boolean contemProfessor(String cpf);", "private boolean checkCompletedCourse(int id) {\r\n boolean x = false;\r\n for (Registration registration : completeCourses) {\r\n if (id == registration.getCourseId()) {\r\n x = true;\r\n break;\r\n }\r\n x = false;\r\n }\r\n return x;\r\n }", "private void isCanSave() {\r\n\t\tsalvar.setEnabled(!hasErroNome(nome.getText()) && !hasErroIdade(idade.getText()) && validaSituacao());\r\n\t}", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "public abstract boolean isRestricted();", "public Boolean isProhibited() {\n throw new NotImplementedException();\n }", "boolean hasMission();", "public boolean isEditable()\n\t{ return editable; }", "public boolean isActivo()\r\n/* 144: */ {\r\n/* 145:245 */ return this.activo;\r\n/* 146: */ }", "public void setIsCancelled (boolean IsCancelled);", "public void setIsCancelled (boolean IsCancelled);", "boolean openPageInEditMode();", "public boolean isCancellable()\r\n/* 64: */ {\r\n/* 65:101 */ return this.result == null;\r\n/* 66: */ }", "public boolean isActivo()\r\n/* 173: */ {\r\n/* 174:318 */ return this.activo;\r\n/* 175: */ }", "@Override\n protected boolean isAuthorized(PipelineData pipelineData) throws Exception\n {\n \t// use data.getACL() \n \treturn true;\n }", "public boolean addCourse(String user, String course){\n String[] tokens = usersRepository.getclassString(user).split(\" \");\r\n String[] courseids = new String[tokens.length];\r\n String courseid = classesRepository.getClassCourseid(course);\r\n for(int i =0; i < tokens.length; i++){\r\n courseids[i] = classesRepository.getClassCourseid(tokens[i]);\r\n }\r\n for(int f =0; f < tokens.length; f++) {\r\n if(courseids[f] == null){\r\n continue;\r\n }\r\n if(courseids[f].equals(courseid)){\r\n return false;\r\n }\r\n }\r\n //check for course space\r\n if(!classesRepository.checkCourseSpace(course)){\r\n return false;\r\n }\r\n\r\n //check here for prereqs\r\n //get student records\r\n String studentrecord = usersRepository.findUserRecords(user);\r\n String studentgrade = usersRepository.findUserGrades(user);\r\n String[] tokenrecords;\r\n String[] tokengrades;\r\n if(studentrecord==null){\r\n tokenrecords = new String[0];\r\n tokengrades = new String[0];\r\n }else{\r\n tokenrecords = studentrecord.split(\" \");\r\n tokengrades = studentgrade.split(\" \");\r\n }\r\n //get course prereq\r\n String[] prereqs = classesRepository.getCoursePrereqs(courseid);\r\n //compare all token records with course prereqs, must be in records without d or f\r\n boolean meetsreq1 = true, meetsreq2 = true;\r\n if(prereqs[0] != null){\r\n meetsreq1=false;\r\n }\r\n if(prereqs[1] != null){\r\n meetsreq2=false;\r\n }\r\n for(int s = 0; s < tokenrecords.length; s++){\r\n if(!tokengrades[s].equals(\"D\") && !tokengrades[s].equals(\"F\")){\r\n if(prereqs[0] != null){\r\n if(prereqs[0].equals(tokenrecords[s])){\r\n meetsreq1 = true;\r\n }\r\n }\r\n if(prereqs[1] != null){\r\n if(prereqs[1].equals(tokenrecords[s])){\r\n meetsreq2 = true;\r\n }\r\n }\r\n }\r\n\r\n }\r\n if(meetsreq1 && meetsreq2){\r\n usersRepository.addCourse(user, course);\r\n return true;\r\n }\r\n return false;\r\n }", "boolean isCancelled();", "public void setIsApproved (boolean IsApproved);", "public void setIsApproved (boolean IsApproved);", "public boolean checkShowSubmitPolicy(Integer ctId,Integer snId){\n\n //check if participator first\n String handle = (String)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_HANDLE);\n boolean flag = false;\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, handle);\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_VIEW_CONTEST_ID)) {\n return true;\n }\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n flag = true;\n }\n }\n if (!flag){\n return false;\n }\n\n //then check policy\n ContestEntity contestEntity = getContestById(ctId);\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_ALL)){\n return true;\n }\n\n SubmissionEntity submissionEntity = new SubmissionEntity();\n submissionEntity.setId(snId);\n List<SubmissionEntity> lstSubmission = submissionMapper.selectWithExample(submissionEntity);\n if (lstSubmission.size() != 1){\n throw new NoSuchPageException(\"Submission not found!\");\n }\n\n //check if submission is from current user\n submissionEntity = lstSubmission.get(0);\n Integer currentUserId = (Integer)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_ID);\n if (submissionEntity.getUrId().equals(currentUserId)){\n return true;\n }\n\n //else check current user has solved this problem and this contests allow to view solved problem's solutions\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_SOLVED)){\n Integer solveCnt = submissionMapper.checkSolvedStatusInContest(ctId,submissionEntity.getPmId(),submissionEntity.getUrId());\n return solveCnt > 0;\n }\n return false;\n }", "boolean isAchievable();", "public interface Completable {\n\n boolean isComplete();\n\n boolean isCorrect();\n\n boolean canBeSolved();\n}", "public void setCValueEditable(boolean status);", "public void setEditablePlaCta(boolean editable)\n {\n if (editable==true)\n {\n objTblModPlaCta.setModoOperacion(objTblModPlaCta.INT_TBL_INS);\n }\n else\n {\n objTblModPlaCta.setModoOperacion(objTblModPlaCta.INT_TBL_NO_EDI);\n }\n }", "boolean isEditable();", "@Override\n public void checkEditing() {\n }", "@Override\n\t\t\tpublic void setCanceled(boolean value) {\n\t\t\t\t\n\t\t\t}", "public void courseOperation() {\n\t\tthePerson.createCourseMenu();\n\t}", "public void setEdit(boolean bool){\r\n edit = bool;\r\n }", "private void setPermissions( String userId, ProposalDevelopmentDocument doc, Set<String> editModes ) {\n\t\tif ( editModes.contains( AuthorizationConstants.EditMode.FULL_ENTRY ) ) {\n\t\t\teditModes.add( \"modifyProposal\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ADD_BUDGET ) ) {\n\t\t\teditModes.add( \"addBudget\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.OPEN_BUDGETS ) ) {\n\t\t\teditModes.add( \"openBudgets\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_BUDGET ) ) {\n\t\t\teditModes.add( \"modifyProposalBudget\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_PROPOSAL_ROLES ) ) {\n\t\t\teditModes.add( \"modifyPermissions\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ADD_NARRATIVE ) ) {\n\t\t\teditModes.add( \"addNarratives\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.CERTIFY ) ) {\n\t\t\teditModes.add( \"certify\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.MODIFY_NARRATIVE_STATUS ) ) {\n\t\t\teditModes.add( \"modifyNarrativeStatus\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.PRINT_PROPOSAL ) ) {\n\t\t\teditModes.add( \"printProposal\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.ALTER_PROPOSAL_DATA ) ) {\n\t\t\teditModes.add( \"alterProposalData\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.SHOW_ALTER_PROPOSAL_DATA ) ) {\n\t\t\teditModes.add( \"showAlterProposalData\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.SUBMIT_TO_SPONSOR ) ) {\n\t\t\teditModes.add( \"submitToSponsor\" );\n\t\t}\n\t\tif ( canExecuteTask( userId, doc, TaskName.MAINTAIN_PROPOSAL_HIERARCHY ) ) {\n\t\t\teditModes.add( \"maintainProposalHierarchy\" );\n\t\t}\n\n\t\tif ( canExecuteTask( userId, doc, TaskName.REJECT_PROPOSAL ) ) {\n\t\t\teditModes.add( TaskName.REJECT_PROPOSAL );\n\t\t}\n\n\t\tsetNarrativePermissions( userId, doc, editModes );\n\t}", "public boolean editarV2(){\n\t\tDate hoy = new Date();\n\t\tint transcurridos = 0;\n\t\tif(estatus.equals(EEstatusRequerimiento.EMITIDO) || estatus.equals(EEstatusRequerimiento.RECIBIDO_EDITADO)){\n\t\t\tif(fechaUltimaModificacion != null){\n\t\t\t\ttranscurridos = obtener_dias_entre_2_fechas(fechaUltimaModificacion, hoy);\n\t\t\t\tif(transcurridos == 0 || transcurridos == 1)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t}else if(fechaCreacion != null){\n\t\t\t\ttranscurridos = obtener_dias_entre_2_fechas(fechaCreacion, hoy);\n\t\t\t\tif(transcurridos == 0 || transcurridos == 1)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t} \n\t\t}\n\t\treturn false;\t\n\t}", "protected abstract boolean invokable(Resource r);" ]
[ "0.61898696", "0.6044313", "0.589972", "0.58301437", "0.5788533", "0.5748902", "0.56932145", "0.5680745", "0.56571585", "0.5615048", "0.5605241", "0.5595618", "0.5529843", "0.5528964", "0.55114424", "0.5505478", "0.5503184", "0.54991317", "0.5499109", "0.54988265", "0.54944706", "0.5489652", "0.5483202", "0.5472895", "0.546469", "0.5451013", "0.5442939", "0.54292786", "0.5427386", "0.54232454", "0.539104", "0.53847164", "0.538216", "0.5366685", "0.5346644", "0.53443795", "0.5341461", "0.5328337", "0.5324997", "0.53230405", "0.53103286", "0.5309785", "0.5295288", "0.52904826", "0.5276818", "0.527254", "0.52561045", "0.5255044", "0.5253042", "0.52435106", "0.5228351", "0.5209963", "0.52066207", "0.52018505", "0.51990515", "0.5186345", "0.5186345", "0.51842433", "0.51824915", "0.51705956", "0.51564485", "0.51526195", "0.515052", "0.51476496", "0.51464856", "0.51438713", "0.5140566", "0.5140136", "0.5138715", "0.5137972", "0.51305103", "0.51261634", "0.51200277", "0.51186657", "0.51171976", "0.51102906", "0.5105461", "0.51027185", "0.51027185", "0.5088009", "0.5087568", "0.50828856", "0.508244", "0.50788033", "0.5069947", "0.50632757", "0.50632757", "0.5059408", "0.5055807", "0.5050191", "0.5045521", "0.5044849", "0.5038104", "0.502936", "0.502681", "0.5023343", "0.5021765", "0.5018522", "0.5009725", "0.5009005" ]
0.6140495
1
Logger logger = Logger.getLogger("test");
public static int addFile(Connection conn,String campus,String user,int id,String fn,String original, int en, int sq, int qn, int version) throws SQLException { int rowsAffected = -1; try { String sql = "INSERT INTO tblfndfiles(id,originalname,filename,auditby,auditdate,campus,en,sq,qn,version) values(?,?,?,?,?,?,?,?,?,?)"; PreparedStatement ps = conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS); ps.setInt(1,id); ps.setString(2,original); ps.setString(3,fn); ps.setString(4,user); ps.setString(5,AseUtil.getCurrentDateTimeString()); ps.setString(6,campus); ps.setInt(7,en); ps.setInt(8,sq); ps.setInt(9,qn); ps.setInt(10,version); rowsAffected = ps.executeUpdate(); // // retrieve and return max id // if(rowsAffected > 0){ // // get the id just added for use here // ResultSet rs = null; try{ rs = ps.getGeneratedKeys(); if(rs.next()){ rowsAffected = rs.getInt(1); } rs.close(); ps.close(); } catch (Exception e){ logger.fatal("addFile - " + e.toString()); rs.close(); ps.close(); } } else{ ps.close(); } } catch (SQLException e) { logger.fatal("FndDB.addFile - " + e.toString()); } catch (Exception e) { logger.fatal("FndDB.addFile - " + e.toString()); } return rowsAffected; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLoggerName() {\n return \"test\";\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "Object createLogger(String name);", "public Logger getLogger()\n/* */ {\n/* 77 */ if (this.logger == null) {\n/* 78 */ this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(this.name);\n/* */ }\n/* 80 */ return this.logger;\n/* */ }", "public Logger (){}", "public Logger getLogger(){\n\t\treturn logger;\n\t}", "public Logger getLogger() {\n\treturn _logger;\n }", "public Logger getLogger() {\n return logger;\n }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "public Logger getLogger()\n\t{\n\t\treturn logger;\n\t}", "public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }", "public static Logger get() {\n\t\treturn LoggerFactory.getLogger(WALKER.getCallerClass());\n\t}", "public Logger getLogger() {\t\t\n\t\treturn logger = LoggerFactory.getLogger(getClazz());\n\t}", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "public static Logger getLogger() {\r\n\t\tif (log == null) {\r\n\t\t\tinitLogs();\r\n\t\t}\r\n\t\treturn log;\r\n\t}", "public Logger getLogger() {\n return logger;\n }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "@Override\r\n\tpublic Logger getLogger() {\r\n\t\t\r\n\t\treturn LogFileGenerator.getLogger();\r\n\t\t\r\n\t}", "private Logger(){ }", "public static Logger logger() {\n return logger;\n }", "protected abstract Logger getLogger();", "private Logger getLogger() {\n return LoggerFactory.getLogger(ApplicationManager.class);\n }", "private static Logger getLogger() {\n if (logger == null) {\n try {\n new transactionLogging();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "Logger getLogger(final String loggerName);", "protected Logger getLogger() {\n return LoggerFactory.getLogger(getClass());\n }", "private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }", "public Logger getLogger()\n {\n return this.logger;\n }", "private Logger() {\n\n }", "public static Logger getLogger()\n {\n if (logger == null)\n {\n Log.logger = LogManager.getLogger(BAG_DESC);\n }\n return logger;\n }", "public static Log getLogger() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog();\r\n }\r\n return l;\r\n }", "@Override\n public MagicLogger getLogger() {\n return logger;\n }", "public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }", "public RevisorLogger getLogger();", "public MyLogger () {}", "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 }", "public static Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(APILOGS);\n\n try {\n\n // This block configure the logger with handler and formatter\n // The boolean value is to append to an existing file if exists\n\n getFileHandler();\n\n logger.addHandler(fh);\n SimpleFormatter formatter = new SimpleFormatter();\n fh.setFormatter(formatter);\n\n // this removes the console log messages\n // logger.setUseParentHandlers(false);\n\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "protected Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(getClass().getName());\n }\n return logger;\n }", "public static Logger getInstance() {\n if (logger == null)\n logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);\n return logger;\n }", "void initializeLogging();", "public AstractLogger getDefaultLogger()\n {\n return new DefaultLogger();\n }", "public static Logger getLogger(String name) {\n\t\tif (name != null && name.length() > 0) {\n\t\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\t\t\t// BasicConfigurator.configure();\n\t\t} else {\n\t\t\tBasicConfigurator.configure();\n\t\t}\n\n\t\t// get a logger instance named \"com.foo\"\n\t\t// Logger logger = Logger.getLogger(\"com.foo\");\n\t\t// ApacheLogTest.class.getResource(\"log4j.properties\");\n\t\tLogger logger = Logger.getLogger(name);\n\n\t\t// Now set its level. Normally you do not need to set the\n\t\t// level of a logger programmatically. This is usually done\n\t\t// in configuration files.\n\t\tlogger.setLevel(Level.ALL);\n\n\t\t// Logger barlogger = Logger.getLogger(\"com.foo.Bar\");\n\n\t\t// The logger instance barlogger, named \"com.foo.Bar\",\n\t\t// will inherit its level from the logger named\n\t\t// \"com.foo\" Thus, the following request is enabled\n\t\t// because INFO >= INFO.\n\t\t// barlogger.info(\"Located nearest gas station.\");\n\n\t\t// This request is disabled, because DEBUG < INFO.\n\t\t// barlogger.debug(\"Exiting gas station search\");\n\n\t\t// ///////////// Appenders ////////////////////////\n\n\t\t// Log4j allows logging requests to print to multiple destinations. In\n\t\t// log4j speak, an output destination is called an appender.\n\n\t\t// Currently, appenders exist for the console, files, GUI components,\n\t\t// remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog\n\t\t// daemons. It is also possible to log asynchronously.\n\n\t\t// ///////////// Layouts ////////////////////////\n\n\t\t// More often than not, users wish to customize not only the output\n\t\t// destination but also the output format. This is accomplished by\n\t\t// associating a layout with an appender. The layout is responsible for\n\t\t// formatting the logging request according to the user's wishes,\n\t\t// whereas an appender takes care of sending the formatted output to its\n\t\t// destination\n\t\treturn logger;\n\t}", "protected abstract ILogger getLogger();", "private Logger(){\n\n }", "private synchronized ILogger getLogger()\n {\n if( _logger == null )\n _logger = ClearLogFactory.getLogger( ClearLogFactory.PERSIST_LOG,\n this.getClass() );\n return _logger;\n }", "private ExtentLogger() {}", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "Map<String, Logger> loggers();", "static Trace getLogger(String name)\n {\n return new Trace(Logger.getLogger(name));\n }", "public Logger getLogger() {\n //depending on the subclass, we'll get a particular logger.\n Logger logger = createLogger();\n\n //could do other operations on the logger here\n return logger;\n }", "protected Log getLogger() {\n return LOGGER;\n }", "public static BackupLogger getLogger() {\n\t\tif (BackupLogger.logger == null) BackupLogger.logger = new BackupLogger();\n\t\treturn BackupLogger.logger;\n\t}", "public Logger logger()\n\t{\n\t\tif (logger == null)\n\t\t{\n\t\t\tlogger = new Logger(PluginRegionBlacklist.this.getClass().getCanonicalName(), null)\n\t\t\t{\n\t\t\t\tpublic void log(LogRecord logRecord)\n\t\t\t\t{\n\n\t\t\t\t\tlogRecord.setMessage(loggerPrefix + logRecord.getMessage());\n\t\t\t\t\tsuper.log(logRecord);\n\t\t\t\t}\n\t\t\t};\n\t\t\tlogger.setParent(getLogger());\n\t\t}\n\t\treturn logger;\n\t}", "public Log(Logger logger) {\n this.logger = logger;\n }", "public Logger getLog () {\n return log;\n }", "public MCBLogger getLogger() {\n return logger;\n }", "public BaseLogger getLogger() {\r\n\t\treturn logger;\r\n\t}", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "public Logger log() {\n return LOG;\n }", "public final Logger getLogger() {\r\n return this.logger;\r\n }", "protected Logger getLogger() {\n return (logger);\n }", "void log();", "public String getLog();", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "private LoggerSingleton() {\n\n }", "public static void log4jExample() {\n\t\tnewLogger.warn(\"This is the info level\");\n\t\t\n\t}", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "IFileLogger log();", "@Nonnull\n ScriptLogger getLogger();", "public Logger getLogger(String name) {\n\t\treturn this.hierarchy.getLogger(name);\n\t}", "Logger getLog(Class clazz);", "protected Logger getLogger(final Class<?> klaz) {\n\t\treturn MavenLoggerFactory.getLogger(klaz, getLog());\n\t}", "public interface Logger {\n\tpublic void log(String msg);\n}", "public LogKitLogger(String name)\n/* */ {\n/* 64 */ this.name = name;\n/* 65 */ this.logger = getLogger();\n/* */ }", "protected abstract Logger newInstance(String name);", "@Override\n\tprotected PublicationControlLogger getLogger() {\n\t\treturn logger;\n\t}", "Appendable getLog();", "public BuildLogger getLogger ( ) {\n @SuppressWarnings ( \"unchecked\" ) final List<? extends BuildListener> listeners = getProject ( ).getBuildListeners ( ) ;\n assert listeners.size ( ) > 0 ;\n return (BuildLogger) listeners.get ( 0 ) ;\n }", "Object createLogger(Class<?> clazz);", "public static Logger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }", "private synchronized ILogger _getAlertLogger()\n {\n if( alertlogger == null )\n alertlogger = ClearLogFactory.getLogger( ClearLogFactory.ALERT_LOG,\n this.getClass() );\n return alertlogger;\n }", "private static synchronized Logger initializeLogger(String path) {\r\n\t\tLogger logger = Logger.getLogger(\"Logging\");\r\n\t\tlogger.removeAllAppenders();\r\n\t\tLogger.getRootLogger().removeAllAppenders();\r\n\t\tFileAppender logAppender = null;\r\n\t\tLayout layout = new PatternLayout(\"%d [%M]: %m%n\");\r\n\t\ttry {\r\n\t\t\tlogAppender = new FileAppender(layout, path);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Problems creating log file...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.addAppender(logAppender);\r\n\t\tConsoleAppender consoleAppender = new ConsoleAppender(layout);\r\n\t\tlogger.addAppender(consoleAppender);\r\n\t\tlogger.setLevel(DEBUG);\r\n\t\treturn logger;\r\n\t}", "public static Logger getLogger(Class<?> clazz){\r\n if(clazz == null){\r\n // this condition will happen if the class has not been initialized\r\n return Logger.getRootLogger();\r\n }\r\n return Logger.getLogger(clazz.getPackage().getName());\r\n }", "private void logToFile() {\n }", "public static Log getLogger(final String key) {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog(key);\r\n }\r\n return l;\r\n }", "@Test\n public void testExistingLog4j2Logger() {\n org.apache.logging.log4j.LogManager.getLogger(\"existingLogger\");\n // Logger will be the one created above\n final Logger logger = Logger.getLogger(\"existingLogger\");\n final Logger l2 = LogManager.getLogger(\"existingLogger\");\n assertEquals(logger, l2);\n logger.setLevel(Level.ERROR);\n final Priority debug = Level.DEBUG;\n // the next line will throw an exception if the LogManager loggers\n // aren't supported by 1.2 Logger/Category\n logger.l7dlog(debug, \"Hello, World\", new Object[0], null);\n assertTrue(appender.getEvents().size() == 0);\n }", "public static final Logger createLogger() {\n\t\tLogger logger = Logger.getLogger(ProcessDatabase.class.getName());\n\t\ttry {\n\t\t\tFileHandler fh = new FileHandler();\n\t\t\tfh.setFormatter(new SimpleFormatter());\n\t\t\tlogger.addHandler(fh);\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn logger;\n\t}", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "public static Logger getInstance(){\n if (shareInstance == null) {\n shareInstance = new Logger();\n }\n return shareInstance;\n }", "public StatusLogger getStatusLogger();", "RootMessageLogger getRootMessageLogger();", "@Override\n public void logs() {\n \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}", "public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}", "public MyLoggingFacade(Logger logger) {\n this.logger = logger;\n }", "protected static NbaLogger getLogger() {\n\t\tif (logger == null) {\n\t\t\ttry {\n\t\t\t\tlogger = NbaLogFactory.getLogger(NbaCyberPrintRequests.class.getName());\n\t\t\t} catch (Exception e) {\n\t\t\t\tNbaBootLogger.log(\"NbaCyberPrintRequests could not get a logger from the factory.\");\n\t\t\t\te.printStackTrace(System.out);\n\t\t\t}\n\t\t}\n\t\treturn logger;\n\t}", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }" ]
[ "0.76177746", "0.7436475", "0.7428474", "0.7220833", "0.7165627", "0.7153", "0.7152944", "0.70964926", "0.7075006", "0.7059625", "0.7037747", "0.7032445", "0.6996715", "0.69956124", "0.6991182", "0.69609714", "0.69513506", "0.6942537", "0.69375736", "0.6920773", "0.6918464", "0.6917882", "0.6898194", "0.6886786", "0.6873449", "0.68513656", "0.6838508", "0.6814564", "0.68001336", "0.67985123", "0.67944497", "0.67819524", "0.67749554", "0.6753002", "0.67400825", "0.67335653", "0.6717527", "0.67066395", "0.6687502", "0.6658993", "0.6649365", "0.6648651", "0.6647203", "0.66461635", "0.66309625", "0.66198623", "0.66072387", "0.65976536", "0.65878654", "0.6577141", "0.6541941", "0.65309364", "0.6518773", "0.65144205", "0.6514203", "0.65047574", "0.6499478", "0.64956915", "0.64927465", "0.6486855", "0.64839745", "0.6470329", "0.6455243", "0.64483625", "0.64483625", "0.6437617", "0.6413254", "0.6410635", "0.639764", "0.63948214", "0.63909507", "0.6387542", "0.6386048", "0.63808113", "0.63739973", "0.63580716", "0.63447666", "0.6339459", "0.6334744", "0.6331241", "0.63147116", "0.63120145", "0.63002396", "0.62812746", "0.6270292", "0.62635857", "0.6237196", "0.6236711", "0.62339145", "0.62329775", "0.6211889", "0.6199456", "0.6190664", "0.6181802", "0.6172694", "0.6168756", "0.6160326", "0.6154124", "0.61527264", "0.611368", "0.6102559" ]
0.0
-1
Logger logger = Logger.getLogger("test");
public static List<Generic> getAttachmentsMaster(Connection conn,String campus,int id,String sort) throws Exception { List<Generic> genericData = null; // retrieve all active forums a user has access to. // active is where the user is actively participating in (message_author) // the historyid is valid because the coursetype is PRE // and messages are in forum only at review process try{ genericData = new LinkedList<Generic>(); AseUtil aseUtil = new AseUtil(); // // default sort is filename // if(sort == null || sort.equals("")){ sort = "fn"; } String sql = "SELECT vw.seq, vw.originalname, tb.auditby, tb.auditdate, tb.filename, tb.sq, tb.en, tb.qn " + "FROM vw_fndfilesmaster vw INNER JOIN tblfndfiles tb ON vw.seq = tb.seq WHERE tb.id = ? and tb.campus=? "; if(sort.equals("fn")){ sql = sql + " ORDER BY vw.originalname"; } else{ sql = sql + " ORDER BY tb.sq, tb.en, tb.qn"; } PreparedStatement ps = conn.prepareStatement(sql); ps.setInt(1,id); ps.setString(2,campus); ResultSet rs = ps.executeQuery(); while(rs.next()){ int seq = rs.getInt("seq"); genericData.add(new Generic( "" + seq, AseUtil.nullToBlank(rs.getString("originalname")), AseUtil.nullToBlank(rs.getString("auditby")), aseUtil.ASE_FormatDateTime(rs.getString("auditdate"),Constant.DATE_DATETIME), AseUtil.nullToBlank(rs.getString("filename")), "" + rs.getInt("sq"), "" + rs.getInt("en"), "" + rs.getInt("qn"), "", "" )); } // rs rs.close(); ps.close(); aseUtil = null; } catch(SQLException e){ logger.fatal("FndDB - getAttachments: " + e.toString()); return null; } catch(Exception e){ logger.fatal("FndDB - getAttachments: " + e.toString()); return null; } return genericData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLoggerName() {\n return \"test\";\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "Object createLogger(String name);", "public Logger getLogger()\n/* */ {\n/* 77 */ if (this.logger == null) {\n/* 78 */ this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(this.name);\n/* */ }\n/* 80 */ return this.logger;\n/* */ }", "public Logger (){}", "public Logger getLogger(){\n\t\treturn logger;\n\t}", "public Logger getLogger() {\n\treturn _logger;\n }", "public Logger getLogger() {\n return logger;\n }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "public Logger getLogger()\n\t{\n\t\treturn logger;\n\t}", "public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }", "public static Logger get() {\n\t\treturn LoggerFactory.getLogger(WALKER.getCallerClass());\n\t}", "public Logger getLogger() {\t\t\n\t\treturn logger = LoggerFactory.getLogger(getClazz());\n\t}", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "public static Logger getLogger() {\r\n\t\tif (log == null) {\r\n\t\t\tinitLogs();\r\n\t\t}\r\n\t\treturn log;\r\n\t}", "public Logger getLogger() {\n return logger;\n }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "@Override\r\n\tpublic Logger getLogger() {\r\n\t\t\r\n\t\treturn LogFileGenerator.getLogger();\r\n\t\t\r\n\t}", "private Logger(){ }", "public static Logger logger() {\n return logger;\n }", "protected abstract Logger getLogger();", "private Logger getLogger() {\n return LoggerFactory.getLogger(ApplicationManager.class);\n }", "private static Logger getLogger() {\n if (logger == null) {\n try {\n new transactionLogging();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "Logger getLogger(final String loggerName);", "protected Logger getLogger() {\n return LoggerFactory.getLogger(getClass());\n }", "private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }", "public Logger getLogger()\n {\n return this.logger;\n }", "private Logger() {\n\n }", "public static Logger getLogger()\n {\n if (logger == null)\n {\n Log.logger = LogManager.getLogger(BAG_DESC);\n }\n return logger;\n }", "public static Log getLogger() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog();\r\n }\r\n return l;\r\n }", "@Override\n public MagicLogger getLogger() {\n return logger;\n }", "public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }", "public RevisorLogger getLogger();", "public MyLogger () {}", "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 }", "public static Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(APILOGS);\n\n try {\n\n // This block configure the logger with handler and formatter\n // The boolean value is to append to an existing file if exists\n\n getFileHandler();\n\n logger.addHandler(fh);\n SimpleFormatter formatter = new SimpleFormatter();\n fh.setFormatter(formatter);\n\n // this removes the console log messages\n // logger.setUseParentHandlers(false);\n\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "protected Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(getClass().getName());\n }\n return logger;\n }", "public static Logger getInstance() {\n if (logger == null)\n logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);\n return logger;\n }", "void initializeLogging();", "public AstractLogger getDefaultLogger()\n {\n return new DefaultLogger();\n }", "public static Logger getLogger(String name) {\n\t\tif (name != null && name.length() > 0) {\n\t\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\t\t\t// BasicConfigurator.configure();\n\t\t} else {\n\t\t\tBasicConfigurator.configure();\n\t\t}\n\n\t\t// get a logger instance named \"com.foo\"\n\t\t// Logger logger = Logger.getLogger(\"com.foo\");\n\t\t// ApacheLogTest.class.getResource(\"log4j.properties\");\n\t\tLogger logger = Logger.getLogger(name);\n\n\t\t// Now set its level. Normally you do not need to set the\n\t\t// level of a logger programmatically. This is usually done\n\t\t// in configuration files.\n\t\tlogger.setLevel(Level.ALL);\n\n\t\t// Logger barlogger = Logger.getLogger(\"com.foo.Bar\");\n\n\t\t// The logger instance barlogger, named \"com.foo.Bar\",\n\t\t// will inherit its level from the logger named\n\t\t// \"com.foo\" Thus, the following request is enabled\n\t\t// because INFO >= INFO.\n\t\t// barlogger.info(\"Located nearest gas station.\");\n\n\t\t// This request is disabled, because DEBUG < INFO.\n\t\t// barlogger.debug(\"Exiting gas station search\");\n\n\t\t// ///////////// Appenders ////////////////////////\n\n\t\t// Log4j allows logging requests to print to multiple destinations. In\n\t\t// log4j speak, an output destination is called an appender.\n\n\t\t// Currently, appenders exist for the console, files, GUI components,\n\t\t// remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog\n\t\t// daemons. It is also possible to log asynchronously.\n\n\t\t// ///////////// Layouts ////////////////////////\n\n\t\t// More often than not, users wish to customize not only the output\n\t\t// destination but also the output format. This is accomplished by\n\t\t// associating a layout with an appender. The layout is responsible for\n\t\t// formatting the logging request according to the user's wishes,\n\t\t// whereas an appender takes care of sending the formatted output to its\n\t\t// destination\n\t\treturn logger;\n\t}", "protected abstract ILogger getLogger();", "private Logger(){\n\n }", "private synchronized ILogger getLogger()\n {\n if( _logger == null )\n _logger = ClearLogFactory.getLogger( ClearLogFactory.PERSIST_LOG,\n this.getClass() );\n return _logger;\n }", "private ExtentLogger() {}", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "Map<String, Logger> loggers();", "static Trace getLogger(String name)\n {\n return new Trace(Logger.getLogger(name));\n }", "public Logger getLogger() {\n //depending on the subclass, we'll get a particular logger.\n Logger logger = createLogger();\n\n //could do other operations on the logger here\n return logger;\n }", "protected Log getLogger() {\n return LOGGER;\n }", "public static BackupLogger getLogger() {\n\t\tif (BackupLogger.logger == null) BackupLogger.logger = new BackupLogger();\n\t\treturn BackupLogger.logger;\n\t}", "public Logger logger()\n\t{\n\t\tif (logger == null)\n\t\t{\n\t\t\tlogger = new Logger(PluginRegionBlacklist.this.getClass().getCanonicalName(), null)\n\t\t\t{\n\t\t\t\tpublic void log(LogRecord logRecord)\n\t\t\t\t{\n\n\t\t\t\t\tlogRecord.setMessage(loggerPrefix + logRecord.getMessage());\n\t\t\t\t\tsuper.log(logRecord);\n\t\t\t\t}\n\t\t\t};\n\t\t\tlogger.setParent(getLogger());\n\t\t}\n\t\treturn logger;\n\t}", "public Log(Logger logger) {\n this.logger = logger;\n }", "public Logger getLog () {\n return log;\n }", "public MCBLogger getLogger() {\n return logger;\n }", "public BaseLogger getLogger() {\r\n\t\treturn logger;\r\n\t}", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "public Logger log() {\n return LOG;\n }", "public final Logger getLogger() {\r\n return this.logger;\r\n }", "protected Logger getLogger() {\n return (logger);\n }", "void log();", "public String getLog();", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "private LoggerSingleton() {\n\n }", "public static void log4jExample() {\n\t\tnewLogger.warn(\"This is the info level\");\n\t\t\n\t}", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "IFileLogger log();", "@Nonnull\n ScriptLogger getLogger();", "public Logger getLogger(String name) {\n\t\treturn this.hierarchy.getLogger(name);\n\t}", "Logger getLog(Class clazz);", "protected Logger getLogger(final Class<?> klaz) {\n\t\treturn MavenLoggerFactory.getLogger(klaz, getLog());\n\t}", "public interface Logger {\n\tpublic void log(String msg);\n}", "public LogKitLogger(String name)\n/* */ {\n/* 64 */ this.name = name;\n/* 65 */ this.logger = getLogger();\n/* */ }", "protected abstract Logger newInstance(String name);", "@Override\n\tprotected PublicationControlLogger getLogger() {\n\t\treturn logger;\n\t}", "Appendable getLog();", "public BuildLogger getLogger ( ) {\n @SuppressWarnings ( \"unchecked\" ) final List<? extends BuildListener> listeners = getProject ( ).getBuildListeners ( ) ;\n assert listeners.size ( ) > 0 ;\n return (BuildLogger) listeners.get ( 0 ) ;\n }", "Object createLogger(Class<?> clazz);", "public static Logger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }", "private synchronized ILogger _getAlertLogger()\n {\n if( alertlogger == null )\n alertlogger = ClearLogFactory.getLogger( ClearLogFactory.ALERT_LOG,\n this.getClass() );\n return alertlogger;\n }", "private static synchronized Logger initializeLogger(String path) {\r\n\t\tLogger logger = Logger.getLogger(\"Logging\");\r\n\t\tlogger.removeAllAppenders();\r\n\t\tLogger.getRootLogger().removeAllAppenders();\r\n\t\tFileAppender logAppender = null;\r\n\t\tLayout layout = new PatternLayout(\"%d [%M]: %m%n\");\r\n\t\ttry {\r\n\t\t\tlogAppender = new FileAppender(layout, path);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Problems creating log file...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.addAppender(logAppender);\r\n\t\tConsoleAppender consoleAppender = new ConsoleAppender(layout);\r\n\t\tlogger.addAppender(consoleAppender);\r\n\t\tlogger.setLevel(DEBUG);\r\n\t\treturn logger;\r\n\t}", "public static Logger getLogger(Class<?> clazz){\r\n if(clazz == null){\r\n // this condition will happen if the class has not been initialized\r\n return Logger.getRootLogger();\r\n }\r\n return Logger.getLogger(clazz.getPackage().getName());\r\n }", "private void logToFile() {\n }", "public static Log getLogger(final String key) {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog(key);\r\n }\r\n return l;\r\n }", "@Test\n public void testExistingLog4j2Logger() {\n org.apache.logging.log4j.LogManager.getLogger(\"existingLogger\");\n // Logger will be the one created above\n final Logger logger = Logger.getLogger(\"existingLogger\");\n final Logger l2 = LogManager.getLogger(\"existingLogger\");\n assertEquals(logger, l2);\n logger.setLevel(Level.ERROR);\n final Priority debug = Level.DEBUG;\n // the next line will throw an exception if the LogManager loggers\n // aren't supported by 1.2 Logger/Category\n logger.l7dlog(debug, \"Hello, World\", new Object[0], null);\n assertTrue(appender.getEvents().size() == 0);\n }", "public static final Logger createLogger() {\n\t\tLogger logger = Logger.getLogger(ProcessDatabase.class.getName());\n\t\ttry {\n\t\t\tFileHandler fh = new FileHandler();\n\t\t\tfh.setFormatter(new SimpleFormatter());\n\t\t\tlogger.addHandler(fh);\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn logger;\n\t}", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "public static Logger getInstance(){\n if (shareInstance == null) {\n shareInstance = new Logger();\n }\n return shareInstance;\n }", "public StatusLogger getStatusLogger();", "RootMessageLogger getRootMessageLogger();", "@Override\n public void logs() {\n \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}", "public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}", "public MyLoggingFacade(Logger logger) {\n this.logger = logger;\n }", "protected static NbaLogger getLogger() {\n\t\tif (logger == null) {\n\t\t\ttry {\n\t\t\t\tlogger = NbaLogFactory.getLogger(NbaCyberPrintRequests.class.getName());\n\t\t\t} catch (Exception e) {\n\t\t\t\tNbaBootLogger.log(\"NbaCyberPrintRequests could not get a logger from the factory.\");\n\t\t\t\te.printStackTrace(System.out);\n\t\t\t}\n\t\t}\n\t\treturn logger;\n\t}", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }" ]
[ "0.76177746", "0.7436475", "0.7428474", "0.7220833", "0.7165627", "0.7153", "0.7152944", "0.70964926", "0.7075006", "0.7059625", "0.7037747", "0.7032445", "0.6996715", "0.69956124", "0.6991182", "0.69609714", "0.69513506", "0.6942537", "0.69375736", "0.6920773", "0.6918464", "0.6917882", "0.6898194", "0.6886786", "0.6873449", "0.68513656", "0.6838508", "0.6814564", "0.68001336", "0.67985123", "0.67944497", "0.67819524", "0.67749554", "0.6753002", "0.67400825", "0.67335653", "0.6717527", "0.67066395", "0.6687502", "0.6658993", "0.6649365", "0.6648651", "0.6647203", "0.66461635", "0.66309625", "0.66198623", "0.66072387", "0.65976536", "0.65878654", "0.6577141", "0.6541941", "0.65309364", "0.6518773", "0.65144205", "0.6514203", "0.65047574", "0.6499478", "0.64956915", "0.64927465", "0.6486855", "0.64839745", "0.6470329", "0.6455243", "0.64483625", "0.64483625", "0.6437617", "0.6413254", "0.6410635", "0.639764", "0.63948214", "0.63909507", "0.6387542", "0.6386048", "0.63808113", "0.63739973", "0.63580716", "0.63447666", "0.6339459", "0.6334744", "0.6331241", "0.63147116", "0.63120145", "0.63002396", "0.62812746", "0.6270292", "0.62635857", "0.6237196", "0.6236711", "0.62339145", "0.62329775", "0.6211889", "0.6199456", "0.6190664", "0.6181802", "0.6172694", "0.6168756", "0.6160326", "0.6154124", "0.61527264", "0.611368", "0.6102559" ]
0.0
-1
ForumDB getUserBoards / getUserBoards
public static List<Generic> getAttachmentsDetail(Connection conn,String campus,int id,int seq,String originalname) throws Exception { return getAttachmentsDetail(conn,campus,id,seq,originalname,""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List findall_board_info(Integer board_id);", "Data<List<Boards>> getBoards();", "@Override\n public List<Board> getBoards(String username) {\n List<Board> boards = boardDataGateway.getBoards(username);\n for (Board b : boards) {\n b.setPins(getPinsOnBoard(username, b.getName()));\n }\n return boards;\n }", "Data<List<Boards>> getBoards(String fields);", "@Override\n\tpublic List<Map> boardList() {\n\t\treturn dao.boardList(session);\n\t}", "@Override\r\n\tpublic ArrayList<BoardVO> getBoardList() {\n\t\treturn boardDao.getBoardList();\r\n\t}", "@Override\n\tpublic List<Board2DTO> getBoardList() throws Exception {\n\t\treturn board2Mapper.getBoardList();\n\t}", "@GetMapping(\"/boards\")\n public List<Board> getAllBoards(){\n return boardRepository.findAll();\n }", "public String getBoardsForCurrentUser(Argument ... args) {\n return(enhanceURL(createURL(GET_BOARDS).asString()));\n }", "@Override\n\tpublic List<SpringBoardVO> boardSelectAll(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelectAll(bvo);\n\t}", "Data<List<Boards>> getFollowersBoards();", "public BoardInterface[] getBoards();", "@Override\n\tpublic List<boardLIstDTO> MyLikeboard(String user_id) throws Exception {\n\t\treturn sqlSession.selectList(namespace+\".MyLikeBoard\", user_id);\n\t}", "@Override\r\n\tpublic Vector<BoardDTO> listBoard(String groupNum) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Map<String, Object>> selectBoardList() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}", "@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}", "@Override\n public Board getBoard(String username, String boardname) {\n return boardDataGateway.getBoard(username, boardname);\n }", "@Override\r\n\tpublic ArrayList<Board1> getAll() {\n\t\treturn dao.selectAll();\r\n\t}", "List<Board> boardListPage(Criteria cri) throws Exception;", "@Override\r\n\tpublic List<FTipBoardVO> listAll() throws Exception {\n\t\treturn session.selectList(namespace + \".listAll\");\r\n\t}", "Data<List<Boards>> getSearchBoards(String query);", "public List<Object> getListForum();", "public List<SampleVO> selectBoardList() {\n\t\treturn sqlSession.selectList(\"sample.selectBoardList\");\r\n\t}", "Data<List<Boards>> getFollowersBoards(Integer limit);", "@Override\n\tpublic List<SpringBoardVO> boardSelect(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelect(bvo);\n\t}", "@SuppressWarnings(\"unchecked\")\n public synchronized ObjectSet<BoardThreadLink> getThreads() {\n \tfinal Query q = mDB.query();\n \tq.constrain(BoardThreadLink.class);\n \tq.descend(\"mBoard\").constrain(SubscribedBoard.this).identity(); // TODO: Benchmark whether switching the order of those two constrains makes it faster.\n \tq.descend(\"mLastReplyDate\").orderDescending();\n \treturn new Persistent.InitializingObjectSet<BoardThreadLink>(mFreetalk, q.execute());\n }", "public List<CommonBoardVO> listAll() throws Exception;", "@Override\r\n\tpublic List<BoardVO> list() throws Exception {\n\t\tlog.info(\"list() - 게시판 리스트 데이터 가져오기 +++++++++++++++\");\r\n\t\treturn null;\r\n\t}", "public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }", "@Override\n\tpublic List<BoardVO> getArticle() {\n\t\tString sql = \"SELECT * FROM board ORDER BY board_id ASC\";\n\t\t\n\t\treturn template.query(sql, new BoardMapper());\n\t}", "@Override\r\n\tpublic List<BoardVo> getBoardList(BoardVo vo) {\n\t\treturn boardDao.getBoardList(vo);\r\n\t}", "@Override\r\n\tpublic List<cms_board_vo> list(SearchCriteria scri) throws Exception {\n\t\treturn sql.selectList(\"cms_board.list\", scri);\r\n\t}", "public List<Boardreservation> getBoardReservations(int boardID);", "@Override\r\n\tpublic List<Board> getList(PageParam pageParam) {\n\t\treturn (List<Board>) mapper.getList(pageParam);\r\n\t}", "@Override\n\tpublic List<?> selectBoardAdminList() {\n\t\treturn eduBbsDAO.selectBoardAdminList();\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Board_clubDTO> select_Board_club() {\n\t\treturn (List<Board_clubDTO>)sqlMapClientTemplate.queryForList(\"BoardSql.select_Board_club\");\r\n\t}", "@Override\n\tpublic List<SpringBoardVO> boardPwCheck(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardPwCheck(bvo);\n\t}", "public List<DYRepBoardDTO> dyreplist(int bno) {\n\t\tDBConn dbconn = DBConn.getDB();\n\t\tConnection conn=null;\n\t\t\n\t\tList<DYRepBoardDTO> list =null;\n\t\t\n\t\ttry {\n\t\t\tconn=dbconn.getConn();\n\t\t\tconn.setAutoCommit(false);\n\t\t\t\n\t\t\tDYBoardDAO dao = DYBoardDAO.getdao();\n\t\t\t list = dao.dyreplist(conn,bno);\n\t\t\t\n\t\t\tconn.commit();\n\t\t}catch(NamingException | SQLException e) {\n\t\t\tSystem.out.println(e);\n\t\t}finally {\n\t\t\tif(conn!=null)try {conn.close();}catch(SQLException e) {}\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public Board getBoard ();", "Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit);", "@Override\n\tpublic List<Map> boardPopularList() {\n\t\treturn dao.boardPopularList(session);\n\t}", "public List<NoticeBoardVO> selectAllBoards(int firstRow,int endRow){\r\n\t\tString sql=\"select * from board_notice order by num desc limit ?, ?\";\r\n\t\tList<NoticeBoardVO> list=new ArrayList<NoticeBoardVO>();\r\n\t\tConnection conn=null;\r\n\t\tPreparedStatement pstmt=null;\r\n\t\tResultSet rs=null;\t\t\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tpstmt=conn.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, firstRow-1);\r\n\t\t\tpstmt.setInt(2, endRow-firstRow+1);\r\n\t\t\tSystem.out.println(pstmt);\r\n\t\t\trs=pstmt.executeQuery();\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tNoticeBoardVO vo=new NoticeBoardVO();\r\n\t\t\t\tvo.setNum(rs.getInt(\"num\"));\r\n\t\t\t\tvo.setUserid(rs.getString(\"userid\"));\r\n\t\t\t\tvo.setTitle(rs.getString(\"title\"));\r\n\t\t\t\tvo.setContent(rs.getString(\"content\"));\r\n\t\t\t\tvo.setReadcount(rs.getInt(\"readcount\"));\r\n\t\t\t\tvo.setWritedate(rs.getTimestamp(\"writedate\"));\r\n\t\t\t\tlist.add(vo);\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn,pstmt,rs);\r\n\t\t}\r\n\t\tSystem.out.println(list);\r\n\t\treturn list;\t\t\r\n\t}", "Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit, String fields);", "@RequestMapping(\"/viewBoards\")\n public String viewAllBoards(Model model,\n Authentication auth) {\n List<Board> board = boardController.findByUser(auth.getName());\n model.addAttribute(\"boards\", board);\n model.addAttribute(\"firstName\", userRepository.findByUsername(auth.getName()).getFirstName());\n\n return \"boardTemplates/viewBoards\";\n }", "public static WildBoard getBoard()\n {\n System.out.println(\"*** WildApp.getBoard() called\");\n \n return myBoard;\n }", "@Override\n\tpublic List<Subscribe> boardSubList(int usid) {\n\t\treturn dao.boardSubList(session, usid);\n\t}", "public List<Board> getCommentList(String boardUpper) throws SQLException {\n\t\treturn dao.getCommentList(boardUpper);\n\t}", "public List<Forum> getListForumWithStatus(String viewStatus);", "public char[][] getBoard(Connection c) {\n Statement stmt = null;\n ResultSet rs = null;\n char[][] board = new char[4][3];\n \n try {\n c.setAutoCommit(false);\n System.out.println(\"Database opened successfully\");\n \n stmt = c.createStatement();\n String sql = \"SELECT * FROM GAMEBOARD;\";\n rs = stmt.executeQuery(sql);\n if (!rs.next()) {\n return null;\n }\n int id = rs.getInt(\"PLAYER_ID\");\n int x = rs.getInt(\"COORD_X\");\n int y = rs.getInt(\"COORD_Y\");\n char type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n\n while (rs.next()) {\n id = rs.getInt(\"PLAYER_ID\");\n x = rs.getInt(\"COORD_X\");\n y = rs.getInt(\"COORD_Y\");\n type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n }\n } catch (Exception e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n return null;\n } finally {\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n \n System.out.println(\"Get Board Succeed.\");\n return board;\n }", "@RequestMapping(method = RequestMethod.GET, path = \"/allUsers\")\n\t\tpublic List<leaderBoard> getAllUsers(){\n\t\t\t logger.info(\"Entered into Controller Layer\");\n\t\t List<leaderBoard> results = leaderboardrepository.findAll();\n\t\t logger.info(\"Number of Records Fetched:\" + results.size());\n\t\t \n\t\t return results;\n\t\t //this works\n\t\t \n\t\t \n\t\t}", "@CrossOrigin\n\t@RequestMapping(value = \"board\", method = RequestMethod.GET, produces = \"application/json\")\n\tpublic String showBoard() throws ServletException {\n\t\t\n\t\tParser<Persons> parser = new Parser<Persons>(personsRepository.findAll());\n\t\treturn parser.parse();\n\t}", "@Test\n\tpublic void testBoard() {\n\t\tUserModel exampleUser = new UserModel();\n\t\texampleUser.setUserId(\"@tester_5\");\n\t\texampleUser.setUserPseudo(\"Test_pseudo\");\n\t\texampleUser.setUserEmail(\"[email protected]\");\n\t\texampleUser.setUserPassword(\"0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123\");\n\t\texampleUser.setUserDate(new Date(new java.util.Date().getTime()));\n\t\texampleUser.setUserAdmin(true);\n\t\ttry {\n\t\t\tUserDatabaseManager.insertUser(exampleUser);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot insert a new user for board testing !\");\n\t\t}\n\n\t\t// Test insertion\n\t\tBoardModel newBoard = new BoardModel();\n\t\tnewBoard.setBoardName(\"test_board\");\n\t\tnewBoard.setBoardCreatorId(\"@tester_5\");\n\t\tnewBoard.setBoardDescription(\"This is the test board of the test user\");\n\t\tnewBoard.addMessageId(\"1\");\n\t\tnewBoard.addMessageId(\"3\");\n\t\ttry {\n\t\t\tBoardDatabaseManager.insertBoard(newBoard);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot insert a new board !\");\n\t\t}\n\n\t\t// Test updating\n\t\tnewBoard.setBoardDescription(\"LOL\");\n\t\ttry {\n\t\t\tBoardDatabaseManager.updateBoard(newBoard);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot update the board !\");\n\t\t}\n\n\t\t// Test the board get for one\n\t\tBoardFilter filter = new BoardFilter();\n\t\tfilter.addBoardName(\"test_board\");\n\t\tfilter.addBoardCreatorId(\"@tester_5\");\n\t\ttry {\n\t\t\tList<BoardModel> res = BoardDatabaseManager.getBoards(filter, false);\n\t\t\tassertEquals(1, res.size());\n\t\t\tassertEquals(\"LOL\", res.get(0).getBoardDescription());\n\t\t\tassertEquals(2, res.get(0).getBoardMessagesId().size());\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot get one board !\");\n\t\t}\n\n\t\t// Test the board deletion\n\t\ttry {\n\t\t\tBoardDatabaseManager.deleteBoard(newBoard);\n\t\t\tList<BoardModel> noBoard = BoardDatabaseManager.getBoards(filter, false);\n\t\t\tassertEquals(0, noBoard.size());\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot delete the board !\");\n\t\t}\n\t}", "@Override\n\tpublic List<BoardDto> boardReplyAll(int board_id) {\n\t\treturn dao.boardReplyAll(board_id);\n\t}", "@Override\n\tpublic List<SpringBoardVO> boardSelectPaging(SpringBoardVO dvo){\n\t\treturn springBoardDAO.boardSelectPaging(dvo);\n\t}", "@Override\n\tpublic List<Map> boardHistoryList(int cPage, int numPerPage, int usid) {\n\t\treturn dao.boardHistoryList(session, cPage, numPerPage, usid);\n\t}", "String getBoard();", "@GetMapping(\"/viewBoard/{board_id}\")\n public String viewBoard(@PathVariable(value = \"board_id\") String board_id,\n Model model,\n Authentication auth) {\n ResponseEntity<Board> board = boardController.getBoardById(board_id);\n\n if (board.getStatusCode().is2xxSuccessful() && board.getBody() != null) {\n // Check if board is private and requesting User is not the board owner, then raise 404\n if (board.getBody().getPrivateBoard() && (auth == null || !auth.getName().equals(board.getBody().getUserId())))\n return \"errorPages/403\";\n\n Board board_body = board.getBody();\n\n // Use the no board url as default\n if (board_body.getBoardCoverUrl() == null)\n board_body.setBoardCoverUrl(\"no-board-cover.png\");\n\n List<Post> post_list = new ArrayList<>();\n List<String> board_post_list = new ArrayList<>();\n\n if (board.getBody().getPostID() != null) {\n for (String post_id : board_body.getPostID()) {\n ResponseEntity<Post> result = postController.getPostsById(post_id);\n if (result.getStatusCode().is2xxSuccessful() && result.getBody() != null) {\n post_list.add(result.getBody());\n board_post_list.add(result.getBody().getId());\n }\n }\n board_body.setPostID(board_post_list);\n boardRepository.save(board_body);\n }\n\n model.addAttribute(\"posts\", post_list);\n model.addAttribute(\"board_data\", board_body);\n\n\n return \"boardTemplates/viewBoard\";\n }\n return \"errorPages/404\";\n }", "Data<List<Boards>> getSearchBoardsCursor(String query, String cursor);", "public int[][] getBoard();", "public List<Message> getChatList(String boardId) {\n\t\tConnection conn = getConnection();\n\t\tList<Message> list = cd.getChatList(conn, boardId);\n\t\tclose(conn);\n\t\treturn list;\n\t}", "@Override\n\tpublic List<?> selectBoardAdminListView() {\n\t\treturn eduBbsDAO.selectBoardAdminList();\n\t}", "Data<List<Boards>> getSearchBoardsCursor(String query, String cursor, String fields);", "public int getCountForum();", "@Override\n public List<Pin> getPinsOnBoard(String username, String boardname) {\n List<Pin> pins = pinDataMapper.getPins(username, boardname);\n for (Pin p : pins)\n for (int userId : pinDataMapper.getLikersIds(p.getId()))\n p.addLike(userDataMapper.getUserByID(userId));\n return pins;\n }", "protected Board getBoard() { // nao vou deixar public, vou deixar privado\n\t\treturn board;\n\t}", "@Override\r\n\tpublic Set<Wall> getWalls(Board board) throws UnsupportedOperationException\r\n\t{\r\n\t\treturn board.getElements(Wall.class);\r\n\t}", "public java.util.Set getChildBoards () {\n\t\treturn this._childBoards;\n\t}", "@Override\n\tpublic List<BoardVO> admin_list() {\n\t\treturn dao.admin_listRow();\n\t}", "String[][] getBoard();", "@GetMapping(value = \"/list\")\n @ResponseBody\n public ResponseEntity<BoardReturnParam> getList() {\n return mainBoardService.getNotDeletedList();\n }", "@Override\r\n\tpublic List<CompanyBoardVO> selectupdateBoard(int cbid) throws Exception {\n\t\treturn dao.selectupdateBoard(cbid);\r\n\t}", "public Set<BoardObject> boardObjects(){\r\n\t\treturn boardObjects;\r\n\t}", "@Override\n\tpublic BoardVO getArticle(int bId) {\n\t\tString sql = \"SELECT * FROM board WHERE board_id=?\";\n\t\treturn template.queryForObject(sql, new BoardMapper(), bId);\n\t\t\t\n\t\t\n\t}", "@GetMapping(value=\"/\")\n\t\tpublic static Collection<Lobby> lobbies(){\n\t\t\treturn lobbies.values();\n\t\t}", "@Override\n\tpublic List<Map> boardLikedList(int cPage, int numPerPage, int usid) {\n\t\treturn dao.boardLikedList(session, cPage, numPerPage, usid);\n\t}", "private void populatePersonalBoardList() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"PersonalBoard\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n DatabaseReference personalBoardDBRef = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if(snapshot.hasChild(email.split(\"@\")[0])){\n dataSnapshot = snapshot.child(email.split(\"@\")[0]);\n personalBoardDBRef = database.child(\"PersonalBoard\").child(snapshot.getKey()).child(email.split(\"@\")[0]);\n break;\n }\n }\n\n if(personalBoardDBRef != null) {\n for(DataSnapshot snapshot : dataSnapshot.getChildren()) {\n for(DataSnapshot subsnapshot : snapshot.getChildren()) {\n personalBoardList.add(subsnapshot.getKey().toString());\n }\n }\n } else {\n personalBoardList.add(\"My Board\");\n }\n arrayAdapterPersonalBoard.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "private ArrayList<WobblyScore> getWobblyLeaderboard() {\n ArrayList<WobblyScore> wobblyScores = new ArrayList<>();\n String json = DiscordUser.getWobbliesLeaderboard(codManager.getGameId());\n if(json == null) {\n return wobblyScores;\n }\n JSONArray scores = new JSONArray(json);\n for(int i = 0; i < scores.length(); i++) {\n wobblyScores.add(WobblyScore.fromJSON(scores.getJSONObject(i), codManager));\n }\n WobblyScore.sortLeaderboard(wobblyScores, true);\n return wobblyScores;\n }", "@Override\n\tpublic List<Map> boardNewList() {\n\t\treturn dao.boardNewList(session);\n\t}", "private Board getBoard() {\n return gameStatus.getBoard();\n }", "@Override\n public List<UserRoom> getUserRoomList() {\n logger.info(\"Start getUserRoomList\");\n List<UserRoom> userRoomList = new ArrayList<>();\n try {\n connection = DBManager.getConnection();\n preparedStatement = connection.prepareStatement(Requests.SELECT_FROM_USER_ROOM);\n rs = preparedStatement.executeQuery();\n while (rs.next()) {\n userRoomList.add(myResultSet(rs));\n }\n } catch (SQLException sqlException) {\n Logger.getLogger(sqlException.getMessage());\n } finally {\n closing(connection, preparedStatement, rs);\n }\n logger.info(\"Completed getUserRoomList\");\n return userRoomList;\n }", "public int getBoard_id(){\n return Board_id;\n }", "@Override\r\n\tpublic ArrayList<Board1> getByDriver(String driver) {\n\t\treturn dao.selectByDriver(driver);\r\n\t}", "@Override\n\tpublic List<Map> boardPopularList(int cPage, int numPerPage) {\n\t\treturn dao.boardPopularList(cPage, numPerPage, session);\n\t}", "private void showWobblyLeaderboard(CommandContext context) {\n if(leaderboard.isEmpty()) {\n context.getMessageChannel().sendMessage(\n \"There are no wobblies on the leaderboard for \"\n + codManager.getGameName() + \"!\"\n ).queue();\n return;\n }\n new PageableTableEmbed<WobblyScore>(\n context,\n leaderboard,\n thumbnail,\n codManager.getGameName() + \" Wobbly Leaderboard\",\n \"Use **\" + getTrigger() + \" wobblies [rank]** to view more details.\\n\\n\"\n + \"Here are the \" + leaderboard.size() + \" wobbly scores:\",\n footer,\n new String[]{\"Rank\", \"Name\", \"Wobblies\"},\n 5\n ) {\n @Override\n public String getNoItemsDescription() {\n return \"There are no wobblies on the leaderboard!\";\n }\n\n @Override\n public String[] getRowValues(int index, WobblyScore score, boolean defaultSort) {\n int rank = defaultSort ? (index + 1) : (getItems().size() - index);\n return new String[]{\n String.valueOf(rank),\n score.getPlayerName(),\n MatchPlayer.formatDistance(score.getWobblies(), \"wobblies\")\n };\n }\n\n @Override\n public void sortItems(List<WobblyScore> items, boolean defaultSort) {\n WobblyScore.sortLeaderboard(items, defaultSort);\n }\n }.showMessage();\n }", "public String selectCurMemsList(String boardId) {\n\t\tConnection conn = getConnection();\n\t\tString list = cd.selectCurMemsList(conn, boardId);\n\t\tclose(conn);\n\t\treturn list;\n\t}", "@Override\n\tpublic List<String> getForumBanList(String forumId) throws Exception {\n\t\treturn null;\n\t}", "public Board getPlayersBoard() {\n return playersBoard;\n }", "@Override\n public Board getBoard(int id) {\n Board b = boardDataGateway.getBoardByID(id);\n if (b != null)\n b.setPins(getPinsOnBoard(b.getCreator().getUsername(), b.getName()));\n return b;\n }", "@GetMapping(\"/boards/{id}\")\n public ResponseEntity<Board> getBoard(@PathVariable Long id){\n Optional<Board> board = boardRepository.findById(id);\n return ResponseUtil.wrapOrNotFound(board);\n }", "public List<Forum> getForums() {\n \t\t// FIXME We do not use @OneToMany because forums are ordered,\n \t\t// thus changing the display order of a single forum will not\n \t\t// automatically change its order in the collection, and manually\n \t\t// executing a sort() seemed a worst appraoch\n \t\treturn this.repository.getForums(this);\n \t}", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "@Override\r\n\tpublic List<CommentVO> commentRead(Integer boardkey) throws Exception {\n\r\n\t\treturn session.selectList(namespace + \".commentRead\", boardkey);\r\n\r\n\t}", "@Override\n\tpublic List<Report> selectReportBoardList(Pagination pg) {\n\t\treturn dao.selectReportBoardList(pg);\n\t}", "public static Board getBoard(){\n\t\treturn board;\n\t}", "@Override\n\tpublic List<BoardVO> listCriteria(Criteria cri) throws Exception {\n\t\treturn dao.listCriteria(cri);\n\t}", "@Override\r\n\tpublic List<GroupBeds> query(GroupBeds bean) {\n\t\treturn null;\r\n\t}", "public Board getOpponentsBoard() {\n return opponentsBoard;\n }", "@Test\n public void destiny2GetLeaderboardsTest() {\n Long destinyMembershipId = null;\n Integer membershipType = null;\n Integer maxtop = null;\n String modes = null;\n String statid = null;\n InlineResponse20048 response = api.destiny2GetLeaderboards(destinyMembershipId, membershipType, maxtop, modes, statid);\n\n // TODO: test validations\n }", "@Override\r\n\tpublic List<Integer> boardNoSelectList(int memberNo) {\n\t\treturn sqlSession.selectList(namespace + \"boardNoSelectList\", memberNo);\r\n\t}", "@Override\r\n\tpublic List<ReturnMessageBean> findbymessageboardid(Integer id) {\n\t\treturn this.getSession().createQuery(\"from ReturnMessageBean where messageboardid = '\" + id + \"'\" , ReturnMessageBean.class)\r\n\t\t\t\t.setMaxResults(50).list();\r\n\t}" ]
[ "0.7129591", "0.6798712", "0.6704545", "0.66778463", "0.6640049", "0.66046417", "0.65784544", "0.6536571", "0.65113866", "0.64794475", "0.6446781", "0.6424201", "0.6406399", "0.63385075", "0.6299406", "0.6298618", "0.6298618", "0.62773216", "0.62706673", "0.6261419", "0.6227779", "0.6209017", "0.62081915", "0.6205392", "0.6191689", "0.61422884", "0.61133343", "0.610935", "0.6105623", "0.60835487", "0.6079208", "0.6031495", "0.59781355", "0.5964138", "0.59481096", "0.59389716", "0.5931531", "0.5930278", "0.58936673", "0.589135", "0.5828576", "0.5820831", "0.580821", "0.579186", "0.5783262", "0.57553077", "0.5743245", "0.5740582", "0.5736925", "0.5670977", "0.56517035", "0.5596101", "0.556908", "0.5562118", "0.55578536", "0.5548546", "0.5543295", "0.5529508", "0.55293053", "0.5521593", "0.55143476", "0.5511916", "0.5506049", "0.54978204", "0.5488346", "0.5487137", "0.54515207", "0.54435533", "0.5443358", "0.54410267", "0.54270726", "0.5425763", "0.54141843", "0.54130423", "0.54129016", "0.54055375", "0.53965735", "0.5389861", "0.5375121", "0.5368221", "0.535392", "0.534841", "0.53466827", "0.5323601", "0.53226566", "0.5318201", "0.5315439", "0.53059757", "0.5300888", "0.52752256", "0.5270071", "0.52698046", "0.5265706", "0.52644646", "0.52623254", "0.5258507", "0.52512795", "0.5243888", "0.5237564", "0.52355707", "0.52344406" ]
0.0
-1
Logger logger = Logger.getLogger("test");
public static List<Generic> getAttachmentsDetail(Connection conn,String campus,int id,int seq,String originalname,String sort) throws Exception { List<Generic> genericData = null; // retrieve all active forums a user has access to. // active is where the user is actively participating in (message_author) // the historyid is valid because the coursetype is PRE // and messages are in forum only at review process try{ genericData = new LinkedList<Generic>(); AseUtil aseUtil = new AseUtil(); // // default sort is filename // if(sort == null || sort.equals("")){ sort = "fn"; } String sql = "SELECT seq, auditby, filename, auditdate, sq, en, qn FROM tblfndfiles " + "WHERE id=? AND campus=? AND originalname=? AND seq <> ? "; if(sort.equals("fn")){ sql = sql + " ORDER BY originalname, seq "; } else{ sql = sql + " ORDER BY sq, en, qn"; } PreparedStatement ps = conn.prepareStatement(sql); ps.setInt(1,id); ps.setString(2,campus); ps.setString(3,originalname); ps.setInt(4,seq); ResultSet rs = ps.executeQuery(); while(rs.next()){ genericData.add(new Generic( "" + rs.getInt("seq"), originalname, AseUtil.nullToBlank(rs.getString("auditby")), aseUtil.ASE_FormatDateTime(rs.getString("auditdate"),Constant.DATE_DATETIME), AseUtil.nullToBlank(rs.getString("filename")), "" + rs.getInt("sq"), "" + rs.getInt("en"), "" + rs.getInt("qn"), "", "" )); } // rs rs.close(); ps.close(); aseUtil = null; } catch(SQLException e){ logger.fatal("FndDB - getAttachments: " + e.toString()); return null; } catch(Exception e){ logger.fatal("FndDB - getAttachments: " + e.toString()); return null; } return genericData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLoggerName() {\n return \"test\";\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "Object createLogger(String name);", "public Logger getLogger()\n/* */ {\n/* 77 */ if (this.logger == null) {\n/* 78 */ this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(this.name);\n/* */ }\n/* 80 */ return this.logger;\n/* */ }", "public Logger (){}", "public Logger getLogger(){\n\t\treturn logger;\n\t}", "public Logger getLogger() {\n\treturn _logger;\n }", "public Logger getLogger() {\n return logger;\n }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "public Logger getLogger()\n\t{\n\t\treturn logger;\n\t}", "public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }", "public static Logger get() {\n\t\treturn LoggerFactory.getLogger(WALKER.getCallerClass());\n\t}", "public Logger getLogger() {\t\t\n\t\treturn logger = LoggerFactory.getLogger(getClazz());\n\t}", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "public static Logger getLogger() {\r\n\t\tif (log == null) {\r\n\t\t\tinitLogs();\r\n\t\t}\r\n\t\treturn log;\r\n\t}", "public Logger getLogger() {\n return logger;\n }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "@Override\r\n\tpublic Logger getLogger() {\r\n\t\t\r\n\t\treturn LogFileGenerator.getLogger();\r\n\t\t\r\n\t}", "private Logger(){ }", "public static Logger logger() {\n return logger;\n }", "protected abstract Logger getLogger();", "private Logger getLogger() {\n return LoggerFactory.getLogger(ApplicationManager.class);\n }", "private static Logger getLogger() {\n if (logger == null) {\n try {\n new transactionLogging();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "Logger getLogger(final String loggerName);", "protected Logger getLogger() {\n return LoggerFactory.getLogger(getClass());\n }", "private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }", "public Logger getLogger()\n {\n return this.logger;\n }", "private Logger() {\n\n }", "public static Logger getLogger()\n {\n if (logger == null)\n {\n Log.logger = LogManager.getLogger(BAG_DESC);\n }\n return logger;\n }", "public static Log getLogger() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog();\r\n }\r\n return l;\r\n }", "@Override\n public MagicLogger getLogger() {\n return logger;\n }", "public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }", "public RevisorLogger getLogger();", "public MyLogger () {}", "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 }", "public static Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(APILOGS);\n\n try {\n\n // This block configure the logger with handler and formatter\n // The boolean value is to append to an existing file if exists\n\n getFileHandler();\n\n logger.addHandler(fh);\n SimpleFormatter formatter = new SimpleFormatter();\n fh.setFormatter(formatter);\n\n // this removes the console log messages\n // logger.setUseParentHandlers(false);\n\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "protected Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(getClass().getName());\n }\n return logger;\n }", "public static Logger getInstance() {\n if (logger == null)\n logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);\n return logger;\n }", "void initializeLogging();", "public AstractLogger getDefaultLogger()\n {\n return new DefaultLogger();\n }", "public static Logger getLogger(String name) {\n\t\tif (name != null && name.length() > 0) {\n\t\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\t\t\t// BasicConfigurator.configure();\n\t\t} else {\n\t\t\tBasicConfigurator.configure();\n\t\t}\n\n\t\t// get a logger instance named \"com.foo\"\n\t\t// Logger logger = Logger.getLogger(\"com.foo\");\n\t\t// ApacheLogTest.class.getResource(\"log4j.properties\");\n\t\tLogger logger = Logger.getLogger(name);\n\n\t\t// Now set its level. Normally you do not need to set the\n\t\t// level of a logger programmatically. This is usually done\n\t\t// in configuration files.\n\t\tlogger.setLevel(Level.ALL);\n\n\t\t// Logger barlogger = Logger.getLogger(\"com.foo.Bar\");\n\n\t\t// The logger instance barlogger, named \"com.foo.Bar\",\n\t\t// will inherit its level from the logger named\n\t\t// \"com.foo\" Thus, the following request is enabled\n\t\t// because INFO >= INFO.\n\t\t// barlogger.info(\"Located nearest gas station.\");\n\n\t\t// This request is disabled, because DEBUG < INFO.\n\t\t// barlogger.debug(\"Exiting gas station search\");\n\n\t\t// ///////////// Appenders ////////////////////////\n\n\t\t// Log4j allows logging requests to print to multiple destinations. In\n\t\t// log4j speak, an output destination is called an appender.\n\n\t\t// Currently, appenders exist for the console, files, GUI components,\n\t\t// remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog\n\t\t// daemons. It is also possible to log asynchronously.\n\n\t\t// ///////////// Layouts ////////////////////////\n\n\t\t// More often than not, users wish to customize not only the output\n\t\t// destination but also the output format. This is accomplished by\n\t\t// associating a layout with an appender. The layout is responsible for\n\t\t// formatting the logging request according to the user's wishes,\n\t\t// whereas an appender takes care of sending the formatted output to its\n\t\t// destination\n\t\treturn logger;\n\t}", "protected abstract ILogger getLogger();", "private Logger(){\n\n }", "private synchronized ILogger getLogger()\n {\n if( _logger == null )\n _logger = ClearLogFactory.getLogger( ClearLogFactory.PERSIST_LOG,\n this.getClass() );\n return _logger;\n }", "private ExtentLogger() {}", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "Map<String, Logger> loggers();", "static Trace getLogger(String name)\n {\n return new Trace(Logger.getLogger(name));\n }", "public Logger getLogger() {\n //depending on the subclass, we'll get a particular logger.\n Logger logger = createLogger();\n\n //could do other operations on the logger here\n return logger;\n }", "protected Log getLogger() {\n return LOGGER;\n }", "public static BackupLogger getLogger() {\n\t\tif (BackupLogger.logger == null) BackupLogger.logger = new BackupLogger();\n\t\treturn BackupLogger.logger;\n\t}", "public Logger logger()\n\t{\n\t\tif (logger == null)\n\t\t{\n\t\t\tlogger = new Logger(PluginRegionBlacklist.this.getClass().getCanonicalName(), null)\n\t\t\t{\n\t\t\t\tpublic void log(LogRecord logRecord)\n\t\t\t\t{\n\n\t\t\t\t\tlogRecord.setMessage(loggerPrefix + logRecord.getMessage());\n\t\t\t\t\tsuper.log(logRecord);\n\t\t\t\t}\n\t\t\t};\n\t\t\tlogger.setParent(getLogger());\n\t\t}\n\t\treturn logger;\n\t}", "public Log(Logger logger) {\n this.logger = logger;\n }", "public Logger getLog () {\n return log;\n }", "public MCBLogger getLogger() {\n return logger;\n }", "public BaseLogger getLogger() {\r\n\t\treturn logger;\r\n\t}", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "public Logger log() {\n return LOG;\n }", "public final Logger getLogger() {\r\n return this.logger;\r\n }", "protected Logger getLogger() {\n return (logger);\n }", "void log();", "public String getLog();", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "private LoggerSingleton() {\n\n }", "public static void log4jExample() {\n\t\tnewLogger.warn(\"This is the info level\");\n\t\t\n\t}", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "IFileLogger log();", "@Nonnull\n ScriptLogger getLogger();", "public Logger getLogger(String name) {\n\t\treturn this.hierarchy.getLogger(name);\n\t}", "Logger getLog(Class clazz);", "protected Logger getLogger(final Class<?> klaz) {\n\t\treturn MavenLoggerFactory.getLogger(klaz, getLog());\n\t}", "public interface Logger {\n\tpublic void log(String msg);\n}", "public LogKitLogger(String name)\n/* */ {\n/* 64 */ this.name = name;\n/* 65 */ this.logger = getLogger();\n/* */ }", "protected abstract Logger newInstance(String name);", "@Override\n\tprotected PublicationControlLogger getLogger() {\n\t\treturn logger;\n\t}", "Appendable getLog();", "public BuildLogger getLogger ( ) {\n @SuppressWarnings ( \"unchecked\" ) final List<? extends BuildListener> listeners = getProject ( ).getBuildListeners ( ) ;\n assert listeners.size ( ) > 0 ;\n return (BuildLogger) listeners.get ( 0 ) ;\n }", "Object createLogger(Class<?> clazz);", "public static Logger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }", "private synchronized ILogger _getAlertLogger()\n {\n if( alertlogger == null )\n alertlogger = ClearLogFactory.getLogger( ClearLogFactory.ALERT_LOG,\n this.getClass() );\n return alertlogger;\n }", "private static synchronized Logger initializeLogger(String path) {\r\n\t\tLogger logger = Logger.getLogger(\"Logging\");\r\n\t\tlogger.removeAllAppenders();\r\n\t\tLogger.getRootLogger().removeAllAppenders();\r\n\t\tFileAppender logAppender = null;\r\n\t\tLayout layout = new PatternLayout(\"%d [%M]: %m%n\");\r\n\t\ttry {\r\n\t\t\tlogAppender = new FileAppender(layout, path);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Problems creating log file...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.addAppender(logAppender);\r\n\t\tConsoleAppender consoleAppender = new ConsoleAppender(layout);\r\n\t\tlogger.addAppender(consoleAppender);\r\n\t\tlogger.setLevel(DEBUG);\r\n\t\treturn logger;\r\n\t}", "public static Logger getLogger(Class<?> clazz){\r\n if(clazz == null){\r\n // this condition will happen if the class has not been initialized\r\n return Logger.getRootLogger();\r\n }\r\n return Logger.getLogger(clazz.getPackage().getName());\r\n }", "private void logToFile() {\n }", "public static Log getLogger(final String key) {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog(key);\r\n }\r\n return l;\r\n }", "@Test\n public void testExistingLog4j2Logger() {\n org.apache.logging.log4j.LogManager.getLogger(\"existingLogger\");\n // Logger will be the one created above\n final Logger logger = Logger.getLogger(\"existingLogger\");\n final Logger l2 = LogManager.getLogger(\"existingLogger\");\n assertEquals(logger, l2);\n logger.setLevel(Level.ERROR);\n final Priority debug = Level.DEBUG;\n // the next line will throw an exception if the LogManager loggers\n // aren't supported by 1.2 Logger/Category\n logger.l7dlog(debug, \"Hello, World\", new Object[0], null);\n assertTrue(appender.getEvents().size() == 0);\n }", "public static final Logger createLogger() {\n\t\tLogger logger = Logger.getLogger(ProcessDatabase.class.getName());\n\t\ttry {\n\t\t\tFileHandler fh = new FileHandler();\n\t\t\tfh.setFormatter(new SimpleFormatter());\n\t\t\tlogger.addHandler(fh);\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn logger;\n\t}", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "public static Logger getInstance(){\n if (shareInstance == null) {\n shareInstance = new Logger();\n }\n return shareInstance;\n }", "public StatusLogger getStatusLogger();", "RootMessageLogger getRootMessageLogger();", "@Override\n public void logs() {\n \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}", "public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}", "public MyLoggingFacade(Logger logger) {\n this.logger = logger;\n }", "protected static NbaLogger getLogger() {\n\t\tif (logger == null) {\n\t\t\ttry {\n\t\t\t\tlogger = NbaLogFactory.getLogger(NbaCyberPrintRequests.class.getName());\n\t\t\t} catch (Exception e) {\n\t\t\t\tNbaBootLogger.log(\"NbaCyberPrintRequests could not get a logger from the factory.\");\n\t\t\t\te.printStackTrace(System.out);\n\t\t\t}\n\t\t}\n\t\treturn logger;\n\t}", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }" ]
[ "0.76177746", "0.7436475", "0.7428474", "0.7220833", "0.7165627", "0.7153", "0.7152944", "0.70964926", "0.7075006", "0.7059625", "0.7037747", "0.7032445", "0.6996715", "0.69956124", "0.6991182", "0.69609714", "0.69513506", "0.6942537", "0.69375736", "0.6920773", "0.6918464", "0.6917882", "0.6898194", "0.6886786", "0.6873449", "0.68513656", "0.6838508", "0.6814564", "0.68001336", "0.67985123", "0.67944497", "0.67819524", "0.67749554", "0.6753002", "0.67400825", "0.67335653", "0.6717527", "0.67066395", "0.6687502", "0.6658993", "0.6649365", "0.6648651", "0.6647203", "0.66461635", "0.66309625", "0.66198623", "0.66072387", "0.65976536", "0.65878654", "0.6577141", "0.6541941", "0.65309364", "0.6518773", "0.65144205", "0.6514203", "0.65047574", "0.6499478", "0.64956915", "0.64927465", "0.6486855", "0.64839745", "0.6470329", "0.6455243", "0.64483625", "0.64483625", "0.6437617", "0.6413254", "0.6410635", "0.639764", "0.63948214", "0.63909507", "0.6387542", "0.6386048", "0.63808113", "0.63739973", "0.63580716", "0.63447666", "0.6339459", "0.6334744", "0.6331241", "0.63147116", "0.63120145", "0.63002396", "0.62812746", "0.6270292", "0.62635857", "0.6237196", "0.6236711", "0.62339145", "0.62329775", "0.6211889", "0.6199456", "0.6190664", "0.6181802", "0.6172694", "0.6168756", "0.6160326", "0.6154124", "0.61527264", "0.611368", "0.6102559" ]
0.0
-1
ForumDB getUserBoards / testData
public static String drawFndRadio(Connection conn,String control,String value) { //Logger logger = Logger.getLogger("test"); String temp = ""; try { String[] fndtype = "FG,FS,FW".split(","); String[] fndname = "Global and Multicultural Perspectives,Symbolic Reasoning,Written Communication".split(","); for(int i=0; i<fndtype.length; i++){ String selected = ""; if(fndtype[i].equals(value)){ selected = "checked"; } temp += "<input type=\"radio\" value=\"" + fndtype[i] +"\" name=\"" + control +"\" " + selected + ">" + fndtype[i] + " - " + fndname[i] + "<br/>"; } } catch (Exception e) { logger.fatal("drawFndRadio - " + e.toString()); } return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Data<List<Boards>> getBoards();", "Data<List<Boards>> getBoards(String fields);", "@Test\n\tpublic void testBoard() {\n\t\tUserModel exampleUser = new UserModel();\n\t\texampleUser.setUserId(\"@tester_5\");\n\t\texampleUser.setUserPseudo(\"Test_pseudo\");\n\t\texampleUser.setUserEmail(\"[email protected]\");\n\t\texampleUser.setUserPassword(\"0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123\");\n\t\texampleUser.setUserDate(new Date(new java.util.Date().getTime()));\n\t\texampleUser.setUserAdmin(true);\n\t\ttry {\n\t\t\tUserDatabaseManager.insertUser(exampleUser);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot insert a new user for board testing !\");\n\t\t}\n\n\t\t// Test insertion\n\t\tBoardModel newBoard = new BoardModel();\n\t\tnewBoard.setBoardName(\"test_board\");\n\t\tnewBoard.setBoardCreatorId(\"@tester_5\");\n\t\tnewBoard.setBoardDescription(\"This is the test board of the test user\");\n\t\tnewBoard.addMessageId(\"1\");\n\t\tnewBoard.addMessageId(\"3\");\n\t\ttry {\n\t\t\tBoardDatabaseManager.insertBoard(newBoard);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot insert a new board !\");\n\t\t}\n\n\t\t// Test updating\n\t\tnewBoard.setBoardDescription(\"LOL\");\n\t\ttry {\n\t\t\tBoardDatabaseManager.updateBoard(newBoard);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot update the board !\");\n\t\t}\n\n\t\t// Test the board get for one\n\t\tBoardFilter filter = new BoardFilter();\n\t\tfilter.addBoardName(\"test_board\");\n\t\tfilter.addBoardCreatorId(\"@tester_5\");\n\t\ttry {\n\t\t\tList<BoardModel> res = BoardDatabaseManager.getBoards(filter, false);\n\t\t\tassertEquals(1, res.size());\n\t\t\tassertEquals(\"LOL\", res.get(0).getBoardDescription());\n\t\t\tassertEquals(2, res.get(0).getBoardMessagesId().size());\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot get one board !\");\n\t\t}\n\n\t\t// Test the board deletion\n\t\ttry {\n\t\t\tBoardDatabaseManager.deleteBoard(newBoard);\n\t\t\tList<BoardModel> noBoard = BoardDatabaseManager.getBoards(filter, false);\n\t\t\tassertEquals(0, noBoard.size());\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Cannot delete the board !\");\n\t\t}\n\t}", "Data<List<Boards>> getFollowersBoards();", "List findall_board_info(Integer board_id);", "Data<List<Boards>> getSearchBoards(String query);", "@Override\n public List<Board> getBoards(String username) {\n List<Board> boards = boardDataGateway.getBoards(username);\n for (Board b : boards) {\n b.setPins(getPinsOnBoard(username, b.getName()));\n }\n return boards;\n }", "public List<SampleVO> selectBoardList() {\n\t\treturn sqlSession.selectList(\"sample.selectBoardList\");\r\n\t}", "@GetMapping(\"/boards\")\n public List<Board> getAllBoards(){\n return boardRepository.findAll();\n }", "@Override\n\tpublic List<Map> boardList() {\n\t\treturn dao.boardList(session);\n\t}", "public List<Object> getListForum();", "Data<List<Boards>> getFollowersBoards(Integer limit);", "@Override\n\tpublic List<boardLIstDTO> MyLikeboard(String user_id) throws Exception {\n\t\treturn sqlSession.selectList(namespace+\".MyLikeBoard\", user_id);\n\t}", "@Test\n public void testGetForumByUser() {\n try {\n List<ForumDTO> forumDTOS = forumService.getForumsByUser(USER_ID);\n assertTrue(\n forumDTOS.stream()\n .map(ForumDTO::getId)\n .collect(Collectors.toSet())\n .contains(FORUM_ID)\n );\n assertTrue(\n forumDTOS.stream()\n .map(ForumDTO::getId)\n .collect(Collectors.toSet())\n .contains(FORUM_LOCKED_ID)\n );\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "@Override\n\tpublic List<Board2DTO> getBoardList() throws Exception {\n\t\treturn board2Mapper.getBoardList();\n\t}", "public String getBoardsForCurrentUser(Argument ... args) {\n return(enhanceURL(createURL(GET_BOARDS).asString()));\n }", "@Override\r\n\tpublic List<FTipBoardVO> listAll() throws Exception {\n\t\treturn session.selectList(namespace + \".listAll\");\r\n\t}", "@Override\r\n\tpublic ArrayList<BoardVO> getBoardList() {\n\t\treturn boardDao.getBoardList();\r\n\t}", "@Override\n\tpublic List<Map<String, Object>> selectBoardList() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<BoardVO> list() throws Exception {\n\t\tlog.info(\"list() - 게시판 리스트 데이터 가져오기 +++++++++++++++\");\r\n\t\treturn null;\r\n\t}", "@Override\n public Board getBoard(String username, String boardname) {\n return boardDataGateway.getBoard(username, boardname);\n }", "private List<Map<Player, Integer>> collectBoardData() {\n List<Map<Player, Integer>> list = new ArrayList<>();\n\n for (int i = 0; i < board.length; i++) {\n list.add(collectLine(getRow(i)));\n list.add(collectLine(getColumn(i)));\n }\n\n list.add(collectLine(getMainDiagonal()));\n list.add(collectLine(getSecondDiagonal()));\n\n return list;\n }", "@Override\r\n\tpublic Vector<BoardDTO> listBoard(String groupNum) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<BoardVO> getArticle() {\n\t\tString sql = \"SELECT * FROM board ORDER BY board_id ASC\";\n\t\t\n\t\treturn template.query(sql, new BoardMapper());\n\t}", "@Test\r\n public void getBoardTest() {\r\n assertEquals(board4, boardManager4.getBoard());\r\n }", "public BoardInterface[] getBoards();", "List<Board> boardListPage(Criteria cri) throws Exception;", "@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}", "@Override\n\tpublic List<BoardVO> listAll() throws Exception {\n\t\treturn dao.listAll();\n\t}", "@Override\r\n\tpublic ArrayList<Board1> getAll() {\n\t\treturn dao.selectAll();\r\n\t}", "@Test\n public void destiny2GetLeaderboardsTest() {\n Long destinyMembershipId = null;\n Integer membershipType = null;\n Integer maxtop = null;\n String modes = null;\n String statid = null;\n InlineResponse20048 response = api.destiny2GetLeaderboards(destinyMembershipId, membershipType, maxtop, modes, statid);\n\n // TODO: test validations\n }", "@Override\n\tpublic List<SpringBoardVO> boardSelectAll(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelectAll(bvo);\n\t}", "@Test\n public void readsAllSubjectsFromDataBase(){\n\n try {\n\n //arrange\n AccessTables ac = new AccessTables();\n DtoServer dtoServer = new DtoServer();\n //act\n ac.getAllSubjects(h2DbConnection);\n //assert\n assertEquals(24, dtoServer.getList().size()); // 6 columns * 3 ROWS = 24 to write to clientSocket from ServerSocket\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@RequestMapping(method = RequestMethod.GET, path = \"/allUsers\")\n\t\tpublic List<leaderBoard> getAllUsers(){\n\t\t\t logger.info(\"Entered into Controller Layer\");\n\t\t List<leaderBoard> results = leaderboardrepository.findAll();\n\t\t logger.info(\"Number of Records Fetched:\" + results.size());\n\t\t \n\t\t return results;\n\t\t //this works\n\t\t \n\t\t \n\t\t}", "@Test\n void getAllUserRolesSuccess() {\n List<UserRoles> userRoles = genericDao.getAll();\n //assert that you get back the right number of results assuming nothing alters the table\n assertEquals(6, userRoles.size());//\n log.info(\"get all userRoles test: all userRoles;\" + genericDao.getAll());\n }", "public List<CommonBoardVO> listAll() throws Exception;", "@Override\r\n\tpublic List<cms_board_vo> list(SearchCriteria scri) throws Exception {\n\t\treturn sql.selectList(\"cms_board.list\", scri);\r\n\t}", "String[][] getBoard();", "public List<NoticeBoardVO> selectAllBoards(int firstRow,int endRow){\r\n\t\tString sql=\"select * from board_notice order by num desc limit ?, ?\";\r\n\t\tList<NoticeBoardVO> list=new ArrayList<NoticeBoardVO>();\r\n\t\tConnection conn=null;\r\n\t\tPreparedStatement pstmt=null;\r\n\t\tResultSet rs=null;\t\t\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tpstmt=conn.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, firstRow-1);\r\n\t\t\tpstmt.setInt(2, endRow-firstRow+1);\r\n\t\t\tSystem.out.println(pstmt);\r\n\t\t\trs=pstmt.executeQuery();\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tNoticeBoardVO vo=new NoticeBoardVO();\r\n\t\t\t\tvo.setNum(rs.getInt(\"num\"));\r\n\t\t\t\tvo.setUserid(rs.getString(\"userid\"));\r\n\t\t\t\tvo.setTitle(rs.getString(\"title\"));\r\n\t\t\t\tvo.setContent(rs.getString(\"content\"));\r\n\t\t\t\tvo.setReadcount(rs.getInt(\"readcount\"));\r\n\t\t\t\tvo.setWritedate(rs.getTimestamp(\"writedate\"));\r\n\t\t\t\tlist.add(vo);\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn,pstmt,rs);\r\n\t\t}\r\n\t\tSystem.out.println(list);\r\n\t\treturn list;\t\t\r\n\t}", "@Test\n public void destiny2GetClanLeaderboardsTest() {\n Long groupId = null;\n Integer maxtop = null;\n String modes = null;\n String statid = null;\n InlineResponse20048 response = api.destiny2GetClanLeaderboards(groupId, maxtop, modes, statid);\n\n // TODO: test validations\n }", "public List<Map<String, Object>> test(UserMtl userMtl){\n\t\tString sqlApp = \"select * from app\";\n\t\tList<Map<String, Object>> queryForList = simpleJdbc.queryForList(sqlApp);\n\t\treturn queryForList;\n\t}", "private void populatePersonalBoardList() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"PersonalBoard\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n DatabaseReference personalBoardDBRef = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if(snapshot.hasChild(email.split(\"@\")[0])){\n dataSnapshot = snapshot.child(email.split(\"@\")[0]);\n personalBoardDBRef = database.child(\"PersonalBoard\").child(snapshot.getKey()).child(email.split(\"@\")[0]);\n break;\n }\n }\n\n if(personalBoardDBRef != null) {\n for(DataSnapshot snapshot : dataSnapshot.getChildren()) {\n for(DataSnapshot subsnapshot : snapshot.getChildren()) {\n personalBoardList.add(subsnapshot.getKey().toString());\n }\n }\n } else {\n personalBoardList.add(\"My Board\");\n }\n arrayAdapterPersonalBoard.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "@Test\n public void testFindAllForums() {\n try {\n List<ForumDTO> forumDTOS = forumService.getAllForum();\n assertTrue(forumDTOS.stream()\n .map(ForumDTO::getId)\n .collect(Collectors.toSet())\n .contains(FORUM_ID)\n );\n assertTrue(forumDTOS.stream()\n .map(ForumDTO::getId)\n .collect(Collectors.toSet())\n .contains(FORUM_LOCKED_ID)\n );\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "@Override\r\n\tpublic List<BoardVo> getBoardList(BoardVo vo) {\n\t\treturn boardDao.getBoardList(vo);\r\n\t}", "@Override\n\tpublic List<Map> boardPopularList() {\n\t\treturn dao.boardPopularList(session);\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Board_clubDTO> select_Board_club() {\n\t\treturn (List<Board_clubDTO>)sqlMapClientTemplate.queryForList(\"BoardSql.select_Board_club\");\r\n\t}", "@CrossOrigin\n\t@RequestMapping(value = \"board\", method = RequestMethod.GET, produces = \"application/json\")\n\tpublic String showBoard() throws ServletException {\n\t\t\n\t\tParser<Persons> parser = new Parser<Persons>(personsRepository.findAll());\n\t\treturn parser.parse();\n\t}", "public List<Forum> getListForumWithStatus(String viewStatus);", "public int getCountForum();", "void getOnboardingData() {\n boolean newUser = mCurrentSessionCache.getOnboardingUserType() == CurrentSessionCache.OnboardingUserType.NEW_USER;\n\n SubscriptionHelper.unsubscribe(mApiSubscription);\n mApiSubscription = mOnboardingService.getOnboarding(newUser)\n .map(OnboardingResponseValidator::validate)\n .doOnSubscribe(this::onSubscribe)\n .subscribe(this::onDataOnboardingReceived, this::onDataError);\n }", "Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit, String fields);", "public List<TwitterDataExtract> GetData();", "@Test\n\tpublic void printUsersTest() {\n\t\tsrv.printUsers();\n\t}", "@DataProvider\r\n\tpublic Object[][] getData() {\n\t\tObject[][] data = new Object[3][2];\r\n\t\t// 1st set\r\n\t\tdata[0][0] = \"setusername\";\r\n\t\tdata[0][1] = \"password\";\r\n\t\t// couloumns in the row are nothing but values for that particualar\r\n\t\t// combination(row)\r\n\r\n\t\t// 2nd set\r\n\t\tdata[1][0] = \"secondsetusername\";\r\n\t\tdata[1][1] = \"secondpassword\";\r\n\r\n\t\t// 3rd set\r\n\t\tdata[2][0] = \"thirdsetusername\";\r\n\t\tdata[2][1] = \"thirdpassword\";\r\n\t\treturn data;\r\n\r\n\t}", "void fetchFactFeeds();", "@RequestMapping(\"/viewBoards\")\n public String viewAllBoards(Model model,\n Authentication auth) {\n List<Board> board = boardController.findByUser(auth.getName());\n model.addAttribute(\"boards\", board);\n model.addAttribute(\"firstName\", userRepository.findByUsername(auth.getName()).getFirstName());\n\n return \"boardTemplates/viewBoards\";\n }", "Data<List<Boards>> getSearchBoardsCursor(String query, String cursor, String fields);", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "@GetMapping(\"/viewBoard/{board_id}\")\n public String viewBoard(@PathVariable(value = \"board_id\") String board_id,\n Model model,\n Authentication auth) {\n ResponseEntity<Board> board = boardController.getBoardById(board_id);\n\n if (board.getStatusCode().is2xxSuccessful() && board.getBody() != null) {\n // Check if board is private and requesting User is not the board owner, then raise 404\n if (board.getBody().getPrivateBoard() && (auth == null || !auth.getName().equals(board.getBody().getUserId())))\n return \"errorPages/403\";\n\n Board board_body = board.getBody();\n\n // Use the no board url as default\n if (board_body.getBoardCoverUrl() == null)\n board_body.setBoardCoverUrl(\"no-board-cover.png\");\n\n List<Post> post_list = new ArrayList<>();\n List<String> board_post_list = new ArrayList<>();\n\n if (board.getBody().getPostID() != null) {\n for (String post_id : board_body.getPostID()) {\n ResponseEntity<Post> result = postController.getPostsById(post_id);\n if (result.getStatusCode().is2xxSuccessful() && result.getBody() != null) {\n post_list.add(result.getBody());\n board_post_list.add(result.getBody().getId());\n }\n }\n board_body.setPostID(board_post_list);\n boardRepository.save(board_body);\n }\n\n model.addAttribute(\"posts\", post_list);\n model.addAttribute(\"board_data\", board_body);\n\n\n return \"boardTemplates/viewBoard\";\n }\n return \"errorPages/404\";\n }", "private Set<BoardObject> populateBoard(){\r\n\t\tSet<BoardObject> ob = new HashSet<BoardObject>();\r\n\t\tob.addAll(createCharacters());\r\n\t\tob.addAll(createWeapons());\r\n\t\treturn ob;\r\n\t}", "@Override\n\tpublic List<Object> getAllUsers() {\n\t\tList<Object> usersList = new ArrayList<Object>();\n\t\tList<TestUser> users = dao.getAll();\n\t\tSystem.out.println(dao.exists(5));\n\t\tfor(TestUser user : users){\n\t\t\tMap<String,Object> m = new HashMap<String,Object>();\n\t\t\tm.put(\"id\", user.getId());\n\t\t\tm.put(\"name\", user.getUsername());\n\t\t\tm.put(\"pwd\", user.getPassword());\n\t\t\tJSONObject j = new JSONObject(m);\n\t\t\tusersList.add(j);\n\t\t}\n\t\treturn usersList;\n\t}", "public List<GameBoard> getBoardList() {\r\n return new ArrayList<GameBoard>(this.boards);\r\n }", "@Override\n\tpublic List<?> selectBoardAdminList() {\n\t\treturn eduBbsDAO.selectBoardAdminList();\n\t}", "@Test\n void testGetAllUsers() {\n List<User> users = userData.crud.getAll();\n int currentSize = users.size();\n assertEquals(currentSize, users.size());\n logger.info(\"Got all users\");\n }", "@Test\n public void UserCharacterServer()\n {\n PlayFabServerModels.ListUsersCharactersRequest getRequest = new PlayFabServerModels.ListUsersCharactersRequest();\n getRequest.PlayFabId = playFabId;\n PlayFabResult<PlayFabServerModels.ListUsersCharactersResult> getCharsResult = PlayFabServerAPI.GetAllUsersCharacters(getRequest);\n VerifyResult(getCharsResult, true);\n }", "public Board getBoard ();", "public List<DYRepBoardDTO> dyreplist(int bno) {\n\t\tDBConn dbconn = DBConn.getDB();\n\t\tConnection conn=null;\n\t\t\n\t\tList<DYRepBoardDTO> list =null;\n\t\t\n\t\ttry {\n\t\t\tconn=dbconn.getConn();\n\t\t\tconn.setAutoCommit(false);\n\t\t\t\n\t\t\tDYBoardDAO dao = DYBoardDAO.getdao();\n\t\t\t list = dao.dyreplist(conn,bno);\n\t\t\t\n\t\t\tconn.commit();\n\t\t}catch(NamingException | SQLException e) {\n\t\t\tSystem.out.println(e);\n\t\t}finally {\n\t\t\tif(conn!=null)try {conn.close();}catch(SQLException e) {}\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "@Test\n public void testLoad() {\n List<User> result = userStore.load();\n\n assertEquals(3, result.size());\n\n assertEquals(\"Claire\", result.get(0).getUserId());\n assertEquals(\"Claire55\", result.get(0).getPassword());\n\n assertEquals(\"Todd\", result.get(1).getUserId());\n assertEquals(\"Todd34\", result.get(1).getPassword());\n }", "@Test\n public void getAllUsers() {\n IUser userOne = new User(\"UserOne\", \"password\");\n IUser userTwo = new User(\"UserTwo\", \"password\");\n channel.join(userOne);\n channel.join(userTwo);\n\n Collection<IRecognizable> users = channel.getAllUsersInfo();\n assertEquals(2,users.size());\n\n\n\n }", "Data<List<Boards>> getFollowersBoardsCursor(String cursor, Integer limit);", "Data<List<Boards>> getSearchBoardsCursor(String query, String cursor);", "@Test\r\n public void testGetAllChromInfo() throws Exception {\n assertEquals(7, queries.getAllChromInfo().size());\r\n }", "public char[][] getBoard(Connection c) {\n Statement stmt = null;\n ResultSet rs = null;\n char[][] board = new char[4][3];\n \n try {\n c.setAutoCommit(false);\n System.out.println(\"Database opened successfully\");\n \n stmt = c.createStatement();\n String sql = \"SELECT * FROM GAMEBOARD;\";\n rs = stmt.executeQuery(sql);\n if (!rs.next()) {\n return null;\n }\n int id = rs.getInt(\"PLAYER_ID\");\n int x = rs.getInt(\"COORD_X\");\n int y = rs.getInt(\"COORD_Y\");\n char type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n\n while (rs.next()) {\n id = rs.getInt(\"PLAYER_ID\");\n x = rs.getInt(\"COORD_X\");\n y = rs.getInt(\"COORD_Y\");\n type = rs.getString(\"PLAYER_TYPE\").charAt(0);\n board[x][y] = type;\n if (id == 1) {\n board[3][0] = type;\n }\n }\n } catch (Exception e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n return null;\n } finally {\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n \n System.out.println(\"Get Board Succeed.\");\n return board;\n }", "@Override\n\tpublic List<SpringBoardVO> boardSelect(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardSelect(bvo);\n\t}", "@Test\n public void destiny2GetLeaderboardsForCharacterTest() {\n Long characterId = null;\n Long destinyMembershipId = null;\n Integer membershipType = null;\n Integer maxtop = null;\n String modes = null;\n String statid = null;\n InlineResponse20048 response = api.destiny2GetLeaderboardsForCharacter(characterId, destinyMembershipId, membershipType, maxtop, modes, statid);\n\n // TODO: test validations\n }", "@DataProvider(name=\"BookData\")\n public Object[][] getData()\n {\n\n return new Object[][] {{\"once\", \"1111\"},{\"twice\",\"2222\"},{\"thrice\",\"3333\"}};\n }", "@Override\n\tpublic List<SpringBoardVO> boardPwCheck(SpringBoardVO bvo) {\n\t\treturn springBoardDAO.boardPwCheck(bvo);\n\t}", "private ArrayList<WobblyScore> getWobblyLeaderboard() {\n ArrayList<WobblyScore> wobblyScores = new ArrayList<>();\n String json = DiscordUser.getWobbliesLeaderboard(codManager.getGameId());\n if(json == null) {\n return wobblyScores;\n }\n JSONArray scores = new JSONArray(json);\n for(int i = 0; i < scores.length(); i++) {\n wobblyScores.add(WobblyScore.fromJSON(scores.getJSONObject(i), codManager));\n }\n WobblyScore.sortLeaderboard(wobblyScores, true);\n return wobblyScores;\n }", "public FloorTile[][] getBoard(){\r\n return board;\r\n }", "@Override\r\n\tpublic List<Board> getList(PageParam pageParam) {\n\t\treturn (List<Board>) mapper.getList(pageParam);\r\n\t}", "@Test\n\tpublic void testgetPlayers() {\n\t\tList<Character> characters = new ArrayList<Character>();\n\t\tcharacters.add(new Character(\"Miss Scarlet\", Color.red, new Point(7,24), \"assets/cards/character/MissScarlet.jpg\"));\n\t\tcharacters.add(new Character(\"Colonel Mustard\", Color.yellow, new Point(0,17),\"assets/cards/character/ColonelMustard.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. White\", Color.white, new Point(9,0), \"assets/cards/character/MrsWhite.jpg\"));\n\t\tcharacters.add(new Character(\"The Reverend Green\", Color.green, new Point(14,0),\"assets/cards/character/MrGreen.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. Peacock\", Color.blue, new Point(23,6), \"assets/cards/character/MrsPeacock.jpg\"));\n\t\tcharacters.add(new Character(\"Professor Plum\", Color.pink, new Point(23,19),\"assets/cards/character/ProfessorPlum.jpg\"));\n\t\tPlayer p = new Player(\"Chris\");\n\t\tcharacters.get(1).setPlayer(p);\t\t\n\t\tBoard b = new Board(characters);\n\t\tassertTrue(b.getPlayers().contains(p));\n\t\tassertTrue(b.getPlayers().size() ==1);\n\t\t\n\t}", "@Test\n public void testAddForum() {\n User user = new User();\n user.setId(USER_ID);\n user.setUserName(USER_NAME);\n user.setEmail(USER_EMAIL);\n user.setPassword(USER_PASSWORD);\n\n try {\n ForumDTO forumDTO = forumService.addForum(FORUM_TITLE, user);\n assertEquals(USER_NAME, forumDTO.getAuthor().getUsername());\n assertEquals(FORUM_TITLE, forumDTO.getTitle());\n assertTrue(forumDTO.getSubscribers().stream()\n .map(UserDTO::getUsername)\n .collect(Collectors.toSet())\n .contains(USER_NAME)\n );\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "private void list() throws JSONException, InterruptedException {\r\n\t /**Database Manager Object used to access mlab.com*/\r\n db.setDataBaseDestination(cDatabase, null, true);\r\n db.accessDatabase();\r\n MongoCollection<Document> col = db.getEntireDatabaseResults();\r\n \r\n // iterator to go through clubs in database\r\n Iterable<Document> iter;\r\n iter = col.find();\r\n \r\n // ArrayList of clubs names \r\n ArrayList<String> clubs = new ArrayList<>();\r\n \r\n // add names to list\r\n for (Document doc : iter) {\r\n JSONObject profile = new JSONObject(doc);\r\n clubs.add(profile.get(cName).toString());\r\n }\r\n \r\n Collections.sort(clubs);\r\n \r\n for (String name : clubs)\r\n \t logger.log(Level.INFO, name);\r\n \r\n displayOpen();\r\n }", "@Override\n\tpublic String GetAllBlogs() {\n\t\tSystem.out.println(\"---> SVR: get all blogs\");\n\t\tJSONObject obj = new JSONObject();\n\n\t\tDBCollection col = connect();\n\t\tDBCursor cursor = col.find();\n\t\tSystem.out.println(\"Cursor size is :\" + cursor.size());\n\t\tJSONArray jarr = new JSONArray();\n\t\tif (cursor.size() == 0) {\n\t\t\tSystem.out.println(\"No data\");\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\tjson.put(\"Error Code\", \"404\");\n\t\t\t\tjson.put(\"Error String\", \"Resource Not Found\");\n\t\t\t} catch (JSONException e) {\n\t\t\t}\n\t\t\treturn json.toString();\n\t\t} else {\n\n\t\t\twhile (cursor.hasNext()) {\n\t\t\t\tDBObject db = cursor.next();\n\n\t\t\t\ttry {\n\t\t\t\t\tobj.append(\"blogid\", db.get(\"blogid\").toString());\n\t\t\t\t\tobj.append(\"subject\", db.get(\"subject\").toString());\n\t\t\t\t\tobj.append(\"description\", db.get(\"description\").toString());\n\t\t\t\t\tobj.append(\"userid\", db.get(\"userid\").toString());\n\t\t\t\t\tobj.append(\"timestamp\", db.get(\"timestamp\").toString());\n\t\t\t\t\tSystem.out.println(\"Server get blog is \" + obj);\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\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out\n\t\t\t\t.println(\"The to string converted jarr is :\" + obj.toString());\n\t\treturn obj.toString();\n\t}", "public static void main(String args[])\n\t{\n\t\ttestConnection1 con=new testConnection1();\n\t\tcon.initializeParams();\n\t\tString loginName=\"rskinne27\";\n\t\t//String query_string=\"from UserData where loginName='rskinne27'\";\n\t\tList list=con.testQuery(loginName);\n\t\tUserData user=null;\n\t\t//UserData user=(UserData)list.get(0);\n\t\t//Users.user=user;\n\t\tfor (Iterator it = list.iterator(); it.hasNext();) {\n\t\t\tuser = (UserData) it.next();\n\t\t\tSystem.out.println(\"in UI:\"+user.getUserId());\n\t\t}\n\t\t//System.out.println(Users.user.getUserName());\n\t}", "@Override\n\tpublic List<Subscribe> boardSubList(int usid) {\n\t\treturn dao.boardSubList(session, usid);\n\t}", "@Test\r\n public void testGetUserHobbies()\r\n {\r\n System.out.println(\"getUserHobbies\");\r\n String occupation = \"Doctor\";\r\n String[] hobbies = {\"Reading\", \"Cooking\"};\r\n int id = 5;\r\n LifeStyleBean instance = new LifeStyleBean(occupation, hobbies, id);\r\n String[] expResult = {\"Reading\", \"Cooking\"};\r\n String[] result = instance.getUserHobbies();\r\n assertArrayEquals(expResult, result);\r\n }", "@Test\n\tvoid testAllUsersDataPresent() {\n\t\tassertNotNull(allUserList);\n\t\tassertTrue(allUserList.size() == 1000);\n\t}", "@Test\n public void getBestTest() throws Exception{\n String json;\n List<Integer> res;\n int N = ((Double)(rand.nextDouble()*4+2)).intValue()*2;\n for (int i=0;i<N;i++) {\n TestRegister(\"Test user \"+i);\n }\n res=lbDao.getAll();\n assertEquals(N,res.size());\n json=lbDao.getN(N);\n LeaderBoardRecord[] reslb=gson.fromJson(json, LeaderBoardRecord[].class);\n assertEquals(reslb.length,N);\n json=lbDao.getN(N/2);\n reslb=gson.fromJson(json, LeaderBoardRecord[].class);\n assertEquals(reslb.length,N/2);\n json=TestGetN();\n reslb=gson.fromJson(json, LeaderBoardRecord[].class);\n assertEquals(reslb.length,3);\n }", "@Test\n public void testGetForumByID() {\n try {\n ForumDTO forumDTO = forumService.getForumWithID(FORUM_ID);\n assertEquals(FORUM_ID, forumDTO.getId());\n assertEquals(USER_NAME, forumDTO.getAuthor().getUsername());\n assertEquals(FORUM_TITLE, forumDTO.getTitle());\n } catch (Exception e) {\n fail(e.getMessage());\n }\n }", "@Test\r\n void getAllUsers() throws IOException {\r\n }", "public int[][] getBoard();", "public List<Board> getCommentList(String boardUpper) throws SQLException {\n\t\treturn dao.getCommentList(boardUpper);\n\t}", "@Override\n\tpublic List<Map> boardHistoryList(int cPage, int numPerPage, int usid) {\n\t\treturn dao.boardHistoryList(session, cPage, numPerPage, usid);\n\t}", "@Test\n public void listAll_200() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n List<Workflow> wfList = new ArrayList<>();\n wfList.add(addMOToDb(1));\n wfList.add(addMOToDb(2));\n wfList.add(addMOToDb(3));\n\n // PREPARE THE TEST\n // Fill in the workflow db\n\n // DO THE TEST\n Response response = callAPI(VERB.GET, \"/mo/\", null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(200, status);\n\n List<Workflow> readWorkflowList = response.readEntity(new GenericType<List<Workflow>>() {\n });\n assertEquals(wfList.size(), readWorkflowList.size());\n for (int i = 0; i < wfList.size(); i++) {\n assertEquals(wfList.get(i).getId(), readWorkflowList.get(i).getId());\n assertEquals(wfList.get(i).getName(), readWorkflowList.get(i).getName());\n assertEquals(wfList.get(i).getDescription(), readWorkflowList.get(i).getDescription());\n }\n\n\n }", "@DataProvider\n\tpublic Object[][] getData()\n\t{\n\t\tObject[][] data = new Object[3][2];\n\t\t\n\t\t//1st set\n\t\tdata[0][0] = \"firstsetusername\";\n\t\tdata[0][1] = \"firstpassword\";\n\t\t//couloumns in the row are nothing but values for that particualar combination(row)\n\t\t\n\t\t//2nd set\n\t\tdata[1][0] = \"secondsetisername\";\n\t\tdata[1][1] = \"second password\";\n\t\t\n\t\t//3rd set\n\t\tdata[2][0] = \"thirdsetusername\";\n\t\tdata[2][1] = \"thirdpassword\";\n\t\treturn data;\n\t\t\n\t}", "@Override\r\n\tpublic void loadData() {\r\n\t\t// Get Session\r\n\r\n\t\tSession ses = HibernateUtil.getSession();\r\n\r\n\t\tQuery query = ses.createQuery(\"FROM User\");\r\n\r\n\t\tList<User> list = null;\r\n\t\tSet<PhoneNumber> phone = null;\r\n\t\tlist = query.list();\r\n\t\tfor (User u : list) {\r\n\t\t\tSystem.out.println(\"Users are \" + u);\r\n\t\t\t// Getting phones for for a particular user Id\r\n\t\t\tphone = u.getPhone();\r\n\t\t\tfor (PhoneNumber ph : phone) {\r\n\t\t\t\tSystem.out.println(\"Phones \" + ph);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "List<OfUserWechat> selectByExample(OfUserWechatExample example);", "protected List<Map<String, Object>> show() {\n List<Map<String, Object>> output = new ArrayList<>();\n try {\n ResultSet rs;\n try (PreparedStatement stmt = DBConnect.getConnection()\n .prepareStatement(String.format(\"SELECT * FROM %s WHERE userID = ?\", table))) {\n stmt.setLong(1, userId);\n rs = stmt.executeQuery();\n }\n output = DBConnect.resultsList(rs);\n rs.close();\n DBConnect.close();\n } catch (SQLException e) {\n Logger.getLogger(DBConnect.class.getName()).log(Level.SEVERE, \"Failed select\", e);\n }\n return output;\n }", "List<FeedsUsersKey> selectByExample(FeedsUsersExample example);", "@Override\n\tpublic List<Map> boardNewList() {\n\t\treturn dao.boardNewList(session);\n\t}" ]
[ "0.7013099", "0.68497324", "0.6623296", "0.6359169", "0.63432", "0.6101799", "0.5997645", "0.5982773", "0.5854296", "0.5842112", "0.5809053", "0.57918507", "0.5785544", "0.5764325", "0.5745718", "0.57040495", "0.57039285", "0.57011837", "0.5610889", "0.5591923", "0.5591048", "0.55771405", "0.557682", "0.55643296", "0.5563708", "0.5530879", "0.55217516", "0.54893625", "0.54893625", "0.5479371", "0.545043", "0.54443735", "0.5419516", "0.537872", "0.5364375", "0.53614444", "0.5360614", "0.5290764", "0.52787024", "0.5276077", "0.5268396", "0.5248863", "0.52477753", "0.5245639", "0.52419835", "0.52304006", "0.521978", "0.5205732", "0.5197972", "0.5187474", "0.5180777", "0.5174231", "0.5168973", "0.51555", "0.5150862", "0.5136838", "0.513295", "0.5128698", "0.5120682", "0.5118717", "0.5116729", "0.5114237", "0.51084816", "0.51040834", "0.5103395", "0.5094047", "0.5092278", "0.50921893", "0.50901884", "0.50827765", "0.50808907", "0.5078055", "0.50743103", "0.50741684", "0.5055121", "0.5054335", "0.5045972", "0.5044909", "0.5044174", "0.5035826", "0.5032546", "0.50310427", "0.50282717", "0.50279677", "0.50266135", "0.50206286", "0.5019556", "0.5014526", "0.5013986", "0.50097", "0.5008342", "0.5004101", "0.49909016", "0.49855512", "0.49780905", "0.497545", "0.4972609", "0.49721357", "0.49703258", "0.49693245", "0.4968843" ]
0.0
-1
/ createFoundation when campus is not null, we create outline for that campus, alpha, num combination only.
public static void createFoundation(String campus,String kix) throws Exception { createFoundation(campus,"",kix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Campus create(long campusId);", "public static void createFoundation(String campus,String user,String kix) throws Exception {\n\nboolean debug = true;\n\n\t\tboolean compressed = true;\n\n\t\tFileWriter fstream = null;\n\t\tBufferedWriter output = null;\n\n Connection conn = null;\n\n\t\tString type = \"PRE\";\n\t\tString sql = \"\";\n\t\tString documents = \"\";\n\t\tString fileName = \"\";\n\n\t\tString alpha = \"\";\n\t\tString num = \"\";\n\t\tString courseTitle = \"\";\n\t\tString fndType = \"\";\n\n\t\tint rowsAffected = 0;\n\n\t\tPreparedStatement ps = null;\n\n\t\tboolean htmlCreated = false;\n\n\t\tString currentDrive = AseUtil.getCurrentDrive();\n\n\t\ttry {\n\t\t\tconn = AsePool.createLongConnection();\n\n\t\t\tif (conn != null){\n\n\t\t\t\tString[] info = getKixInfo(conn,kix);\n\t\t\t\talpha = info[Constant.KIX_ALPHA];\n\t\t\t\tnum = info[Constant.KIX_NUM];\n\t\t\t\tcourseTitle = info[Constant.KIX_COURSETITLE];\n\t\t\t\tfndType = info[Constant.KIX_ROUTE];\n\t\t\t\ttype = info[Constant.KIX_TYPE];\n\n\t\t\t\tinfo = Helper.getKixRoute(conn,campus,alpha,num,\"CUR\");\n\t\t\t\tString courseKix = info[0];\n\n\t\t\t\tint id = NumericUtil.getInt(getFndItem(conn,kix,\"id\"),0);\n\n\t\t\t\tif (debug) {\n\t\t\t\t\tlogger.info(\"campus: \" + campus);\n\t\t\t\t\tlogger.info(\"kix: \" + kix);\n\t\t\t\t\tlogger.info(\"alpha: \" + alpha);\n\t\t\t\t\tlogger.info(\"num: \" + num);\n\t\t\t\t\tlogger.info(\"courseTitle: \" + courseTitle);\n\t\t\t\t\tlogger.info(\"fndType: \" + fndType);\n\t\t\t\t\tlogger.info(\"type: \" + type);\n\t\t\t\t}\n\n\t\t\t\tString htmlHeader = Util.getResourceString(\"fndheader.ase\");\n\t\t\t\tString htmlFooter = Util.getResourceString(\"fndfooter.ase\");\n\t\t\t\tif (debug) logger.info(\"resource HTML\");\n\n\t\t\t\tdocuments = SysDB.getSys(conn,\"documents\");\n\t\t\t\tif (debug) logger.info(\"obtained document folder\");\n\n\t\t\t\ttry {\n\t\t\t\t\tfileName = currentDrive\n\t\t\t\t\t\t\t\t\t+ \":\"\n\t\t\t\t\t\t\t\t\t+ documents\n\t\t\t\t\t\t\t\t\t+ \"fnd\\\\\"\n\t\t\t\t\t\t\t\t\t+ campus\n\t\t\t\t\t\t\t\t\t+ \"\\\\\"\n\t\t\t\t\t\t\t\t\t+ kix\n\t\t\t\t\t\t\t\t\t+ \".html\";\n\n\t\t\t\t\tif (debug) logger.info(fileName);\n\n\t\t\t\t\tfstream = new FileWriter(fileName);\n\n\t\t\t\t\toutput = new BufferedWriter(fstream);\n\n\t\t\t\t\toutput.write(htmlHeader);\n\n\t\t\t\t\thtmlCreated = false;\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString junk = viewFoundation(conn,kix);\n\n\t\t\t\t\t\tif(CompDB.hasSLOs(conn,courseKix)){\n\t\t\t\t\t\t\tjunk += \"<hr size=\\\"1\\\" noshade=\\\"\\\"><br/><br/>\" + getLinkedItems(conn,campus,user,id,kix,Constant.COURSE_OBJECTIVES,true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tjunk = junk.replace(\"<br>\",\"<br/>\");\n\n\t\t\t\t\t\toutput.write(junk);\n\n\t\t\t\t\t\tHtml.updateHtml(conn,Constant.FOUNDATION,kix);\n\n\t\t\t\t\t\thtmlCreated = true;\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tlogger.fatal(\"FndDB.createFoundation - fail to create foundation - \"\n\t\t\t\t\t\t\t+ campus + \" - \" + kix + \"\\n\" + e.toString());\n\t\t\t\t\t}\n\n\t\t\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\t\t\tString copyRight = \"\" + calendar.get(Calendar.YEAR);\n\n\t\t\t\t\thtmlFooter = htmlFooter.replace(\"[FOOTER_COPYRIGHT]\",\"Copyright ©1999-\"+copyRight+\" All rights reserved.\")\n\t\t\t\t\t\t\t\t.replace(\"[FOOTER_STATUS_DATE]\",footerStatus(conn,kix,type));\n\n\t\t\t\t\tif (debug) logger.info(\"obtained document folder\");\n\n\t\t\t\t\toutput.write(htmlFooter);\n\n\t\t\t\t\tif (debug) logger.info(\"HTML created\");\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tlogger.fatal(\"FndDB.createFoundation - fail to open/create file - \"\n\t\t\t\t\t\t\t+ campus + \" - \" + kix + \" - \" + \"\\n\" + e.toString());\n\t\t\t\t} finally {\n\t\t\t\t\toutput.close();\n\t\t\t\t}\n\n\t\t\t\tconn.close();\n\t\t\t\tconn = null;\n\n\t\t\t\tif (debug) logger.info(\"connection closed\");\n\n\t\t\t} // if conn != null\n\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"FndDB.createFoundation FAILED3 - \"\n\t\t\t\t\t+ campus + \" - \" + kix + \" - \" + \"\\n\" + e.toString());\n\t\t}\n\t\tfinally{\n\t\t\ttry{\n\t\t\t\tif (conn != null){\n\t\t\t\t\tconn.close();\n\t\t\t\t\tconn = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tlogger.fatal(\"FndDB.createFoundation\\n\" + kix + \"\\n\" + e.toString());\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "public void setHandlingCampus(CampusId campus) ;", "@Override\n\tpublic void addCampus(Campus campus) {\n\t\tEntityManager em=emf.createEntityManager();\n\t\tem.getTransaction().begin();\n\t\ttry {\n\t\t\tem.persist(campus);\n\t\t\tem.getTransaction().commit();\n\t\t\t\n\t\t} finally {\n\t\t\t// TODO: handle finally claus\n\t\t\tif (em.getTransaction().isActive()) {\n\t\t\t\tem.getTransaction().rollback();\n\t\t\t}\n\t\t}\n\t\t\n\t\tem.close();\n\t}", "public CashDrawer getByCampusCode(String campusCode);", "public void setCampus(CampusEbo campus) {\n this.campus = campus;\n }", "public void setCampusCode(String campusCode) {\n this.campusCode = campusCode;\n }", "public CashDrawer openCashDrawer(String campusCode, String documentId);", "private void createCNSHIsFull() {\r\n createStudentList(new Student(\"Vasile Ana\", 10), new Student(\"Marin Alina\", 6), new Student(\"Ilie David\", 8), new Student(\"Gheorghe Alex\", 9));\r\n createSchoolList(new School(\"C.N.S.H.\", 0), new School(\"C.N.C.H.\", 8), new School(\"C.N.A.E.\", 10));\r\n createStudentPreferences(new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1])), new LinkedList<>(Arrays.asList(schools[0], schools[2])));\r\n createSchoolPreferences(new LinkedList<>(Arrays.asList(students[0], students[1], students[2], students[3])), new LinkedList<>(Arrays.asList(students[0], students[1], students[2])), new LinkedList<>(Arrays.asList(students[1], students[3], students[0])));\r\n }", "private void createCNAEIsNotFull() {\r\n createStudentList(new Student(\"Vasile Ana\", 10), new Student(\"Marin Alina\", 6), new Student(\"Ilie David\", 8), new Student(\"Gheorghe Alex\", 9));\r\n createSchoolList(new School(\"C.N.S.H.\", 0), new School(\"C.N.C.H.\", 0), new School(\"C.N.A.E.\", 10));\r\n createStudentPreferences(new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1])), new LinkedList<>(Arrays.asList(schools[0], schools[2])));\r\n createSchoolPreferences(new LinkedList<>(Arrays.asList(students[3], students[0], students[1], students[2])), new LinkedList<>(Arrays.asList(students[0], students[2], students[1])), new LinkedList<>(Arrays.asList(students[0], students[1], students[3])));\r\n }", "private void createCNSHIsFullCNCHHasOnlyOnePlace() {\r\n createStudentList(new Student(\"Vasile Ana\", 10), new Student(\"Marin Alina\", 6), new Student(\"Ilie David\", 8), new Student(\"Gheorghe Alex\", 9));\r\n createSchoolList(new School(\"C.N.S.H.\", 0), new School(\"C.N.C.H.\", 1), new School(\"C.N.A.E.\", 10));\r\n createStudentPreferences(new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1], schools[2])), new LinkedList<>(Arrays.asList(schools[0], schools[1])), new LinkedList<>(Arrays.asList(schools[0], schools[2])));\r\n createSchoolPreferences(new LinkedList<>(Arrays.asList(students[3], students[0], students[1], students[2])), new LinkedList<>(Arrays.asList(students[0], students[2], students[1])), new LinkedList<>(Arrays.asList(students[0], students[1], students[3])));\r\n }", "public static Composition createComposition(Patient patient, Practitioner practitioner, String date,\n ArrayList<Immunization> ArrayListYellowFever,\n ArrayList<Immunization> ArrayListStandardVaccinations,\n ArrayList<Immunization> ArrayListOtherVaccinations,\n ArrayList<Immunization> ArrayListInfluenza,\n ArrayList<Immunization> ArrayListTuberculosis,\n ArrayList<Observation> ArrayListTuberculinTests,\n ArrayList<Observation> ArrayListAntibodyAssays,\n ArrayList<Observation> ArrayListHepatitisB,\n ArrayList<Observation> ArrayListRubella,\n ArrayList<Immunization> ArrayListPassiveImmunizations,\n ArrayList<Immunization> ArrayListSerumInjection,\n ArrayList<Condition> ArrayListCondition,\n ArrayList<Observation> ArrayListBlood){\n // Create a new Composition object\n Composition composition = new Composition();\n\n // Set Identifier of the composition object\n composition.setIdentifier(new Identifier()\n .setSystem(\"http://www.kh-uzl.de/fhir/composition\")\n .setValue(UUID.randomUUID().toString()));\n\n // Set status of composition\n composition.setStatus(Composition.CompositionStatus.FINAL);\n\n // Set kind of composition\n composition.setType(new CodeableConcept()\n .addCoding(new Coding()\n .setCode(\"11369-6\")\n .setSystem(\"http://loinc.org\")\n .setDisplay(\"History of Immunization Narrative\")));\n\n // Set reference to a patient, all the data in the composition belongs to\n composition.setSubject(new Reference()\n .setIdentifier(patient.getIdentifierFirstRep())\n .setReference(patient.fhirType() + \"/\" + patient.getId()));\n\n // Set composition editing time\n composition.setDateElement(new DateTimeType(date));\n\n // Set author of the composition\n composition.addAuthor(new Reference()\n .setIdentifier(practitioner.getIdentifierFirstRep())\n .setReference(practitioner.fhirType() + \"/\" + practitioner.getId()));\n\n // Set title of the composition\n composition.setTitle(\"Internationale Bescheinigungen über Impfungen und Impfbuch\");\n\n\n // Section for the owner of the certificate of vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Impfausweisinhaber\")\n .addEntry(new Reference()\n .setIdentifier(patient.getIdentifierFirstRep())\n .setReference(patient.fhirType() + \"/\" + patient.getId())));\n\n\n // Section for yellow fever\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Gelbfieber\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Internationale Bescheinigung über Impfung oder Wiederimpfung gegen Gelbfieber\"))));\n\n for(int i = 0; i < ArrayListYellowFever.size(); i++){\n composition.getSection().get(1).addEntry(new Reference()\n .setIdentifier(ArrayListYellowFever.get(i).getIdentifierFirstRep())\n .setReference(ArrayListYellowFever.get(i).fhirType() + \"/\" + ArrayListYellowFever.get(i).getId()));\n }\n\n\n // Section for standard vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Standardimpfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Bescheinigung über Satndardimpfungen\"))));\n\n for(int i = 0; i < ArrayListStandardVaccinations.size(); i++){\n composition.getSection().get(2).addEntry(new Reference()\n .setIdentifier(ArrayListStandardVaccinations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListStandardVaccinations.get(i).fhirType() + \"/\" + ArrayListStandardVaccinations.get(i).getId()));\n }\n\n\n // Section for other vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Sonstige Schutzimpfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Sonstige Schutzimpfungen, z.B. gegen Cholera, FSME, Hepatits A, Meningokokken, Pneumokokken, Typhus, Varizellen\"))));\n\n for(int i = 0; i < ArrayListOtherVaccinations.size(); i++){\n composition.getSection().get(3).addEntry(new Reference()\n .setIdentifier(ArrayListOtherVaccinations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListOtherVaccinations.get(i).fhirType() + \"/\" + ArrayListOtherVaccinations.get(i).getId()));\n }\n\n\n // Section for vaccinations against influenza\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Schutzimpfungen gegen Influenza\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Schutzimpfungen gegen Influenza (Virusgrippe)\"))));\n\n for(int i = 0; i < ArrayListInfluenza.size(); i++){\n composition.getSection().get(4).addEntry(new Reference()\n .setIdentifier(ArrayListInfluenza.get(i).getIdentifierFirstRep())\n .setReference(ArrayListInfluenza.get(i).fhirType() + \"/\" + ArrayListInfluenza.get(i).getId()));\n }\n\n\n // Section for vaccinations against tuberculosis\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Bescheinigung über Tuberkulose-Schutzimpfungen (BCG)\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Bescheinigung über Tuberkulose-Schutzimpfungen (BCG)\"))));\n\n for(int i = 0; i < ArrayListTuberculosis.size(); i++){\n composition.getSection().get(5).addEntry(new Reference()\n .setIdentifier(ArrayListTuberculosis.get(i).getIdentifierFirstRep())\n .setReference(ArrayListTuberculosis.get(i).fhirType() + \"/\" + ArrayListTuberculosis.get(i).getId()));\n }\n\n\n // Section for Tuberculin-tests\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ergebnis von Tuberkulinproben\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ergebnis von Tuberkulinproben\"))));\n\n for(int i = 0; i < ArrayListTuberculinTests.size(); i++){\n composition.getSection().get(6).addEntry(new Reference()\n .setIdentifier(ArrayListTuberculinTests.get(i).getIdentifierFirstRep())\n .setReference(ArrayListTuberculinTests.get(i).fhirType() + \"/\" + ArrayListTuberculinTests.get(i).getId()));\n }\n\n\n // Section for antibody assays\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ergebnisse von Antikörperuntersuchungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ergebnisse von Antikörperuntersuchungen, z.B. Tatanus, Virushepatitis A u. a.\"))));\n\n for(int i = 0; i < ArrayListAntibodyAssays.size(); i++){\n composition.getSection().get(7).addEntry(new Reference()\n .setIdentifier(ArrayListAntibodyAssays.get(i).getIdentifierFirstRep())\n .setReference(ArrayListAntibodyAssays.get(i).fhirType() + \"/\" + ArrayListAntibodyAssays.get(i).getId()));\n }\n\n\n // Section for Hepatitis B\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Virushepatitis B\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Virushepatitis B: Ergebnis von Antikörper-Untersuchungen (Anti-HBs)\"))));\n\n for(int i = 0; i < ArrayListHepatitisB.size(); i++){\n composition.getSection().get(8).addEntry(new Reference()\n .setIdentifier(ArrayListHepatitisB.get(i).getIdentifierFirstRep())\n .setReference(ArrayListHepatitisB.get(i).fhirType() + \"/\" + ArrayListHepatitisB.get(i).getId()));\n }\n\n\n // Section for Rubella antibody assays\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Röteln-Antikörper-Bestimmungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Röteln-Antikörper-Bestimmungen\"))));\n\n for(int i = 0; i < ArrayListRubella.size(); i++){\n composition.getSection().get(9).addEntry(new Reference()\n .setIdentifier(ArrayListRubella.get(i).getIdentifierFirstRep())\n .setReference(ArrayListRubella.get(i).fhirType() + \"/\" + ArrayListRubella.get(i).getId()));\n }\n\n\n // Section for Passive immunizations with human immunoglobulins\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Passive Immunisierungen mit humanen Immunoglobulinen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Passive Immunisierungen mit humanen Immunoglobulinen (z.B Standard-Immunoglobulin, Tetanus- oder andere spezielle Immunoglobuline)\"))));\n\n for(int i = 0; i < ArrayListPassiveImmunizations.size(); i++){\n composition.getSection().get(10).addEntry(new Reference()\n .setIdentifier(ArrayListPassiveImmunizations.get(i).getIdentifierFirstRep())\n .setReference(ArrayListPassiveImmunizations.get(i).fhirType() + \"/\" + ArrayListPassiveImmunizations.get(i).getId()));\n }\n\n\n // Section for serum injections\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Serum-Injektion\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Serum-Injektion: Heterologe Sera (z.B. vom Pferd)\"))));\n\n for(int i = 0; i < ArrayListSerumInjection.size(); i++){\n composition.getSection().get(11).addEntry(new Reference()\n .setIdentifier(ArrayListSerumInjection.get(i).getIdentifierFirstRep())\n .setReference(ArrayListSerumInjection.get(i).fhirType() + \"/\" + ArrayListSerumInjection.get(i).getId()));\n }\n\n\n // Section for medical comments on risk factors concerning vaccinations\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Ärztliche Vermerke über medizinische Risikofaktoren bei Impfungen\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Ärztliche Vermerke über medizinische Risikofaktoren bei Impfungen\"))));\n\n for(int i = 0; i < ArrayListCondition.size(); i++){\n composition.getSection().get(12).addEntry(new Reference()\n .setIdentifier(ArrayListCondition.get(i).getIdentifierFirstRep())\n .setReference(ArrayListCondition.get(i).fhirType() + \"/\" + ArrayListCondition.get(i).getId()));\n }\n\n\n // Section for blood group and rhesus factor\n composition.addSection(new Composition.SectionComponent()\n .setTitle(\"Blutgruppe und Rh-Faktor\")\n .setText(new Narrative()\n .setStatus(Narrative.NarrativeStatus.ADDITIONAL)\n .setDiv(new XhtmlNode().setValue(\"Blutgruppe und Rh-Faktor\"))));\n\n for(int i = 0; i < ArrayListBlood.size(); i++){\n composition.getSection().get(13).addEntry(new Reference()\n .setIdentifier(ArrayListBlood.get(i).getIdentifierFirstRep())\n .setReference(ArrayListBlood.get(i).fhirType() + \"/\" + ArrayListBlood.get(i).getId()));\n }\n\n\n return composition;\n }", "public static void updateFndOutline(Connection conn,String kix,String campus,String alpha,String num,String type) throws SQLException {\n\n\t\t//Logger logger = Logger.getLogger(\"test\");\n\n\t\ttry {\n\n\t\t\tboolean debug = false;\n\n\t\t\tif(debug){\n\t\t\t\tlogger.info(\"kix: \" + kix);\n\t\t\t\tlogger.info(\"campus: \" + campus);\n\t\t\t\tlogger.info(\"alpha: \" + alpha+ \"<br>\");\n\t\t\t\tlogger.info(\"num: \" + num);\n\t\t\t\tlogger.info(\"type: \" + type);\n\t\t\t}\n\n\t\t\tString sql = \"UPDATE tblfndoutlines SET \" + campus + \"=? \"\n\t\t\t\t\t\t+ \"WHERE category=? AND coursealpha=? AND coursenum=? AND coursetype=? \";\n\n\t\t\tif(debug) logger.info(\"sql: \" + sql);\n\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\n\t\t\tps.setString(1,kix);\n\t\t\tps.setString(2,\"Outline\");\n\t\t\tps.setString(3,alpha);\n\t\t\tps.setString(4,num);\n\t\t\tps.setString(5,type);\n\t\t\tint rowsAffected = ps.executeUpdate();\n\n\t\t\tif(debug) logger.info(\"rowsAffected: \" + rowsAffected);\n\n\t\t\t// if == 0, row does not exist for update. add new row\n\t\t\tif (rowsAffected == 0){\n\t\t\t\tsql = \"INSERT INTO tblfndoutlines \"\n\t\t\t\t\t+ \"(category,coursealpha,coursenum,coursetype,\"+campus+\") \"\n\t\t\t\t\t+ \"VALUES('Outline',?,?,?,?)\";\n\n\t\t\t\tif(debug) logger.info(\"sql: \" + sql);\n\n\t\t\t\tps = conn.prepareStatement(sql);\n\t\t\t\tps.setString(1,alpha);\n\t\t\t\tps.setString(2,num);\n\t\t\t\tps.setString(3,type);\n\t\t\t\tps.setString(4,kix);\n\t\t\t\trowsAffected = ps.executeUpdate();\n\t\t\t}\n\n\t\t\tps.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tlogger.fatal(\"FndDB.updateFndOutline - \" + e.toString());\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"FndDB.updateFndOutline - \" + e.toString());\n\t\t}\n\n\t\treturn;\n\t}", "public static void test1() {\n int n1 = 100, n2 = 100, n3 = 100;\n float v = 1.0f, d = 20.0f;\n float[][][] paint = new float[n3][n2][n1];\n /*\n for (int i3=0; i3<n3; ++i3) {\n for (int i2=0; i2<n2; ++i2) {\n for (int i1=0; i1<n1; ++i1) {\n if (i3<n3/2) cae.paint[i3][i2][i1] = 1.0f;\n }\n }\n }\n */\n Painting3Group p3g = new Painting3Group(paint);\n SphereBrush pb = new SphereBrush();\n Painting3 p3 = p3g.getPainting3();\n// p3.paintAt(50,60,50,v,d,pb);\n// p3.paintAt(50,50,50,v,d,pb);\n// p3.paintAt(50,50,50,v,d,pb);\n p3.paintAt(50,50,50,v,d,pb);\n Contour c = p3.getContour(v);\n\n SimpleFrame sf = new SimpleFrame();\n sf.setTitle(\"Formation\");\n World world = sf.getWorld();\n TriangleGroup tg = new TriangleGroup(c.i,c.x);\n world.addChild(tg);\n sf.setSize(1250,900);\n }", "@Override\n\tpublic Campus create(long campusId) {\n\t\tCampus campus = new CampusImpl();\n\n\t\tcampus.setNew(true);\n\t\tcampus.setPrimaryKey(campusId);\n\n\t\treturn campus;\n\t}", "public CampusId getHandlingCampus();", "private void createFacilities(LocationManagement client,\n String siteGUID,\n String userId) throws FVTUnexpectedCondition\n {\n final String activityName = \"createFacilities\";\n\n FixedLocationProperties fixedLocationProperties = new FixedLocationProperties();\n fixedLocationProperties.setTimeZone(\"GMT\");\n\n LocationProperties locationProperties;\n \n try\n {\n Map<String, String> additionalProperties = new HashMap<>();\n additionalProperties.put(facility1AdditionalPropertyName, facility1AdditionalPropertyValue);\n\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility1Name);\n locationProperties.setIdentifier(facility1Identifier);\n locationProperties.setDisplayName(facility1DisplayName);\n locationProperties.setDescription(facility1Description);\n locationProperties.setAdditionalProperties(additionalProperties);\n \n String facility1GUID = client.createLocation(userId, null, null, locationProperties);\n\n if (facility1GUID == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no GUID for Create of definition 1)\");\n }\n\n client.setLocationAsFixedPhysical(userId, null, null, facility1GUID, fixedLocationProperties);\n client.setupNestedLocation(userId, null, null, siteGUID, facility1GUID, null);\n \n LocationElement retrievedElement = client.getLocationByGUID(userId, facility1GUID);\n LocationProperties retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from Retrieve)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Retrieve of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Retrieve of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Retrieve of 1)\");\n }\n if (retrievedProperties.getAdditionalProperties() == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(null additionalProperties from Retrieve of 1)\");\n }\n else if (! facility1AdditionalPropertyValue.equals(retrievedProperties.getAdditionalProperties().get(facility1AdditionalPropertyName)))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(bad additionalProperties from Retrieve of 1)\");\n }\n\n List<LocationElement> facilityList = client.getLocationsByName(userId, facility1Name, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility for RetrieveByName of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty facility list for RetrieveByName of 1)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Facility list for RetrieveByName of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no Facility 1 from Retrieve)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Facility 1 RetrieveByName of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Facility 1 RetrieveByName of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Facility 1 RetrieveByName of 1)\");\n }\n \n facilityList = client.findLocations(userId, searchString, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for findLocations of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for findLocations of 1)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for findLocations of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of 1)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of 1)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n else\n {\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n }\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from RetrieveOfMembers)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveOfMembers of 1)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveOfMembers of 1)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveOfMembers of 1)\");\n }\n\n /*\n * Check that not possible to create an element with the same qualified name.\n */\n try\n {\n client.createLocation(userId, null, null, locationProperties);\n\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(duplicate create of facility allowed)\");\n }\n catch (InvalidParameterException okResult)\n {\n // nothing to do\n }\n\n /*\n * Now do the second value\n */\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility2Name);\n locationProperties.setIdentifier(facility2Identifier);\n locationProperties.setDisplayName(facility2DisplayName);\n locationProperties.setDescription(facility2Description);\n locationProperties.setAdditionalProperties(additionalProperties);\n String facility2GUID = client.createLocation(userId, null, null, locationProperties);\n\n if (facility2GUID == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no GUID for Create of definition 2)\");\n }\n\n client.setupNestedLocation(userId, null, null, siteGUID, facility2GUID, new NestedLocationProperties());\n\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 2 from Retrieve)\");\n }\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from Retrieve of 2)\");\n }\n if (! facility2DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from Retrieve of 2)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from Retrieve of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from Retrieve of 2)\");\n }\n\n facilityList = client.getLocationsByName(userId, facility2Name, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for RetrieveByName of 2)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for RetrieveByName of 2)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for RetrieveByName of 2 contains\" + facilityList.size() +\n \" elements)\");\n }\n\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveByName of 2)\");\n }\n if (! facility2DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveByName of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveByName of 2)\");\n }\n\n facilityList = client.findLocations(userId, searchString, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for findLocations of all)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for findLocations of all)\");\n }\n else if (facilityList.size() != 3)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for findLocations of all contains\" + facilityList.size() +\n \" elements)\");\n }\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of both)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of both)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations of both contains\" + facilityList.size() +\n \" elements)\");\n }\n\n /*\n * Add the new name\n */\n locationProperties = new LocationProperties();\n locationProperties.setDisplayName(facility2NameUpdate);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveUpdate of 2)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2)\");\n }\n\n /*\n * Update location 2 with location 1's qualified name - this should fail\n */\n try\n {\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility1Name);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Duplicate update allowed)\");\n }\n catch (InvalidParameterException expectedResult)\n {\n // all ok\n }\n\n /*\n * Location 2 should be exactly as it was\n */\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName \" + retrievedProperties.getDisplayName() + \" from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2 after qualified name failed change)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2)\");\n }\n\n /*\n * Update location 2 with a new qualified name - this should work ok\n */\n locationProperties = new LocationProperties();\n locationProperties.setQualifiedName(facility2NameUpdate);\n client.updateLocation(userId, null, null, facility2GUID, true, locationProperties);\n\n\n /*\n * Location 2 should be updated\n */\n retrievedElement = client.getLocationByGUID(userId, facility2GUID);\n retrievedProperties = retrievedElement.getLocationProperties();\n\n if (! facility2NameUpdate.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2NameUpdate.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveUpdate of 2 after qualified name change)\");\n }\n if (! facility2Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveUpdate of 2 after qualified name change)\");\n }\n\n /*\n * By detaching definition 2, then should only get value 1 back from the set membership request.\n */\n client.clearNestedLocation(userId, null, null, siteGUID, facility2GUID);\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for getNestedLocations of 1 after detach)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for getNestedLocations of 1 after detach)\");\n }\n else if (facilityList.size() != 1)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for getNestedLocations after detach of 1 contains\" + facilityList.size() +\n \" elements)\");\n }\n else\n {\n retrievedElement = facilityList.get(0);\n retrievedProperties = retrievedElement.getLocationProperties();\n }\n\n if (retrievedProperties == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no facility 1 from RetrieveOfMembers of 1 after detach)\");\n }\n\n if (! facility1Name.equals(retrievedProperties.getQualifiedName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad qualifiedName from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1DisplayName.equals(retrievedProperties.getDisplayName()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad displayName from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1Description.equals(retrievedProperties.getDescription()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad description from RetrieveOfMembers of 1 after detach)\");\n }\n if (! facility1Identifier.equals(retrievedProperties.getIdentifier()))\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Bad identifier from RetrieveOfMembers of 1 after detach)\");\n }\n \n /*\n * Now reattach value 2 and check it reappears in the set.\n */\n client.setupNestedLocation(userId, null, null, siteGUID, facility2GUID, null);\n\n facilityList = client.getNestedLocations(userId, siteGUID, 0, maxPageSize);\n\n if (facilityList == null)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(no location for RetrieveSetMembers of both after reattach)\");\n }\n else if (facilityList.isEmpty())\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName + \"(Empty location list for RetrieveSetMembers of of both after reattach)\");\n }\n else if (facilityList.size() != 2)\n {\n throw new FVTUnexpectedCondition(testCaseName,\n activityName + \"(Locations for RetrieveSetMembers of both after reattach contains\" + facilityList.size() +\n \" elements)\");\n }\n }\n catch (FVTUnexpectedCondition testCaseError)\n {\n throw testCaseError;\n }\n catch (Exception unexpectedError)\n {\n throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError);\n }\n }", "public void buildSectionOne(Document document) throws DocumentException, IOException, JSONException {\n PdfPTable titleTable = new PdfPTable ( 1 );\n titleTable.setWidthPercentage ( 100 );\n\n // Strategy\n titleTable.addCell ( ReportTemplate.getSectionHeaderCell ( \"Featured Strategy: \" + selectedStrategy ) );\n\n /**\n * @changed - Abhishek\n * @date - 11-02-2016\n * @desc - Applied format of $xxx,xxx\n */\n // Estimate Income\n titleTable.addCell ( ReportTemplate.getSectionSubHeaderCellWithBoxBorder ( \"Estimated Income: $\" + estimatedIncome ) );\n\n document.add ( titleTable );\n\n // Add Charts Now\n PdfPTable contentTable = new PdfPTable ( 2 );\n contentTable.setWidthPercentage ( 100 );\n\n // Create 3d Pie Chart Section\n PdfPCell pieChartSectionCell = ReportTemplate.getBoxBorderCell ();\n pieChartSectionCell.addElement ( getPieChartSection () );\n contentTable.addCell ( pieChartSectionCell );\n\n // Create Bar Chart Section\n PdfPCell barChartSectionCell = ReportTemplate.getBoxBorderCell ();\n barChartSectionCell.addElement ( getResourceManagementTable () );\n contentTable.addCell ( barChartSectionCell );\n document.add ( contentTable );\n //document.newPage();\n\n PdfPTable contentTable2 = new PdfPTable ( 2 );\n contentTable2.setWidthPercentage ( 100 );\n\n // Add Risk Management Section\n PdfPCell riskManagementSectionCell = ReportTemplate.getBoxBorderWithoutLeftPaddingCell ();\n riskManagementSectionCell.addElement ( getRiskManagementTable () );\n contentTable2.addCell ( riskManagementSectionCell );\n\n // Add Conservation Management Section\n\n Paragraph conservationParagraph = new Paragraph ();\n\n conservationParagraph.add ( new Chunk ( \"Conservation Management\\n\\n\", ReportTemplate.TIMESROMAN_12_BOLD ) );\n conservationParagraph.add ( new Chunk ( \"Conservation Goals\\n\", ReportTemplate.TIMESROMAN_10_NORMAL) );\n /**\n * @changed - Abhishek\n * @date - 12-12-2015\n * @updated - 11-01-2016\n */\n ReportDataPage1.ConservationPracticeBean conservationBean = reportDataPage1.getLandUnderConservationPractice ();\n\n /**\n * @changed - Abhishek\n * @updated - 11-01-2016\n */\n conservationParagraph.add ( new Chunk ( AgricultureStandardUtils.doubleWithOneDecimal( Double.parseDouble (conservationBean.getProfitFromConservation () ) ) + \" % Est. Income under conservation practices\\n\" +\n AgricultureStandardUtils.doubleWithOneDecimal( Double.parseDouble (conservationBean.getLandUnderConservation () ) ) + \" % Acreage under conservation practices\", ReportTemplate.TIMESROMAN_10_NORMAL ) );\n\n PdfPCell conservationManagementSectionCell = ReportTemplate.getBoxBorderWithoutLeftPaddingCell ();\n conservationManagementSectionCell.addElement ( conservationParagraph );\n contentTable2.addCell ( conservationManagementSectionCell );\n\n contentTable2.setKeepTogether(true);\n document.add ( contentTable2 );\n\n\n /*getIncomeUnderConservationPractice(farmInfoView);*/\n\n }", "@Override\n\tpublic void ajouterCamping(Camping camping) {\n\t\tcampingRepo.save(camping);\t\n\t}", "public String getCampusCode() {\n return campusCode;\n }", "void crearCampania(GestionPrecioDTO campania);", "private void formFiller(FormLayout fl)\n\t{\n fl.setSizeFull();\n\n\t\ttf0=new TextField(\"Name\");\n\t\ttf0.setRequired(true);\n\t\t\n sf1 = new Select (\"Customer\");\n try \n {\n\t\t\tfor(String st :db.selectAllCustomers())\n\t\t\t{\n\t\t\t\tsf1.addItem(st);\n\t\t\t}\n\t\t} \n \tcatch (UnsupportedOperationException | SQLException e) \n \t{\n \t\tErrorWindow wind = new ErrorWindow(e); \n\t UI.getCurrent().addWindow(wind);\n \t\te.printStackTrace();\n \t}\n sf1.setRequired(true);\n \n sf2 = new Select (\"Project Type\");\n sf2.addItem(\"In house\");\n sf2.addItem(\"Outsourcing\");\n df3=new DateField(\"Start Date\");\n df3.setDateFormat(\"d-M-y\");\n df3.setRequired(true);\n \n df4=new DateField(\"End Date\");\n df4.setDateFormat(\"d-M-y\");\n \n df4.setRangeStart(df3.getValue());\n \n df5=new DateField(\"Next DeadLine\");\n df5.setDateFormat(\"d-M-y\");\n df5.setRangeStart(df3.getValue());\n df5.setRangeEnd(df4.getValue());\n sf6 = new Select (\"Active\");\n sf6.addItem(\"yes\");\n sf6.addItem(\"no\");\n sf6.setRequired(true);\n \n tf7=new TextField(\"Budget(mandays)\");\n \n tf8=new TextArea(\"Description\");\n \n tf9=new TextField(\"Inserted By\");\n \n tf10=new TextField(\"Inserted At\");\n \n tf11=new TextField(\"Modified By\");\n \n tf12=new TextField(\"Modified At\");\n \n if( project.getName()!=null)tf0.setValue(project.getName());\n else tf0.setValue(\"\");\n\t\tif(!editable)tf0.setReadOnly(true);\n fl.addComponent(tf0, 0);\n \n\n if(project.getCustomerID()!=-1)\n\t\t\ttry \n \t{\n\t\t\t\tsf1.setValue(db.selectCustomerforId(project.getCustomerID()));\n\t\t\t}\n \tcatch (ReadOnlyException | SQLException e) \n \t{\n \t\tErrorWindow wind = new ErrorWindow(e); \n\t\t UI.getCurrent().addWindow(wind);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\telse sf1.setValue(\"\");\n if(!editable)sf1.setReadOnly(true);\n fl.addComponent(sf1, 1);\n \n \n if(project.getProjectType()!=null)sf2.setValue(project.getProjectType());\n else sf2.setValue(\"\");\n if(!editable)sf2.setReadOnly(true);\n fl.addComponent(sf2, 2);\n \n if(project.getStartDate()!=null) df3.setValue(project.getStartDate());\n if(!editable)df3.setReadOnly(true);\n fl.addComponent(df3, 3);\n \n if(project.getEndDate()!=null) df4.setValue(project.getEndDate());\n if(!editable)df4.setReadOnly(true);\n fl.addComponent(df4, 4);\n \n if(project.getNextDeadline()!=null)df5.setValue(project.getNextDeadline());\n if(!editable)df5.setReadOnly(true);\n fl.addComponent(df5, 5);\n \n if (project.isActive())sf6.setValue(\"yes\");\n else sf6.setValue(\"no\");\n if(!editable)sf6.setReadOnly(true);\n fl.addComponent(sf6, 6);\n \n if(project.getBudget()!=-1.0) tf7.setValue(String.valueOf(project.getBudget()));\n else tf7.setValue(\"\");\n if(!editable)tf7.setReadOnly(true);\n fl.addComponent(tf7, 7);\n \n if(project.getDescription()!=null)tf8.setValue(project.getDescription());\n else tf8.setValue(\"\");\n if(!editable)tf8.setReadOnly(true);\n fl.addComponent(tf8, 8);\n \n if(project.getInserted_by()!=null)tf9.setValue(project.getInserted_by());\n else tf9.setValue(\"\");\n tf9.setEnabled(false);\n fl.addComponent(tf9, 9);\n \n if(project.getInserted_at()!=null)tf10.setValue(project.getInserted_at().toString());\n else tf10.setValue(\"\");\n tf10.setEnabled(false);\n fl.addComponent(tf10, 10);\n \n if(project.getModified_by()!=null)tf11.setValue(project.getModified_by());\n else tf11.setValue(\"\");\n tf11.setEnabled(false);\n fl.addComponent(tf11, 11);\n \n if(project.getModified_at()!=null)tf12.setValue(project.getModified_at().toString());\n else tf12.setValue(\"\");\n tf12.setEnabled(false);\n fl.addComponent(tf12, 12);\n \n \n\t}", "public void closeCashDrawer(String campusCode);", "@Override\n\tpublic void removeCampus(Campus campus) {\n\t\tEntityManager em=emf.createEntityManager();\n\t\tem.getTransaction().begin();\n\t\ttry {\n\t\t\tem.remove(em.merge(campus));\n\t\t\tem.getTransaction().commit();\n\t\t} finally {\n\t\t\t// TODO: handle finally clause\n\t\t\tif (em.getTransaction().isActive()) {\n\t\t\t\tem.getTransaction().rollback();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void creationSable(){\n\t\tfor(int x=2;x<=this.taille-3;x++) {\n\t\tfor(int y=2;y<=this.taille-3;y++) {\n\t\tif( grille.get(x).get(y).getTypeOccupation()==0 &&\n\t\t\t\tgrille.get(x+2).get(y).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x+2).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y+2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x-2).get(y-2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x).get(y-2).getTypeOccupation()!=3 &&\n\t\t\t\tgrille.get(x+2).get(y-2).getTypeOccupation()!=3 ) {\n\t\t\t\n\t\t\tint[] coord = new int[2];\n\t\t\tcoord[0]=x;\n\t\t\tcoord[1]=y;\n\t\t\tSable sable = new Sable(coord);\n\t\t\tgrille.get(x).set(y, sable);\n\t\t}\n\t\t}\n\t\t}\n\t}", "public boolean createPersonalDetails(Integer staffID, String surname, String name, Date dob, String address, String town, String county,\n String postCode, String telNo, String mobileNo, String emergencyContact, String emergencyContactNo){\n\n\n hrDB.addPDRecord(staffID, surname, name, dob, address, town, county,\n postCode, telNo, mobileNo, emergencyContact, emergencyContactNo);\n return true;\n\n\n }", "private void _generateAFaculty(int index) {\n writer_.startSection(CS_C_FACULTY, _getId(CS_C_FACULTY, index));\n _generateAFaculty_a(CS_C_FACULTY, index, _getId(CS_C_FACULTY, index));\n writer_.endSection(CS_C_FACULTY);\n }", "public Campus remove(long campusId) throws NoSuchCampusException;", "private HBox createDiagnosisInfo( String cosmoId )\r\n {\r\n HBox mainBox = new HBox();\r\n VBox leftVBox = new VBox();\r\n VBox rightVBox = new VBox();\r\n\r\n HBox familyPhysicianHBox = new HBox();\r\n\r\n HBox participantDiagnosisHBox = new HBox();\r\n HBox physicianPhoneNumberHBox = new HBox();\r\n HBox dateCompletedHBox = new HBox();\r\n HBox checkBoxesHBox = new HBox();\r\n\r\n Label familyPhysicianLbl = new Label(\"Family Physician: \");\r\n Label participantDiagnosisLbl = new Label(\"Participant Diagnosis: \");\r\n Label physicianPhoneLbl = new Label(\"Physician Phone Number: \");\r\n Label dateCompletedLbl = new Label(\"Date Completed: \");\r\n\r\n familyPhysicianTxt = new Label();\r\n participantDiagnosisTxt = new TextField();\r\n physicianPhoneTxt = new Label();\r\n dateCompletedTxt = new Label();\r\n\r\n tylenolGiven = new CheckBox();\r\n tylenolGiven.setText(\"Tylenol Given\");\r\n careGiverPermission = new CheckBox();\r\n careGiverPermission.setText(\"Caregivers Permission given\");\r\n\r\n editableItems.add(careGiverPermission);\r\n editableItems.add(tylenolGiven);\r\n editableItems.add(dateCompletedTxt);\r\n editableItems.add(physicianPhoneTxt);\r\n editableItems.add(participantDiagnosisTxt);\r\n editableItems.add(familyPhysicianTxt);\r\n btnSave.setOnAction(event -> {\r\n lblMessage.setText(\"\");\r\n String[] info = new String[4];\r\n info[0] = participantDiagnosisTxt.getText();\r\n info[1] = tylenolGiven.isSelected() + \"\";\r\n info[2] = careGiverPermission.isSelected() + \"\";\r\n info[3] = otherInfoTxt.getText();\r\n\r\n boolean success = helper.saveHealthStatusInfo(info, cosmoID);\r\n\r\n if ( success )\r\n {\r\n\r\n assignDiagnosisInfo(cosmoId);\r\n lblMessage.setTextFill(Color.BLUE);\r\n lblMessage.setText(\"Save successful\");\r\n\r\n }\r\n else\r\n {\r\n lblMessage.setTextFill(Color.RED);\r\n lblMessage.setText(\"The save was unsuccesful.\");\r\n }\r\n\r\n });\r\n // Following is just adding stuff to their boxes and setting some\r\n // spacing and alignment\r\n familyPhysicianHBox.getChildren().addAll(familyPhysicianLbl,\r\n familyPhysicianTxt);\r\n familyPhysicianHBox.setSpacing(125);\r\n familyPhysicianHBox.setAlignment(Pos.CENTER_RIGHT);\r\n\r\n participantDiagnosisHBox.getChildren().addAll(participantDiagnosisLbl,\r\n participantDiagnosisTxt);\r\n participantDiagnosisHBox.setSpacing(SPACING);\r\n participantDiagnosisHBox.setAlignment(Pos.CENTER_RIGHT);\r\n physicianPhoneNumberHBox.getChildren().addAll(physicianPhoneLbl,\r\n physicianPhoneTxt);\r\n\r\n physicianPhoneNumberHBox.setSpacing(SPACING);\r\n physicianPhoneNumberHBox.setAlignment(Pos.CENTER_RIGHT);\r\n dateCompletedHBox.getChildren().addAll(dateCompletedLbl,\r\n dateCompletedTxt);\r\n dateCompletedHBox.setSpacing(SPACING);\r\n dateCompletedHBox.setAlignment(Pos.CENTER_RIGHT);\r\n checkBoxesHBox.getChildren().addAll(tylenolGiven, careGiverPermission);\r\n checkBoxesHBox.setSpacing(SPACING);\r\n\r\n leftVBox.getChildren().addAll(familyPhysicianHBox,\r\n participantDiagnosisHBox, checkBoxesHBox);\r\n leftVBox.setSpacing(SPACING);\r\n rightVBox.getChildren().addAll(physicianPhoneNumberHBox,\r\n dateCompletedHBox);\r\n rightVBox.setSpacing(SPACING);\r\n mainBox.getChildren().addAll(leftVBox, rightVBox);\r\n mainBox.setSpacing(SPACING * 2);\r\n\r\n return mainBox;\r\n }", "private void createGrpClinicSelection() {\n\n\t}", "@Override\n\tpublic boolean createSprint(SprintFormBean sprint) throws IllegalAccessException, InvocationTargetException {\n\t\tSprint sprintEntity = new Sprint() ;\n\t\tsprintEntity.setDescription(sprint.getDescription());\n\t\tsprintEntity.setName(sprint.getName());\n\t\tsprintEntity.setReleaseid(sprint.getReleaseid());\n\t\tif(sprintRespository.save(sprintEntity) != null){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t\n\t\n\t\t\n\t}", "public org.oep.usermgt.model.Citizen create(long citizenId);", "public void AdicionaCampusFinal(String nomeCampus) {\n\t\tif (inicio == null) {\n\t\t\tCampusModel campus = new CampusModel(nomeCampus);\n\t\t\tinicio = campus;\n\t\t} else {\n\t\t\tCampusModel aux = inicio;\n\t\t\taux = FinalInserir(inicio);\n\t\t\tCampusModel campus = new CampusModel(nomeCampus);\n\t\t\taux.setProx(campus);\n\t\t}\n\t}", "private void exportOutline() {\n boolean modOK = modIfChanged();\n boolean sectionOpen = false;\n int exported = 0;\n if (modOK) {\n fileChooser.setDialogTitle (\"Export Agenda to OPML\");\n fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n File selectedFile = fileChooser.showSaveDialog (this);\n if (selectedFile != null) {\n MarkupWriter writer \n = new MarkupWriter(selectedFile, MarkupWriter.OPML_FORMAT);\n boolean ok = writer.openForOutput();\n if (ok) {\n textMergeScript.clearSortAndFilterSettings();\n int lastSeq = -1;\n for (int i = 0; i < clubEventList.size(); i++) {\n ClubEvent nextClubEvent = clubEventList.get(i);\n if (nextClubEvent != null\n && nextClubEvent.getStatusAsString().contains(\"Current\")) {\n String what = nextClubEvent.getWhat();\n if (exported == 0) {\n writer.startHead();\n writer.writeTitle(\"Minutes for \" + what);\n writer.endHead();\n writer.startBody();\n }\n String seqStr = nextClubEvent.getSeq();\n int seq = Integer.parseInt(seqStr);\n String seqTitle = \"\";\n switch (seq) {\n case 1:\n seqTitle = \"Open Meeting\";\n break;\n case 2:\n seqTitle = \"Finance\";\n break;\n case 3:\n seqTitle = \"Board Info\";\n break;\n case 4:\n seqTitle = \"Recent Events\";\n break;\n case 5:\n seqTitle = \"Upcoming\";\n break;\n case 8:\n seqTitle = \"Communication\";\n break;\n case 9:\n seqTitle = \"Close Meeting\";\n break;\n }\n String category = nextClubEvent.getCategory();\n \n // Start a new outline section for each type of agenda item\n if (seq != lastSeq) {\n if (sectionOpen) {\n writer.endOutline();\n }\n writer.startOutline(seqTitle);\n sectionOpen = true;\n lastSeq = seq;\n }\n \n // Start a new outline item for each event\n writer.startOutline(what);\n String ymd = nextClubEvent.getYmd();\n String when = nextClubEvent.getWhen();\n if (nextClubEvent.hasWhoWithData()) {\n writer.writeOutline(\"Who: \" + nextClubEvent.getWho());\n }\n if (nextClubEvent.hasWhenWithData()) {\n writer.writeOutline(\"When: \" + nextClubEvent.getWhen());\n }\n if (nextClubEvent.hasItemTypeWithData()) {\n writer.writeOutline(\"Item Type: \" + nextClubEvent.getItemType());\n }\n if (nextClubEvent.hasCategoryWithData()) {\n writer.writeOutline(\"Category: \" + nextClubEvent.getCategory());\n }\n if (nextClubEvent.hasStatusWithData()) {\n writer.writeOutline(\"Status: \" + nextClubEvent.getStatusAsString());\n }\n if (nextClubEvent.hasDiscussWithData()) {\n writer.writeOutline(\"To Discuss: \" + nextClubEvent.getDiscuss());\n }\n \n // Action Items\n if (nextClubEvent.hasActionsWithData()) {\n writer.startOutline(\"Action Items\");\n for (int j = 0; j < nextClubEvent.sizeEventActionList(); j++) {\n EventAction action = nextClubEvent.getEventAction(j);\n TextBuilder actionText = new TextBuilder();\n String actionee = action.getActionee();\n if (actionee != null && actionee.length() > 0) {\n actionText.append(actionee + \": \");\n }\n actionText.append(action.getAction());\n writer.writeOutline(actionText.toString());\n }\n writer.endOutline();\n }\n \n // Numbers\n if (nextClubEvent.hasOverUnderWithData()\n || nextClubEvent.hasFinanceProjectionWithData()) {\n writer.startOutline(\"Numbers\");\n \n if (nextClubEvent.hasCost()) {\n writer.writeOutline(\"Cost per Person: \" \n + nextClubEvent.getCost());\n }\n if (nextClubEvent.hasTickets()) {\n writer.writeOutline(\"To Receive Tickets: \" \n + nextClubEvent.getTickets());\n }\n if (nextClubEvent.hasQuantity()) {\n writer.writeOutline(\"Quantity available: \" \n + nextClubEvent.getQuantity());\n }\n if (nextClubEvent.hasPlannedAttendance()) {\n writer.writeOutline(\"Planned Attendance: \" \n + nextClubEvent.getPlannedAttendance());\n }\n if (nextClubEvent.hasActualAttendance()) {\n writer.writeOutline(\"Actual Attendance: \" \n + nextClubEvent.getActualAttendance());\n }\n if (nextClubEvent.hasPlannedIncome()) {\n writer.writeOutline(\"Planned Income: \" \n + nextClubEvent.getPlannedIncome());\n }\n if (nextClubEvent.hasActualIncome()) {\n writer.writeOutline(\"Actual Income: \" \n + nextClubEvent.getActualIncome());\n }\n if (nextClubEvent.hasPlannedExpense()) {\n writer.writeOutline(\"Planned Expense: \" \n + nextClubEvent.getPlannedExpense());\n }\n if (nextClubEvent.hasActualExpense()) {\n writer.writeOutline(\"Actual Expense: \" \n + nextClubEvent.getActualExpense());\n }\n writer.writeOutline(\"Over/Under: \" \n + nextClubEvent.getOverUnder());\n writer.writeOutline(\"Projection: \" \n + nextClubEvent.getFinanceProjection());\n \n writer.endOutline();\n }\n \n // Notes\n if (nextClubEvent.hasNotesWithData()) {\n writer.startOutline(\"Notes\");\n for (int n = 0; n < nextClubEvent.sizeEventNoteList(); n++) {\n EventNote note = nextClubEvent.getEventNote(n);\n TextBuilder noteText = new TextBuilder();\n writer.startOutline(ClubEventCalc.calcNoteHeaderLine(note));\n markdownReader = new StringLineReader(note.getNote());\n MarkdownInitialParser mdParser\n = new MarkdownInitialParser(this);\n MarkdownLine mdLine = mdParser.getNextLine();\n while (mdLine != null) {\n writer.writeOutline(mdLine.getLine());\n mdLine = mdParser.getNextLine();\n }\n writer.endOutline();\n }\n writer.endOutline();\n }\n \n /*\n StringBuilder h3 = new StringBuilder();\n if (ymd != null && ymd.length() > 7) {\n h3.append(when);\n h3.append(\" -- \");\n }\n if (category != null && category.length() > 0) {\n h3.append(category);\n h3.append(\": \");\n }\n h3.append(what);\n writer.writeHeading(3, h3.toString(), \"\");\n \n // Print Who\n exportMinutesField \n (writer, \n \"Who\", \n nextClubEvent.getWho());\n \n // Print Where\n exportMinutesField \n (writer, \n \"Where\", \n nextClubEvent.getWhere());\n \n // Print Finance Projection\n exportMinutesField \n (writer, \n \"Finance Projection\", \n nextClubEvent.getFinanceProjection());\n \n // Print Finance Projection\n exportMinutesField \n (writer, \n \"Over/Under\", \n nextClubEvent.getOverUnder());\n \n // Print Discussion\n exportMinutesField \n (writer, \"For Discussion\", nextClubEvent.getDiscuss());\n \n if (nextClubEvent.sizeEventNoteList() > 0) {\n EventNote note = nextClubEvent.getEventNote(0);\n String via = note.getNoteVia();\n if (via != null && via.equalsIgnoreCase(\"Minutes\")) {\n writer.writeLine(\"Minutes: \");\n writer.writeLine(note.getNote());\n }\n } */\n writer.endOutline();\n exported++;\n } // end if next event not null\n } // end for each item in list\n if (sectionOpen) {\n writer.endOutline();\n }\n writer.endBody();\n writer.close();\n JOptionPane.showMessageDialog(this,\n String.valueOf(exported) + \" Club Events exported successfully to\"\n + GlobalConstants.LINE_FEED\n + selectedFile.toString(),\n \"Export Results\",\n JOptionPane.INFORMATION_MESSAGE,\n Home.getShared().getIcon());\n logger.recordEvent (LogEvent.NORMAL, String.valueOf(exported) \n + \" Club Events exported as minutes to \" \n + selectedFile.toString(),\n false);\n statusBar.setStatus(String.valueOf(exported) \n + \" Club Events exported\");\n } \n if (! ok) {\n logger.recordEvent (LogEvent.MEDIUM,\n \"Problem exporting Club Events as minutes to \" + selectedFile.toString(),\n false);\n trouble.report (\"I/O error attempting to export club events to \" \n + selectedFile.toString(),\n \"I/O Error\");\n statusBar.setStatus(\"Trouble exporting Club Events\");\n } // end if I/O error\n } // end if user selected an output file\n } // end if were able to save the last modified record\n }", "void format03(String line, int lineCount) {\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\n\n // There must be data records after each code 03 record, therefore\n // this record must not be preceded by a code 03 record.\n if (prevCode == 3) {\n outputError((lineCount-1) + \" - Fatal - \" +\n \"No data for station: \" + stationId);\n } // if (prevCode == 3)\n\n //01 a2 format code always '03' n/a\n //02 a12 stnid station id: composed of as following: station\n // 1-3: institute id\n // 4-8: 1st 5 of expedition name ??\n // 9-12: station number\n //03 a10 stnnam station number station\n //04 i8 date yyyymmdd, e.g. 19900201 station\n //06 i3 latdeg latitude degrees (negative for north) station\n //07 f6.3 latmin latitude minutes (with decimal seconds) station\n //08 i4 londeg longitude degrees (negative for west) station\n //09 f6.3 lonmin longitude minutes (with decimal seconds) station\n //10 f7.2 stndep station depth station\n //11 a1 up indicator = 'D' for down, = 'U' for up (def = 'D') n/a\n //12 a8 grid_no for sfri only - grid number sfri_grid\n\n // get the data off the line\n java.util.StringTokenizer t = new java.util.StringTokenizer(line, \" \");\n String dummy = t.nextToken(); // get 'rid' of the code\n\n station.setSurveyId(survey.getSurveyId());\n if (t.hasMoreTokens()) station.setStationId(t.nextToken());\n if (t.hasMoreTokens()) station.setStnnam(t.nextToken());\n if (t.hasMoreTokens()) {\n String temp = t.nextToken();\n startDate = temp.substring(0,4) + \"-\" + temp.substring(4,6) +\n \"-\" + temp.substring(6);\n station.setDateStart(startDate + \" 00:00:00.0\");\n if (dbg) System.out.println(\"<br>format03: timeZone = \" +\n timeZone + \", startDate = \" + station.getDateStart());\n // convert to UTC?\n /*\n if (\"sast\".equals(timeZone)) {\n java.util.GregorianCalendar calDate = new java.util.GregorianCalendar();\n calDate.setTime(station.getDateStart());\n calDate.add(java.util.Calendar.HOUR, -2);\n //station.setDateStart(new Timestamp(calDate.getTime().getTime()));\n //Timestamp dateTimeMin2 = new Timestamp(calDate.getTime().getTime());\n java.text.SimpleDateFormat formatter =\n new java.text.SimpleDateFormat (\"yyyy-MM-dd\");\n station.setDateStart(formatter.format(calDate.getTime()) + \" 00:00:00.0\");\n } // if ('sast'.equals(timeZone))\n */\n if (dbg4) System.out.println(\"<br>format03: timeZone = \" +\n timeZone + \", startDate = \" + station.getDateStart());\n station.setDateEnd(station.getDateStart());\n\n } // if (t.hasMoreTokens())\n\n /* ub03\n float degree = 0f; float minute= 0f;\n if (t.hasMoreTokens()) degree = toFloat(t.nextToken(), 1f);\n if (t.hasMoreTokens()) minute = toFloat(t.nextToken(), 60f);\n station.setLatitude(degree + minute);\n */\n float latitude = 0f; //ub03\n if (t.hasMoreTokens()) latitude = toFloat(t.nextToken(), 1f); //ub03\n station.setLatitude(latitude); //ub03\n if ((latitude > 90f) || (latitude < -90f)) {\n outputError(lineCount + \" - Fatal - \" +\n \"Latitude invalid ( > 90 or < -90) : \" +\n latitude + \" : \" + station.getStationId(\"\"));\n } // if ((latitude > 90f) || (latitude < -90f))\n\n\n //sign = line.substring(46,47);\n //temp = toFloat(line.substring(47,50), 1f) +\n // toFloat(line.substring(50,55), 60000f);\n //station.setLongitude((\"-\".equals(sign) ? -temp : temp));\n /* ub03\n if (t.hasMoreTokens()) degree = toFloat(t.nextToken(), 1f);\n if (t.hasMoreTokens()) minute = toFloat(t.nextToken(), 60f);\n station.setLongitude(degree + minute);\n */\n float longitude = 0f; //ub03\n if (t.hasMoreTokens()) longitude = toFloat(t.nextToken(), 1f); //ub03\n station.setLongitude(longitude); //ub03\n if ((longitude > 180f) || (longitude < -180f)) {\n outputError(lineCount + \" - Fatal - \" +\n \"Longitude invalid ( > 180 or < -180) : \" +\n longitude + \" : \" + station.getStationId(\"\"));\n } // if ((longitude > 180f) || (longitude < -180f))\n\n if (t.hasMoreTokens()) station.setStndep(toFloat(t.nextToken(), 1f));\n\n if (t.hasMoreTokens()) upIndicator = t.nextToken().trim().toUpperCase();\n\n sfriGrid.setSurveyId(survey.getSurveyId());\n sfriGrid.setStationId(station.getStationId());\n if (t.hasMoreTokens()) sfriGrid.setGridNo(toString(t.nextToken()));\n\n // the first three letters of the station Id must be the institute Id\n// ub10\n// take out because of profiling floats - station id starts with D\n// if (!institute.equals(station.getStationId(\"\").substring(0,3))) {\n// if (dbg) System.out.println(\"<br>institute = \" + institute);\n// outputError(lineCount + \" - Fatal - \" +\n// \"Station Id does not start with institute Id \" + institute +\n// \": \" + station.getStationId(\"\"));\n// } // if (!institute.equals(station.getStationId().substring(0,3)))\n\n stationId = station.getStationId(\"\");\n\n // update the minimum and maximum dates\n if (station.getDateStart().before(dateMin)) {\n dateMin = station.getDateStart();\n } // if (station.getDateStart().before(dateMin))\n if (station.getDateEnd().after(dateMax)) {\n dateMax = station.getDateEnd();\n } // if (station.getDateStart().before(dateMin))\n\n // update the minimum and maximum latitudes\n if (station.getLatitude() < latitudeMin) {\n latitudeMin = station.getLatitude();\n } // if (station.getLatitude() < latitudeMin)\n if (station.getLatitude() > latitudeMax) {\n latitudeMax = station.getLatitude();\n } // if (station.getLatitude() < latitudeMin)\n\n // update the minimum and maximum longitudes\n if (station.getLongitude() < longitudeMin) {\n longitudeMin = station.getLongitude();\n } // if (station.getLongitude() < LongitudeMin)\n if (station.getLongitude() > longitudeMax) {\n longitudeMax = station.getLongitude();\n } // if (station.getLongitude() < LongitudeMin)\n\n // update the station counter\n stationCount++;\n if (dbg) System.out.println(\"\");\n if (dbg) System.out.println(\"<br>format03: station = \" + station);\n if (dbg) System.out.println(\"<br>format03: sfriGrid = \" + sfriGrid);\n if (dbg) System.out.println(\"<br>format03: stationCount = \" + stationCount);\n\n }", "private void attemptCreation() {\n newFlat.setAddressLine1(\"\");\n newFlat.setPostcode(\"\");\n newFlat.setNotes(\"\");\n newFlat.setFlatNum(\"\");\n newFlat.setTenant(\"\");\n\n // Reset errors\n actvProperty.setError(null);\n etFlatNum.setError(null);\n etFlatNotes.setError(null);\n flatTenant.setError(null);\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for valid address, if the user entered one\n if (TextUtils.isEmpty(actvProperty.getText().toString())) {\n actvProperty.setError(\"This field is required\");\n cancel = true;\n focusView = actvProperty;\n } else if (!isAddressValid(actvProperty.getText().toString())) {\n actvProperty.setError(\"This address is invalid\");\n cancel = true;\n focusView = actvProperty;\n }\n\n // Check for a valid flat number, if the user entered one\n if (TextUtils.isEmpty(etFlatNum.getText().toString())) {\n etFlatNum.setError(\"This field is required\");\n cancel = true;\n if (focusView == null) {\n focusView = etFlatNum;\n }\n } else if (!isFlatNumValid(\"Flat \" + etFlatNum.getText().toString())) {\n etFlatNum.setError(\"This flat number is in use\");\n cancel = true;\n if (focusView == null) {\n focusView = etFlatNum;\n }\n\n Collections.sort(flatNums);\n\n new AlertDialog.Builder(this)\n .setIcon(android.R.drawable.ic_dialog_alert)\n .setTitle(\"Warning\")\n .setMessage(\"These flats already exist in \" + actvProperty.getText().toString()\n + \":\\n\\n\" + flatNums.toString() + \"\\n\\nPlease enter a unique number.\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n })\n .show();\n }\n\n // Check for valid tenant, if the user entered one\n if (TextUtils.isEmpty(flatTenant.getText().toString())) {\n // No need to add a tenant\n } else if (!isTenantValid(flatTenant.getText().toString())) {\n flatTenant.setError(\"This tenant does not exist in the system\");\n cancel = true;\n if (focusView == null) {\n focusView = flatTenant;\n }\n } else if (!isTenantFree(flatTenant.getText().toString())) {\n flatTenant.setError(\"This tenant number is in use\");\n cancel = true;\n if (focusView == null) {\n focusView = flatTenant;\n }\n }\n\n // Check for notes and add default notes if null\n if (TextUtils.isEmpty(etFlatNotes.getText().toString())) {\n etFlatNotes.setText(\"No notes yet. That's okay, you can add some later..\");\n }\n\n if (cancel) {\n // There was an error; don't attempt creation and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);\n saveNewFlat();\n }\n }", "void validateCreate(ClaudiaData claudiaData, EnvironmentDto environmentDto, String vdc) throws \r\n AlreadyExistEntityException, InvalidEntityException;", "@SuppressWarnings(\"static-access\")\r\n\t@Test\r\n\tpublic void crearCinesTest() {\r\n\r\n\t\tpd.crearCines();\r\n\t\tpd.pm.deletePersistent(pd.cinema1);\r\n\t\tpd.pm.deletePersistent(pd.cinema2);\r\n\t\tpd.pm.deletePersistent(pd.cinema3);\r\n\r\n\t}", "public void create_GovOfficial(Citizen citizen)\n\t{\n\t\tPersonalDetails details = citizen.getDetails(); \n\t\tString user = citizen.getUsername(), \n\t\t\t pass = citizen.getPassword();\n\t\t\n\t\taccounts.remove(citizen);\n\t\taccounts.add(new GovernmentOfficial(user, pass));\n\t\taccounts.get(accounts.size() - 1).setPersonalDetails(details);\n\t}", "public static CreationEntry createSimpleEntry(int aPrimarySkill, int aObjectSource, int aObjectTarget, int aObjectCreated, boolean depleteSource, boolean depleteTarget, float aPercentageLost, boolean depleteEqually, boolean aCreateOnGround, int aCustomCreationCutOff, double aMinimumSkill, CreationCategories aCategory) {\n/* 3645 */ CreationEntry entry = new SimpleCreationEntry(aPrimarySkill, aObjectSource, aObjectTarget, aObjectCreated, depleteSource, depleteTarget, aPercentageLost, depleteEqually, aCreateOnGround, aCustomCreationCutOff, aMinimumSkill, aCategory);\n/* */ \n/* */ \n/* 3648 */ CreationMatrix.getInstance().addCreationEntry(entry);\n/* 3649 */ return entry;\n/* */ }", "public Faculty() {\n\t\tsuper();\n\t\tlevel = \" \";\n\t}", "void createNewContinent();", "public static CreationEntry createSimpleEntry(int aPrimarySkill, int aObjectSource, int aObjectTarget, int aObjectCreated, boolean depleteSource, boolean depleteTarget, float aPercentageLost, boolean depleteEqually, boolean aCreateOnGround, CreationCategories aCategory) {\n/* 3586 */ CreationEntry entry = new SimpleCreationEntry(aPrimarySkill, aObjectSource, aObjectTarget, aObjectCreated, depleteSource, depleteTarget, aPercentageLost, depleteEqually, aCreateOnGround, aCategory);\n/* */ \n/* 3588 */ CreationMatrix.getInstance().addCreationEntry(entry);\n/* 3589 */ return entry;\n/* */ }", "public CampusEbo getCampus() {\n if ( StringUtils.isBlank(campusCode) ) {\n campus = null;\n } else {\n if ( campus == null || !StringUtils.equals( campus.getCode(),campusCode) ) {\n ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);\n if ( moduleService != null ) {\n Map<String,Object> keys = new HashMap<String, Object>(1);\n keys.put(LocationConstants.PrimaryKeyConstants.CODE, campusCode);\n campus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);\n } else {\n throw new RuntimeException( \"CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.\" );\n }\n }\n }\n return campus;\n }", "private boolean upsertCreditCard(CreditCardSetupForm form, long ccId, User user, JoinDealSessionObject jdso) {\n CreditCardDetail ccd = ccId > 0 ? CreditCardDetail.getById(ccId) : new CreditCardDetail();\n\n ccd.setFirstName(form.getFirstName());\n ccd.setLastName(form.getLastName());\n ccd.setAddress1(form.getAddress1());\n ccd.setAddress2(form.getAddress2());\n ccd.setCity(form.getCity());\n ccd.setState(form.getState());\n ccd.setZipCode(form.getZipCode());\n ccd.setCountry(form.getCountry());\n ccd.setCardholderName(form.getCardholderName());\n ccd.setCreditCardNum(form.getCreditCardNumber()); // not to be persisted in DB\n ccd.setCardType(form.getCardType());\n ccd.setCvv(form.getCvv());\n ccd.setLastFour(CreditCardUtil.getEncodedLastFourDigits(form.getCreditCardNumber()));\n ccd.setExpiryDate(DateUtils.getDateFromMonthYear(\n Integer.parseInt(form.getExpMonth())-1, Integer.parseInt(form.getExpYear())));\n ccd.setUserId(user.getUserId());\n\n Date now = new Date();\n if (ccId <= 0) {\n ccd.setDateCreated(now);\n }\n ccd.setDateModified(now);\n ccd.setDoNotSaveToDb(form.isDoNotSave());\n \n jdso.setCreditCardDetail(ccd);\n if(form.isSameAsShippingAddr()) {\n ShippingAddress shAddr = new ShippingAddress();\n shAddr.setUserId(user.getUserId());\n shAddr.setAddress1(ccd.getAddress1());\n shAddr.setAddress2(ccd.getAddress2());\n shAddr.setCity(ccd.getCity());\n shAddr.setState(ccd.getState());\n shAddr.setZipCode(ccd.getZipCode());\n shAddr.setCountry(ccd.getCountry());\n shAddr.setFirstName(ccd.getFirstName());\n shAddr.setLastName(ccd.getLastName());\n shAddr.setDoNotSaveToDb(ccd.isDoNotSaveToDb());\n jdso.setShippingAddress(shAddr);\n } else {\n // reset shipping whenever checkbox is unchecked (i.e. in edit mode) and next is pressed.\n jdso.setShippingAddress(null);\n }\n \n return true;\n }", "public Cinema() {\r\n\r\n this.fname = null;\r\n\r\n this.fgenre = null;\r\n\r\n this.fdirector = null;\r\n\r\n this.actors = null;\r\n\r\n this.ftext = null;\r\n\r\n this.fdate = null;\r\n \r\n this.fduration = null;\r\n \r\n this.fformat = null;\r\n \r\n this.frate = 0;\r\n\r\n }", "private boolean addContestantToList() {\r\n\t\tContestant toAdd = new Contestant();\r\n\t\ttoAdd.setFName(fNameField.getText());\r\n\t\ttoAdd.setLName(lNameField.getText());\r\n\t\tif (mInitField.getText().length() != 0) {\r\n\t\t\ttoAdd.setMInit(mInitField.getText());\r\n\t\t}\r\n\t\ttoAdd.setPhoneNo(phoneNumberField.getText());\r\n\t\ttoAdd.setEmail(emailField.getText());\r\n\t\ttoAdd.setImgURL(filePath);\r\n\t\tint[] a = new int[2];\r\n\t\tswitch (ageField.getSelectedIndex()) {\r\n\t\t\tcase 0:\r\n\t\t\t\t//to print invalid in\r\n\t\t\t\t//break;\r\n\t\t\tcase 1: \r\n\t\t\t\ta[0] = 0;\r\n\t\t\t\ta[1] = 3;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2: \r\n\t\t\t\ta[0] = 4;\r\n\t\t\t\ta[1] = 7;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3: \r\n\t\t\t\ta[0] = 8;\r\n\t\t\t\ta[1] = 11;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4: \r\n\t\t\t\ta[0] = 12;\r\n\t\t\t\ta[1] = 15;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5: \r\n\t\t\t\ta[0] = 16;\r\n\t\t\t\ta[1] = 18;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6: \r\n\t\t\t\ta[0] = 19;\r\n\t\t\t\ta[1] = 24;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7: \r\n\t\t\t\ta[0] = 25;\r\n\t\t\t\ta[1] = 30;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 8: \r\n\t\t\t\ta[0] = 31;\r\n\t\t\t\ta[1] = Integer.MAX_VALUE;\r\n\t\t\t\ttoAdd.setAgeRange(a);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tboolean result = myList.addContestant(toAdd);\r\n\t\t\r\n\t\treturn result;\r\n\t}", "private void _generateAFaculty_a(int type, int index, String id) {\n int indexInFaculty;\n int courseNum;\n int courseIndex;\n boolean dup;\n CourseInfo course;\n\n indexInFaculty = instances_[CS_C_FACULTY].count - 1;\n\n writer_.addProperty(CS_P_NAME, _getRelativeName(type, index), false);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#name\", _getRelativeName(type, index), false ); \t\n }\n //undergradutate courses\n courseNum = _getRandomFromRange(FACULTY_COURSE_MIN, FACULTY_COURSE_MAX);\n for (int i = 0; i < courseNum; i++) {\n courseIndex = _AssignCourse(indexInFaculty);\n writer_.addProperty(CS_P_TEACHEROF, _getId(CS_C_COURSE, courseIndex), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#teacherOf\", _getId(CS_C_COURSE, courseIndex), true ); \t\n }\n }\n //gradutate courses\n courseNum = _getRandomFromRange(FACULTY_GRADCOURSE_MIN, FACULTY_GRADCOURSE_MAX);\n for (int i = 0; i < courseNum; i++) {\n courseIndex = _AssignGraduateCourse(indexInFaculty);\n writer_.addProperty(CS_P_TEACHEROF, _getId(CS_C_GRADCOURSE, courseIndex), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#teacherOf\", _getId(CS_C_GRADCOURSE, courseIndex), true ); \t\n }\n }\n for (int i = 0; i < courseNum; i++) {\n courseIndex = _AssignWebCourse(indexInFaculty);\n writer_.addProperty(CS_P_TEACHEROF, _getId(CS_C_WEBCOURSE, courseIndex), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#teacherOf\", _getId(CS_C_WEBCOURSE, courseIndex), true ); \t\n }\n }\n //person properties\n String n = _getId(CS_C_UNIV, random_.nextInt(UNIV_NUM));\n writer_.addProperty(CS_P_UNDERGRADFROM, CS_C_UNIV, n);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#undergraduateDegreeFrom\", n, true ); \t\n }\n n = _getId(CS_C_UNIV, random_.nextInt(UNIV_NUM));\n writer_.addProperty(CS_P_GRADFROM, CS_C_UNIV,\n n);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#mastersDegreeFrom\", n, true ); \t\n }\n n = _getId(CS_C_UNIV, random_.nextInt(UNIV_NUM));\n writer_.addProperty(CS_P_DOCFROM, CS_C_UNIV,\n n);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#doctoralDegreeFrom\", n, true ); \t\n }\n writer_.addProperty(CS_P_WORKSFOR,\n _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#worksFor\", _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true ); \t\n }\n writer_.addProperty(CS_P_EMAIL, _getEmail(type, index), false);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#email\", _getEmail(type, index), false ); \t\n }\n writer_.addProperty(CS_P_TELEPHONE, \"xxx-xxx-xxxx\", false);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#telephone\", \"xxx-xxx-xxxx\", false ); \t\n }\n }", "private void addRow() throws CoeusException{\r\n // PDF is not mandatory\r\n// String fileName = displayPDFFileDialog();\r\n// if(fileName == null) {\r\n// //Cancelled\r\n// return ;\r\n// }\r\n \r\n BudgetSubAwardBean budgetSubAwardBean = new BudgetSubAwardBean();\r\n budgetSubAwardBean.setProposalNumber(budgetBean.getProposalNumber());\r\n budgetSubAwardBean.setVersionNumber(budgetBean.getVersionNumber());\r\n budgetSubAwardBean.setAcType(TypeConstants.INSERT_RECORD);\r\n// budgetSubAwardBean.setPdfAcType(TypeConstants.INSERT_RECORD);\r\n budgetSubAwardBean.setSubAwardStatusCode(1);\r\n // PDF is not mandatory\r\n// budgetSubAwardBean.setPdfFileName(fileName);\r\n budgetSubAwardBean.setUpdateUser(userId);\r\n //COEUSQA-4061 \r\n CoeusVector cvBudgetPeriod = new CoeusVector(); \r\n \r\n cvBudgetPeriod = getBudgetPeriodData(budgetSubAwardBean.getProposalNumber(),budgetSubAwardBean.getVersionNumber()); \r\n \r\n //COEUSQA-4061\r\n int rowIndex = 0;\r\n if(data == null || data.size() == 0) {\r\n budgetSubAwardBean.setSubAwardNumber(1);\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - Start\r\n // Sub Award Details button will be enabled only when the periods are generated or budget has one period\r\n if(isPeriodsGenerated() || cvBudgetPeriod.size() == 1){\r\n subAwardBudget.btnSubAwardDetails.setEnabled(true);\r\n }\r\n // Added for COEUSQA-2115 : Subaward budgeting for Proposal Development - End\r\n }else{\r\n rowIndex = data.size();\r\n BudgetSubAwardBean lastBean = (BudgetSubAwardBean)data.get(rowIndex - 1);\r\n budgetSubAwardBean.setSubAwardNumber(lastBean.getSubAwardNumber() + 1);\r\n }\r\n if(!subAwardBudget.isEnabled()){\r\n subAwardBudget.btnSubAwardDetails.setEnabled(true);\r\n }\r\n data.add(budgetSubAwardBean);\r\n subAwardBudgetTableModel.fireTableRowsInserted(rowIndex, rowIndex);\r\n subAwardBudget.tblSubAwardBudget.setRowSelectionInterval(rowIndex, rowIndex);\r\n \r\n }", "@Test\r\n\tpublic void testAddPregnancyRecord() {\r\n\t\t\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setMultiplicity(\"2\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setWeightGain(\"12.5\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setNumHoursInLabor(\"-1\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setNumWeeksPregnant(\"39\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\t\r\n\t\toic.setYearOfConception(\"a\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setYearOfConception(\"2005\");\r\n\t\toic.setDeliveryType(\"Vaginal Delivery\");\r\n\t\tAssert.assertTrue(oic.getDeliveryType().equals(\"Vaginal Delivery\"));\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\t\t\r\n\t\t\r\n\t\toic.setYearOfConception(\"101\");\r\n\t\tAssert.assertTrue(oic.getDisplayedPregnancies().isEmpty());\r\n\t\t\r\n\t\toic.setYearOfConception(\"2005\");\r\n\t\toic.setNumHoursInLabor(\"3\");\r\n\t\toic.addPregnancyRecord();\r\n\t\tAssert.assertFalse(oic.getDisplayedPregnancies().isEmpty());\r\n\t}", "public Association createAssociation(SnpAssociationStandardMultiForm form) {\n Association association = setCommonAssociationElements(form);\n association.setSnpInteraction(false);\n\n // Add loci to association, for multi-snp and standard snps we assume their is only one locus\n Collection<Locus> loci = new ArrayList<>();\n Locus locus = new Locus();\n\n // Set locus description and haplotype count\n // Set this number to the number of rows entered by curator\n Integer numberOfRows = form.getSnpFormRows().size();\n if (numberOfRows > 1) {\n locus.setHaplotypeSnpCount(numberOfRows);\n association.setMultiSnpHaplotype(true);\n }\n\n if (form.getMultiSnpHaplotypeDescr() != null && !form.getMultiSnpHaplotypeDescr().isEmpty()) {\n locus.setDescription(form.getMultiSnpHaplotypeDescr());\n }\n else {\n if (numberOfRows > 1) {\n locus.setDescription(numberOfRows + \"-SNP haplotype\");\n }\n else {\n locus.setDescription(\"Single variant\");\n }\n }\n\n // Create gene from each string entered, may sure to check pre-existence\n Collection<String> authorReportedGenes = form.getAuthorReportedGenes();\n Collection<Gene> locusGenes = lociAttributesService.createGene(authorReportedGenes);\n\n // Set locus genes\n locus.setAuthorReportedGenes(locusGenes);\n\n // Handle rows entered for haplotype by curator\n Collection<SnpFormRow> rows = form.getSnpFormRows();\n Collection<RiskAllele> locusRiskAlleles = new ArrayList<>();\n\n for (SnpFormRow row : rows) {\n\n // Create snps from row information\n String curatorEnteredSNP = row.getSnp();\n SingleNucleotidePolymorphism snp = lociAttributesService.createSnp(curatorEnteredSNP);\n\n // Get the curator entered risk allele\n String curatorEnteredRiskAllele = row.getStrongestRiskAllele();\n\n // Create a new risk allele and assign newly created snp\n RiskAllele riskAllele = lociAttributesService.createRiskAllele(curatorEnteredRiskAllele, snp);\n\n // If association is not a multi-snp haplotype save frequency to risk allele\n if (!form.getMultiSnpHaplotype()) {\n riskAllele.setRiskFrequency(form.getRiskFrequency());\n }\n\n // Check for proxies and if we have one create a proxy snps\n if (row.getProxySnps() != null && !row.getProxySnps().isEmpty()) {\n Collection<SingleNucleotidePolymorphism> riskAlleleProxySnps = new ArrayList<>();\n\n for (String curatorEnteredProxySnp : row.getProxySnps()) {\n SingleNucleotidePolymorphism proxySnp = lociAttributesService.createSnp(curatorEnteredProxySnp);\n riskAlleleProxySnps.add(proxySnp);\n }\n\n riskAllele.setProxySnps(riskAlleleProxySnps);\n }\n\n locusRiskAlleles.add(riskAllele);\n }\n\n // Assign all created risk alleles to locus\n locus.setStrongestRiskAlleles(locusRiskAlleles);\n\n // Add locus to collection and link to our association\n loci.add(locus);\n association.setLoci(loci);\n return association;\n }", "@Override\n\tpublic void create () {\n\t\t//IntrigueGraphicalDebugger.enable();\n\t\tIntrigueGraphicSys = new IntrigueGraphicSystem();\n\t\tIntrigueTotalPhysicsSys = new IntrigueTotalPhysicsSystem();\n\t\t\n\t\tfinal int team1 = 1;\n\t\tfinal int team2 = 2;\n\t\t\n\t\tstage = new Stage();\n\t\ttable = new Table();\n\t\ttable.bottom();\n\t\ttable.left();\n\t\ttable.setFillParent(true);\n\t\t\n\t\tLabelStyle textStyle;\n\t\tBitmapFont font = new BitmapFont();\n\t\t\n\n\t\ttextStyle = new LabelStyle();\n\t\ttextStyle.font = font;\n\n\t\ttext = new Label(\"Intrigue\",textStyle);\n\t\tLabel text2 = new Label(\"@author: Matt\", textStyle);\n\t\tLabel text3 = new Label(\"OPERATION 1\", textStyle);\n\t\t\n\t\ttext.setFontScale(1f,1f);\n\t\ttable.add(text);\n\t\ttable.row();\n\t\ttable.add(text2);\n\t\ttable.row();\n\t\ttable.add(text3);\n\t\tstage.addActor(table);\n\n\t\ttable.setDebug(true);\n\t\tString path_to_char = \"3Dmodels/Soldier/ArmyPilot/ArmyPilot.g3dj\";\n //String path_to_road = \"3Dmodels/Road/roadV2.g3db\";\n\t\t//String path_to_rink = \"3Dmodels/Rink/Rink2.g3dj\";\n\t\tString path_to_snow_terrain = \"3Dmodels/Snow Terrain/st5.g3dj\";\n\t\tString path_to_crosshair = \"2Dart/Crosshairs/rifle_cross.png\";\n\t\n\t\tMatrix4 trans = new Matrix4();\n\t\tMatrix4 iceTrans = new Matrix4();\n\t\tMatrix4 iceTrans2 = new Matrix4();\n\t\tMatrix4 iceTrans3 = new Matrix4();\n\t\tMatrix4 iceTrans4 = new Matrix4();\n\t\tMatrix4 trans2 = new Matrix4();\n\t\tMatrix4 trans3 = new Matrix4();\n\t\n\t\ttrans.translate(-3000,6000,-500);\n\t\t//Vector3 halfExtents = new Vector3(30f,90f,25f);\n\t\tbtCapsuleShape person_shape = new btCapsuleShape(30f, 90f);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(player_guid)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char).IntrigueControllerComponent(1)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans)\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.DecalComponent()\n\t\t\t\t\t.ThirdPersonCameraComponent()\n .CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent()\n\t\t\t\t\t.Fireable(path_to_crosshair)\n\t\t\t\t\t.TargetingAI(team1)\n\t\t\t\t\t//.CharacterSoundComponent(\"SoundEffects/Character/walking/step-spur.mp3\", \"SoundEffects/guns/M4A1.mp3\")\n\t\t\t\t\t.Build());\n\t\tJson json_test = new Json(); \n\t\tEntity d = mamaDukes.get(player_guid);\n\t\t//System.out.println(json_test.prettyPrint(d));\n\t\t\n\t\t\n\t\tmamaDukes.get(player_guid).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\", iceTrans, Entity.class));\n\t\t\t\t/*\n\t\t\t\tnew DrifterObject.DrifterObjectBuilder(1)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(1)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans)\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\n\t\t\t\t\t\t\t\"3DParticles/blizzard.pfx\",new Vector3(1000,1000, -2500), \n\t\t\t\t\t\t\tnew Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build())\n\t\t\t\t\t.Build());*/\n\t\ttrans2.translate(-1000,1000,1500);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(2)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans2)\n\t\t\t\t\t.ParticleComponent(\"Blood\", \"3DParticles/Character/Blood.pfx\", \n\t\t\t\t\t\t\tnew Vector3(), new Vector3(1f,1f,1f))\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent()\n\t\t\t\t\t.Fireable()\n\t\t\t\t\t.ShootingSoldierAI()\n\t\t\t\t\t.TargetingAI(team2)\n\t\t\t\t\t.Build());\n\t\t\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody()\n\t\t\t\t\t.getRigidBody()\n\t\t\t\t\t.setAngularFactor(new Vector3(0,0,0));\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody()\n\t\t\t\t\t.getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\t\t\n\t\tmamaDukes.get(2).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setUserIndex(2);\n\t\t\n\t\ttrans3.translate(-1000, 1000, 2000);\n\t\t\n\t\tmamaDukes.add(new Entity.Builder(3)\n\t\t\t\t\t.IntrigueModelComponent(path_to_char)\n\t\t\t\t\t.IntriguePhysicalComponent(person_shape, 200f, trans3)\n\t\t\t\t\t.MotionComponent()\n\t\t\t\t\t.AimingComponent()\n\t\t\t\t\t.CharacterActionsComponent()\n\t\t\t\t\t.AnimationComponent().Fireable()\n\t\t\t\t\t.ShootingSoldierAI().TargetingAI(team2)\n\t\t\t\t\t.Build());\n\t\t\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setAngularFactor(new Vector3(0,0,0));\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody()\n\t\t\t\t\t.setActivationState(Collision.DISABLE_DEACTIVATION);\n\t\tmamaDukes.get(3).getPhysicalComponent()\n\t\t\t\t\t.getPhysicsBody().getRigidBody().setUserIndex(3);\n\t\t\n\t\tVector3 rpos = new Vector3();\n\t\t\n\t\tmamaDukes.get(1).getModelComponent().getModel()\n\t\t\t\t\t.transform.getTranslation(rpos);\n\t\t\n\t\ticeTrans2.translate(0, 0, 6185.332f);\n\t\t\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"SoundEffects/stages/snow stage/wind1.mp3\",\n\t\t\t\t\"3DParticles/blizzard.pfx\", iceTrans2, Entity.class));\n\t\t\n\t\t\t\t\t/*new DrifterObject.DrifterObjectBuilder(4)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(4)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans2)\n\t\t\t\t\t.IntrigueLevelComponent(\"SoundEffects/stages/snow stage/wind1.mp3\")\n\t\t\t\t\t.Build())\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\"3DParticles/blizzard.pfx\",\n\t\t\t\t\t\t\tnew Vector3(0, 0, 6185.332f),\n\t\t\t\t\t\t\tnew Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build());*/\n\t\t\n\t\tmamaDukes.get(4).getModelComponent().getModel().transform.translate(new Vector3(0, 0, 6185.332f)); //btStaticMeshShapes do not update their motionStates. The model Translation must be set manually in these cases.\n\t\ticeTrans3.translate(-6149.6568f, 0, 6185.332f);\n\t\t\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\" , iceTrans3, Entity.class));\n\t\t/**\n\t\t * btStaticMeshShapes do not update their motionStates. The model Translation must be set manually in these cases.\n\t\t */\n\t\tmamaDukes.get(5).getModelComponent().getModel().transform.translate(new Vector3(-6149.6568f, 0, 6185.332f)); \n\t\t\n\t\ticeTrans4.translate(-6149.6568f, 0, 0);\n\t\tmamaDukes.add(level_factory.createLevel(path_to_snow_terrain,\n\t\t\t\t\"3DParticles/blizzard.pfx\" , iceTrans4, Entity.class));\n\t\t\t\t\t/**new DrifterObject.DrifterObjectBuilder(6)\n\t\t\t\t\t.BaseObject(new Gobject.Builder(6)\n\t\t\t\t\t.IntrigueModelComponent(path_to_snow_terrain)\n\t\t\t\t\t.IntriguePhysicalComponent(iceMass, iceTrans4)\n\t\t\t\t\t.ParticleComponent(\"Blizzard\",\"3DParticles/blizzard.pfx\",\n\t\t\t\t\t\t\tnew Vector3(-6149.6568f, 0, 0), new Vector3(3000, 1000,2000 ))\n\t\t\t\t\t.Build())\n\t\t\t\t\t.Build());*/\n\t\tmamaDukes.get(6).getModelComponent().getModel().transform.translate(new Vector3(-6149.6568f, 0, 0)); \n\t\t\n\t}", "@RequestMapping(value = \"/staff/caupdatemultiple\", method = RequestMethod.POST)\n\tpublic ModelAndView saveCAMultiple(@RequestParam(required = false) Long campusid, HttpSession session) {\n\t\treturn null;\n\t}", "public Boolean buildModel(DaoStage activeStage) {\n\n // if no previous model, create locus, actor, prop lists\n if (activeStage.getLocusList().locii.size() == 0) {\n // create actor list mirroring locus list\n List<String> actorList = new ArrayList<>();\n activeStage.setActorList(actorList);\n // create stage locus list mirroring locus list\n List<String> propList = new ArrayList<>();\n activeStage.setPropList(propList);\n List<Integer> propFgColorList = new ArrayList<>();\n activeStage.setPropFgColorList(propFgColorList);\n List<Integer> propBgColorList = new ArrayList<>();\n activeStage.setPropBgColorList(propBgColorList);\n\n // create prop list\n DaoLocusList daoLocusList = new DaoLocusList();\n activeStage.setLocusList(daoLocusList);\n // establish ring max id list\n Integer ring = 0;\n Integer ringId = 0;\n List<Integer> ringMaxId = new ArrayList<>();\n ringMaxId.add(0);\n\n // seed 1st locus at 0,0\n DaoLocus origin = new DaoLocus();\n // mirror locus list add with actor & prop\n mirrorLociiAdd(origin, daoLocusList, actorList, propList, propFgColorList, propBgColorList);\n // set nickname, seed vert\n origin.setNickname(setLocusName(ring, ringMaxId.get(ring)));\n origin.setVertX(RING_CENTER_X);\n origin.setVertY(RING_CENTER_Y);\n origin.setVertZ(RING_CENTER_Z);\n Log.d(TAG, origin.toString() + \" at origin.\");\n\n // populate 1st ring around origin\n ++ring; // 1st\n ringId = populateLocii(ring, ringMaxId.get(ring - 1), daoLocusList, origin, actorList,\n propList, propFgColorList, propBgColorList);\n ringMaxId.add(ringId);\n\n // populate next ring by expanding around each locus in previous ring\n while (ring < activeStage.getRingSize()) {\n ++ring;\n // for each locus in previous ring\n Integer locusIndex = ringMaxId.get(ring - 2) + 1;\n ringId = ringMaxId.get(ring - 1);\n while (locusIndex < ringMaxId.get(ring - 1) + 1) {\n origin = daoLocusList.locii.get(locusIndex);\n ringId = populateLocii(ring, ringId, daoLocusList, origin, actorList,\n propList, propFgColorList, propBgColorList);\n ++locusIndex;\n }\n ringMaxId.add(ringId);\n }\n // create bounding rect with min/max inverted\n setBoundingRect(new RectF(RING_MAX_X, RING_MAX_Y, RING_MIN_X, RING_MIN_Y));\n // create bounding rect\n initBoundingRect(activeStage);\n }\n else if (activeStage.getPropFgColorList() == null ||\n activeStage.getPropBgColorList() == null ||\n activeStage.getPropFgColorList().size() != activeStage.getPropList().size() ||\n activeStage.getPropBgColorList().size() != activeStage.getPropList().size()) {\n Log.e(TAG, \"BuildModel finds depopulated FG,BG Color Lists...repairing...\");\n List<Integer> propFgColorList = new ArrayList<>();\n activeStage.setPropFgColorList(propFgColorList);\n List<Integer> propBgColorList = new ArrayList<>();\n activeStage.setPropBgColorList(propBgColorList);\n // for each prop\n for (int i = 0; i < activeStage.getPropList().size(); i++) {\n // if prop defined\n if (!activeStage.getPropList().get(i).equals(DaoDefs.INIT_STRING_MARKER)) {\n Log.d(TAG, \"buildModel repairing prop(\" + i + \") \" + activeStage.getPropList().get(i));\n if (activeStage.getPropList().get(i).equals(DaoActor.ACTOR_MONIKER_FORBIDDEN)) {\n propFgColorList.add(DaoStage.STAGE_BG_COLOR);\n propBgColorList.add(DaoStage.STAGE_BG_COLOR);\n } else if (activeStage.getPropList().get(i).equals(DaoActor.ACTOR_MONIKER_MIRROR)) {\n String actorMoniker = activeStage.getActorList().get(i);\n if (!actorMoniker.equals(DaoDefs.INIT_STRING_MARKER)) {\n DaoActor daoActor = (DaoActor) getRepoProvider().getDalActor().getDaoRepo().get(actorMoniker);\n if (daoActor != null) {\n propFgColorList.add(daoActor.getForeColor());\n propBgColorList.add(DaoStage.STAGE_BG_COLOR);\n Log.d(TAG,\"buildModel adds mirror for actor \" + daoActor.getMoniker() + \" at \" + i);\n }\n else {\n // add empty fg/bg color\n propFgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n propBgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n }\n }\n }\n }\n else {\n String actorMoniker = activeStage.getActorList().get(i);\n if (!actorMoniker.equals(DaoDefs.INIT_STRING_MARKER)) {\n DaoActor daoActor = (DaoActor) getRepoProvider().getDalActor().getDaoRepo().get(actorMoniker);\n if (daoActor != null) {\n activeStage.getPropList().set(i, DaoActor.ACTOR_MONIKER_MIRROR);\n propFgColorList.add(daoActor.getForeColor());\n propBgColorList.add(DaoStage.STAGE_BG_COLOR);\n Log.d(TAG,\"buildModel adds mirror for actor \" + daoActor.getMoniker() + \" at \" + i);\n }\n else {\n // add empty fg/bg color\n propFgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n propBgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n }\n }\n else {\n // add empty fg/bg color\n propFgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n propBgColorList.add(DaoDefs.INIT_INTEGER_MARKER);\n }\n }\n }\n }\n return true;\n }", "private void displaySubAwardDetails(char functionType) throws CoeusException{\r\n if(subAwardBudget.tblSubAwardBudget.getCellEditor() != null){\r\n subAwardBudget.tblSubAwardBudget.getCellEditor().stopCellEditing();\r\n }\r\n int selectedRow = subAwardBudget.tblSubAwardBudget.getSelectedRow();\r\n if(selectedRow > -1){\r\n BudgetSubAwardBean budgetSubAward = (BudgetSubAwardBean)data.get(selectedRow);\r\n // Sub Award details window will be opened only when organization name is provided\r\n if(budgetSubAward.getOrganizationName() == null || CoeusGuiConstants.EMPTY_STRING.equals(budgetSubAward.getOrganizationName().trim())){\r\n // This validation is fired during save itself\r\n// CoeusOptionPane.showWarningDialog(coeusMessageResources.parseMessageKey(ENTER_ORGANIZATION_NAME));\r\n }else{\r\n Vector vecSubAwardPeriodDetails = budgetSubAward.getSubAwardPeriodDetails();\r\n // Check the sub award has any entry in the database and set it to the form,\r\n // other wise based on the generated periods sub award period collection will be created\r\n if(vecSubAwardPeriodDetails == null || (vecSubAwardPeriodDetails != null && vecSubAwardPeriodDetails.isEmpty())){\r\n vecSubAwardPeriodDetails = new Vector();\r\n Equals eqNull = new Equals(\"acType\", null);\r\n String queryKey = budgetBean.getProposalNumber()+budgetBean.getVersionNumber();\r\n QueryEngine queryEngine = QueryEngine.getInstance();\r\n vecBudgetPeriods = queryEngine.getDetails(queryKey, BudgetPeriodBean.class);\r\n GreaterThan periodGreaterThanOne = new GreaterThan(\"budgetPeriod\",new Integer(1));\r\n CoeusVector vecBudgetDetails = queryEngine.executeQuery(queryKey, BudgetDetailBean.class, periodGreaterThanOne);\r\n if(vecBudgetPeriods != null && !vecBudgetPeriods.isEmpty()){\r\n for(Object budgetPeriodDetails : vecBudgetPeriods){\r\n BudgetPeriodBean budgetPeriodBean = (BudgetPeriodBean)budgetPeriodDetails;\r\n BudgetSubAwardDetailBean subAwardDetailBean = new BudgetSubAwardDetailBean();\r\n subAwardDetailBean.setBudgetPeriod(budgetPeriodBean.getBudgetPeriod());\r\n subAwardDetailBean.setVersionNumber(budgetPeriodBean.getVersionNumber());\r\n subAwardDetailBean.setPeriodStartDate(budgetPeriodBean.getStartDate());\r\n subAwardDetailBean.setPeriodEndDate(budgetPeriodBean.getEndDate());\r\n subAwardDetailBean.setAcType(TypeConstants.INSERT_RECORD);\r\n vecSubAwardPeriodDetails.add(subAwardDetailBean);\r\n }\r\n }\r\n }else if(vecSubAwardPeriodDetails != null && !vecSubAwardPeriodDetails.isEmpty()){\r\n Equals eqNull = new Equals(\"acType\", null);\r\n String queryKey = budgetBean.getProposalNumber()+budgetBean.getVersionNumber();\r\n QueryEngine queryEngine = QueryEngine.getInstance();\r\n vecBudgetPeriods = queryEngine.getDetails(queryKey, BudgetPeriodBean.class);\r\n \r\n if(vecBudgetPeriods!= null && (vecBudgetPeriods.size() != vecSubAwardPeriodDetails.size())){\r\n for(Object periodDetail : vecBudgetPeriods){\r\n BudgetPeriodBean budgetPeriodBean = (BudgetPeriodBean)periodDetail;\r\n int budgetPeriod = budgetPeriodBean.getBudgetPeriod();\r\n boolean hasSubAwardDetails = false;\r\n for(Object subAwardDetail : vecSubAwardPeriodDetails){\r\n BudgetSubAwardDetailBean subAwardDetailBean = (BudgetSubAwardDetailBean)subAwardDetail;\r\n if(budgetPeriod == subAwardDetailBean.getBudgetPeriod()){\r\n hasSubAwardDetails = true;\r\n break;\r\n }\r\n }\r\n if(!hasSubAwardDetails){\r\n BudgetSubAwardDetailBean subAwardDetailBean = new BudgetSubAwardDetailBean();\r\n subAwardDetailBean.setBudgetPeriod(budgetPeriodBean.getBudgetPeriod());\r\n subAwardDetailBean.setVersionNumber(budgetPeriodBean.getVersionNumber());\r\n subAwardDetailBean.setPeriodStartDate(budgetPeriodBean.getStartDate());\r\n subAwardDetailBean.setPeriodEndDate(budgetPeriodBean.getEndDate());\r\n subAwardDetailBean.setAcType(TypeConstants.INSERT_RECORD);\r\n vecSubAwardPeriodDetails.add(subAwardDetailBean);\r\n }\r\n }\r\n }\r\n }\r\n \r\n budgetSubAward.setSubAwardPeriodDetails(vecSubAwardPeriodDetails);\r\n subAwardDetailController = new BudgetSubAwardDetailController(getFunctionType(),budgetSubAward);\r\n subAwardDetailController.setFormData(vecSubAwardPeriodDetails);\r\n subAwardDetailController.display();\r\n }\r\n }\r\n }", "@Test\n void qureyInfoByStudentNum() {\n addInfoForGEIAS();\n }", "public static void main_addApplicant(){\n String applicantName, college;\n String[] skills = new String[3], companyNames = new String[3];\n double gpa;\n System.out.println(\"Enter Applicant Name: \");\n applicantName = input.nextLine();\n if(!Character.isLetter(applicantName.charAt(0))) {\n System.out.println(\"Invalid input.\");\n main_menu();\n }\n System.out.println(\"Enter Applicant GPA: \");\n gpa = input.nextDouble();\n while(gpa <= 0 || gpa >= 4){\n System.out.println(\"Invalid input: GPA must be greater than 0.0 and less than 4.0\");\n main_menu();\n }\n input.nextLine();\n System.out.println(\"Enter Applicant College: \");\n college = input.nextLine();\n if(!Character.isLetter(college.charAt(0))) {\n System.out.println(\"Invalid input.\");\n main_menu();\n }\n\n int x = 0;\n\n while(x < 3){\n System.out.println(\"Enter up to \" + (3 - x) + \" Companies: \");\n String companyX = input.nextLine();\n if(!companyX.equals(\"\")){\n companyNames[x] = companyX;\n x++;\n }\n else if(companyX.equals(\"\") && x == 0){\n System.out.println(\"Error: Applicant must have at least one company.\");\n x = 0;\n }\n else\n x = 3;\n }\n\n x = 0;\n\n while(x < 3){\n System.out.println(\"Enter up to \" + (3 - x) + \" Skills: \");\n String skillX = input.nextLine();\n if(!skillX.equals(\"\")){\n skills[x] = skillX;\n x++;\n }\n else if(skillX.equals(\"\") && x == 0) {\n System.out.println(\"Error: Applicant must have at least one skill.\");\n x = 0;\n }\n else\n x = 3;\n }\n\n Applicant app = new Applicant(companyNames, applicantName,\n gpa, college, skills);\n\n try {\n table.addApplicant(app);\n }\n catch (FullTableException ex) {\n System.out.println(\"Full table.\");\n main_menu();\n }\n\n\n\n\n }", "@Override\r\n public Formation ajouterFormation(Stockagedemandeformation demandeformation, int nbParticipants,String statut) {\r\n Formation f = new Formation();\r\n f.setStatut(statut);\r\n Formation formationCree = this.formationFacade.create(f);\r\n ajouterFormationCompose(formationCree, demandeformation, nbParticipants);\r\n return formationCree;\r\n }", "Sect1 createSect1();", "public void createProject(String nameProject, String nameDiscipline) throws \n InvalidDisciplineException,InvalidProjectException{\n int id = _person.getId();\n Professor _professor = getProfessors().get(id);\n _professor.createProject(nameProject, nameDiscipline);\n }", "@Test\n public void createNewCase_withNoAddressTypeForEstab() throws Exception {\n doCreateNewCaseTest(\n \"Floating palace\", EstabType.OTHER, AddressType.SPG, CaseType.SPG, AddressLevel.U);\n }", "public Campus fetchByPrimaryKey(long campusId);", "Division createDivision();", "@Test\n public void testStaffFactoryCreate() {\n StaffController staffController = staffFactory.getStaffController();\n staffController.addStaff(STAFF_NAME, STAFF_GENDER, STAFf_ROLE);\n assertEquals(1, staffController.getStaffList().size());\n }", "@Test\r\n public void testCreateValid() throws PAException {\r\n StudyProtocol studyProtocol = TestSchema.createStudyProtocolObj();\r\n Ii spIi = IiConverter.convertToStudyProtocolIi(studyProtocol.getId());\r\n StudyDiseaseDTO studyDiseaseDTO = new StudyDiseaseDTO();\r\n studyDiseaseDTO.setStudyProtocolIdentifier(spIi);\r\n Ii diseaseIi = IiConverter.convertToIi(TestSchema.pdqDiseaseIds.get(0));\r\n studyDiseaseDTO.setDiseaseIdentifier(diseaseIi);\r\n studyDiseaseDTO.setCtGovXmlIndicator(BlConverter.convertToBl(true));\r\n StudyDiseaseDTO result = bean.create(studyDiseaseDTO);\r\n assertStudyDiseaseDTO(studyDiseaseDTO, result);\r\n List<StudyDiseaseDTO> dtoList = bean.getByStudyProtocol(spIi);\r\n assertNotNull(\"No result returned\", dtoList);\r\n assertEquals(\"Wrong number of StudyDisease found\", 1, dtoList.size());\r\n assertStudyDiseaseDTO(studyDiseaseDTO, dtoList.get(0));\r\n }", "public void unlockCashDrawer(String campusCode, String documentId);", "private void _generateAFullProf(int index) {\n String id;\n\n id = _getId(CS_C_FULLPROF, index);\n writer_.startSection(CS_C_FULLPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#FullProfessor\", true); \t\n }\n _generateAProf_a(CS_C_FULLPROF, index, id);\n if (index == chair_) {\n writer_.addProperty(CS_P_HEADOF,\n _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, ontology+\"#headOf\", _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1), true); \t\n }\n } \n writer_.endSection(CS_C_FULLPROF);\n _assignFacultyPublications(id, FULLPROF_PUB_MIN, FULLPROF_PUB_MAX);\n }", "public AddForensicsForm()\r\n\t{\r\n\t\t//sets the layout to border layout as the default layout for a jpanel is flow.\r\n\t\tthis.setLayout(new BorderLayout());\r\n\t\t\r\n\t\t//creates the number format that stops letters being entered into certain textfields\r\n\t\tnumForm = NumberFormat.getIntegerInstance();\r\n\t\tnumForm.setGroupingUsed(false);\r\n\t\tnumForm.setMinimumIntegerDigits(0);\r\n\t\t\r\n\t\t/* Creates the form panel that will hold all the labels and text fields for the form.\r\n\t\t * It is given a grid layout so that each row will be a different section of the form e.g \r\n\t\t * what case it is a part of then on the next line the ID number of the forensic file etc.*/\r\n\t\tform = new JPanel();\r\n\t\tform.setLayout(new GridLayout(0,2,5,5));\r\n\t\tform.setBorder(new CompoundBorder(new EmptyBorder(5,5,5,5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5,5,5,5))));\r\n\t\t\r\n\t\t/* this is the label and textfield that is used to link the forensic file to the case, this has to be\r\n\t\t * done manually as new forensic files could be added for older cases as well as newer and there is no\r\n\t\t * way to predetermine what case the file is for. */\r\n\t\tevidenceLabel = new JLabel(\"Forensic File for case: \");\r\n\t\tevidenceID = new JFormattedTextField(numForm);\r\n\t\tform.add(evidenceLabel);\r\n\t\tform.add(evidenceID);\r\n\t\t\r\n\t\t/* This is the label and text field that holds the information for the ID of the forensics file\r\n\t\t * as this is unique and assigned automatically the field is set to uneditable by default\r\n\t\t * the assignID method in the forensic class is used to assign a unique ID to the forensic file*/\r\n\t\tforensicLabel = new JLabel(\"Forensics ID: \");\r\n\t\tforensicID = new JFormattedTextField();\r\n\t\tforensicID.setEditable(false);\r\n\t\tf1.assignID();\r\n\t\tforensicID.setText(String.valueOf(f1.getForensicID()));\r\n\t\tform.add(forensicLabel);\r\n\t\tform.add(forensicID);\r\n\t\t\r\n\t\t/* This is the label and combobox for biological evidence, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\tbioLabel = new JLabel(\"Presence of Biological Evidence:\");\r\n\t\tbioBox = new JComboBox(confirmation);\r\n\t\tform.add(bioLabel);\r\n\t\tform.add(bioBox);\r\n\t\t\r\n\t\t/* This is the label and combobox for print evidence e.g finger prints and toe prints, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\tprintsLabel = new JLabel(\"Presence of Finger Prints:\");\r\n\t\tprintsBox = new JComboBox(confirmation);\r\n\t\tform.add(printsLabel);\r\n\t\tform.add(printsBox);\r\n\t\t\r\n\t\t/* This is the label and combobox for Track evidence e.g boot and tire, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\ttracksLabel = new JLabel(\"Presence of Vehicle/Foot Tracks:\");\r\n\t\ttracksBox = new JComboBox(confirmation);\r\n\t\tform.add(tracksLabel);\r\n\t\tform.add(tracksBox);\r\n\t\t\r\n\t\t/* This is the label and combobox for digital evidence e.g phones and tablets, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\tdigitalLabel = new JLabel(\"Presence of Digital Evidence: \");\r\n\t\tdigitalBox = new JComboBox(confirmation);\r\n\t\tform.add(digitalLabel);\r\n\t\tform.add(digitalBox);\r\n\t\t\r\n\t\t/* This is the label and combobox for tool mark evidence, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\ttoolMarkLabel = new JLabel(\"Presence of tool marks\");\r\n\t\ttoolMarkBox = new JComboBox(confirmation);\r\n\t\tform.add(toolMarkLabel);\r\n\t\tform.add(toolMarkBox);\r\n\t\t\t\t\r\n\t\t/* This is the label and combobox for narcotic evidence, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\tnarcoticLabel = new JLabel(\"Presence of Narcotics: \");\r\n\t\tnarcoticBox = new JComboBox(confirmation);\r\n\t\tform.add(narcoticLabel);\r\n\t\tform.add(narcoticBox);\r\n\t\t\r\n\t\t/* This is the label and combobox for firearm evidence, it uses the confirmation\r\n\t\t * array to give it the values for the combobox*/\r\n\t\tfirearmLabel = new JLabel(\"Presence of Firearms: \");\r\n\t\tfirearmBox = new JComboBox(confirmation);\r\n\t\tform.add(firearmLabel);\r\n\t\tform.add(firearmBox);\r\n\t\t\r\n\t\t/* these are the buttons to cancel and sumbit and the panel that holds them\r\n\t\t * Submit uses the inner class listener to perform a function\r\n\t\t * and the cancel button is used by the window handler class to\r\n\t\t * return to the previous menu*/\r\n\t\tbuttons = new JPanel();\r\n\t\tsubmit = new JButton(\"Submit\");\r\n\t\tsubmit.addActionListener(this);\r\n\t\tcancel = new JButton(\"Cancel\");\r\n\t\tbuttons.add(submit);\r\n\t\tbuttons.add(cancel);\r\n\t\t\r\n\t\t//this is the container that holds both the button and form panel.\r\n\t\tcontainer = new JPanel();\r\n\t\tcontainer.setLayout(new GridLayout(0,1));\r\n\t\tcontainer.setBorder(new EmptyBorder(200, 0, 0, 0));\r\n\t\tcontainer.add(form);\r\n\t\tcontainer.add(buttons);\r\n\t\t\r\n\t\t//adds the container to the main panel.\r\n\t\tadd(container, BorderLayout.CENTER);\r\n\t}", "public String createCoopAdmin(int compId, int branchId, String username, String regdate,\r\n String memberno, String phone, String name, String email,String address, String coopprf){\r\n \r\n JSONObject obj = new JSONObject(); \r\n\r\n obj.put(\"gcid\", compId);\r\n obj.put(\"gbid\", branchId);\r\n obj.put(\"username\", username);\r\n obj.put(\"regdate\", regdate); \r\n obj.put(\"memberno\", memberno);\r\n obj.put(\"phone\", phone);\r\n obj.put(\"name\", name);\r\n obj.put(\"email\", email);\r\n obj.put(\"address\", address);\r\n obj.put(\"coopprf\", coopprf);\r\n \r\n return obj.toJSONString();\r\n }", "Prms createPrms();", "private static void createSubmission(String[] attributes, int docuID, int orgID) {\n\t\tint actID = ActivityDetailsService.getActivityDetailsByDocuID(docuID).getId();\n\t\tint submissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t//System.out.println(\"docuID: \" + docuID);\n\t\tif(submissionID == 0){\n\t\t\t//create submission details\n\t\t\tSubmissionDetails subDet = new SubmissionDetails();\n\t\t\tsubDet.setActID(actID);\n\t\t\tsubDet.setSubmittedBy(attributes[16]);\n\t\t\tsubDet.setContactNo(attributes[17]);\n\t\t\tsubDet.setEmailAddress(attributes[18]);\n\t\t\tsubDet.setDateSubmitted(toDateTime(attributes[0]));\n\t\t\tsubDet.setSubmissionType(attributes[4]);\n\t\t\t\n\t\t\tif(subDet.getSubmissionType().equalsIgnoreCase(\"Special Approval Slip\"))\n\t\t\t\tsubDet.setSasType(attributes[19]);\n\t\t\telse subDet.setSasType(\"-\");\n\t\t\tSubmissionDetailsService.addSubmissionDetails(subDet);\n\t\t\tif(attributes.length >= 21) {\n\t\t\t\tsubmissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t\t\tcreateCheckingDetails(attributes, submissionID);\n\t\t\t}\n\t\t} else {\n\t\t\tif(attributes.length >= 21) {\n\t\t\t\tsubmissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t\t\tcreateCheckingDetails(attributes, submissionID);\n\t\t\t}\n\t\t}\n\t\n\t}", "private void createGrpContactDetails() {\n\n\t\tgrpContactDetails = new Group(grpPharmacyDetails, SWT.NONE);\n\t\tgrpContactDetails.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tgrpContactDetails.setBounds(new Rectangle(20, 40, 350, 230));\n\n\t\tlblInstructions = new Label(grpContactDetails, SWT.CENTER);\n\t\tlblInstructions.setBounds(new org.eclipse.swt.graphics.Rectangle(50,\n\t\t\t\t20, 260, 20));\n\t\tlblInstructions.setText(\"All fields marked with * are compulsory\");\n\t\tlblInstructions.setFont(ResourceUtils\n\t\t\t\t.getFont(iDartFont.VERASANS_8_ITALIC));\n\n\t\tlblPharmacyName = new Label(grpContactDetails, SWT.NONE);\n\t\tlblPharmacyName.setBounds(new org.eclipse.swt.graphics.Rectangle(18, 45, 120,\n\t\t\t\t20));\n\t\tlblPharmacyName.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblPharmacyName.setText(\"* Facility Name:\");\n\t\ttxtPharmacyName = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtPharmacyName.setBounds(new org.eclipse.swt.graphics.Rectangle(150, 45, 180,\n\t\t\t\t20));\n\t\ttxtPharmacyName.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtPharmacyName.setFocus();\n\t\ttxtPharmacyName.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtNameKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\n\t\t});\n\t\ttxtPharmacyName.setEnabled(false);\n\n\t\tlblStreetAdd = new Label(grpContactDetails, SWT.NONE);\n\t\tlblStreetAdd.setBounds(new org.eclipse.swt.graphics.Rectangle(18, 75,\n\t\t\t\t120, 20));\n\t\tlblStreetAdd.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblStreetAdd.setText(\"* Street Address:\");\n\t\ttxtStreetAdd = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtStreetAdd.setBounds(new org.eclipse.swt.graphics.Rectangle(150, 75,\n\t\t\t\t180, 20));\n\t\ttxtStreetAdd.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtStreetAdd.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtStreetKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\t\t});\n\t\ttxtStreetAdd.setEnabled(false);\n\n\t\tlblCity = new Label(grpContactDetails, SWT.NONE);\n\t\tlblCity.setBounds(new org.eclipse.swt.graphics.Rectangle(18, 105, 120,\n\t\t\t\t20));\n\t\tlblCity.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblCity.setText(\"* City:\");\n\t\ttxtCity = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtCity.setBounds(new org.eclipse.swt.graphics.Rectangle(150, 105, 180,\n\t\t\t\t20));\n\t\ttxtCity.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtCity.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtCityKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\t\t});\n\t\ttxtCity.setEnabled(false);\n\n\t\tlblTel = new Label(grpContactDetails, SWT.NONE);\n\t\tlblTel.setBounds(new org.eclipse.swt.graphics.Rectangle(18, 135, 124,\n\t\t\t\t20));\n\t\tlblTel.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblTel.setText(\"* Telephone Number:\");\n\t\ttxtTel = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtTel.setBounds(new org.eclipse.swt.graphics.Rectangle(150, 135, 180,\n\t\t\t\t20));\n\t\ttxtTel.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtTel.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtTelNoKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\t\t});\n\t\ttxtTel.setEnabled(false);\n\n\t\tlblPharmacistName1 = new Label(grpContactDetails, SWT.NONE);\n\t\tlblPharmacistName1.setBounds(new org.eclipse.swt.graphics.Rectangle(18,\n\t\t\t\t165, 120, 20));\n\t\tlblPharmacistName1.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblPharmacistName1.setText(\"* Head Pharmacist:\");\n\t\ttxtPharmacistName1 = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtPharmacistName1.setBounds(new org.eclipse.swt.graphics.Rectangle(\n\t\t\t\t150, 165, 180, 20));\n\t\ttxtPharmacistName1.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtPharmacistName1.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtPharmacistKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\t\t});\n\t\ttxtPharmacistName1.setEnabled(false);\n\n\t\tlblPharmacyAssistant = new Label(grpContactDetails, SWT.NONE);\n\t\tlblPharmacyAssistant.setBounds(new org.eclipse.swt.graphics.Rectangle(18,\n\t\t\t\t195, 120, 20));\n\t\tlblPharmacyAssistant.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\tlblPharmacyAssistant.setText(\" Pharmacy Assistant:\");\n\t\ttxtPharmacyAssistant = new Text(grpContactDetails, SWT.BORDER);\n\t\ttxtPharmacyAssistant.setBounds(new org.eclipse.swt.graphics.Rectangle(\n\t\t\t\t150, 195, 180, 20));\n\t\ttxtPharmacyAssistant.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t\ttxtPharmacyAssistant.addKeyListener(new KeyAdapter() {\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent evt) {\n\t\t\t\ttxtPharmacistKeyReleased();\n\t\t\t\tfieldsChanged = true;\n\t\t\t}\n\t\t});\n\t\ttxtPharmacyAssistant.setEnabled(false);\n\n\t}", "private void initTestBuildingWithRoomsAndWorkplaces() {\n\t\tinfoBuilding = dataHelper.createPersistedBuilding(\"50.20\", \"Informatik\", new ArrayList<Property>());\n\t\troom1 = dataHelper.createPersistedRoom(\"Seminarraum\", \"-101\", -1, Arrays.asList(new Property(\"WLAN\")));\n\n\t\tworkplace1 = dataHelper.createPersistedWorkplace(\"WP1\",\n\t\t\t\tArrays.asList(new Property(\"LAN\"), new Property(\"Lampe\")));\n\t\tworkplace2 = dataHelper.createPersistedWorkplace(\"WP2\", Arrays.asList(new Property(\"LAN\")));\n\n\t\troom1.addContainedFacility(workplace1);\n\t\troom1.addContainedFacility(workplace2);\n\n\t\tinfoBuilding.addContainedFacility(room1);\n\t}", "public static AssessmentCreationForm openFillCreationForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Create);\n\n Logger.getInstance().info(\"Fill out the required fields with valid data\");\n AssessmentCreationForm creationForm = new AssessmentCreationForm();\n creationForm.fillAssessmentInformation(new User(Roles.STAFF), assm);\n\n return new AssessmentCreationForm();\n }", "public static BorderPane getBuildingInfoBP(Accordion ac) {\n screenBounds = Screen.getPrimary().getBounds();\n\n //Reset TableView tableBuilding\n tableBuilding = new TableView<>();\n tableBuilding.getColumns().clear();\n tableBuilding.setEditable(true);\n\n // Table of Buildings with Info\n // Pane Center\n TableColumn<Building, Long> idCol = new TableColumn<>(\"id\");\n idCol.setMinWidth(100);\n idCol.setCellValueFactory(new PropertyValueFactory<>(\"id\"));\n idCol.getStyleClass().setAll(\"first-col\");\n\n TableColumn<Building, String> buildingCol = new TableColumn<>(\"Building Name\");\n buildingCol.setMinWidth(100);\n buildingCol.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n buildingCol.setCellFactory(TextFieldTableCell.forTableColumn());\n buildingCol.setOnEditCommit((TableColumn.CellEditEvent<Building, String> t) ->\n t.getTableView().getItems().get(t.getTablePosition().getRow()).setName(t.getNewValue()));\n\n TableColumn<Building, LocalTime> openTimeCol = new TableColumn<>(\"Open Time\");\n openTimeCol.setMinWidth(100);\n openTimeCol.setCellValueFactory(new PropertyValueFactory<>(\"openTime\"));\n openTimeCol.setCellFactory(TextFieldTableCell.forTableColumn(new TimeToStringConverter()));\n openTimeCol.setOnEditCommit((TableColumn.CellEditEvent<Building, LocalTime> t) ->\n t.getTableView().getItems().get(t.getTablePosition().getRow()).setOpenTime(t.getNewValue()));\n\n TableColumn<Building, LocalTime> closeTimeCol = new TableColumn<>(\"Close Time\");\n closeTimeCol.setMinWidth(100);\n closeTimeCol.setCellValueFactory(new PropertyValueFactory<>(\"closeTime\"));\n closeTimeCol.setCellFactory((TextFieldTableCell.forTableColumn(new TimeToStringConverter())));\n closeTimeCol.setOnEditCommit((TableColumn.CellEditEvent<Building, LocalTime> t) ->\n t.getTableView().getItems().get(t.getTablePosition().getRow()).setCloseTime(t.getNewValue()));\n\n TableColumn<Building, String> streetNameCol = new TableColumn<>(\"Street Name\");\n streetNameCol.setMinWidth(100);\n streetNameCol.setCellValueFactory(new PropertyValueFactory<>(\"streetName\"));\n streetNameCol.setCellFactory(TextFieldTableCell.forTableColumn());\n streetNameCol.setOnEditCommit(\n (TableColumn.CellEditEvent<Building, String> t) ->\n t.getTableView().getItems().get(t.getTablePosition().getRow()).setStreetName(t.getNewValue()));\n\n TableColumn<Building, String> streetNumCol = new TableColumn<>(\"Street Number\");\n streetNumCol.setMinWidth(100);\n streetNumCol.setCellValueFactory(new PropertyValueFactory<>(\"streetNumber\"));\n streetNumCol.setCellFactory(TextFieldTableCell.forTableColumn());\n streetNumCol.setOnEditCommit(\n (TableColumn.CellEditEvent<Building, String> t) -> t.getTableView().getItems().get(\n t.getTablePosition().getRow()).setStreetNumber(t.getNewValue()));\n\n TableColumn<Building, String> zipCodeCol = new TableColumn<>(\"Zip Code\");\n zipCodeCol.setMinWidth(100);\n zipCodeCol.setCellValueFactory(new PropertyValueFactory<>(\"zipCode\"));\n zipCodeCol.setCellFactory(TextFieldTableCell.forTableColumn());\n zipCodeCol.setOnEditCommit(\n (TableColumn.CellEditEvent<Building, String> t) -> t.getTableView().getItems().get(\n t.getTablePosition().getRow()).setZipCode(t.getNewValue()));\n\n TableColumn<Building, String> cityCol = new TableColumn<>(\"City\");\n cityCol.setMinWidth(100);\n cityCol.setCellValueFactory(new PropertyValueFactory<>(\"City\"));\n cityCol.setCellFactory(TextFieldTableCell.forTableColumn());\n cityCol.setOnEditCommit(\n (TableColumn.CellEditEvent<Building, String> t) -> t.getTableView().getItems().get(\n t.getTablePosition().getRow()).setCity(t.getNewValue()));\n cityCol.getStyleClass().setAll(\"last-col\");\n\n buildingData = FXCollections.observableList(BuildingCommunication.getBuildings());\n tableBuilding.setItems(buildingData);\n tableBuilding.getColumns().addAll(idCol, buildingCol, openTimeCol, closeTimeCol, streetNameCol, streetNumCol, zipCodeCol, cityCol);\n\n HBox hboxBottom = new HBox();\n hboxBottom.setPadding(new Insets(20, 20, 20, 0));\n hboxBottom.getChildren().setAll(deleteInfoButton, updateInfoButton);\n\n // VBox to add a new building\n // Pane Right\n Text buildingName = new Text(\"Building Name\");\n Text openTime = new Text(\"Open Time\");\n Text closeTime = new Text(\"Close Time\");\n Text streetName = new Text(\"Street Name\");\n Text streetNumber = new Text(\"Street Number\");\n Text zipCode = new Text(\"Zip Code\");\n Text city = new Text(\"City\");\n\n\n ObservableList<LocalTime> time = generateTime();\n TextField buildingNameInput = new TextField();\n ComboBox<LocalTime> openTimeInput = new ComboBox<>();\n openTimeInput.setItems(time);\n ComboBox<LocalTime> closeTimeInput = new ComboBox<>();\n closeTimeInput.setItems(time);\n TextField streetNameInput = new TextField();\n TextField streetNumberInput = new TextField();\n TextField zipCodeInput = new TextField();\n TextField cityInput = new TextField();\n\n Button addButtonBuilding = new Button(\"Add Building\");\n\n VBox vboxRight = new VBox(5);\n vboxRight.getChildren().addAll(buildingName, buildingNameInput, openTime, openTimeInput,\n closeTime, closeTimeInput, streetName, streetNameInput, streetNumber, streetNumberInput,\n zipCode, zipCodeInput, city, cityInput, addButtonBuilding);\n\n // Delete Button\n deleteInfoButton.setOnAction(e -> {\n try {\n deleteBuildingButtonClicked();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n });\n\n // Update Button\n updateInfoButton.setOnAction(e -> {\n try {\n updateBuildingButtonClicked();\n AdminSceneController.loadBuildingTP(ac);\n ac.setExpandedPane(AdminSceneController.buildingTP);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n });\n\n // Add Button\n addButtonBuilding.setOnAction(e -> {\n String buildingNameInputText = buildingNameInput.getText();\n String openTimeInputText = openTimeInput.getValue().toString();\n String closeTimeInputText = closeTimeInput.getValue().toString();\n String streetNameInputText = streetNameInput.getText();\n String streetNumberInputText = streetNumberInput.getText();\n String zipCodeInputText = zipCodeInput.getText();\n String cityInputText = cityInput.getText();\n\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(null);\n String success = BuildingCommunication.addBuilding(buildingNameInputText, LocalTime.parse(openTimeInputText), LocalTime.parse(closeTimeInputText),\n streetNameInputText, streetNumberInputText, zipCodeInputText, cityInputText);\n if (success.equals(\"Successful\")) {\n alert.hide();\n } else {\n alert.setContentText(success);\n alert.showAndWait();\n }\n\n buildingNameInput.setText(null);\n openTimeInput.setValue(null);\n closeTimeInput.setValue(null);\n streetNameInput.setText(null);\n streetNumberInput.setText(null);\n zipCodeInput.setText(null);\n cityInput.setText(null);\n AdminSceneController.loadBuildingTP(ac);\n ac.setExpandedPane(AdminSceneController.buildingTP);\n });\n\n tableBuilding.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);\n\n tableBuilding.getStyleClass().add(\"center\");\n hboxBottom.getStyleClass().add(\"bottom\");\n vboxRight.getStyleClass().add(\"right\");\n addButtonBuilding.getStyleClass().setAll(\"restaurant-menu-button\");\n deleteInfoButton.getStyleClass().setAll(\"restaurant-menu-button\");\n updateInfoButton.getStyleClass().setAll(\"restaurant-menu-button\");\n deleteTimeButton.getStyleClass().setAll(\"restaurant-menu-button\");\n updateTimeButton.getStyleClass().setAll(\"restaurant-menu-button\");\n\n // All elements in BorderPane\n BorderPane borderPane = new BorderPane();\n borderPane.getStyleClass().add(\"admin-border-pane\");\n borderPane.setCenter(tableBuilding);\n borderPane.setRight(vboxRight);\n borderPane.setBottom(hboxBottom);\n\n return borderPane;\n }", "@Test\n public void test3IsCreatable()throws Exception{\n\n //Zone\n Position pos = new Position(0,0);\n generateLevel.landOn(pos,BlockType.PATH.toString());\n\n NormalDefender nd = new NormalDefender(generateLevel.getZoneList().\n get(0).getPos(),generateLevel.getAttackersList());\n if(generateLevel.isCreatable(nd)){\n generateLevel.getDefendersList().push(nd);\n }\n\n NormalDefender nd2 = new NormalDefender(generateLevel.getZoneList().\n get(0).getPos(),generateLevel.getAttackersList());\n assertFalse(generateLevel.isCreatable(nd2));\n }", "void addTestTermsAndCourses() {\n // Creates Terms\n addTerm(\"Term 1\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 2\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 3\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 4\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 5\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 6\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 7\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 8\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 9\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 10\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 11\", \"5/19/2019\", \"6/23/2019\");\n addTerm(\"Term 12\", \"5/19/2019\", \"6/23/2019\");\n int term1Id = getTermIdFromIndex(0);\n int term2Id = getTermIdFromIndex(1);\n// int term3Id = getTermIdFromIndex(2);\n\n // Creates Courses\n addCourse(\"course 1\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term1Id);\n addCourse(\"course 2\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term1Id);\n addCourse(\"course 3\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term2Id);\n addCourse(\"course 4\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term1Id);\n addCourse(\"course 5\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term1Id);\n addCourse(\"course 6\", \"5/29/2019\", \"5/29/19\",\n \"Working On\", \"Dr. Phil\", \"80183834433\",\n \"[email protected]\", \"TESTING OPTIONAL NOTE\", term2Id);\n int course1Id = getCourseIdFromIndex(0);\n int course2Id = getCourseIdFromIndex(1);\n\n // Creates Assignments\n addAssignment(\"Assignment 1\", \"this shit is whack\", \"5/29/2019\", course1Id);\n addAssignment(\"Assignment 2\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 3\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 4\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 5\", \"this shit is whack\", \"5/29/2019\", course1Id);\n addAssignment(\"Assignment 6\", \"this shit is whack\", \"5/29/2019\", null);\n addAssignment(\"Assignment 7\", \"this shit is whack\", \"5/29/2019\", course1Id);\n addAssignment(\"Assignment 8\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 9\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 10\", \"this shit is whack\", \"5/29/2019\", course2Id);\n addAssignment(\"Assignment 11\", \"this shit is whack\", \"5/29/2019\", course1Id);\n addAssignment(\"Assignment 12\", \"this shit is whack\", \"5/29/2019\", null);\n }", "@Test\n public void createFormSceduleEntry(){\n ScheduleEntry entry = new ScheduleEntry(\"9;00AM\", new SystemCalendar(2018,4,25));\n }", "public Form(){\n\t\ttypeOfLicenseApp = new TypeOfLicencsApplication();\n\t\toccupationalTrainingList = new ArrayList<OccupationalTraining>();\n\t\taffiadavit = new Affidavit();\n\t\tapplicationForReciprocity = new ApplicationForReciprocity();\n\t\teducationBackground = new EducationBackground();\n\t\toccupationalLicenses = new OccupationalLicenses();\n\t\tofficeUseOnlyInfo = new OfficeUseOnlyInfo();\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString emailTo = \"[email protected]\";\n\t\tString body = \"\";\n\t\tString subject = \"Information for an apartment building!\";\n\t\t\n\t\t\n\t\t//first construct units, then construct a tenant with a unit\n\t\tArrayList<unit> thirtyFourthStreet = new ArrayList<unit>();\n\t\tArrayList<tenant> thirtyFourthStreetTenants = new ArrayList<tenant>();\n\t\t\n\t\tunit oneA = new unit(\"1 Bedroom\", 1400, \"1a\");\n\t\tunit oneB = new unit(\"2 Bedroom\", 2500, \"1b\");\n\t\tunit oneC = new unit(\"1 Bedroom\", 1600, \"1c\");\n\t\tunit oneD = new unit(\"3 Bedroom\", 3500, \"1d\");\n\t\t\n\t\tunit twoA = new unit(\"2 Bedroom\", 2200, \"2a\");\n\t\tunit twoB = new unit(\"2 Bedroom\", 2600, \"2b\");\n\t\tunit twoC = new unit(\"1 Bedroom\", 1500, \"2c\");\n\t\tunit twoD = new unit(\"2 Bedroom\", 1300, \"2d\");\n\t\t\n\t\tthirtyFourthStreet.add(oneA);\n\t\tthirtyFourthStreet.add(oneB);\n\t\tthirtyFourthStreet.add(oneC);\n\t\tthirtyFourthStreet.add(oneD);\n\t\t\n\t\tthirtyFourthStreet.add(twoA);\n\t\tthirtyFourthStreet.add(twoB);\n\t\tthirtyFourthStreet.add(twoC);\n\t\tthirtyFourthStreet.add(twoD);\n\t\t\n\t\ttenant josh = new tenant(\"Josh\", oneA, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant bob = new tenant(\"Bob\", oneB, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant tracy = new tenant(\"Tracy\", oneC, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant sam = new tenant(\"Sam\", oneD, \"01/22/2017\", \"01/22/2018\");\n\t\t\n\t\ttenant samantha = new tenant(\"Samantha\", twoA, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant bruce = new tenant(\"Bruce\", twoB, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant rebecca = new tenant(\"Rebecca\", twoC, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant steve = new tenant(\"Steve\", twoD, \"01/22/2017\", \"01/22/2018\");\n\t\t\n\t\tthirtyFourthStreetTenants.add(josh);\n\t\tthirtyFourthStreetTenants.add(bob);\n\t\tthirtyFourthStreetTenants.add(tracy);\n\t\tthirtyFourthStreetTenants.add(sam);\n\t\tthirtyFourthStreetTenants.add(samantha);\n\t\tthirtyFourthStreetTenants.add(bruce);\n\t\tthirtyFourthStreetTenants.add(rebecca);\n\t\tthirtyFourthStreetTenants.add(steve);\n\t\t/*\n\t\tSystem.out.println(\"Tracy, which apartment are you in?\");\n\t\tSystem.out.println(tracy.apartment.id);\n\t\tSystem.out.println(\"How big is your unit?\");\n\t\tSystem.out.println(tracy.apartment.size);\n\t\tSystem.out.println(\"What is your rent?\");\n\t\tSystem.out.println(tracy.apartment.rent);\n\t\t*/\n\t\t\n\t\tbody += \"Tracy, which apartment are you in?\\n\";\n\t\tbody += tracy.apartment.id + \"\\n\";\n\t\tbody += \"How big is your unit?\\n\";\n\t\tbody += tracy.apartment.size + \"\\n\";\n\t\tbody += \"What is your rent?\\n\";\n\t\tbody += tracy.apartment.rent + \"\\n\";\n\t\t\n\t\tbody += \"Name everyone in my building and what they're paying.\\n\";\n\t\tfor (tenant a : thirtyFourthStreetTenants){\n\t\tbody += a.name + \" \" + a.apartment.id + \" \" + a.apartment.rent + \"\\n\";\n\t\t}\n\t\t\n\t\tEmail newEmail = new Email(emailTo, body, subject);\n\t\tnewEmail.sendEmail();\n\t}", "public void buildProjector(int quantity){\r\n if (quantity != 0){\r\n eventRoomItems.addItem(itemFactory.constructProjector());\r\n }\r\n else{\r\n eventRoomItems.addItem(null);\r\n }\r\n }", "private Contest createContestForTest() {\r\n EntityManager em = com.topcoder.service.studio.contest.bean.MockEntityManager.EMF.createEntityManager();\r\n em.getTransaction().begin();\r\n\r\n StudioFileType fileType = new StudioFileType();\r\n populateStudioFileType(fileType);\r\n em.persist(fileType);\r\n\r\n ContestChannel channel = new ContestChannel();\r\n populateContestChannel(channel);\r\n em.persist(channel);\r\n\r\n ContestType contestType = new ContestType();\r\n populateContestType(contestType);\r\n contestType.setContestType(1L);\r\n em.persist(contestType);\r\n\r\n ContestStatus status = new ContestStatus();\r\n status.setDescription(\"description\");\r\n status.setName(\"Name\");\r\n status.setContestStatusId(10L);\r\n status.setStatusId(1L);\r\n em.persist(status);\r\n\r\n Date date = new Date();\r\n ContestGeneralInfo generalInfo = new ContestGeneralInfo();\r\n generalInfo.setBrandingGuidelines(\"guideline\");\r\n generalInfo.setDislikedDesignsWebsites(\"disklike\");\r\n generalInfo.setGoals(\"goal\");\r\n generalInfo.setOtherInstructions(\"instruction\");\r\n generalInfo.setTargetAudience(\"target audience\");\r\n generalInfo.setWinningCriteria(\"winning criteria\");\r\n\r\n ContestMultiRoundInformation multiRoundInformation = new ContestMultiRoundInformation();\r\n multiRoundInformation.setMilestoneDate(new Date());\r\n multiRoundInformation.setRoundOneIntroduction(\"round one\");\r\n multiRoundInformation.setRoundTwoIntroduction(\"round two\");\r\n\r\n ContestSpecifications specifications = new ContestSpecifications();\r\n specifications.setAdditionalRequirementsAndRestrictions(\"none\");\r\n specifications.setColors(\"white\");\r\n specifications.setFonts(\"Arial\");\r\n specifications.setLayoutAndSize(\"10px\");\r\n\r\n PrizeType prizeType = new PrizeType();\r\n prizeType.setDescription(\"Good\");\r\n prizeType.setPrizeTypeId(1L);\r\n em.persist(prizeType);\r\n\r\n MilestonePrize milestonePrize = new MilestonePrize();\r\n milestonePrize.setAmount(10.0);\r\n milestonePrize.setCreateDate(new Date());\r\n milestonePrize.setNumberOfSubmissions(1);\r\n milestonePrize.setType(prizeType);\r\n\r\n Contest entity = new Contest();\r\n\r\n entity.setContestChannel(channel);\r\n entity.setContestType(contestType);\r\n entity.setCreatedUser(10L);\r\n entity.setEndDate(date);\r\n entity.setEventId(101L);\r\n entity.setForumId(1000L);\r\n entity.setName(\"name\");\r\n entity.setProjectId(101L);\r\n entity.setStartDate(date);\r\n entity.setStatus(status);\r\n entity.setStatusId(1L);\r\n entity.setTcDirectProjectId(1L);\r\n entity.setWinnerAnnoucementDeadline(date);\r\n entity.setGeneralInfo(generalInfo);\r\n entity.setSpecifications(specifications);\r\n entity.setMultiRoundInformation(multiRoundInformation);\r\n entity.setMilestonePrize(milestonePrize);\r\n\r\n em.getTransaction().commit();\r\n\r\n em.close();\r\n return entity;\r\n }", "void insertfacultydata(Faculty fac_insert);", "private void _generateAnAssociateProfessor(int index) {\n String id = _getId(CS_C_ASSOPROF, index);\n writer_.startSection(CS_C_ASSOPROF, id);\n if(globalVersionTrigger){\n \twriter_log.addPropertyInstance(id, RDF.type.getURI(), ontology+\"#AssociateProfessor\", true); \t\n }\n _generateAProf_a(CS_C_ASSOPROF, index, id);\n writer_.endSection(CS_C_ASSOPROF);\n _assignFacultyPublications(id, ASSOPROF_PUB_MIN, ASSOPROF_PUB_MAX);\n \n }", "public void validateCreateCustomerAndTask() {\n\t\tAttSelectNewCustomerOptionFromListBox.click();\n\t\tAttCustomerNameTextBox.sendKeys(\"TestCust\");\n\t\tAttProjectNameTextBox.sendKeys(\"TestProject\");\n\t\tAttTaskNameTextBox.sendKeys(\"Tast1WCNP\");\n\t\tAttBudgetTimeTextBox.sendKeys(\"3:00\");\n\t\tAttEnterDateInDateField.sendKeys(Keys.ENTER,\"Jan 27, 2019\");\n\t\tAttSelectBillableBillingType.click();\n\t\tAttSelectCheckBoxMarkToBeAdd.click();\n\t\tAttCreateTaskBtn.click();\n\t}", "@Override\n public boolean createApprisialForm(ApprisialFormBean apprisial) {\n apprisial.setGendate(C_Util_Date.generateDate());\n return in_apprisialformdao.createApprisialForm(apprisial);\n }", "@Test\n public void createComaPatients() {\n \n Assert.assertEquals(service.createComa().get(0).getBedNumber(), \"45\");\n }", "interface FullCase {\n\n static CaseData build() {\n return CaseData.builder()\n .textField(TEXT)\n .numberField(NUMBER)\n .yesOrNoField(YES_OR_NO)\n .phoneUKField(PHONE_UK)\n .emailField(EMAIL)\n .moneyGBPField(MONEY_GBP)\n .dateField(DATE)\n .dateTimeField(DATE_TIME)\n .textAreaField(TEXT_AREA)\n .fixedListField(FIXED_LIST)\n .multiSelectListField(MULTI_SELECT_LIST)\n .collectionField(new AATCaseType.CollectionItem[]{\n new AATCaseType.CollectionItem(null, COLLECTION_VALUE_1),\n new AATCaseType.CollectionItem(null, COLLECTION_VALUE_2)\n })\n .complexField(new AATCaseType.ComplexType(COMPLEX_TEXT, COMPLEX_FIXED_LIST))\n .addressUKField(\n AATCaseType.AddressUKField.builder()\n .addressLine1(ADDRESS_LINE_1)\n .addressLine2(ADDRESS_LINE_2)\n .addressLine3(ADDRESS_LINE_3)\n .postTown(ADDRESS_POST_TOWN)\n .county(ADDRESS_COUNTY)\n .postCode(ADDRESS_POSTCODE)\n .country(ADDRESS_COUNTRY)\n .build()\n )\n .build();\n }\n }", "@FXML\n\tpublic void addInvestor() {\n\t\tString iName = name.getText();\n\t\tString iSurname = surname.getText();\n\t\tString iPesel = pesel.getText();\n\t\tString iBudget = budget.getText();\n\t\tif (iName.isEmpty()) {\n\t\t\tshowErrorDialog(\"Provide valid name\");\n\t\t} else if (iSurname.isEmpty()) {\n\t\t\tshowErrorDialog(\"Provide valid surname\");\n\t\t} else if (!NumberUtils.isPESEL(iPesel)) {\n\t\t\tshowErrorDialog(\"Given PESEL is not valid\");\n\t\t} else if (!NumberUtils.isNumeric(iBudget)) {\n\t\t\tshowErrorDialog(\"Given budget is not valid\");\n\t\t} else {\n\t\t\tInvestor investor = new Investor(iName, iSurname, iPesel, iBudget);\n\t\t\tPseudoDB.addNewInwestor(investor);\n\t\t\tPseudoDB.showAllInvestors();\n\t\t\tStage stage = (Stage) closePopUpIco.getScene().getWindow();\n\t\t\tBlurUtils.unblur();\n\t\t\tstage.close();\n\t\t}\n\n\t}", "Gradian createGradian();", "void showFaithCube(FamilyColor familyColor, int cardOrdinal);", "@FXML\r\n public void createNewAccount(ActionEvent e) throws Exception{\r\n String name = nameField.getText(); //Get nameField text\r\n String grade = gradeField.getText(); //Get gradeField text\r\n String serial = \"1\"; //Create random serial code\r\n String email = emailField.getText(); //Get emailField text\r\n String pnumber = pnumberField.getText(); //Get pnumberField text\r\n Boolean once = true;\r\n\r\n ArrayList <ComboBox> boxList = new ArrayList<>(); //Create new ArrayList with ComboBox type\r\n Collections.addAll(boxList,courseComboBox1, courseComboBox2, courseComboBox3, courseComboBox4, courseComboBox5, courseComboBox6); //Add Course ComboBoxes to ArrayList\r\n\r\n String courseStr = \"\"; //Initialize courseStr (to be written to file)\r\n for (int i = 0; i <boxList.size(); i++){\r\n try{\r\n String tempC = boxList.get(i).getValue().toString();\r\n if (tempC != null){\r\n if (once) {\r\n courseStr = courseStr + tempC;\r\n once = false;\r\n }else{\r\n courseStr = courseStr + \"%\" + tempC;\r\n }\r\n }\r\n System.out.println(tempC);\r\n } catch (NullPointerException error){\r\n System.out.println(\"No Input\");\r\n }\r\n }\r\n\r\n\r\n try(BufferedWriter locFile = new BufferedWriter(new FileWriter(\"src/resources/peerTutorsData.txt\", true))){ //Write data to file\r\n locFile.write(name + \"~\" + courseStr + \"~\" + grade + \"~\" + serial + \"~\" + email + \"~\" + pnumber+\"\\n\");\r\n }\r\n\r\n }", "private void createGrpPharmacyDetails() {\n\t\tgrpPharmacyDetails = new Group(getShell(), SWT.NONE);\n\t\tgrpPharmacyDetails.setText(\"Facility Details (shown on labels and reports)\");\n\t\tgrpPharmacyDetails.setBounds(new Rectangle(40, 250, 720, 320));\n\t\tgrpPharmacyDetails.setFont(ResourceUtils.getFont(iDartFont.VERASANS_8));\n\t}", "void format07(String line, int lineCount) {\n\n // is this the first record in the file?\n checkFirstRecord(code, lineCount);\n\n // get the data off the line\n java.util.StringTokenizer t = new java.util.StringTokenizer(line, \" \");\n String dummy = t.nextToken(); // get 'rid' of the code\n\n int subCode = 0;\n if (dataType == WATERWOD) {\n if (t.hasMoreTokens()) subCode = toInteger(t.nextToken());\n switch (subCode) {\n case 1: if (t.hasMoreTokens()) watProfQC.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) //set profile DIC quality flag\n watProfQC.setDic((toInteger(t.nextToken())));\n if (t.hasMoreTokens()) t.nextToken(); // is no profile DOC quality flag\n if (t.hasMoreTokens()) t.nextToken(); // is no profile fluoride quality flag\n if (t.hasMoreTokens()) t.nextToken(); // is no profile iodene quality flag\n if (t.hasMoreTokens()) t.nextToken(); // is no profile iodate quality flag\n break;\n } // switch (subCode)\n } // if (dataType = WATERWOD)\n\n // there can only be one code 07 record per substation\n if (subCode != 1) code07Count++;\n if (code07Count > 1) {\n outputError(lineCount + \" - Fatal - \" +\n \"More than 1 code 07 record in substation\");\n } // if (code07Count > 1)\n\n\n if (dataType == SEDIMENT) {\n\n //01 a2 format code always \"07\" n/a\n //02 a12 stnid station id: composed as for format 03 sedphy\n //03 f7.3 toc µgm / gram sedchem1\n //04 f8.3 fluoride µgm / gram sedchem1\n //05 f7.2 kjn µgm / gram sedchem1\n //06 f7.3 oxa µgm / gram sedchem1\n //07 f7.3 ptot µgm / gram sedchem1\n\n if (t.hasMoreTokens()) sedphy.setStationId(toString(t.nextToken()));\n if (t.hasMoreTokens()) sedchem1.setToc(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedchem1.setFluoride(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedchem1.setKjn(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedchem1.setOxa(toFloat(t.nextToken(), 1f));\n if (t.hasMoreTokens()) sedchem1.setPtot(toFloat(t.nextToken(), 1f));\n\n // station Id must match that of previous station record\n checkStationId(lineCount, sedphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format07: sedchem1 = \" + sedchem1);\n\n } else if ((dataType == WATER) || (dataType == WATERWOD)) {\n\n //01 a2 format code always \"07\" n/a\n //02 a12 stnid station id: composed as for format 03 watphy\n //03 f10.3 DIC µgm / litre watchem1\n //04 f7.2 DOC mgm / litre watchem1\n //05 f8.3 fluoride µgm / litre watchem1\n //06 f7.2 iodene µgm atom / litre = µM watchem1\n //07 f7.3 iodate µgm atom / litre = µM watchem1\n\n // subCode = 1 - ignore\n // subCode = 0 (WATER) or subCode = 2 (WATERWOD)\n if (subCode != 1) {\n if (t.hasMoreTokens()) watphy.setStationId(toString(t.nextToken()));\n\n if (t.hasMoreTokens()) watchem1.setDic(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) // set DIC quality flag\n watQC.setDic((toInteger(t.nextToken())));\n\n if (t.hasMoreTokens()) watchem1.setDoc(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile DOC quality flag\n\n if (t.hasMoreTokens()) watchem1.setFluoride(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile fluoride quality flag\n\n if (t.hasMoreTokens()) watchem1.setIodene(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile iodene quality flag\n\n if (t.hasMoreTokens()) watchem1.setIodate(toFloat(t.nextToken(), 1f));\n if ((dataType == WATERWOD) && (t.hasMoreTokens())) t.nextToken(); // is no profile iodate quality flag\n\n // station Id must match that of previous station record\n checkStationId(lineCount, watphy.getStationId(\"\"));\n\n if (dbg) System.out.println(\"format07: watchem1 = \" + watchem1);\n\n } // if (subCode != 1)\n\n } // if (dataType == SEDIMENT)\n\n }", "public void onCreate() {\r\n Session session = sessionService.getCurrentSession();\r\n Map<String, Region> items = ControlUtility.createForm(Pc.class);\r\n\r\n ControlUtility.fillComboBox((ComboBox<Kind>) items.get(\"Kind\"), session.getCampaign().getCampaignVariant().getKinds());\r\n ControlUtility.fillComboBox((ComboBox<Race>) items.get(\"Race\"), session.getCampaign().getCampaignVariant().getRaces());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Ability>) items.get(\"SavingThrows\"), Arrays.asList(Ability.values()));\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Proficiency>) items.get(\"Proficiencies\"), session.getCampaign().getCampaignVariant().getProficiencies());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Feature>) items.get(\"Features\"), session.getCampaign().getCampaignVariant().getFeatures());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Trait>) items.get(\"Traits\"), session.getCampaign().getCampaignVariant().getTraits());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Equipment>) items.get(\"Equipment\"), session.getCampaign().getCampaignVariant().getEquipments());\r\n\r\n Campaign campaign = session.getCampaign();\r\n\r\n Dialog<String> dialog = ControlUtility.createDialog(\"Create Playable Character\", items);\r\n dialog.show();\r\n\r\n dialog.setResultConverter(buttonType -> {\r\n if (buttonType != null) {\r\n Pc pc = null;\r\n try {\r\n pc = ControlUtility.controlsToValues(Pc.class, items);\r\n } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n if (pc != null) {\r\n try {\r\n characterService.createPlayerCharacter(pc);\r\n } catch (SessionAlreadyExists | IndexAlreadyExistsException sessionAlreadyExists) {\r\n sessionAlreadyExists.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n Player player = playerManagementService.getRegisteredPlayer();\r\n campaign.addPlayer(player);\r\n campaign.addCharacter(pc);\r\n if (campaignListingService.campaignExists(campaign.getId())) {\r\n manipulationService.updateCampaign(campaign);\r\n } else {\r\n manipulationService.createCampaign(campaign);\r\n }\r\n } catch (MultiplePlayersException | EntityNotFoundException | SessionAlreadyExists | IndexAlreadyExistsException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n } catch (MultiplePlayersException | EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n sessionService.updateParticipant(playerManagementService.getRegisteredPlayer().getId(), pc.getId());\r\n sessionService.updateCampaign(campaign);\r\n } catch (EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n render();\r\n return pc.toString();\r\n }\r\n }\r\n return null;\r\n });\r\n }", "@Test\n\tpublic void createContactWithoutMandatoryDetailsTest() throws Throwable {\n\t\tHome homePage = PageFactory.initElements(driver, Home.class);\n\t\thomePage.getContactsLnk().click();\n\t\t\n\t\t/*navigate to Create New Contact Page*/\n\t\tContacts contactPage = PageFactory.initElements(driver, Contacts.class);\n\t\tcontactPage.getCreateContactImg().click();\n\t\t\n\t\t/*creating contact without details*/\n\t\tCreatingNewContact createNewContPage = PageFactory.initElements(driver, CreatingNewContact.class);\n\t\tcreateNewContPage.getSaveBtn().click();\n\t\t\n\t\t/*capture alert popup message*/\n\t\tString actAlertMsg = utils.alertPopUpMsg();\n\t\tString expAlertMsg = fLib.getExcelData(\"Sheet1\", 4, 3);\n\t\t\n\t\t/*Validation*/\n\t\tAssert.assertEquals(actAlertMsg, expAlertMsg);\n\t\tReporter.log(\"CreateContactWithoutMandatoryDetails successfully Validated === PASS\", true);\n\t\t\n\t}", "public void tabla_campos() {\n int rec = AgendarA.tblAgricultor.getSelectedRow();// devuelve un entero con la posicion de la seleccion en la tabla\n ccAgricultor = AgendarA.tblAgricultor.getValueAt(rec, 1).toString();\n crearModeloAgenda();\n }", "private String e19BuildStaffGageString(String s) {\n String tmp1 = null;\n if ((s != null) && (s.length() > 0)) {\n tmp1 = String.format(\"%c%s-%c\", SEP_CHAR, s, SEP_CHAR);\n } else {\n tmp1 = String.format(\"%c-----%c\", SEP_CHAR, SEP_CHAR);\n }\n\n return tmp1;\n }", "public void hireFullTimeStaff (String staffName, String joiningDate, String qualification, String appointedBy) {\n if (joined == true) {\n System.out.println(\"The name of staff is \"+staffName+\"\"+\"and the joining date is \"+joiningDate);\n }else{\n this.staffName = staffName;\n this.joiningDate = joiningDate;\n this.qualification = qualification;\n this.appointedBy = appointedBy;\n joined = true;\n }\n }", "WithCreate withFreeSku();" ]
[ "0.6010579", "0.5555347", "0.55129206", "0.523131", "0.52160186", "0.50895184", "0.5051138", "0.50176144", "0.49715534", "0.49348646", "0.48698464", "0.4857675", "0.48251244", "0.4796674", "0.4763348", "0.4704909", "0.46178204", "0.45782217", "0.4562436", "0.4551722", "0.45394093", "0.4529105", "0.45290497", "0.4520896", "0.45196027", "0.4519206", "0.45188573", "0.4501369", "0.44741607", "0.44606346", "0.44575936", "0.44430813", "0.44307733", "0.43920335", "0.43882585", "0.43773904", "0.4372681", "0.43605772", "0.43475053", "0.43173283", "0.4314122", "0.4301965", "0.42921475", "0.42900187", "0.42834643", "0.4278264", "0.42737055", "0.42706883", "0.4258604", "0.42538744", "0.4249032", "0.42479938", "0.42365605", "0.42277583", "0.420784", "0.42031512", "0.4197731", "0.41975924", "0.41970024", "0.4196456", "0.418429", "0.41741717", "0.41702357", "0.41661248", "0.41618338", "0.4156179", "0.4154133", "0.41538602", "0.41537604", "0.41496196", "0.41461092", "0.41436213", "0.41330665", "0.4126784", "0.41252807", "0.4123832", "0.41215557", "0.41192976", "0.41166657", "0.41142166", "0.41140342", "0.4114015", "0.41114908", "0.41003996", "0.4100038", "0.40981746", "0.40964845", "0.40947098", "0.40899587", "0.40865532", "0.40854648", "0.4077413", "0.40771082", "0.4074116", "0.40630034", "0.40617976", "0.40541744", "0.40540898", "0.40482038", "0.4047417" ]
0.64475054
0
Logger logger = Logger.getLogger("test");
public static void createFoundation(String campus,String user,String kix) throws Exception { boolean debug = true; boolean compressed = true; FileWriter fstream = null; BufferedWriter output = null; Connection conn = null; String type = "PRE"; String sql = ""; String documents = ""; String fileName = ""; String alpha = ""; String num = ""; String courseTitle = ""; String fndType = ""; int rowsAffected = 0; PreparedStatement ps = null; boolean htmlCreated = false; String currentDrive = AseUtil.getCurrentDrive(); try { conn = AsePool.createLongConnection(); if (conn != null){ String[] info = getKixInfo(conn,kix); alpha = info[Constant.KIX_ALPHA]; num = info[Constant.KIX_NUM]; courseTitle = info[Constant.KIX_COURSETITLE]; fndType = info[Constant.KIX_ROUTE]; type = info[Constant.KIX_TYPE]; info = Helper.getKixRoute(conn,campus,alpha,num,"CUR"); String courseKix = info[0]; int id = NumericUtil.getInt(getFndItem(conn,kix,"id"),0); if (debug) { logger.info("campus: " + campus); logger.info("kix: " + kix); logger.info("alpha: " + alpha); logger.info("num: " + num); logger.info("courseTitle: " + courseTitle); logger.info("fndType: " + fndType); logger.info("type: " + type); } String htmlHeader = Util.getResourceString("fndheader.ase"); String htmlFooter = Util.getResourceString("fndfooter.ase"); if (debug) logger.info("resource HTML"); documents = SysDB.getSys(conn,"documents"); if (debug) logger.info("obtained document folder"); try { fileName = currentDrive + ":" + documents + "fnd\\" + campus + "\\" + kix + ".html"; if (debug) logger.info(fileName); fstream = new FileWriter(fileName); output = new BufferedWriter(fstream); output.write(htmlHeader); htmlCreated = false; try{ String junk = viewFoundation(conn,kix); if(CompDB.hasSLOs(conn,courseKix)){ junk += "<hr size=\"1\" noshade=\"\"><br/><br/>" + getLinkedItems(conn,campus,user,id,kix,Constant.COURSE_OBJECTIVES,true); } junk = junk.replace("<br>","<br/>"); output.write(junk); Html.updateHtml(conn,Constant.FOUNDATION,kix); htmlCreated = true; } catch(Exception e){ logger.fatal("FndDB.createFoundation - fail to create foundation - " + campus + " - " + kix + "\n" + e.toString()); } Calendar calendar = Calendar.getInstance(); String copyRight = "" + calendar.get(Calendar.YEAR); htmlFooter = htmlFooter.replace("[FOOTER_COPYRIGHT]","Copyright ©1999-"+copyRight+" All rights reserved.") .replace("[FOOTER_STATUS_DATE]",footerStatus(conn,kix,type)); if (debug) logger.info("obtained document folder"); output.write(htmlFooter); if (debug) logger.info("HTML created"); } catch(Exception e){ logger.fatal("FndDB.createFoundation - fail to open/create file - " + campus + " - " + kix + " - " + "\n" + e.toString()); } finally { output.close(); } conn.close(); conn = null; if (debug) logger.info("connection closed"); } // if conn != null } catch (Exception e) { logger.fatal("FndDB.createFoundation FAILED3 - " + campus + " - " + kix + " - " + "\n" + e.toString()); } finally{ try{ if (conn != null){ conn.close(); conn = null; } } catch(Exception e){ logger.fatal("FndDB.createFoundation\n" + kix + "\n" + e.toString()); } } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLoggerName() {\n return \"test\";\n }", "private Logger getLogger() {\n return LoggingUtils.getLogger();\n }", "private static Logger getLogger() {\n return LogDomains.getLogger(ClassLoaderUtil.class, LogDomains.UTIL_LOGGER);\n }", "Object createLogger(String name);", "public Logger getLogger()\n/* */ {\n/* 77 */ if (this.logger == null) {\n/* 78 */ this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(this.name);\n/* */ }\n/* 80 */ return this.logger;\n/* */ }", "public Logger (){}", "public Logger getLogger(){\n\t\treturn logger;\n\t}", "public Logger getLogger() {\n\treturn _logger;\n }", "public Logger getLogger() {\n return logger;\n }", "protected static Logger log() {\n return LogSingleton.INSTANCE.value;\n }", "public Logger getLogger()\n\t{\n\t\treturn logger;\n\t}", "public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }", "public static Logger get() {\n\t\treturn LoggerFactory.getLogger(WALKER.getCallerClass());\n\t}", "public Logger getLogger() {\t\t\n\t\treturn logger = LoggerFactory.getLogger(getClazz());\n\t}", "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "public static Logger getLogger() {\r\n\t\tif (log == null) {\r\n\t\t\tinitLogs();\r\n\t\t}\r\n\t\treturn log;\r\n\t}", "public Logger getLogger() {\n return logger;\n }", "@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}", "@Override\r\n\tpublic Logger getLogger() {\r\n\t\t\r\n\t\treturn LogFileGenerator.getLogger();\r\n\t\t\r\n\t}", "private Logger(){ }", "public static Logger logger() {\n return logger;\n }", "protected abstract Logger getLogger();", "private Logger getLogger() {\n return LoggerFactory.getLogger(ApplicationManager.class);\n }", "private static Logger getLogger() {\n if (logger == null) {\n try {\n new transactionLogging();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "Logger getLogger(final String loggerName);", "protected Logger getLogger() {\n return LoggerFactory.getLogger(getClass());\n }", "private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }", "public Logger getLogger()\n {\n return this.logger;\n }", "private Logger() {\n\n }", "public static Logger getLogger()\n {\n if (logger == null)\n {\n Log.logger = LogManager.getLogger(BAG_DESC);\n }\n return logger;\n }", "public static Log getLogger() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog();\r\n }\r\n return l;\r\n }", "@Override\n public MagicLogger getLogger() {\n return logger;\n }", "public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }", "public RevisorLogger getLogger();", "public MyLogger () {}", "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 }", "public static Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(APILOGS);\n\n try {\n\n // This block configure the logger with handler and formatter\n // The boolean value is to append to an existing file if exists\n\n getFileHandler();\n\n logger.addHandler(fh);\n SimpleFormatter formatter = new SimpleFormatter();\n fh.setFormatter(formatter);\n\n // this removes the console log messages\n // logger.setUseParentHandlers(false);\n\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return logger;\n }", "protected Logger getLogger() {\n if (logger == null) {\n logger = Logger.getLogger(getClass().getName());\n }\n return logger;\n }", "public static Logger getInstance() {\n if (logger == null)\n logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);\n return logger;\n }", "void initializeLogging();", "public AstractLogger getDefaultLogger()\n {\n return new DefaultLogger();\n }", "public static Logger getLogger(String name) {\n\t\tif (name != null && name.length() > 0) {\n\t\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\t\t\t// BasicConfigurator.configure();\n\t\t} else {\n\t\t\tBasicConfigurator.configure();\n\t\t}\n\n\t\t// get a logger instance named \"com.foo\"\n\t\t// Logger logger = Logger.getLogger(\"com.foo\");\n\t\t// ApacheLogTest.class.getResource(\"log4j.properties\");\n\t\tLogger logger = Logger.getLogger(name);\n\n\t\t// Now set its level. Normally you do not need to set the\n\t\t// level of a logger programmatically. This is usually done\n\t\t// in configuration files.\n\t\tlogger.setLevel(Level.ALL);\n\n\t\t// Logger barlogger = Logger.getLogger(\"com.foo.Bar\");\n\n\t\t// The logger instance barlogger, named \"com.foo.Bar\",\n\t\t// will inherit its level from the logger named\n\t\t// \"com.foo\" Thus, the following request is enabled\n\t\t// because INFO >= INFO.\n\t\t// barlogger.info(\"Located nearest gas station.\");\n\n\t\t// This request is disabled, because DEBUG < INFO.\n\t\t// barlogger.debug(\"Exiting gas station search\");\n\n\t\t// ///////////// Appenders ////////////////////////\n\n\t\t// Log4j allows logging requests to print to multiple destinations. In\n\t\t// log4j speak, an output destination is called an appender.\n\n\t\t// Currently, appenders exist for the console, files, GUI components,\n\t\t// remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog\n\t\t// daemons. It is also possible to log asynchronously.\n\n\t\t// ///////////// Layouts ////////////////////////\n\n\t\t// More often than not, users wish to customize not only the output\n\t\t// destination but also the output format. This is accomplished by\n\t\t// associating a layout with an appender. The layout is responsible for\n\t\t// formatting the logging request according to the user's wishes,\n\t\t// whereas an appender takes care of sending the formatted output to its\n\t\t// destination\n\t\treturn logger;\n\t}", "protected abstract ILogger getLogger();", "private Logger(){\n\n }", "private synchronized ILogger getLogger()\n {\n if( _logger == null )\n _logger = ClearLogFactory.getLogger( ClearLogFactory.PERSIST_LOG,\n this.getClass() );\n return _logger;\n }", "private ExtentLogger() {}", "@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}", "Map<String, Logger> loggers();", "static Trace getLogger(String name)\n {\n return new Trace(Logger.getLogger(name));\n }", "public Logger getLogger() {\n //depending on the subclass, we'll get a particular logger.\n Logger logger = createLogger();\n\n //could do other operations on the logger here\n return logger;\n }", "protected Log getLogger() {\n return LOGGER;\n }", "public static BackupLogger getLogger() {\n\t\tif (BackupLogger.logger == null) BackupLogger.logger = new BackupLogger();\n\t\treturn BackupLogger.logger;\n\t}", "public Logger logger()\n\t{\n\t\tif (logger == null)\n\t\t{\n\t\t\tlogger = new Logger(PluginRegionBlacklist.this.getClass().getCanonicalName(), null)\n\t\t\t{\n\t\t\t\tpublic void log(LogRecord logRecord)\n\t\t\t\t{\n\n\t\t\t\t\tlogRecord.setMessage(loggerPrefix + logRecord.getMessage());\n\t\t\t\t\tsuper.log(logRecord);\n\t\t\t\t}\n\t\t\t};\n\t\t\tlogger.setParent(getLogger());\n\t\t}\n\t\treturn logger;\n\t}", "public Log(Logger logger) {\n this.logger = logger;\n }", "public Logger getLog () {\n return log;\n }", "public MCBLogger getLogger() {\n return logger;\n }", "public BaseLogger getLogger() {\r\n\t\treturn logger;\r\n\t}", "public static void loggingExample() {\n\t\tSystem.out.println(\"This is running with the default logger!\");\n\t\tnewLogger.fatal(\"This is fatal\");\n\t\tnewLogger.warn(\"This is the warn level\");\n\t\tnewLogger.info(\"This is the info level\");\n\t\t\n\t}", "public Logger log() {\n return LOG;\n }", "public final Logger getLogger() {\r\n return this.logger;\r\n }", "protected Logger getLogger() {\n return (logger);\n }", "void log();", "public String getLog();", "LogRecorder getLogRecorder();", "LogRecorder getLogRecorder();", "private LoggerSingleton() {\n\n }", "public static void log4jExample() {\n\t\tnewLogger.warn(\"This is the info level\");\n\t\t\n\t}", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}", "@Override\n\tpublic void initLogger() {\n\t\t\n\t}", "IFileLogger log();", "@Nonnull\n ScriptLogger getLogger();", "public Logger getLogger(String name) {\n\t\treturn this.hierarchy.getLogger(name);\n\t}", "Logger getLog(Class clazz);", "protected Logger getLogger(final Class<?> klaz) {\n\t\treturn MavenLoggerFactory.getLogger(klaz, getLog());\n\t}", "public interface Logger {\n\tpublic void log(String msg);\n}", "public LogKitLogger(String name)\n/* */ {\n/* 64 */ this.name = name;\n/* 65 */ this.logger = getLogger();\n/* */ }", "protected abstract Logger newInstance(String name);", "@Override\n\tprotected PublicationControlLogger getLogger() {\n\t\treturn logger;\n\t}", "Appendable getLog();", "public BuildLogger getLogger ( ) {\n @SuppressWarnings ( \"unchecked\" ) final List<? extends BuildListener> listeners = getProject ( ).getBuildListeners ( ) ;\n assert listeners.size ( ) > 0 ;\n return (BuildLogger) listeners.get ( 0 ) ;\n }", "Object createLogger(Class<?> clazz);", "public static Logger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }", "private synchronized ILogger _getAlertLogger()\n {\n if( alertlogger == null )\n alertlogger = ClearLogFactory.getLogger( ClearLogFactory.ALERT_LOG,\n this.getClass() );\n return alertlogger;\n }", "private static synchronized Logger initializeLogger(String path) {\r\n\t\tLogger logger = Logger.getLogger(\"Logging\");\r\n\t\tlogger.removeAllAppenders();\r\n\t\tLogger.getRootLogger().removeAllAppenders();\r\n\t\tFileAppender logAppender = null;\r\n\t\tLayout layout = new PatternLayout(\"%d [%M]: %m%n\");\r\n\t\ttry {\r\n\t\t\tlogAppender = new FileAppender(layout, path);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Problems creating log file...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.addAppender(logAppender);\r\n\t\tConsoleAppender consoleAppender = new ConsoleAppender(layout);\r\n\t\tlogger.addAppender(consoleAppender);\r\n\t\tlogger.setLevel(DEBUG);\r\n\t\treturn logger;\r\n\t}", "public static Logger getLogger(Class<?> clazz){\r\n if(clazz == null){\r\n // this condition will happen if the class has not been initialized\r\n return Logger.getRootLogger();\r\n }\r\n return Logger.getLogger(clazz.getPackage().getName());\r\n }", "private void logToFile() {\n }", "public static Log getLogger(final String key) {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog(key);\r\n }\r\n return l;\r\n }", "@Test\n public void testExistingLog4j2Logger() {\n org.apache.logging.log4j.LogManager.getLogger(\"existingLogger\");\n // Logger will be the one created above\n final Logger logger = Logger.getLogger(\"existingLogger\");\n final Logger l2 = LogManager.getLogger(\"existingLogger\");\n assertEquals(logger, l2);\n logger.setLevel(Level.ERROR);\n final Priority debug = Level.DEBUG;\n // the next line will throw an exception if the LogManager loggers\n // aren't supported by 1.2 Logger/Category\n logger.l7dlog(debug, \"Hello, World\", new Object[0], null);\n assertTrue(appender.getEvents().size() == 0);\n }", "public static final Logger createLogger() {\n\t\tLogger logger = Logger.getLogger(ProcessDatabase.class.getName());\n\t\ttry {\n\t\t\tFileHandler fh = new FileHandler();\n\t\t\tfh.setFormatter(new SimpleFormatter());\n\t\t\tlogger.addHandler(fh);\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn logger;\n\t}", "protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }", "protected void initLogger() {\n initLogger(\"DEBUG\");\n }", "public static Logger getInstance(){\n if (shareInstance == null) {\n shareInstance = new Logger();\n }\n return shareInstance;\n }", "public StatusLogger getStatusLogger();", "RootMessageLogger getRootMessageLogger();", "@Override\n public void logs() {\n \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}", "public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}", "public MyLoggingFacade(Logger logger) {\n this.logger = logger;\n }", "protected static NbaLogger getLogger() {\n\t\tif (logger == null) {\n\t\t\ttry {\n\t\t\t\tlogger = NbaLogFactory.getLogger(NbaCyberPrintRequests.class.getName());\n\t\t\t} catch (Exception e) {\n\t\t\t\tNbaBootLogger.log(\"NbaCyberPrintRequests could not get a logger from the factory.\");\n\t\t\t\te.printStackTrace(System.out);\n\t\t\t}\n\t\t}\n\t\treturn logger;\n\t}", "public static Log getLoggerBase() {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLogBase();\r\n }\r\n return l;\r\n }" ]
[ "0.7617866", "0.74349934", "0.74269545", "0.7219886", "0.71646297", "0.71528167", "0.71517015", "0.7095277", "0.7073859", "0.7058592", "0.70364654", "0.70327544", "0.69952905", "0.6994047", "0.6989922", "0.6959935", "0.69502085", "0.6941776", "0.69363904", "0.69201475", "0.6917498", "0.6917213", "0.68964875", "0.6886311", "0.6872831", "0.6849951", "0.683835", "0.68133426", "0.6799522", "0.67983705", "0.6793209", "0.6780716", "0.6775311", "0.67511845", "0.6740068", "0.6732519", "0.6716561", "0.6705742", "0.66869605", "0.66583055", "0.66485137", "0.6647673", "0.6646329", "0.6645334", "0.66301465", "0.66196597", "0.6607931", "0.6596395", "0.6586117", "0.6576076", "0.6540886", "0.6530301", "0.65185565", "0.6514238", "0.6512961", "0.6504001", "0.64981276", "0.6495095", "0.649175", "0.64858365", "0.64831436", "0.6469476", "0.64542437", "0.64476913", "0.64476913", "0.64369744", "0.6413109", "0.641051", "0.6398178", "0.63942635", "0.63900983", "0.6386566", "0.63842934", "0.63798386", "0.6373019", "0.6357977", "0.6344728", "0.6339058", "0.6333477", "0.633063", "0.63134456", "0.63111675", "0.6299132", "0.6281071", "0.6270592", "0.62624204", "0.62367517", "0.623621", "0.62347853", "0.62326527", "0.6211437", "0.61994374", "0.6190576", "0.61803627", "0.6171468", "0.61677593", "0.6160331", "0.61544675", "0.61518294", "0.61131704", "0.61012554" ]
0.0
-1
showByUserProgress show outlines by user and outline progress
public static String showByUserProgress(Connection conn, String campus, String user, String progress, String caller){ //Logger logger = Logger.getLogger("test"); StringBuffer listing = new StringBuffer(); String alpha = ""; String num = ""; String title = ""; String kix = ""; String link = ""; String subprogress = ""; boolean found = false; boolean showLink = false; try{ String sql = ""; PreparedStatement ps = null; if (user == null || user.length() == 0){ // as administrators, show all modify/approval progress // so they may edit enabled items. sql = "SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress " + "FROM tblfnd WHERE campus=? AND (progress=? OR progress=?) " + "ORDER BY coursealpha,coursenum"; ps = conn.prepareStatement(sql); ps.setString(1,campus); ps.setString(2,Constant.FND_MODIFY_TEXT); ps.setString(3,Constant.FND_APPROVAL_TEXT); } else{ // when in review, make sure to include review in approval (SQL is different) // when in review in approval, don't include proposer's name if (progress.equals(Constant.COURSE_REVIEW_TEXT)){ sql = "SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress " + "FROM tblfnd WHERE campus=? AND proposer=? " + "AND progress=? ORDER BY coursealpha,coursenum"; ps = conn.prepareStatement(sql); ps.setString(1,campus); ps.setString(2,user); ps.setString(3,progress); } else if (progress.equals(Constant.FND_REVIEW_IN_APPROVAL)){ sql = "SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress " + "FROM tblfnd WHERE campus=? " + "AND (progress=? AND subprogress=?) ORDER BY coursealpha,coursenum"; ps = conn.prepareStatement(sql); ps.setString(1,campus); ps.setString(2,Constant.FND_APPROVAL_TEXT); ps.setString(3,Constant.FND_REVIEW_IN_APPROVAL); } else{ sql = "SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress " + "FROM tblfnd WHERE campus=? " + "AND proposer=? AND Progress=? ORDER BY coursealpha,coursenum"; ps = conn.prepareStatement(sql); ps.setString(1,campus); ps.setString(2,user); ps.setString(3,progress); } } ResultSet rs = ps.executeQuery(); while ( rs.next() ){ showLink = true; alpha = AseUtil.nullToBlank(rs.getString("coursealpha")); num = AseUtil.nullToBlank(rs.getString("coursenum")); subprogress = AseUtil.nullToBlank(rs.getString("subprogress")); // prevent proposer from cancelling reviews kicked off by approver if (subprogress.equals(Constant.FND_REVIEW_IN_APPROVAL) || subprogress.equals(Constant.FND_REVIEW_IN_DELETE)){ String currentApprover = ApproverDB.getCurrentApprover(conn,campus,alpha,num); if (currentApprover != null && !currentApprover.equals(user)) showLink = false; } title = AseUtil.nullToBlank(rs.getString("coursetitle")); kix = AseUtil.nullToBlank(rs.getString("historyid")); link = caller + ".jsp?kix=" + kix; if (showLink){ listing.append("<li><a href=\"" + link + "\" class=\"linkcolumn\">" + alpha + " " + num + " - " + title + "</a></li>"); found = true; } } rs.close(); ps.close(); } catch(Exception ex){ logger.fatal("Helper: showByUserProgress - " + ex.toString()); listing.setLength(0); } if (found) return "<ul>" + listing.toString() + "</ul>"; else return "<ul><li>Outline does not exist for this request</li></ul>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showProgress();", "@Override\n public void showProgress() {\n\n }", "@Override\n\tpublic void showProgress() {\n\t\twaitDialog(true);\n\t}", "@Override\n public void showProgressSync() {\n }", "void showModalProgress();", "void onShowProgress();", "public void showProgress(boolean show) {\n \t}", "public void setProgress(final int percentage, final String user) {\r\n\t\tif (this.statusBar != null) {\r\n\t\t\tif (this.progressBarUser == null || user == null || this.progressBarUser.equals(user)) {\r\n\t\t\t\tif (percentage > 99 | percentage == 0)\r\n\t\t\t\t\tthis.progressBarUser = null;\r\n\t\t\t\telse\r\n\t\t\t\t\tthis.progressBarUser = user;\r\n\r\n\t\t\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\t\t\tthis.statusBar.setProgress(percentage);\r\n\t\t\t\t\tif (this.taskBarItem != null) {\r\n\t\t\t\t\t\tif (user == null)\r\n\t\t\t\t\t\t\tthis.taskBarItem.setProgressState(SWT.DEFAULT);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthis.taskBarItem.setProgressState(GDE.IS_MAC ? SWT.PAUSED : SWT.NORMAL);\r\n\r\n\t\t\t\t\t\tthis.taskBarItem.setProgress(percentage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tDataExplorer.this.statusBar.setProgress(percentage);\r\n\t\t\t\t\t\t\tif (DataExplorer.this.taskBarItem != null) {\r\n\t\t\t\t\t\t\t\tif (user == null)\r\n\t\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgressState(SWT.DEFAULT);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgressState(GDE.IS_MAC ? SWT.PAUSED : SWT.NORMAL);\r\n\r\n\t\t\t\t\t\t\t\tDataExplorer.this.taskBarItem.setProgress(percentage);\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\tthis.progessPercentage = percentage;\r\n\t\t\t\tif (percentage >= 100) DataExplorer.this.resetProgressBar();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void showProgress() {\n img_left_action.setVisibility(View.GONE);\n search_progress.setAlpha(0.0f);\n search_progress.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(search_progress, \"alpha\", 0.0f, 1.0f).start();\n }", "@Override\n\t\t\tpublic void onProgressChanged(SeekArc seekArc, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\tprog = progress;\n\t\t\t}", "public void displayProgress(String message) {\n }", "void hideProgress();", "private void showProgress(String taskName,String processString)\n {\n mProgressView = ProgressDialog.show(this, taskName, processString, true);\n mLoginFormView.setVisibility(View.INVISIBLE);\n\n }", "private String getProgressBar(){\n String output = \"\\u00A77[\";\n int total = 20;\n double unlocked = this.unlockedPercentage;\n output += \"\\u00A72\";\n //green bars for every 5% unlocked\n while(unlocked>=5){\n output += \"|\";\n unlocked-=5;\n total--;\n }\n //rest of them are red bars\n output += \"\\u00A7c\";\n while(total-->0){\n output += \"|\";\n }\n\n output += \"\\u00A77]\";\n return output;\n }", "void startProgress();", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mReviewFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mReviewFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mReviewFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mReviewFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "private void showProgressWindow() {\n \t\t// compute total number of iterations\n \t\tint total = 0;\n \t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\t\tif (contrib[y][x] == null) continue;\n \t\t\t\ttotal += contrib[y][x].target - contrib[y][x].current;\n \t\t\t}\n \t\t}\n \n \t\tfinal JPanel calendarPane = new JPanel() {\n \n \t\t\tprivate final int tileSize = 12, tileTotal = 15;\n \t\t\tprivate final Dimension prefSize =\n \t\t\t\tnew Dimension(CAL_WIDTH * tileTotal, CAL_HEIGHT * tileTotal);\n \n \t\t\t@Override\n \t\t\tpublic void paint(final Graphics g) {\n \t\t\t\tsuper.paint(g);\n \t\t\t\tfinal int step = maxContrib / 4;\n \t\t\t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\t\t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\t\t\t\tif (contrib[y][x] == null) continue;\n \t\t\t\t\t\tfinal int colorIndex = (contrib[y][x].current - 1) / step;\n \t\t\t\t\t\tg.setColor(CAL_COLORS[colorIndex]);\n \t\t\t\t\t\tg.fillRect(tileTotal * x, tileTotal * y, tileSize, tileSize);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t@Override\n \t\t\tpublic Dimension getPreferredSize() {\n \t\t\t\treturn prefSize;\n \t\t\t}\n \n \t\t};\n \t\tcalendarPane.setBorder(new LineBorder(Color.red));\n \n \t\tprogressBar = new JProgressBar();\n \t\tprogressBar.setMaximum(total);\n \t\tprogressBar.setStringPainted(true);\n \n \t\tfinal JPanel contentPane = new JPanel();\n \t\tcontentPane.setLayout(new BorderLayout());\n \t\tcontentPane.add(calendarPane, BorderLayout.CENTER);\n \t\tcontentPane.add(progressBar, BorderLayout.SOUTH);\n \n \t\tprogressFrame = new JFrame(\"Contribution Hacker\");\n \t\tprogressFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n \t\tprogressFrame.setContentPane(contentPane);\n \t\tprogressFrame.pack();\n \n \t\t// center the window onscreen\n \t\tfinal Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n \t\tfinal Dimension windowSize = progressFrame.getSize();\n \t\tfinal int posX = (screenSize.width - windowSize.width) / 2;\n \t\tfinal int posY = (screenSize.height - windowSize.height) / 2;\n \t\tprogressFrame.setLocation(posX, posY);\n \n \t\tprogressFrame.setVisible(true);\n \t}", "private void showProgressIndicator() {\n setProgressBarIndeterminateVisibility(true);\n setProgressBarIndeterminate(true);\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n loginSV.setVisibility(show ? View.GONE : View.VISIBLE);\n loginSV.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n loginSV.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n loginPB.setVisibility(show ? View.VISIBLE : View.GONE);\n loginPB.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n loginPB.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n loginPB.setVisibility(show ? View.VISIBLE : View.GONE);\n loginSV.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "public void onProgressChanged(SeekBar seeker, int progress, boolean fromUser) {\r\n\t\tswitch (seeker.getId()) {\r\n\t\t\tcase R.id.sb_create1:\r\n\t\t\t\ttv_create1.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_diff1:\r\n\t\t\t\ttv_diff1.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_var1:\r\n\t\t\t\ttv_var1.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_style1:\r\n\t\t\t\ttv_style1.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_create2:\r\n\t\t\t\ttv_create2.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_diff2:\r\n\t\t\t\ttv_diff2.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_var2:\r\n\t\t\t\ttv_var2.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_style2:\r\n\t\t\t\ttv_style2.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_create3:\r\n\t\t\t\ttv_create3.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_diff3:\r\n\t\t\t\ttv_diff3.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_var3:\r\n\t\t\t\ttv_var3.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.sb_style3:\r\n\t\t\t\ttv_style3.setText(String.valueOf(progress));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void display() {\t\t\n\t\tparent.pushStyle();\n\t\t\n\t\t//parent.noStroke();\n\t\t//parent.fill(255);\n\t\tparent.noFill();\n\t\tparent.ellipse(pos.x, pos.y, diam, diam);\n\t\tnodeSpin.drawNode(pos.x, pos.y, diam);\n\t\t\n\t\t//This should match what happens in the hover animation\n\t\tif (focused && userId >= 0) {\n\t\t\tparent.fill(Sequencer.colors[userId]);\n\t\t\tparent.ellipse(pos.x, pos.y, diam, diam);\n\t\t}\n\t\t\n\t\trunAnimations();\n\t\t\n\t\tparent.popStyle();\n\t}", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showSubmitScoreProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(\n android.R.integer.config_shortAnimTime);\n\n mSubmitScoreStatusView.setBackground(new BitmapDrawable(getResources(),\n ImageUtils.decodeSampledBitmapFromResource(getResources(), R.drawable.end_form_1280x768, screenWidth, screenHeight)));\n\n mSubmitScoreStatusView.setVisibility(View.VISIBLE);\n\n mSubmitScoreStatusView.animate().setDuration(shortAnimTime)\n .alpha(show ? 1 : 0)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mSubmitScoreStatusView.setVisibility(show ? View.VISIBLE\n : View.GONE);\n }\n });\n\n mFinishGameView.setVisibility(View.VISIBLE);\n mFinishGameView.animate().setDuration(shortAnimTime)\n .alpha(show ? 0 : 1)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mFinishGameView.setVisibility(show ? View.GONE\n : View.VISIBLE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mSubmitScoreStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n mFinishGameView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n public void showProgress(final boolean show) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mProgressBar.setVisibility(show ? View.GONE : View.VISIBLE);\n btnAwardPoints.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n btnAwardPoints.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressBar.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressBar.setVisibility(show ? View.VISIBLE : View.GONE);\n btnAwardPoints.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n\n }", "@Override \r\n\t\t\t public void onProgressChanged(SeekBar seekBar, int progress, \r\n\t\t\t boolean fromUser) {\n\t\t\t\t\tgraph.setSpacing(progress);\r\n\t\t\t}", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mAnalysisForm.setVisibility(show ? View.GONE : View.VISIBLE);\n mAnalysisForm.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mAnalysisForm.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mAnalysisForm.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show, final View view) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n view.setVisibility(show ? View.GONE : View.VISIBLE);\n view.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n view.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n view.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n// mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n\n }\n });\n\n// mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n// mProgressView.animate().setDuration(shortAnimTime).alpha(\n// show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n// @Override\n// public void onAnimationEnd(Animator animation) {\n// mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n// }\n// });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n// mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n// mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n\t// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n\t// for very easy animations. If available, use these APIs to fade-in\n\t// the progress spinner.\n\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n\t int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n\t mSignUpStatusView.setVisibility(View.VISIBLE);\n\t mSignUpStatusView.animate().setDuration(shortAnimTime).alpha(show ? 1 : 0)\n\t\t .setListener(new AnimatorListenerAdapter() {\n\t\t\t@Override\n\t\t\tpublic void onAnimationEnd(Animator animation) {\n\t\t\t mSignUpStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n\t\t\t}\n\t\t });\n\n\t mSignUpFormView.setVisibility(View.VISIBLE);\n\t mSignUpFormView.animate().setDuration(shortAnimTime).alpha(show ? 0 : 1)\n\t\t .setListener(new AnimatorListenerAdapter() {\n\t\t\t@Override\n\t\t\tpublic void onAnimationEnd(Animator animation) {\n\t\t\t mSignUpFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n\t\t\t}\n\t\t });\n\t} else {\n\t // The ViewPropertyAnimator APIs are not available, so simply show\n\t // and hide the relevant UI components.\n\t mSignUpStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n\t mSignUpFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n\t}\n }", "void showProgressBar(boolean show, boolean isFirstPage);", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n linearLayoutParent.setVisibility(show ? View.GONE : View.VISIBLE);\n linearLayoutParent.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n linearLayoutParent.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n linearLayoutParent.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\r\n private void showProgress(final boolean show) {\r\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\r\n // for very easy animations. If available, use these APIs to fade-in\r\n // the progress spinner.\r\n\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\r\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\r\n\r\n mRaspberryLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\r\n mRaspberryLoginFormView.animate().setDuration(shortAnimTime).alpha(\r\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\r\n @Override\r\n public void onAnimationEnd(Animator animation) {\r\n mRaspberryLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\r\n }\r\n });\r\n\r\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\r\n mCancelButton.setVisibility(show ? View.VISIBLE : View.GONE);\r\n mProgressView.animate().setDuration(shortAnimTime).alpha(\r\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\r\n @Override\r\n public void onAnimationEnd(Animator animation) {\r\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\r\n }\r\n });\r\n } else {\r\n // The ViewPropertyAnimator APIs are not available, so simply show\r\n // and hide the relevant UI components.\r\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\r\n mCancelButton.setVisibility(show ? View.VISIBLE : View.GONE);\r\n mRaspberryLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\r\n }\r\n }", "@TargetApi( Build.VERSION_CODES.HONEYCOMB_MR2 )\n private void showProgress( final boolean show )\n {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2 )\n {\n int shortAnimTime =\n getResources().getInteger(\n android.R.integer.config_shortAnimTime );\n\n mLoginStatusView.setVisibility( View.VISIBLE );\n mLoginStatusView.animate()\n .setDuration( shortAnimTime )\n .alpha( show ? 1 : 0 )\n .setListener( new AnimatorListenerAdapter()\n {\n @Override\n public void onAnimationEnd( Animator animation )\n {\n mLoginStatusView.setVisibility( show\n ? View.VISIBLE : View.GONE );\n }\n } );\n\n mLoginFormView.setVisibility( View.VISIBLE );\n mLoginFormView.animate()\n .setDuration( shortAnimTime )\n .alpha( show ? 0 : 1 )\n .setListener( new AnimatorListenerAdapter()\n {\n @Override\n public void onAnimationEnd( Animator animation )\n {\n mLoginFormView.setVisibility( show ? View.GONE\n : View.VISIBLE );\n }\n } );\n }\n else\n {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mLoginStatusView.setVisibility( show ? View.VISIBLE : View.GONE );\n mLoginFormView.setVisibility( show ? View.GONE : View.VISIBLE );\n }\n }", "@Override\n\tpublic void showProgress() {\n\t\tprogress.show();\n\t\tprogress.setCancelable(false);\n\t\tprogress.setContentView(R.layout.progress);\n\t}", "private void updateProgressBar() {\n\t\tdouble current = model.scannedCounter;\n\t\tdouble total = model.fileCounter;\n\t\tdouble percentage = (double)(current/total);\n\t\t\n\t\t//Update Progress indicators\n\t\ttxtNumCompleted.setText((int) current + \" of \" + (int) total + \" Completed (\" + Math.round(percentage*100) + \"%)\");\n\t\tprogressBar.setProgress(percentage);\n\t}", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginStatusView.setVisibility(View.VISIBLE);\n mLoginStatusView.animate()\n .setDuration(shortAnimTime)\n .alpha(show ? 1 : 0)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n\n mLoginFormView.setVisibility(View.VISIBLE);\n mLoginFormView.animate()\n .setDuration(shortAnimTime)\n .alpha(show ? 0 : 1)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mLoginStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n }", "@Override\n public void updateScreen() {\n if (dirty) {\n Alkahestry.logger.info(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// String name = String.valueOf(((ContainerMoleculeSplitter) container).moleculeSplitterTileEntity.progress);\n// fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040);\n// fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040);\n dirty = false;\n }\n// ((ContainerMoleculeSplitter) container)\n// .moleculeSplitterTileEntity\n// .\n super.updateScreen();\n }", "void showQueuingBuildProgress();", "@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\tint thickness = min_Thickness + (step_Thickness*seekBar.getProgress());\n\t\t\t\tseismicImage.setThickness(thickness);\n\t\t\t}", "protected void updateProgress(Progress prog) {\r\n \t// if this is called then ensure the no tasks msg is not also displayed\r\n \tshowNoTaskMsg(false);\r\n \t\r\n\t\tint done = prog.getWork();\r\n\t\tString status = getStatusDesc(prog);\r\n\r\n\t\tfinal ProgressUIControl progressUIControl = findOrCreateUIControl(prog);\r\n\t\tprogressUIControl.showMsg(status);\r\n\t\tprogressUIControl.showPercent(done);\r\n\t\t\r\n\t\tif (prog.isFinished() && !progressUIControl.isFinishNotified) {\r\n\t\t\tLog.i(TAG, \"Job finished:\"+prog.getJobName());\r\n\t\t\tprogressUIControl.isFinishNotified = true;\r\n\t\t\tjobFinished(prog);\r\n\t\t}\r\n }", "public interface ResultProgressHandle {\n \n /**\n * Set the current position and total number of steps. Note it is\n * inadvisable to be holding any locks when calling this method, as it\n * may immediately update the GUI using \n * <code>EventQueue.invokeAndWait()</code>.\n * \n * @param currentStep the current step in the progress of computing the\n * result.\n * @param totalSteps the total number of steps. Must be greater than\n * or equal to currentStep.\n */\n public abstract void setProgress (int currentStep, int totalSteps);\n \n /** \n * Set the current position and total number of steps, and description \n * of what the computation is doing. Note it is\n * inadvisable to be holding any locks when calling this method, as it\n * may immediately update the GUI using \n * <code>EventQueue.invokeAndWait()</code>. \n * @param description Text to describe what is being done, which can\n * be displayed in the UI.\n * @param currentStep the current step in the progress of computing the\n * result.\n * @param totalSteps the total number of steps. Must be greater than\n * or equal to currentStep.\n */\n public abstract void setProgress (String description, int currentStep, int totalSteps);\n \n /**\n * Set the status as \"busy\" - a rotating icon will be displayed instead\n * of a percent complete progress bar.\n * \n * Note it is inadvisable to be holding any locks when calling this method, as it\n * may immediately update the GUI using \n * <code>EventQueue.invokeAndWait()</code>. \n * @param description Text to describe what is being done, which can\n * be displayed in the UI.\n */\n public abstract void setBusy (String description);\n \n /**\n * Call this method when the computation is complete, and pass in the \n * final result of the computation. The method doing the computation\n * (<code>DeferredWizardResult.start()</code> or something it \n * called) should exit immediately after calling this method. If the\n * <code>failed()</code> method is called after this method has been\n * called, a runtime exception may be thrown.\n * @param result the Object which was computed, if any.\n */ \n public abstract void finished(Object result);\n /**\n * Call this method if computation fails. The message may be some text\n * describing what went wrong, or null if no description.\n * @param message The text to display to the user. The method \n * doing the computation (<code>DeferredWizardResult.start()</code> or something it \n * called). If the <code>finished()</code> method is called after this\n * method has been called, a runtime exception may be thrown.\n * should exit immediately after calling this method.\n * It is A description of what went wrong, or null.\n * @param canNavigateBack whether or not the Prev button should be \n * enabled.\n */ \n public abstract void failed (String message, boolean canNavigateBack);\n \n /**\n * Add the component to show for the progress display to the instructions panel. \n */\n public abstract void addProgressComponents (Container panel);\n \n /**\n * Returns true if the computation is still running, i.e., if neither finished or failed have been called.\n *\n * @return true if there is no result yet.\n */\n public boolean isRunning();\n}", "void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n }", "private void progressMode() {\n\t\t// lazily build the layout\n\t\tif (progressLayout == null) {\n\t\t\tprogressLayout = new DefaultVerticalLayout(true, true);\n\n\t\t\tprogressBar = new ProgressBar();\n\t\t\tprogressBar.setHeight(\"20px\");\n\t\t\tprogressLayout.add(progressBar);\n\n\t\t\tstatusLabel = new Text(\"\");\n\t\t\tprogressLayout.add(statusLabel);\n\t\t}\n\t\tprogressBar.setValue(0.0f);\n\t\tstatusLabel.setText(\"\");\n\n\t\tremoveAll();\n\t\tadd(progressLayout);\n\t}", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n /*mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });*/\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n //mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\t//progreso.setVisibility(View.VISIBLE);\n\t\t\tsetProgressBarIndeterminateVisibility(true);\n\t\t}", "public void onProgressUpdate(int numRouleau,String prochain);", "@Override\n\tpublic void preExecution() {\n\t\tshowProgressBar();\n\t}", "@Override\n\tpublic void hideProgress() {\n\t\twaitDialog(false);\n\t}", "public void onProgress(int pos);", "@Override\n protected void onProgressUpdate(Integer... values) {\n progress.setVisibility(View.VISIBLE);\n progress.setProgress(values[0]);\n super.onProgressUpdate(values);\n }", "@Override\n public void showProgressBar() {\n MainActivity.sInstance.showProgressBar();\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n @Override\n public void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n }", "public void drawStepsVisualization(){\n\n visualization = new ProgressBar(context,null,android.R.attr.progressBarStyleHorizontal);\n visualization.setMax(numberOfSteps);\n visualization.setProgress(startProgressAt);\n visualization.getProgressDrawable().setColorFilter(Color.GRAY, PorterDuff.Mode.SRC_IN);\n\n this.addView(visualization);\n\n }", "@Override\n\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\tboolean fromUser) {\n\t\t\tcustomPercent = progress / 100.0;\n\t\t\tupdateCustom();\n\t\t\t\n\t\t}", "@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\timgView.setAlpha(progress);\n\t\t\t}", "public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n textViewDelay.setText(\"Delay: \" + progress + \" seconds\"); //update \"progress\" value and pass it to textview\n }", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {\n TextView txtV_graduacao = inf.findViewById(R.id.textView11);\n txtV_graduacao.setText(\"\"+progress+\" %\");\n }", "@Override\n\t\tprotected void onProgressUpdate(Integer... progress) {\n\t\t\tprogressBar.setVisibility(View.VISIBLE);\n\n\t\t\t// updating progress bar value\n\t\t\tprogressBar.setProgress(progress[0]);\n\n\t\t\t// updating percentage value\n\t\t\ttxtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n\t\t}", "public void progressMade();", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n loginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n loginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n loginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n progressView.setVisibility(show ? View.VISIBLE : View.GONE);\n progressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n progressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n progressView.setVisibility(show ? View.VISIBLE : View.GONE);\n loginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "private void updateProgress(int progress) {\n if (myHost != null) {\n myHost.updateProgress(progress);\n } else {\n System.out.println(\"Progress: \" + progress + \"%\");\n }\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "public void showProgressBar() {\n\t\tmProgressBarVisible = true;\n\t\tif (getView() != null) {\n\t\t\tLinearLayout progressLayout = (LinearLayout) getView()\n\t\t\t\t\t.findViewById(R.id.severity_list_progress_layout);\n\t\t\tif (progressLayout != null)\n\t\t\t\tprogressLayout.setVisibility(View.VISIBLE);\n\t\t}\n\t}", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n }", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\n p.setStrokeWidth(progress);\n\n bitmap.eraseColor(Color.WHITE);\n canvas.drawLine(30,50,320,50,p);\n imageView.setImageBitmap(bitmap);\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mCreatePostView.setVisibility(show ? View.GONE : View.VISIBLE);\n mCreatePostView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mCreatePostView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mCreatePostView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showLoginProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(\n android.R.integer.config_shortAnimTime);\n\n mLoginStatusView.setBackground(new BitmapDrawable(getResources(),\n ImageUtils.decodeSampledBitmapFromResource(getResources(),\n R.drawable.end_form_1280x768, screenWidth, screenHeight)\n ));\n\n mLoginStatusView.setVisibility(View.VISIBLE);\n mLoginStatusView.animate().setDuration(shortAnimTime)\n .alpha(show ? 1 : 0)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginStatusView.setVisibility(show ? View.VISIBLE\n : View.GONE);\n }\n });\n\n mFinishGameView.setVisibility(View.VISIBLE);\n mFinishGameView.animate().setDuration(shortAnimTime)\n .alpha(show ? 0 : 1)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mFinishGameView.setVisibility(show ? View.GONE\n : View.VISIBLE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mLoginStatusView.setVisibility(show ? View.VISIBLE : View.GONE);\n mFinishGameView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n /*\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n */\n\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n // mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "public void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\tboolean fromUser) {\n\t}", "void setProgress(int progress);", "void setProgress(int progress);", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mDisplayFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mDisplayFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mDisplayFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoadMsg.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mDisplayFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@Override\n protected void onProgressUpdate(Integer... progress) {\n progressBar.setVisibility(View.VISIBLE);\n\n // updating progress bar value\n progressBar.setProgress(progress[0]);\n\n // updating percentage value\n txtPercentage.setText(String.valueOf(progress[0]) + \"%\");\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow for very easy animations.\n // If available, use these APIs to fade-in the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@Override\n\t\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\tboolean fromUser) {\n\t\t\t\tp1=progress;\n\t\t\t\tp=p1.toString();\n\t\t\t\tx=p1.toString();\n\t\t\t\twithin.setText( x+=\" Kms\");\t\t\t\t\n\t\t\t\t}", "private void showProgress() {\n if (dialogProgress == null) {\n dialogProgress = new Dialog(this);\n dialogProgress.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialogProgress.setContentView(R.layout.custom_progress);\n dialogProgress.setCancelable(false);\n }\n\n dialogProgress.getWindow().getDecorView().getRootView().setBackgroundColor(getResources().getColor(android.R.color.transparent));\n dialogProgress.show();\n }", "public void run() {\r\n ouputProgressModel.setPogressStarted(true);\r\n try {\r\n for (int i = 0; i <= 100; i += 10) {\r\n // pause the thread\r\n Thread.sleep(PROCCESS_SLEEP_LENGTH);\r\n // update the percent value\r\n ouputProgressModel.setPercentComplete(i);\r\n SessionRenderer.render(\"progressExample\");\r\n }\r\n }\r\n catch (InterruptedException e) { }\r\n ouputProgressModel.setPogressStarted(false);\r\n }", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n TextView tvDeSeekBarPregunta2 = (TextView) findViewById(R.id.tvDeSeekBarPregunta2);\n tvDeSeekBarPregunta2.setText(String.valueOf(progress));\n Shared200.setP212_42(String.valueOf(progress));\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mRegistrationFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mRegistrationFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mRegistrationFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mRegistrationFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }", "@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)\n private void showProgress(final boolean show) {\n // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow\n // for very easy animations. If available, use these APIs to fade-in\n // the progress spinner.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {\n int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);\n\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n mLoginFormView.animate().setDuration(shortAnimTime).alpha(\n show ? 0 : 1).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n });\n\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mProgressView.animate().setDuration(shortAnimTime).alpha(\n show ? 1 : 0).setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n }\n });\n } else {\n // The ViewPropertyAnimator APIs are not available, so simply show\n // and hide the relevant UI components.\n mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);\n mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);\n }\n }" ]
[ "0.63829833", "0.6230356", "0.59680444", "0.58917814", "0.5811188", "0.58014065", "0.57428896", "0.5575487", "0.5572302", "0.5511528", "0.5497288", "0.5488675", "0.5464302", "0.5460752", "0.5405768", "0.53721493", "0.53699267", "0.5361142", "0.5338814", "0.5336173", "0.53142977", "0.53078747", "0.5302985", "0.52987117", "0.52926624", "0.5266085", "0.525279", "0.52447885", "0.52399486", "0.5221665", "0.5208896", "0.5203035", "0.5199633", "0.5195357", "0.5183572", "0.5182189", "0.5176547", "0.5173853", "0.5162751", "0.5155123", "0.51529723", "0.5145439", "0.5137469", "0.5135863", "0.51271677", "0.5125439", "0.5125295", "0.51212007", "0.5120923", "0.511521", "0.51128966", "0.5100787", "0.5099444", "0.50983244", "0.50934005", "0.5091335", "0.50885075", "0.5086772", "0.50811327", "0.50806063", "0.5077297", "0.5075031", "0.5074421", "0.5073583", "0.5073408", "0.5069559", "0.50694567", "0.5068749", "0.50680804", "0.50669795", "0.5065463", "0.50621474", "0.505202", "0.505202", "0.5046433", "0.5043063", "0.503707", "0.5035206", "0.50333214", "0.50321233", "0.5030371", "0.5030134", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876", "0.5027876" ]
0.5481561
12
showByUserProgress / Returns true if the program exists in a particular type and campus
public static boolean existByTypeCampus(Connection conn,String campus,String kix,String type) throws SQLException { boolean found = false; boolean debug = false; try { // unlike courses, programs are based on titles, degrees, and divisions String[] info = getKixInfo(conn,kix); String alpha = info[Constant.KIX_ALPHA]; String num = info[Constant.KIX_NUM]; if(info != null){ if (debug){ logger.info("campus: " + campus); logger.info("kix: " + kix); logger.info("alpha: " + alpha); logger.info("num: " + num); logger.info("type: " + type); } String sql = "SELECT type FROM tblfnd WHERE campus=? AND coursealpha=? AND coursenum=? AND type=?"; PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1,campus); ps.setString(2,alpha); ps.setString(3,num); ps.setString(4,type); ResultSet rs = ps.executeQuery(); found = rs.next(); rs.close(); ps.close(); } } catch (SQLException e) { logger.fatal("Fnd.programExistByTypeCampus - " + e.toString()); } catch (Exception e) { logger.fatal("Fnd.programExistByTypeCampus - " + e.toString()); } return found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String showByUserProgress(Connection conn,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tString campus,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tString user,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tString progress,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tString caller){\n\n\t\t//Logger logger = Logger.getLogger(\"test\");\n\n\t\tStringBuffer listing = new StringBuffer();\n\t\tString alpha = \"\";\n\t\tString num = \"\";\n\t\tString title = \"\";\n\t\tString kix = \"\";\n\t\tString link = \"\";\n\t\tString subprogress = \"\";\n\n\t\tboolean found = false;\n\t\tboolean showLink = false;\n\n\t\ttry{\n\t\t\tString sql = \"\";\n\t\t\tPreparedStatement ps = null;\n\n\t\t\tif (user == null || user.length() == 0){\n\t\t\t\t// as administrators, show all modify/approval progress\n\t\t\t\t// so they may edit enabled items.\n\t\t\t\tsql = \"SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress \" +\n\t\t\t\t\t\"FROM tblfnd WHERE campus=? AND (progress=? OR progress=?) \" +\n\t\t\t\t\t\"ORDER BY coursealpha,coursenum\";\n\t\t\t\tps = conn.prepareStatement(sql);\n\t\t\t\tps.setString(1,campus);\n\t\t\t\tps.setString(2,Constant.FND_MODIFY_TEXT);\n\t\t\t\tps.setString(3,Constant.FND_APPROVAL_TEXT);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// when in review, make sure to include review in approval (SQL is different)\n\t\t\t\t// when in review in approval, don't include proposer's name\n\t\t\t\tif (progress.equals(Constant.COURSE_REVIEW_TEXT)){\n\t\t\t\t\tsql = \"SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress \" +\n\t\t\t\t\t\t\"FROM tblfnd WHERE campus=? AND proposer=? \" +\n\t\t\t\t\t\t\"AND progress=? ORDER BY coursealpha,coursenum\";\n\t\t\t\t\tps = conn.prepareStatement(sql);\n\t\t\t\t\tps.setString(1,campus);\n\t\t\t\t\tps.setString(2,user);\n\t\t\t\t\tps.setString(3,progress);\n\t\t\t\t}\n\t\t\t\telse if (progress.equals(Constant.FND_REVIEW_IN_APPROVAL)){\n\t\t\t\t\tsql = \"SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress \" +\n\t\t\t\t\t\t\t\"FROM tblfnd WHERE campus=? \" +\n\t\t\t\t\t\t\t\"AND (progress=? AND subprogress=?) ORDER BY coursealpha,coursenum\";\n\t\t\t\t\tps = conn.prepareStatement(sql);\n\t\t\t\t\tps.setString(1,campus);\n\t\t\t\t\tps.setString(2,Constant.FND_APPROVAL_TEXT);\n\t\t\t\t\tps.setString(3,Constant.FND_REVIEW_IN_APPROVAL);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsql = \"SELECT distinct historyid, CourseAlpha, CourseNum, coursetitle, subprogress \" +\n\t\t\t\t\t\t\"FROM tblfnd WHERE campus=? \" +\n\t\t\t\t\t\t\"AND proposer=? AND Progress=? ORDER BY coursealpha,coursenum\";\n\t\t\t\t\tps = conn.prepareStatement(sql);\n\t\t\t\t\tps.setString(1,campus);\n\t\t\t\t\tps.setString(2,user);\n\t\t\t\t\tps.setString(3,progress);\n\t\t\t\t}\n\t\t\t}\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile ( rs.next() ){\n\n\t\t\t\tshowLink = true;\n\n\t\t\t\talpha = AseUtil.nullToBlank(rs.getString(\"coursealpha\"));\n\t\t\t\tnum = AseUtil.nullToBlank(rs.getString(\"coursenum\"));\n\t\t\t\tsubprogress = AseUtil.nullToBlank(rs.getString(\"subprogress\"));\n\n\t\t\t\t// prevent proposer from cancelling reviews kicked off by approver\n\t\t\t\tif (subprogress.equals(Constant.FND_REVIEW_IN_APPROVAL) || subprogress.equals(Constant.FND_REVIEW_IN_DELETE)){\n\t\t\t\t\tString currentApprover = ApproverDB.getCurrentApprover(conn,campus,alpha,num);\n\t\t\t\t\tif (currentApprover != null && !currentApprover.equals(user))\n\t\t\t\t\t\tshowLink = false;\n\t\t\t\t}\n\n\t\t\t\ttitle = AseUtil.nullToBlank(rs.getString(\"coursetitle\"));\n\t\t\t\tkix = AseUtil.nullToBlank(rs.getString(\"historyid\"));\n\t\t\t\tlink = caller + \".jsp?kix=\" + kix;\n\n\t\t\t\tif (showLink){\n\t\t\t\t\tlisting.append(\"<li><a href=\\\"\" + link + \"\\\" class=\\\"linkcolumn\\\">\" + alpha + \" \" + num + \" - \" + title + \"</a></li>\");\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t\tps.close();\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tlogger.fatal(\"Helper: showByUserProgress - \" + ex.toString());\n\t\t\tlisting.setLength(0);\n\t\t}\n\n\t\tif (found)\n\t\t\treturn \"<ul>\" + listing.toString() + \"</ul>\";\n\t\telse\n\t\t\treturn \"<ul><li>Outline does not exist for this request</li></ul>\";\n\t}", "boolean hasProgress();", "boolean hasProgress();", "public boolean hasProgress();", "public boolean isProgramActive(String programId);", "private boolean shouldRegisterUniversity(Progress progress) {\n return progress.name.equals(Progress.universityRegistration)\n || progress.name.equals(Progress.universityRegistrationResponseNegative)\n || progress.name.equals(Progress.universityRegistrationCanceled);\n }", "public boolean attivaPulsanteProsegui(){\n\t\tif(!model.isSonoInAggiornamentoIncasso()){\n\t\t\tif(null!=model.getGestioneOrdinativoStep1Model().getOrdinativo() && model.getGestioneOrdinativoStep1Model().getOrdinativo().isFlagCopertura() && model.getGestioneOrdinativoStep2Model().getListaSubOrdinativiIncasso()!= null && model.getGestioneOrdinativoStep2Model().getListaSubOrdinativiIncasso().size()>0){\n\t\t\t return true;\t\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public void checkProgress() {\n\t\tupdateBitfield();\n\t\tlog(\"Checking progress...\");\n\t\tFileInfo[] fileinfo = files.getFiles();\n\t\tfor (int i = 0; i < fileinfo.length; i++) {\n\t\t\tFileInfo info = fileinfo[i];\n\t\t\tRandomAccessFile file = info.getFileAcces();\n\t\t\ttry {\n\t\t\t\tif (file.length() > 0L) {\n\t\t\t\t\tint pieceIndex = (int) (info.getFirstByteOffset() / files.getPieceSize());\n\t\t\t\t\tint lastPieceIndex = pieceIndex + info.getPieceCount();\n\t\t\t\t\tfor (; pieceIndex < lastPieceIndex; pieceIndex++) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (files.getPiece(pieceIndex).checkHash()) {\n\t\t\t\t\t\t\t\t// log(\"Progress Check: Have \" + pieceIndex);\n\t\t\t\t\t\t\t\tif (torrentStatus == STATE_DOWNLOAD_DATA) {\n\t\t\t\t\t\t\t\t\tbroadcastHave(pieceIndex);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfiles.havePiece(pieceIndex);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t\tlog(\"Checking progress done\");\n\t}", "@Override\n\tpublic void showProgress() {\n\t\twaitDialog(true);\n\t}", "public int show(int sit_checker)\n {\n int ret_val = 0;\n for(Room temp : data_set)\n {\n if(temp.get_situation() == sit_checker)\n {\n ++ret_val;\n System.out.print(temp.room_number() + \" - \");\n }\n }\n if(ret_val > 0)\n System.out.println(\"\\n(-1 for cancel operation)\");\n return ret_val;\n }", "private void showLoadProgramDlg() {\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\n SixDOFArmResources.getString(\"PIERINHO_FILE_DESCRIPTION\"),\n SixDOFArmResources.getString(\"PIERINHO_FILE_EXTENSION\")\n );\n File file;\n File dir;\n final JFileChooser fc = new JFileChooser();\n fc.setDialogTitle(SixDOFArmResources.getString(\"PIERINHO_FILE_SELECTION\"));\n fc.setFileFilter(filter);\n boolean proceed;\n String filename = programLabel.getText();\n \n if (filename.length() > 0) {\n dir = new File(FileUtils.expandFileName(filename));\n if (dir.exists()) {\n fc.setCurrentDirectory(dir);\n }\n }\n do {\n int returnVal = fc.showOpenDialog(this);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n file = fc.getSelectedFile();\n if (file.exists()) {\n proceed = true;\n } else {\n proceed = false;\n gui.showError(String.format(\n SixDOFArmResources.getString(\"ERROR_FILE_DOES_NOT_EXIST\"),\n file.getAbsolutePath()));\n }\n if (proceed) {\n programPathLabel.setText(file.getAbsolutePath());\n loadProgram();\n } else {\n }\n } else {\n break;\n }\n } while(!proceed);\n }", "private void showProgressNotification() {\n if (isCollectingBugReport()) {\n mNotificationManager.notify(\n BUGREPORT_IN_PROGRESS_NOTIF_ID, buildProgressNotification());\n }\n }", "public static boolean displayResult() {\r\n Counseling counseling = new Counseling();\r\n List<Student> studentList = counseling.getStudentList();\r\n\r\n try {\r\n \t//If everything goes correct then a new file is created at this location with the result of counseling in it\r\n PrintWriter writer = new PrintWriter\r\n (\"C:/Users/Aakanksha/workspace/DS2/src/counseling/Result.txt\", \"UTF-8\");\r\n for(Student student: studentList) {\r\n writer.println(student.getId() + \"\\t\" +\r\n student.getName() + \"\\t\" +\r\n student.getProgramAllocated());\r\n }\r\n writer.close();\r\n return true;\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n } \r\n }", "public boolean es_programa() {\n\t\treturn tipo == Tipo_simbolo.PROGRAMA;\n\t}", "public static void checkFromUser() {\n\t\tif (askUser(\"Please type y to execute program and any other key to stop\").contentEquals(\"y\")) {\n\t\t\tSystem.out.println(\"Continuing\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Terminating program\");\n\t\t\tSystem.exit(0); \n\t\t}\n\t\tSystem.out.println(\"Calculating the greatest house income, the greatest income after expenditure and greatest savings from the given 3 families\");\n\t}", "void showProgress();", "protected boolean isMarkedByPlugin(final Program program) {\r\n\t\tfinal Marker[] markers = program.getMarkerArr();\r\n\t\tif (markers != null) {\r\n\t\t\tfinal String id = getId();\r\n\t\t\tfor (Marker marker : markers) {\r\n\t\t\t\tif (id.equals(marker.getId())) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static void showWorkInProgressWarning()\n {\n \tJOptionPane.showMessageDialog(null, \"Warning: This version of \" +\n \t\tPROJECT_FAMILY_NAME + \" is \\\"work in progress\\\" any may not work \" +\n \t\t\"as expected.\\n\" +\n \t\t\"If you need a working program, use version \" +\n \t\tZong.PROJECT_VERSION + \".\" + Zong.PROJECT_ITERATION_LAST_WORKING,\n \t\tPROJECT_FAMILY_NAME + \" \" + PROJECT_VERSION + \".\" + PROJECT_ITERATION,\n \t\tJOptionPane.WARNING_MESSAGE);\n }", "static private void showMissions() {\n\n Iterator iteratorMissionStatus = allMissions.missionStatus.entrySet().iterator();\n\n while (iteratorMissionStatus.hasNext()) {\n HashMap.Entry entry = (HashMap.Entry) iteratorMissionStatus.next();\n System.out.println((String) entry.getKey() + \": \");\n\n if ((boolean) (entry.getValue()) == false) {\n System.out.print(\"mission in progress\");\n System.out.println(\"\");\n }\n if ((boolean) (entry.getValue()) == true) {\n System.out.print(\"mission is complete\");\n System.out.println(\"\");\n }\n System.out.println(\"\");\n\n }\n }", "private boolean isBusyNow() {\n if (tip.visibleProperty().getValue()){\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"FTP Client\");\n alert.setHeaderText(\"Please wait current download finish!\");\n alert.initOwner(main.getWindow());\n alert.showAndWait();\n return true;\n }\n return false;\n }", "@Test(priority = 3)\n public void checkCourseProgress() {\n \twait.until(ExpectedConditions.titleContains(\"Email Marketing Strategies\"));\n \t\n \t//Assert Course progress\n \tString courseProgress = driver.findElement(By.xpath(\"//div[contains(@class, 'ld-progress-percentage')]\")).getText();\n \tAssert.assertEquals(courseProgress, \"100% COMPLETE\");\n }", "boolean hasPokemonDisplay();", "private int userAlreadyPresent() {\n System.out.printf(\"%s%n%s%n%s%n%s%n\", Notifications.getMessage(\"ERR_USER_ALREADY_PRESENT\"), Notifications.getMessage(\"SEPARATOR\"), Notifications.getMessage(\"PROMPT_PRESENT_USER_MULTIPLE_CHOICE\"), Notifications.getMessage(\"SEPARATOR\"));\n\n switch(insertInteger(1, 3)) {\n case 1:\n System.out.printf(\"%s %s%n\", Notifications.getMessage(\"MSG_EXIT_WITHOUT_SAVING\"), Notifications.getMessage(\"MSG_MOVE_TO_LOGIN\"));\n return -1;\n case 2:\n System.out.println(Notifications.getMessage(\"PROMPT_MODIFY_FIELDS\"));\n return 1;\n default:\n return 0;\n }\n }", "public boolean isProgramIdForUser(String programid) {\n if (mUserProgramsAndRoles != null) {\n String rolesStr = mUserProgramsAndRoles.get(programid);\n if (StringUtils.isNotBlank(rolesStr)) {\n Set<String> roles = new HashSet<>(Arrays.asList(rolesStr.split(\",\")));\n roles.retainAll(TBLOADER_ROLES);\n return roles.size() > 0;\n }\n }\n return false;\n }", "public boolean hasProgress() {\n return progressBuilder_ != null || progress_ != null;\n }", "@java.lang.Override\n public boolean hasProgress() {\n return progress_ != null;\n }", "public boolean uploadingProgressBarIsShow() {\n return uploadingProgressBar.getVisibility() == VISIBLE;\n }", "boolean canPerformQuest(int currentWorkCred);", "public void showStatus(Field field)\n {\n\n stepLabel.setText(\"\");\n stats.reset();\n\n fieldView.preparePaint();\n\n for(int row = 0; row < field.getDepth(); row++) {\n for(int col = 0; col < field.getWidth(); col++) {\n if(col <= field.getSavannaEnvironment().getEndCol()) {\n if(!\"Savanna\".equals(currentEnvironment)) {\n fieldView.drawMark(col, row, Color.gray);\n } else {\n fieldView.drawMark(col, row, Color.YELLOW);\n }\n } else if(col > field.getSavannaEnvironment().getEndCol() && col <= field.getForestEnvironment().getEndCol()) {\n if(!\"Forest\".equals(currentEnvironment)) {\n fieldView.drawMark(col, row, Color.gray);\n } else {\n fieldView.drawMark(col, row, Color.GREEN);\n }\n } else {\n if(!\"Desert\".equals(currentEnvironment)) {\n fieldView.drawMark(col, row, Color.gray);\n } else {\n fieldView.drawMark(col, row, Color.ORANGE);\n }\n }\n }\n }\n stats.generateCounts(field);\n stats.countFinished();\n\n population.setText(POPULATION_PREFIX + stats.getPopulationDetails(field, currentEnvironment));\n fieldView.repaint();\n }", "public static final boolean isUserLoad() {\n return SystemProperties.get(BUILD_TYPE).equals(BUILD_TYPE_USER);\n }", "void showQueuingBuildProgress();", "public boolean checkProgramChanged(){\r\n\t\tfor(int i = 0; i < paneCount(); i++) {\r\n\t\t\tif (!checkProgramChanged(i))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "protected void updateProgress(Progress prog) {\r\n \t// if this is called then ensure the no tasks msg is not also displayed\r\n \tshowNoTaskMsg(false);\r\n \t\r\n\t\tint done = prog.getWork();\r\n\t\tString status = getStatusDesc(prog);\r\n\r\n\t\tfinal ProgressUIControl progressUIControl = findOrCreateUIControl(prog);\r\n\t\tprogressUIControl.showMsg(status);\r\n\t\tprogressUIControl.showPercent(done);\r\n\t\t\r\n\t\tif (prog.isFinished() && !progressUIControl.isFinishNotified) {\r\n\t\t\tLog.i(TAG, \"Job finished:\"+prog.getJobName());\r\n\t\t\tprogressUIControl.isFinishNotified = true;\r\n\t\t\tjobFinished(prog);\r\n\t\t}\r\n }", "public String checkSystem() {\r\n\t\tif(currentSheeps > totalSheeps || currentSheeps < 0) {\r\n\t\t\treturn \"inconsistent!\";\r\n\t\t}\r\n\t\telse if(currentSheeps < totalSheeps) {\r\n\t\t\treturn \"incomplete!\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn \"complete!\";\r\n\t\t}\r\n\t}", "void showCreatorWaitingRoom();", "boolean hasOfflineUserDataJob();", "public void showComplete() {\r\n showCompleted = !showCompleted;\r\n todoListGui();\r\n }", "@NlsContexts.ProgressText\n String getRootsScanningProgressText();", "private void showResult(TYPE type){\r\n\t\tString brand = \"\";//brand\r\n\t\tString sub = \"\";//sub brand\r\n\t\tString area = \"\";//area\r\n\t\tString cus = \"\";//customer name\r\n\t\tString time = \"\";//time in second level\r\n\t\tKIND kind = null;//profit or shipment \r\n\t\t\r\n\t\tif(item1.getExpanded()){\r\n\t\t\tkind = KIND.SHIPMENT;\r\n\t\t\tbrand = combo_brand_shipment.getText();\r\n\t\t\tsub = combo_sub_shipment.getText();\r\n\t\t\tarea = combo_area_shipment.getText();\r\n\t\t\tcus = combo_cus_shipment.getText();\r\n\t\t}else if(item2.getExpanded()){\r\n\t\t\tkind = KIND.PROFIT;\r\n\t\t\tbrand = combo_brand_profit.getText();\r\n\t\t\tsub = combo_sub_profit.getText();\r\n\t\t\tarea = combo_area_profit.getText();\r\n\t\t\tcus = combo_cus_profit.getText();\r\n\t\t}else{//either item1 & item2 are not expanded\r\n\t\t\t//show a message?\r\n\t\t\tkind = KIND.NONE;\r\n\t\t}\r\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n\t\ttime = formatter.format(new Date());\r\n\t\tfinal Map<String, Object> args = new HashMap<String ,Object>();\r\n\t\targs.put(\"brand\", brand);\r\n\t\targs.put(\"sub_brand\", sub);\r\n\t\targs.put(\"area\", area);\r\n\t\targs.put(\"customer\", cus);\r\n\t\targs.put(\"time\", time);\r\n\t\targs.put(\"kind\", kind.toString());\r\n\t\targs.put(\"type\", type.toString());\r\n\t\t//call engine to get the data\t\r\n\t\t\r\n\t\tProgressMonitorDialog progressDialog = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());\r\n\t\tIRunnableWithProgress runnable = new IRunnableWithProgress() { \r\n\t\t public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { \r\n\t\t \t\r\n\t\t Display.getDefault().asyncExec(new Runnable() { \r\n\t\t public void run() { \r\n\t\t monitor.beginTask(\"正在进行更新,请勿关闭系统...\", 100); \r\n\t\t \r\n\t\t monitor.worked(25); \r\n\t monitor.subTask(\"收集数据\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tro.getMap().clear();\r\n\t\t\t\t\tro=statistic.startAnalyzing(args, monitor);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tMessageBox mbox = new MessageBox(MainUI.getMainUI_Instance(Display.getDefault()));\r\n\t\t\t\t\tmbox.setMessage(\"分析数据失败,请重试\");\r\n\t\t\t\t\tmbox.open();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tmonitor.worked(100); \r\n\t monitor.subTask(\"分析完成\");\r\n\t \r\n\t\t monitor.done();\r\n\t\t }\r\n\t\t \t });\r\n\t\t } \r\n\t\t}; \r\n\t\t \r\n\t\ttry { \r\n\t\t progressDialog.run(true,/*是否开辟另外一个线程*/ \r\n\t\t false,/*是否可执行取消操作的线程*/ \r\n\t\t runnable/*线程所执行的具体代码*/ \r\n\t\t ); \r\n\t\t} catch (InvocationTargetException e) { \r\n\t\t\tMessageBox mbox = new MessageBox(MainUI.getMainUI_Instance(Display.getDefault()));\r\n\t\t\tmbox.setMessage(\"分析数据失败,请重试\");\r\n\t\t\tmbox.open();\r\n\t\t\treturn;\r\n\t\t} catch (InterruptedException e) { \r\n\t\t\tMessageBox mbox = new MessageBox(MainUI.getMainUI_Instance(Display.getDefault()));\r\n\t\t\tmbox.setMessage(\"分析数据失败,请重试\");\r\n\t\t\tmbox.open();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(ro.getMap().isEmpty())\r\n\t\t\treturn;\r\n\t\t\r\n\t\tPagination page1 = (Pagination) ro.get(\"table1\");\r\n\t\tPagination page2 = (Pagination) ro.get(\"table2\");\r\n\t\tPagination page3 = (Pagination) ro.get(\"table3\");\r\n\t\tList<Object> res1 = new ArrayList<Object>();\r\n\t\tList<Object> res2 = new ArrayList<Object>();\r\n\t\tList<Object> res3 = new ArrayList<Object>();\r\n\t\tif(page1 != null)\r\n\t\t\tres1 = (List<Object>)page1.getItems();\r\n\t\tif(page2 != null)\r\n\t\t\tres2 = (List<Object>)page2.getItems();\r\n\t\tif(page2 != null)\r\n\t\t\tres3 = (List<Object>)page3.getItems();\r\n\t\t\r\n\t\tif(res1.size()==0 && res2.size()==0 && res3.size()==0){\r\n\t\t\tMessageBox messageBox = new MessageBox(MainUI.getMainUI_Instance(Display.getDefault()));\r\n\t \tmessageBox.setMessage(\"没有满足查询条件的数据可供分析,请查询其他条件\");\r\n\t \tmessageBox.open();\r\n\t \treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//this if/else can be optimized, since it looks better in this way, leave it\t\t\r\n\t\t//case 1: brand ratio, area ratio, trend\r\n\t\tif(brand.equals(AnalyzerConstants.ALL_BRAND) && area.equals(AnalyzerConstants.ALL_AREA)){\r\n\t\t\t\t\t\t\r\n\t\t\t//brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(true);//all brands\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n \t\t\r\n \t\t//area ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(true);//all areas\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//area\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\r\n\t\t}\r\n\t\t//case 2: brand ratio, customer ratio, trend\r\n\t\telse if(brand.equals(AnalyzerConstants.ALL_BRAND) && cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n\t\t\t//brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(true);//all brands\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n \r\n \t\t//customer ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(false);//all areas\r\n \t\trb2.setArea(area);\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//area\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 3: brand ratio, trend\r\n\t\telse if(brand.equals(AnalyzerConstants.ALL_BRAND) && !area.equals(AnalyzerConstants.ALL_AREA) && !cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n\t\t\t//brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(true);//all brands\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 4: sub brand ratio, area ratio, trend\r\n\t\telse if(sub.equals(AnalyzerConstants.ALL_SUB) && area.equals(AnalyzerConstants.ALL_AREA)){\r\n\t\t\t//sub brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(false);//all brands\r\n\t\t\trb.setBrand(brand);\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n \r\n \t\t//area ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(true);//all areas\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//area\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 5: sub brand ratio, customer ratio, trend\r\n\t\telse if(sub.equals(AnalyzerConstants.ALL_SUB) && cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n\t\t\t//sub brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(false);//all brands\r\n\t\t\trb.setBrand(brand);\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n \r\n \t\t//customer ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(false);//all areas\r\n \t\trb2.setArea(area);\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//area\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 6: sub brand ratio, trend\r\n\t\telse if(sub.equals(AnalyzerConstants.ALL_SUB) && !area.equals(AnalyzerConstants.ALL_AREA) && !cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n\t\t\t//sub brand ratio\r\n\t\t\tRatioBlock rb = new RatioBlock();\r\n\t\t\trb.setBrand_sub(false);//all brands\r\n\t\t\trb.setBrand(brand);\r\n\t\t\trb.setKind(kind);\r\n\t\t\trb.setBrand_area(true);//brand\r\n\t\t\tRatioResultList rrl = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl.initilByQuery(res1, 1);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc = new RatioComposite(composite_content, 0, rb, rrl); \r\n \t\talys.add(bc);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 7: area ratio, trend\r\n\t\telse if(!brand.equals(AnalyzerConstants.ALL_BRAND) && !sub.equals(AnalyzerConstants.ALL_SUB) && area.equals(AnalyzerConstants.ALL_AREA)){\r\n \t\t//area ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(true);//all areas\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//brand\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 8: customer ratio, trend\r\n\t\telse if(!brand.equals(AnalyzerConstants.ALL_BRAND) && !sub.equals(AnalyzerConstants.ALL_SUB) && cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n \t\t//customer ratio\r\n \t\tRatioBlock rb2 = new RatioBlock();\r\n \t\trb2.setArea_customer(false);//all areas\r\n \t\trb2.setArea(area);\r\n \t\trb2.setKind(kind);\r\n \t\trb2.setBrand_area(false);//brand\r\n\t\t\tRatioResultList rrl2 = new RatioResultList();\r\n\t\t\t//we should notice that, all the table can not be modified!\r\n\t\t\trrl2.initilByQuery(res2, 2);//the input arg is the query result from Engine\t\t\t\r\n\t\t\tRatioComposite bc2 = new RatioComposite(composite_content, 0, rb2, rrl2); \r\n \t\talys.add(bc2);\r\n \t\tcomposite_content.setLayout(layout_content);\r\n composite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t//case 9: trend\r\n\t\telse if(!brand.equals(AnalyzerConstants.ALL_BRAND) && !sub.equals(AnalyzerConstants.ALL_SUB) && !area.equals(AnalyzerConstants.ALL_AREA) & !cus.equals(AnalyzerConstants.ALL_CUSTOMER)){\r\n\t\t\t//now, just trend, do nothing here\r\n\t\t}\r\n\t\tif(!kind.equals(KIND.NONE)){\r\n\t\t\t//trend, always has the trend graph \t\r\n\t\t\tTrendDataSet ts = new TrendDataSet();\r\n\t\t\tts.setKind(kind);\t\r\n\t\t\tts.setType(type);\r\n\t\t\tTrendComposite tc = new TrendComposite(composite_content, 0, ts, res3); \r\n\t\t\talys.add(tc);\r\n\t\t\tcomposite_content.setLayout(layout_content);\r\n\t\t\tcomposite_scroll.setMinSize(composite_content.computeSize(SWT.DEFAULT, SWT.DEFAULT));\r\n\t\t}\r\n\t\t\t\t\r\n\t}", "public List<Models.Programme> showProgrammes() {\n List<Models.Programme> results = em.createNativeQuery(\"select pg.* from programme pg, programmeparticipant ppa, participant p where pg.programmecode = ppa.programmecode and ppa.participantid = p.participantid and p.userid = ?\", Models.Programme.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" programmes were found.\");\n\n for (Models.Programme programme : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Programme?id=\" + programme.getProgrammecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>PROGRAMME</a>\\n\"\n + \" <a class='name'>\" + programme.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + programme.getProgrammecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public void iterateAndClickParticularProgram(final String programeName);", "public void checkIfProgramsAccesible(List<String> programList);", "public List<Models.Programme> showProgrammes(String from) {\n // Get from all levels\n List<Models.Programme> results = em.createNativeQuery(\"select pg.* from programme pg, institution i, institutionparticipant ipa, participant p where pg.institutioncode = i.institutioncode and ipa.institutioncode = i.institutioncode and ipa.participantid = p.participantid and p.userid = ? and i.institutioncode = ?\", Models.Programme.class).setParameter(1, user.getUserid()).setParameter(2, from).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" programmes were found.\");\n\n for (Models.Programme programme : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Programme?id=\" + programme.getProgrammecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>PROGRAMME</a>\\n\"\n + \" <a class='name'>\" + programme.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + programme.getProgrammecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public boolean existInItinerary() {\n\t\t\n\t\tlong position = mPref.getLong(\"KEY_DATA_POSITION\", 0);\n\t\t\n\t\tif (mPref.contains(\"USER_DATA_\" + position)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasStartingInfo();", "private void showMenuListProspect(){\n File fProspect = new File(\"Propsect_Relance.csv\");\n if(!fProspect.exists()){\n jMenuItem_ShowProspect.setEnabled(false);\n }\n }", "public void showProgress(boolean show) {\n \t}", "public boolean showAllOccupationTypes() {\n return occupationTypes.contains(OccupationType.TOIMINNANOHJAAJA);\n }", "public void printByUser() {\r\n TUseStatus useStatus;\r\n\t for (int a=0; a < m_current_resources_count; a++)\r\n\t for (int b=0; b < m_current_users_count; b++) {\r\n\t useStatus = m_associations[a][b];\r\n\t if (useStatus!=null) System.out.println(useStatus.toString()); \r\n\t } \r\n }", "public boolean isOpened(){\n return chestProgressLevel==1;\n }", "boolean isReadyForShowing();", "private boolean shouldRegisterCourse(Progress progress) {\n return progress.name.equals(Progress.courseRegistration)\n || progress.name.equals(Progress.courseRegistrationCanceled)\n || progress.name.equals(Progress.courseRegistrationResponseNegative);\n }", "boolean hasUsage();", "private boolean checkProgramChanged(int i)\r\n\t{\r\n\t\tBoolean bool = true;\r\n\t\tif (isPaneModified(i)) {\r\n\t\t\tparentFrame.showProgram();\r\n\t\t\tsetSelectedIndex(i);\r\n\t\t\tString message = Messages\r\n\t\t\t\t.getString(\"EditorFrame.tab.discardChanges.confirm\"); //$NON-NLS-1$\r\n\t\t\tString title = Messages\r\n\t\t\t\t.getString(\"EditorFrame.program.discardChanges.confirmTitle\"); //$NON-NLS-1$\r\n\t\t\tObject[] options = { Messages.getString(\"tangara.yes\"), //$NON-NLS-1$\r\n\t\t\t\tMessages.getString(\"tangara.cancel\") }; //$NON-NLS-1$\r\n\t\t\tint answer = JOptionPane.showOptionDialog(this, message, title,\r\n\t\t\t\tJOptionPane.OK_CANCEL_OPTION,\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE,\r\n\t\t\t\tnull, // do not use a custom Icon\r\n\t\t\t\toptions, // the titles of buttons\r\n\t\t\t\toptions[0]);\r\n\t\t\tif (answer != JOptionPane.OK_OPTION)\r\n\t\t\t\tbool = false;\r\n\t\t}\r\n\t\treturn bool;\r\n\t}", "public boolean isActiveUser() {\r\n if (currentProcessInstance == null)\r\n return false;\r\n \r\n String[] states = currentProcessInstance.getActiveStates();\r\n if (states == null)\r\n return false;\r\n \r\n Actor[] users;\r\n for (int i = 0; i < states.length; i++) {\r\n try {\r\n users = currentProcessInstance.getWorkingUsers(states[i]);\r\n for (int j = 0; j < users.length; j++) {\r\n if (getUserId().equals(users[j].getUser().getUserId()))\r\n return true;\r\n }\r\n } catch (WorkflowException ignored) {\r\n // ignore unknown state\r\n continue;\r\n }\r\n }\r\n \r\n return false;\r\n }", "public void verifyTrainingProgressCardIsDisplayed(String trainingName)\n {\n \twaitUntillFinishProcessSpinnerDisable();\n_normalWait(3000); \n \tWebElement elementToBeVerified = \n \t\t\tdriver.findElement(ByLocator(\"//div[@class='ma-dialog-header']/span[contains(text(),'\"+trainingName+\"')]\"));\n \tAssert.assertTrue(elementToBeVerified.isDisplayed());\n \treportInfo();\n }", "boolean hasWork();", "private void showProgress(String taskName,String processString)\n {\n mProgressView = ProgressDialog.show(this, taskName, processString, true);\n mLoginFormView.setVisibility(View.INVISIBLE);\n\n }", "void showModalProgress();", "private void displayLoader() {\n pDialog = new ProgressDialog(RegisterActivity.this);\n pDialog.setMessage(\"Signing Up.. Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }", "@Override\n public void setUserVisibleHint(boolean isVisibleToUser) {\n super.setUserVisibleHint(isVisibleToUser);\n if (isVisibleToUser && !alreadyMadeApplicationsApiCall) {\n alreadyMadeApplicationsApiCall = true;\n fetchItemsWithUrl(getActivity(), ApiManager.getApprovedApplicationsUrl());\n }\n }", "private boolean hasUserImportantView() {\n int userID = this.sharedPreferences.getInt(Constants.SP_USER_ID_KEY, 0);\n return this.sharedPreferences.getBoolean(serverName + \"_\" + userID, false);\n }", "void showLoading(boolean isLoading);", "public boolean loadProgress() {\n return false;\n }", "void onShowProgress();", "public String systemCompletion(SystemType system) {\n\t\tboolean isComplete = true;\n\t\tboolean isStarted = true;\n\t\tPlayer player = null;\n\t\tString result;\n\n\t\tfor (StandardElement stdElement : GameLauncher.board.getStdElements()) {\n\n\t\t\tif (stdElement.getElementSystem().equals(system)) {\n\n\t\t\t\tif (!stdElement.isMaxDevelopment()) {\n\t\t\t\t\tisComplete = false;\n\t\t\t\t}\n\t\t\t\tif (stdElement.getOwnedBy() == null) {\n\t\t\t\t\tisComplete = false;\n\t\t\t\t\tisStarted = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tplayer = stdElement.getOwnedBy();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif (isComplete) {\n\t\t\tresult = String.format(\"\\nAll elements of %s were successfully researched and constructed by %s!\\n\",\n\t\t\t\t\tsystem.getName(), player.getName());\n\t\t} else if (isStarted) {\n\t\t\tresult = String.format(\n\t\t\t\t\t\"\\n%s started research & development on the %s, but unfortunately the Artemis project failed before construction could be completed.\\n\",\n\t\t\t\t\tplayer.getName(), system.getName());\n\t\t} else {\n\t\t\tresult = String.format(\n\t\t\t\t\t\"\\nDespite the efforts invested by the teams, %s never managed to get past the initial research stages.\\n\",\n\t\t\t\t\tsystem.getName());\n\t\t}\n\n\t\treturn result;\n\t}", "@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\t\t\t\tif (fromUser) {\n\t\t\t\t\tswitch (seekBar.getId()) {\n\t\t\t\t\t\tcase R.id.farmersSeekBar:\n\t\t\t\t\t\t\tif (colonyManager.workersEnabled && colonyManager.scientistsEnabled) {\n\t\t\t\t\t\t\t\tdouble k;\n\t\t\t\t\t\t\t\tif (colonyManager.workersPercentage + colonyManager.scientistsPercentage != 0) {\n\t\t\t\t\t\t\t\t\tk = colonyManager.workersPercentage / (colonyManager.workersPercentage + colonyManager.scientistsPercentage);\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\tk = 0.5;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdouble newFarmersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\tdouble sumPercentageLeft = 1 - newFarmersPercentage;\n\t\t\t\t\t\t\t\tdouble newWorkersPercentage = k * sumPercentageLeft;\n\t\t\t\t\t\t\t\tdouble newScientistPercentage = sumPercentageLeft - newWorkersPercentage;\n\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistPercentage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (colonyManager.workersEnabled) {\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.farmersPercentage + colonyManager.workersPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(maxPercentage, 0, colonyManager.scientistsPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newFarmersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newWorkersPercentage = maxPercentage - newFarmersPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, colonyManager.scientistsPercentage);\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 /*=> colonyManager.scientistsEnabled == true, otherwise user would be unable to impact farmersSeekBar*/\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.farmersPercentage + colonyManager.scientistsPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(maxPercentage, colonyManager.workersPercentage, 0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newFarmersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newScientistsPercentage = maxPercentage - newFarmersPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, colonyManager.workersPercentage, newScientistsPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinvalidatePercentages();\n\t\t\t\t\t\t\tinvalidateDeltaMorale();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase R.id.workersSeekBar:\n\t\t\t\t\t\t\tif (colonyManager.farmersEnabled && colonyManager.scientistsEnabled) {\n\t\t\t\t\t\t\t\tdouble k;\n\t\t\t\t\t\t\t\tif (colonyManager.farmersPercentage + colonyManager.scientistsPercentage != 0) {\n\t\t\t\t\t\t\t\t\tk = colonyManager.farmersPercentage / (colonyManager.farmersPercentage + colonyManager.scientistsPercentage);\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\tk = 0.5;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdouble newWorkersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\tdouble sumPercentageLeft = 1 - newWorkersPercentage;\n\t\t\t\t\t\t\t\tdouble newFarmersPercentage = k * sumPercentageLeft;\n\t\t\t\t\t\t\t\tdouble newScientistsPercentage = sumPercentageLeft - newFarmersPercentage;\n\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistsPercentage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (colonyManager.farmersEnabled) {\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.farmersPercentage + colonyManager.workersPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(0, maxPercentage, colonyManager.scientistsPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newWorkersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newFarmersPercentage = maxPercentage - newWorkersPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, colonyManager.scientistsPercentage);\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 //=> colonyManager.scientistsEnabled == true, otherwise user would be unable to impact workersSeekBar\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.workersPercentage + colonyManager.scientistsPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(colonyManager.farmersPercentage, maxPercentage, 0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newWorkersPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newScientistsPercentage = maxPercentage - newWorkersPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(colonyManager.farmersPercentage, newWorkersPercentage, newScientistsPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinvalidatePercentages();\n\t\t\t\t\t\t\tinvalidateDeltaMorale();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase R.id.scientistsSeekBar:\n\t\t\t\t\t\t\tif (colonyManager.farmersEnabled && colonyManager.workersEnabled) {\n\t\t\t\t\t\t\t\tdouble k;\n\t\t\t\t\t\t\t\tif (colonyManager.farmersPercentage + colonyManager.workersPercentage != 0) {\n\t\t\t\t\t\t\t\t\tk = colonyManager.farmersPercentage / (colonyManager.farmersPercentage + colonyManager.workersPercentage);\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\tk = 0.5;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdouble newScientistsPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\tdouble sumPercentageLeft = 1 - newScientistsPercentage;\n\t\t\t\t\t\t\t\tdouble newFarmersPercentage = k * sumPercentageLeft;\n\t\t\t\t\t\t\t\tdouble newWorkersPercentage = sumPercentageLeft - newFarmersPercentage;\n\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistsPercentage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (colonyManager.farmersEnabled) {\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.farmersPercentage + colonyManager.scientistsPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(0, colonyManager.workersPercentage, maxPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newScientistsPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newFarmersPercentage = maxPercentage - newScientistsPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(newFarmersPercentage, colonyManager.workersPercentage, newScientistsPercentage);\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 /*=> colonyManager.workersEnabled == true, otherwise user would be unable to impact scientistsSeekBar*/\n\t\t\t\t\t\t\t\t\tdouble maxPercentage = colonyManager.workersPercentage + colonyManager.scientistsPercentage;\n\t\t\t\t\t\t\t\t\tint maxProgress = (int) Math.round(maxPercentage * 100);\n\t\t\t\t\t\t\t\t\tif (progress >= maxProgress) {\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(colonyManager.farmersPercentage, 0, maxPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdouble newScientistsPercentage = progress / 100.0;\n\t\t\t\t\t\t\t\t\t\tdouble newWorkersPercentage = maxPercentage - newScientistsPercentage;\n\t\t\t\t\t\t\t\t\t\tcolonyManager.setPercentage(colonyManager.farmersPercentage, newWorkersPercentage, newScientistsPercentage);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinvalidatePercentages();\n\t\t\t\t\t\t\tinvalidateDeltaMorale();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tToast.makeText(MainActivity.context, \"Error: unknown seekBar.\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\r\n public boolean isAvailable() {\r\n if (getView() == null)\r\n return false;\r\n return getView().getSelectedUsers(true) != null || getView().getSelectedQueries(true) != null;\r\n }", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n indicator.setImageResource(getResources().getIdentifier(satisfaction[seekBar.getProgress()], \"drawable\", getActivity().getPackageName()));\n }", "public void Show_only_completed()\r\n {\n if(!this.filter)\r\n {\r\n if(tableView.getItems().size()>0) {\r\n for (int i = 0; i < tableView.getItems().size(); i++) {\r\n ucf.assignments.list selectedList = tableView.getItems().get(i);\r\n this.all_items.add(selectedList);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n resettable();\r\n }\r\n this.filter = true;\r\n ArrayList<ucf.assignments.list> tmplist = new ArrayList<ucf.assignments.list>();\r\n\r\n for(int i = 0; i<tableView.getItems().size();i++)\r\n {\r\n ucf.assignments.list selectedList = tableView.getItems().get(i);\r\n if(selectedList.getstatus())\r\n tmplist.add(selectedList);\r\n }\r\n tableView.getItems().removeAll(tmplist);\r\n }", "boolean hasIsComplete();", "boolean hasIsComplete();", "public boolean isCheckedOutByUser() {\r\n \r\n if (vocabularyFolder == null) {\r\n return false;\r\n } else {\r\n return StringUtils.isNotBlank(vocabularyFolder.getWorkingUser()) && !vocabularyFolder.isWorkingCopy()\r\n && StringUtils.equals(getUserName(), vocabularyFolder.getWorkingUser());\r\n }\r\n }", "boolean hasProject();", "public final boolean isProgressBarVisible() {\r\n\r\n if ((pBarVisible == true) && (progressBar != null)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private void check(final VProgram program) {\n\t}", "public DTProgramaFormacion verInfoPrograma(String nombreProg) throws ProgramaFormacionExcepcion;", "public boolean isEditableByUser() {\r\n if ((this.currentStatusChange == null) ||\r\n (this.currentStatusChange.equals(PoStatusCode.PROPOSED)))\r\n return true;\r\n return false;\r\n }", "public default boolean activeFromObject(SpellData dataIn, World worldIn){ return getRangeType() != RangeType.PERSONAL; }", "boolean isUnique(TextField inputPartNumber);", "private void saveAsConfirmButton(){\n //Check if the input is valid (lcase and no spaces)\n String input = SaveAsLabNameTextField.getText();\n \n if(input.contains(\" \") || !input.equals(input.toLowerCase())){ \n SaveAsErrorLabel.setText(\"Lab name must be lowercase and contain no spaces!\");\n SaveAsErrorLabel.setVisible(true);\n }\n //Check if lab already exists\n else if(Arrays.asList(labsPath.list()).contains(input)){ \n SaveAsErrorLabel.setText(\"Lab already exists!\");\n SaveAsErrorLabel.setVisible(true);\n }\n else{\n SaveAsErrorLabel.setVisible(false);\n saveAs(input);\n SaveAsDialog.setVisible(false);\n } \n }", "private void showProgressIndication() {\n Log.i(TAG, \"loading contacts... \");\n // TODO: make this be a no-op if the progress indication is\n // already visible with the exact same title and message.\n\n dismissProgressIndication(); // Clean up any prior progress indication\n\n mProgressDialog = new ProgressDialog(this);\n mProgressDialog.setMessage(this.getResources().getString(R.string.contact_list_loading));\t\n mProgressDialog.setIndeterminate(true);\n mProgressDialog.setCancelable(false);\n mProgressDialog.show();\n }", "@Override\r\n\tprotected void onProgressUpdate(String... s) {\r\n\t\tactivity.addToGUI(s[0]);\r\n\t}", "private boolean isOnePerOrg(String org){\r\n\t\tfor(int i = 0; i < users.size(); i++){\r\n\t\t\tif(users.get(i).organization.equalsIgnoreCase(org)){\r\n\t\t\t\tSystem.out.println(\"Sorry only one person can represent the Nonprofit Organization\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void printReport(){\n\t\tSystem.out.println(\"This is \" + name + \", UPENN \" + graduationYear);\n\t\tSystem.out.println(\"Their GPA is \" + GPA);\n\t\tString numCoursesString = \"\";\n\t\tif (numCoursesCompleted == 1){\n\t\t\tnumCoursesString=\"course\";\t//if the student has only taken one course, just print course\n\t\t}\n\t\telse{\n\t\t\tnumCoursesString=\"courses\"; //if the student has taken more than one course, print courses when called\n\t\t}\n\t\tSystem.out.println(\"They have taken \" + numCoursesCompleted + \" \" + numCoursesString); \n\t}", "public boolean isMainProgram() {\n return this.getName() == null;\n }", "public void toolAccepted()\n {\n printOut(cliToolsManager.simpleQuestionsMaker(\"Strumento accettato\", 40, true));\n }", "@Override\n public void showProgress() {\n\n }", "boolean hasStartingHadithNo();", "public void info(){\r\n System.out.println(\"Title : \" + title);\r\n System.out.println(\"Author . \" + author);\r\n System.out.println(\"Location : \" + location);\r\n if (isAvailable){\r\n System.out.println(\"Available\");\r\n }\r\n else {\r\n System.out.println(\"Not available\");\r\n }\r\n\r\n }", "@Nullable\n @NlsContexts.ProgressText\n String getRootsScanningProgressText();", "public void queryAndDisplayStatus(View examView, AppCompatActivity activity) {\n new ExamStatusDisplayerTask(this).execute(examView, activity);\n }", "boolean hasAchievementType();", "@Override\n public void showProgressSync() {\n }", "public boolean is_completed();", "public static boolean isCourseCancellable(Connection conn,String kix,String user) throws SQLException {\n\n\t\t//Logger logger = Logger.getLogger(\"test\");\n\n\t\tboolean cancellable = false;\n\t\tString proposer = \"\";\n\t\tString progress = \"\";\n\n\t\ttry {\n\t\t\tString[] info = getKixInfo(conn,kix);\n\t\t\tString alpha = info[0];\n\t\t\tString num = info[1];\n\t\t\tString campus = info[4];\n\n\t\t\tString sql = \"SELECT edit,proposer,progress FROM tblfnd WHERE historyid=?\";\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\n\t\t\tps.setString(1,kix);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tcancellable = rs.getBoolean(1);\n\t\t\t\tproposer = rs.getString(2);\n\t\t\t\tprogress = rs.getString(3);\n\t\t\t}\n\n\t\t\t// only the proposer may cancel a pending course\n\t\t\tif (cancellable && user.equals(proposer) &&\n\t\t\t\t(\tprogress.equals(Constant.FND_MODIFY_TEXT) ||\n\t\t\t\t\tprogress.equals(Constant.FND_DELETE_TEXT) ||\n\t\t\t\t\tprogress.equals(Constant.FND_REVISE_TEXT)\n\t\t\t\t)){\n\t\t\t\tcancellable = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcancellable = false;\n\t\t\t}\n\n\t\t\trs.close();\n\t\t\tps.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tlogger.fatal(\"FndDB.isCourseCancellable - \" + e.toString());\n\t\t\tcancellable = false;\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"FndDB.isCourseCancellable - \" + e.toString());\n\t\t\tcancellable = false;\n\t\t}\n\n\t\treturn cancellable;\n\t}", "boolean isComplete();", "boolean isComplete();", "private boolean isUserVisibleEvent(int eventType) {\n return eventType != UsageEvents.Event.SYSTEM_INTERACTION\n && eventType != UsageEvents.Event.STANDBY_BUCKET_CHANGED;\n }", "private void checking() {\n checkProgress = new ProgressDialog(DownloadActivity.this);\n checkProgress.setCancelable(false);\n checkProgress.setMessage(getResources().getString(R.string.checking_message));\n checkProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n checkProgress.setIndeterminate(true);\n checkProgress.show();\n new Thread(new Runnable() {\n public void run() {\n while (check == 0) {}\n checkProgress.dismiss();\n }\n }).start();\n }" ]
[ "0.5622444", "0.54570264", "0.54570264", "0.533375", "0.5220627", "0.50866747", "0.4998121", "0.4986403", "0.49673367", "0.4917119", "0.49126253", "0.4886458", "0.48762602", "0.48452285", "0.48382053", "0.48248836", "0.4812706", "0.48029092", "0.47874027", "0.47686312", "0.47302875", "0.47110364", "0.47019783", "0.47002816", "0.4698149", "0.46906275", "0.4673737", "0.46722767", "0.46673018", "0.4663937", "0.46593487", "0.4644737", "0.463485", "0.46266297", "0.46229306", "0.46221533", "0.46015045", "0.45834848", "0.4577592", "0.45747706", "0.4571188", "0.4571178", "0.45643952", "0.45629215", "0.45540866", "0.45533997", "0.45533946", "0.45404872", "0.45371822", "0.45351624", "0.45335624", "0.45315188", "0.45310128", "0.4529305", "0.45176744", "0.45155984", "0.4512186", "0.45112875", "0.45099035", "0.4507553", "0.45074096", "0.45072266", "0.449859", "0.44975886", "0.44971955", "0.4494041", "0.44929644", "0.44867304", "0.44847167", "0.44816405", "0.44754827", "0.44754827", "0.44728613", "0.44626904", "0.44613034", "0.44576168", "0.44557813", "0.4453738", "0.4447183", "0.44431108", "0.44399598", "0.44387144", "0.4437341", "0.44354165", "0.44333845", "0.44320714", "0.44173348", "0.44161955", "0.44096607", "0.44089776", "0.44083425", "0.44065848", "0.44025415", "0.44003713", "0.43845475", "0.4384007", "0.43817195", "0.43817195", "0.43738788", "0.4372851" ]
0.49500307
9
/ Is this program reviewable? If so, is this the proposer? Only proposer can invite. progress = review or modify or review in approval review requested = proposer
public static boolean reviewable(Connection conn,String campus,String kix,String user) throws SQLException { //Logger logger = Logger.getLogger("test"); boolean reviewable = false; String proposer = ""; String progress = ""; String subprogress = ""; boolean debug = false; try { debug = DebugDB.getDebug(conn,"FndDB"); if (debug){ logger.info("---------->"); logger.info("reviewable"); logger.info("---------->"); logger.info("campus: " + campus); logger.info("kix: " + kix); logger.info("user: " + user); } String sql = "SELECT proposer,progress,subprogress FROM tblfnd WHERE campus=? AND historyid=?"; PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1, campus); ps.setString(2, kix); ResultSet rs = ps.executeQuery(); if (rs.next()) { proposer = AseUtil.nullToBlank(rs.getString(1)); progress = AseUtil.nullToBlank(rs.getString(2)); subprogress = AseUtil.nullToBlank(rs.getString(3)); } rs.close(); ps.close(); String coproposer = getFndItem(conn,kix,"coproposer"); String currentApprover = ApproverDB.getCurrentFndApprover(conn,campus,kix); if (currentApprover == null){ currentApprover = Constant.BLANK; } // if the proposer and modify or review or review in approval // else if current approver and approval or delete if ((user.equals(proposer) || coproposer.contains(user)) && ( progress.equals(Constant.FND_MODIFY_PROGRESS) || progress.equals(Constant.FND_REVIEW_PROGRESS) || subprogress.equals(Constant.FND_REVIEW_IN_APPROVAL))){ reviewable = true; } else if ( ( progress.equals(Constant.FND_APPROVAL_PROGRESS) || progress.equals(Constant.FND_DELETE_PROGRESS)) || user.equals(currentApprover) ){ reviewable = true; } else{ reviewable = false; } if (debug){ logger.info("<----------"); logger.info("reviewable"); logger.info("<----------"); logger.info("reviewable: " + reviewable); logger.info("proposer: " + proposer); logger.info("coproposer: " + coproposer); logger.info("progress: " + progress); logger.info("subprogress: " + subprogress); logger.info("currentApprover: " + currentApprover); } } catch (SQLException e) { logger.fatal("FndDB.reviewable - " + e.toString()); } catch (Exception e) { logger.fatal("FndDB.reviewable - " + e.toString()); } return reviewable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isApproved();", "public boolean isApproved();", "@Override\n\tpublic boolean isApproved() {\n\t\treturn _scienceApp.isApproved();\n\t}", "@Override\n\tpublic boolean isApproved();", "@SystemAPI\n\tboolean needsApproval();", "boolean hasPlainApprove();", "public boolean isApproved()\n\t{\n\t\tif(response.containsKey(\"Result\")) {\n\t\t\tif(response.get(\"Result\").equals(\"APPROVED\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isApproved() {\n\t\treturn model.isApproved();\n\t}", "public boolean isApproved() {\n return approved;\n }", "public boolean isUserApproval() {\n\n if (!ACTION_UserChoice.equals(getAction())) {\n return false;\n }\n\n return (getColumn() != null) && \"IsApproved\".equals(getColumn().getColumnName());\n\n }", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "public boolean hasPlainApprove() {\n return dataCase_ == 4;\n }", "public boolean hasPlainApprove() {\n return dataCase_ == 4;\n }", "public boolean isApproved() {\n\t\treturn isApproved;\n\t}", "private boolean isApproved() {\r\n if (rnd.nextInt(10) < 5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "@Override\n\tpublic boolean approvePartner(Partner partner) {\n\t\treturn false;\n\t}", "public boolean isProved() {\n\t\treturn proveState == PROVED;\n\t}", "public boolean requiresPostApproval() {\n return true;\n }", "boolean isAccepting();", "private boolean askForSuperviser(Person p) throws Exception {\n\n\t\treturn p.isResearcher() && (p.getInstitutionalRoleId() > 1);\n\t}", "String propose() {\r\n Person person = preferences[pointer];\r\n partner = determinePartner(person);\r\n String result;\r\n if (partner == null) {\r\n result = person.name + \" rejects. \";\r\n } else if (ex == null || ex.isEmpty()) {\r\n result = person.name + \" accepts. \";\r\n } else {\r\n result = person.name + \" dumps \" + ex + \", gets engaged to \" + name + \".\";\r\n }\r\n pointer++;\r\n ex = \"\";\r\n return name + \" proposes to \" + person.name + \". \" + result;\r\n }", "private boolean doGetApproval() {\n\t\tcurrentStep = OPERATION_NAME+\": getting approval from BAMS\";\n\t\tif (!_atmssHandler.doDisDisplayUpper(SHOW_PLEASE_WAIT)) {\n\t\t\trecord(\"Dis\");\n\t\t\treturn false;\n\t\t}\n\t\tresult = _atmssHandler.doBAMSUpdatePasswd(newPassword, _session);\n\t\tif (result) {\n\t\t\trecord(\"password changed\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\trecord(\"BAMS\");\n\t\t\tif (!_atmssHandler.doDisDisplayUpper(FAILED_FROM_BAMS_UPDATING_PW)) {\n\t\t\t\trecord(\"Dis\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpause(3);\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean canCreateProposal( Person user ) {\n\t\tApplicationTask task = new ApplicationTask( TaskName.CREATE_PROPOSAL );\n\t\tTaskAuthorizationService taskAuthenticationService = KraServiceLocator.getService( TaskAuthorizationService.class );\n\t\treturn taskAuthenticationService.isAuthorized( user.getPrincipalId(), task );\n\t}", "boolean hasAccountBudgetProposal();", "public boolean isHasAlreadyReviewed() {\r\n boolean result = false;\r\n if (ui.isIsUserAuthenticated() && professionalStatus.isIsProfessional()) {\r\n Users user = ui.getUser();\r\n if (recipe != null) {\r\n for (Review rev : recipe.getReviews()) {\r\n if (rev.getReviewer().getUserName().equals(user.getUserName())) {\r\n result = true;\r\n break;\r\n }\r\n }//end for\r\n }\r\n }// end value != null\r\n return result;\r\n }", "public String approve() throws Exception\r\n {\r\n try\r\n {\r\n PoInvGrnDnMatchingHolder holder = poInvGrnDnMatchingService.selectByKey(param.getMatchingOid());\r\n \r\n if (\"yes\".equals(this.getSession().get(SESSION_SUPPLIER_DISPUTE)))\r\n {\r\n if (PoInvGrnDnMatchingStatus.PENDING.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"pending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.MATCHED.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"matched\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.INSUFFICIENT_INV.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"insufficientInv\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingStatus.OUTDATED.equals(holder.getMatchingStatus()))\r\n {\r\n this.result = \"outdated\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingInvStatus.APPROVED.equals(holder.getInvStatus()) || PoInvGrnDnMatchingInvStatus.SYS_APPROVED.equals(holder.getInvStatus()))\r\n {\r\n this.result = \"approved\";\r\n return SUCCESS;\r\n }\r\n if (!holder.getRevised())\r\n {\r\n if (PoInvGrnDnMatchingSupplierStatus.PENDING.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"supplierpending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.PENDING.equals(holder.getBuyerStatus()) && PoInvGrnDnMatchingSupplierStatus.ACCEPTED.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"supplieraccept\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.PENDING.equals(holder.getBuyerStatus()) && PoInvGrnDnMatchingSupplierStatus.REJECTED.equals(holder.getSupplierStatus()))\r\n {\r\n this.result = \"buyerpending\";\r\n return SUCCESS;\r\n }\r\n if (PoInvGrnDnMatchingBuyerStatus.REJECTED.equals(holder.getBuyerStatus()))\r\n {\r\n this.result = \"rejected\";\r\n return SUCCESS;\r\n }\r\n }\r\n }\r\n if (null == param.getInvStatusActionRemarks() || param.getInvStatusActionRemarks().length() == 0 || param.getInvStatusActionRemarks().length() > 255)\r\n {\r\n this.result = \"remarks\";\r\n return SUCCESS;\r\n }\r\n this.checkInvFileExist(holder);\r\n poInvGrnDnMatchingService.changeInvDateToFirstGrnDate(holder);\r\n PoInvGrnDnMatchingHolder newHolder = new PoInvGrnDnMatchingHolder();\r\n BeanUtils.copyProperties(holder, newHolder);\r\n newHolder.setInvStatus(PoInvGrnDnMatchingInvStatus.APPROVED);\r\n newHolder.setInvStatusActionDate(new Date());\r\n newHolder.setInvStatusActionRemarks(param.getInvStatusActionRemarks());\r\n newHolder.setInvStatusActionBy(getProfileOfCurrentUser().getLoginId());\r\n poInvGrnDnMatchingService.auditUpdateByPrimaryKeySelective(this.getCommonParameter(), holder, newHolder);\r\n poInvGrnDnMatchingService.moveFile(holder);\r\n this.result = \"1\";\r\n }\r\n catch (Exception e)\r\n {\r\n ErrorHelper.getInstance().logError(log, this, e);\r\n this.result = \"0\";\r\n }\r\n return SUCCESS;\r\n }", "private void completeReview(long ticketId, ApprovalDTO dto, boolean reject, String reason)\n throws PortalServiceException {\n CMSUser user = ControllerHelper.getCurrentUser();\n Enrollment ticketDetails = enrollmentService.getTicketDetails(user, ticketId);\n \n long processInstanceId = ticketDetails.getProcessInstanceId();\n if (processInstanceId <= 0) {\n throw new PortalServiceException(\"Requested profile is not available for approval.\");\n }\n try {\n List<TaskSummary> availableTasks = businessProcessService.getAvailableTasks(user.getUsername(),\n Arrays.asList(user.getRole().getDescription()));\n boolean found = false;\n for (TaskSummary taskSummary : availableTasks) {\n if (taskSummary.getName().equals(APPROVAL_TASK_NAME)\n && taskSummary.getProcessInstanceId() == processInstanceId) {\n found = true;\n long taskId = taskSummary.getId();\n\n if (!reject) {\n // apply approver changes\n ProviderInformationType provider = applyChanges(dto, taskId);\n businessProcessService.completeReview(taskId, user.getUsername(),\n Arrays.asList(user.getRole().getDescription()), provider, false, reason);\n } else {\n businessProcessService.completeReview(taskId, user.getUsername(),\n Arrays.asList(user.getRole().getDescription()), null, true, reason);\n }\n }\n }\n if (!found) {\n throw new PortalServiceException(\"You do not have access to the requested operation.\");\n }\n } catch (Exception ex) {\n throw new PortalServiceException(\"Error while invoking process server.\", ex);\n }\n }", "public Byte getApproveStatus() {\n return approveStatus;\n }", "protected void setProved() {\n\t\tproveState = PROVED;\n\t}", "public void interactWhenApproaching() {\r\n\t\t\r\n\t}", "public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }", "public boolean approvePotentialDeliveryMan(final Parcel parcel, final String email);", "@Test\n\tvoid grantScholarshipApproved() {\n\t\tScholarship scholarship= iScholarshipService.getById(1000).orElse(null);\n\t\tStudent student= iStudentService.findByStudentId(166);\n\t\tassertEquals(scholarship,iOfficerService.grantApproval(scholarship, student));\n\t\t\n\t}", "protected boolean isAdvancePendingEntry(GeneralLedgerPendingEntry glpe) {\n return StringUtils.equals(glpe.getFinancialDocumentTypeCode(), TemConstants.TravelDocTypes.TRAVEL_AUTHORIZATION_CHECK_ACH_DOCUMENT) ||\n StringUtils.equals(glpe.getFinancialDocumentTypeCode(),TemConstants.TravelDocTypes.TRAVEL_AUTHORIZATION_WIRE_OR_FOREIGN_DRAFT_DOCUMENT);\n }", "cosmos.gov.v1beta1.ProposalStatus getStatus();", "HrDocumentRequest approve(HrDocumentRequest hrDocumentRequest);", "public void setIsApproved (boolean IsApproved);", "public void setIsApproved (boolean IsApproved);", "private void reviewDeptPolicies() {\n if(metWithHr && metDeptStaff) {\n reviewedDeptPolicies = true;\n } else {\n System.out.println(\"Sorry, you cannot review \"\n + \" department policies until you have first met with HR \"\n + \"and then with department staff.\");\n }\n }", "public boolean ApproveReimbursement(int employeeID, int reimburseID, String reason, int status);", "public boolean inProgress(){return (this.currentTicket != null);}", "public static void showReviewDialogIfNotShownBefore() {\n\t\tif (mRequestActivity != null\n\t\t\t\t\t\t&& PhonarPreferencesManager.getFirstResponseSeen(mRequestActivity)\n\t\t\t\t\t\t&& !PhonarPreferencesManager.getReviewDialogSeen(mRequestActivity)) {\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(mRequestActivity);\n\t\t\tbuilder.setTitle(R.string.review_title);\n\t\t\tbuilder.setMessage(R.string.review_message);\n\t\t\tbuilder.setPositiveButton(R.string.review_ok, new DialogInterface.OnClickListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW, Uri\n\t\t\t\t\t\t\t\t\t.parse(\"market://details?id=com.phonar\"));\n\t\t\t\t\tmRequestActivity.startActivity(intent);\n\t\t\t\t\tPhonarPreferencesManager.setReviewDialogSeen(mRequestActivity, true);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbuilder.setNegativeButton(R.string.review_cancel,\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\t\t\tPhonarPreferencesManager.setReviewDialogSeen(mRequestActivity,\n\t\t\t\t\t\t\t\t\t\t\t\t\ttrue);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\tCommonUtils.showDialog(builder);\n\t\t}\n\t}", "@Override\r\n public boolean canDisapprove(Document document) {\n return false;\r\n }", "public void promptSubmitReview() {\n ZenDialog.builder().withBodyText(C0880R.string.prompt_submit_review).withDualButton(C0880R.string.cancel, 0, C0880R.string.submit, DIALOG_REQ_SUBMIT).create().show(getFragmentManager(), (String) null);\n }", "public String getCreativeApprovalStatus() {\r\n return creativeApprovalStatus;\r\n }", "public static String control_make_review_public() {\r\n \r\n String output = \"\";\r\n boolean review_made_public = false;\r\n boolean security_code_changed = false;\r\n \r\n if (make_review_public.equals(\"Show\")) {\r\n \r\n connection = use_connection;\r\n \r\n set_security_code(security_code);\r\n set_row_id(row_id);\r\n set_item_id(item_id);\r\n \r\n if (make_review_public().equals(\"success\")) {\r\n \r\n review_made_public = true;\r\n }\r\n \r\n set_security_code(new_security_code);\r\n \r\n if (change_security_code().equals(\"success\")) {\r\n \r\n security_code_changed = true;\r\n }\r\n \r\n if (review_made_public && security_code_changed) {\r\n \r\n Show_Reviews_Update.form_messages.add(\"success making review public\");\r\n } else {\r\n \r\n Show_Reviews_Update.form_messages.add(\"error making review public\");\r\n }\r\n \r\n output = Show_Reviews_Update.show_form_messages();\r\n \r\n try {\r\n \r\n use_connection.close();\r\n } catch (SQLException e) {\r\n }\r\n \r\n Show_Reviews_Update.form_messages.clear();\r\n }\r\n \r\n return output;\r\n }", "public boolean isEditableByUser() {\r\n if ((this.currentStatusChange == null) ||\r\n (this.currentStatusChange.equals(PoStatusCode.PROPOSED)))\r\n return true;\r\n return false;\r\n }", "public boolean getIsPMReviewed() {\n if (review != null) {\n return review.isPMReviewed();\n } else {\n return false;\n }\n }", "List<String> viewPendingApprovals();", "public static Boolean isAlreadyRevoked(String proposalId, String userId, String roleId) {\n Query query = null;\n @SuppressWarnings(\"rawtypes\")\n List histList = null;\n Boolean isAlreadyRevoked = true;\n try {\n OBContext.setAdminMode();\n // Task No. 7304\n /*\n * String sqlString = \" select pmgmt.escm_proposalmgmt_id from escm_proposalmgmt pmgmt \" +\n * \" left join (select ad_role_id, createdby, escm_proposalmgmt_id, requestreqaction from escm_proposalmgmt_hist where seqno=\"\n * + \" (select max(seqno) from escm_proposalmgmt_hist \" +\n * \" where escm_proposalmgmt_id =:Escm_Proposalmgmt_ID and Requestreqaction not in ('RMIR','RMIREQ','RMI','RMIRES','F','FR'))\"\n * +\n * \" and escm_proposalmgmt_id =:Escm_Proposalmgmt_ID) hist on hist.escm_proposalmgmt_id=pmgmt.escm_proposalmgmt_id \"\n * + \" where exists (select 1 from escm_proposalmgmt \" +\n * \" where escm_proposalmgmt_id =:Escm_Proposalmgmt_ID and createdby =:AD_User_ID and ad_role_id=:AD_Role_ID) \"\n * +\n * \" and pmgmt.escm_proposalmgmt_id =:Escm_Proposalmgmt_ID and requestreqaction='SUB' and requestreqaction!='REV' \"\n * ;\n */\n String sqlString = \" select requestreqaction, ad_role_id, createdby \"\n + \" from escm_proposalmgmt_hist where Escm_Proposalmgmt_ID = :Escm_Proposalmgmt_ID \"\n + \" order by created desc limit 1 \";\n query = OBDal.getInstance().getSession().createSQLQuery(sqlString);\n query.setParameter(\"Escm_Proposalmgmt_ID\", proposalId);\n // query.setParameter(\"AD_User_ID\", userId);\n // query.setParameter(\"AD_Role_ID\", roleId);\n histList = query.list();\n if (histList.size() > 0) {\n Object[] row = (Object[]) histList.get(0);\n if (\"SUB\".equals(row[0].toString()) && roleId.equals(row[1].toString())\n && userId.equals(row[2].toString())) {\n isAlreadyRevoked = false;\n }\n }\n } catch (Exception e) {\n log.error(\"Exception in isAlreadyRevoked \" + e.getMessage());\n OBDal.getInstance().rollbackAndClose();\n } finally {\n OBContext.restorePreviousMode();\n }\n return isAlreadyRevoked;\n }", "private TransferPointRequest processTransferApproval(TransferPointRequest transferPointRequest) throws InspireNetzException {\n Customer requestor = transferPointRequest.getFromCustomer();\n\n Customer approver = customerService.findByCusCustomerNo(transferPointRequest.getApproverCustomerNo());\n\n //if a new request , send approval request and save request\n if(transferPointRequest.getPtrId() == null || transferPointRequest.getPtrId() == 0){\n\n // Log the information\n log.info(\"transferPoints -> New request for point transfer received(Approval needed)\");\n\n //add a new transfer point request\n transferPointRequest = addTransferPointRequest(transferPointRequest);\n\n log.info(\"transferPoints: Sending approval request to approver\");\n\n //send approval request to approver\n partyApprovalService.sendApproval(requestor,approver,transferPointRequest.getPtrId(),PartyApprovalType.PARTY_APPROVAL_TRANSFER_POINT_REQUEST,transferPointRequest.getToLoyaltyId(),transferPointRequest.getRewardQty()+\"\");\n\n //set transfer allowed to false\n transferPointRequest.setTransferAllowed(false);\n\n } else {\n\n //CHECK whether approver has accepted the request\n boolean isTransferAllowed = isPartyApprovedTransfer(transferPointRequest);\n\n if(isTransferAllowed){\n\n log.info(\"transferPoints : Transfer is approved by the linked account\");\n\n //set redemption allowed to true\n transferPointRequest.setTransferAllowed(true);\n\n } else {\n\n log.info(\"transferPoints : Transfer request rejected by linked account\");\n\n //set redemption allowed to false\n transferPointRequest.setTransferAllowed(false);\n\n\n }\n }\n\n return transferPointRequest;\n }", "public void viewApplicants() throws InterruptedException {\n\t\tdriver.findElement(By.xpath(dev_GSP_CLICKER)).click();\n\t\tdriver.findElement(By.xpath(dev_GSP_CONDITIONALLYAPPROVE)).click();\n\t\tThread.sleep(1000);\n\t\tWebElement promowz = driver.findElement(By.xpath(dev_GSP_CAPPROVEREASON));\n\t\tpromowz.sendKeys(\"c\");\n\t\tThread.sleep(1000);\n\t\tdriver.findElement(By.xpath(dev_GSP_CAPPROVEBUTTON)).click();\n\t\tAssert.assertTrue(\"Successfully conditionally approved!\", elementUtil.isElementAvailabe(dev_GSP_CAPPROVESUCCESS));\n\t\tlogger.info(\"Passed conditionally approved\");\n\t\t\n\t}", "boolean isEligible(@Nonnull Urn userUrn, @Nonnull RecommendationRequestContext requestContext);", "public boolean checkAppApproveStatus(String myAppName) {\n\t\tSystem.out.println(\"Checking current account status for app\" + myAppName);\n\t\tboolean currentValue;\n\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd MMM yyyy\");\n\t\tDate now = new Date();\n\t\tString strDate = sdfDate.format(now);\n\t\tWebElement myAccount = getAccontDetails(myAppName);\n\t\tWebElement myAccountField = myAccount.findElement(By.xpath(\"//*[@class='approve_notify']//span]\"));\n\t\tSystem.out.println(myAccountField.getText());\n\t\tif (myAccountField.getText().contains(\"Approve\") && myAccountField.getText().contains(strDate)) {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is approved\");\n\t\t\tcurrentValue = true;\n\t\t} else {\n\t\t\tSystem.out.println(\"current approval status for app\" + myAppName + \"is pending\");\n\t\t\tcurrentValue = false;\n\t\t}\n\t\treturn currentValue;\n\t}", "boolean hasRecommendation();", "public boolean isUnproved() {\n\t\treturn proveState == UNPROVED;\n\t}", "public boolean checkShowSubmitPolicy(Integer ctId,Integer snId){\n\n //check if participator first\n String handle = (String)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_HANDLE);\n boolean flag = false;\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, handle);\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_VIEW_CONTEST_ID)) {\n return true;\n }\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n flag = true;\n }\n }\n if (!flag){\n return false;\n }\n\n //then check policy\n ContestEntity contestEntity = getContestById(ctId);\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_ALL)){\n return true;\n }\n\n SubmissionEntity submissionEntity = new SubmissionEntity();\n submissionEntity.setId(snId);\n List<SubmissionEntity> lstSubmission = submissionMapper.selectWithExample(submissionEntity);\n if (lstSubmission.size() != 1){\n throw new NoSuchPageException(\"Submission not found!\");\n }\n\n //check if submission is from current user\n submissionEntity = lstSubmission.get(0);\n Integer currentUserId = (Integer)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_ID);\n if (submissionEntity.getUrId().equals(currentUserId)){\n return true;\n }\n\n //else check current user has solved this problem and this contests allow to view solved problem's solutions\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_SOLVED)){\n Integer solveCnt = submissionMapper.checkSolvedStatusInContest(ctId,submissionEntity.getPmId(),submissionEntity.getUrId());\n return solveCnt > 0;\n }\n return false;\n }", "@Test\n\tpublic void madeOfferHasPendingStatus() {\n\t}", "boolean isProjectFavourite(int accountId, int projectId);", "com.lvl6.proto.EventQuestProto.QuestAcceptResponseProto.QuestAcceptStatus getStatus();", "protected ACLMessage handleAcceptProposal(ACLMessage cfp, ACLMessage propose,ACLMessage accept) throws FailureException \r\n\t{\r\n\t\tACLMessage inform = accept.createReply();\r\n\t\tinform.setPerformative(ACLMessage.INFORM);\r\n\t\t//TODO: devrementer le nb de trajets disponibles suite a la vente\r\n\t\treturn inform;\r\n\t}", "@Override\r\n\tpublic void reviewOfPastYear(ExemptTeamMember exemptTeamMember) {\n\t\t\r\n\t\t\r\n\t}", "private void getApprovalPendingNotices() {\n noOfRows = appParametersDAO.getIntParameter(MR_APPROVAL_ROWS_PER_PAGE);\n filterAndLoadMarriageNotices();\n }", "boolean canPerformQuest(int currentWorkCred);", "@OnClick(R.id.mApprovalCommit)\n void onApprovalPress() {\n String userName = mPetitionConcertUserName.getText().toString();\n// if (!userName.equals(\"\")) {\n// userName = userName.substring(1, userName.length() - 1);\n// }\n// String content = mPetitionContent.getText().toString();\n// String petitioner = mPetitioner.getText().toString();\n// String timeRange = mPetitionTimeRange.getText().toString();\n String result = mApprovalResultMenuTab.getText().toString();\n String opinion = mApprovalOpinion.getText().toString();\n if (opinion.equals(\"\")) {\n Toast.makeText(this, \"请输入审批意见\", Toast.LENGTH_SHORT).show();\n } else {\n if (mDialog == null) mDialog = new ProgressDialog(this);\n mDialog.setMessage(\"正在提交,请稍后...\");\n mDialog.setCancelable(false);\n mDialog.show();\n switch (result) {\n case \"同意\":\n mPresent.approvalAgree(approval.getRequestid(), approval.getApproveNodeId(), approval.getApprovePerson(), opinion);\n break;\n case \"不同意\":\n mPresent.approvalRefused(approval.getRequestid(), approval.getApprovePerson(), opinion);\n break;\n default:\n Log.e(TAG, \"onApprovalPress: \" + approval.getRequestid() + \"::\" + approval.getApproveNodeId() + \"::\" + approval.getApprovePerson() + \"::\" + opinion);\n break;\n }\n }\n\n\n }", "public boolean isIncomingInvitePending();", "public void autoApprove(int reimburseID, String autoReason, int status);", "@Override\n\tpublic void approveForm(Context ctx) {\n\t\t//Authentication\n\t\tUser approver = ctx.sessionAttribute(\"loggedUser\");\n\t\tif (approver == null) {\n\t\t\tctx.status(401);\n\t\t\treturn;\n\t\t}\n\t\tString username = ctx.pathParam(\"username\");\n\t\tif (!approver.getUsername().equals(username)) {\n\t\t\tctx.status(403);\n\t\t\treturn;\n\t\t}\n\t\t// Implementation\n\t\tString id = ctx.pathParam(\"id\");\n\t\tForm form = fs.getForm(UUID.fromString(id));\n\t\tapprover.getAwaitingApproval().remove(form);\n\t\tus.updateUser(approver);\n\t\t// If approver is just the direct supervisor\n\t\tif (!approver.getType().equals(UserType.DEPARTMENT_HEAD) && !approver.getType().equals(UserType.BENCO)) {\n\t\t\tform.setSupervisorApproval(true);\n\t\t\tUser departmentHead = us.getUserByName(approver.getDepartmentHead());\n\t\t\tdepartmentHead.getAwaitingApproval().add(form);\n\t\t\tus.updateUser(departmentHead);\n\t\t}\n\t\t// If the approver is a department head but not a benco\n\t\tif (approver.getType().equals(UserType.DEPARTMENT_HEAD) && !approver.getType().equals(UserType.BENCO)) {\n\t\t\tform.setDepartmentApproval(true);\n\t\t\tUser benco = us.getUser(\"sol\");\n\t\t\tbenco.getAwaitingApproval().add(form);\n\t\t\tus.updateUser(benco);\n\t\t}\n\t\t// if the approver is a BenCo\n\t\tif (approver.getType().equals(UserType.BENCO)) {\n\t\t\tform.setBencoApproval(true);\n\t\t\tUser formSubmitter = us.getUserByName(form.getName());\n\t\t\tif (formSubmitter.getAvailableReimbursement() >= form.getCompensation()) {\n\t\t\t\tformSubmitter.setAvailableReimbursement(formSubmitter.getAvailableReimbursement() - form.getCompensation());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tformSubmitter.setAvailableReimbursement(0.00);\n\t\t\t}\n\t\t\tformSubmitter.getAwaitingApproval().remove(form);\n\t\t\tformSubmitter.getCompletedForms().add(form);\n\t\t\tus.updateUser(formSubmitter);\n\t\t}\n\t\t\n\t\tfs.updateForm(form);\n\t\tctx.json(form);\n\t}", "public static void reviewAcceptedTrade(League theLeague, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Accepted Trade---\");\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(theLeague.getPendingTrade());\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"-Has this trade been processed?-\");\r\n\t\tSystem.out.println(\"1 - Yes\");\r\n\t\tSystem.out.println(\"2 - No\");\r\n\r\n\t\tif (Input.validInt(1, 2, keyboard) == 1) {\r\n\t\t\ttheLeague.setPendingTrade(\"\");\r\n\t\t}\r\n\t}", "boolean hasIsRedeemed();", "public void setApproved(boolean approved) {\n this.approved = approved;\n }", "public boolean isReviewPositive()\n {\n return (m_nReviewValue == REVIEW_VALUE_POSITIVE) ? true : false ;\n }", "public static boolean checkInAppReviewDialog(Activity activity) {\n\t\tif (CookbookConfig.INAPP_REVIEW_DIALOG_FREQUENCY == 0) return false;\n\n\t\t// get counter\n\t\tfinal Preferences preferences = new Preferences();\n\t\tfinal int counter = preferences.getInAppReviewDialogCounter();\n\t\tLogcat.d(\"\" + counter);\n\n\t\t// check counter\n\t\tboolean showDialog = false;\n\t\tif (counter != -1) {\n\t\t\tif (counter >= CookbookConfig.INAPP_REVIEW_DIALOG_FREQUENCY && counter % CookbookConfig.INAPP_REVIEW_DIALOG_FREQUENCY == 0) {\n\t\t\t\tshowDialog = true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t\t// show in-app review dialog\n\t\tif (showDialog) {\n\t\t\tshowInAppReviewDialog(activity);\n\t\t}\n\n\t\t// increment counter\n\t\tpreferences.setInAppReviewDialogCounter(counter + 1);\n\t\treturn showDialog;\n\t}", "public boolean approveCheckIn(SoftwareEngineer e){\n int i;\n\n for(i=0;i<this.curHeadCount;i++){\n if(employee[i].equals(e)) break;\n }\n\n return (i<this.curHeadCount && e.access);\n }", "private boolean isPartyApprovedTransfer(TransferPointRequest transferPointRequest) {\n Customer requestor = transferPointRequest.getFromCustomer();\n\n Customer approver = customerService.findByCusCustomerNo(transferPointRequest.getApproverCustomerNo());\n\n // Check if there is a entry in the LinkingApproval table\n PartyApproval partyApproval = partyApprovalService.getExistingPartyApproval(approver, requestor, PartyApprovalType.PARTY_APPROVAL_TRANSFER_POINT_REQUEST, transferPointRequest.getPtrId());\n\n // If the partyApproval is not found, then return false\n if ( partyApproval == null) {\n\n // Log the information\n log.info(\"isPartyApproved -> Party has not approved linking\");\n\n // return false\n return false;\n\n } else {\n\n return transferPointRequest.isApproved();\n }\n\n }", "boolean contemProfessor(Professor p);", "@Override\n\tpublic long getApprovedstatus() {\n\t\treturn _buySellProducts.getApprovedstatus();\n\t}", "@Override\n\tpublic boolean isAutoApprove(String arg0) {\n\t\treturn false;\n\t}", "@Test\n public void canGetApprovalsWithAutoApproveTrue() {\n addApproval(marissa.getId(), \"c1\", \"uaa.user\", 6000, APPROVED);\n addApproval(marissa.getId(), \"c1\", \"uaa.admin\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"openid\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n\n addApproval(marissa.getId(), \"c1\", \"read\", 12000, DENIED);\n addApproval(marissa.getId(), \"c1\", \"write\", 6000, APPROVED);\n\n assertEquals(3, endpoints.getApprovals(\"user_id eq \\\"\"+marissa.getId()+\"\\\"\", 1, 100).size());\n }", "@Test\n @Ignore\n public void testDslTriggerPRIsToApproveApprovedFreeStyle() throws Exception {\n createSeedJob(readDslScript(\"./dsl/testDslTriggerPRIsToApproveApprovedFreeStyle.groovy\"));\n /* Fetch the newly created job and check its trigger configuration */\n FreeStyleProject createdJob = (FreeStyleProject) j.getInstance().getItem(\"test-job\");\n /* Go through all triggers to validate DSL */\n Map<TriggerDescriptor, Trigger<?>> triggers = createdJob.getTriggers();\n assertEquals(1, triggers.size());\n List<String> dispNames = new ArrayList<>();\n boolean isToApprove = false;\n for (Trigger<?> entry : triggers.values()) {\n BitBucketPPRTrigger tmp2 = (BitBucketPPRTrigger) entry;\n assertEquals(1, tmp2.getTriggers().size());\n String tmpNname = tmp2.getTriggers().get(0).getActionFilter().getClass().getName();\n String dispName = tmpNname.substring(tmpNname.lastIndexOf(\".\") + 1);\n dispNames.add(dispName);\n BitBucketPPRPullRequestApprovedActionFilter tmp3 = (BitBucketPPRPullRequestApprovedActionFilter) tmp2.getTriggers().get(0)\n .getActionFilter();\n isToApprove = tmp3.shouldSendApprove();\n }\n assertEquals(1, dispNames.size());\n assertEquals(dispNames.get(0), \"BitBucketPPRPullRequestApprovedActionFilter\");\n assertTrue(isToApprove);\n }", "@Override\n\tpublic void approveAcceptedOffer(String matriculation) {\n\t\tofferman.approveAcceptedOffer(matriculation);\n\t\t\n\t}", "@Override\n\tpublic Boolean approveRejectLista(int statoApprovazione, String nomeLista) {\n\t\t\n\t\tLista listaElettorale = listaElettoraleDaNome(nomeLista);\n\t\t\n\t\tlistaElettorale.setStatoApprovazione(statoApprovazione);\n\t\t\n\t\t//modifica la lista elettorale dato lo stato di approvazione\n\t\tmodificaListaElettorale(listaElettorale);\n\n\t\treturn true;\n\t}", "public boolean approveAppointment() {\n\t\tIHealthCareDAO dao = new HealthCareDAO();\r\n\t\treturn dao.approveAppointment();\r\n\t}", "protected abstract boolean approvedForClass(Course c);", "public static String control_send_review_change_email_request() throws IOException {\r\n \r\n String output = \"\";\r\n String file_stream = \"\";\r\n \r\n if (send_review_change_email_request.equals(\"Edit\")) {\r\n \r\n connection = use_connection;\r\n \r\n set_security_code(new_security_code);\r\n set_row_id(row_id);\r\n set_item_id(item_id);\r\n \r\n if (change_security_code().equals(\"success\")) {\r\n\r\n if (!(search_particular_review().get(0).get(0).equals(\"fail\"))\r\n && !(search_particular_review().get(0).get(0).equals(\"no review\"))\r\n && search_particular_review().get(0).size() == 1) {\r\n \r\n URL url_for_post_request = new URL(Config.domain() + \"/third-party/email-forwarders/send-email-change-review-request/\");\r\n \r\n Map<String, Object> parameter = new LinkedHashMap<>();\r\n \r\n parameter.put(\"domain\", Config.domain());\r\n parameter.put(\"row_id\", search_particular_review().get(0).get(0));\r\n parameter.put(\"item_id\", search_particular_review().get(1).get(0));\r\n parameter.put(\"rating\", search_particular_review().get(2).get(0));\r\n \r\n if (search_particular_review().get(3).get(0).equals(\"\")\r\n || search_particular_review().get(3).get(0).replaceAll(\" \", \"\").length() == 0) {\r\n \r\n parameter.put(\"subject\", \"No subject\");\r\n } else {\r\n \r\n parameter.put(\"subject\", search_particular_review().get(3).get(0));\r\n }\r\n \r\n if (search_particular_review().get(4).get(0).equals(\"\")\r\n || search_particular_review().get(4).get(0).replaceAll(\" \", \"\").length() == 0) {\r\n \r\n parameter.put(\"description\", \"No comment\");\r\n } else {\r\n \r\n parameter.put(\"description\", search_particular_review().get(4).get(0));\r\n }\r\n \r\n if (search_particular_review().get(5).get(0).equals(\"\")\r\n || search_particular_review().get(5).get(0).replaceAll(\" \", \"\").length() == 0) {\r\n \r\n parameter.put(\"name\", \"Anonymous\");\r\n } else {\r\n \r\n parameter.put(\"name\", search_particular_review().get(5).get(0));\r\n }\r\n \r\n if (search_particular_review().get(6).get(0).equals(\"\")\r\n || search_particular_review().get(6).get(0).replaceAll(\" \", \"\").length() == 0) {\r\n \r\n parameter.put(\"email\", \"[email protected]\");\r\n } else {\r\n \r\n parameter.put(\"email\", search_particular_review().get(6).get(0));\r\n }\r\n \r\n parameter.put(\"security_code\", search_particular_review().get(7).get(0));\r\n \r\n StringBuilder post_data = new StringBuilder();\r\n \r\n for (Map.Entry<String, Object> each_parameter : parameter.entrySet()) {\r\n \r\n if (post_data.length() != 0) {\r\n \r\n post_data.append('&');\r\n }\r\n \r\n post_data.append(URLEncoder.encode(each_parameter.getKey(), \"UTF-8\"));\r\n post_data.append('=');\r\n post_data.append(URLEncoder.encode(String.valueOf(each_parameter.getValue()), \"UTF-8\"));\r\n }\r\n \r\n byte[] post_data_bytes = post_data.toString().getBytes(\"UTF-8\");\r\n \r\n HttpURLConnection file_connection = (HttpURLConnection)url_for_post_request.openConnection();\r\n file_connection.setRequestMethod(\"POST\");\r\n file_connection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n file_connection.setRequestProperty(\"Content-Length\", String.valueOf(post_data_bytes.length));\r\n file_connection.setDoOutput(true);\r\n file_connection.getOutputStream().write(post_data_bytes);\r\n \r\n Reader read_input = new BufferedReader(\r\n new InputStreamReader(file_connection.getInputStream(), \"UTF-8\"));\r\n \r\n for (int each_character; (each_character = read_input.read()) >= 0;) {\r\n \r\n file_stream += (char)each_character;\r\n }\r\n \r\n if (file_stream.equals(\"success\")) {\r\n \r\n Show_Reviews_Update.form_messages.add(\"success - send email change review request\");\r\n } \r\n }\r\n }\r\n \r\n output = Show_Reviews_Update.show_form_messages();\r\n \r\n try {\r\n \r\n use_connection.close();\r\n } catch (SQLException e) {\r\n }\r\n \r\n Show_Reviews_Update.form_messages.clear();\r\n }\r\n \r\n return output;\r\n }", "private Boolean getStatusForPaid(final String status) {\n boolean flag = false;\n if (status.equalsIgnoreCase(PdfConstants.PAID)\n || status.equalsIgnoreCase(PdfConstants.RETURN_PENDING)\n || status.equalsIgnoreCase(PdfConstants.SCHEDULED_PENDING)\n || status.equalsIgnoreCase(PdfConstants.SCHEDULED_PROCESSING)\n || status.equalsIgnoreCase(PdfConstants.IN_PROCESS)\n || status.equalsIgnoreCase(PdfConstants.PENDING)) {\n flag = true;\n }\n return flag;\n }", "@When(\"^Check for review$\")\n\tpublic void check_for_review() throws Throwable {\n\t\twait.WaitForElement(profilepage.getreviewlink(), 70);\n\t\tprofilepage.clickonreviewtab();\n\t}", "@Override\n\tpublic boolean isDraft();", "private TransferPointRequest checkTransferRequestEligibility(TransferPointRequest transferPointRequest) {\n Customer fromAccount = transferPointRequest.getFromCustomer();\n\n //get destination account\n Customer toAccount = transferPointRequest.getToCustomer();\n\n //check if account is linked\n transferPointRequest = isAccountLinked(transferPointRequest);\n\n //set request customer no as from account customer no\n transferPointRequest.setRequestorCustomerNo(fromAccount.getCusCustomerNo());\n\n //if accounts are not linked , requestor is eligible for transfer\n if(!transferPointRequest.isAccountLinked()){\n\n //set transfer eligibility to ELIGIBLE\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.ELIGIBLE);\n\n } else {\n\n //if linked , get the transfer point settings\n TransferPointSetting transferPointSetting = transferPointRequest.getTransferPointSetting();\n\n //check redemption settings\n switch(transferPointSetting.getTpsLinkedEligibilty()){\n\n case TransferPointSettingLinkedEligibity.NO_AUTHORIZATION:\n\n //if authorization is not needed set eligibity to ELIGIBLE\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.ELIGIBLE);\n\n return transferPointRequest;\n\n case TransferPointSettingLinkedEligibity.PRIMARY_ONLY:\n\n //check the requestor is primary\n if(!transferPointRequest.isCustomerPrimary()){\n\n //if not primary , then set eligibility to INELIGIBLE\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.INELIGIBLE);\n\n } else {\n\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.ELIGIBLE);\n }\n\n return transferPointRequest;\n\n case TransferPointSettingLinkedEligibity.SECONDARY_WITH_AUTHORIZATION:\n\n //if customer is secondary , set eligibility to APRROVAL_NEEDED and set approver\n //and requestor customer no's\n if(!transferPointRequest.isCustomerPrimary()){\n\n //set eligibility status as approval needed\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.APPROVAL_NEEDED);\n\n //set approver customer no\n transferPointRequest.setApproverCustomerNo(transferPointRequest.getParentCustomerNo());\n\n } else {\n\n //set eligibility to eligible\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.ELIGIBLE);\n\n }\n\n return transferPointRequest;\n\n case TransferPointSettingLinkedEligibity.ANY_ACCOUNT_WITH_AUTHORIZATION:\n\n //set eligibility to approval needed\n transferPointRequest.setEligibilityStatus(RequestEligibilityStatus.APPROVAL_NEEDED);\n\n if(transferPointRequest.isCustomerPrimary()){\n\n //set approver customer no\n transferPointRequest.setApproverCustomerNo(transferPointRequest.getChildCustomerNo());\n\n } else {\n\n //set approver customer no\n transferPointRequest.setApproverCustomerNo(transferPointRequest.getParentCustomerNo());\n\n }\n\n return transferPointRequest;\n\n }\n }\n\n return transferPointRequest;\n\n }", "private void declareWinner(){\r\n System.out.println(\"All proposals received\");\r\n AID best = proposals.get(0).getSender();\r\n for(ACLMessage proposal: proposals){\r\n String time = proposal.getContent().replaceFirst(\"bid\\\\(\", \"\");\r\n time = time.replaceFirst(\" sec\\\\)\", \"\");\r\n String bestTimeString = \r\n proposal.getContent().\r\n replaceFirst(\"bid\\\\(\", \"\").\r\n replaceFirst(\" sec\\\\)\", \"\");\r\n int bestTime = Integer.parseInt(bestTimeString);\r\n int propTime = Integer.parseInt(time);\r\n if (bestTime > propTime) {\r\n best = proposal.getSender();\r\n }\r\n }\r\n sendMessage(best, \"\", ACLMessage.ACCEPT_PROPOSAL);\r\n Object[] ob = new Object[2];\r\n ob[0] = best;\r\n ob[1] = currentPartial;\r\n expectedReturn.add(ob);\r\n System.out.println(\"Accepting proposal from \" + best.getLocalName());\r\n for(ACLMessage proposal: proposals){\r\n if(!proposal.getSender().equals(best)){\r\n sendMessage(proposal.getSender(), \"\", ACLMessage.REJECT_PROPOSAL);\r\n }\r\n }\r\n proposals.clear();\r\n solvables.remove(0);\r\n if(!solvables.isEmpty()){\r\n \r\n auctionJob(solvables.get(0));\r\n }\r\n }", "public static boolean canApproveForms() {\n return SecurityUtils.getSubject().isPermitted(\"ownSite:canApprove\");\n }", "@When(\"^User should see Review Confirmation Message$\")\n\tpublic void user_should_see_Review_Confirmation_Message() throws Throwable {\n\t\twait.WaitForElement(reviewConfirmationPageObjects.getreviewconfirmmsg(), 70);\n\t\treviewConfirmationPageObjects.verifyreviewconfirmation();\n\t}", "boolean getDraft();", "boolean isAchievable();", "@Override\n public void isContractAccepted(Messages.ContractProposalResponse msg) {\n if (msg.isAccepted) {\n createNewContractAgent(msg);\n runningContracts.add(msg.contId);\n }\n }", "protected void commitRequirementReviews(NbaTXLife nbaTXLife, NbaRequirement nbaReq, String partyID, String user){\n Map reqMap = nbaTXLife.getRequirementInfos(partyID);\n if (nbaReq.getReviewInd() && nbaReq.getReviewDate() == null) {\n RequirementInfo reqInfo = (RequirementInfo) reqMap.get(nbaReq.getRequirementInfoUniqueID()); //SPR3145\n RequirementInfoExtension reqInfoExt = NbaUtils.getFirstRequirementInfoExtension(reqInfo);\n if (reqInfoExt == null) {\n OLifEExtension olifeExt = NbaTXLife.createOLifEExtension(NbaOliConstants.EXTCODE_REQUIREMENTINFO);\n reqInfo.addOLifEExtension(olifeExt);\n reqInfoExt = olifeExt.getRequirementInfoExtension();\n }\n reqInfoExt.setReviewedInd(true);\n if (nbaReq.getReviewID() != null) {\n reqInfoExt.setReviewID(nbaReq.getReviewID());\n } else {\n reqInfoExt.setReviewID(user); //default to the current user\n }\n reqInfoExt.setReviewDate(new java.util.Date());\n reqInfoExt.setActionUpdate();\n }\n }", "public String getApprove() {\r\n if (approve == null)\r\n approve = initApproveElement().findElement(By.cssSelector(\"[data-role*='approvalStatus']\")).getText();\r\n return approve;\r\n }", "boolean hasRemarketingAction();", "public void Feedback_req()\n {\n\t boolean feedbackreqpresent =Feedbackreq.size()>0;\n\t if(feedbackreqpresent)\n\t {\n\t\t // System.out.println(\"Feedback Request report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"Feedback Request report is not present\");\n\t }\n }", "@Override\n\tpublic boolean changeStatus(Person p) {\n\t\tSession session = factory.getCurrentSession();\n\t\tQuery query = session\n\t\t\t\t.createQuery(\"update Booking b set b.bookingStatus='request' where b.person=\" + p.getEmployeeId());\n\t\tint i = query.executeUpdate();\n\t\tif(i==1)\n\t\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}" ]
[ "0.684236", "0.684236", "0.66693234", "0.65996647", "0.65979546", "0.6573983", "0.6434708", "0.61990243", "0.6177714", "0.61168027", "0.61072755", "0.6080837", "0.6053427", "0.5971963", "0.5963292", "0.5847447", "0.5843177", "0.58060884", "0.57955587", "0.5750331", "0.57240534", "0.5715622", "0.5684951", "0.5657541", "0.5597553", "0.55794877", "0.5577437", "0.55767274", "0.5569265", "0.556241", "0.556215", "0.5555736", "0.5554899", "0.5549327", "0.55203867", "0.5517602", "0.54896134", "0.54896134", "0.5483859", "0.546531", "0.544194", "0.54406023", "0.54381967", "0.5424959", "0.54245204", "0.5415798", "0.5411163", "0.5410483", "0.5402505", "0.5398725", "0.53905785", "0.5382889", "0.53814316", "0.53662515", "0.5361032", "0.53483117", "0.5346031", "0.5343899", "0.53407913", "0.53384674", "0.5331959", "0.53210765", "0.5314273", "0.5303687", "0.5298373", "0.5296805", "0.52924436", "0.52915335", "0.5286378", "0.5278411", "0.5277242", "0.52693474", "0.526574", "0.52520245", "0.5249335", "0.52485424", "0.5241177", "0.523789", "0.5230032", "0.5228774", "0.5225595", "0.5224838", "0.5224726", "0.52175975", "0.52088463", "0.5205279", "0.52045065", "0.5198393", "0.51973873", "0.5191702", "0.5191243", "0.5189324", "0.51885146", "0.5182423", "0.51758826", "0.51747495", "0.51697576", "0.5164745", "0.5164626", "0.5155075" ]
0.63405687
7
/ Determines if user is allowed to review a course and that it is not yet expired
public static boolean isReviewer(Connection conn,String campus,String alpha,String num,String user) throws Exception { //Logger logger = Logger.getLogger("test"); boolean reviewer = false; boolean debug = false; int counter = 0; try { debug = DebugDB.getDebug(conn,"FndDB"); if (debug){ logger.info("--------->"); logger.info("isReviewer"); logger.info("--------->"); } String table = "tblReviewers tbr INNER JOIN tblfnd tc ON " + "(tbr.campus = tc.campus) AND " + "(tbr.coursenum = tc.CourseNum) AND " + "(tbr.coursealpha = tc.CourseAlpha) "; String where = "GROUP BY tbr.coursealpha,tbr.coursenum,tc.type,tbr.userid,tc.reviewdate " + "HAVING (tbr.coursealpha='" + alpha + "' AND " + "tbr.coursenum='" + num + "' AND " + "tc.type='PRE' AND " + "tbr.userid='" + user + "' AND " + "tc.reviewdate >= " + DateUtility.getSystemDateSQL("yyyy-MM-dd") + ")"; counter = (int) AseUtil.countRecords(conn,table,where); if (debug) logger.info("counter: " + counter); if (counter > 0) reviewer = true; if (debug){ logger.info("<---------"); logger.info("isReviewer"); logger.info("<---------"); } } catch (Exception e) { logger.fatal("CourseDB: isReviewer - " + e.toString()); } return reviewer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isExpired() {\n final LocalDateTime now = LocalDateTime.now().minusSeconds(10L);\n return now.isAfter(startTime.plusMinutes(exam.getExamTime())) || endTime != null;\n }", "public boolean isHasAlreadyReviewed() {\r\n boolean result = false;\r\n if (ui.isIsUserAuthenticated() && professionalStatus.isIsProfessional()) {\r\n Users user = ui.getUser();\r\n if (recipe != null) {\r\n for (Review rev : recipe.getReviews()) {\r\n if (rev.getReviewer().getUserName().equals(user.getUserName())) {\r\n result = true;\r\n break;\r\n }\r\n }//end for\r\n }\r\n }// end value != null\r\n return result;\r\n }", "@Override\n\tpublic boolean checkEnrolment(Users userid, Course courseid) {\n\t\treturn false;\n\t}", "public boolean canBeUsed() {\r\n\t\tLocalDate today = LocalDate.now();\r\n\r\n\t\tlong daysDifference = ChronoUnit.DAYS.between(today, expirationDate);\r\n\t\tif (daysDifference >= 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected abstract boolean approvedForClass(Course c);", "public synchronized boolean checkAvailabilityOfCourse(Character courseName){\n\t\treturn getCourseSeatsCount(courseName) < 60;\n\t}", "private boolean isOverReviewLimit(UUID theConferenceID) {\r\n\t\t// check to see if conference exists within reviewer list of confs or not\r\n\t\tif(this.isReviewerAssignedToConference(theConferenceID)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tboolean isOver = false;\r\n\t\tif (this.myConferencesAndAssignedManuscriptsList.get(theConferenceID).size() >= MAX_REVIEWS) {\r\n\t\t\tisOver = true;\r\n\t\t} \r\n\t\tSystem.out.println(isOver);\r\n\t\treturn isOver;\r\n\t}", "public boolean expired(){\n return !Period.between(dateOfPurchase.plusYears(1), LocalDate.now()).isNegative();\n }", "boolean expired();", "public boolean isExpired() {\n\t\treturn this.maturityDt.before(Calendar.getInstance().getTime());\n\t}", "@SystemAPI\n\tboolean needsApproval();", "public boolean checkShowSubmitPolicy(Integer ctId,Integer snId){\n\n //check if participator first\n String handle = (String)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_HANDLE);\n boolean flag = false;\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, handle);\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_VIEW_CONTEST_ID)) {\n return true;\n }\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n flag = true;\n }\n }\n if (!flag){\n return false;\n }\n\n //then check policy\n ContestEntity contestEntity = getContestById(ctId);\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_ALL)){\n return true;\n }\n\n SubmissionEntity submissionEntity = new SubmissionEntity();\n submissionEntity.setId(snId);\n List<SubmissionEntity> lstSubmission = submissionMapper.selectWithExample(submissionEntity);\n if (lstSubmission.size() != 1){\n throw new NoSuchPageException(\"Submission not found!\");\n }\n\n //check if submission is from current user\n submissionEntity = lstSubmission.get(0);\n Integer currentUserId = (Integer)httpSession.getAttribute(Constants.CURRENT_LOGIN_USER_ID);\n if (submissionEntity.getUrId().equals(currentUserId)){\n return true;\n }\n\n //else check current user has solved this problem and this contests allow to view solved problem's solutions\n if (contestEntity.getShowSubmit().equals(Constants.SHOW_SUBMIT_SOLVED)){\n Integer solveCnt = submissionMapper.checkSolvedStatusInContest(ctId,submissionEntity.getPmId(),submissionEntity.getUrId());\n return solveCnt > 0;\n }\n return false;\n }", "boolean hasAllowedCredit();", "public boolean isUserApproval() {\n\n if (!ACTION_UserChoice.equals(getAction())) {\n return false;\n }\n\n return (getColumn() != null) && \"IsApproved\".equals(getColumn().getColumnName());\n\n }", "boolean canCrit();", "private boolean _requiresLogin() {\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\n if (accessToken == null) {\n return true;\n } else {\n return accessToken.isExpired();\n }\n }", "boolean isAccountNonExpired();", "boolean isAccountNonExpired();", "public boolean isAlwaysValid() {\n return new Date().before(this.getExpirationDate()) && this.hasNotBeenUsed();\n }", "private void reviewDeptPolicies() {\n if(metWithHr && metDeptStaff) {\n reviewedDeptPolicies = true;\n } else {\n System.out.println(\"Sorry, you cannot review \"\n + \" department policies until you have first met with HR \"\n + \"and then with department staff.\");\n }\n }", "boolean hasExpiryTimeSecs();", "boolean hasExpiry();", "boolean hasExpirationDate();", "boolean isExpired(int userId);", "private boolean isApproved() {\r\n if (rnd.nextInt(10) < 5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public boolean checkOutsiderPermission(Authentication authentication,Integer ctId){\n ContestEntity contestEntity = getContestById(ctId);\n //contest must be public(anyone can participate) and contest creator allows everyone to see\n if (!contestEntity.getIsAnyoneCanParticipate().equals(1) || !contestEntity.getShowInforToAll().equals(1)){\n return false;\n }\n\n //if so allows only when contest has started\n Date currentTime = new Date();\n Date startTime = contestEntity.getStartTime();\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, authentication.getName());\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n return false;\n }\n }\n return currentTime.compareTo(startTime) >= 0;\n }", "boolean isExpired();", "public boolean isExpired()\n\t{\n\t\tif (TimeRemaining == 0) \n\t\t\treturn true;\n\t\telse return false;\n\t}", "public boolean isAbleToClaim() {\n if (!isActive()) {\n return false;\n }\n\n ZonedDateTime now = ZonedDateTime.now();\n return now.toEpochSecond() >= claimFromDate.toEpochSecond();\n }", "public boolean isApproved();", "public boolean isApproved();", "public abstract boolean checkPolicy(User user);", "private boolean isInstructor(User user)\r\n {\r\n if (LOG.isDebugEnabled())\r\n {\r\n LOG.debug(\"isInstructor(User \" + user + \")\");\r\n }\r\n if (user != null)\r\n return SecurityService.unlock(user, \"site.upd\", getContextSiteId());\r\n else\r\n return false;\r\n }", "public boolean addCourse(String user, String course){\n String[] tokens = usersRepository.getclassString(user).split(\" \");\r\n String[] courseids = new String[tokens.length];\r\n String courseid = classesRepository.getClassCourseid(course);\r\n for(int i =0; i < tokens.length; i++){\r\n courseids[i] = classesRepository.getClassCourseid(tokens[i]);\r\n }\r\n for(int f =0; f < tokens.length; f++) {\r\n if(courseids[f] == null){\r\n continue;\r\n }\r\n if(courseids[f].equals(courseid)){\r\n return false;\r\n }\r\n }\r\n //check for course space\r\n if(!classesRepository.checkCourseSpace(course)){\r\n return false;\r\n }\r\n\r\n //check here for prereqs\r\n //get student records\r\n String studentrecord = usersRepository.findUserRecords(user);\r\n String studentgrade = usersRepository.findUserGrades(user);\r\n String[] tokenrecords;\r\n String[] tokengrades;\r\n if(studentrecord==null){\r\n tokenrecords = new String[0];\r\n tokengrades = new String[0];\r\n }else{\r\n tokenrecords = studentrecord.split(\" \");\r\n tokengrades = studentgrade.split(\" \");\r\n }\r\n //get course prereq\r\n String[] prereqs = classesRepository.getCoursePrereqs(courseid);\r\n //compare all token records with course prereqs, must be in records without d or f\r\n boolean meetsreq1 = true, meetsreq2 = true;\r\n if(prereqs[0] != null){\r\n meetsreq1=false;\r\n }\r\n if(prereqs[1] != null){\r\n meetsreq2=false;\r\n }\r\n for(int s = 0; s < tokenrecords.length; s++){\r\n if(!tokengrades[s].equals(\"D\") && !tokengrades[s].equals(\"F\")){\r\n if(prereqs[0] != null){\r\n if(prereqs[0].equals(tokenrecords[s])){\r\n meetsreq1 = true;\r\n }\r\n }\r\n if(prereqs[1] != null){\r\n if(prereqs[1].equals(tokenrecords[s])){\r\n meetsreq2 = true;\r\n }\r\n }\r\n }\r\n\r\n }\r\n if(meetsreq1 && meetsreq2){\r\n usersRepository.addCourse(user, course);\r\n return true;\r\n }\r\n return false;\r\n }", "default Optional<Boolean> doesCalendarAccessAuthorized() {\n return Optional.ofNullable(toSafeBoolean(getCapability(CALENDAR_ACCESS_AUTHORIZED_OPTION)));\n }", "boolean hasCustomerUserAccess();", "public boolean accessTokenExpired() {\n Date currentTime = new Date();\n if ((currentTime.getTime() - lastAccessTime.getTime()) > TIMEOUT_PERIOD) {\n return true;\n } else {\n return false;\n }\n }", "public abstract boolean isRestricted();", "boolean checkForExpiration() {\n boolean expired = false;\n\n // check if lease exists and lease expire is not MAX_VALUE\n if (leaseId > -1 && leaseExpireTime < Long.MAX_VALUE) {\n\n long currentTime = getCurrentTime();\n if (currentTime > leaseExpireTime) {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[checkForExpiration] Expiring token at {}: {}\",\n currentTime, this);\n }\n noteExpiredLease();\n basicReleaseLock();\n expired = true;\n }\n }\n\n return expired;\n }", "public boolean checkValidity(int api_key) throws ParseException{\n User user= getUser(api_key);\n //if user is hitting api first time then set start date = now\n if(user.getHitCount()==0){\n user.setStartDate(new Date());\n }\n //if user is allowed then increment the hit_count\n if(user.isUserAllowed(new Date())){\n user.setHitCount(user.getHitCount());\n return true;\n }\n else{\n return false;\n }\n \n }", "public static boolean isSessionValid (String ACCESS_LEVEL) {\n String sqlRetrieveDateTime = \"SELECT now() as date_time\";\n \n LocalDateTime time = LocalDateTime.now().minusYears(100);\n try (Connection conn = Database.getConnection();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sqlRetrieveDateTime)) {\n \n while (rs.next()) {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n time = LocalDateTime.parse(rs.getString(\"date_time\"), formatter); \n }\n } catch (SQLException se) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(1), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n } catch (IOException ioe) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(0), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n } catch (DateTimeParseException | NullPointerException dtpe) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(0), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(MainLayout.getJPanel(), Messages.getError(0), Messages.getHeaders(0), JOptionPane.ERROR_MESSAGE);\n }\n \n LocalDateTime t = time.minusMinutes(30);\n \n setRoleFromDatabase();\n \n return t.isBefore(lastAction) && doesUserExist() && (role.equals(roleFromDatabase)) && (ACCESS_LEVEL.equals(role)) && (ACCESS_LEVEL.equals(roleFromDatabase)) && ((userId != -1) && (aisId != -1) && (!name.isEmpty()) && (!role.isEmpty()) && (!roleFromDatabase.isEmpty()));\n }", "boolean hasExpired();", "boolean isSetIssued();", "public boolean isPostingAllowed() {\n if (currentUser == null || activeTopic == null) {\n return false;\n }\n if (currentUser.isPublicAccount()) {\n return false;\n }\n return activeTopic.isEditable();\n }", "public boolean isPastSubmissionDeadline() {\r\n\t\tCalendar currentTime = Calendar.getInstance();\r\n\t\tif(currentTime.after(getConference().getManuscriptDueDate())) {\r\n\t\t\treturn true;\r\n\t\t} \r\n\t\treturn false;\r\n\t}", "public Boolean isExpired() {\n\t\tCalendar today = Calendar.getInstance();\n\t\treturn today.get(Calendar.DAY_OF_YEAR) != date.get(Calendar.DAY_OF_YEAR);\n\t}", "public boolean action_allowed(){\r\n\t\treturn action_holds.size()==0;\r\n\t}", "public boolean canBeDeleted() {\n\t\treturn System.currentTimeMillis() - dateTimeOfSubmission.getTime() < ACCEPT_CANCEL_TIME;\n\t}", "public boolean isValid_ToBuyTicket() {\n if (this.tktSold < this.museum.getMaxVisit() && isNowTime_in_period()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean isProvidingCourse(String userid){\n\t\t\n\t\tboolean courseprovider = false;\n\t\t\n\t\tMongoConnection mongocon = new MongoConnection();\n\t\tDBCursor resultcursor = mongocon.getDBObject(\"userid\", userid, \"Course\");\n\t\tif(resultcursor.hasNext()){\n\t\t\tDBObject theObj = resultcursor.next();\n\t\t\n\t\t\tCourses courses = new Courses();\n\t\t\t\n\t\t\tcourses.setCourseCategory((String)theObj.get(\"courseCategory\"));\n\t\t\tcourses.setCoursecreatedate((String)theObj.get(\"coursecreatedate\"));\n\t\t\tcourses.setCoursecreatelocation((String)theObj.get(\"coursecreatelocation\"));\n\t\t\tcourses.setCourseDescription((String)theObj.get(\"courseDescription\"));\n\t\t\tcourses.setCourseFee((String)theObj.get(\"courseFee\"));\n\t\t\tcourses.setCourseid((String)theObj.get(\"courseid\"));\n\t\t\tcourses.setCourseimageid((String)theObj.get(\"courseimageid\"));\n\t\t\tcourses.setCourselinkid((String)theObj.get(\"courselinkid\"));\n\t\t\tcourses.setCourseName((String)theObj.get(\"courseName\"));\n\t\t\tcourses.setCourseownerid((String)theObj.get(\"courseownerid\"));\n\t\t\tcourses.setCoursepublisheddate((String)theObj.get(\"coursepublisheddate\"));\n\t\t\tcourses.setCoursepublishlocation((String)theObj.get(\"coursepublishlocation\"));\n\t\t\tcourses.setCourseReview((String)theObj.get(\"courseReview\"));\n\t\t\t\n\t\t\tString[] weekids = ((String)theObj.get(\"courseweekids\")).split(\",\");\n\t\t\t\n\t\t\tcourses.setCourseweekids(weekids);\n\t\t\tcourseprovider = true;\n\t\t\t\n\t\t\tcourselist.add(courses);\n\t\t\t\n\t\t}else{\n\t\t\tcourselist.add(\"\");\n\t\t}\n\t\t\n\t\t\n\t\treturn courseprovider;\n\t}", "public static boolean isCourseCancellable(Connection conn,String kix,String user) throws SQLException {\n\n\t\t//Logger logger = Logger.getLogger(\"test\");\n\n\t\tboolean cancellable = false;\n\t\tString proposer = \"\";\n\t\tString progress = \"\";\n\n\t\ttry {\n\t\t\tString[] info = getKixInfo(conn,kix);\n\t\t\tString alpha = info[0];\n\t\t\tString num = info[1];\n\t\t\tString campus = info[4];\n\n\t\t\tString sql = \"SELECT edit,proposer,progress FROM tblfnd WHERE historyid=?\";\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\n\t\t\tps.setString(1,kix);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tcancellable = rs.getBoolean(1);\n\t\t\t\tproposer = rs.getString(2);\n\t\t\t\tprogress = rs.getString(3);\n\t\t\t}\n\n\t\t\t// only the proposer may cancel a pending course\n\t\t\tif (cancellable && user.equals(proposer) &&\n\t\t\t\t(\tprogress.equals(Constant.FND_MODIFY_TEXT) ||\n\t\t\t\t\tprogress.equals(Constant.FND_DELETE_TEXT) ||\n\t\t\t\t\tprogress.equals(Constant.FND_REVISE_TEXT)\n\t\t\t\t)){\n\t\t\t\tcancellable = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcancellable = false;\n\t\t\t}\n\n\t\t\trs.close();\n\t\t\tps.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tlogger.fatal(\"FndDB.isCourseCancellable - \" + e.toString());\n\t\t\tcancellable = false;\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"FndDB.isCourseCancellable - \" + e.toString());\n\t\t\tcancellable = false;\n\t\t}\n\n\t\treturn cancellable;\n\t}", "public boolean getIsLimited() {\r\n return !(this.accessLimitations != null && this.accessLimitations.contains(\"UNL\"));\r\n }", "boolean isEligible(@Nonnull Urn userUrn, @Nonnull RecommendationRequestContext requestContext);", "boolean isComponentAccessTokenExpired();", "public boolean checkParticipate(Authentication auth, Integer ctId) throws NoSuchPageException {\n //check if participator\n ContestEntity contestEntity = getContestById(ctId);\n Date currentTime = new Date();\n Date startTime = contestEntity.getStartTime();\n Date endTime = DateUtils.addMinutes(startTime, contestEntity.getDuration());\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, auth.getName());\n for (AuthorityDTO curAuth : lstAuthority) {\n if (curAuth.getId().equals(Constants.AUTH_PARTICIPATE_CONTEST_ID)) {\n //if so then check conditions mentioned above\n if (currentTime.compareTo(startTime) >= 0\n && currentTime.compareTo(endTime) <= 0){\n return true;\n }else if(currentTime.compareTo(endTime) > 0\n && contestEntity.getCanPractice().equals(1)){\n return true;\n }\n }\n }\n //not participator\n return false;\n }", "private Boolean canUserValidate() throws ServeurException, ClientException {\n // Direct on/off line\n return checkValidatePermission();\n }", "public boolean isLate(){\n Date d = givenBack != null ? givenBack : new Date();\n return expirationDate.before(d);\n }", "@Override\n\tpublic boolean isApproved() {\n\t\treturn _scienceApp.isApproved();\n\t}", "public boolean checkDate(Date dateNow, Date maxAccess) {\n return dateNow.after(maxAccess);\n }", "public boolean hasExpired(){\n Date now = new Date();\n return now.after(getExpireTime());\n }", "public boolean isExpired() {\r\n if (expiresDate != null) {\r\n Date rightNow = new Date();\r\n return expiresDate.before(rightNow);\r\n }\r\n return false;\r\n }", "public boolean isReviewPositive()\n {\n return (m_nReviewValue == REVIEW_VALUE_POSITIVE) ? true : false ;\n }", "boolean isCredentialsNonExpired();", "boolean isCredentialsNonExpired();", "boolean isValidForNow ();", "default T calendarAccessAuthorized() {\n return amend(CALENDAR_ACCESS_AUTHORIZED_OPTION, true);\n }", "private static boolean updateRequired(Context context) {\r\n\t\tSharedPreferences pref = context.getSharedPreferences(\r\n\t\t\t\tUSER_ID_SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);\r\n\r\n\t\tif (pref.contains(LAST_UPDATE)) {\r\n\r\n\t\t\tLong lastUpdate = pref.getLong(LAST_UPDATE, -1);\r\n\t\t\tLong now = new Date().getTime();\r\n\r\n\t\t\treturn (now - lastUpdate) > TIME_IN_MILLIS;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private Boolean isNeed(Course course, String userEmail) {\n if (course.getTeacher() != null && course.getTeacher().getEmail().equals(userEmail)) {\n return true;\n } else if (course.getTeacherEmail() != null && course.getTeacherEmail().equals(userEmail)) {\n return true;\n } else if (course.getOrganization() != null && course.getOrganization().getResponsiblePerson().getEmail().equals(userEmail)) {\n return true;\n }\n return false;\n }", "public static boolean canAccess (HttpServletRequest req, AccessRights requiredRights) {\n\t\tif (requiredRights.equals(AccessRights.PUBLIC)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (req.getSession().getAttribute(SESS_IS_EMPLOYEE) != null) {\n\t\t\tif (requiredRights.equals(AccessRights.AUTHENTICATED) || requiredRights.equals(AccessRights.EMPLOYEE)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn req.getSession().getAttribute(SESS_IS_ADMIN) != null && (boolean) req.getSession().getAttribute(SESS_IS_ADMIN);\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean requiresChecking(ReferencedURL rurl)\n\t{\n\t\t// DO NOT CHANGE THIS METHOD without also changing the other methods in\n\t\t// this policy class, and also the documented policy in the class\n\t\t// comments.\n\n\t\tfinal long lastCheck = rurl.getLastChecked().getTime();\n\n\t\tif( lastCheck < oneMonthAgo() )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif( !rurl.isSuccess() && rurl.getTries() < triesUntilDisabled )\n\t\t{\n\t\t\tif( lastCheck < oneDayAgo() )\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public Boolean hasCardExpired(Date currentDate);", "public boolean isAccountNonExpired() {\n\t\treturn true;\r\n\t}", "public boolean isExpired() {\n return getExpiration() <= System.currentTimeMillis() / 1000L;\n }", "public Boolean isAuthorized(String userId);", "private boolean hasCoolOffPeriodExpired(Jwt jwt) {\n\n Date issuedAtTime = jwt.getClaimsSet().getIssuedAtTime();\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n calendar.set(Calendar.MILLISECOND, 0);\n calendar.add(Calendar.MINUTE, -1);\n\n return calendar.getTime().compareTo(issuedAtTime) > 0;\n }", "boolean isExpire(long currentTime);", "public boolean isOverdue(int today);", "public synchronized boolean canWatch() {\n\t\t//boolean to keep track of theater vacancy \n\t\tboolean enterStatus;\n\t\t//when the movie is in session or the theater is full we can't enter\n\t\tif(Clock.isInSession ||Driver.currentVisitors == 8) { \n\t\t\tenterStatus = false;\n\t\t}else {\n\t\t\tenterStatus = true;\n\t\t}\n\t\treturn enterStatus;\n\t}", "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 boolean isExpired() {\n return expired;\n }", "public boolean isExpired() {\n return expired;\n }", "public boolean isExpired() {\n\n return this.expiration.before(new Date());\n }", "public boolean isExpired() {\n return ((System.currentTimeMillis() - this.createdTime) >= expiryTime);\n }", "public boolean isSelectedPredefinedCourse(){\n if(predefinedCourseName == null) return false;\n else return true;\n }", "public boolean checkVisibility() {\n LocalDateTime now = LocalDateTime.now();\n return (this.viewer != 0 && !now.isAfter(this.destructTime));\n }", "boolean hasExpiredTrialLicense() {\n return false;\n }", "public boolean isAccountNonExpired() {\n\t\treturn false;\r\n\t}", "private boolean validLogin() {\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n\t\tif(principal.equals(IConstant.LOGIN_STATUS.ANONYMOUS_USER)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tUserDetails userDetails = (UserDetails) principal;\r\n\t\t\treturn userDetails.isAccountNonExpired() &&\r\n\t\t\t\t\tuserDetails.isAccountNonLocked() &&\r\n\t\t\t\t\tuserDetails.isCredentialsNonExpired() &&\r\n\t\t\t\t\tuserDetails.isEnabled();\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void reviewOfPastYear(ExemptTeamMember exemptTeamMember) {\n\t\t\r\n\t\t\r\n\t}", "public boolean requiresPostApproval() {\n return true;\n }", "boolean isAccepting();", "@Override\n\tpublic boolean isDenied() {\n\t\treturn model.isDenied();\n\t}", "public boolean isAccountNonExpired() {\n\t\treturn true;\n\t}", "public boolean mayHaveExpired() {\n return mayHaveExpired;\n }", "public boolean isRestricted() {\n return restricted;\n }", "public boolean isExpired() {\n return System.currentTimeMillis() > this.expiry;\n }", "boolean canRedoExpenseTracker() throws NoUserSelectedException;", "public boolean isRestricted() {\n return _restricted;\n }", "public boolean isRestricted() {\n return restricted || getFlow().getRestriction() != null;\n }", "public static boolean isEndorValid(int CUST_ID,int REVIEW_ID) {\n irate_Connection om = new irate_Connection();\n om.startConnection(\"user1\", \"password\", dbName);\n conn = om.getConnection();\n s = om.getStatement();\n irate_DQL dql = new irate_DQL(conn, s);\n int REVIEW_ID_2 = dql.revid(CUST_ID);\n if(REVIEW_ID == REVIEW_ID_2)\n return false;\n else\n return true;\n }" ]
[ "0.6250155", "0.60417074", "0.60025346", "0.59579843", "0.5954598", "0.5931773", "0.59088564", "0.5837412", "0.58130056", "0.5809629", "0.5776991", "0.57756686", "0.5766885", "0.57614344", "0.57571286", "0.5747964", "0.5722109", "0.5722109", "0.570435", "0.5700923", "0.5691521", "0.56840986", "0.5683887", "0.5667006", "0.5664621", "0.56412", "0.5597054", "0.55855465", "0.55511546", "0.5544706", "0.5544706", "0.5540319", "0.5512323", "0.55037665", "0.54874", "0.5476439", "0.5476267", "0.5469159", "0.5457858", "0.5454468", "0.54521215", "0.5449743", "0.54495525", "0.5436979", "0.5423166", "0.53969616", "0.5375374", "0.5375371", "0.537275", "0.53656524", "0.53621995", "0.5361279", "0.5351427", "0.5347327", "0.53441846", "0.5337145", "0.5335152", "0.531689", "0.5313541", "0.5311103", "0.5304953", "0.5301336", "0.5301268", "0.5301268", "0.52952164", "0.5293106", "0.52816474", "0.52706856", "0.5267086", "0.5264831", "0.5260356", "0.52561665", "0.525326", "0.52486783", "0.5247194", "0.52454823", "0.5242744", "0.5235125", "0.5233928", "0.52278847", "0.52278847", "0.52255106", "0.52222717", "0.5219727", "0.5217605", "0.52158135", "0.52147967", "0.52091146", "0.52071786", "0.52043265", "0.5197251", "0.51884264", "0.518562", "0.51803666", "0.518026", "0.5179477", "0.5179463", "0.5172241", "0.51688296", "0.5162651" ]
0.5372137
49
returns true if the String argument is empty
public static String footerStatus(Connection conn,String kix,String type) { String footerStatus = ""; try{ if(type.equals("ARC")){ footerStatus = "Archived on " + getFndItem(conn,kix,"dateapproved"); } else if(type.equals("CUR")){ footerStatus = "Approved on " + getFndItem(conn,kix,"dateapproved"); } else if(type.equals("PRE")){ footerStatus = "Last modified on " + getFndItem(conn,kix,"auditdate"); } } catch(Exception e){ logger.fatal("footerStatus ("+kix+"/"+type+"): " + e.toString()); } return footerStatus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isEmptyOrNullString (final String in) {\n\t\treturn StringUtils.EMPTY_STRING.equals(in);\n\t}", "private boolean checkForEmpty(String str){\r\n\t\tString sourceStr = str;\r\n\t\tif(StringUtils.isBlank(sourceStr)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean isEmpty(String str) {\n return str == null || str.trim().isEmpty();\n }", "protected boolean notEmpty(String s) {\n return s != null && s.length() != 0;\n }", "private static boolean isEmpty(CharSequence str) {\n if (str == null || str.length() == 0) {\n return true;\n } else {\n return false;\n }\n }", "private boolean isEmpty(String str) {\n return (str == null) || (str.equals(\"\"));\n }", "private boolean isEmpty(String string) {\n\t\treturn string == null || string.isEmpty();\n\t}", "protected boolean isEmpty(String s) {\n return s == null || s.trim().isEmpty();\n }", "private boolean isEmpty(String s) {\n return s == null || \"\".equals(s);\n }", "private static boolean isEmpty(CharSequence str) {\n return str == null || str.length() == 0;\n }", "public static boolean isEmpty(String input) {\n if (input == null || input.isEmpty() || (\"\").equals(input.trim()))\n return true;\n return false;\n }", "public static boolean isEmpty(String aString)\r\n {\r\n return aString==null || aString.trim().length()==0;\r\n }", "public static boolean isEmptyOrNull(String content){\n if(content == null){\n return true;\n }else return content.trim().equals(\"\");\n }", "private boolean checkForEmptyString(Object value)\n\t{\n\t\tif (value == null || value.toString().isEmpty()) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isNotEmpty(String input){\r\n if(input == null) return false;\r\n if(input.isEmpty()) return false;\r\n return true;\r\n }", "private static final boolean isEmpty(String s) {\n return s == null || s.trim().length() < 1;\n }", "protected boolean isEmpty(String text) {\r\n if (text == null) {\r\n return true;\r\n }\r\n\r\n if (text.trim().length() == 0) {\r\n return true;\r\n }\r\n return false;\r\n }", "public static final boolean isEmpty(String strSource){\n return strSource==null ||strSource.equals(\"\")|| strSource.trim().length()==0; \n }", "private final boolean emptyVal(String val) {\n return ((val == null) || (val.length() == 0));\n }", "abstract boolean canMatchEmptyString();", "private final static boolean isEmpty(String field) {\n return field == null || field.trim().length() == 0;\n }", "public static boolean isStringFullEmpty(String string) {\n\t\treturn !string.isBlank() && !string.isEmpty();\n\t}", "public static boolean isEmpty(String str) {\n return StringUtils.isEmpty(str);\n }", "public boolean isEmpty( String string ){\n if( string == null || string.trim().length() == 0 ){\n return true;\n }\n return false;\n }", "static boolean isNullOrEmpty(String str){\n if(str == null){\n return true;\n }\n if(str.isEmpty()){\n return true;\n }\n if(str.length() == 0){\n return true;\n }\n if(str.equalsIgnoreCase(\" \")){\n return true;\n }\n return false;\n }", "public static boolean isEmpty(String value)\n {\n return (isNull(value)) || value.trim().length() == 0;\n }", "public static boolean isEmpty(String value)\n {\n return (isNull(value)) || value.trim().length() == 0;\n }", "public static boolean isEmpty(String string) {\n\treturn null == string || string.trim().isEmpty();\n }", "public boolean isEmpty() {\n\t\tString v = getValue();\n\t\treturn v == null || v.isEmpty();\n\t}", "public static boolean isEmpty(CharSequence str) {\r\n\t\tif (str == null || str.length() == 0) return true;\r\n\t\telse return false;\r\n\t}", "boolean canMatchEmptyString() {\n return false;\n }", "public static boolean isEmpty(String s) {\n return s == null || s.isEmpty();\n }", "public static boolean isEmpty(String text) {\n return text == null || text.isEmpty();\n }", "public static boolean isEmpty(CharSequence str) {\r\n if (str == null || str.length() == 0)\r\n return true;\r\n else\r\n return false;\r\n }", "public static boolean isNullOrEmpty(String content){\n return (content !=null && !content.trim().isEmpty() ? false :true);\n }", "static boolean isNullOrEmpty(String string) {\n return string == null || string.isEmpty();\n }", "private static boolean hasString(String value) {\n if (!value.trim().equals(\"\") && value.length() > 0) {\n return true;\n }\n\n return false;\n\n }", "public static boolean isEmpty(String value) {\r\n\t\treturn value == null || value.length() < 1;\r\n\t}", "public static boolean stringNullOrEmpty ( String string ) {\r\n if ( string == null ) return true;\r\n if ( string.isEmpty() ) return true;\r\n return false;\r\n }", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "public static boolean isEmpty(String value) {\n return ((value == null) || (value.trim().length() == 0));\n }", "public static boolean isEmpty(String string) {\n return string.length() == 0;\n }", "public static boolean isEmpty(String value) {\n return (value == null || value.trim().equals(\"\"));\n }", "protected boolean isEmptyValue(final String parameter) {\n // String value = parameters.get(parameter);\n // return isEmptyString(value);\n return false;\n }", "public static boolean isNullOrEmpty(String strIn)\r\n {\r\n return (strIn == null || strIn.equals(\"\"));\r\n }", "public static boolean isEmpty(String s) {\n\t\treturn s != null && s.length() == 0;\n\t}", "public boolean isEmpty(String pValue) {\r\n\t\treturn StringUtils.isEmpty(pValue);\r\n\t}", "public static boolean isEmpty(String str) {\r\n return str == null || str.length() == 0;\r\n }", "public static boolean isNullOrEmpty(String param) {\n return param == null || param.trim().length() == 0;\n }", "public static boolean isEmpty(String s) {\n return s == null || s.length() == 0;\n }", "public static boolean isEmpty(String s) {\r\n return (s == null) || (s.length() == 0);\r\n }", "public boolean isEmpty() {\n return strings.isEmpty();\n }", "public static boolean isEmpty(CharSequence str) {\n return str == null || str.length() == 0;\n }", "public static boolean isNotEmpty(String text) {\r\n\t\treturn (!(text == null || text.isEmpty() || text.length() == 0 || text.equals(\"\")));\r\n\t}", "public static boolean checkNullOrEmptyString(String inputString) {\n\t\treturn inputString == null || inputString.trim().isEmpty();\n\t}", "public static boolean isEmpty(CharSequence str) {\n if (str == null || str.length() == 0 || \"null\".equals(str))\n return true;\n else\n return false;\n }", "public static boolean isBlank(String str)\n {\n if( str == null || str.length() == 0 )\n return true;\n return false;\n }", "public boolean isNullOrEmpty(String str){\n \treturn str!=null && !str.isEmpty() ? false : true;\n }", "public static boolean isEmpty( String input )\n {\n if ( input == null || \"\".equals( input ) )\n return true;\n\n for ( int i = 0; i < input.length(); i++ )\n {\n char c = input.charAt( i );\n if ( c != ' ' && c != '\\t' && c != '\\r' && c != '\\n' )\n {\n return false;\n }\n }\n return true;\n }", "public static Boolean IsStringNullOrEmpty(String value) {\n\t\treturn value == null || value == \"\" || value.length() == 0;\n\t}", "public static boolean IsNullOrEmpty(String text) {\n\t\treturn text == null || text.length() == 0;\n\t}", "public static boolean isEmpty(final String value) {\n\t\treturn value == null || value.trim().length() == 0 || \"null\".endsWith(value);\n\t}", "public static boolean isEmptyString(String text) {\n return (text == null || text.trim().length() == 0);\n }", "public static boolean isBlankOrNullString(String s){\n return s == null || s.isEmpty() || s.equalsIgnoreCase(\"\");\n }", "private static boolean isBlank(CharSequence str) {\n int strLen;\n if (str == null || (strLen = str.length()) == 0) {\n return true;\n }\n for (int i = 0; i < strLen; i++) {\n if ((Character.isWhitespace(str.charAt(i)) == false)) {\n return false;\n }\n }\n return true;\n }", "private static boolean isBlank(String str)\r\n/* 254: */ {\r\n/* 255: */ int length;\r\n/* 256:300 */ if ((str == null) || ((length = str.length()) == 0)) {\r\n/* 257:301 */ return true;\r\n/* 258: */ }\r\n/* 259: */ int length;\r\n/* 260:302 */ for (int i = length - 1; i >= 0; i--) {\r\n/* 261:303 */ if (!Character.isWhitespace(str.charAt(i))) {\r\n/* 262:304 */ return false;\r\n/* 263: */ }\r\n/* 264: */ }\r\n/* 265:306 */ return true;\r\n/* 266: */ }", "public static boolean checkEmptiness(String str) {\r\n return str != null && !str.trim().equals(\"\");\r\n }", "public boolean empty() {\n return s.isEmpty();\n }", "public static boolean isEmpty(String string) {\n\t\treturn string == null || \"\".equals(string);\n\t}", "public static boolean isEmpty(CharSequence str) {\n\t\treturn (str == null || str.toString().trim().length() == 0);\n\t}", "public static boolean isEmptyString(String s) {\n return (s==null || s.equals(\"\"));\n }", "protected boolean isEmpty(Object obj) {\r\n return (obj == null || obj instanceof String\r\n && ((String) obj).trim().length() == 0);\r\n }", "public static boolean isBlank(String text) {\n return text == null || isBlank(text.toCharArray());\n }", "public static boolean isStringEmpty(String str) {\r\n return (str == null) || \"\".equals(str.trim());\r\n }", "public static boolean isEmpty(final CharSequence string)\n\t{\n\t\treturn string == null || string.length() == 0 || string.toString().trim().equals(\"\");\n\t}", "public static boolean isEmpty(@Nullable final String text) {\n return text == null || text.trim().length() == 0;\n }", "public static boolean isEmpty(String s)\r\n {\r\n return (s == null || s.length() == 0 || s.trim().length() == 0);\r\n }", "@Test\n\tpublic void nonEmptyString() {\n\t\tString s = \" H \";\n\t\tassertFalse(\"Non empty string\", StringUtil.isEmpty(s));\n\t}", "public boolean isEmpty() {\n return (this.text == null);\n }", "@Contract(\"null -> true\")\n public static boolean isBlankOrNull(final String arg) {\n return (arg == null || arg.replaceAll(\"\\\\s\", \"\").length() == 0);\n }", "public static boolean isNullOrEmpty(String text) {\n if (text == null || text.equals(\"\")) {\n return true;\n } else {\n return false;\n }\n }", "public static final boolean isEmptyStr(String str)\n\t{\n\t\tif (null == str || \"\".equals(str))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static boolean isNotEmpty(String str) {\n\treturn null != str && !str.trim().isEmpty();\n }", "public boolean empty() {\n\t return s.isEmpty();\n\t}", "public static boolean isNotEmpty(String str) {\n return !StringUtil.isEmpty(str);\n }", "public static boolean isNotEmpty(String value) {\n\t\treturn value != null && !value.trim().isEmpty();\n\t}", "private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }", "@Test\n\tpublic void zeroLength() {\n\t\tString s = \"\";\n\t\tassertTrue(\"Zero length string\", StringUtil.isEmpty(s));\n\t}", "public static boolean isNotEmpty(String text) {\n return !isEmpty(text);\n }", "protected boolean checkEmpty(String line) {\n return line == null || line.isBlank();\n }", "public static boolean isNotEmpty(String value) {\n return !isEmpty(value);\n }", "private boolean isParamsEmpty(String... params){\n for (String param : params) {\n if (param.isEmpty())\n return true;\n }\n return false;\n }", "public static boolean isBlank(String str) {\n\t\tboolean flag = false;\n\t\tif (str == null || \"\".equals(str.trim())) {\n\t\t\tflag = true;\n\t\t}\n\t\treturn flag;\n\t}", "public static boolean isNullOrEmpty(String str) {\n return str == null || str.isEmpty();\n }", "public abstract boolean IsEmpty();", "public boolean isEmpty(String studentName)\r\n {\r\n return (studentName.isEmpty() || studentName.trim().isBlank());\r\n }", "public static boolean isEmpty(String string) {\n if (string == null) {\n return true;\n }\n \n if (\"\".equals(string)) {\n return true;\n }\n \n return false;\n }", "public boolean isEmpty() {\n\t\t\t\t\n\t\treturn length() == 0;\n\t}", "public static boolean isEmpty(Object field) {\r\n\t\treturn (field == null) || field.toString().trim().isEmpty();\r\n\t}", "public boolean isEmpty() {\r\n\t\treturn this.strings != null ? this.strings.isEmpty() : true;\r\n\t}", "public static boolean isNotEmpty(String str) {\r\n return !StringUtil.isEmpty(str);\r\n }" ]
[ "0.78667337", "0.78552276", "0.7841638", "0.78372335", "0.7812655", "0.78121346", "0.77504", "0.7708159", "0.7688102", "0.76810694", "0.7675375", "0.76679933", "0.7660164", "0.7646039", "0.76337475", "0.7629068", "0.761431", "0.76096284", "0.76010454", "0.75825286", "0.75818914", "0.75633764", "0.7557668", "0.75566566", "0.7541583", "0.75327957", "0.75327957", "0.75316316", "0.75206155", "0.7514406", "0.7514353", "0.7513553", "0.74970216", "0.7489373", "0.7476665", "0.74700683", "0.74691826", "0.7467975", "0.746029", "0.7455258", "0.74264485", "0.7393122", "0.73906887", "0.7388183", "0.7364321", "0.7362173", "0.7357581", "0.7353878", "0.7350435", "0.73480576", "0.7338376", "0.7326218", "0.73191696", "0.7302112", "0.73004293", "0.7277496", "0.7274788", "0.7271118", "0.725394", "0.72499126", "0.7247811", "0.7247316", "0.7246397", "0.7244772", "0.72401553", "0.7237175", "0.7228754", "0.72204745", "0.7205036", "0.71999353", "0.7197001", "0.7195675", "0.7195075", "0.71931124", "0.71909446", "0.71872175", "0.71846235", "0.71815765", "0.71698064", "0.7162427", "0.71358824", "0.712692", "0.71215373", "0.7101111", "0.708466", "0.7073242", "0.7070738", "0.7067095", "0.7062265", "0.7061934", "0.705021", "0.7043398", "0.7041176", "0.7039234", "0.7034536", "0.7025314", "0.70241445", "0.70225847", "0.702168", "0.7018281", "0.70164037" ]
0.0
-1
getLinkedItems returns sql for linked src
public static String getLinkedItems(Connection conn,String campus,String user,int id,String kix,String src,boolean print) throws SQLException { //Logger logger = Logger.getLogger("test"); WebSite website = new WebSite(); String temp = ""; String sql = ""; StringBuffer buf = new StringBuffer(); StringBuffer legend = new StringBuffer(); String rowColor = ""; String checked = ""; String field = ""; String xiAxis = ""; String yiAxis = ""; int iHallmarks = 0; boolean debug = false; try{ debug = DebugDB.getDebug(conn,"LinkedUtil"); if (debug) logger.info("getLinkedItems - START"); String server = SysDB.getSys(conn,"server"); com.ase.aseutil.fnd.FndDB fnd = new com.ase.aseutil.fnd.FndDB(); // // for legend // legend.append("<hr size=\"1\" noshade=\"\"><br>LEGEND<br/><ol>"); for(com.ase.aseutil.Generic fd: fnd.getHallmarks(conn,id)){ legend.append("<li class=\"normaltext\">"+fd.getString2()+"</li>"); ++iHallmarks; } legend.append("</ol>"); // // display header line (items for linking) // if(!print){ buf.append("<form name=\"aseForm\" method=\"post\" action=\"/central/servlet/linker?arg=fnd\">"); } buf.append("<table summary=\"\" id=\"tableLinkedFoundationItems\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"8\"><tbody>" + "<tr bgcolor=\"#E1E1E1\">" + "<td class=\"textblackTH\" valign=\"top\">&nbsp;SLO / Hallmarks</td>"); for (int j = 0; j < iHallmarks; j++){ buf.append("<td class=\"textblackTH\" valign=\"top\" width=\"03%\">"+(j+1)+"</td>"); if(j > 0){ xiAxis += ","; } xiAxis += "" + (j+1); } // next j buf.append("</tr>"); // // show matrix. keep in mind the kix we need for SLOs is the course kix and not the // the foundation kix // String[] info = getKixInfo(conn,kix); String alpha = info[Constant.KIX_ALPHA]; String num = info[Constant.KIX_NUM]; info = Helper.getKixRoute(conn,campus,alpha,num,"CUR"); String courseKix = info[0]; ArrayList list = CompDB.getCompsByKix(conn,courseKix); if ( list != null ){ Comp comp; for (int i = 0; i<list.size(); i++){ comp = (Comp)list.get(i); if(i > 0){ yiAxis += ","; } yiAxis += "" + comp.getID(); // alternating if (i % 2 == 0){ rowColor = Constant.EVEN_ROW_BGCOLOR; } else{ rowColor = Constant.ODD_ROW_BGCOLOR; } // data row buf.append("<tr bgcolor=\""+rowColor+"\">" + "<td class=\"datacolumn\" valign=\"top\">"+comp.getComp()+"</td>"); for (int j = 0; j < iHallmarks; j++){ checked = ""; if(isChecked(conn,campus,id,NumericUtil.getInt(comp.getID(),0),(j+1))){ checked = "checked"; } field = comp.getID() + "_" + (j+1); if(!print){ buf.append("<td valign=\"top\" width=\"03%\">" + "<input type=\"checkbox\" "+checked+" name=\""+field+"\" value=\"1\">" + "</td>"); } else{ if(checked.equals("")){ buf.append("<td valign=\"top\" width=\"03%\">" + "&nbsp;" + "</td>"); } else{ buf.append("<td valign=\"top\" width=\"03%\">" + "<img src=\"http://"+server+"/central/images/images/checkmarkG.gif\" alt=\"selected\" border=\"0\" />" + "</td>"); } } } // next j buf.append("</tr>"); } // for comp } // list not null buf.append("</tbody></table>"); if(!print){ buf.append("<input type=\"hidden\" value=\""+id+"\" name=\"id\" id=\"id\">" + "<input type=\"hidden\" value=\""+kix+"\" name=\"kix\" id=\"kix\">" + "<input type=\"hidden\" value=\""+src+"\" name=\"src\" id=\"src\">" + "<input type=\"hidden\" value=\""+xiAxis+"\" name=\"xiAxis\" id=\"xiAxis\">" + "<input type=\"hidden\" value=\""+yiAxis+"\" name=\"yiAxis\" id=\"yiAxis\">" + "<hr size=\"1\" noshade><p align=\"right\">" + "<input type=\"submit\" class=\"input\" name=\"aseSubmit\" value=\"Submit\" title=\"save data\">&nbsp;&nbsp;" + "<input type=\"submit\" class=\"input\" name=\"aseCancel\" value=\"Cancel\" title=\"abort selected operation\" onClick=\"return cancelMatrixForm()\">" + "</p>" + "</form>"); } temp = buf.toString() + legend.toString(); fnd = null; if (debug) logger.info("getLinkedItems - END"); } catch (Exception e) { logger.fatal("FndDB.getLinkedItems - " + e.toString()); } return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ArrayList<String> findLinkedEntity(String node) throws SQLException;", "List<ProductLink> links();", "private DataSourcesItem getSrcDataSources(DataSourcesItem item) {\r\n if (item == null) { return null; }\r\n\r\n DataSourcesDao dsDao = DiscourseDbDaoFactory.DEFAULT.getDataSourcesDao();\r\n DataSourcesItem result = dsDao.findBySourceId((Long)item.getId());\r\n return result;\r\n }", "@Transactional\r\n\tpublic List<UIDataModelEntity>getLinks(int startItem){\r\n\t\tPageRequest page = new PageRequest(startItem, PAGE_OFFSET);\r\n\t\tPage<Item> items = itemRepo.findAll(page);\r\n\t\tList<UIDataModelEntity> uiEntitiesList = new ArrayList<>();\r\n\t\tfor(Item item : items){\r\n\t\t\titem.getItemLinks().size();\r\n\t\t\tSet<ItemLink> links = item.getItemLinks();\r\n\t\t\tCategory category = item.getCategory();\r\n\t\t\tUIDataModelEntity modelEntity = new UIDataModelEntity();\r\n\t\t\tmodelEntity.setCategoryName(category.getName());\r\n\t\t\tmodelEntity.setCompanyName(item.getName());\r\n\t\t\tlinks.stream().forEach(e->{modelEntity.getGoogleLinks().add(e.getLink());});\r\n\t\t\tuiEntitiesList.add(modelEntity);\r\n\t\t}\r\n\t\t\r\n\t\treturn uiEntitiesList;\r\n\t\t\r\n\t}", "ObservableList<Link> getFilteredLinkList();", "public void populateLinks(List<Drop> drops, Account queryingAccount) {\n \n \t\tList<Long> dropIds = new ArrayList<Long>();\n \t\tfor (Drop drop : drops) {\n \t\t\tdropIds.add(drop.getId());\n \t\t}\n \n \t\tString sql = \"SELECT `droplet_id`, `link_id` AS `id`, `url` \";\n \t\tsql += \"FROM `droplets_links` \";\n \t\tsql += \"INNER JOIN `links` ON (`links`.`id` = `link_id`) \";\n \t\tsql += \"WHERE `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `links`.`id` NOT IN ( \";\n \t\tsql += \"SELECT `link_id` \";\n \t\tsql += \"FROM `account_droplet_links` \";\n \t\tsql += \"WHERE `account_id` = :account_id \";\n \t\tsql += \"AND `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `deleted` = 1) \";\n \t\tsql += \"UNION ALL \";\n \t\tsql += \"SELECT `droplet_id`, `link_id` AS `id`, `url` \";\n \t\tsql += \"FROM `account_droplet_links` \";\n \t\tsql += \"INNER JOIN `links` ON (`links`.`id` = `link_id`) \";\n \t\tsql += \"WHERE `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `account_id` = :account_id \";\n \t\tsql += \"AND `deleted` = 0 \";\n \n \t\tQuery query = em.createNativeQuery(sql);\n \t\tquery.setParameter(\"drop_ids\", dropIds);\n \t\tquery.setParameter(\"account_id\", queryingAccount.getId());\n \n \t\t// Group the links by drop id\n \t\tMap<Long, List<Link>> links = new HashMap<Long, List<Link>>();\n \t\tfor (Object oRow : query.getResultList()) {\n \t\t\tObject[] r = (Object[]) oRow;\n \n \t\t\tLong dropId = ((BigInteger) r[0]).longValue();\n \t\t\tLink link = new Link();\n \t\t\tlink.setId(((BigInteger) r[1]).longValue());\n \t\t\tlink.setUrl((String) r[2]);\n \n \t\t\tList<Link> l = links.get(dropId);\n \t\t\tif (l == null) {\n \t\t\t\tl = new ArrayList<Link>();\n \t\t\t\tlinks.put(dropId, l);\n \t\t\t}\n \n \t\t\tl.add(link);\n \t\t}\n \n \t\tfor (Drop drop : drops) {\n \t\t\tList<Link> l = links.get(drop.getId());\n \n \t\t\tif (l != null) {\n \t\t\t\tdrop.setLinks(l);\n \t\t\t} else {\n \t\t\t\tdrop.setLinks(new ArrayList<Link>());\n \t\t\t}\n \t\t}\n \t}", "private void loadItems() {\n try {\n if (ServerIdUtil.isServerId(memberId)) {\n if (ServerIdUtil.containsServerId(memberId)) {\n memberId = ServerIdUtil.getLocalId(memberId);\n } else {\n return;\n }\n }\n List<VideoReference> videoReferences = new Select().from(VideoReference.class).where(VideoReference_Table.userId.is(memberId)).orderBy(OrderBy.fromProperty(VideoReference_Table.date).descending()).queryList();\n List<String> videoIds = new ArrayList<>();\n for (VideoReference videoReference : videoReferences) {\n videoIds.add(videoReference.getId());\n }\n itemList = new Select().from(Video.class).where(Video_Table.id.in(videoIds)).orderBy(OrderBy.fromProperty(Video_Table.date).descending()).queryList();\n } catch (Throwable t) {\n itemList = new ArrayList<>();\n }\n }", "public abstract DBResult getContinuousLink(int linkId) throws SQLException;", "public abstract DBResult getLink(int linkId) throws SQLException;", "public List<String> getLinks();", "TLinkman selectByPrimaryKey(Integer linkid);", "List<Link> getLinks();", "public List<MediaRelation> loadMediaRelations();", "public abstract DBResult getAdjacentLinks(int nodeId) throws SQLException;", "java.util.List<com.rpg.framework.database.Protocol.Item> \n getItemsList();", "ObservableList<Link> getUnfilteredLinkList();", "private ContentItem getSrcContent(ContentItem item) {\r\n if (item == null) { return null; }\r\n\r\n ContentDao contentDao = DiscourseDbDaoFactory.DEFAULT.getContentDao();\r\n ContentItem result = contentDao.findBySourceId((Long)item.getId());\r\n return result;\r\n }", "public Collection<GPImageLinkComponent> getImages(final SessionContext ctx)\n\t{\n\t\tfinal List<GPImageLinkComponent> items = getLinkedItems( \n\t\t\tctx,\n\t\t\ttrue,\n\t\t\tGpcommonaddonConstants.Relations.BRANDBAR2GPIMAGELINKRELATION,\n\t\t\t\"GPImageLinkComponent\",\n\t\t\tnull,\n\t\t\tfalse,\n\t\t\tfalse\n\t\t);\n\t\treturn items;\n\t}", "@SuppressWarnings(\"rawtypes\")\n private String getSourcePageIds(Job job)\n {\n StringBuilder spIds = new StringBuilder();\n Iterator spIter = job.getSourcePages().iterator();\n while (spIter.hasNext())\n {\n SourcePage sp = (SourcePage) spIter.next();\n spIds.append(sp.getId()).append(\",\");\n }\n\n String result = spIds.toString();\n if (result.endsWith(\",\"))\n {\n return result.substring(0, result.length() - 1);\n }\n return \"\";\n }", "public Cursor querySources(){\n String sql = \"SELECT \" + ArticleContract.ArticleEntry.COLUMN_SOURCE + \", \"\n + ArticleContract.ArticleEntry.COLUMN_CATEGORY + \" FROM \"\n + ArticleContract.ArticleEntry.TOP_ARTICLE_TABLE + \" GROUP BY \"\n + ArticleContract.ArticleEntry.COLUMN_SOURCE + \" UNION \"\n + \"SELECT \" + ArticleContract.ArticleEntry.COLUMN_SOURCE + \", \"\n + ArticleContract.ArticleEntry.COLUMN_CATEGORY + \" FROM \"\n + ArticleContract.ArticleEntry.LATEST_ARTICLE_TABLE + \" GROUP BY \"\n + ArticleContract.ArticleEntry.COLUMN_SOURCE;\n return db.rawQuery(sql, null);\n }", "public abstract DBResult getAdjacentContinuousLinks(int nodeId) throws SQLException;", "private String linkString()\n {\n Iterator<DSAGraphNode<E>> iter = links.iterator();\n String outputString = \"\";\n DSAGraphNode<E> node = null;\n while (iter.hasNext())\n {\n node = iter.next();\n outputString = (outputString + node.getLabel() + \", \");\n }\n return outputString;\n }", "public static com.sybase.collections.GenericList<ru.terralink.mvideo.sap.Orders> getRelationsOrderss_for_Relations(java.lang.Long surrogateKey, int skip, int take)\n {\n String intervalName = null;\n if(com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.isEnabled)\n {\n intervalName = \"Orders.getRelationsOrderss_for_Relations\";\n com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.getInstance().startInterval(intervalName, com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.PersistenceRead);\n }\n try\n {\n \n \n String _selectSQL = \" x.\\\"a\\\",x.\\\"b\\\",x.\\\"c\\\",x.\\\"d\\\",x.\\\"e\\\",x.\\\"f\\\",x.\\\"g\\\",x.\\\"h\\\",x.\\\"i\\\",x.\\\"j\\\",x.\\\"l\\\",x.\\\"m\\\",x.\\\"n\\\",x.\\\"o\\\",x.\\\"p\\\",x.\\\"q\\\",x.\\\"r\\\",x.\\\"s\\\",x.\\\"t\\\",x.\\\"u\\\",x.\\\"v\\\",x.\\\"w\\\",x.\\\"x\\\",x.\\\"y\\\",x.\\\"z\\\",x.\\\"ba\\\",x.\\\"bb\\\",x.\\\"bc\\\",x.\\\"bd\\\",x.\\\"be\\\",x.\\\"bf\\\",x.\\\"bg\\\",x.\\\"bh\\\",x.\\\"bi\\\",x.\\\"bj\\\",x.\\\"bl\\\",x.\\\"bm\\\",x.\\\"pending\\\",x.\\\"_pc\\\",x.\\\"_rp\\\",x.\\\"_rf\\\"\"\n + \",x.\\\"relationsFK\\\",x.\\\"bn\\\",x.\\\"_rc\\\",x.\\\"_ds\\\",x.\\\"cvpOperation_length\\\",x.\\\"cvpOperationLobs_length\\\" from \\\"mvideo5_1_0_orders\\\" x where (((x.\\\"pending\\\" = 1 or not exists (select x_os.\\\"bn\\\" from \\\"mvideo5_1_0_orders_os\\\" x_os where x_os.\\\"bn\\\" = x.\\\"bn\\\")))) and ( x.\\\"relationsFK\\\"=?)\";\n _selectSQL = \"select \" + _selectSQL;\n String[] ids = new String[0];\n com.sybase.reflection.DataType[] dts = new com.sybase.reflection.DataType[]{ \n com.sybase.reflection.DataType.forName(\"long?\"),\n };\n Object[] values = new Object[] { \n surrogateKey,\n };\n com.sybase.collections.GenericList<Object> res = DELEGATE.findWithSQL(_selectSQL, dts, values, ids, skip, take, ru.terralink.mvideo.sap.Orders.class);\n return (com.sybase.collections.GenericList<ru.terralink.mvideo.sap.Orders>)(Object)res;\n }\n finally\n {\n if(com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.isEnabled)\n {\n com.sybase.mobile.util.perf.impl.PerformanceAgentServiceImpl.getInstance().stopInterval(intervalName);\n }\n }\n }", "java.util.List<Integer> getSrcIdList();", "private void queryIPLinkList(UAVHttpMessage data) {\n\n String appgpids = data.getRequest(\"appgpids\");\n\n List<String> ls = JSONHelper.toObjectArray(appgpids, String.class);\n\n @SuppressWarnings(\"rawtypes\")\n Map<String, Map> retMap = new HashMap<String, Map>();\n\n /**\n * query iplink by app group+app id\n */\n for (String appgpid : ls) {\n\n Map<String, String> d = cm.getHashAll(\"store.region.uav\", \"LNK@\" + appgpid);\n\n retMap.put(appgpid, d);\n }\n\n String resultMsg = JSONHelper.toString(retMap);\n\n data.putResponse(UAVHttpMessage.RESULT, resultMsg);\n }", "List fetchBySourceDatabase(String sourceDatabaseName, String sourceID) throws AdaptorException ;", "List<? extends Link> getLinks();", "public String[] listRelations();", "public ArrayList getSourceTableList(String tableName) {\r\n\t\tArrayList sourceTableList = new ArrayList();\r\n\t\tHashSet tableSet = new HashSet();\r\n\t\t// whether the table is a volatile table\r\n\t\tint index = -1;\r\n\t\tindex = volatileIndex(tableName);\r\n\t\t// is a volatile table\r\n\t\tif (index >= 0) {\r\n\t\t\tfor (int i = 0; i < volatileTableSourceList.size(); i++) {\r\n\t\t\t\tHashMap volatileTable = (HashMap) volatileTableSourceList.get(i);\r\n\t\t\t\tInteger volatileIndex = (Integer) volatileTable.get(\"sqlIndex\");\r\n\t\t\t\tif (index == volatileIndex.intValue()) {\r\n\t\t\t\t\ttableSet = (HashSet) volatileTable.get(\"sourceTableList\");\r\n\t\t\t\t\tArrayList tableList = new ArrayList(tableSet);\r\n\r\n\t\t\t\t\tfor (int j = 0; j < tableList.size(); j++) {\r\n\t\t\t\t\t\tHashMap table = (HashMap) tableList.get(j);\r\n\t\t\t\t\t\tString sTable_name = (String) table.get(\"sourceTable\");\r\n\t\t\t\t\t\t// String expressionExp = (String) table.get(\"expression\");\r\n\t\t\t\t\t\tHashMap sTable = new HashMap();\r\n\t\t\t\t\t\tsTable.put(\"sourceTable\", sTable_name);\r\n\t\t\t\t\t\tsTable.put(\"targetTable\", tableName);\r\n\t\t\t\t\t\t// sTable.put(\"expression\",expressionExp);\r\n\t\t\t\t\t\tsourceTableList.add(sTable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tindex = commonIndex(tableName);\r\n\t\t\tif (index >= 0) {\r\n\t\t\t\tfor (int i = 0; i < commonTableSourceList.size(); i++) {\r\n\t\t\t\t\tHashMap commonTable = (HashMap) commonTableSourceList.get(i);\r\n\t\t\t\t\tInteger commonIndex = (Integer) commonTable.get(\"sqlIndex\");\r\n\t\t\t\t\tif (index == commonIndex.intValue()) {\r\n\t\t\t\t\t\ttableSet = (HashSet) commonTable.get(\"sourceTableList\");\r\n\t\t\t\t\t\tArrayList tableList = new ArrayList(tableSet);\r\n\r\n\t\t\t\t\t\tfor (int j = 0; j < tableList.size(); j++) {\r\n\t\t\t\t\t\t\tHashMap table = (HashMap) tableList.get(j);\r\n\t\t\t\t\t\t\tString sTable_name = (String) table.get(\"sourceTable\");\r\n\t\t\t\t\t\t\t// String expressionExp = (String) table.get(\"expression\");\r\n\t\t\t\t\t\t\tHashMap sTable = new HashMap();\r\n\t\t\t\t\t\t\tsTable.put(\"sourceTable\", sTable_name);\r\n\t\t\t\t\t\t\tsTable.put(\"targetTable\", tableName);\r\n\t\t\t\t\t\t\t// sTable.put(\"expression\",expressionExp);\r\n\t\t\t\t\t\t\tsourceTableList.add(sTable);\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} else {\r\n\t\t\t\tHashMap sourceTable = new HashMap();\r\n\t\t\t\tsourceTable.put(\"sourceTable\", \"\");\r\n\t\t\t\tsourceTable.put(\"targetTable\", tableName);\r\n\t\t\t\t// sourceTable.put(\"expression\",expString);\r\n\t\t\t\tsourceTableList.add(sourceTable);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new ArrayList(new HashSet(sourceTableList));\r\n\t}", "public java.lang.String getLinkid(){\r\n return localLinkid;\r\n }", "public static ResultSet getLineItemsResultSet(Connection conn) throws SQLException {\r\n\t\tString querySearch = \"SELECT * FROM lineitems\";\r\n\t\treturn getQueryResultSet(conn, querySearch);\r\n\t}", "public List<TparselinksEntity> getAllLinks();", "public Collection<Map<String, String>> getLinks();", "List fetchBySourceDatabase(String sourceDatabaseName) throws AdaptorException ;", "List<TLinkman> selectByExample(TLinkmanExample example);", "java.util.List<java.lang.String>\n getQueryItemsList();", "private List<Woacrawledurl> readCrawledUrls()\n\t{\n\t\tString hql = \"from Woacrawledurl where instanceId=\"\n\t\t\t\t+ this.param.instance.getTaskinstanceId() + \"order by id\";\n\t\tSessionFactory sessionFactory = TaskFactory.getSessionFactory(this.param.dbid);\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tTransaction t = session.beginTransaction();\n\t\tQuery q = session.createQuery(hql);\n\t\tList<Woacrawledurl> list = q.list();\n\t\tt.commit();\n\t\treturn list;\n\t}", "List<Link> findLinkByCache();", "java.lang.String getLinkedContext();", "public List<ApiPersonDTO> getCastForMetadata(MetaDataType type, Long id, List<DataItem> dataItems, Set<String> jobs) {\n SqlScalars sqlScalars = new SqlScalars();\n sqlScalars.addToSql(\"SELECT DISTINCT p.id,\");\n if (dataItems.contains(DataItem.BIOGRAPHY)) {\n sqlScalars.addToSql(\"p.biography,\");\n sqlScalars.addScalar(\"biography\", StringType.INSTANCE);\n }\n sqlScalars.addToSql(\"p.name,p.first_name AS firstName,p.last_name AS lastName,\");\n sqlScalars.addToSql(\"p.birth_day AS birthDay,p.birth_place AS birthPlace,p.birth_name AS birthName,\");\n sqlScalars.addToSql(\"p.death_day AS deathDay,p.death_place AS deathPlace,\");\n sqlScalars.addToSql(\"c.role as role,c.voice_role as voiceRole,c.job as job \");\n sqlScalars.addToSql(\"FROM person p \");\n\n if (type == SERIES) {\n sqlScalars.addToSql(\"JOIN cast_crew c ON p.id=c.person_id\");\n sqlScalars.addToSql(\"JOIN season sea ON sea.series_id=:id\");\n sqlScalars.addToSql(\"JOIN videodata vd ON vd.id=c.videodata_id and vd.season_id=sea.id\");\n } else if (type == SEASON) {\n sqlScalars.addToSql(\"JOIN cast_crew c ON p.id=c.person_id \");\n sqlScalars.addToSql(\"JOIN videodata vd ON vd.id=c.videodata_id and vd.season_id=:id\");\n } else {\n // defaults to movie/episode\n sqlScalars.addToSql(\"JOIN cast_crew c ON p.id=c.person_id and c.videodata_id=:id\");\n }\n\n sqlScalars.addToSql(\"WHERE p.status\" + SQL_IGNORE_STATUS_SET);\n \n if (jobs != null) {\n sqlScalars.addToSql(\"AND c.job in (:jobs)\");\n sqlScalars.addParameter(\"jobs\", jobs);\n }\n \n sqlScalars.addToSql(\"ORDER BY c.ordering\");\n\n sqlScalars.addScalar(LITERAL_ID, LongType.INSTANCE);\n sqlScalars.addScalar(LITERAL_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_FIRST_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_LAST_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_DAY, DateType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_PLACE, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_DEATH_DAY, DateType.INSTANCE);\n sqlScalars.addScalar(LITERAL_DEATH_PLACE, StringType.INSTANCE);\n sqlScalars.addScalar(\"role\", StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_VOICE_ROLE, BooleanType.INSTANCE);\n sqlScalars.addScalar(LITERAL_JOB, StringType.INSTANCE);\n sqlScalars.addParameter(LITERAL_ID, id);\n\n return executeQueryWithTransform(ApiPersonDTO.class, sqlScalars);\n }", "public List<DatasetItem> getDatasetsExternal() {\n List sortedList = new ArrayList(getDatasets());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "private DiscourseItem getSrcDiscourse(DiscourseItem item) {\r\n if (item == null) { return null; }\r\n\r\n DiscourseDao dao = DiscourseDbDaoFactory.DEFAULT.getDiscourseDao();\r\n DiscourseItem result = dao.findBySourceId((Long)item.getId());\r\n return result;\r\n }", "public Vector<String> getAffectedItemOnRelatedProject(Context context, String[] args) throws Exception {\n logger.debug(\"pss.slc.ui.SLCUIUtil:getAffectedItemOnRelatedProject :Start\");\n Vector<String> vAffectedItem = new Vector<String>();\n try {\n HashMap programMap = (HashMap) JPO.unpackArgs(args);\n HashMap paramList = (HashMap) programMap.get(\"paramList\");\n String strProjectRelList = (String) paramList.get(\"projectRelList\");\n if (UIUtil.isNotNullAndNotEmpty(strProjectRelList)) {\n String[] strRelId = strProjectRelList.split(\",\");\n StringList slRelSelect = new StringList();\n slRelSelect.add(\"to.name\");\n slRelSelect.add(\"to.id\");\n MapList mlAffectedItem = DomainRelationship.getInfo(context, strRelId, slRelSelect);\n\n for (Object obj : mlAffectedItem) {\n Map mAffectedItem = (Map) obj;\n StringBuffer output = new StringBuffer(\" \");\n output.append(\"<tr><td width=\\\"60%\\\">\");\n output.append(\"<a href=\\\"javascript:emxTableColumnLinkClick('../common/emxTree.jsp?objectId=\");\n output.append((String) mAffectedItem.get(\"to.id\"));\n output.append(\"', '700', '600', 'false', 'insert', '')\\\" class=\\\"object\\\">\");\n output.append(\" \" + (String) mAffectedItem.get(\"to.name\"));\n output.append(\"</a></td>\");\n output.append(\"</tr>\");\n vAffectedItem.add(output.toString());\n }\n }\n } catch (Exception e) {\n logger.error(\"ERROR in pss.slc.ui.SLCUIUtil:getAffectedItemOnRelatedProject : \" + e.getMessage());\n }\n logger.debug(\"pss.slc.ui.SLCUIUtil:getAffectedItemOnRelatedProject :End\");\n return vAffectedItem;\n }", "public ArrayList<String> getLinkedFiles(ArrayList<String> tag_names) {\n\n\t\tString query = \"\";\n\n\t\t//\n\t\t// construct string builder\n\t\t//\n\t\tStringBuilder builder = new StringBuilder();\n\n\t\tif (tag_names.size() == 1) {\n\t\t\tquery = \"SELECT \" + MAP_FIELD_FILE + \" FROM \" + MAP_TABLE_NAME\n\t\t\t\t\t+ \" WHERE \" + MAP_FIELD_TAG + \" =?\";\n\t\t} else {\n\t\t\t//\n\t\t\t// build query\n\t\t\t//\n\t\t\tfor (int index = 0; index < tag_names.size(); index++) {\n\t\t\t\tif (builder.length() == 0) {\n\t\t\t\t\tbuilder.append(\"SELECT T1.\" + MAP_FIELD_FILE + \" FROM \"\n\t\t\t\t\t\t\t+ MAP_TABLE_NAME + \" AS T1 WHERE T1.\"\n\t\t\t\t\t\t\t+ MAP_FIELD_TAG + \"=?\");\n\t\t\t\t} else {\n\t\t\t\t\tint pos = builder.indexOf(\" FROM\");\n\t\t\t\t\tString str = \", T\" + Integer.toString(index + 1) + \".\"\n\t\t\t\t\t\t\t+ MAP_FIELD_FILE;\n\t\t\t\t\tbuilder.insert(pos, str);\n\n\t\t\t\t\tpos = builder.indexOf(\" WHERE\");\n\t\t\t\t\tstr = \", \" + MAP_TABLE_NAME + \" AS T\"\n\t\t\t\t\t\t\t+ Integer.toString(index + 1);\n\t\t\t\t\tbuilder.insert(pos, str);\n\n\t\t\t\t\tstr = \" AND T\" + Integer.toString(index + 1) + \".\"\n\t\t\t\t\t\t\t+ MAP_FIELD_TAG + \" =? AND T1.\" + MAP_FIELD_FILE\n\t\t\t\t\t\t\t+ \" = T\" + Integer.toString(index + 1) + \".\"\n\t\t\t\t\t\t\t+ MAP_FIELD_FILE;\n\t\t\t\t\tbuilder.append(str);\n\t\t\t\t}\n\n\t\t\t\tquery = builder.toString();\n\t\t\t}\n\t\t}\n\n\t\tString[] ids = new String[tag_names.size()];\n\t\tfor (int index = 0; index < tag_names.size(); index++) {\n\t\t\t//\n\t\t\t// convert to ids\n\t\t\t//\n\t\t\tids[index] = new String(\n\t\t\t\t\tLong.toString(getTagId(tag_names.get(index))));\n\t\t}\n\n\t\tCursor cursor = m_db.rawQuery(query, ids);\n\n\t\tif (cursor.moveToFirst() == false) {\n\t\t\t//\n\t\t\t// no entries\n\t\t\t//\n\t\t\tcursor.close();\n\t\t\tLogger.e(\"no entries\");\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// construct array list\n\t\t//\n\t\tArrayList<String> list = new ArrayList<String>();\n\n\t\tdo {\n\n\t\t\t//\n\t\t\t// add result\n\t\t\t//\n\t\t\tCursor file_cursor = m_db.query(FILE_TABLE_NAME,\n\t\t\t\t\tnew String[] { FILE_FIELD_PATH }, FILE_FIELD_ID + \"=?\",\n\t\t\t\t\tnew String[] { cursor.getString(0) }, null, null, null);\n\n\t\t\t//\n\t\t\t// collect result\n\t\t\t//\n\t\t\tcollectResultSet(file_cursor, list);\n\n\t\t\t//\n\t\t\t// close cursor\n\t\t\t//\n\t\t\tfile_cursor.close();\n\n\t\t} while (cursor.moveToNext());\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\t//\n\t\t// return result list\n\t\t//\n\t\treturn list;\n\t}", "public List<AnnotatedLinkWrapper> getItemsUnfiltered() {\n return getDelegate().getExtendedItems().stream()\n .map(AnnotatedLinkWrapper::new)\n .filter(al -> al.getTarget() != null)\n .filter(al -> al.getTarget().isInProduction())\n .collect(Collectors.toList());\n }", "public void getRemoteItems() {\n url = getAllItemsOrderedByCategory;\n params = new HashMap<>();\n params.put(param_securitykey, param_securitykey);\n\n if (ApiHelper.checkInternet(mContext)) {\n mApiHelper.getItems(mIRestApiCallBack, true, url, params);\n } else {\n //Toast.makeText(mContext, mContext.getString(R.string.noInternetConnection), Toast.LENGTH_LONG).show();\n mIRestApiCallBack.onNoInternet();\n CacheApi cacheApi = loadCacheData(url, params);\n mSqliteCallBack.onDBDataObjectLoaded(cacheApi);\n }\n\n }", "com.rpg.framework.database.Protocol.Item getItems(int index);", "public abstract NestedSet<Artifact> getTransitiveJackLibrariesToLink();", "public static List getOtherDropdownItems(Connection conn) throws ServletException, SQLException, ObjectNotFoundException {\r\n List<DropdownItem> items;\r\n String sql = \"select item.id AS dropdownId, item_group.short_name || ': ' || item.name AS dropdownValue \" +\r\n \t\"FROM item,item_group WHERE item.ITEM_GROUP_ID = item_group.ID \" +\r\n \t\"AND (ITEM_GROUP_ID > 3 AND ITEM_GROUP_ID < 9) ORDER BY ITEM_GROUP_ID,item.name\";\r\n if ((Constants.DISPLAY_ALL_DRUGS_WHEN_DISPENSING != null) && (Constants.DISPLAY_ALL_DRUGS_WHEN_DISPENSING.equals(\"1\"))) {\r\n \tsql = \"select item.id AS dropdownId, item.name AS dropdownValue \" +\r\n \t\"FROM item,item_group WHERE item.ITEM_GROUP_ID = item_group.ID \" +\r\n \t\"AND (ITEM_GROUP_ID > 3) ORDER BY ITEM_GROUP_ID,item.name\";\r\n }\r\n \tArrayList values = new ArrayList();\r\n \t//item = (DropdownItem) DatabaseUtils.getBean(conn, DropdownItem.class, sql, values);\r\n BeanProcessor beanprocessor = new AuditInfoBeanProcessor();\r\n RowProcessor convert = new ZEPRSRowProcessor(beanprocessor);\r\n items = DatabaseUtils.getList(conn, DropdownItem.class, sql, values, convert);\r\n \treturn items;\r\n }", "public List<ExternalLinkItem> getExternalLinksExternal() {\n List<ExternalLinkItem> sortedList = new ArrayList<ExternalLinkItem>(getExternalLinks());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "private String getItems(long listid){\n \tString theItems = \"\";\n \titemDbAdapter.open();\n \titemCursor = itemDbAdapter.fetchAllItemsFromList(LIST_ID);\n startManagingCursor(itemCursor);\n int cursorRows = itemCursor.getCount();\n \n for ( int i = 0; i < cursorRows; i++) {\n \titemCursor.moveToPosition(i);\n \tString title = itemCursor.getString(itemCursor.getColumnIndexOrThrow(ItemsDbAdapter.KEY_TITLE));\n \ttheItems = theItems + title + \"\\n\";\n }\n \titemDbAdapter.close();\n \treturn theItems;\n }", "ImmutableList<SchemaOrgType> getThumbnailUrlList();", "public List getSourceConnections() {\n return new ArrayList(sourceConnections);\n }", "public final List<a> brw() {\n List<a> linkedList;\n Exception e;\n Throwable th;\n AppMethodBeat.i(73624);\n Cursor rawQuery;\n try {\n rawQuery = this.bSd.rawQuery(\"select rowid,exptId,groupId,exptSeq from ExptItem order by exptId\", null);\n if (rawQuery != null) {\n try {\n linkedList = new LinkedList();\n while (rawQuery.moveToNext()) {\n try {\n a aVar = new a();\n aVar.d(rawQuery);\n linkedList.add(aVar);\n } catch (Exception e2) {\n e = e2;\n try {\n ab.e(\"MicroMsg.ExptStorage\", \"get all expt without content error [%s]\", e.toString());\n if (rawQuery != null) {\n rawQuery.close();\n }\n AppMethodBeat.o(73624);\n return linkedList;\n } catch (Throwable th2) {\n th = th2;\n if (rawQuery != null) {\n }\n AppMethodBeat.o(73624);\n throw th;\n }\n }\n }\n ab.d(\"MicroMsg.ExptStorage\", \"get all expt without content [%d]\", Integer.valueOf(linkedList.size()));\n } catch (Exception e3) {\n e = e3;\n linkedList = null;\n ab.e(\"MicroMsg.ExptStorage\", \"get all expt without content error [%s]\", e.toString());\n if (rawQuery != null) {\n }\n AppMethodBeat.o(73624);\n return linkedList;\n }\n }\n linkedList = null;\n if (rawQuery != null) {\n rawQuery.close();\n }\n } catch (Exception e4) {\n e = e4;\n rawQuery = null;\n linkedList = null;\n } catch (Throwable th3) {\n th = th3;\n rawQuery = null;\n if (rawQuery != null) {\n rawQuery.close();\n }\n AppMethodBeat.o(73624);\n throw th;\n }\n AppMethodBeat.o(73624);\n return linkedList;\n }", "List<CaseLinkman> selectAll();", "@SuppressWarnings(\"unchecked\")\n\tprivate List<ApiArtworkDTO> getFirstMemberArtwork(Long boxedSetId, ArtworkType artworkType, String artworkSortDir) {\n \tStringBuilder sb = new StringBuilder();\n \tsb.append(\"SELECT 'BOXSET' as source, bso_1.boxedset_id as id, a_1.id AS artworkId, al_1.id AS locatedId, ag_1.id AS generatedId,\");\n \tsb.append(\"a_1.artwork_type AS artworkType, ag_1.cache_dir AS cacheDir, ag_1.cache_filename AS cacheFilename, al_1.create_timestamp, bso_1.ordering \");\n \tsb.append(\"FROM boxed_set_order bso_1 \");\n \tsb.append(\"JOIN artwork a_1 ON a_1.videodata_id=bso_1.videodata_id AND a_1.artwork_type=:artworkType \");\n \tsb.append(\"JOIN artwork_located al_1 ON a_1.id=al_1.artwork_id and al_1.status not in ('INVALID','NOTFOUND','ERROR','IGNORE','DELETED') \");\n \tsb.append(\"JOIN artwork_generated ag_1 ON al_1.id=ag_1.located_id \");\n \tsb.append(\"WHERE bso_1.boxedset_id=:id \");\n \tsb.append(\"UNION \");\n \tsb.append(\"SELECT 'BOXSET' as source, bso_2.boxedset_id as id, a_2.id AS artworkId, al_2.id AS locatedId, ag_2.id AS generatedId,\");\n \tsb.append(\"a_2.artwork_type AS artworkType, ag_2.cache_dir AS cacheDir, ag_2.cache_filename AS cacheFilename, al_2.create_timestamp, bso_2.ordering \");\n \tsb.append(\"FROM boxed_set_order bso_2 \");\n \tsb.append(\"JOIN artwork a_2 ON a_2.series_id=bso_2.series_id AND a_2.artwork_type=:artworkType \");\n \tsb.append(\"JOIN artwork_located al_2 ON a_2.id=al_2.artwork_id and al_2.status not in ('INVALID','NOTFOUND','ERROR','IGNORE','DELETED') \"); \n \tsb.append(\"JOIN artwork_generated ag_2 ON al_2.id=ag_2.located_id \");\n \tsb.append(\"WHERE bso_2.boxedset_id=:id \");\n if (\"DESC\".equalsIgnoreCase(artworkSortDir)) {\n \tsb.append(\"ORDER BY ordering DESC, create_timestamp DESC\");\n } else {\n \tsb.append(\"ORDER BY ordering ASC, create_timestamp ASC\");\n }\n \n \tSQLQuery query = currentSession().createSQLQuery(sb.toString());\n \tquery.addScalar(LITERAL_ID, LongType.INSTANCE);\n \tquery.addScalar(LITERAL_SOURCE, StringType.INSTANCE);\n \tquery.addScalar(LITERAL_ARTWORK_ID, LongType.INSTANCE);\n \tquery.addScalar(LITERAL_LOCATED_ID, LongType.INSTANCE);\n \tquery.addScalar(LITERAL_GENERATED_ID, LongType.INSTANCE);\n \tquery.addScalar(LITERAL_ARTWORK_TYPE, StringType.INSTANCE);\n \tquery.addScalar(LITERAL_CACHE_DIR, StringType.INSTANCE);\n \tquery.addScalar(LITERAL_CACHE_FILENAME, StringType.INSTANCE);\n\n \tquery.setLong(LITERAL_ID, boxedSetId);\n \tquery.setString(\"artworkType\", artworkType.name());\n query.setResultTransformer(Transformers.aliasToBean(ApiArtworkDTO.class));\n query.setMaxResults(1); // just the first result\n return query.list();\n }", "@Override\n public BatchOperator linkFrom(List<BatchOperator> ins) {\n return linkFrom(ins.get(0));\n }", "public Set<String> getLinks() throws SearchResultException;", "private ArrayList<ArrayList<Object>> getJoinedIntermediate(List<Table> tables) {\n\t\tArrayList<ArrayList<Object>> rtn = new ArrayList<ArrayList<Object>>(); \n\n\t\ttry {\n\t\t\tfor(int iterator = 0; iterator < tables.size(); iterator++) {\n\t\t\t\tTable table = tables.get(iterator);\n\t\t\t\tif(rtn.isEmpty()) {\t\t\t\t\t\n\t\t\t\t\tArrayList<Tuple> tuples = (ArrayList<Tuple>) table.getTuples();\n\t\t\t\t\tfor(Tuple tuple : tuples) {\n\t\t\t\t\t\tArrayList<Object> objectTuple = new ArrayList<Object>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tField fields[] = tuple.getClass().getDeclaredFields();\n\t\t\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tField field = fields[i];\n\t\t\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\t\t\tobjectTuple.add(field.get(tuple));\n\t\t\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\trtn.add(objectTuple);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint originalTableSize = rtn.size();\n\t\t\t\t\tArrayList<Tuple> tuples = (ArrayList<Tuple>) table.getTuples();\n\t\t\t\t\t\n\t\t\t\t\t// Copy existing tuples for join\n\t\t\t\t\tfor(int j = 0; j < tuples.size() - 1; j++)\n\t\t\t\t\t\tfor(int i = 0; i < originalTableSize; i++)\n\t\t\t\t\t\t\trtn.add(new ArrayList<Object>(rtn.get(i)));\n\t\t\t\t\t\n\t\t\t\t\t// Join\n\t\t\t\t\tfor(int j = 0; j < tuples.size(); j++) {\n\t\t\t\t\t\tTuple tuple = tuples.get(j);\n\t\t\t\t\t\tField fields[] = tuple.getClass().getDeclaredFields();\n\t\t\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tField field = fields[i];\n\t\t\t\t\t\t\tfor(int iter = 0; iter < originalTableSize; iter++) {\n\t\t\t\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\t\t\t\trtn.get(j * originalTableSize + iter).add(field.get(tuple));\n\t\t\t\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (MalformedURLException e)\t{\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t\treturn rtn;\n\t}", "public StringBuilder getLinks(Elements imgs) {\n\t\tStringBuilder links = new StringBuilder();\n\t\tString prefix = \"\";\n\t\tfor (Element item : imgs) {\n\t\t\tlinks.append(prefix);\n\t\t\tprefix = \"|\";\n\t\t\tlinks.append(item.attr(\"href\"));\n }\n\t\treturn links;\n\t}", "public static void link_items(String source_table_name, int id, int[] indexes) throws SQLException{\n\t\tPreparedStatement pstmt=null;\n\t\tConnection conn = Connection_pooling.cpds.getConnection();\n\t\t\n\t\tif(source_table_name.compareTo(\"Actors\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_cinema_actor_movie (actor_id, movie_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"Movies\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_cinema_actor_movie (actor_id, movie_id) VALUES (?,\"+id+\") \");\n\t\tif(source_table_name.compareTo(\"Categories\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_cinema_movie_tag (category_id, movie_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"Artists\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_music_artist_creation (artist_id, creation_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"Creations\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_music_artist_creation (artist_id, creation_id) VALUES (?,\"+id+\") \");\n\t\tif(source_table_name.compareTo(\"Countries\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_places_location_country (country_id, location_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"Locations\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_places_location_country (country_id, location_id) VALUES (?,\"+id+\") \");\n\t\tif(source_table_name.compareTo(\"NBA players\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_nba_player_team (player_id, team_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"NBA teams\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_nba_player_team (player_id, team_id) VALUES (?,\"+id+\") \");\n\t\tif(source_table_name.compareTo(\"Israeli soccer players\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_israeli_soccer_player_team (player_id, team_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"Israeli soccer teams\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_israeli_soccer_player_team (player_id, team_id) VALUES (?,\"+id+\") \");\n\t\tif(source_table_name.compareTo(\"World soccer players\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_world_soccer_player_team (player_id, team_id) VALUES (\"+id+\",?) \");\n\t\tif(source_table_name.compareTo(\"World soccer teams\")==0)\n\t\t\tpstmt = conn.prepareStatement(\"INSERT IGNORE INTO curr_world_soccer_player_team (player_id, team_id) VALUES (?,\"+id+\") \");\n\n\t\tconn.setAutoCommit(false);\n\t\ttry{\n\t\t\texecute_stmt(pstmt, indexes);\n\t\t}catch(SQLException e){\n\t\t\tSystem.out.println(e);\n\t\t\tconn.rollback();\n\t\t}\n\t\tconn.commit();\n\t\tconn.setAutoCommit(true);\n\t\t\n\t\tpstmt.close();\n\t\tconn.close();\n\t}", "private ContributionItem getSrcContribution(ContributionItem item) {\r\n if (item == null) { return null; }\r\n\r\n ContributionDao cDao = DiscourseDbDaoFactory.DEFAULT.getContributionDao();\r\n ContributionItem result = cDao.findBySourceId((Long)item.getId());\r\n return result;\r\n }", "public List<BusinessObject> getItems(Package pkg);", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public static ResultSet getAllItem() {\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT itemID, ownerID, Name, status, description,category,image1,image2,image3,image4 FROM iteminformation\");\n return rs;\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public List<Category> getCategoriesLinkedTo(String link) { \n\t\tlogger.trace(\"getCategoriesLinkedTo\");\n\t\t//\t\tString sql = \"from Link where name Like '%:link%'\";\n\t\tString sql = \"SELECT * FROM Category \"\n\t\t\t\t+ \"WHERE id in (SELECT category FROM Link WHERE name LIKE ?)\";\n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction();\n\n\t\tSQLQuery query = session.createSQLQuery(sql)\n\t\t\t\t.addEntity(Category.class);\n\n\t\tString part = String.format(\"%%%s%%\", link); \n\t\tquery.setParameter(0, part);\n\n\t\tList<Category> categories = query.list();\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\n\t\treturn categories; \n\t}", "public List<ItemsResponse> getListItems(ItemsRequest req) throws DAOException {\n\t\tlogger.debug(\" --- getListItems [ HNotaDAO ] --- \" );\n\t\tlogger.debug(\" --- request : \"+req.toString()+\" --- \" );\n\t\t\n\t\t\n\t\tList<ItemsResponse> lista = null;\n\t\tStringBuilder query = new StringBuilder();\n\n\t\tint limit = req.getLimit();\n\t\tint page = req.getPage();\n\n\t\tif (limit == 0 || page == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tint to = limit * page;\n\t\tint from = (to - limit) + 1;\n\n\t\tquery.append(\" SELECT * FROM (SELECT @rownum:=@rownum+1 rank , q.* \");\n\t\tquery.append(\" \t\tFROM ( SELECT n.FC_ID_CONTENIDO AS id , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_TITULO AS title, \");\n query.append(\" \t\t\t n.FC_CN AS user , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_DESCRIPCION AS description , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FD_FECHA_PUBLICACION AS date , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_ID_TIPO_NOTA AS typeItem, \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_FRIENDLY_URL AS url_item , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_ID_ESTATUS_NOTA AS status , \");\n\t\tquery.append(\" \t\t\t\t\t\tn.FC_IMAGEN_PRINCIPAL AS image , \");\n\t\tquery.append(\" \t\t\t\t\t\tcategoria.FC_ID_CATEGORIA AS idCategories , \");\n\t\tquery.append(\" \t\t\t\t\t\tcategoria.FC_DESCRIPCION AS descCategories, \");\n\t\tquery.append(\" \t\t\t\t\t\tdeporte.FC_DESCRIPCION AS descSport, \");\n\t\tquery.append(\" \t\t\t\t\t\tdeporte.FC_ID_DEPORTE AS idSport \");\n\t\tquery.append(\" \t\t\t\tFROM yog_ba_h_nota n \");\n\t\tquery.append(\" \t\t\t\tLEFT JOIN yog_ba_c_categoria categoria ON n.FC_ID_CATEGORIA = categoria.FC_ID_CATEGORIA \");\n\t\tquery.append(\" \t\t\t\tLEFT JOIN yog_ba_c_deporte deporte ON n.FC_ID_DEPORTE = deporte.FC_ID_DEPORTE \");\n\t\tquery.append(\" \t\t \t\t WHERE 1=1 \");\n\t\t\n\t\tif (req.getType().equals(\"categoria\")) {\n\t\t\tquery.append(\" AND categoria.FC_ID_CATEGORIA = '\" + req.getId() + \"' \");\n\t\t}\n\t\t\n\t\t\n\t\tif (req.getType().equals(\"deporte\")) {\n\t\t\tquery.append(\" AND deporte.FC_ID_DEPORTE = '\" + req.getId() + \"' \");\n\t\t}\n\t\t\n\t\tif (req.getStatus() != null && !req.getStatus().equals(\"\"))\n\t\t\tquery.append(\" AND n.FC_ID_ESTATUS_NOTA = '\" + req.getStatus() + \"' \");\n\n\t\tquery.append(\" ORDER BY FD_FECHA_PUBLICACION DESC ) AS q ,(SELECT @rownum:=0) num ) r \");\n\t\tquery.append(\" WHERE r.rank >= \" + from + \" AND r.rank <= \" + to + \" \");\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\ttry {\n\n\t\t\tlista = jdbcTemplate.query(query.toString(), new BeanPropertyRowMapper<ItemsResponse>(ItemsResponse.class));\n\n\t\t} catch (Exception e) {\n\n\t\t\tlogger.error(\"--- Error getListItems [ HNotaDAO ] :\", e);\n\n\t\t\tthrow new DAOException(e.getMessage());\n\n\t\t}\n\n\t\treturn lista;\n\n\t}", "java.lang.String getQueryItems(int index);", "@Query(\"SELECT item FROM no.ssb.klass.core.model.ReferencingClassificationItem item \"\n + \" INNER JOIN item.level level\"\n + \" INNER JOIN level.statisticalClassification s\"\n + \" WHERE s.deleted = :deleted \"\n + \" AND level.statisticalClassification.classificationVersion = :classification\")\n List<ReferencingClassificationItem> findItemReferences(\n @Param(\"classification\") StatisticalClassification statisticalClassification,\n @Param(\"deleted\") boolean deleted);", "List<NjProductTaticsRelation> selectByExample(NjProductTaticsRelationExample example);", "List<TempletLink> selectByExample(TempletLinkExample example);", "public void linkRecords();", "public List<NewsItem> getNewsItemDataFromDB() throws SQLException;", "String getSourcesfromUniqueEndpoit(String graph);", "public ArrayList bteqBridge(List sqlList, String fileName) throws MDSException {\r\n\r\n\t\tsqlNum = sqlList.size();\r\n\r\n\t\t// PropertiesLoader bootProps;\r\n\t\t// try {\r\n\t\t// bootProps = PropertiesLoader.getLoader(\"tap.properties\");\r\n\t\t// String limit = bootProps.getProperty(\"SQL_NUM_LIMIT\");\r\n\t\t// if ( limit != null && limit.length() >0 )\r\n\t\t// sql_num_limit = Integer.parseInt(limit);\r\n\t\t// else\r\n\t\t// sql_num_limit = 100000;\r\n\t\t// } catch (Exception e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\tsql_num_limit = 100000; // modified by MarkDong\r\n\r\n\t\tint pos = fileName.indexOf(\".log\");\r\n\t\tif (pos > 0)\r\n\t\t\tfileName = fileName.substring(0, pos);\r\n\t\tString scriptID = getScriptID(fileName);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < sqlList.size(); i++) {\r\n\t\t\t\tArrayList sourceTables = new ArrayList();\r\n\t\t\t\tsqlIndex = i;\r\n\t\t\t\tString sql = (String) sqlList.get(i);\r\n\t\t\t\tSQL parser = new SQL(getStream(sql));\r\n\t\t\t\tStatementTree statement;\r\n\t\t\t\tstatement = parser.Statement();\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.Select\")) {\r\n\t\t\t\t\tparseSelect(statement);\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.Delete\")) {\r\n\t\t\t\t\tparseDelete(statement);\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.Insert\")) {\r\n\t\t\t\t\tsourceTables = parseInsert(statement);\r\n\t\t\t\t\tif (sourceTables == null) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (int t = 0; t < sourceTables.size(); t++) {\r\n\t\t\t\t\t\tHashMap resultTable = (HashMap) sourceTables.get(t);\r\n\t\t\t\t\t\tString targetTable = (String) resultTable.get(\"targetTable\");\r\n\t\t\t\t\t\tString sourceTable = (String) resultTable.get(\"sourceTable\");\r\n\t\t\t\t\t\t// System.out.println(targetTable + \" \" + sourceTable + \" \" + expression);\r\n\r\n\t\t\t\t\t\tString[] target = targetTable.split(\"\\\\.\");\r\n\t\t\t\t\t\tString[] source = sourceTable.split(\"\\\\.\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// target table info\r\n\t\t\t\t\t\t\tMDSDbVO targetUnit = getUnitObject(target[0], target[1]);\r\n\t\t\t\t\t\t\tString targetGlobalID = targetUnit.getMETA_GLOBAL_ID();\r\n\t\t\t\t\t\t\t// source table info\r\n\t\t\t\t\t\t\tMDSDbVO sourceUnit = getUnitObject(source[0], source[1]);\r\n\t\t\t\t\t\t\tString globalID = sourceUnit.getMETA_GLOBAL_ID();\r\n\r\n\t\t\t\t\t\t\t// relation type and comment\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t * String commentID = (String) resultTable.get(\"expression\"); String relationComm =\r\n\t\t\t\t\t\t\t * commentID; if ( sqlNum > sql_num_limit ) relationComm = getComment(commentID);\r\n\t\t\t\t\t\t\t */\r\n\t\t\t\t\t\t\tString relationID = \"13\";\r\n\r\n\t\t\t\t\t\t\taddRelation(globalID\r\n\t\t\t\t\t\t\t\t\t , targetGlobalID\r\n\t\t\t\t\t\t\t\t\t , \"\"\r\n\t\t\t\t\t\t\t\t\t , relationID\r\n\t\t\t\t\t\t\t\t\t , \"1\"\r\n\t\t\t\t\t\t\t\t\t , scriptID,fileName);\r\n\r\n\t\t\t\t\t\t} catch (MDSException e) {\r\n\t\t\t\t\t\t\t// logger.error(e.getMessage());\r\n\t\t\t\t\t\t\tthrow new MDSException(e);\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t// logger.error(e.getMessage());\r\n\t\t\t\t\t\t\tthrow new MDSException(\"table : \" + sourceTable + \" or table: \" + targetTable\r\n\t\t\t\t\t\t\t\t\t+ \" without database reference!\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.ViewManager\")) {\r\n\t\t\t\t\tsourceTables = parseCreateView(statement, fileName);\r\n\t\t\t\t\tif (sourceTables == null) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (int t = 0; t < sourceTables.size(); t++) {\r\n\t\t\t\t\t\tHashMap resultTable = (HashMap) sourceTables.get(t);\r\n\t\t\t\t\t\tString targetTable = (String) resultTable.get(\"targetTable\");\r\n\t\t\t\t\t\tString sourceTable = (String) resultTable.get(\"sourceTable\");\r\n\t\t\t\t\t\tString[] target = targetTable.split(\"\\\\.\");\r\n\t\t\t\t\t\tString[] source = sourceTable.split(\"\\\\.\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// target table info\r\n\t\t\t\t\t\t\tMDSDbVO targetUnit = getUnitObject(target[0], target[1]);\r\n\t\t\t\t\t\t\tString targetGlobalID = targetUnit.getMETA_GLOBAL_ID();\r\n\t\t\t\t\t\t\t// source table info\r\n\t\t\t\t\t\t\tMDSDbVO sourceUnit = getUnitObject(source[0], source[1]);\r\n\t\t\t\t\t\t\tString globalID = sourceUnit.getMETA_GLOBAL_ID();\r\n\r\n\t\t\t\t\t\t\tString relationID = \"13\";\r\n\t\t\t\t\t\t\t//String relSrcID = getObjID(fileName, target[1]);\r\n\t\t\t\t\t\t\tString relSrcID = getObjID(target[0], target[1]);\t//edit by markdong\r\n\t\t\t\t\t\t\taddRelation(globalID, targetGlobalID, \"\", relationID, \"1\", relSrcID, targetTable);\r\n\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t// logger.error(e.getMessage());\r\n\t\t\t\t\t\t\tthrow new MDSException(\"table : \" + source[0] + \" OR table : \" + target[0]\r\n\t\t\t\t\t\t\t\t\t+ \" without database reference!\", e);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.CreateTable\")) {\r\n\t\t\t\t\t// get all volitale tables\r\n\t\t\t\t\tHashMap tableInfo = parseCreateTable(statement);\r\n\t\t\t\t\tif (tableInfo == null) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBoolean ifVolitale = (Boolean) tableInfo.get(\"volatile\");\r\n\t\t\t\t\tif (ifVolitale.booleanValue())\r\n\t\t\t\t\t\tvolatileTableList.add(tableInfo);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcommonTableList.add(tableInfo);\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.UpdateTable\")) {\r\n\t\t\t\t\tparseUpdate(statement);\r\n\t\t\t\t}\r\n\t\t\t\tif (statement.getClassName().equals(\"com.teradata.sqlparser.interpret.AlterTable\"))\r\n\t\t\t\t\tparseAlterTable(statement);\r\n\t\t\t\tif (sourceTables != null)\r\n\t\t\t\t\tsourceTables.clear();\r\n\t\t\t\tparser = null;\r\n\t\t\t\tstatement = null;\r\n\t\t\t}\r\n\t\t} catch (Throwable e) {\r\n\t\t\tthrow new MDSException(fileName + \" parse error\", e);\r\n\t\t}\r\n\t\treturn this.insertArray;\r\n\t}", "@Override\n public ArrayList<SamleImageDetails> getSampleImageLinks(String orinNo) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null;\n Transaction tx = session.beginTransaction();\n query = session.createSQLQuery(xqueryConstants.getSampleImageLinks());\n query.setParameter(\"orinNo\", orinNo); \n query.setFetchSize(10);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \t//Null check\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setImageLocation(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setImageLocation(\"\");\n \t}\n \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \t\n \tif(row[5] !=null){\n \t\t\n \t\tif(row[5].toString().equalsIgnoreCase(\"ReadyForReview\") || row[5].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[5].toString().contains(\"Ready_\")){\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"Link Status is null\");\n \t\tsampleImage.setLinkStatus(\"Initiated\");\n \t}\n \t\n \t\n \t\n \tif(row[6] !=null){\n \t\t\n \t\tif(row[6].toString().equalsIgnoreCase(\"Ready_For_Review\") || row[6].toString().contains(\"Ready_\")){\n \t\t\tLOGGER.info(\"if condtion ReadyForReview \");\n \t\t\tsampleImage.setImageStatus(\"ReadyForReview\");\n \t\t}else{\n \t\t\t\n \t\t\tsampleImage.setImageStatus(row[6]!=null?row[6].toString():null);\n \t\t} \t\t\n \t}else{\n \t\tLOGGER.info(\"imageStatus as----null in DAO \");\n \t\tsampleImage.setImageStatus(\"Initiated\");\n \t}\n \t\n \tif(row[7] !=null){\n \t\tsampleImage.setImageSampleId(row[7]!=null?row[7].toString():null);\n \t}else {\n \t\tsampleImage.setImageSampleId(\"\");\n \t}\n \tsampleImage.setImageSamleReceived(row[8]!=null?row[8].toString():null);\n \tsampleImage.setImageSilhouette(row[9]!=null?row[9].toString():null);\n \tif(row[10] !=null){\n \t\tsampleImage.setTiDate(row[10]!=null?row[10].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setTiDate(\"\");\n \t}\n \tif(row[11] !=null){\n \t\tsampleImage.setSampleCoordinatorNote(row[11]!=null?row[11].toString():null);\n \t}else {\n \t\t\n \t\tsampleImage.setSampleCoordinatorNote(\"\");\n \t} \t\n \tsampleImgList.add(sampleImage);\n \t\n \t//RejectCode\n \tif(row[13] !=null && row[14] !=null && row[15] !=null){\n \t\tsampleImage.setRejectCode(row[13].toString());\n \t\tsampleImage.setRejectReason(row[14].toString());\n\n \t\tString rejectionTimeStamp = StringUtils.replace(row[15].toString(),\"T\",\" \");\n \t\tString formattedTimeStamp = StringUtils.substringBeforeLast(rejectionTimeStamp, \"-\");\n \t\tsampleImage.setRejectionTimestamp(formattedTimeStamp);\n \t} \n }\n }catch(Exception e){\n \te.printStackTrace();\n }\n finally{\n \ttx.commit(); \t\n \tsession.close();\n }\n \t\n \t\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "public void populateMedia(List<Drop> drops, Account queryingAccount) {\n \n \t\tMap<Long, Integer> dropIndex = new HashMap<Long, Integer>();\n \t\tint i = 0;\n \t\tfor (Drop drop : drops) {\n \t\t\tdropIndex.put(drop.getId(), i);\n \t\t\ti++;\n \t\t}\n \n \t\tString sql = \"SELECT `droplet_id`, `media`.`id` AS `id`, `media`.`url` AS `url`, `type`, `media_thumbnails`.`size` AS `thumbnail_size`, `media_thumbnails`.`url` AS `thumbnail_url` \";\n \t\tsql += \"FROM `droplets_media` \";\n \t\tsql += \"INNER JOIN `media` ON (`media`.`id` = `media_id`) \";\n \t\tsql += \"LEFT JOIN `media_thumbnails` ON (`media_thumbnails`.`media_id` = `media`.`id`) \";\n \t\tsql += \"WHERE `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `media`.`id` NOT IN ( \";\n \t\tsql += \"SELECT `media_id` \";\n \t\tsql += \"FROM `account_droplet_media` \";\n \t\tsql += \"WHERE `account_id` = :account_id \";\n \t\tsql += \"AND `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `deleted` = 1) \";\n \t\tsql += \"UNION ALL \";\n \t\tsql += \"SELECT `droplet_id`, `media`.`id` AS `id`, `media`.`url` AS `url`, `type`, `media_thumbnails`.`size` AS `thumbnail_size`, `media_thumbnails`.`url` AS `thumbnail_url` \";\n \t\tsql += \"FROM `account_droplet_media` \";\n \t\tsql += \"INNER JOIN `media` ON (`media`.`id` = `media_id`) \";\n \t\tsql += \"LEFT JOIN `media_thumbnails` ON (`media_thumbnails`.`media_id` = `media`.`id`) \";\n \t\tsql += \"WHERE `droplet_id` IN :drop_ids \";\n \t\tsql += \"AND `account_id` = :account_id \";\n \t\tsql += \"AND `deleted` = 0; \";\n \n \t\tQuery query = em.createNativeQuery(sql);\n \t\tquery.setParameter(\"drop_ids\", dropIndex.keySet());\n \t\tquery.setParameter(\"account_id\", queryingAccount.getId());\n \n \t\t// Group the media by drop id\n \t\tMap<Long, Media> media = new HashMap<Long, Media>();\n \t\tfor (Object oRow : query.getResultList()) {\n \t\t\tObject[] r = (Object[]) oRow;\n \n \t\t\tLong dropId = ((BigInteger) r[0]).longValue();\n \t\t\tDrop drop = drops.get(dropIndex.get(dropId));\n \t\t\tif (drop.getMedia() == null) {\n \t\t\t\tdrop.setMedia(new ArrayList<Media>());\n \t\t\t}\n \t\t\n \t\t\tLong mediaId = ((BigInteger) r[1]).longValue();\n \t\t\tMedia m = media.get(mediaId);\n \t\t\t\n \t\t\tif (m == null) {\n \t\t\t\tm = new Media();\n \t\t\t\tm.setId(mediaId);\n \t\t\t\tm.setUrl((String) r[2]);\n \t\t\t\tm.setType((String) r[3]);\n \t\t\t\tmedia.put(mediaId, m);\n \t\t\t} \n \t\t\t\n \t\t\t// Add thumbnails\n \t\t\tif (r[4] != null) {\n \t\t\t\tMediaThumbnail mt = new MediaThumbnail();\n \t\t\t\tmt.setMedia(m);\n \t\t\t\tmt.setSize((Integer)r[4]);\n \t\t\t\tmt.setUrl((String)r[5]);\n \t\t\t\t\n \t\t\t\tList<MediaThumbnail> thumbnails = m.getThumbnails();\n \t\t\t\tif (thumbnails == null) {\n \t\t\t\t\tthumbnails = new ArrayList<MediaThumbnail>();\n \t\t\t\t\tm.setThumbnails(thumbnails);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tthumbnails.add(mt);\n \t\t\t}\n \t\t\t\n \t\t\t// Add media to drop\n \t\t\tif (!drop.getMedia().contains(m)) {\n \t\t\t\tdrop.getMedia().add(m);\n \t\t\t}\n \t\t}\n \t}", "@Override\n public ArrayList<SamleImageDetails> getGroupingSampleImageLinks(String groupingId) throws PEPPersistencyException{\n \tLOGGER.info(\"inside getSampleImageLinksDetails()dao impl\");\n \tList<SamleImageDetails> sampleImgList = new ArrayList<SamleImageDetails>();\n \tSession session = this.sessionFactory.openSession();\n Query query = null; \n query = session.createSQLQuery(xqueryConstants.getGroupingSampleImageLinks());\n query.setParameter(0, groupingId); \n query.setFetchSize(1);\n List<Object[]> rows = query.list();\n try{\n for(Object[] row : rows){ \t\n \tSamleImageDetails sampleImage = new SamleImageDetails(); \t\n \tsampleImage.setOrinNo(row[0]!=null?row[0].toString():null);\n \tsampleImage.setImageId(row[1]!=null?row[1].toString():null);\n \tif(row[2]!=null){\n \t\tsampleImage.setImageName(row[2]!=null?row[2].toString():null);\n \t}else {\n \t\tsampleImage.setImageName(\"\");\n \t}\n \tif(row[3] !=null){\n \t\tsampleImage.setOriginalImageName(row[3]!=null?row[3].toString():null);\n \t}else{\n \t\tsampleImage.setOriginalImageName(\"\");\n \t} \t\n \tsampleImage.setImageShotType(row[4]!=null?row[4].toString():null);\n \tif(row[5] !=null){\n \t\t\tsampleImage.setLinkStatus(row[5]!=null?row[5].toString():null);\n \t\t \t\t\n \t}\n \tif(row[7] !=null){ \t\t\t\n \t\t\tsampleImage.setImageStatus(row[7]!=null?row[7].toString():null);\n \t} \n \t\n \tsampleImgList.add(sampleImage);\n }\n }catch(Exception e){\n \tLOGGER.error(\"inside getGroupingSampleImageLinks \",e);\n \te.printStackTrace();\n }\n finally{ \n \t session.close();\n }\n \treturn (ArrayList<SamleImageDetails>) sampleImgList; \n \t\n }", "private List<FollowItem> query(String sql)\r\n {\r\n DbManager db=new DbManager();\r\n ResultSet rs=null;\r\n List<FollowItem> list=new ArrayList<FollowItem>();\r\n rs = db.getRs(sql);\r\n try {\r\n while(rs.next())\r\n {\r\n FollowItem followItem = new FollowItem();\r\n followItem.setUserId(rs.getInt(\"UserID\"));\r\n followItem.setListingId(rs.getInt(\"ListingID\"));\r\n \r\n list.add(followItem);\r\n }\r\n } catch (SQLException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n } finally{\r\n db.destory();\r\n }\r\n return list;\r\n }", "private DataSourceInstanceItem getSrcDataSourceInstance(DataSourceInstanceItem item) {\r\n if (item == null) { return null; }\r\n\r\n DataSourceInstanceDao dsiDao = DiscourseDbDaoFactory.DEFAULT.getDataSourceInstanceDao();\r\n DataSourceInstanceItem result = dsiDao.findBySourceId((Long)item.getId());\r\n return result;\r\n }", "protected java.util.Vector _getLinks() {\n\tjava.util.Vector links = new java.util.Vector();\n\tlinks.addElement(getPeopleLink());\n\tlinks.addElement(getChangeLogDetailsesLink());\n\treturn links;\n}", "public String getQuickLinksAndNotes(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String secondLevelLinkTitle, List[] secondLevelOfLinks, String quickNote, HttpSession session)\n/* */ {\n/* 456 */ StringBuffer out = new StringBuffer();\n/* 457 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 458 */ if ((quickLinkText != null) && (quickLink != null) && (quickLinkText.size() == quickLink.size()))\n/* */ {\n/* 460 */ out.append(\"<tr>\");\n/* 461 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + quickLinkHeader + \"d,.mfnjh.mdfnh.m,dfnh,.dfmn</td>\");\n/* 462 */ out.append(\"</tr>\");\n/* */ \n/* */ \n/* 465 */ for (int i = 0; i < quickLinkText.size(); i++)\n/* */ {\n/* 467 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 470 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 472 */ out.append(\"<tr>\");\n/* */ \n/* 474 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 475 */ out.append(\"<a href=\\\"\" + (String)quickLink.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)quickLinkText.get(i) + \"</a></td>\");\n/* 476 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 482 */ out.append(\"</table><br>\");\n/* 483 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 484 */ if ((secondLevelOfLinks != null) && (secondLevelLinkTitle != null))\n/* */ {\n/* 486 */ List sLinks = secondLevelOfLinks[0];\n/* 487 */ List sText = secondLevelOfLinks[1];\n/* 488 */ if ((sText != null) && (sLinks != null) && (sLinks.size() == sText.size()))\n/* */ {\n/* */ \n/* 491 */ out.append(\"<tr>\");\n/* 492 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + secondLevelLinkTitle + \"</td>\");\n/* 493 */ out.append(\"</tr>\");\n/* 494 */ for (int i = 0; i < sText.size(); i++)\n/* */ {\n/* 496 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 499 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 501 */ out.append(\"<tr>\");\n/* */ \n/* 503 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 504 */ if (sLinks.get(i).toString().length() == 0) {\n/* 505 */ out.append((String)sText.get(i) + \"</td>\");\n/* */ }\n/* */ else {\n/* 508 */ out.append(\"<a href=\\\"\" + (String)sLinks.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)sText.get(i) + \"</a></td>\");\n/* */ }\n/* 510 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ }\n/* 514 */ out.append(\"</table>\");\n/* 515 */ return out.toString();\n/* */ }", "public String getQuickLinksAndNotes(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String secondLevelLinkTitle, List[] secondLevelOfLinks, String quickNote, HttpSession session)\n/* */ {\n/* 459 */ StringBuffer out = new StringBuffer();\n/* 460 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 461 */ if ((quickLinkText != null) && (quickLink != null) && (quickLinkText.size() == quickLink.size()))\n/* */ {\n/* 463 */ out.append(\"<tr>\");\n/* 464 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + quickLinkHeader + \"d,.mfnjh.mdfnh.m,dfnh,.dfmn</td>\");\n/* 465 */ out.append(\"</tr>\");\n/* */ \n/* */ \n/* 468 */ for (int i = 0; i < quickLinkText.size(); i++)\n/* */ {\n/* 470 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 473 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 475 */ out.append(\"<tr>\");\n/* */ \n/* 477 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 478 */ out.append(\"<a href=\\\"\" + (String)quickLink.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)quickLinkText.get(i) + \"</a></td>\");\n/* 479 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 485 */ out.append(\"</table><br>\");\n/* 486 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 487 */ if ((secondLevelOfLinks != null) && (secondLevelLinkTitle != null))\n/* */ {\n/* 489 */ List sLinks = secondLevelOfLinks[0];\n/* 490 */ List sText = secondLevelOfLinks[1];\n/* 491 */ if ((sText != null) && (sLinks != null) && (sLinks.size() == sText.size()))\n/* */ {\n/* */ \n/* 494 */ out.append(\"<tr>\");\n/* 495 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + secondLevelLinkTitle + \"</td>\");\n/* 496 */ out.append(\"</tr>\");\n/* 497 */ for (int i = 0; i < sText.size(); i++)\n/* */ {\n/* 499 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 502 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 504 */ out.append(\"<tr>\");\n/* */ \n/* 506 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 507 */ if (sLinks.get(i).toString().length() == 0) {\n/* 508 */ out.append((String)sText.get(i) + \"</td>\");\n/* */ }\n/* */ else {\n/* 511 */ out.append(\"<a href=\\\"\" + (String)sLinks.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)sText.get(i) + \"</a></td>\");\n/* */ }\n/* 513 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ }\n/* 517 */ out.append(\"</table>\");\n/* 518 */ return out.toString();\n/* */ }", "public String getAllSources(Attribute attr){\r\n\t\tString allSources = attr.getSource();\r\n\t\tfor(Attribute curAttr: valInstances) {\r\n\t\t\tif(attr.getName().equals(curAttr.getName()) && attr.getVal().equals(curAttr.getVal())) {\r\n\t\t\t\tif(!allSources.contains(curAttr.getSource())){\r\n\t\t\t\t\tallSources += \",\" + curAttr.getSource();\r\n\t\t\t\t}\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\treturn allSources;\r\n\t}", "public List<PropertyImages> findWhereSrcUrlEquals(String srcUrl) throws PropertyImagesDaoException\n\t{\n\t\ttry {\n\t\t\treturn getJdbcTemplate().query(\"SELECT ID, TITLE, TYPE, SIZE, SRC_URL, PROPERTY_DATA_UUID FROM \" + getTableName() + \" WHERE SRC_URL = ? ORDER BY SRC_URL\", this,srcUrl);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new PropertyImagesDaoException(\"Query failed\", e);\n\t\t}\n\t\t\n\t}", "public String getQuickLinksAndNotes(String quickLinkHeader, ArrayList quickLinkText, ArrayList quickLink, String secondLevelLinkTitle, List[] secondLevelOfLinks, String quickNote, HttpSession session)\n/* */ {\n/* 465 */ StringBuffer out = new StringBuffer();\n/* 466 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 467 */ if ((quickLinkText != null) && (quickLink != null) && (quickLinkText.size() == quickLink.size()))\n/* */ {\n/* 469 */ out.append(\"<tr>\");\n/* 470 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + quickLinkHeader + \"d,.mfnjh.mdfnh.m,dfnh,.dfmn</td>\");\n/* 471 */ out.append(\"</tr>\");\n/* */ \n/* */ \n/* 474 */ for (int i = 0; i < quickLinkText.size(); i++)\n/* */ {\n/* 476 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 479 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 481 */ out.append(\"<tr>\");\n/* */ \n/* 483 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 484 */ out.append(\"<a href=\\\"\" + (String)quickLink.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)quickLinkText.get(i) + \"</a></td>\");\n/* 485 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 491 */ out.append(\"</table><br>\");\n/* 492 */ out.append(\"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" class=\\\"leftmnutables\\\">\");\n/* 493 */ if ((secondLevelOfLinks != null) && (secondLevelLinkTitle != null))\n/* */ {\n/* 495 */ List sLinks = secondLevelOfLinks[0];\n/* 496 */ List sText = secondLevelOfLinks[1];\n/* 497 */ if ((sText != null) && (sLinks != null) && (sLinks.size() == sText.size()))\n/* */ {\n/* */ \n/* 500 */ out.append(\"<tr>\");\n/* 501 */ out.append(\"<td class=\\\"leftlinksheading\\\">\" + secondLevelLinkTitle + \"</td>\");\n/* 502 */ out.append(\"</tr>\");\n/* 503 */ for (int i = 0; i < sText.size(); i++)\n/* */ {\n/* 505 */ String borderclass = \"\";\n/* */ \n/* */ \n/* 508 */ borderclass = \"class=\\\"leftlinkstd\\\"\";\n/* */ \n/* 510 */ out.append(\"<tr>\");\n/* */ \n/* 512 */ out.append(\"<td width=\\\"81%\\\" height=\\\"21\\\" \" + borderclass + \">\");\n/* 513 */ if (sLinks.get(i).toString().length() == 0) {\n/* 514 */ out.append((String)sText.get(i) + \"</td>\");\n/* */ }\n/* */ else {\n/* 517 */ out.append(\"<a href=\\\"\" + (String)sLinks.get(i) + \"\\\" class=\\\"staticlinks\\\">\" + (String)sText.get(i) + \"</a></td>\");\n/* */ }\n/* 519 */ out.append(\"</tr>\");\n/* */ }\n/* */ }\n/* */ }\n/* 523 */ out.append(\"</table>\");\n/* 524 */ return out.toString();\n/* */ }", "String getLink();", "public List<cn.edu.kmust.flst.domain.flst.tables.pojos.Article> fetchByArticleSourcesLink(String... values) {\n return fetch(Article.ARTICLE.ARTICLE_SOURCES_LINK, values);\n }", "public java.util.List<Integer>\n getSrcIdList() {\n return java.util.Collections.unmodifiableList(\n instance.getSrcIdList());\n }", "@Override\r\n public List<Link> getLinks(Turn inTurn, Player inPlayer) throws Exception\r\n {\r\n return getGameState().getLinkList();\r\n }", "@Override\n public List<Community> getCommunities(Context context, Item item) throws SQLException\n {\n List<Community> result = new ArrayList<Community>();\n List<Collection> collections = item.getCollections();\n for(Collection collection : collections)\n {\n List<Community> owningCommunities = collection.getCommunities();\n for (Community community : owningCommunities) {\n result.add(community);\n result.addAll(communityService.getAllParents(context, community));\n }\n }\n\n return result;\n }", "public void loadTag(){ \n\t\t try {\n\n\t\t\t\tConnection con = DBConnection.connect();\n\n\t\t\t\tString query=\"select * from Tag \";\n\t\t\t\tPreparedStatement pst=con.prepareStatement(query);\n\t\t\t\tResultSet rs=pst.executeQuery();\n\t\t\t\t\n\t\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tString name =rs.getString(\"relatedtag\");\n\t\t\t\t\ttag.addItem(name);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tcon.close();\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n}", "public List<Link> getLinks()\t{return Collections.unmodifiableList(allLinks);}", "java.lang.String getAssociatedSource();", "@Test\n\tpublic void testGetLinksNoLinks() {\n\t\tList<String> results = helper.getLinks(\"Robert'); DROP TABLE Students;--\", null);\n\t\tassertTrue(results.isEmpty());\n\t}", "private Long getPollsSocialNetworkLinksByTag(final String tagName,\n final Integer initResults, final Integer maxResults,\n final TypeSearchResult filter) {\n Long linksbyItem = 0L;\n Long totalLinksByPoll = 0L;\n \n final List<Poll> polls = this.getPollsByHashTag(tagName, initResults,\n maxResults, filter);\n for (Poll poll : polls) {\n linksbyItem = getTweetPollDao().getSocialLinksByType(null, null,\n poll, TypeSearchResult.POLL);\n totalLinksByPoll = totalLinksByPoll + linksbyItem;\n }\n return totalLinksByPoll;\n }", "@Override\n\tpublic ArrayList<String> getLinks() {\n\t\treturn this.description.getLinks();\n\t}", "void doNestedNaturalJoin(WorkflowExpressionQuery e, NestedExpression nestedExpression, StringBuffer columns, StringBuffer where, StringBuffer whereComp, List values, List queries, StringBuffer orderBy) { // throws WorkflowStoreException {\n\n Object value;\n Field currentExpField;\n\n int numberOfExp = nestedExpression.getExpressionCount();\n\n for (int i = 0; i < numberOfExp; i++) { //ori\n\n //for (i = numberOfExp; i > 0; i--) { //reverse 1 of 3\n Expression expression = nestedExpression.getExpression(i); //ori\n\n //Expression expression = nestedExpression.getExpression(i - 1); //reverse 2 of 3\n if (!(expression.isNested())) {\n FieldExpression fieldExp = (FieldExpression) expression;\n\n FieldExpression fieldExpBeforeCurrent;\n queries.add(expression);\n\n int queryId = queries.size();\n\n if (queryId > 1) {\n columns.append(\" , \");\n }\n\n //do; OS_CURRENTSTEP AS a1 ....\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n columns.append(currentTable + \" AS \" + 'a' + queryId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n columns.append(historyTable + \" AS \" + 'a' + queryId);\n } else {\n columns.append(entryTable + \" AS \" + 'a' + queryId);\n }\n\n ///////// beginning of WHERE JOINS/s : //////////////////////////////////////////\n //do for first query; a1.ENTRY_ID = a1.ENTRY_ID\n if (queryId == 1) {\n where.append(\"a1\" + '.' + stepProcessId);\n where.append(\" = \");\n\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else {\n where.append(\"a\" + queryId + '.' + entryId);\n }\n }\n\n //do; a1.ENTRY_ID = a2.ENTRY_ID\n if (queryId > 1) {\n fieldExpBeforeCurrent = (FieldExpression) queries.get(queryId - 2);\n\n if (fieldExpBeforeCurrent.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + (queryId - 1) + '.' + stepProcessId);\n } else if (fieldExpBeforeCurrent.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + (queryId - 1) + '.' + stepProcessId);\n } else {\n where.append(\"a\" + (queryId - 1) + '.' + entryId);\n }\n\n where.append(\" = \");\n\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else {\n where.append(\"a\" + queryId + '.' + entryId);\n }\n }\n\n ///////// end of LEFT JOIN : \"LEFT JOIN OS_CURRENTSTEP a1 ON a0.ENTRY_ID = a1.ENTRY_ID\n //\n //////// BEGINNING OF WHERE clause //////////////////////////////////////////////////\n value = fieldExp.getValue();\n currentExpField = fieldExp.getField();\n\n //if the Expression is negated and FieldExpression is \"EQUALS\", we need to negate that FieldExpression\n if (expression.isNegate()) {\n //do ; a2.STATUS !=\n whereComp.append(\"a\" + queryId + '.' + fieldName(fieldExp.getField()));\n\n switch (fieldExp.getOperator()) { //WHERE a1.STATUS !=\n case EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS NOT \");\n } else {\n whereComp.append(\" != \");\n }\n\n break;\n\n case NOT_EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS \");\n } else {\n whereComp.append(\" = \");\n }\n\n break;\n\n case GT:\n whereComp.append(\" < \");\n\n break;\n\n case LT:\n whereComp.append(\" > \");\n\n break;\n\n default:\n whereComp.append(\" != \");\n\n break;\n }\n\n switch (currentExpField) {\n case START_DATE:\n case FINISH_DATE:\n values.add(new Timestamp(((java.util.Date) value).getTime()));\n\n break;\n\n default:\n\n if (value == null) {\n values.add(null);\n } else {\n values.add(value);\n }\n\n break;\n }\n } else {\n //do; a1.OWNER =\n whereComp.append(\"a\" + queryId + '.' + fieldName(fieldExp.getField()));\n\n switch (fieldExp.getOperator()) { //WHERE a2.FINISH_DATE <\n case EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS \");\n } else {\n whereComp.append(\" = \");\n }\n\n break;\n\n case NOT_EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS NOT \");\n } else {\n whereComp.append(\" <> \");\n }\n\n break;\n\n case GT:\n whereComp.append(\" > \");\n\n break;\n\n case LT:\n whereComp.append(\" < \");\n\n break;\n\n default:\n whereComp.append(\" = \");\n\n break;\n }\n\n switch (currentExpField) {\n case START_DATE:\n case FINISH_DATE:\n values.add(new Timestamp(((java.util.Date) value).getTime()));\n\n break;\n\n default:\n\n if (value == null) {\n values.add(null);\n } else {\n values.add(value);\n }\n\n break;\n }\n }\n\n //do; a1.OWNER = ? ... a2.STATUS != ?\n whereComp.append(\" ? \");\n\n //////// END OF WHERE clause////////////////////////////////////////////////////////////\n if ((e.getSortOrder() != WorkflowExpressionQuery.SORT_NONE) && (e.getOrderBy() != null)) {\n // System.out.println(\"ORDER BY ; queries.size() : \" + queries.size());\n orderBy.append(\" ORDER BY \");\n orderBy.append(\"a1\" + '.' + fieldName(e.getOrderBy()));\n\n if (e.getSortOrder() == WorkflowExpressionQuery.SORT_ASC) {\n orderBy.append(\" ASC\");\n } else if (e.getSortOrder() == WorkflowExpressionQuery.SORT_DESC) {\n orderBy.append(\" DESC\");\n }\n }\n } else {\n NestedExpression nestedExp = (NestedExpression) expression;\n\n where.append('(');\n\n doNestedNaturalJoin(e, nestedExp, columns, where, whereComp, values, queries, orderBy);\n\n where.append(')');\n }\n\n //add AND or OR clause between the queries\n if (i < (numberOfExp - 1)) { //ori\n\n //if (i > 1) { //reverse 3 of 3\n if (nestedExpression.getExpressionOperator() == LogicalOperator.AND) {\n where.append(\" AND \");\n whereComp.append(\" AND \");\n } else {\n where.append(\" OR \");\n whereComp.append(\" OR \");\n }\n }\n }\n }", "@Override\n public List<ImageLinkVO> getGroupingScene7ImageLinks(String groupingId) throws PEPPersistencyException {\n\n LOGGER.info(\"***Entering getScene7ImageLinks() method in ImageRequestDAOImpl.\");\n Session session = null; \n List<ImageLinkVO> imageLinkVOList = new ArrayList<ImageLinkVO>();\n ImageLinkVO imageLinkVO = null;\n List<Object[]> rows=null;\n final XqueryConstants xqueryConstants = new XqueryConstants();\n try {\n session = sessionFactory.openSession(); \n final Query query =session.createSQLQuery(xqueryConstants.getGroupingScene7ImageLinks());\n if(query!=null)\n {\n query.setParameter(0, groupingId); \n rows = query.list();\n }\n if(rows!=null)\n {\n for (final Object[] row : rows) {\n \timageLinkVO = new ImageLinkVO();\n \tif(row[1]!=null){\n \timageLinkVO.setOrin(row[0] == null? \"\" : row[0].toString());\n \timageLinkVO.setShotType(row[4] == null? \"\" : row[4].toString());\n \timageLinkVO.setImageURL(row[1] == null? \"\" : row[1].toString());\n \timageLinkVO.setSwatchURL(row[2] == null? \"\" : row[2].toString());\n \timageLinkVO.setViewURL(row[3] == null? \"\" : row[3].toString()); \n \t}\n \n LOGGER.debug(\"Image Link Attribute Values -- \\nORIN: \" + imageLinkVO.getOrin() +\n \"\\nSHOT TYPE: \" + imageLinkVO.getShotType() +\n \"\\nIMAGE URL: \" + imageLinkVO.getImageURL() + \n \"\\nSWATCH URL: \" + imageLinkVO.getSwatchURL() + \n \"\\nVIEW URL: \" + imageLinkVO.getViewURL());\n \n imageLinkVOList.add(imageLinkVO);\n }\n }\n }\n catch(final Exception e){\n LOGGER.error(\"Exception in getGroupingScene7ImageLinks() method DAO layer. -- \",e);\n throw new PEPPersistencyException(e);\n }\n finally { \n session.close();\n }\n LOGGER.info(\"***Exiting ImageRequestDAO.getScene7ImageLinks() method.\");\n return imageLinkVOList;\n }", "java.util.List<io.opencannabis.schema.commerce.OrderItem.Item> \n getItemList();" ]
[ "0.5966777", "0.5603953", "0.56005883", "0.5583014", "0.5396764", "0.5344889", "0.53049093", "0.5298165", "0.5296125", "0.5266826", "0.5220836", "0.51827216", "0.51691204", "0.51685786", "0.51660323", "0.515454", "0.50980985", "0.5090644", "0.5080115", "0.50573933", "0.50421286", "0.5012517", "0.49963623", "0.49869084", "0.49773857", "0.49368918", "0.4924106", "0.49084195", "0.49009156", "0.4900901", "0.4884269", "0.48809952", "0.48459023", "0.48413923", "0.4840981", "0.48395607", "0.4831575", "0.48236644", "0.47912845", "0.47790614", "0.47688368", "0.47649476", "0.4759359", "0.475376", "0.4736318", "0.47310746", "0.47310334", "0.47288388", "0.4723257", "0.47065562", "0.4704623", "0.46979114", "0.46961954", "0.4694337", "0.46791005", "0.46715435", "0.4662105", "0.4658183", "0.4657046", "0.46559572", "0.46520993", "0.46493402", "0.464767", "0.46455956", "0.4645435", "0.46421695", "0.46408567", "0.46395946", "0.463842", "0.4635101", "0.4626188", "0.46208134", "0.4610264", "0.46075535", "0.46075034", "0.46027982", "0.4596352", "0.45954123", "0.45895174", "0.4575477", "0.4569861", "0.4564884", "0.45589814", "0.45580643", "0.45519453", "0.45504478", "0.4531063", "0.4529022", "0.4527747", "0.45239258", "0.45234707", "0.4517725", "0.4515754", "0.45109525", "0.45053518", "0.45035803", "0.45012227", "0.45000315", "0.44998127", "0.44994283" ]
0.6137541
0
Called when a drawer has settled in a completely closed state.
public void onDrawerClosed(View view) { super.onDrawerClosed(view); // Do whatever you want here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onDrawerClosed(View view) {\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n Log.d(TAG, \"onDrawerClosed\");\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n super.onDrawerClosed(drawerView);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n\n }", "public void onDrawerClosed(View drawerView) {\n\n }", "@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tshowUp();\n\t\t\t}", "@Override\n public void onDrawerStateChanged(int newState) {\n }", "@Override\n public void onDrawerStateChanged(int newState) {\n }", "@Override\n public void onDrawerStateChanged(int newState) {\n }", "@Override\n public void onDrawerStateChanged(int newState) {\n }", "@Override\n public void onDrawerStateChanged(int newState) {\n }", "@Override\n\tpublic void onSidebarClosed() {\n\t\tLog.d(TAG, \"opened\");\n\t}", "@Override\n\t\t\tpublic void onDrawerClosed() {\n\t\t\t\tlayoutParams = new FrameLayout.LayoutParams(\n\t\t\t\t\t\tLayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\t\t\tslidingDrawer.setLayoutParams(layoutParams);\n\t\t\t\tbottomLayout.setVisibility(View.VISIBLE);\n\t\t\t}", "@Override\n public void onDrawerClosed() {\n if (lnr_option_pen.getVisibility() == View.VISIBLE)\n lnr_option_pen.setVisibility(View.GONE);\n\n if (lnr_option_brush.getVisibility() == View.VISIBLE)\n lnr_option_brush.setVisibility(View.GONE);\n\n if (lnr_option_size.getVisibility() == View.VISIBLE)\n lnr_option_size.setVisibility(View.GONE);\n }", "public void onDrawerClosed(View view) {\n getActionBar().setTitle(\"Closed Drawer\");\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n resumeLocationUpdates();\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "@Override\n\t\t\tpublic void onDrawerOpened() {\n\t\t\t\tshowDown();\n\t\t\t}", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getActionBar().setTitle(R.string.drawer_close);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n handleEvent_onDrawerOpened(drawerView);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n\t\t\t\tLog.d(TAG, \"nav drawer closed state\");\n\t\t\t\tgetActionBar().setTitle(title);\n\t\t\t\tinvalidateOptionsMenu(); // goes to onPrepareOptionsMenu()\n\t\t\t}", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(\"Stored configurations\");\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n\t\t\t\t\t invalidateOptionsMenu(); \n\t\t\t\t\t }", "@Override\r\n\t\t\tpublic void onClosed() {\n\t\t\t\t\r\n\t\t\t}", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n invalidateOptionsMenu();\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "public void onDrawerClosed(View view) {\r\n super.onDrawerClosed(view);\r\n invalidateOptionsMenu();\r\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n // getSupportActionBar().setTitle(mTitle);\n\n //invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void closeDrawer() {\n final DrawerLayout mDrawerLayout;\n\n mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);\n\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n mDrawerLayout.closeDrawer(GravityCompat.START);\n hideAddFeed();\n\n }\n }, 200);\n }", "public void setOnDrawerCloseListener(OnDrawerCloseListener onDrawerCloseListener) {\n/* 209 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n if (actionBar != null) actionBar.setTitle(activityTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n invalidateOptionsMenu();\n }", "public void onDrawerClosed(View view) {\n if (Build.VERSION.SDK_INT >= 11) {\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n } else {\n //Call it directly on gingerbread.\n onPrepareOptionsMenu(mMenu);\n }\n\n// startFullscreenIfNeeded();\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n }", "@Override\n public void onDrawerClosed(View drawerView) {\n invalidateOptionsMenu();\n Log.d(\"Apps Main\", \"Close drawer \");\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n }", "public void onDrawerClosed(View view) {\n \tactivity.getSupportActionBar().setTitle(\"Txootx!\");\n \tactivity.invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n }", "void checkClosed();", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //change toolbar title to the app's name\n toolbar.setTitle(getResources().getString(R.string.app_name));\n\n //hide the add feed menu option\n hideAddFeed();\n\n }", "@Override\n public void onPourWaterRaised() {\n if (theFSM.getCupPlaced()) {\n pouringState = true;\n }\n }", "private void closeDrawer(){\n if (drawerLayout.isDrawerOpen(GravityCompat.START)){\n drawerLayout.closeDrawer(GravityCompat.START);\n }\n }", "public void onDrawerOpened(View drawerView) {\n\n }", "public void onDrawerClosed(View view) {\n menuvalue = 0;\n getSupportActionBar().setHomeAsUpIndicator(R.mipmap.menu);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n// getActionBar().setTitle(mTitle);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n// getActionBar().setTitle(mTitle);\n }", "public void onDrawerClosed(View view) {\n\t\t\t\tsuper.onDrawerClosed(view);\n\t\t\t\tgetSupportActionBar().setTitle(mActivityTitle);\n\t\t\t\tinvalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n\t\t\t}", "public void onDrawerClosed(View view) {\r\n\t\t\t\tsuper.onDrawerClosed(view);\r\n\t\t\t\tgetActionBar().setTitle(mTitle);\r\n\t\t\t}", "@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }", "@Override\n public void onDrawerOpened(View drawerView) {\n\n super.onDrawerOpened(drawerView);\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mActivityTitle);\n //invalidateOptionsMenu();\n //creates call to onPrepareOptionsMenu()\n }", "public boolean checkClosed();", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n linearLayout.removeAllViews();\n linearLayout.invalidate();\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mActivityTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mActivityTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n getSupportActionBar().setTitle(mActivityTitle);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerClosed(View view) {\n super.onDrawerClosed(view);\n //getActionBar().setTitle(mTitle);\n }", "@Override\n boolean onBeforePopDir() {\n int size = mState.stack.size();\n\n if (mDrawer.isPresent()\n && (System.currentTimeMillis() - mDrawerLastFiddled) > DRAWER_NO_FIDDLE_DELAY) {\n // Close drawer if it is open.\n if (mDrawer.isOpen()) {\n mDrawer.setOpen(false);\n mDrawerLastFiddled = System.currentTimeMillis();\n return true;\n }\n\n final Intent intent = getIntent();\n final boolean launchedExternally = intent != null && intent.getData() != null\n && mState.action == State.ACTION_BROWSE;\n\n // Open the Close drawer if it is closed and we're at the top of a root, but only when\n // not launched by another app.\n if (size <= 1 && !launchedExternally) {\n mDrawer.setOpen(true);\n // Remember so we don't just close it again if back is pressed again.\n mDrawerLastFiddled = System.currentTimeMillis();\n return true;\n }\n }\n\n return false;\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }", "public void onDrawerOpened(View drawerView) {\n super.onDrawerOpened(drawerView);\n invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()\n }" ]
[ "0.7115407", "0.6926059", "0.6869123", "0.6850017", "0.6850017", "0.67975765", "0.67975765", "0.6745561", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6725664", "0.6721151", "0.66889405", "0.66880065", "0.6562775", "0.655485", "0.655485", "0.655485", "0.655485", "0.6535418", "0.64513475", "0.63647944", "0.63557786", "0.63468915", "0.63330674", "0.62742853", "0.62742853", "0.62742853", "0.62727624", "0.6207396", "0.61479044", "0.61479044", "0.60617363", "0.60555094", "0.6026638", "0.60136896", "0.6004723", "0.5999999", "0.5999999", "0.5999999", "0.5999999", "0.5987982", "0.5977952", "0.59757096", "0.5963962", "0.5900662", "0.5900662", "0.5878352", "0.58625096", "0.58526325", "0.58501506", "0.5838531", "0.5826156", "0.5819381", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5816328", "0.5814934", "0.58083963", "0.57997423", "0.57940894", "0.57877415", "0.5771512", "0.57663655", "0.57663655", "0.5758774", "0.5739536", "0.57342184", "0.57342184", "0.57342184", "0.57235277", "0.5717598", "0.5714211", "0.571184", "0.571184", "0.571184", "0.5708654", "0.5708341", "0.56557673", "0.56557673", "0.56557673" ]
0.67596
7