query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
sequencelengths
19
20
metadata
dict
Returns true if the routine permits SQL.
private boolean permitsSQL( RoutineAliasInfo rai ) { short sqlAllowed = rai.getSQLAllowed(); switch( sqlAllowed ) { case RoutineAliasInfo.MODIFIES_SQL_DATA: case RoutineAliasInfo.READS_SQL_DATA: case RoutineAliasInfo.CONTAINS_SQL: return true; default: return false; } }
[ "public static boolean couldBeSQL(TokenSequence seq) {\n String potentialStatement = seq.token().text().toString();\n if (potentialStatement.startsWith(\"\\\"\") || potentialStatement.startsWith(\"'\")) {\n potentialStatement = potentialStatement.substring(1);\n }\n potentialStatement = potentialStatement.toLowerCase().trim();\n return potentialStatement.startsWith(\"select\") || potentialStatement.startsWith(\"insert\")\n || potentialStatement.startsWith(\"update\") || potentialStatement.startsWith(\"delete\")\n || potentialStatement.startsWith(\"drop\");\n }", "protected boolean canIssueSQLToDatabase_impl(Object status) {\n int stat = getIntStatus(status);\n return ((stat == Status.STATUS_ACTIVE) || (stat == Status.STATUS_PREPARING));\n }", "public boolean exec(String sql)\r\n {\n try {\r\n sqldb.execSQL(sql);\r\n return true;\r\n }\r\n catch (Exception ex) {\r\n StaticLogger.E(this, \"unexpected ex: \", ex);\r\n }\r\n return false;\r\n }", "public boolean sqlException()\n\t{\n\n\t\tboolean rtn = true;\n\n\t\tswitch (sqlcode)\n\t\t{\n\t\t\tcase 0 :\n\t\t\t\tif (sqlstate == null)\n\t\t\t\t{\n\t\t\t\t\trtn = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn rtn;\n\t}", "public boolean excute(String sql) throws SQLException {\n\t\tString rewriteSQl = sql;\n\t\tStatement stmt = getStatement();\t\t\t\t\n\t\tboolean ret = stmt.execute(rewriteSQl);\t\n\t\treturn ret;\n\t}", "@Override\n\tpublic boolean canExecute() {\n\t\treturn table != null;\n\t}", "public Object runSQL (String sql){\n \t\n \tBoolean executeSuccess = false; \n \t\n \tsql = sql.trim().toUpperCase();\n\n\n\n try {\n // conn = dataSource.getConnection();\n\n stmt = conn.createStatement();\n \n \n \n if(sql.startsWith(\"SELECT\")){\n\n \tResultSet results = stmt.executeQuery(sql);\t \n \treturn results;\n } else \n if (sql.startsWith(\"INSERT\") || (sql.startsWith(\"REPLACE\")) || (sql.startsWith(\"UPDATE\")) || (sql.startsWith(\"DELETE\"))) {\n \tif(stmt.executeUpdate(sql)==1){\n \t\texecuteSuccess=true;\n \t}\n }\n \n }\n catch (Exception e) {\n \te.printStackTrace();\n }\n \n return executeSuccess;\n }", "public boolean isPoolable() throws SQLException {\n return false;\n }", "private boolean initSQLStatement() {\n try {\n sql = connection.createStatement();\n } catch (SQLException e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }", "private boolean executeSQL(String sql) throws TException, SQLException {\n isCancelled = false;\n TSExecuteStatementReq execReq = new TSExecuteStatementReq(sessionId, sql, stmtId);\n int rows = fetchSize;\n if (maxRows != 0 && fetchSize > maxRows) {\n rows = maxRows;\n }\n execReq.setFetchSize(rows);\n execReq.setTimeout((long) queryTimeout * 1000);\n TSExecuteStatementResp execResp = client.executeStatementV2(execReq);\n try {\n RpcUtils.verifySuccess(execResp.getStatus());\n } catch (StatementExecutionException e) {\n throw new IoTDBSQLException(e.getMessage(), execResp.getStatus());\n }\n\n deepCopyResp(execResp);\n if (execResp.isSetColumns()) {\n queryId = execResp.getQueryId();\n if (execResp.queryResult == null) {\n BitSet aliasColumn = listToBitSet(execResp.getAliasColumns());\n this.resultSet =\n new IoTDBNonAlignJDBCResultSet(\n this,\n execResp.getColumns(),\n execResp.getDataTypeList(),\n execResp.columnNameIndexMap,\n execResp.ignoreTimeStamp,\n client,\n sql,\n queryId,\n sessionId,\n execResp.nonAlignQueryDataSet,\n execResp.tracingInfo,\n execReq.timeout,\n execResp.operationType,\n execResp.getSgColumns(),\n aliasColumn);\n } else {\n this.resultSet =\n new IoTDBJDBCResultSet(\n this,\n execResp.getColumns(),\n execResp.getDataTypeList(),\n execResp.columnNameIndexMap,\n execResp.ignoreTimeStamp,\n client,\n sql,\n queryId,\n sessionId,\n execResp.queryResult,\n execResp.tracingInfo,\n execReq.timeout,\n execResp.moreData);\n }\n return true;\n }\n return false;\n }", "public boolean isPoolable() throws SQLException {\n return false;\n }", "public boolean sqlQuery(String query){\n\t\tresult = null;\n\t\ttry{\n\t\t\tresult = this.stmt.executeQuery(query);\n\t\t} catch(SQLException e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean canExecute() {\n\t\treturn table != null && super.canExecute();\n\t}", "public boolean select(String sql){ \n //--------------------------------------------------------------------------- \n return open(sql); \n }", "public boolean execute(String sql) throws SQLException {\n getProcessContext().setIsPreparedStatement(false);\n getProcessContext().setOriginSql(sql);\n executeInternal();\n return true;\n }", "public boolean isValid() throws SQLException;", "protected final boolean execInData(String sql){\r\n\t\tSession session = getSessionFactory().getCurrentSession(); \r\n\t\tQuery query = session.createQuery(sql);\r\n\t\t\r\n\t\tint ret = query.executeUpdate();\r\n\t\t\r\n\t\tif(ret>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}", "@Override\r\n\tpublic boolean isPoolable() throws SQLException {\n\t\treturn false;\r\n\t}", "private boolean checkBeforeExecuting(String sqlCheck[]) throws RuntimeException{\n\t\ttry{\n\t\t\tif(DBInterface.getReference() == null)\n\t\t\t\tthrow new IllegalArgumentException(\"Database currently unavailable. Please try again.\");\n\t\t\tfor(String check: sqlCheck){\n\t\t\t\tCachedRowSetImpl result = DBInterface.getReference().executeSelect(check);\n\t\t\t\tif(result.next())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(SQLException e){\n\t\t\tthrow new RuntimeException(\"System Error: Invalid SQL Check Statement\");\n\t\t}\n\t\treturn true;\n\t}", "boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Splits a String using indexOf instead of regex to speed things up.
public static ArrayList<String> split(String str, String delimiter, int expectedNumTokens) { final ArrayList<String> result = new ArrayList<String>(expectedNumTokens); int delimiterIdx = -1; do { final int tokenStartIdx = delimiterIdx + 1; delimiterIdx = str.indexOf(delimiter, tokenStartIdx); final String token = (delimiterIdx != -1 ? str.substring(tokenStartIdx, delimiterIdx) : str.substring(tokenStartIdx) ); result.add(token); } while( delimiterIdx != -1 ); return result; }
[ "String[] splitString(String input);", "public String[] split(String input);", "public static String[] split(String str1, String str2)\n\t/* 485: */{\n\t\t/* 486: 731 */return StringUtils.split(str1, str2);\n\t\t/* 487: */}", "private String[] split(String input) {\n int index = 0;\n ArrayList<String> matchList = new ArrayList<String>();\n Matcher m = splitpattern.matcher(input);\n // Add segments before each match found\n while(m.find()) {\n String match = input.substring(index, m.start());\n if (match.length()>0) matchList.add(match);\n index = m.end();\n String mnw=input.substring(m.start(),index);\n if (mnw.length()>0) matchList.add(mnw); // this will include the matched non-word character in the matchList \n } \n if (index == 0) return new String[] {input}; // If no match was found, return this \n matchList.add(input.substring(index, input.length())); // Add remaining segment\n // Construct result\n int resultSize = matchList.size();\n while (resultSize > 0 && matchList.get(resultSize-1).equals(\"\")) resultSize--; // remove blanks at the end \n String[] result = new String[resultSize];\n return matchList.subList(0, resultSize).toArray(result);\n }", "public static String[] mySplit(String str, String regex) {\n\t\t\n\t Vector<String> result = new Vector<String>();\n\t int start = 0;\n\t int pos = str.indexOf(regex);\n\t while (pos>=start) {\n\t if (pos>start) {\n\t result.add(str.substring(start,pos));\n\t }\n\t start = pos + regex.length();\n\t result.add(regex);\n\t pos = str.indexOf(regex,start); \n\t }\n\t if (start<str.length()) {\n\t result.add(str.substring(start));\n\t }\n\t String[] array = result.toArray(new String[0]);\n\t return array;\n\t}", "public static String[] splits(String s, String delimiter) {\n\t\tint arrayIndex = 0;\n\t\tfor(int i = 0 ; i < s.length() ; i++)\n\t\t\tif((s.substring(i,i+1)).equals(delimiter))\n\t\t\t\tarrayIndex++;\n\t\tString[] rr = new String[arrayIndex+1];\n\t\tString temp = \"\";\tint x = 0;\n\t\tfor(int i = 0 ; i < s.length() ; i++) {\n\t\t\tif(!(s.substring(i,i+1)).equals(delimiter))\n\t\t\t\ttemp += s.substring(i,i+1);\n\t\t\telse { rr[x] = temp; x++; temp = \"\"; }\n\t\t}\n\t\trr[x] = temp;\treturn rr;\n\t}", "public static ArrayList<String> splitString(String input){\n\t\tArrayList<String> vec = new ArrayList<String>();\n\t StringTokenizer st = new StringTokenizer(input);\n\t while(st.hasMoreTokens())\n\t \tvec.add(st.nextToken());\n\t\treturn vec;\n\t}", "public static List<String> split(String s, int... indexes) {\n\t\tList<String> list = new ArrayList<>(indexes.length);\n\t\tint last = 0;\n\t\tfor (int i : indexes) {\n\t\t\tif (i >= s.length()) i = s.length();\n\t\t\tlist.add(s.substring(last, i));\n\t\t\tlast = i;\n\t\t}\n\t\tlist.add(s.substring(last));\n\t\treturn list;\n\t}", "public static String[] strSplit(String s, String delimiter) {\n return strSplit(s, delimiter, -1);\n }", "public static String[] split(String input, String regex) {\n\n\t\tint start = 0;\n\t\tint end = 0;\n\t\tPattern p = Pattern.compile(regex);\n\t\tMatcher m = p.matcher(input);\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tboolean hasRegex = m.find();\n\t\t/* It first checks if the regex comes at the beginning or not\n\t\t * - if the regex comes first, it adds it to the list, if not, it adds the substring\n\t\t * before the next regex and then the regex afterwards in order to be ready to enter the \n\t\t * while loop.*/\n\t\tif (hasRegex && (m.start() == 0)) { //checks if the start of the first regex is index 0\n\n\t\t\tlist.add(m.group());\n\t\t\tstart = m.end(); //this will store the index after the regex\n\n\t\t} else if (hasRegex) {\n\t\t\t\n\t\t\tend = m.start(); //this will store the index before the regex\n\t\t\tlist.add(input.substring(0, end));//it can add the first substring because its start is 0\n\t\t\tlist.add(m.group());\n\t\t\tstart = m.end(); //this will store the index after the regex\n\n\t\t} else\n\t\t\t// If there is no regex in the string, it returns the string in a single cell array\n\t\t\treturn new String[] {input};\n\t\t//It then loops through the string, adding the substring before each regex and then the regex\n\t\twhile (m.find()) {\n\n\t\t\tend = m.start(); //the start was stored before find() iterated matcher forward\n\t\t\tlist.add(input.substring(start, end));\n\t\t\tlist.add(m.group());\n\t\t\tstart = m.end(); //new start replaces old start that was found before find() iterated matcher\n\n\t\t}\n\n\t\t//if the newest start (the end of the last regex) is != to the length, there is more afterwards\n\t\tif (input.length() != start)\n\t\t\tlist.add(input.substring(start, input.length()));\n\t\t//this is how you send the proper *weird* parameter to toArray because it uses generic types\n\t\treturn list.toArray(new String[list.size()]);\n\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate static String[] splitWorker(String str, String separatorChars, int max,\n boolean preserveAllTokens) {\n // Performance tuned for 2.0 (JDK1.4)\n // Direct code is quicker than StringTokenizer.\n // Also, StringTokenizer uses isSpace() not isWhitespace()\n\n if (str == null) {\n return null;\n }\n int len = str.length();\n if (len == 0) {\n return EMPTY_STRING_ARRAY;\n }\n List list = new ArrayList();\n int sizePlus1 = 1;\n int i = 0;\n int start = 0;\n boolean match = false;\n boolean lastMatch = false;\n if (separatorChars == null) {\n // Null separator means use whitespace\n while (i < len) {\n if (Character.isWhitespace(str.charAt(i))) {\n if (match || preserveAllTokens) {\n lastMatch = true;\n if (sizePlus1++ == max) {\n i = len;\n lastMatch = false;\n }\n list.add(str.substring(start, i));\n match = false;\n }\n start = ++i;\n continue;\n } else {\n lastMatch = false;\n }\n match = true;\n i++;\n }\n } else if (separatorChars.length() == 1) {\n // Optimise 1 character case\n char sep = separatorChars.charAt(0);\n while (i < len) {\n if (str.charAt(i) == sep) {\n if (match || preserveAllTokens) {\n lastMatch = true;\n if (sizePlus1++ == max) {\n i = len;\n lastMatch = false;\n }\n list.add(str.substring(start, i));\n match = false;\n }\n start = ++i;\n continue;\n } else {\n lastMatch = false;\n }\n match = true;\n i++;\n }\n } else {\n // standard case\n while (i < len) {\n if (separatorChars.indexOf(str.charAt(i)) >= 0) {\n if (match || preserveAllTokens) {\n lastMatch = true;\n if (sizePlus1++ == max) {\n i = len;\n lastMatch = false;\n }\n list.add(str.substring(start, i));\n match = false;\n }\n start = ++i;\n continue;\n } else {\n lastMatch = false;\n }\n match = true;\n i++;\n }\n }\n if (match || (preserveAllTokens && lastMatch)) {\n list.add(str.substring(start, i));\n }\n return (String[]) list.toArray(new String[list.size()]);\n }", "private static String[] split(String s) {\n/* 177 */ if (TextUtils.isBlank(s)) {\n/* 178 */ return null;\n/* */ }\n/* 180 */ return s.split(\" *, *\");\n/* */ }", "private static String[] splitString( final String string, final String onToken )\r\n {\r\n final int offset = 4;\r\n final StringTokenizer tokenizer = new StringTokenizer( string, onToken );\r\n final String[] result = new String[tokenizer.countTokens()];\r\n\r\n for( int i = 0; i < result.length; i++ )\r\n {\r\n String token = tokenizer.nextToken();\r\n if( token.startsWith( \"\\tat \" ) )\r\n {\r\n result[i] = token.substring( offset );\r\n }\r\n else\r\n {\r\n result[i] = token;\r\n }\r\n }\r\n\r\n return result;\r\n }", "private static String[] split(String input)\n\t {\n\t return input.split(\"\\\\s+\");\n\t }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate static String[] splitWorker(String str, char separatorChar, boolean preserveAllTokens) {\n // Performance tuned for 2.0 (JDK1.4)\n\n if (str == null) {\n return null;\n }\n int len = str.length();\n if (len == 0) {\n return EMPTY_STRING_ARRAY;\n }\n List list = new ArrayList();\n int i = 0;\n int start = 0;\n boolean match = false;\n boolean lastMatch = false;\n while (i < len) {\n if (str.charAt(i) == separatorChar) {\n if (match || preserveAllTokens) {\n list.add(str.substring(start, i));\n match = false;\n lastMatch = true;\n }\n start = ++i;\n continue;\n } else {\n lastMatch = false;\n }\n match = true;\n i++;\n }\n if (match || (preserveAllTokens && lastMatch)) {\n list.add(str.substring(start, i));\n }\n return (String[]) list.toArray(new String[list.size()]);\n }", "public static void main(String[] args) {\n\t\n\t\tString ts1 = \"hi..! how_r_u..?\";\n\t\tSystem.out.println(\"Target String : \"+ ts1);\n\t\n\t\t Pattern p1 = Pattern.compile(\"\\\\s\");\n\t\t String[] str1 = p1.split(ts1); System.out.println(\"Split via space\");\n\t\t for(String s : str1)System.out.println(\"=> \"+s);\n\t\t \n System.out.println();\n \n\t\t String ts2 = \"priyanshumaurya.8868@gmail.com\";\n\t\t Pattern p2 = Pattern.compile(\"[.]\");\n\t\t String[] str2 = p2.split(ts2); System.out.print(\" split by [.] => \");\n\t\t for(String s : str2)System.out.println(\"=> \"+s);\n\t\t \n System.out.println();\n \t\t \n\t\t Pattern p3= Pattern.compile(\"\\\\.\");\n\t\t String[] str3 = p3.split(ts2); System.out.print(\" split by \\\\. => \");\n\t\t for(String s : str3)System.out.println(\"=> \"+s);\n\t\t \n System.out.println();\n \t\n\t\t // below example doesn't gonna return anything, because we are splitting via . (splitting by anything , ( or we can say ignoring anything) )\n\t\t Pattern p4 = Pattern.compile(\".\");\n\t\t String[] str4 = p4.split(ts2); System.out.print(\" split by . => \");\n\t\t for(String s : str4)System.out.println(\"=> \"+s);\n\t\t \n\t\t System.out.println(\"\\nhi\");\n\t\t \n\t\t// NOTE : => String class has also a spliting function in it... \n\t\t \n\t\t // String class split() method can take pattern as arrgument where as \n\t\t //pattern class spilt method can take target string as a arrgument\n\t\t \n\t\t System.out.println(\"*************************************** String.split() *******************************************\");\n\t\t String s = \"Durga Software Solution \";\n\t\t for( String s1 : s.split(\"\\\\s\")) System.out.println(\" => \"+s1);\n\t\t \n\t\t \n\t\t \n\t}", "private String[] splitByWhitespaces(String string) {\n return string.split(\"(?<=\\\\s+)\");\n }", "public static String[] split(final String data, final String separator){\r\n\t\tString str = separator + data + separator;\r\n\t\tint count = countOccurrences(str, separator);\r\n\t\tString[] array = new String[count - 1];\r\n\t\tint start = separator.length();\r\n\t\tint end;\r\n\t\tfor (int i = 0; i < array.length; i++){\r\n\t\t\tend = str.indexOf(separator, start);\r\n\t\t\tarray[i] = str.substring(start, end);\r\n\t\t\tstart = end + separator.length();\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "public List<List<String>> splitString(String s) {\n List<List<String>> res = new ArrayList<>();\n if (s.isEmpty()) {\n res.add(new ArrayList<>());\n return res;\n }\n if (s.length() == 1) {\n List<String> list = new ArrayList<>();\n list.add(s);\n res.add(list);\n }\n if (s.length() == 2) {\n List<String> list1 = new ArrayList<>();\n list1.add(s);\n res.add(list1);\n List<String> list2 = new ArrayList<>();\n list2.add(s.substring(0, 1));\n list2.add(s.substring(1, 2));\n res.add(list2);\n }\n if (s.length() >= 3) {\n String s1 = s.substring(0, 1);\n String n1 = s.substring(1, s.length());\n List<List<String>> lists1 = splitString(n1);\n for (List<String> list : lists1) {\n list.add(0, s1);\n }\n res.addAll(lists1);\n String s2 = s.substring(0, 2);\n String n2 = s.substring(2, s.length());\n List<List<String>> lists2 = splitString(n2);\n for (List<String> list : lists2) {\n list.add(0, s2);\n }\n res.addAll(lists2);\n }\n return res;\n }", "public static void fastSplit(String pString,\n char pSeparator,\n String[] pResult) {\n fastSplit(pString,\n pSeparator,\n pResult,\n pResult.length);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ UpdateState(0) for Menu UpdateState(1) for Play
@Override public void resize(int width, int height) { }
[ "public void update() {\n\t\t// resume\n\t\tif (resume.activated) {\n\t\t\tgame.data.status = GameState.PLAYING;\n\t\t\tresume.activated = false;\n\t\t}\n\t\t// quit\n\t\tif (mainmenu.activated) {\n\t\t\tgame.data.status = GameState.MAIN_MENU;\n\t\t\tmainmenu.activated = false;\n\t\t}\n\t}", "public void update(){\n\t\t\n\t\tmenuLoop.update(gameState);\n\t\t\n\t\t//Updating the game state form the menuLoop\n\t\tgameState = menuLoop.getGameState();\n\t\t\n\t\t//Return level\n\t\t//TODO set the levelFlag from the menu\n\t\tlevelFlag = menuLoop.levelFlag;\n\t\tif(levelFlag != 0){\n\t\t\tLevel level = new Level(levelFiles[levelFlag - 1]);\n\t\t\tgameLoop.setLevel(level);\n\t\t\tlevelFlag = 0;\n\t\t\tplayingLevel = true;\n\t\t}\n\t\tif(playingLevel){\n\t\t\tgameLoop.update(gameState);\n\t\t}\n\t\t\t\n\t\tif(gameLoop.getGameState() == 5 || gameLoop.getGameState() == 7) {\n\t\t\tgameState = gameLoop.getGameState();\n\t\t}\n\t\t\n\t\t\n\t\t//System.out.println(gameState);\n\t\t\n\t\t//Checking if the player paused the game\n\t\t\n\t\t\n\t\t//Music player\n\t\tmusic.doShit(gameState);\n\t}", "public void updatePlay() {\n \tcurGameplayController.update();\n \tif (curGameplayController.isDone()){\n \t\tif (curGameplayController.reset){\n \t\t\ttry {\n\t\t\t\t\tloadNextMenu(curGameplayController.levelName,\"\",false);\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} else if (curGameplayController.playerWon()){\n\t \t\t//check if level beaten and update savestate\n\t \t\tif (curLevelData.postNarrative != null && !curLevelData.seenPost){\n\t \t\t\tnarrativeController.reset(curLevelData.postNarrative, false);\n\t \t\t\tgameState = GameState.NARRATIVE;\n\t \t\t} else {\n\t \t\t\t\tif (curLevelData.getNextLevelName() != null){\n\t \t\t\t\t\tthis.setTransition(curLevelData.getNextLevelName(), true);\n\t \t\t\t\t} else {\n\t \t\t\t\t\tthis.setTransition(GameState.MENU);\n\t \t\t\t\t\tmainMenuController.resetMenu();\n\t \t\t\t\t}\n\t \t\t}\n \t\t} else {\n \t\t\tthis.setTransition(curLevelData.levelName, false);\n \t\t}\n \t}\n }", "private void updateState(){\n }", "@Override\n\tpublic void update(GameContainer gc, StateBasedGame sbg, int delta)\n\t\t\tthrows SlickException {\n\t\tif(backtomenu){\n\t\t\tsbg.enterState(Portal2D.MAINMENUSTATE);\n\t\t}\t\n\t\tswitch (mainMenuItemSelected){\n\t\tcase MENU_SOUNDLEVEL:\n\t\t\tdisplayscreensize=false;\n\t\t\tdisplaysoundlevel=true;\n\t\t\tdisplayinputload=false;\n\t\t\tgc.setSoundVolume((float)soundLevelSelected);\n\t\t\tbreak;\n\t\tcase MENU_DISPLAYINPUT:\n\t\t\tdisplayscreensize=false;\n\t\t\tdisplaysoundlevel=false;\n\t\t\tdisplayinputload=true;\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\treturn;\n\t}", "public void updateState(){\n\t\tsuper.updateState();\r\n\t\tif(up) addAction(Step8ActionType.ACCELL_YNEG);\r\n\t\tif(down)addAction(Step8ActionType.ACCELL_YPOS);\r\n\t\tif(right)addAction(Step8ActionType.ACCELL_XPOS);\r\n\t\tif(left) addAction(Step8ActionType.ACCELL_XNEG);\r\n\t}", "public void updateStates(){\n }", "public void updateState(boolean inPlay) {\n\t\tthis.onBoard = inPlay;\n\t}", "@Override\r\n\tpublic void stateUpdate() \r\n\t{\n\t\t\r\n\t}", "void update(MenuView view, Player player);", "public void mainMenu(){\n programState = ProgramState.MAIN_MENU;\n }", "@Override\n public void update() {\n if(menuTexts[0].clickBox == null || game.getml().lClick == null) return;\n checkMenuClick();\n for(MenuText m: menuTexts){\n if(m.clickBox.intersects(game.getml().cPos) && !m.text.equals(\"Main Menu\")){\n m.highlighted = true;\n } else if(m.highlighted) m.highlighted = false;\n }\n game.getml().lClick = null;\n\n }", "private void updateMenu() {\n final int UPDATE_TIME = 1;\n\n ClickAction lobbyAction = new ConnectToBungeeServer(plugin, \"hub-01\");\n\n //Start the thread to update the items.\n new BukkitRunnable() {\n\n @Override\n public void run() {\n\n //Don't update anything unless a player is online.\n if (Bukkit.getOnlinePlayers().size() >= 1) {\n\n //Update the current frame.\n //This is for animated item descriptions.\n if (frame == 1) {\n frame++;\n } else {\n frame--;\n }\n\n //Update the Items\n updateItems();\n\n //Update Menu\n setItem(lobby, 0, lobbyAction);\n }\n }\n }.runTaskTimer(plugin, 0, 20 * UPDATE_TIME);\n }", "private void update() {\n if (gsManager.noActiveStates() || input == null) {\n return;\n }\n gsManager.getCurrentState().tick();\n Time.setTicks(gsManager.getCurrentState().getTicks());\n gsManager.getCurrentState().update(input);\n \n // checks if game should stop or if full screen should be toggled\n if (input.getJustDownKey(\"exit\")) {\n stop();\n }\n else {\n if (input.getJustDownKey(\"debug\")) {\n setDebug(!debug);\n }\n if (input.getJustDownKey(\"fullscreen\")) {\n window.setFullscreen(!window.isFullscreen());\n }\n }\n \n input.update();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\trepaint();\n\t\tif(currentState == MENU_STATE){\n\t\t\tupdatems();\n\t\t}else if(currentState == GAME_STATE){\n\t\t\tupdategs();\n\t\t}else if(currentState == END_STATE){\n\t\t\tupdatees();\n\t\t}\n\n\n\t}", "public void fromPauseToMenu(){\n\t\tcurrentState = MENU;\n\t\tgameStates.get(currentState).initialize();\n\t}", "public void Update() {\n m_state.Update();\n }", "public void updateState()\n\t{\n\t\tif (bounceButton.isSelected() || bothButton.isSelected())\n\t\t\tshouldBounce = true;\n\t\telse\n\t\t\tshouldBounce = false;\n\n\t\tif (translateButton.isSelected() || bothButton.isSelected())\n\t\t\tshouldTranslate = true;\n\t\telse\n\t\t\tshouldTranslate = false;\n\t}", "public Menu(){\n playButtonPressed = false;\n playButtonMultiplayerPressed = false;\n menuEnd = false;\n }", "public void update() {\r\n\t\tif(getMyGame().getGameState() == false)\r\n\t\t\tgame.setScreen(new EndScreen(game, getMyGame().getLeaderboard(), getMyGame().getPlayers()));\r\n\r\n\t\tif(this.isWaitingColor()) {\r\n\t\t\tgetUpd().changeToRed();\r\n\t\t\tgetUpd().changeToGreen();\r\n\t\t\tgetUpd().changeToBlue();\r\n\t\t\tgetUpd().changeToYellow();\r\n\t\t}\r\n\t\tgetUpd().moveLeft();\r\n\t\tgetUpd().moveRight();\r\n\t\tgetUpd().makeTurn();\r\n\t\tgetUpd().cardDraw();\r\n\t\tgetUpd().pass();\r\n\t\tgetUpd().callUNO();\r\n\t\tgetUpd().saveGame(\"multidata.ser\");\r\n\t\tgetUpd().loadGame(\"multidata.ser\");\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Result code is RESULT_OK only if the user selects an Image
public void onActivityResult(int requestCode,int resultCode,Intent data){ if (resultCode == AddActivity.RESULT_OK) switch (requestCode){ case GALLERY_REQUEST_CODE: //data.getData return the content URI for the selected Image Uri selectedVideo = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; // Get the cursor Cursor cursor = getContentResolver().query(selectedVideo, filePathColumn, null, null, null); // Move to first row cursor.moveToFirst(); //Get the column index of MediaStore.Images.Media.DATA int columnIndex = cursor.getColumnIndex(filePathColumn[0]); //Gets the String value in the column pathToVideo = cursor.getString(columnIndex); cursor.close(); // Set the Image in ImageView after decoding the String videoViewAdd.setVideoPath(pathToVideo); MediaController mediaController = new MediaController(this); videoViewAdd.setMediaController(mediaController); videoViewAdd.start(); break; } }
[ "public boolean imageSelectedFromGallery(int requestCode, int resultCode) {\n return resultCode == Activity.RESULT_OK && requestCode == IMAGE_PICK_CODE;\n }", "private void selectImage() {\n\t\tfinal CharSequence[] items = { \"Take Photo\", \"Choose from Library\",\n\t\t\t\t\"Cancel\" };\n\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(Image.this);\n\t\tbuilder.setTitle(\"Add Photo!\");\n\t\tbuilder.setItems(items, new DialogInterface.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int item) {\n\t\t\t\tboolean result=Utility.checkPermission(Image.this);\n\n\t\t\t\t//select \"take new photo\"\n\t\t\t\tif (items[item].equals(\"Take Photo\")) {\n\t\t\t\t\tuserChoosenTask =\"Take Photo\";\n\t\t\t\t\tif(result)\n\t\t\t\t\t\tcameraIntent();\n\n\t\t\t\t//select \"select exist photo\"\n\t\t\t\t} else if (items[item].equals(\"Choose from Library\")) {\n\t\t\t\t\tuserChoosenTask =\"Choose from Library\";\n\t\t\t\t\tif(result)\n\t\t\t\t\t\tgalleryIntent();\n\n\t\t\t\t//select to exist\n\t\t\t\t} else if (items[item].equals(\"Cancel\")) {\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbuilder.show();\n\t}", "private void selectImage() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, IMG_REQ);\n }", "private void selectImage() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, IMG_REQUEST);\n\n // reset last selected image and the last result\n imgView.setVisibility(View.GONE);\n imgView.setImageResource(0);\n result.setVisibility(View.GONE);\n result.setText(\"\");\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == GALLERY_REQUEST_CODE\n && resultCode == Activity.RESULT_OK\n && !isNull(data)) {\n\n Uri selectedImage = data.getData();\n String[] filePathColumn = { MediaStore.Images.Media.DATA };\n\n Cursor cursor = getActivity().getContentResolver().query(\n selectedImage,\n filePathColumn,\n null,\n null,\n null\n );\n\n cursor.moveToFirst();\n\n int columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n String imagePath = cursor.getString(columnIndex);\n cursor.close();\n\n try {\n Bitmap bitmap = BitmapFactory.decodeFile(imagePath);\n\n previewImageView.setImageBitmap(bitmap);\n\n isImageSelected = true;\n listener.setSelectedImage(bitmap);\n\n existingImageButton.setVisibility(View.GONE);\n imageSelectedButtonsLinearLayout.setVisibility(View.VISIBLE);\n }catch (Exception e) {\n\n }\n }\n }", "public void SelectImage() {\n final CharSequence[] items = {\"Camera\", \"Gallery\", \"Cancel\"};\n androidx.appcompat.app.AlertDialog.Builder builder = new androidx.appcompat.app.AlertDialog.Builder(this);\n builder.setTitle(\"Add Image\");\n builder.setItems(items, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n if (items[i].equals(\"Camera\")) {\n\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(intent, CAMERA_KEY);\n }\n } else if (items[i].equals(\"Gallery\")) {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"image/*\");\n startActivityForResult(intent, GALLERY_KEY);\n } else if (items[i].equals(\"Cancel\")) {\n dialogInterface.dismiss();\n }\n }\n }).show();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == 0) {\n mSelectUri = data.getData();\n\n Bitmap bitmap = null;\n try {\n bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), mSelectUri);\n mImgPhoto.setImageDrawable(new BitmapDrawable(getResources(), bitmap));\n mBtnSelectPhoto.setAlpha(0);\n } catch (IOException e) {\n\n }\n }\n }", "@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n\t\tif (requestCode == RESULT_LOAD_IMAGE && resultCode == Activity.RESULT_OK && data != null) {\n\t\t\tUri selectedImage = data.getData();\n\t\t\tString[] filePathColumn = { MediaStore.Images.Media.DATA };\n\n\t\t\tCursor cursor = getActivity().getContentResolver().query(selectedImage, filePathColumn, null, null, null);\n\t\t\tcursor.moveToFirst();\n\n\t\t\tint columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n\t\t\tString picturePath = cursor.getString(columnIndex);\n\t\t\tcursor.close();\n\n\t\t\tBitmap image = ImageManager.getInstance().loadImageFromPath(picturePath);\n\t\t\trefreshBackgroundPreview(image);\n\t\t}\n\t\tif(requestCode == RESULT_LOAD_IMAGE){\n\n\t\t\t((RadioButton)(radiogroup.findViewById(R.id.dialog_new_level_radiobutton_fromdisk))).setChecked(false);\n\t\t}\n\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t}", "private void selectImage() {\n final CharSequence[] options = {\"Take Photo\", \"Choose From Gallery\", \"Cancel\"};\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(this);\n builder.setTitle(\"Select Option\");\n builder.setItems(options, (dialog, item) -> {\n if (options[item].equals(\"Take Photo\")) {\n dialog.dismiss();\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n selectedImage = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),\n \"image_\" + String.valueOf(System.currentTimeMillis()) + \".jpg\"));\n intent.putExtra(MediaStore.EXTRA_OUTPUT, selectedImage);\n startActivityForResult(intent, PICK_IMAGE_CAMERA);\n } else if (options[item].equals(\"Choose From Gallery\")) {\n dialog.dismiss();\n Intent pickPhoto = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n pickPhoto.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(pickPhoto, \"Compelete action using\"),\n PICK_IMAGE_GALLERY);\n } else if (options[item].equals(\"Cancel\")) {\n dialog.dismiss();\n }\n });\n builder.show();\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == AppConstants.OPEN_CAMERA_PICKER_IMAGE) {\n // Make sure the request was successful\n if (resultCode == Activity.RESULT_OK) {\n SubMediaGalleryActivity.imagesSelected.add(imageFilePath);\n setResultAndFinish();\n } else {\n finish();\n }\n } else if (requestCode == AppConstants.OPEN_CAMERA_PICKER_VIDEO) {\n // Make sure the request was successful\n if (resultCode == Activity.RESULT_OK) {\n SubMediaGalleryActivity.imagesSelected.add(imageFilePath);\n setResultAndFinish();\n } else {\n finish();\n }\n }\n }", "private void selectImage() {\n final CharSequence[] items = { \"Take Photo\", \"Choose from Library\", \"Remove Photo\",\n \"Cancel\"\n };\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setItems(items, (dialog, item) -> {\n if (items[item].equals(\"Take Photo\")) {\n requestStoragePermission(true);\n } else if (items[item].equals(\"Choose from Library\")) {\n requestStoragePermission(false);\n\t\t\t} else if (items[item].equals(\"Cancel\")) {\n\t\t\t\tdialog.dismiss();\n\t\t\t} else if (items[item].equals(\"Remove Photo\")) {\n\t\t\t\tremoveImage();\n\t\t\t}\n });\n builder.show();\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tswitch (requestCode) {\n\t\tcase TAKE_PHOTO: {\n\t\t\tif (resultCode == RESULT_OK) {\n\t\t\t\ttry {\n\n\t\t\t\t\t// ÏÔʾÅÄÕÕͼƬ\n\t\t\t\t\tIntent intent = this.getIntent();\n\t\t\t\t\tintent.setData(imageUri);\n\t\t\t\t\tsetResult(110, intent);\n\t\t\t\t\tSelectPicPopupWindow.this.finish();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase CHOOSE_PHOTO: {\n\t\t\tif (resultCode == RESULT_OK) {\n\t\t\t\tif (Build.VERSION.SDK_INT >= 19) {\n\t\t\t\t\thandleImageOnKitKat(data);\n\t\t\t\t} else {\n\t\t\t\t\thandleImageBeforeKitKat(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t}\n\t}", "private void SelectImage()\n {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(\n Intent.createChooser(\n intent,\n \"Select Image from here...\"),\n PICK_IMAGE_REQUEST);\n\n\n }", "private void chooseImage(int pickImageRequest) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), pickImageRequest);\n }", "private void selectImage() {\n // This will display and list three categories available for the user to select\n final CharSequence[] items = { \"Take Photo\", \"Choose from Library\",\n \"Cancel\" };\n\n // This displays the pop-up based on the items defined in the previous statement\n AlertDialog.Builder builder = new AlertDialog.Builder(MainScreen.this);\n builder.setTitle(\"Add Photo\");\n builder.setItems(items, new DialogInterface.OnClickListener() {\n /**\n * Once the dialogue options have been selected.\n * This code will produce different intent results based on that chosen\n * selection.\n * Authored by Anthony McDonald\n * @param dialog\n * @param item\n */\n @Override\n public void onClick(DialogInterface dialog, int item) {\n boolean result=Utility.checkPermission(MainScreen.this);\n\n if (items[item].equals(\"Take Photo\")) {\n userChosen =\"Take Photo\";\n if(result)\n cameraIntent();\n\n } else if (items[item].equals(\"Choose from Library\")) {\n userChosen =\"Choose from Library\";\n if(result)\n galleryIntent();\n\n } else if (items[item].equals(\"Cancel\")) {\n dialog.dismiss();\n }\n }\n });\n builder.show();\n }", "private void selectImage() {\n try {\n final CharSequence[] options = {\"Take Photo\", \"Choose From Gallery\",\"Cancel\"};\n android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(activity);\n builder.setTitle(\"Select Option\");\n builder.setItems(options, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int item) {\n if (options[item].equals(\"Take Photo\")) {\n dialog.dismiss();\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n startActivityForResult(intent, PICK_IMAGE_CAMERA);\n } else if (options[item].equals(\"Choose From Gallery\")) {\n dialog.dismiss();\n Intent pickPhoto = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(pickPhoto, PICK_IMAGE_GALLERY);\n } else if (options[item].equals(\"Cancel\")) {\n dialog.dismiss();\n }\n }\n });\n builder.show();\n } catch (Exception e) {\n Toast.makeText(getContext(), \"Camera Permission error\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "private void selectImage() {\n Intent pickIntent = new Intent(Intent.ACTION_PICK);\n pickIntent.setDataAndType(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,\"image/*\");\n\n startActivityForResult(pickIntent, PICK_IMAGE);\n }", "private void selectImage(Context context) {\n\t\tfinal CharSequence[] options = {\"Take Photo\", \"Choose from Gallery\", \"Cancel\"};\n\n\t\t//Display optionbox for user to choose how to upload their photo\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(context);\n\t\tbuilder.setTitle(\"Save a photo from the run...\");\n\n\t\tbuilder.setItems(options, new DialogInterface.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int item) {\n\t\t\t\t//Start camera capture intent if they chose to take a photo\n\t\t\t\tif (options[item].equals(\"Take Photo\")) {\n\t\t\t\t\tIntent takePicture = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\t\t\t\t\tstartActivityForResult(takePicture, 0);\n\n\t\t\t\t}\n\t\t\t\t//Start the media chooser intent if they wanted to choose from their gallery\n\t\t\t\telse if (options[item].equals(\"Choose from Gallery\")) {\n\t\t\t\t\tIntent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\t\t\t\t\tstartActivityForResult(pickPhoto, 1);\n\n\t\t\t\t}\n\t\t\t\t//Cancel = do nothing\n\t\t\t\telse if (options[item].equals(\"Cancel\")) {\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t//Show the dialogbox\n\t\tbuilder.show();\n\t}", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"image/jpeg\");\n intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);\n\n startActivityForResult(Intent.createChooser(intent, \"Complete action using\"), RC_PHOTO_PICKER);\n }", "@Override\n public void onClick(View view) {\n\n Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n try {\n i.putExtra(\"return-data\", true);\n startActivityForResult(\n Intent.createChooser(i, \"Select Picture\"), RESULT_LOAD_IMAGE);\n }catch (ActivityNotFoundException ex){\n ex.printStackTrace();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a VersionedAddressBook with an empty initial state.
public VersionedAddressBook() { super(); version = new LinearHistory<>(new AddressBook()); }
[ "public AddressBook() {\n addressEntryList = new ArrayList<AddressEntry>();\n addressCount = 0;\n }", "public AddressBook() {\n addressEntryList = new ArrayList<>();\n }", "public AddressBook() {\n\t\taddressCode = 0;\n\t\tiosAddressCode = null;\n\t\tagentId = null;\n\t\tname = null;\n\t\tgender = null;\n\t\tbirthDate = null;\n\n\t\tcreatedBy = null;\n\t\tcreationDate = null;\n\t\tmodifiedBy = null;\n\t\tmodificationDate = null;\n\t\trecruitmentProgressStatus = null;\n\n\t\treferalSource = null;\n\t\tgroup = null;\n\t\tresidentialAddress1 = \"\";\n\t\tresidentialAddress2 = \"\";\n\t\tresidentialAddress3 = \"\";\n\t\tresidentialPostalCode = \"\";\n\t\tregisteredAddress1 = \"\";\n\t\tregisteredAddress2 = \"\";\n\t\tregisteredAddress3 = \"\";\n\t\tregisteredPostalCode = \"\";\n\t\tfixedLineNO = null;\n\t\tmobilePhoneNo = null;\n\t\tofficePhoneNo = null;\n\t\tmarritalStatus = null;\n\t\teducation = null;\n\t\tworkingYearExperience = null;\n\t\tyearlyIncome = null;\n\t\tpresentWorkCondition = null;\n\t\tpurchasedAnyInsurance = null;\n\t\toutlookApperance = null;\n\t\trecommendedRecruitmentScheme = null;\n\t\tsalesExperience = null;\n\t\tremarks = null;\n\t\tweibo = null;\n\t\tweChat = null;\n\n\t\tidType = null;\n\t\tage = null;\n\t\tbirthPlace = null;\n\t\teMailId = null;\n\t\trace = null;\n\t\treJoin = null;\n\t\tqq = null;\n\t\tlastContactedDate = null;\n\t\trecruitedBy = null;\n\n\t\tnric = null;\n\t\ttalentProfile = null;\n\t\tnatureOfBusiness = null;\n\t\tcandidatePhoto = null;\n\t\tinterviewCompletionDate = null;\n\t\tdeleteStatus = false;\n\n\t\tbranchCode = null;\n\t\tcandidateAgentCode = null;\n\t\trecruitmentType = null;\n\t\tcontractDate = null;\n\n\t\tccTestResult = null;\n\t\tccTestResultDate = null;\n\t\tqrCode=null;\n\t\tnewComerSource=null;\n\t\tco = null;\n\n\t\tcandidateFamilyInfos = null;\n\t\tcandidateWorkExperiences = null;\n\t\tcandidateEducations = null;\n\t\tcandidateProfessionalCertifications = null;\n\t\tcandidateESignatures = null;\n\t\tcandidateGroups = null;\n\t\tcandidateNotes = null;\n\t}", "@Override\r\n\t\t\tpublic Object getNewObject() {\n\t\t\t\treturn AddressbookFactory.eINSTANCE.createContact();\r\n\t\t\t}", "public AddressBook(){\n\t\tsuper();\n\t}", "private AddressBook(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n }", "public static AddressBook getAddressBook(final Version version) {\r\n if (version == Version.Version1) {\r\n return new AddressBookImpl(version);\r\n }\r\n return null;\r\n }", "public XmlSerializableAddressBook() {\n persons = new ArrayList<>();\n assignments = new ArrayList<>();\n attendance = new ArrayList<>();\n }", "public CourseAddressBook() {\n super();\n }", "AddressBook create(final AddressBookNamePasswordPair pair);", "public Address() {\n \n this.name = null;\n this.postalAddress = null;\n this.phoneNumber = null;\n this.note = null;\n }", "@Test(expected = NullPointerException.class)\n public void testCreateAddressBook_Null() {\n // addContact() returns true meaning null was added in address book\n assertTrue(addressbook.addContact(null));\n // address book size equals 1 meaning null was added in address book\n assertEquals(1, addressbook.numberOfContacts());\n }", "public AddressBook(String address, String name, String surname) \r\n { \r\n this.address = address;\r\n this.name = name;\r\n this.surname = surname;\r\n }", "@SuppressWarnings(\"unused\")\n private Address() {\n super();\n }", "public Address() {\n this.street = \"\";\n this.barangay = \"\";\n this.city = \"\";\n this.province = \"\";\n this.country = \"\";\n }", "public Address() {\n \tsuper();\n }", "public PersonsContract() {}", "public Address (){\n \n }", "public Book() {\n this.number = \"\";\n this.name = \"\";\n this.checkedOut = false;\n this.datePublished = null;\n }", "@SuppressWarnings(\"unused\")\n private StreetAddress() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: a
void m15159a(String str, Exception exception);
[ "public interface C3511a {\n /* renamed from: a */\n void mo29057a(int i);\n }", "interface C4511c {\n /* renamed from: a */\n void mo29775a();\n }", "public interface ans {\n /* renamed from: a */\n void mo1174a();\n}", "public interface C24712af {\n /* renamed from: a */\n void mo64682a(List<Aweme> list);\n}", "public interface C11237e {\n /* renamed from: a */\n void mo39072a();\n}", "public interface C1837a {\n /* renamed from: a */\n void mo5414a(C1197a c1197a);\n }", "public interface C5635a {\n /* renamed from: a */\n void mo17734a(C5599a aVar);\n }", "public interface C21636a {\n /* renamed from: a */\n void mo57784a(String str);\n }", "interface cdw {\n /* renamed from: a */\n Object mo2685a(String str);\n}", "public interface C8405b<T> {\n /* renamed from: a */\n T mo21567a();\n}", "public interface aa extends ab {\r\n /* renamed from: a */\r\n void mo459a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo460a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo466b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo467b(int i) throws RemoteException;\r\n\r\n /* renamed from: h */\r\n float mo473h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n int mo474i() throws RemoteException;\r\n\r\n /* renamed from: l */\r\n int mo477l() throws RemoteException;\r\n\r\n /* renamed from: m */\r\n List<LatLng> mo478m() throws RemoteException;\r\n}", "interface C1026a {\n /* renamed from: a */\n void mo10282a(C1025el c1025el);\n\n /* renamed from: b */\n void mo10283b(C1025el c1025el);\n }", "public interface C4489a {\n /* renamed from: a */\n void mo12254a(int i);\n }", "public interface C40369ab {\n /* renamed from: a */\n void mo100344a();\n\n /* renamed from: a */\n void mo100345a(int i);\n}", "@Override // com.zhihu.android.base.widget.adapter.ZHRecyclerViewAdapter.ViewHolder\n /* renamed from: a */\n public void mo65331a(T t) {\n super.mo65331a((Object) t);\n mo82389n();\n }", "interface C0504b {\n /* renamed from: a */\n void mo7607a();\n }", "interface C17044s {\n /* renamed from: a */\n C17043r mo44275a(String str);\n}", "public interface C27423b {\n /* renamed from: a */\n C27422a mo70532a();\n\n /* renamed from: b */\n C27425d mo70533b();\n}", "public interface C11546e {\n /* renamed from: a */\n String mo29506a(Field field);\n}", "public interface C34109a {\n /* renamed from: a */\n RecommendList mo86759a();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case number: 11 /Coverage entropy=1.4901762161527465
@Test(timeout = 4000) public void test11() throws Throwable { JSONObject jSONObject0 = new JSONObject(); long long0 = jSONObject0.optLong("kf&tId/u.1"); assertEquals(0L, long0); Boolean boolean0 = Boolean.FALSE; String[] stringArray0 = new String[6]; stringArray0[0] = "kf&tId/u.1"; stringArray0[1] = "kf&tId/u.1"; stringArray0[2] = "] is not a Boolean."; stringArray0[3] = "kf&tId/u.1"; stringArray0[4] = "kf&tId/u.1"; stringArray0[5] = "kf&tId/u.1"; JSONObject jSONObject1 = new JSONObject(boolean0, stringArray0); String string0 = JSONObject.valueToString(jSONObject1, 0, 48); assertEquals("{}", string0); }
[ "@Test(timeout = 4000)\n public void test147() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n String string0 = evaluation0.toSummaryString(true);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test135() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n CostMatrix costMatrix0 = CostMatrix.parseMatlab(\".uD4;G~)**S]]\");\n Evaluation evaluation0 = new Evaluation(instances0, costMatrix0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test153() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n \n evaluation0.useNoPriors();\n assertEquals(Double.NaN, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test140() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.avgCost();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test152() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedTrueNegativeRate();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test191() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test178() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostMatrix costMatrix0 = new CostMatrix(0);\n Evaluation evaluation0 = new Evaluation(instances0, costMatrix0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test164() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.totalCost();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test(timeout = 4000)\n public void test161() throws Throwable {\n SimpleLogistic simpleLogistic0 = new SimpleLogistic((-2795), false, true);\n AdditiveRegression additiveRegression0 = new AdditiveRegression(simpleLogistic0);\n Capabilities capabilities0 = additiveRegression0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.correlationCoefficient();\n assertEquals(Double.NaN, double0, 0.01);\n }", "@Test(timeout = 4000)\n public void test074() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.unclassified();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test141() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = evaluation0.makeDistribution(Double.NaN);\n assertNotNull(doubleArray0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0, doubleArray0.length);\n }", "@Test(timeout = 4000)\n public void test061() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numTrueNegatives(1);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public void test128() throws Exception {\n testNScenario(\"java128\");\n }", "@Test(timeout = 4000)\n public void test158() throws Throwable {\n SimpleLogistic simpleLogistic0 = new SimpleLogistic((-2795), false, true);\n AdditiveRegression additiveRegression0 = new AdditiveRegression(simpleLogistic0);\n Capabilities capabilities0 = additiveRegression0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n try { \n evaluation0.KBMeanInformation();\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't compute K&B Info score: class numeric!\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "@Test(timeout = 4000)\n public void test060() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalsePositives((byte)74);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test128() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test155() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test079() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = evaluation0.makeDistribution(0.0);\n assertArrayEquals(new double[] {1.0, 0.0}, doubleArray0, 0.01);\n assertEquals(2, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertNotNull(doubleArray0);\n }", "@Test\r\n public void TestChi()\r\n {\n \tdouble dblChi = invchisquaredistribution(5, 0.95);\r\n \tConsole.WriteLine(dblChi);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: e
public static boolean m99789e() { if (C6399b.m19946v()) { return false; } Locale b = C43013ch.m136515b(); if (TextUtils.equals(b.getLanguage(), Locale.CHINESE.getLanguage()) || TextUtils.equals(b.getLanguage(), Locale.ENGLISH.getLanguage())) { return C7213d.m22500a().mo18803bo().showNewRelationFragment(); } return false; }
[ "@Override protected void process (int e) {\n\t\t}", "@Override\n\tpublic void eee() {\n\t\t\n\t}", "public void e() throws c {\n for (i a2 : this.f13971e) {\n a2.e();\n }\n }", "@Override\n\tpublic void visitEnemigo(Enemigo e) {\n\n\t}", "public int e() {\n return this.e;\n }", "void event(Event e)\n\t{\n\t\t\n\t}", "public void ec(){}", "@Override\r\n\t\t\tpublic void exceptionThrown(Exception e) {\n\t\t\t\tSystem.out.println(\"Exception thrown is - \" + e.toString());\r\n\t\t\t}", "public static void e(Exception e) {\r\n\r\n\t\te.printStackTrace();\r\n\r\n\t}", "@Override\n\tpublic void process(Entity e) {\n\t\t\n\t}", "@Override\n\tpublic void onException(Exception e) {\n\t\t\n\t}", "E getEvent();", "IS getE();", "private static String leggiEccezione(Throwable e) {\n\t\tStringBuilder sb = new StringBuilder(\" *** \");\n\t\tsb.append(e.getClass().getSimpleName());\n\t\tsb.append(\" *** \");\n\t\tsb.append(e.getMessage());\n\t\tfor(StackTraceElement se: e.getStackTrace()) {\n\t\t\tsb.append(\" @\");\n\t\t\tsb.append(se.getClassName());\n\t\t\tsb.append('#');\n\t\t\tsb.append(se.getLineNumber());\n\t\t}\n\t\tif(e.getCause()!=null) {\n\t\t\tsb.append(\" *** causa: \");\n\t\t\tsb.append(leggiEccezione(e.getCause()));\n\t\t}\n\t\treturn sb.toString();\n\t}", "public void e(String subject) {\n/* 84 */ this.e = subject;\n/* */ }", "@Override\n\tpublic void error(Exception e)\n\t{\n\t\t\n\t}", "public void setE(String e) {\n this.e = e;\n }", "public void captureEvents(Object e) {\r\n\t\treturn;\r\n\t}", "static /* synthetic */ void m256a(Throwable e) {\n Logger.getInstance().mo2140e(ErrorRequestListener.class.getName(), \"Erro por implementar\");\n e.printStackTrace();\n }", "@Override\n\t\t\tpublic void actionPerformed( ActionEvent e)\n\t\t\t{\n\t\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
package private for now; might become public someday
public ByteSequence getEpilogueRaw() { return epilogue; }
[ "protected void method_5557() {}", "protected void mo4791d() {\n }", "private BaseUtils() {}", "private FrameworkSupportUtils() {}", "private ConvertUtils() {\n\t}", "private InternalReflect() {\n\t\t\t// do nothing\n\t\t}", "private Helper() {\r\n\t}", "@Override\n public int utilite() {\n return 0;\n }", "private FileUtil() {\n\t\t// no operation\n\t}", "private PlanBuildingUtils() {}", "private B000066() {\r\n\r\n\t}", "private TestingTools() {\n\t\n\t}", "private CodiceFiscaleUtils() {\n }", "@Override\n public void extornar() {\n \n }", "protected abstract void mo3493a();", "private Helper() \n\t{\t\n\t}", "private ErlangConversionUtils() {\n throw new UnsupportedOperationException(\"do not instantiate\");\n }", "private NativeSupport() {\r\n\t}", "private AdapterUtils() {\n \t\t// prevents instantiation.\n \t}", "private MiscToolkit() {\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a set of data and scroll to last
public void addDataAndScrollToLast(int[] datas) { if (datas == null) return; for (int d : datas) { mEcgDatas.add(d); } post(new Runnable() { @Override public void run() { if (getWidth() != 0 && getHeight() != 0) { if (mMode == MODE_NORMAL) { mScrollX = 0; invalidate(); } } else { post(this); } } }); }
[ "private void addEndLessScrolling() {\n listSharks.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {\n super.onScrolled(recyclerView, dx, dy);\n if (dy > 0) {\n // scrolled down\n visibleItemCount = mLayoutManager.getChildCount();\n totalItemCount = mLayoutManager.getItemCount();\n pastVisibleItems = mLayoutManager.findFirstVisibleItemPosition();\n\n if (!isLoading) {\n // reached end\n // time to load new sharks\n if ((visibleItemCount + pastVisibleItems) >= totalItemCount) {\n isLoading = true;\n // handling pagination\n // incrementing page number\n calls++;\n Log.e(\"...\", \"Last Item Wow ! page : \" + calls);\n // calling sharks search api\n // with incremented page\n searchForSharks(calls);\n }\n }\n }\n }\n });\n }", "@Override\r\n\t\t\tpublic void onScroll(AbsListView view, int firstVisibleItem,\r\n\t\t\t\t\tint visibleItemCount, int totalItemCount) {\n\t\t\t\tint lastInScreen = firstVisibleItem + visibleItemCount; \r\n\t\t\t\t if((lastInScreen == totalItemCount &&!isload) ){ \r\n\t\t\t\t new AddData().execute(Config.URL_PROGRAM);\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t}", "private void scrollMyListViewToBottom() {\n getListView().post(new Runnable() {\n @Override\n public void run() {\n // Select the last row so it will scroll into view...\n getListView().setSelection(getListAdapter().getCount() - 1);\n }\n });\n }", "public void scrollToBottom() {\r\n\t\t//\r\n\t\tthis.selectAll();\r\n\t\tint x = this.getSelectionEnd();\r\n\t\tthis.select(x, x);\r\n\t}", "@Override\n public void onLoadMore() {\n listData.add(null);\n mAdapter.notifyItemInserted(listData.size() - 1);\n\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n // remove progress item\n listData.remove(listData.size() - 1);\n mAdapter.notifyItemRemoved(listData.size());\n //add items one by one\n int start = listData.size();\n int end = start + 5;\n\n for (int i = start + 1; i <= end; i++) {\n listData.add(new HomeData(R.drawable.lck, \"LCK Spring - Week 10 Day 1\", \"LoL Esports\"));\n listData.add(new HomeData(R.drawable.lamnguoiyeuanhnhebaby, \"Làm Người Yêu Anh Nhé Baby\", \"Nguyen Jenda\"));\n mAdapter.notifyItemInserted(listData.size());\n }\n mAdapter.setLoaded();\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n }, 2000);\n }", "protected void addOne() {\n for (int x = 0; x < 2; x++) {\n mAdapter.getData().add(0, \"\" + (addedIndex++));\n mAdapter.notifyItemInserted(0);\n }\n mRecyclerView.scrollToPosition(0);\n mSwipeRefreshLayout.setRefreshing(false);\n\n }", "@Override\n public void onLoadMore(int current_page) {\n ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPosition(focusPosition);\n loadMore();\n }", "public void scrollToBottom() {\n setScrollPosition(DOM.getElementPropertyInt(getElement(), \"scrollHeight\"));\n }", "@Override\n\t\t\tpublic void onScroll(AbsListView view, int firstVisibleItem,\n\t\t\t\t\tint visibleItemCount, int totalItemCount) {\n\t\t\t\tlastindex = firstVisibleItem + visibleItemCount - 1;\n\t\t\t}", "public void moveNext(){\n if(i+1<size)\n i++;\n getData(i);\n }", "@Override\r\n\tpublic void onLastItemVisible() {\n\t\tint nextPage = currentPage+1;\r\n\t\tloadData(nextPage,1);\r\n\t}", "public void loadNextDataFromApi(int offset) {\n // Send an API request to retrieve appropriate paginated data\n // --> Send the request including an offset value (i.e `page`) as a query parameter.\n maxId = Long.valueOf(tweets.get(tweets.size()-1).id)-1;\n client.getNextTimeline(maxId, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Headers headers, JSON json) {\n try {\n adapter.addAll(Tweet.fromJsonArray(json.jsonArray));\n adapter.notifyDataSetChanged();\n maxId = Long.valueOf(tweets.get(tweets.size()-1).id)-1;\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n @Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n\n }\n });\n // --> Deserialize and construct new model objects from the API response\n // --> Append the new data objects to the existing set of items inside the array of items\n // --> Notify the adapter of the new items made with `notifyItemRangeInserted()`\n }", "void moveToLast();", "@Override\n\t\t\tpublic void onLoadMore() {\n\t\t\t\tloadData();\n\t\t\t}", "public void scrollToEnd()\n\t{\n\t\tSwingUtilities.invokeLater(new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tscrollRowToVisible(m_Root.getChildCount());\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n\tpublic void getMoreDataList() {\r\n\t\tnew Thread(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tURL url;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tString lastId = list.get(list.size() - 1).getMemoryId();\r\n\t\t\t\t\tLog.i(\"sinceid\", lastId);\r\n\t\t\t\t\turl = new URL(AppKeys.GET_MORE_MEMORY_LIST_URL + lastId);\r\n\t\t\t\t\tgetMoreMemoryList(url);\r\n\t\t\t\t} catch (MalformedURLException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}).start();\r\n\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextOldDataFromApi(page);\n }", "@Override\n public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)\n {\n if (firstVisibleItem + visibleItemCount > latestAdapter.getCount())\n {\n if (firstVisibleItem + visibleItemCount >= 10)\n {\n if (!isLatestLoadOver && !isLatestLoading)\n {\n isLatestLoading = true;\n queryMyGoWith(pagenum);\n }\n }\n }\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n\n mLastMaxId = tweetsList.get(tweetsList.size()-1).getId();\n populateTheHomeTimeline(25, mLastSinceId, mLastMaxId);\n //Log.e(\"A\", mLastMaxId + \" \" + (mLastSinceId-1) + \" \" + newMaxId);\n //Log.e(\"H\", \"hit\");\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n // Minimum max_id (oldest tweet) is last tweet in tweets list\n max_id = tweets.get(tweets.size() - 1).id;\n // Fetch & display older tweets in timeline\n loadNextDataFromApi(max_id - 1);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.BaseResponse base = 1;
boolean hasBase();
[ "proto.MmBp.BaseResponse getBaseResponse();", "public Response() {\n setVersion(\"HTTP/1.0\");\n }", "public proto.MmBp.BaseResponse getBaseResponse() {\n return baseResponse_;\n }", "RhythmMmBp.BaseResponseOrBuilder getBaseResponseOrBuilder();", "@Override\r\n\tpublic void response() {\n\r\n\t}", "@Override\r\n\tpublic byte get_response_type() {\n\t\treturn 0;\r\n\t}", "public com.fanxi.service.message.RestfulBaseResponseProto.RestfulBaseResponse getBaseResponse() {\n return baseResponse_ == null ? com.fanxi.service.message.RestfulBaseResponseProto.RestfulBaseResponse.getDefaultInstance() : baseResponse_;\n }", "@DISPID(1012)\n @PropGet\n long responseEnd();", "@Override\n public void process(ResponseBuilder rb) throws IOException {\n }", "public NanoResponse() {\n this.status = RequestServer.HTTP_OK;\n }", "public void response(byte response) {\n\r\n\t}", "public void returnToBase() {\n\t}", "public ResponseMsgType getResponse(){\r\n return localResponse;\r\n }", "@Override\n\tvoid stateSpecificToResponse(byte[] responseByte) {\n\t\t\n\t}", "public boolean hasBaseResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "Response.Type getType();", "public Builder setBaseResponse(\n proto.MmBp.BaseResponse.Builder builderForValue) {\n if (baseResponseBuilder_ == null) {\n baseResponse_ = builderForValue.build();\n onChanged();\n } else {\n baseResponseBuilder_.setMessage(builderForValue.build());\n }\n bitField0_ |= 0x00000001;\n return this;\n }", "public final int getResponse() { return response;}", "P newResponse(R request);", "private AddResponse() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disconnects client form server.
public void disconnect() { socketWrapper.sendMessage("disconnect"); socketWrapper.disconnect(); }
[ "public void disconnect() {\n serverConnection.disconnect();\n }", "public void disconnect()\r\n {\r\n setRunning(false);\r\n if(_clientSocket != null)\r\n {\r\n StreamUtils.close(_clientSocket);\r\n }\r\n _disconnected.fireEvent(EventArgs.Empty);\r\n }", "public void disconnect() {\n quitServer();\n }", "public void disconnectFromServer() {\n try {\n // Close the socket\n if (null != this.clientSocket) {\n clientSocket.close();\n clientSocket = null;\n }\n\n // Close the command handler\n if (null != this.commandHandler) {\n this.commandHandler.close();\n this.commandHandler = null;\n }\n \n } catch (IOException e) {\n System.err.println(\"Could not close client connection, exiting program.\");\n System.exit(1);\n }\n \n // Mark client as \"Not connected.\"\n connected = false;\n }", "public void disconnect()\n {\n try\n {\n // Send disconnect message\n this.dataOut.writeBytes(\"&disconnect\\n\");\n this.dataIn.close();\n this.dataOut.close();\n // Close client socket\n this.socket.close();\n }\n catch (IOException ex)\n {\n ex.printStackTrace(System.err);\n }\n }", "public void disconnectClient()\n {\n // don't go below 0\n if (numClientsConnected > 0)\n {\n numClientsConnected--;\n }\n setChanged();\n notifyObservers();\n }", "private void disconnect(){\n client.shutdown();\n SocketHandler.setSocket(null);\n\n btnConnect.setVisibility(btnConnect.VISIBLE);\n btnDisconnect.setVisibility(btnDisconnect.INVISIBLE);\n\n Toast.makeText(LoginActivity.this, \"Disconnected\", Toast.LENGTH_SHORT).show();\n }", "public void disconnect(String server) {\n\t}", "public void disconnectClient(IClient client) throws RemoteException;", "public void disconnect() {\n this.disconnect(1000, DISCONNECT_MSG);\n }", "public void disconnect() {\n isConnected = false;\n }", "public void disconnect() {\n if (isConnected()) {\n try {\n connection.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "default void clientDisconnect() {}", "private void disconnect() {\n try {\n telnetClient.disconnect();\n } catch (IOException e) {\n System.err.println(\"Error disconnecting from Telnet server: \" + e.getMessage());\n }\n }", "public static void disconnect() {\r\n\r\n\t\tisConnected = false;\r\n\t\tclientThread.interrupt();\r\n\r\n\t\tif (inCall)\r\n\t\t\tplay.stop();\r\n\t\tinCall = false;\r\n\r\n\t\tJOptionPane\r\n\t\t\t\t.showMessageDialog(\r\n\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\"Ooops! You seem to have disconnected from the server. The application will exit.\");\r\n\t\tSystem.exit(0);\r\n\t}", "private void disconnect() {\n\t\tlogger.trace(\"disconnect() is called\");\n\t\t\n\t\tif (task != null){\n\t\t\ttask.stopServer();\n\t\t\ttask = null;\n\t\t\tconnectionStatusLabel.setText(offline);\n\t\t\tdisconnectToolBarButton.setEnabled(false);\n\t\t\tconnectToolBarButton.setEnabled(true);\n\t\t}\n\t}", "private void disconnect() throws IOException{\n if(client != null) {\n client.close();\n }\n }", "@Override\n\t synchronized protected void clientDisconnected(\n\t\t\t ConnectionToClient client) {\n\t\t System.out.println(\"Clinet disconnected\");\n\t\t logoutUser(client);\n\t }", "public abstract void onClientDisconnect(ClientInfo clientInfo, MessengerServer server);", "private void doDisconnectGame() {\n if (this.currentSession != null) {\n this.currentSession.removeClient(this.connection.getRemoteSocketAddress());\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Code to be executed when the ad is displayed.
@Override public void onAdOpened() { }
[ "@Override\n public void onAdLoaded() {\n System.out.println(\"------------onAdLoaded-----------------\");\n }", "@Override\n\t\tpublic void onModalAdDisplayed() {\n\t\t\tLog.i (CLASS_TAG,\"onModalAdDisplayed\");\n\t\t}", "@Override\n\t\tpublic void onModalAdPreDisplay() {\n\t\t\tLog.i (CLASS_TAG,\"onModalAdPreDisplay\");\n\t\t}", "@Override\n\tpublic void onAderInterstitialAdReady() {\n\t\tinterstitialAd.showAd(this);\n\t}", "@Override\n public void onAdLoaded() {\n Toast.makeText(MainActivity.this,\"Hello Banner Ad Loaded\",Toast.LENGTH_LONG).show();\n System.out.println(\"Hello Ad Banner Loaded\");\n }", "@Override\n public void didDisplayAd(RFMAdView arg0) {\n Log.v(LOG_TAG, \"Ad did display\");\n }", "@Override\n\t\t\tpublic void onAdStarted() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onAdShown(AppierNativeAd appierNativeAd) {\n }", "@Override\n public void onAdLoaded() {\n mInterstitialAd.show();\n }", "@Override\n\tpublic void onAderInterstitialAdPresent() {\n\t\t\n\t}", "@Override\n public void onAdDisplayed(MaxAd ad) {\n }", "@Override\n public void onAdLoaded() {\n adContainerView.setVisibility(View.VISIBLE);\n }", "public void sendBannerAdScreenPresented() {\n if (this.mBannerListener != null) {\n IronLog.CALLBACK.info(\"\");\n this.mBannerListener.onBannerAdScreenPresented();\n }\n }", "@Override\n public void onClick(View view) {\n if (mInterstitial.isAdLoaded()) {\n mInterstitial.displayAd();\n }\n else {\n Toast.makeText(MainActivity.this, \"Ad not ready yet\", Toast.LENGTH_SHORT).show();\n }\n }", "public void onDisplay() {\n\t}", "@Override\n\tpublic void showAd() {\n\t\tSystem.out.println(\"showAd() mock\");\n\t\tAdsHandler.handleAdJustWatched();\n//\t\tAdsHandler.handleAdNotAvailable();\n\t}", "public void displayInterstitial() {\n if (interstitialAds.isLoaded()) {\n interstitialAds.show();\n }\n }", "@Override\n public void onAdOpened() {\n Log.e(TAG, \"onAdOpened: \" );\n }", "public void displayInterstitial() {\n\t\tLog.d(this.getLocalClassName(),\"Displaying interstitial\");\n\t\tif(pAds != null)\n\t\t\tpAds.showInterstitial();\n\t}", "@Override\n \tpublic void adClicked() {\n \n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field wineBasicInfoRequest is set (has been assigned a value) and false otherwise
public boolean isSetWineBasicInfoRequest() { return this.wineBasicInfoRequest != null; }
[ "public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasGetAdditionalInfo() {\n return getAdditionalInfo_ != null;\n }", "public boolean isSetAuth_request() {\r\n return this.auth_request != null;\r\n }", "@java.lang.Override\n public boolean hasRequest() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public boolean hasBaseRequest() {\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\n\t\t}", "public boolean isSetRequestMap() {\n return this.requestMap != null;\n }", "public boolean isSetRequestParams() {\n return this.requestParams != null;\n }", "public boolean hasInfo() {\n return infoBuilder_ != null || info_ != null;\n }", "public boolean isSetRequest_id() {\n return this.request_id != null;\n }", "public boolean hasRequestHeader() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isConnectRequest() {\n\t\t\treturn (getFlags() & 7) == 2;\n\t\t}", "public boolean hasInfo() {\n return fieldSetFlags()[3];\n }", "public boolean hasRequestHeader() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMiscInfoQueryResp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasDetails() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasDetails() {\n return fieldSetFlags()[0];\n }", "public boolean isIsOnrequest() {\n return isOnrequest;\n }", "public boolean hasRequestType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasRequestType() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasRequestMsg() {\n return ((bitField0_ & 0x00000001) != 0);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Implementation of the DisplayAdjustmentListener interface. Invoked when a component or changes the scale.
public void displayAdjustmentValueChanged (DisplayAdjustmentEvent event) { start_base = event.getStart (); end_base = event.getEnd (); width_in_bases = event.getWidthInBases (); rev_comp_display = event.isRevCompDisplay (); recalculate_flag = true; if (event.getType () == DisplayAdjustmentEvent.ALL_CHANGE_ADJUST_EVENT) { selection_start_marker = null; selection_end_marker = null; } repaintCanvas (); }
[ "@Override\n public void componentResized(final ComponentEvent e) {\n setScale(getScale());\n }", "@Override\n\t\t\tpublic void adjustmentValueChanged(AdjustmentEvent e) {\n\t\t\t\tif (forwardScollpaneChanges) {\n\t\t\t\t\tm_display.pan(0, lastV - e.getValue());\n\t\t\t\t\tm_display.repaint();\n\t\t\t\t\tlastV = e.getValue();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"forwardScollpaneChanges is false\");\n\t\t\t\t}\n\n\t\t\t}", "public void onScaleChanged(float scale);", "public void onScaleUpdate();", "public void adjustmentValueChanged(AdjustmentEvent arg0) {\n\t\t\t\r\n\t\t}", "protected void updateScaleValue(){\n\t\t\n\t\t//removing all the listeners\n\t\tdisplayScaleCheckBox.removeActionListener(displayScaleCheckBoxListener);\n\t\t\n\t\t//initializing the widgets\n\t\tdisplayScaleCheckBox.setSelected(curveConfiguration.displayScale());\n\t\t\n\t\t//adding all the listeners\n\t\tdisplayScaleCheckBox.addActionListener(displayScaleCheckBoxListener);\n\t}", "public void adjustmentValueChanged(AdjustmentEvent e) {\n\t\t\t\tcolor[0] = e.getValue();\r\n\t\t\t\tsetTextField();\r\n\t\t\t\tsetBackGroundPanel();\r\n\t\t\t}", "public void componentResized(ComponentEvent evt) {\n\t\t\t\tdisplayFrame.setSize(displayFrame.getWidth(), (int) (displayFrame.getWidth() * aspectRatio));\r\n\t\t\t\t\r\n\t\t double ratio = 1;\r\n\t\t double currentWidth = displayFrame.getWidth();\r\n\t\t if (currentWidth != 0 && lastWidth !=0) {\r\n\t\t \tratio = currentWidth / lastWidth;\r\n\t\t }\r\n\t\t if (lastWidth != currentWidth) {\r\n\t\t \tlastWidth = currentWidth;\r\n\t\t\t totalScale *= ratio;\r\n\t\t\t\t\tIconComponent.setRatio(totalScale);\r\n\t\t }\r\n\t\t\t\tupdatePanel(boxPanel);\r\n\t\t\t\tupdatePanel(raiseSizePanel);\r\n\t\t\t\tupdatePanel(bgPanel);\r\n\t\t\t\tupdatePanel(buttonPanel);\r\n\t\t\t\tupdatePanel(potLabelPanel);\r\n\t\t\t\tupdatePanel(boardPanelWrapper);\r\n\t\t\t\tupdatePanel(actionLabelPanel);\r\n\t\t\t\tupdatePanel(chatPanel);\r\n \t\t}", "public void adjustmentValueChanged(AdjustmentEvent e) {\r\n // set scrolled component's position here:\r\n Adjustable srcAdj = e.getAdjustable();\r\n int val = e.getValue();\r\n\r\n Insets ins = scrollable.getInsets();\r\n Point loc = scrollable.getLocation();\r\n if (srcAdj == hAdj) {\r\n loc.x = ins.left - val;\r\n }\r\n if (srcAdj == vAdj) {\r\n loc.y = ins.top - val;\r\n }\r\n scrollable.setLocation(loc);\r\n int hSize = scrollable.getWidth() - getHrzInsets(ins);\r\n int vSize = scrollable.getHeight() - getVrtInsets(ins);\r\n Rectangle r = new Rectangle(ins.left, ins.top, hSize, vSize);\r\n scrollable.doRepaint(r); // repaint only client area\r\n }", "@Override\r\n public void componentResized(ComponentEvent e) {\r\n if (!component.isDisplayable()) {\r\n return;\r\n }\r\n scrollable.doRepaint();\r\n }", "@Override\r\n\t\t\t\tpublic void componentResized(ComponentEvent arg0) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\tpublic void componentResized(ComponentEvent arg0) {\n\r\n\t}", "public void onChartScale(MotionEvent me, float scaleX, float scaleY){}", "@Override\r\n\tpublic void componentResized(ComponentEvent e) {\n\t\tpantallaActual.redimensionarPantalla(e);\r\n\r\n\t}", "@Override\n public void onDisplayChanged(int displayId) {\n }", "@Override\n public void componentResized(ComponentEvent e) {\n\n }", "public void componentResized(ComponentEvent arg0) {\n int wid = getWidth();\n int ht = getHeight();\n int min = (wid < ht) ? wid : ht;\n gridUnit = min/MAX_UNITS;\n computeSpotLoc(wid, ht, gridUnit);\n updateGUI();\n }", "private void updateScale() {\n float x = (Float) xScaleModel.getValue();\n \n if (movableComponent != null) {\n Cell cell = editor.getCell();\n CellTransform cellTransform = cell.getLocalTransform();\n cellTransform.setScaling(x);\n movableComponent.localMoveRequest(cellTransform);\n editor.setPanelDirty(PositionJPanel.class, true);\n }\n }", "@Override\n public void componentResized(ComponentEvent e) {\n reLayout();\n }", "public void componentResized(ComponentEvent e) {\n System.out.println(\"componentResized: \" + \"\" \n \t\t+ getSize().getHeight() +\", \" + getSize().getWidth());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override protected String doInBackground(Object... params) { List<AchievmentsModel> resList = null; resList = MessageService.receiveAchievements( (AchievmentsSearchModel) params[0], MyAchievments.this); if (resList != null && !resList.isEmpty() && !resList.get(0).getFhbz().startsWith("0#")) { doing = resList.get(0).getDwzxz(); nf = setFloat(resList.get(0).getDwwwc()) + ""; finish = resList.get(0).getDwywc(); mfinish = setFloat(finish); mnf = setFloat(resList.get(0).getDwwwc()); md = setFloat(doing); all = (mfinish + mnf + md) + ""; mall = setFloat(all); if (mnf == 0 && md == 0 && mfinish == 0) { all = "0"; mall = 0; } return "0#"; } else { return "1#"; } }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used by rest get to client
private static String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); }
[ "public Object getClient(ClientInfo clientInfo);", "@Override\n\tprotected int onRestGet() {\n\t\treturn 0;\n\t}", "private FullHttpResponse onGet() {\n Long id = null;\n\n try {\n id = Long.parseLong(getPathParser().getPathStream().nextToken());\n } catch (NumberFormatException e) {\n appendln(\"Incorrect id format.\");\n return newClientErrorResponse(e, LOG);\n }\n\n Session session = null;\n Transaction txn = null;\n try {\n session = getSession();\n txn = session.beginTransaction();\n final User retInstance = UserDBUtil.getUserById(session, id, false);\n txn.commit();\n\n /* buffer result */\n return newResponseForInstance(id, retInstance);\n } catch (Exception e) {\n if (txn != null && txn.isActive()) {\n txn.rollback();\n }\n return newServerErrorResponse(e, LOG);\n }\n }", "@Override\n\tpublic void handleGET(CoapExchange exchange) {\n\n\t\t\n\t}", "public static RestHighLevelClient GetClient() { return client; }", "public String doHttpcall() {\n\t\t ServiceInstance\r\n\t si=client.choose(\"PRODUCER-(ORDER-SERVICE)\");\r\n\t \r\n\t //read uri and path \r\n\t String URL= si.getUri()+\"/show\";\r\n\t \r\n\t //MAKE HTTP CALL \r\n\t RestTemplate rt=new RestTemplate();\r\n\t \r\n\t String msg=rt.getForObject(URL, String.class);\r\n\t \r\n\t return msg;\r\n\t \r\n\t }", "public abstract T fetch(final QTRestClient client);", "public String get(String path){\n\n try {\n Client client = Client.create();\n\n WebResource webResource = client.resource(getHostAddress() + \":\" + getPort() + \"/api/\" + path);\n ClientResponse response = webResource.type(\"application/json\").get(ClientResponse.class);\n\n\n String output = response.getEntity(String.class);\n System.out.println(output);\n\n if (response.getStatus() != 0) {\n return output;\n }\n\n } catch (Exception e){\n e.printStackTrace();\n }\n return \"\";\n }", "RestfulRequest get(String uri);", "public String get(String path) {\n\n Client client = Client.create();\n\n WebResource webResource = client.resource(getHostAddress() + \":\" + getPort() + \"/api/\" + path);\n ClientResponse response = webResource.type(\"application/json\").get(ClientResponse.class);\n\n String output = response.getEntity(String.class);\n System.out.println(output);\n return output;\n\n }", "public RestConnectorResponse doGet (String url, HashMap<String, String> params, HashMap<String, String> headers, Collection<String> obfuscationMask);", "Client loadDetail(Client client);", "public interface NoPostServiceClient extends RestService {\n\n @GET\n @Path(\"nopost\")\n public void getNoPost(MethodCallback<List<LastPost>> callBack);\n\n\n}", "public interface ApiServer {\n\n public static String pid=\"IP000185\";\n public static String cid=\"14766\";\n public static String token=\"60c62ce38b6ccebd262498c5ae7e5d51\";\n public static String seed=\"1c498fdbe4315728\";\n public static String url=\"http://test.ddearn.com/appservice.svc/GetConfigInfo/Token=6ac6cf6541cd36781a3ae53b289153e6&Seed=075f604aec23de2d\";\n\n\n// http://test.ddearn.com/appservice.svc/GetProductDetail/Product_ID=IP000185&Cust_ID=14766&Token=60c62ce38b6ccebd262498c5ae7e5d51&Seed=1c498fdbe4315728\n\n @GET(\"GetProductDetail/Product_ID={Product_ID}&Cust_ID={Cust_ID}\")\n Call<BaseEntity<ProductDetails>> getProductDetail2(@Path(\"Product_ID\") String Product_ID, @Path(\"Cust_ID\") String Cust_ID);\n\n @GET(\"GetProductDetail/Product_ID={Product_ID}&Cust_ID={Cust_ID}&Token={Token}&Seed={Seed}\")\n Call<BaseEntity<ProductDetails>> getProductDetail1(@Path(\"Product_ID\") String Product_ID, @Path(\"Cust_ID\") String Cust_ID, @Path(\"Token\") String token, @Path(\"Seed\") String seed);\n\n @GET(\"GetProductDetail/Product_ID=IP000185&Cust_ID=14766&Token=60c62ce38b6ccebd262498c5ae7e5d51&Seed=1c498fdbe4315728\")\n Call<BaseEntity<ProductDetails>> getProductDetail();\n\n\n // http://test.ddearn.com/appservice.svc/GetConfigInfo/Token=6ac6cf6541cd36781a3ae53b289153e6&Seed=075f604aec23de2d\n @GET(\"GetConfigInfo/Token=6ac6cf6541cd36781a3ae53b289153e6&Seed=075f604aec23de2d\")\n Call<BaseEntity<List<AppConfig>>> GetConfigInfo();\n\n\n\n\n\n\n}", "public Client getClient () { return client; }", "@Override\n protected HttpRequestBase createHttpRequest(String... params) {\n String id = params[0];\n String url = Configuration.getInstance().getAllQuestsREST(id);\n HttpRequestBase request = new HttpGet(url);\n\n //Receiving JSON\n request.setHeader(\"Accept\", \"application/json\");\n\n return request;\n }", "@RestMethod(name=GET, path=\"/\")\r\n\tpublic void doGet(RestResponse res) {\r\n\t\tres.setOutput(GET);\r\n\t}", "@GET\n @Produces(\"text/plain\")\n public String get() {\n return \"Getting\";\n }", "@Override\n\tpublic void doRetrieve() {\n\t\t\n\t}", "public interface RestService {\n @GET(\"/topics\")\n void getAllTopics(@Query(\"page\") int page,@Query(\"size\") int size,RestCallBack<List<Topic>> callBack);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
finds customer id by tax id
public static int findCustID(int taxID){ int i; int tempCustID=0; for (i=0; i<customerList.size(); i++){ int tempTaxID; tempTaxID=customerList.get(i).getTaxID(); if (taxID==tempTaxID){ tempCustID=customerList.get(i).getCustID(); } } return tempCustID; }
[ "public Customer getCustomerByTaxId(String taxId)throws Exception{\n\t\tlog.info(\"inside getCustomerByTaxId\");\n\t\tCustomer customer=(Customer) hibernateTemplate.getSessionFactory().getCurrentSession().createCriteria(Customer.class)\n\t\t\t\t.add(Restrictions.eq(\"taxId\",taxId)).list().get(0);\n\t\tif(null!=customer)\n\t\t\treturn customer;\n\t\telse\n\t\t\tthrow new CustomersNotFoundException();\n\t}", "public Customer searchId(int id) throws CustNotFoundException;", "java.lang.String getSupplierTaxID();", "java.lang.String getSellerTaxId();", "public int indexOf(Taxon taxon);", "public String getcustomerid(String invoiceid) {\n\t\tPreparedStatement preparedStatement = null;\r\n\t\tString customerid = \" \";\r\n\t\ttry {\r\n\t\t\tString sql = \"select customerid from customer_sale where id=\"+invoiceid+\"\";\r\n\t\t\tpreparedStatement = connection.prepareStatement(sql);\r\n\t\t\tResultSet rs = preparedStatement.executeQuery();\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tcustomerid = rs.getString(1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn customerid;\r\n\t}", "public String getTaxId() {\n return this.taxId;\n }", "@Override\n\tpublic Customer findCustomerIdbyAccNo(int AccNo) {\n\t\treturn bankingdao.findCustomerIdbyAccNo(AccNo);\n\t}", "public Integer getIdTax() {\n return idTax;\n }", "public abstract CustomerInformation findCustomer(String customerID);", "public AdCustomer getCustomer(final int customerId) throws RowNotFoundException;", "@SuppressWarnings(\"unchecked\")\n\t\tpublic ArrayList<Orders> getOrdersofCustomers(Customer taxId) throws Exception{\n\t\t\tlog.info(\"inside getOrdersofAgent()\");\n\t\t\tAssert.notNull(taxId);\n\t\t\tArrayList<Orders> orders=(ArrayList<Orders>) hibernateTemplate.getSessionFactory().getCurrentSession().createCriteria(Orders.class)\n\t\t\t\t\t.add(Restrictions.eq(\"taxId\",taxId)).list();\n\t\t\tif(orders.isEmpty()){\n\t\t\t\tthrow new OrderNotFoundException();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn orders;\n\t\t\t}\n\t\t}", "private Customer findRecord(Long id) {\n\t\treturn ofy().load().type(Customer.class).id(id).get();\n\t}", "public Company getCompany(String taxCode);", "double findBalanceByCustomerId(long id);", "Customer getCustomerById(String customerId);", "@Override\r\n\tpublic Customer findBycusid(Integer cusid) {\n\t\treturn customerDao.findBycusid(cusid);\r\n\t}", "public WebElement getElementTaxId() {\n return getElementInput(\"//input[@name=\\\"tax_id\\\"]\");\n }", "boolean hasBuyerTaxId();", "Customer findCustomer(Long customerId) throws CustomerNotFoundException;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public String findPage(RoleQo roleQo, Integer index, Integer size) { return null; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_profile_followers_following_info, container, false); return view; }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.movie_statistic_layout, parent, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_question, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_volley2, container, false);\n\n // link graphical items to variables\n temperature = (TextView) view.findViewById(R.id.temperature);\n description = (TextView) view.findViewById(R.id.description);\n weatherBackground = (ImageView) view.findViewById(R.id.weatherbackground);\n\n // Implementation\n implementation();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n final View view = inflater.inflate(getLayout(), container, false);\n\n setupLayout(view);\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.bookmark_band_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.manu, container, false);\n getXmlList();\n copyFileList();\n initView();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_emotion_packet, container, false);\n initView(rootView);\n initListener();\n return rootView;\n }", "@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_opportunity, null);\r\n\r\n\t\t// 设置右上角的图标\r\n\t\taddButton = (ImageView) getActivity().findViewById(R.id.addButton);\r\n\t\taddButton.setImageResource(R.drawable.back);\r\n\t\taddButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tFragment newFragment = new MainFragment(R.id.business);\r\n\t\t\t\tString title = getString(R.string.business);\r\n\t\t\t\tgetFragmentManager().beginTransaction().replace(R.id.content_frame, newFragment).commit();\r\n\t\t\t\tTextView topTextView = (TextView) getActivity().findViewById(R.id.topTv);\r\n\t\t\t\ttopTextView.setText(title);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn view;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qr_gen, container, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_fate, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance){\n\n return inflater.inflate(R.layout.fragment_scrapbook, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_home, container, false);\n rcv = view.findViewById(R.id.RCV);\n comment = view.findViewById(R.id.Comment);\n lottie = view.findViewById(R.id.Lottie);\n ConnectXML();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n ViewGroup container, Bundle savedInstanceState) {\n initConfigAndView(inflater, container, R.layout.com_parse_ui_parse_login_help_fragment);\n\n mTxtInstructions = (TextView) mLayout.findViewById(R.id.login_help_instructions);\n mEdtEmailAddress = (EditText) mLayout.findViewById(R.id.login_help_email_input);\n mBtnSubmit = (Button) mLayout.findViewById(R.id.login_help_submit);\n\n mBtnSubmit.setOnClickListener(this);\n\n return mLayout;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bottom_sheet_details, container, false);\n // binding views\n boxMessage = view.findViewById(R.id.box_messages);\n boxResult = view.findViewById(R.id.box_result);\n htmlTextMessage = view.findViewById(R.id.html_text_message);\n progressLoading = view.findViewById(R.id.progress_loading_country);\n htmlTextNames = view.findViewById(R.id.text_country_names);\n htmlTextDetails = view.findViewById(R.id.text_country_details);\n imageFlag = view.findViewById(R.id.image_country_flag);\n // set loading message\n htmlTextMessage.setHtmlText(getString(R.string.html_message_loading_country, getArguments().getString(\"name\")));\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n\n return inflater.inflate(R.layout.fragment_account, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_guan_zhu, container, false);\n initView(inflate);\n initdata();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_whole_task, container, false);\n ButterKnife.bind(this, view);\n refreshLayout.setOnRefreshListener(this);\n refreshLayout.setOnLoadmoreListener(this);\n loadData();\n setAdapter();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_show_mult_att, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_timeline, parent, false);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GETS A PLAYER BY HIS ID
@GetMapping("/{id}") public ResponseEntity<?> getPlayerById(@PathVariable String id){ Player player = playerService.getPlayerById(id); return ResponseEntity.ok(player); }
[ "public Player getPlayerWithId(String playerId);", "public Player getPlayer(int playerID);", "public Player getPlayerById(int id){\n for(Player player : GameField.getInstance().getPlayers()){\n if(player.getId() == id){\n return player;\n }\n }\n LOG.error(\"Ein Spieler mit ID: \" + id + \" wurde nicht gefunden\");\n return null;\n }", "@Override\n\tpublic Player getPlayer(Long id) {\n\t\treturn iPlayerRepository.findById(id).get();\n\t}", "public Player getPlayer(int id) {\n for (Player player : players) {\n if (player.getPlayerId() == id)\n return player;\n }\n\n return null;\n }", "@Override\n public Player getPlayerById(long id) {\n String hql = \"FROM Player p where p.id = :id\";\n Session session = HibernateUtil.getSessionFactory().openSession();\n try {\n Query<Player> query = session.createQuery(hql);\n query.setParameter(\"id\",id);\n\n Player player = query.uniqueResult();\n logger.info(player.toString());\n return query.uniqueResult();\n } finally {\n session.close();\n }\n }", "public static IPlayer getByPlayerId(long playerId) {\n/* 35 */ return playerIdToPlayer.get(Long.valueOf(playerId));\n/* */ }", "public static Player getPlayerByID(int id){\r\n\t\tfor (Player p : Import_export_datas.allPlayers) {\r\n\t\t\tif(p.getPlayerId() == id){\r\n\t\t\t\treturn p;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Player find(Long id) {\n return players.stream()\n .filter(p -> p.getId().equals(id))\n .findFirst()\n .orElse(null);\n }", "public Player returnPlayerById(Integer id){\n\n return playerRepository.returnPlayerById(id);\n }", "public Player getPlayer(int id) {\n\n Player p = pf.getPlayer(id);\n\n if (p != null) {\n return p;\n }\n\n String query = \"SELECT p.name, p.team, t.name, p.number, p.current \"\n + \"FROM player as p, team as t \" + \"WHERE p.id = ? AND t.id = p.team;\";\n\n Player player = null;\n\n try (PreparedStatement prep = conn.prepareStatement(query)) {\n prep.setInt(1, id);\n ResultSet rs = prep.executeQuery();\n\n if (rs.next()) {\n String name = rs.getString(1);\n int teamID = rs.getInt(2);\n String teamName = rs.getString(THREE);\n int number = rs.getInt(FOUR);\n boolean current = rs.getBoolean(FIVE);\n\n player = pf.getPlayer(id, name, teamID, teamName, number, current);\n\n }\n } catch (SQLException e) {\n String message = \"Could not retrieve player \" + id + \" from the \"\n + \"database.\";\n close();\n throw new RuntimeException(message + e.getMessage());\n }\n\n return player;\n }", "public static Player getByID(long id){\n Player player = cache.get(id);\n if(player == null) {\n try {\n final Session session = HibernateUtil.getSessionFactory().openSession();\n session.beginTransaction();\n //parameterized where clause\n String whereClause = \" player_id = :id\";\n //whole query\n String query = \"FROM Player WHERE\" + whereClause;\n //create HQL query in session after retrieving from sessionFactory\n player = (Player) session\n .createQuery(query).setParameter(\"id\", id).list().get(0);\n session.getTransaction().commit();\n session.close();\n //put in cache since it wasnt in cache originally\n cache.put(id, player);\n }catch(Exception e){\n //catch all exceptions\n }\n }\n return player;\n }", "public ClientInterface getPlayerByID(int playerID) { return players.get(playerID); }", "@RequestMapping(path = \"player/{playerid}\", method = RequestMethod.GET)\n\n\t\tpublic Player getPlayerByID(@PathVariable(\"playerid\") String playerid) {\n\n\t\t\tPlayer player = snakeDao.getPlayerById(playerid);\n\n\t\t\treturn player;\n\t\t}", "public static Player get(String name, byte id) {\n synchronized (Player.PLAYER_MAP) {\n if (Player.PLAYER_MAP.containsKey(name)) {\n return Player.PLAYER_MAP.get(name);\n }\n\n LocalPlayer p = new LocalPlayer(name, id);\n Player.PLAYER_MAP.put(name, p);\n return p;\n }\n }", "public PlayerState getPlayer(int id) {\n return players.get(Integer.valueOf(id));\n }", "public CorePlayer getPlayerById(final UUID uid) {\n\t\tGuard.ArgumentNotNull(uid, \"uid\");\n\t\t\n\t\t// Check online players first\n\t\tCorePlayer p = onlinePlayers.get(uid);\n\t\tif (p == null) {\n\t\t\tp = players.get(uid);\n\t\t}\n\t\treturn p;\n\t}", "public Player getPlayer(String username);", "Player get(String name);", "@GetMapping(\"/players/{id}\")\n @Timed\n public ResponseEntity<Player> getPlayer(@PathVariable Long id) {\n Player player = playerService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(player));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override protected IBaseDao<Op_ChtypeOperate, String> getEntityDao() { return op_ChtypeOperateDao; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column TT_FUNCTION.STATUS
public void setStatus(String status) { this.status = status; }
[ "public void setStatus( String status )\n {\n fdf.setString( \"Status\", status );\n }", "sifnode.oracle.v1.Types.Status getStatus();", "@Test\n\tpublic void testSetStatus_fixture17_1()\n\t\tthrows Exception {\n\t\tDBTrigger fixture = getFixture17();\n\t\tString status = \"0123456789\";\n\n\t\tfixture.setStatus(status);\n\n\t\t// add additional test code here\n\t}", "@Column(name = \"STATUS\", length = EntityWithId.COLUMNLENGTH)\n \n \n public gov.nih.nci.calims2.domain.workflow.enumeration.MethodStatus getStatus() {\n return status;\n }", "public void setAdminMigrationStatus(Context context, String strStatus) throws Exception {\n // String cmd = \"modify program eServiceSystemInformation.tcl property MigrationR215VariantConfigurationGBOMPhase1 value \"+strStatus;\n String cmd = \"modify program $1 property $2 value $3 \";\n MqlUtil.mqlCommand(context, cmd, true, \"eServiceSystemInformation.tcl\", \"MigrationR215VariantConfigurationGBOMPhase1\", strStatus);\n }", "public void setStatus(String status){\n this.status=status;\n }", "private void setStatus(boolean value){\n this.status = value;\n }", "public void setStatus(boolean param) {\n this.localStatus = param;\n }", "void setStatus(final OTransaction.TXSTATUS iStatus);", "public void setStatus(boolean status){\n\t\tthis.status = status;\n\t}", "private void setStatus(String status)\n\t{\n\t\tmStatus=status;\n\t\tif (mCallback!=null)\n\t\t\tmCallback.onUpdated();\n\t}", "public void setStatus(String status){\r\n\t\tthis.status = status;\r\n\t}", "public void setStatus(String status)\r\n {\r\n this.status = status;\r\n }", "private void setStatus(String status) {\n\n this.status = status;\n }", "public void setStatus(boolean status) {\n this.status = status;\n }", "public void setStatus(Integer status)\r\n\t{\r\n\t\tthis.status = status;\r\n\t}", "@JsonProperty(\"status\")\n public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status)\n {\n this.status = status;\n }", "void setTransactionStatus(String transactionId, TransactionStatus status);", "public void setStatus(String status) {\n\t\tthis.status=Status.valueOf(status);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prepare configuration and start the service
public boolean startup();
[ "protected void internal_start() throws ConfigurationException {}", "public final void runClasspathService() {\n try {\n final Class cClasspath = Class.forName(ClassPathLoaderService.DYNAMIC_CLASS_NAME);\n final IStartService service = (IStartService) cClasspath.newInstance();\n service.setInstallDir(getInstallDir());\n service.setHostDir(VAL_OCTANE_HOST_DIR);\n service.setHasDebug(HAS_DEBUG);\n service.runService(); \n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } // End of the Try Catch // \n }", "protected void startServices() {\n QaiTestServerModule qaiTestServer = new QaiTestServerModule();\n QaiTestSecurityModule qaiTestSecurity = new QaiTestSecurityModule();\n injector = Guice.createInjector(qaiTestServer, qaiTestSecurity);\n\n //GuiceManagedContext managedContext = injector.getInstance(GuiceManagedContext.class);\n //provideHazelcastConfig(managedContext);\n // this looks crazy but just works...\n injector.injectMembers(qaiTestServer);\n\n injector.injectMembers(this);\n\n // so that the singleton is initialized\n QaiInjectorService.createInstance(injector);\n\n // the whole configuration takes place in guice\n // and the main instance is then distributed via injection\n String instanceName = hazelcastInstance.getName();\n logger.info(\"hazelcastInstance with name: '\" + instanceName + \"' has been started\");\n\n }", "private void configureServices() {\n // create services and make them available in our services map\n fileService = new CoreFileService(this);\n componentManager = new ComponentManager(this,\n config.isRemoteLibAllowed(), config.getLibraryPathsMap());\n dataService = new CoreDataService(this,\n config.isUnsetPropertiesAllowed());\n execService = new CoreExecService(this);\n\n services.put(FileService.class, fileService);\n services.put(ComponentService.class, componentManager);\n services.put(DataService.class, dataService);\n services.put(EventService.class, new CoreEventService(this));\n services.put(ExecService.class, execService);\n }", "private void handleAutoStart(\n @NonNull ServiceTask task,\n @NonNull SmartServiceTaskConfig config,\n @NonNull Collection<ServiceInfoSnapshot> preparedServices,\n @NonNull Collection<ServiceInfoSnapshot> runningServices,\n @NonNull Collection<ServiceInfoSnapshot> onlineServices\n ) {\n Collection<ServiceInfoSnapshot> allServices = new HashSet<>();\n allServices.addAll(preparedServices);\n allServices.addAll(runningServices);\n // check the prepared service count now as they don't count to the maximum services\n if (config.preparedServices() > preparedServices.size()) {\n var service = this.createService(task, config, allServices);\n // create only one service per heartbeat\n if (service != null) {\n return;\n }\n }\n // check if the maximum service count is reached\n if (config.maxServices() > 0 && runningServices.size() >= config.maxServices()) {\n return;\n }\n // only start services by the smart module if the smart min service count overrides the task min service count\n if (config.smartMinServiceCount() > task.minServiceCount()\n && config.smartMinServiceCount() > runningServices.size()) {\n var service = this.createService(task, config, runningServices);\n // check if the service was created successfully and start it\n if (service != null) {\n service.provider().start();\n // create only one service per heartbeat\n return;\n }\n }\n // check if the auto-start based on the player count is enabled\n if (config.percentOfPlayersForANewServiceByInstance() < 0) {\n return;\n }\n // validate that we can start a service now\n var nextAutoStartTime = this.autoStartBlocks.get(task.name());\n if (nextAutoStartTime != null && nextAutoStartTime >= System.currentTimeMillis()) {\n return;\n }\n // get the overall player counts\n var onlinePlayers = onlineServices.stream()\n .mapToDouble(service -> service.readProperty(BridgeDocProperties.ONLINE_COUNT))\n .sum();\n var maximumPlayers = onlineServices.stream()\n .mapToDouble(service -> Math.max(0, service.readProperty(BridgeDocProperties.MAX_PLAYERS)))\n .sum();\n // check if we can create a percentage count\n if (onlinePlayers == 0 || maximumPlayers == 0) {\n return;\n }\n // make the values absolute\n var absoluteOnline = onlinePlayers / runningServices.size();\n var absoluteMaximum = maximumPlayers / runningServices.size();\n // create the percentage\n var percentage = SmartUtil.percentage(absoluteOnline, absoluteMaximum);\n if (percentage >= config.percentOfPlayersForANewServiceByInstance()) {\n var service = this.createService(task, config, runningServices);\n // check if the service was created successfully and start it\n if (service != null) {\n service.provider().start();\n // block player based service starting now\n this.autoStartBlocks.put(\n task.name(),\n System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(config.forAnewInstanceDelayTimeInSeconds()));\n }\n }\n }", "public void start() {\n // These clears the existing configs\n Database.ordersToBeProcessed.clear();\n Database.ordersProcessed.clear();\n Database.basket.clear();\n Database.postcodes.clear();\n Database.suppliers.clear();\n Database.drones.clear();\n Database.staffs.clear();\n Database.users.clear();\n Database.postcodeDistance.clear();\n Database.shouldRestockDish = true;\n Database.shouldRestockIngredient = true;\n StockManagement.dishes.clear();\n StockManagement.ingredients.clear();\n\n // Establishes a new file in the path provided or override the existing file\n try (BufferedReader br = new BufferedReader(new FileReader(path))) {\n String line;\n\n // parse\n while ((line = br.readLine()) != null) {\n parse(line);\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Wrong file name!\");\n } catch (IOException e) {\n System.out.println(\"Config parser IO exception: \" + e);\n }\n }", "void startServices();", "@Override\n public void serviceStart() {\n for (int i = 0 ; i < taskCommunicators.length ; i++) {\n taskCommunicatorServiceWrappers[i].init(getConfig());\n taskCommunicatorServiceWrappers[i].start();\n }\n }", "protected abstract void initService();", "@Override\n public void start() throws TomsException {\n YamlReader reader = null;\n try {\n reader = new YamlReader(new FileReader(\"config/config.yaml\"));\n GlobalConfig current = reader.read(GlobalConfig.class);\n\n // copy.\n config.setServer(current.getServer());\n } catch (Exception e) {\n throw new TomsException(e);\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n throw new TomsException(e);\n }\n }\n }\n }", "@Override\n public void initialize() throws DiscoveryException {\n try {\n initServiceBaseProps();\n File configFile = new File(getMainServicesConfigPath(), CONFIG_FILE_NAME);\n\n if (configFile.exists()) {\n\n log.info(\"Loading config file...\");\n readConfig(configFile);\n log.info(\"Config file successfully loaded!\");\n\n manageRegistration();\n\n //contextService = findContextService(servID.contextURL);\n //log.info(\"Loading ontology file...\");\n //ontologyStr = resOntDesc.serializeOntology(getMainServicesConfigPath());\n //loadOntologyModels(getMainServicesConfigPath(), resOntDesc.getOntologyFileName());\n //log.info(\"Ontology file successfully loaded!\\n\");\n } else {\n log.error(\"Discovery Service configuration file not found: \" + configFile.toString());\n System.exit(4);\n }\n\n } catch (ServiceBaseException serviceBaseException) {\n throw new DiscoveryException(serviceBaseException);\n }\n }", "private void autoStartConfig()\n {\n List<String> servers = getAutoStartList();\n\n if (servers != null)\n {\n log.info(\"Startup detected for servers: {}\", startupServers);\n }\n\n SuccessMessageResponse response = operationalServices.activateServerListWithStoredConfig(sysUser.trim(), servers);\n\n if (response.getRelatedHTTPCode() == 200)\n {\n startupMessage = response.getSuccessMessage();\n }\n else\n {\n startupMessage = response.getExceptionErrorMessage();\n\n StartupFailEvent customSpringEvent = new StartupFailEvent(this, startupMessage);\n applicationEventPublisher.publishEvent(customSpringEvent);\n triggeredRuntimeHalt = true;\n }\n }", "public void start(Configuration config) {\n/* 86 */ maybeStartHelper(config);\n/* 87 */ super.start(config);\n/* */ }", "public void configure(Preferences prefs) throws ConfigurationException {\n services.put(PREF_ABC_MONITOR, prefs.getBoolean(PREF_START + PREF_ABC_MONITOR, true));\n services.put(PREF_POOL_MONITOR, prefs.getBoolean(PREF_START + PREF_POOL_MONITOR, true));\n services.put(PREF_RSS_GENERATOR, prefs.getBoolean(PREF_START + PREF_RSS_GENERATOR, true));\n services.put(PREF_RSS_MONITOR, prefs.getBoolean(PREF_START + PREF_RSS_MONITOR, true));\n services.put(PREF_VARIABLE_FETCHER, prefs.getBoolean(PREF_START + PREF_VARIABLE_FETCHER, true));\n services.put(PREF_WEEKLY_EMAILS, prefs.getBoolean(PREF_START + PREF_WEEKLY_EMAILS, true));\n services.put(PREF_WEEKLY_SUMMARY, prefs.getBoolean(PREF_START + PREF_WEEKLY_SUMMARY, true));\n services.put(PREF_UPDATE_DATETOOL, prefs.getBoolean(PREF_START + PREF_UPDATE_DATETOOL, true));\n services.put(PREF_WATCHED_DISCUSSIONS_CLEANER, prefs.getBoolean(PREF_START + PREF_WATCHED_DISCUSSIONS_CLEANER, true));\n services.put(PREF_RSS_OKSYSTEM, prefs.getBoolean(PREF_START + PREF_RSS_OKSYSTEM, true));\n services.put(PREF_RSS_JOBPILOT, prefs.getBoolean(PREF_START + PREF_RSS_JOBPILOT, true));\n services.put(PREF_RSS_JOBSCZ, prefs.getBoolean(PREF_START + PREF_RSS_JOBSCZ, true));\n services.put(PREF_RSS_64BIT, prefs.getBoolean(PREF_START + PREF_RSS_64BIT, true));\n services.put(PREF_UPDATE_TOP_STATISTICS, prefs.getBoolean(PREF_START + PREF_UPDATE_TOP_STATISTICS, true));\n services.put(PREF_UPDATE_STATISTICS, prefs.getBoolean(PREF_START + PREF_UPDATE_STATISTICS, true));\n services.put(PREF_JOB_OFFER_MANAGER, prefs.getBoolean(PREF_START + PREF_JOB_OFFER_MANAGER, false));\n services.put(PREF_USER_SCORE_SETTER, prefs.getBoolean(PREF_START + PREF_USER_SCORE_SETTER, false));\n services.put(PREF_USER_SYNC_SERVICE, prefs.getBoolean(PREF_START + PREF_USER_SYNC_SERVICE, false));\n services.put(PREF_WEB_SERVICES, prefs.getBoolean(PREF_START + PREF_WEB_SERVICES, false));\n services.put(PREF_SUBPORTAL_SCORE_SETTER, prefs.getBoolean(PREF_START + PREF_SUBPORTAL_SCORE_SETTER, false));\n\n delays.put(PREF_POOL_MONITOR, prefs.getInt(PREF_POOL_MONITOR + PREF_DELAY, 60));\n delays.put(PREF_RSS_GENERATOR, prefs.getInt(PREF_RSS_GENERATOR + PREF_DELAY, 60));\n delays.put(PREF_RSS_MONITOR, prefs.getInt(PREF_RSS_MONITOR + PREF_DELAY, 60));\n delays.put(PREF_VARIABLE_FETCHER, prefs.getInt(PREF_VARIABLE_FETCHER + PREF_DELAY, 60));\n delays.put(PREF_WATCHED_DISCUSSIONS_CLEANER, prefs.getInt(PREF_WATCHED_DISCUSSIONS_CLEANER + PREF_DELAY, 60));\n delays.put(PREF_RSS_OKSYSTEM, prefs.getInt(PREF_RSS_OKSYSTEM + PREF_DELAY, 60));\n delays.put(PREF_RSS_JOBPILOT, prefs.getInt(PREF_RSS_JOBPILOT + PREF_DELAY, 60));\n delays.put(PREF_RSS_JOBSCZ, prefs.getInt(PREF_RSS_JOBSCZ + PREF_DELAY, 60));\n delays.put(PREF_RSS_64BIT, prefs.getInt(PREF_RSS_64BIT + PREF_DELAY, 60));\n delays.put(PREF_USER_SYNC_SERVICE, prefs.getInt(PREF_USER_SYNC_SERVICE + PREF_DELAY, 160));\n delays.put(PREF_UPDATE_TOP_STATISTICS, prefs.getInt(PREF_UPDATE_TOP_STATISTICS + PREF_DELAY, 60));\n delays.put(PREF_UPDATE_STATISTICS, prefs.getInt(PREF_UPDATE_STATISTICS + PREF_DELAY, 60));\n delays.put(PREF_JOB_OFFER_MANAGER, prefs.getInt(PREF_JOB_OFFER_MANAGER + PREF_DELAY, 60));\n\n periods.put(PREF_POOL_MONITOR, prefs.getInt(PREF_POOL_MONITOR + PREF_PERIOD, 600));\n periods.put(PREF_RSS_GENERATOR, prefs.getInt(PREF_RSS_GENERATOR + PREF_PERIOD, 600));\n periods.put(PREF_RSS_MONITOR, prefs.getInt(PREF_RSS_MONITOR + PREF_PERIOD, 60));\n periods.put(PREF_VARIABLE_FETCHER, prefs.getInt(PREF_VARIABLE_FETCHER + PREF_PERIOD, 600));\n periods.put(PREF_WATCHED_DISCUSSIONS_CLEANER, prefs.getInt(PREF_WATCHED_DISCUSSIONS_CLEANER + PREF_PERIOD, 600));\n periods.put(PREF_RSS_OKSYSTEM, prefs.getInt(PREF_RSS_OKSYSTEM + PREF_PERIOD, 600));\n periods.put(PREF_RSS_JOBPILOT, prefs.getInt(PREF_RSS_JOBPILOT + PREF_PERIOD, 600));\n periods.put(PREF_RSS_JOBSCZ, prefs.getInt(PREF_RSS_JOBSCZ + PREF_PERIOD, 600));\n periods.put(PREF_RSS_64BIT, prefs.getInt(PREF_RSS_64BIT + PREF_PERIOD, 600));\n periods.put(PREF_UPDATE_STATISTICS, prefs.getInt(PREF_UPDATE_STATISTICS + PREF_PERIOD, 600));\n periods.put(PREF_JOB_OFFER_MANAGER, prefs.getInt(PREF_JOB_OFFER_MANAGER + PREF_PERIOD, 600));\n periods.put(PREF_USER_SYNC_SERVICE, prefs.getInt(PREF_USER_SYNC_SERVICE + PREF_PERIOD, 600));\n\n endpointUrlServices = prefs.get(PREF_USERS_DEPLOY_PATH, \"/users\");\n }", "public void start(){\n this.setServiceState(STATE.RUNNING);\n }", "@Override\n\tprotected void startService() {\n\n\t}", "@Override\n\tprotected void startService() {\n\t\t\n\t}", "public static void _startup() {\n LocalPlatform platform = LocalPlatform.get();\n availablePortIteratorWKA = platform.getAvailablePorts();\n availablePortIteratorWKA.next();\n\n int clusterPort = availablePortIteratorWKA.next();\n\n OptionsByType member1Options = createCacheServerOptions(clusterPort, TEST, 1, CACHE_CONFIG);\n OptionsByType member2Options = createCacheServerOptions(clusterPort, TEST, 2, CACHE_CONFIG);\n OptionsByType member3Options = createCacheServerOptions(clusterPort, TEST, 3, CACHE_CONFIG);\n OptionsByType member4Options = createCacheServerOptions(clusterPort, TEST, 4, CACHE_CONFIG);\n\n member1 = platform.launch(CoherenceCacheServer.class, member1Options.asArray());\n member2 = platform.launch(CoherenceCacheServer.class, member2Options.asArray());\n member3 = platform.launch(CoherenceCacheServer.class, member3Options.asArray());\n member4 = platform.launch(CoherenceCacheServer.class, member4Options.asArray());\n\n Eventually.assertDeferred(()->member1.getClusterSize(), is(4));\n\n Eventually.assertDeferred(()->member1.getServiceStatus(SERVICE_NAME1), is(ServiceStatus.MACHINE_SAFE));\n Eventually.assertDeferred(()->member1.getServiceStatus(SERVICE_NAME2), is(ServiceStatus.MACHINE_SAFE));\n Eventually.assertDeferred(()->member1.getServiceStatus(SERVICE_NAME3), is(ServiceStatus.MACHINE_SAFE));\n Eventually.assertDeferred(()->member1.getServiceStatus(SERVICE_NAME4), is(ServiceStatus.MACHINE_SAFE));\n }", "public void start() {\n\t\tfinal Configuration configuration = new TestConfiguration(this);\n\t\tfinal Execution<Configuration> analysis = new Execution<Configuration>(configuration);\n\t\tanalysis.executeBlocking();\n\t}", "public void start()\n {\n log.info(\"Starting BackupTool via its Unix Service Interface.\");\n \n commonStart(BackupToolMain.staticArgs);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto generated setter method
public void setINSDSeq_primaryAccession(java.lang.String param){ localINSDSeq_primaryAccessionTracker = param != null; this.localINSDSeq_primaryAccession=param; }
[ "abstract protected void set(Object value);", "@Override\n protected void doSetValue(Object value) {\n super.doSetValue(value);\n }", "@Override\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tpublic Object setValue(Object value) {\n \t\t\twrite();\n \t\t\treturn me.setValue( value );\n \t\t}", "@Override\n\tpublic void setValue() {\n\t\t\n\t}", "public abstract void _set(int value);", "@Override\n\tprotected Object doSet(String property, Object value) {\n\t\treturn super.doSet(property, value);\n\t}", "public void set(T value) ;", "@Override\n\t\tpublic void setValue(Object value) {\n\t\t}", "public void setValue(String value)\n/* */ {\n/* 74 */ this.value = value;\n/* */ }", "public void set(String name, Object value);", "protected void set(T value) throws CmdLineException\n {\n setter.addValue(value);\n }", "void set(String name, String value);", "public interface SetProxy { void set(String name, Object val); }", "abstract public void set(String property, String value);", "public void set(T value);", "public void setValue(String value)\r\n/* 16: */ {\r\n/* 17:46 */ this.value = value;\r\n/* 18: */ }", "@Override\r\n public void set(T value){\r\n this.data = value;\r\n }", "public final void setValue(String attributeName, Object value) {\n if (getValueObject() == null) {\n return;\n }\n try {\n Method[] writeMethods = (Method[]) voSetterMethods.get(attributeName);\n if (writeMethods != null) {\n Object oldValue = getValue(attributeName);\n if (value != null) {\n if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(java.sql.Date.class)\n && value.getClass().equals(java.util.Date.class)) {\n value = new java.sql.Date(((java.util.Date) value).getTime());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(java.sql.Timestamp.class)\n && value.getClass().equals(java.util.Date.class)) {\n value = new java.sql.Timestamp(((java.util.Date) value).getTime());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(java.sql.Timestamp.class)\n && value.getClass().equals(java.sql.Date.class)) {\n value = new java.sql.Timestamp(((java.sql.Date) value).getTime());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Integer.class)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Integer(((java.math.BigDecimal) value).intValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Integer.TYPE)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Integer(((java.math.BigDecimal) value).intValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Long.class)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Long(((java.math.BigDecimal) value).longValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Long.TYPE)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Long(((java.math.BigDecimal) value).longValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Double.class)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Double(((java.math.BigDecimal) value).doubleValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Double.TYPE)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Double(((java.math.BigDecimal) value).doubleValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Float.class)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Float(((java.math.BigDecimal) value).floatValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Float.TYPE)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Float(((java.math.BigDecimal) value).floatValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Short.class)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Short(((java.math.BigDecimal) value).shortValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].equals(Short.TYPE)\n && value.getClass().equals(java.math.BigDecimal.class)) {\n value = new Short(((java.math.BigDecimal) value).shortValue());\n } else if (writeMethods[writeMethods.length - 1].getParameterTypes()[0].isEnum() //Nelson Moncada\n && value.getClass().isEnum()) {\n Class c = value.getClass();\n value = Enum.valueOf(c, value.toString());\n }\n }\n\n Object obj = getValueObject();\n if (obj != null) {\n for (int i = 0; i < writeMethods.length - 1; i++) {\n obj = writeMethods[i].invoke(obj, new Object[0]);\n\n // check if the inner v.o. is null...\n if (obj == null) {\n if (!createInnerVO) {\n return;\n } else {\n obj = (ValueObject) writeMethods[i].getReturnType().newInstance();\n }\n }\n }\n }\n\n if (value == null && oldValue != null\n || value != null && oldValue == null\n || value != null && oldValue != null && !value.equals(oldValue)) {\n boolean isOk =\n form.getFormController() == null\n ? true\n : form.getFormController().validateControl(\n attributeName,\n oldValue,\n value);\n if (isOk) {\n writeMethods[writeMethods.length - 1].invoke(obj, new Object[]{value});\n fireValueChanged(attributeName, oldValue, value);\n } else {\n form.pull(attributeName);\n }\n }\n }\n } catch (Exception ex) {\n Logger.error(this.getClass().getName(), \"setValue\", \"Error while writing the value object attribute '\" + attributeName + \"'\", ex);\n }\n }", "public abstract void setValue(final Object value);", "public Method getSetter() {\n\n return setter;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
map of items to pending runnables, so we can cancel a removal if need be
public TestAdapter() { ArrayList<Event> events; DatabaseAccess databaseAccess; databaseAccess = DatabaseAccess.getInstance(getApplicationContext()); databaseAccess.open(); events = databaseAccess.getFavorites(); databaseAccess.close(); items = new ArrayList<>(); itemsPendingRemoval = new ArrayList<>(); // let's generate some items // this should give us a couple of screens worth for (int i=0; i < events.size(); i++) { items.add(events.get(i)); } }
[ "private void removeFromPendingItem(TimerNI item) {\n\t\tfinal int count = mPending.size();\n\t\tfor( int i = count-1; i >= 0; i-- ) {\n\t\t\tTimerNI t = mPending.get(i);\n\t\t\tif( t == item ) {\n\t\t\t\tmPending.remove( i );\n\t\t\t}\n\t\t}\n\t\titem.zeroPendingCount();\n\t}", "@SuppressWarnings(\"rawtypes\")\n private void runBeforeTriggeredActions() {\n // remove them from the list of cancellable commands\n ArrayList<OneTimeRunnable> list = new ArrayList<>(myRunBeforeActions);\n myRunBeforeActions.clear();\n\n for (OneTimeRunnable runnable : list) {\n List<Class> classes = new ArrayList<>(myCancelActionsMap.keySet());\n for (Class key : classes) {\n HashSet<OneTimeRunnable> values = myCancelActionsMap.get(key);\n values.remove(runnable);\n if (values.isEmpty()) {\n myCancelActionsMap.remove(key);\n }\n }\n }\n\n list.forEach((runnable) -> {\n if (debug) System.out.println(\"Running before triggered task \" + runnable);\n runnable.run();\n });\n }", "public int removeTasks(Collection<ITask> listOfTasksToRemove);", "protected void addRulesDerivingPendingNonTerminal(RuleStateItem item, String nonterm, Syntax syntax, List todo)\t{\n\t\t// make the closure for one item:\n\t\t// if pointer before a nonterminal, add all rules that derive it\n\t\tfor (int i = 0; i < syntax.size(); i++)\t{\n\t\t\tRule rule = syntax.getRule(i);\n\t\t\t\n\t\t\tif (rule.getNonterminal().equals(nonterm))\t{\n\t\t\t\tRuleStateItem rsi = createRuleStateItem(i, rule);\n\n\t\t\t\tif (entries.containsKey(rsi) == false)\t{\n\t\t\t\t\tentries.put(rsi, rsi);\t// real entry list\n\t\t\t\t\ttodo.add(rsi);\t// work list\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void buildAndAddTasksWithPendingMappingForUser() {\n final SFlowNodeInstance normalTask1 = buildAndAddNormalTask(\"normalTask1\", ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN, PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN);\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(normalTask1.getId()).build());\n final SFlowNodeInstance normalTask2 = buildAndAddNormalTask(\"normalTask2\", ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN, PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN);\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(normalTask2.getId()).build());\n final SFlowNodeInstance normalTask3 = buildAndAddNormalTask(\"normalTask3\", ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN, PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN);\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(normalTask3.getId()).build());\n\n // Tasks KO not assigned & pending for john, and OK not assigned & not pending\n final SFlowNodeInstance executingTask = buildAndAddExecutingTask();\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(executingTask.getId()).build());\n final SFlowNodeInstance notStableTask = buildAndAddNotStableTask();\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(notStableTask.getId()).build());\n final SFlowNodeInstance terminalTask = buildAndAddTerminalTask();\n repository.add(aPendingActivityMapping().withUserId(JACK_ID).withActivityId(terminalTask.getId()).build());\n buildAndAddNormalTask(\"normalTask1\", ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS, PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS);\n\n // Tasks OK not assigned & pending for Bob\n final SFlowNodeInstance normalTask4 = buildAndAddNormalTask(\"normalTask1\", ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_BOB, PROCESS_DEFINITION_ID_SUPERVISED_BY_BOB);\n repository.add(aPendingActivityMapping().withUserId(PAUL_ID).withActivityId(normalTask4.getId()).build());\n\n // Tasks OK not assigned & pending for Bob, process not supervised\n final SFlowNodeInstance normalTask5 = buildAndAddNormalTask(\"normalTask1\", ROOT_PROCESS_INSTANCE_ID_NOT_SUPERVISED, PROCESS_DEFINITION_ID_NOT_SUPERVISED);\n repository.add(aPendingActivityMapping().withUserId(PAUL_ID).withActivityId(normalTask5.getId()).build());\n }", "@Test\n public void testTaskWithPendingMessage() {\n JobDispatcher jobDispatcher = new JobDispatcher();\n // Preparing the inputs\n Map<String, SortedSet<Integer>> currentInstanceToTaskAssignments = new HashMap<>();\n SortedSet<Integer> tasks = new TreeSet<>();\n tasks.add(PARTITION_ID);\n currentInstanceToTaskAssignments.put(INSTANCE_NAME, tasks);\n Map<Integer, AbstractTaskDispatcher.PartitionAssignment> paMap = new TreeMap<>();\n CurrentStateOutput currentStateOutput = prepareCurrentState(TaskPartitionState.RUNNING,\n TaskPartitionState.RUNNING, TaskPartitionState.DROPPED);\n JobContext jobContext = prepareJobContext(TaskPartitionState.RUNNING);\n JobConfig jobConfig = prepareJobConfig();\n Map<String, Set<Integer>> tasksToDrop = new HashMap<>();\n tasksToDrop.put(INSTANCE_NAME, new HashSet<>());\n WorkflowControllerDataProvider cache = new WorkflowControllerDataProvider();\n jobDispatcher.updatePreviousAssignedTasksStatus(currentInstanceToTaskAssignments,\n new HashSet<>(), JOB_NAME, currentStateOutput, jobContext, jobConfig, TaskState.IN_PROGRESS,\n new HashMap<>(), new HashSet<>(), paMap, TargetState.START, new HashSet<>(), cache,\n tasksToDrop);\n Assert.assertEquals(paMap.get(0)._state, TaskPartitionState.DROPPED.name());\n }", "void uncompleteAll(){\n for(Task t : tasks){\n t.uncomplete();\n }\n System.out.println(\"All tasks are now marked as pending!\");\n }", "protected void shrinkEmptyItems(){\n \n ThreadLocal<ArrayBlockingQueue<UUID>> thListJobDone = new ThreadLocal<ArrayBlockingQueue<UUID>>();\n try{\n ArrayBlockingQueue<UUID> listOfDoneJob = new ArrayBlockingQueue<UUID>((int) this.forWriteQueue.size());\n thListJobDone.set(listOfDoneJob);\n Boolean notHaveDoneJob = Boolean.FALSE;\n for( Map.Entry<UUID, ConcurrentHashMap<Integer, ?>> itemJob : this.forWriteQueue.entrySet() ){\n if( itemJob.getValue().isEmpty() ){\n thListJobDone.get().add(itemJob.getKey());\n }\n }\n try{\n if( !thListJobDone.get().isEmpty() ){\n do{\n UUID poll = thListJobDone.get().poll();\n if( poll != null){\n this.forWriteQueue.remove(poll);\n UUID ceilingKey = this.forWriteQueue.ceilingKey(poll);\n if( ceilingKey == null ){\n thListJobDone.get().add(poll);\n }\n }\n\n }while( !thListJobDone.get().isEmpty() );\n }\n } catch ( ClassCastException ex ){\n ex.printStackTrace();\n } catch ( NullPointerException ex ){\n ex.printStackTrace();\n }\n } finally {\n thListJobDone.remove();\n }\n }", "public synchronized void cancelAll(Port timerPort_)\r\n {\r\n if (qkey == null) return;\r\n qkey.reset();\r\n map.clear();\r\n }", "private static void processItems(final int n) {\r\n\t\twhile (!aiThreadTasks.isEmpty()) {\r\n\t\t\tInteger idToRemove = aiThreadTasks.poll().call();\r\n\t\t\tsynchronized (individualsIds) {\r\n\t\t\t\tindividualsIds.remove(idToRemove);\r\n\t\t\t}\r\n\t\t}\r\n\t\tLogger.aiDebug(\"Processed \" + n + \" AI items\", LogLevel.TRACE);\r\n\t}", "protected void processWaitingList() {\n\t\tfor (Entry<Agent, Objective> e : waitingList) {\n\t\t\taddAgent(e.getKey(), e.getValue());\n\t\t}\n\t\twaitingList.clear();\n\t}", "void handleUpdate(IfaceUpdater upd)\n{\n for (Iterator<Map.Entry<IfaceCall,Set<IfaceCall>>> it1 = rename_map.entrySet().iterator(); it1.hasNext(); ) {\n Map.Entry<IfaceCall,Set<IfaceCall>> ent = it1.next();\n if (upd.isCallRemoved(ent.getKey())) {\n it1.remove();\n }\n else {\n int ct = 0;\n for (Iterator<IfaceCall> it2 = ent.getValue().iterator(); it2.hasNext(); ) {\n IfaceCall c2 = it2.next();\n if (upd.isCallRemoved(c2)) it2.remove();\n else ++ct;\n }\n if (ct == 0) it1.remove();\n }\n }\n}", "public void setWaiting(Queue<ClockProcess> list) {this.waiting = list;}", "private void updatePendingRequests() {\n\n synchronized (pendingCommands) {\n while (!pendingCommands.isEmpty()) {\n // logger.info(\"Updating All Pending Requests {} > {} \", pendingCommands.size(), log.getCommitIndex());\n final PendingCommand<T> item = pendingCommands.poll();\n if (item.entry.index <= log.getStateMachineIndex()) {\n logger.debug(\"Returning Pending Command Response To Client {}\", item.entry);\n item.handler.handleResponse(item.entry);\n } else {\n pendingCommands.addFirst(item);\n return;\n }\n }\n }\n }", "private void removeFinishedTasks() {\n imageList.removeIf(new Predicate<Image>() {\n @Override\n public boolean test(Image t) {\n return t.hasFinished();\n }\n });\n }", "private void testConcurrencyInternal(final int maxCapacity, final int numInitialEntries, final int entriesPerOperation, final int maxTimeoutSeconds)\n throws Exception {\n final BoundedBlockingQueue<String> bbq = new BoundedBlockingQueue<>(maxCapacity, new PriorityQueue<>());\n final List<Runnable> runnables = new ArrayList<>();\n\n for (int i = 0; i < numInitialEntries; i++)\n bbq.add(\"initial \" + i);\n\n // adds 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++) {\n try {\n bbq.add(\"add \" + i);\n } catch (IllegalStateException e) {\n i--;\n }\n }\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // adds 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n if (!bbq.offer(\"offer \" + i))\n i--;\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // adds 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n if (!bbq.offer(\"offer timeout \" + i, 100, TimeUnit.MILLISECONDS))\n i--;\n } catch (InterruptedException e) {\n System.err.println(e);\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // adds 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n bbq.put(\"put \" + i);\n } catch (InterruptedException e) {\n System.err.println(e);\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // removes 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n if (bbq.poll() == null)\n i--;\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // removes 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n if (bbq.poll(100, TimeUnit.MILLISECONDS) == null)\n i--;\n } catch (InterruptedException e) {\n System.err.println(e);\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // removes 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++)\n if (bbq.take() == null)\n i--;\n } catch (InterruptedException e) {\n System.err.println(e);\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // removes 10 entries\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++) {\n String peek = bbq.peek();\n if (!(bbq.contains(peek) && bbq.remove(peek)))\n i--;\n }\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n // performs additional operations while reading and writing to the queue\n runnables.add(() -> {\n int i = 0;\n try {\n for (i = 0; i < entriesPerOperation; i++) {\n int size = bbq.size();\n assertTrue(size >= 0 && size <= maxCapacity);\n int cap = bbq.remainingCapacity();\n assertTrue(cap >= 0 && cap <= maxCapacity);\n }\n } finally {\n assertEquals(entriesPerOperation, i);\n }\n });\n\n assertConcurrent(\"BoundedBlockingQueue concurrency test\", runnables, maxTimeoutSeconds);\n\n Iterator<String> iter = bbq.iterator();\n int numLeft = 0;\n while (iter.hasNext()) {\n iter.next();\n numLeft++;\n }\n\n assertEquals(numInitialEntries, numLeft);\n\n List<String> drain = new ArrayList<>();\n bbq.drainTo(drain);\n\n assertEquals(numInitialEntries, drain.size());\n assertEquals(0, bbq.size());\n }", "CaseInstanceMigrationBuilder removeWaitingForRepetitionPlanItemDefinitionMapping(RemoveWaitingForRepetitionPlanItemDefinitionMapping mapping);", "private interface ObdTasks {\n public static final int CONNECT_DEVICE = 0;\n public static final int MANAGE_DEVICE = 1;\n public static final int QUEUE_PROCESSOR = 2;\n public static final int SEED_COMMANDS = 3;\n }", "private void invalidateCreatedTasks(String type) {\n synchronized (createdTasks) {\n Vector v = (Vector) createdTasks.get(type);\n if (v != null) {\n Enumeration enum = v.elements();\n while (enum.hasMoreElements()) {\n WeakishReference ref=\n (WeakishReference) enum.nextElement();\n Task t = (Task) ref.get();\n //being a weak ref, it may be null by this point\n if(t!=null) {\n t.markInvalid();\n }\n }\n v.removeAllElements();\n createdTasks.remove(type);\n }\n }\n }", "public static void main(String[] args) throws Exception{\n Map m = new HashMap();\n m.put(null, null);\n System.out.println(m);\n List<String> list = new ArrayList<>();\n list.add(\"1\");\n list.add(\"2\");\n Iterator iterator = list.iterator();\n while(iterator.hasNext()){\n String nex = (String) iterator.next();\n if(\"2\".equals(nex)){\n iterator.remove();\n }\n }\n// for(String s : list){\n// if(\"2\".equals(s)){\n// list.remove(s);//抛出异常\n// }\n// }\n System.out.println(list);\n// ReentrantLock lock = new ReentrantLock();\n//\n// Runnable r1 = new Runnable() {\n// @Override\n// public void run() {\n// System.out.print(\"foo\");\n// }\n// };\n// Runnable r2 = new Runnable() {\n// @Override\n// public void run() {\n// System.out.print(\"bar\");\n// }\n// };\n// ExecutorService executorService = Executors.newCachedThreadPool();\n// final Semaphore semaphore = new Semaphore(1);\n// final CountDownLatch countDownLatch = new CountDownLatch(1);\n// for (int i = 0; i < 1 ; i++) {\n// executorService.execute(() -> {\n// try {\n// semaphore.acquire();\n// fooBar.foo(r1);\n// semaphore.release();\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n// countDownLatch.countDown();\n// });\n// }\n// for (int i = 0; i < 1 ; i++) {\n// executorService.execute(() -> {\n// try {\n// semaphore.acquire();\n// fooBar.bar(r2);\n// semaphore.release();\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n// countDownLatch.countDown();\n// });\n// }\n// countDownLatch.await();\n// executorService.shutdown();\n\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Driver program to test above functions
public static void main(String[] args) { System.out.println(compareString("road", "doar")); System.out.println(compareString("road", "door")); }
[ "private void testing() {\n\t}", "public void testSample(){\r\n\r\n\t}", "public static void main(String[] args) {\n\t\n\t\t// Each function here should test a different class.\n\n\t\t// CharLinkedList\n\t\ttestCharLinkedList();\n\n\t\t// SuffixTreeNode\n\t\ttestSuffixTreeNode(); \n/*\n\t\t// longestRepeatedSuffixTree\n\t\ttestLongestRepeatedSuffixTree();\n*/\n\t\t//SuffixTree\n\t\tTree_tests();\n\t\t\n\t\t// Notifying the user that the code have passed all tests. \n\t\tif (testPassed) {\n\t\t\tSystem.out.println(\"All \" + testNum + \" tests passed!\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tvatest(1,2,3);\r\n\t\tvatest(\"Testing: \",10,20);\r\n\t\tvatest(true,false,false);\r\n\t\tvatest(1458);\r\n\t}", "@Test\n\tpublic void Driver() {\n\n\t\tfinal Object testingData[][] = {\n\n\t\t\t//Test #01: Correct execution of test. Expected true.\n\t\t\t{\n\t\t\t\t\"instructor1\", \"test@mail.com\", \"testName\", \"345456\", \"http://www.profile.org\", \"edit@mail.com\", null\n\t\t\t},\n\n\t\t\t//Test #02: Attempt to save an endorser record without proper credentials. Expected false.\n\t\t\t{\n\t\t\t\t\"user2\", \"test@mail.com\", \"testName\", \"345456\", \"http://www.profile.org\", \"edit@mail.com\", IllegalArgumentException.class\n\t\t\t},\n\n\t\t\t//Test #03: Attempt to edit an endorser record with blank fields. Expected false.\n\t\t\t{\n\t\t\t\t\"instructor1\", \"test@mail.com\", \"\", \"345456\", \"\", \"\", ConstraintViolationException.class\n\t\t\t}\n\n\t\t};\n\n\t\tfor (int i = 0; i < testingData.length; i++)\n\t\t\tthis.Template((String) testingData[i][0], (String) testingData[i][1], (String) testingData[i][2], (String) testingData[i][3], (String) testingData[i][4], (String) testingData[i][5], (Class<?>) testingData[i][6]);\n\t}", "private void doTest() {\r\n\r\n\t}", "public void testManualTest()\n {\n\n }", "public static void main(String[] args) {\n repeatTest();\n// deferTest();\n// scan2ReduceTest();\n// ditinctTest();\n// mergeTest();\n// retryTest();\n// catchTest();\n// timestampTest();\n// async();\n }", "public static void main(String[] args) throws IOException {\n test05();\n }", "public static void main(String[] args) {\n System.out.println(\"this is for test\" );\n// demoOperation();\n// demoString();\n// demoList();\n// demoMapTable();\n// demoSet();\n// demoException();\n// demoOO();\n demoFunction();\n\n }", "public static void main( String...args )\n\t\t{\n\t\tTestData();\n\t\t}", "public static void main(String[] args) throws Exception {\r\n\r\n // startTest1();\r\n // startTest2();\r\n // startTest2printFile();\r\n // testTurnoverRotors();\r\n // bombeChallengeOne();\r\n // bombeChallengeTwo();\r\n // bombeChallengeThree();\r\n // startTest2Extension();\r\n\r\n\r\n }", "public void testIt() {\n\t}", "public static void main(String[] args) {\n\ttest(tests);\n }", "public void testSchedbotFF() {\n\t}", "@Test\n public void mainUITest() {\n //check the main menu\n testMainMenu();\n startDebugGame();\n disableFarmNoise(); // moo\n testConsole(); \n testTaskAndWorkerManager();\n testWorldSettings();\n testStorage();\n }", "public static void main(String[] args) {\n\t\tselectTest();\r\n\t\t//selectTest(2);\r\n\t\t//deleteTest(2);\t\r\n\t\t//updateTest();\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n Tester tester = new Tester(\"Robinson\", 'M', 28, 11, \"SDET\", 120000);\n tester.eat(\"steak\");\n tester.sleep();\n tester.testing();\n // tester.code();\n // tester.fixBugs();\n\n System.out.println(\"tester = \" + tester);\n Developer developer = new Developer(\"Selda\", 'F', 27, 12, \"Java Developer\", 130000);\n developer.eat(\"sushi\");\n developer.sleep();\n // developer.testing();\n developer.code();\n developer.fixBugs();\n\n Driver driver = new Driver(\"John\", 'M', 79, 13, \"Truck Driver\", 85000);\n driver.eat(\"lobster\");\n driver.sleep();\n // driver.testing();\n // driver.code();\n // driver.fixBugs();\n\n\n }", "public static void main(String[] args) {\n\t\t\n\t\ttest();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tTestCalculator testcal = new TestCalculator();\r\n\t\tboolean output1 = testcal.testParser();\r\n\t\tboolean output2 = testcal.testAdd();\r\n\t\tboolean output3 = testcal.testMultiplication();\r\n\t\t//if all testing are working\r\n\t\tif (output1 && output2 && output3) {\r\n\t\t\tSystem.out.println(\"Congratulations, your Calculator appears to be working.\");\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_informacoes, menu); return true; }
[ "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflator = getMenuInflater();\n\t\tinflator.inflate(R.menu.activity_action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n public boolean onCreateOptionsMenu( android.view.Menu menu)\r\n {\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_activity_actions, menu);\r\n return super.onCreateOptionsMenu(menu);\r\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tmenu.clear();\n\t\tinflater.inflate(R.menu.main_action, menu);\n\t\t// ((IdtActivity)\n\t\t// getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.abc_ic_ab_back_mtrl_am_alpha);\n\t\t// repl(Fra, args, isFinish);\n\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater(); // Get menu inflater from context\n \tinflater.inflate(R.menu.menu, menu); // use inflater to inflate menu from resource xml\n \treturn true; // \n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.base_action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater=getMenuInflater();\n\t\tinflater.inflate(R.menu.menuitem, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(android.view.Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.inventory_menu, menu);\n iMenu = menu;\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action_bar_item, menu);\n\t\tadditem = menu.findItem(R.id.new_show);\n\t\tacceptitem = menu.findItem(R.id.accept_show);\n\t\tedititem = menu.findItem(R.id.edit_show);\n\t\tdeleteitem = menu.findItem(R.id.delete_show);\n\t\tif (menu != null) {\n\t\t\tsetActionBar();// function to set menu item display\n\t\t}\n\t\treturn super.onCreateOptionsMenu(menu);\n\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.cmdlist_activity_action, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.info_actions, menu);\r\n return super.onCreateOptionsMenu(menu);\r\n }", "private void inflateAdditionalMenu() {\n\t\tinflateMenu = true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\tgetMenuInflater().inflate(org.ideas4j.DoSomething.R.menu.menubar, menu);\n\treturn true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n this.menu = menu;\n\n MenuItem action_add = menu.findItem(R.id.action_add);\n action_add.setVisible(false);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action_bar, menu);\r\n\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.item_info, menu);\n \t\treturn true;\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto generated getter method
public long getDicomSeriesPk(){ return localDicomSeriesPk; }
[ "public MethodDoc getGetter()\r\n {\r\n return m_jvdGetter;\r\n }", "public long getGetter() {\n return getter_;\n }", "public T get() {\n return value;\n }", "public abstract M get();", "@Override\n \tpublic String get() {\n \t\treturn null;\n \t}", "public Object get() {\n return toString();\n }", "public Getter get() {\n\t\treturn new TestGetter();\r\n\t}", "abstract int get();", "public String getCodigo()\r\n/* 105: */ {\r\n/* 106: 94 */ return this.codigo;\r\n/* 107: */ }", "public String get (String name);", "public abstract A get();", "public T get() {\n return get(getLanguage(), false);\n }", "public Producto getProducto()\r\n/* 103: */ {\r\n/* 104:116 */ return this.producto;\r\n/* 105: */ }", "public int getFoo() { return 3; }", "public String getNombre()\r\n/* 70: */ {\r\n/* 71: 72 */ return this.nombre;\r\n/* 72: */ }", "@Override\n\tpublic void get(String property) {\n\t\t\n\t}", "@Override\n\tpublic String get() {\n\t\treturn _get(String.class);\n\t}", "public Empresa getEmpresa()\r\n/* 238: */ {\r\n/* 239:380 */ return this.empresa;\r\n/* 240: */ }", "@Override\n public A get() {\n return value;\n }", "@Override\n public T get() {\n return (T) build();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Covers all matches, exact case
@Test public void testContainingAllExactMatch() { List<Tweet> containing = Filter.containing(Arrays.asList(tweet1, tweet2), Arrays.asList("talk")); assertFalse("expected non-empty list", containing.isEmpty()); assertTrue("expected list to contain tweets", containing.containsAll(Arrays.asList(tweet1, tweet2))); assertEquals("expected same order", 0, containing.indexOf(tweet1)); }
[ "String exactMatch();", "public void testSmallMatching()\n {\n _testMatching(\"single\");\n _testMatching(\"1\", \"2a\");\n _testMatching(\"first\", \"secondlong\", \"3rd\");\n }", "LMatchCase createLMatchCase();", "@Override\n public boolean match(String text) {\n return match.equalsIgnoreCase(text);\n }", "HistoricCaseInstanceQuery matchVariableNamesIgnoreCase();", "boolean isMatchAnyEnabled();", "public static void main(String[] args) {\n boolean res = wordPatternMatch(\"aabb\",\"xyzabcxzyabc\");\r\n // boolean res = wordPatternMatch(\"aaaa\",\"asdasdasdasd\");\r\n System.out.println(res);\r\n \r\n \r\n }", "protected boolean matches(String phrase) {\n String canonical = phrase.toLowerCase(Locale.US);\n for(String word : ban) {\n if(canonical.indexOf(word) != -1)\n return true;\n }\n return false;\n }", "@Test\n public void test0() {\n assertFalse(isMatch(\"aa\", \"a\"));\n assertTrue(isMatch(\"aa\", \"aa\"));\n assertFalse(isMatch(\"aaa\", \"aa\"));\n }", "public static void main(String[] args) {\n\t\tString s1=\"abcdefgh\";\r\n\t\tSystem.out.println(s1.regionMatches(0, \"ooooabcdefghoooo\", 4, 8));\r\n\t\t\r\n\t\t//Ignore case\r\n\t\tSystem.out.println(s1.regionMatches(true , 0, \"ooooABCDEFGHoooo\", 4, 8));\r\n\t\t\r\n\t}", "public void testMatchAll() {\n PatternMatcher matcher = factory.get(null);\n assertTrue(matcher.matches(\"\", matchContext));\n assertTrue(matcher.matches(\"\", matchContext));\n assertTrue(matcher.matches(\"abc\", matchContext));\n assertTrue(matcher.matches(null, matchContext));\n }", "@Override\n public boolean matches()\n {\n return false;\n }", "@Override\n public boolean match(String text) {\n return match.equals(text);\n }", "@Test\n\tpublic void testCaseExactMatchFullContainment()\n\t{\n\t\tList<String> sourceTokens = TOKENIZER.tokenize(\"19.7 in\"); \n\t\tList<List<String>> targetTokens = Lists.newArrayList();\n\t\ttargetTokens.add(TOKENIZER.tokenize(\"19.7 in\"));\n\t\t\n\t\trunTest(sourceTokens, targetTokens, Lists.newArrayList(EXACT_DOUBLE_COMPARER), FULL_MATCH);\t\t\t\n\t}", "@Test\n\tpublic void testCaseFuzzyMatchFullContainment()\n\t{\n\t\tList<String> sourceTokens = TOKENIZER.tokenize(\"19.7 in\"); \n\t\tList<List<String>> targetTokens = Lists.newArrayList();\n\t\ttargetTokens.add(TOKENIZER.tokenize(\"19.7 in\"));\n\t\t\n\t\trunTest(sourceTokens, targetTokens, Lists.newArrayList(FUZZY_DOUBLE_COMPARER), FULL_MATCH);\t\t\t\n\t}", "@Test\n public void TestCase_matchesCorrectCases() {\n TestCase test = new TestCase(9, new int[] { 3, 2, 1, 1 }, new Operands(2, 1, 2), new int[] { 3, 2, 2, 1 });\n List<String> found = test.run().matching;\n assertEquals(3, found.size());\n assertTrue(found.contains(\"mulr\"));\n assertTrue(found.contains(\"addi\"));\n assertTrue(found.contains(\"seti\"));\n }", "@Test public void toMatchResultTest() throws Exception {\n Pattern pattern = PF.compile(\"squid\");\n Matcher matcher = pattern.matcher(\n \"agiantsquidofdestinyasmallsquidoffate\");\n matcher.find();\n int matcherStart1 = matcher.start();\n MatchResult mr = matcher.toMatchResult();\n if (mr == matcher)\n Assert.fail();\n int resultStart1 = mr.start();\n if (matcherStart1 != resultStart1)\n Assert.fail();\n matcher.find();\n int matcherStart2 = matcher.start();\n int resultStart2 = mr.start();\n if (matcherStart2 == resultStart2)\n Assert.fail();\n if (resultStart1 != resultStart2)\n Assert.fail();\n MatchResult mr2 = matcher.toMatchResult();\n if (mr == mr2)\n Assert.fail();\n if (mr2.start() != matcherStart2)\n Assert.fail();\n//// RegExTest.report(\"toMatchResult is a copy\");\n }", "@Test\n public void testIsMatch() {\n String[] fulls = new String[]{\"aa\", \"aa\", \"aa\", \"ab\", \"aab\"};\n String[] partials = new String[]{\"aa\", \"a*\", \".*\", \".*\", \"c*a*b\"};\n\n String[] fulls2 = new String[]{\"aa\", \"aaa\"};\n String[] partials2 = new String[]{\"a\", \"aa\"};\n\n for (int i = 0 ; i < fulls.length; i++) {\n assertTrue(isMatch(fulls[i], partials[i]));\n }\n\n for (int i = 0 ; i < fulls2.length; i++) {\n assertFalse(isMatch(fulls2[i], partials2[i]));\n }\n assertTrue(isMatch(\"aaa\", \"*.a\") == isMatch2(\"aaa\", \"*.a\"));\n }", "protected abstract List<String> match(String message);", "@Test\n public void testReplaceMultipleSameSearchForText() throws IOException {\n this.replaceSelectedAndCheck(\"testReplaceMultipleSameSearchForText\", CaseSensitivity.INSENSITIVE);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the productname value for this Lbmonitor.
public void setProductname(java.lang.String productname) { this.productname = productname; }
[ "private void setProductName(String value) {\n\t\tthis.productName = value;\n\t}", "public void setProductName(java.lang.CharSequence value) {\n this.product_name = value;\n }", "public void setProductName(String productName) {\r\n setFieldValue(8, 0, productName, Fit.SUBFIELD_INDEX_MAIN_FIELD);\r\n }", "public void setName(String partName) {\r\n this.name = partName;\r\n this.prodNameProperty.set(partName);\r\n }", "public void setProductItemName(String pProductItemName) {\n mProductItemName = pProductItemName;\n }", "public void setName(String name) throws IllegalProductArgumentException {\n if (isValidName(name)) {\n this.name = name;\n } else {\n throw new IllegalProductArgumentException(\"Invalid product name\");\n }\n }", "public com.learning.bookstore.model.product.Product.Builder setName(java.lang.String value) {\n validate(fields()[0], value);\n this.name = value;\n fieldSetFlags()[0] = true;\n return this;\n }", "public void setName(String pname)\n\t{\n\t\tthis.name=pname;\n\t}", "public ProductBuilder setName(String pName) {\r\n \r\n this.name = pName;\r\n \r\n return this;\r\n \r\n }", "@Test\n\tpublic void testSetProductName_1()\n\t\tthrows Exception {\n\t\tProductCatalog fixture = new ProductCatalog();\n\t\tfixture.setCatagoryName(\"clothing\");\n\t\tfixture.setImageUrl(\"xyz\");\n\t\tfixture.setProductIdChild(\"pd11_a\");\n\t\tfixture.setProductName(\"shirt\");\n\t\tfixture.setProductIdParent(\"pd11\");\n\t\tfixture.setPrice(\"300\");\n\t\tString productName = \"shirt\";\n\n\t\tfixture.setProductName(productName);\n\n\t\t// add additional test code here\n\t}", "public String getProductName() {\r\n return this.productName;\r\n }", "public void setName(String Name) {\r\n if (!productName.test(Name)) {\r\n this.Name = Name;\r\n } else {\r\n throw new IllegalArgumentException(\"Name Field Cannot be empty\");\r\n }\r\n }", "public void setProductDescription(java.lang.String productDescription)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PRODUCTDESCRIPTION$10, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(PRODUCTDESCRIPTION$10);\n }\n target.setStringValue(productDescription);\n }\n }", "public void setProduct(String product) {\n if (product.matches(\"[A-Za-z]*/s?[A-Za-z]?\"))\n this.product = product;\n else\n new IllegalArgumentException(\"product name must be alphabet\");\n }", "public String getProductName() {\r\n return ProductName;\r\n }", "public void setJlProductId(String productId) {\n jlProductId.setText(productId);\n }", "public final String getProductName() {\n\t\treturn this.productName;\n\t}", "private static void printProductChangeNameDialog(Product product) {\n\t\t// Print out request for a new name of the product\n\t\tSystem.out.printf(PRODUCT_CHANGE_ATTRIBUTE_FORMAT_STRING, NAME_STRING,\n\t\t\t\t'\"' + product.getName() + '\"', NAME_STRING);\n\t\t// Read the new name until its size will be greater than zero\n\t\tString newName = Input.readString();\n\t\twhile (newName.length() == 0) {\n\t\t\tSystem.out.print(INVALID_INPUT_ERROR_STRING);\n\t\t\tnewName = Input.readString();\n\t\t}\n\t\t// Change the name of the product and print out confirmation message\n\t\tproduct.setName(newName);\n\t\tSystem.out.printf(PRODUCT_ATTRIBUTE_CHANGED_FORMAT_STRING, NAME_STRING);\n\t}", "public final native void setName(String name) /*-{\r\n\t\tthis.name = name;\r\n\t}-*/;", "public ProductBuilder withName(ProductName productName) {\n this.name = productName;\n return this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check current event in the list
@Override public boolean accept(AccessibilityEvent t) { if ((t.getEventType() & mMask) != 0) { return true; } // no match yet return false; }
[ "public boolean isEventActive(){\n long currentTime = Calendar.getInstance().getTimeInMillis() / 1000L;\n return currentTime < Long.parseLong(event_details.getTimestamp());\n }", "private boolean checkEventName(String name) {\n for (Event current : Database.listEvents) {\n if (current.getName().toLowerCase().equals(name.toLowerCase())) {\n return true;\n }\n }\n return false;\n }", "boolean hasEvent2();", "boolean hasEvent1();", "@Override\n public boolean isValid()\n {\n return this.eventsList != null;\n }", "protected boolean _checkForNextEventInParent() throws IllegalActionException {\n if(_stateSpace.get(_currentStateIndex).eventQueue.size()!=0 && \r\n _stateSpace.get(_currentStateIndex).upToThisTaken+1 < _stateSpace.get(_currentStateIndex).eventQueue.size()) {\r\n DEEvent next=_stateSpace.get(_currentStateIndex).eventQueue.get(_stateSpace.get(_currentStateIndex).upToThisTaken+1);\r\n if (next.timeStamp().compareTo(getModelTime()) > 0) {\r\n // If the next event is in the future time,\r\n // jump out of the big while loop in fire() and\r\n // proceed to postfire().\r\n return false;\r\n } \r\n else if (next.timeStamp().compareTo(getModelTime()) < 0) {\r\n throw new IllegalActionException(\r\n \"The tag of the next event (\" + next.timeStamp()\r\n + \".\" + next.microstep()\r\n + \") can not be less than\"\r\n + \" the current tag (\" + getModelTime()\r\n + \".\" + _microstep + \") !\");\r\n } else {\r\n // The next event has the same tag as the current tag,\r\n // indicating that at least one actor is going to be\r\n // fired at the current iteration.\r\n // Continue the current iteration.\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n return true;\r\n }", "public Event eventValid() throws ArrayIndexOutOfBoundsException \r\n {\r\n\r\n System.out.println(\"Please input the name of the event\");\r\n String eventToCheck = getStrInput();\r\n Event checkEvent = new Event(eventToCheck, 0);//creates object to check against event arraylist\r\n int eventPos = Collections.binarySearch(events, checkEvent);//searches the event arraylist and returns position if event exists or negative if not\r\n \r\n try\r\n {\r\n Event eventBuy = events.get(eventPos);//tries to retrieve event \r\n return eventBuy;\r\n }\r\n catch(ArrayIndexOutOfBoundsException e)\r\n {\r\n System.out.println(\"---------------------------------------------------------------------------------\");\r\n System.out.println(\"That name doesn't correspond with an event.\");\r\n System.out.println(\"Returning you to the main menu\");\r\n System.out.println(\"---------------------------------------------------------------------------------\");\r\n throw e;\r\n }\r\n\r\n }", "boolean hasLastTriggered();", "private boolean contains(Event event, ArrayList<Event> events) {\n for (Event event1 : events) {\n if (event1 != null && event1.getEventID().equals(event.getEventID()))\n return true;\n }\n\n return false;\n }", "public void iterateEventList() {\n\n\t\tDriverConfig.setLogString(\n\t\t\t\t\"iterate the event list and select the event.\", true);\n\t\tdo {\n\t\t\tWaitUtil.waitUntil(20000);\n\t\t\tWebElement programeElementLink = retrieveElementByTagTextForSubElement(\n\t\t\t\t\tDriverConfig.getDriver(), formElement, TAG_ANCHOR,\n\t\t\t\t\tinputEventName);\n\t\t\tif (programeElementLink != null) {\n\t\t\t\tWaitUtil.waitUntil(20000);\n\t\t\t\tprogrameElementLink.click();\n\t\t\t\teventfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tWaitUtil.waitUntil(10000);\n\t\t\tWebElement nextElement2 = null;\n\t\t\tif (retrieveElementByAttributeValueByPassingElement(\n\t\t\t\t\tDriverConfig.getDriver(), formElement, TAG_SPAN,\n\t\t\t\t\tATTR_CLASS,\n\t\t\t\t\tdemandSideManagementConfig.get(PREVIOUS_PAGE_HOVER)) != null) {\n\t\t\t\tnextElement2 = retrieveElementByAttributeValueForSubElement(\n\t\t\t\t\t\tDriverConfig.getDriver(), formElement, TAG_SPAN,\n\t\t\t\t\t\tATTR_CLASS,\n\t\t\t\t\t\tdemandSideManagementConfig.get(PREVIOUS_PAGE_HOVER),\n\t\t\t\t\t\tMEDIUM_TIMEOUT);\n\t\t\t\tnextElement2.click();\n\t\t\t} else {\n\t\t\t\tWaitUtil.waitUntil(20000);\n\t\t\t\tnextElement2 = retrieveElementByAttributeValueForSubElement(\n\t\t\t\t\t\tDriverConfig.getDriver(), formElement, TAG_SPAN,\n\t\t\t\t\t\tATTR_CLASS,\n\t\t\t\t\t\tdemandSideManagementConfig\n\t\t\t\t\t\t\t\t.get(PREVIOUS_PAGE_WITHOUT_HOVER),\n\t\t\t\t\t\tMEDIUM_TIMEOUT);\n\t\t\t\tnextElement2.click();\n\t\t\t}\n\n\t\t\tWaitUtil.waitUntil(20000);\n\t\t\tprogrameElementLink = retrieveElementByTagTextForSubElement(\n\t\t\t\t\tDriverConfig.getDriver(), formElement, TAG_ANCHOR,\n\t\t\t\t\tinputEventName);\n\t\t\tif (programeElementLink != null) {\n\t\t\t\tWaitUtil.waitUntil(20000);\n\t\t\t\tDriverConfig.setLogString(\"Load shapping event '\"\n\t\t\t\t\t\t+ inputEventName + \"' found.\", true);\n\t\t\t\tprogrameElementLink.click();\n\t\t\t\teventfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!nextPageElement.getAttribute(ATTR_CLASS).endsWith(\n\t\t\t\tdemandSideManagementConfig.get(DISABLED)));\n\n\t}", "public List<Event> isActive(List<Event> eventList) {\n\t\tfor (Iterator<Event> iterator = eventList.iterator(); iterator\n\t\t\t\t.hasNext();) {\n\t\t\tEvent event = iterator.next();\n\t\t\tif (!event.isActive())\n\t\t\t\titerator.remove();\n\t\t}\n\t\treturn eventList;\n\t}", "private void check() throws IllegalActionException {\n if(_stateSpace.get(_currentStateIndex).underAnalysisMovingObjects.containsKey(335)) {\r\n if(Integer.valueOf(_stateSpace.get(_currentStateIndex).underAnalysisMovingObjects.get(335).split(\",\")[0])==48)\r\n for(DEEvent o: _stateSpace.get(_currentStateIndex).eventQueue) {\r\n if(o.actor() instanceof Track) {\r\n int trackId=((IntToken)(((Track)o.actor()).trackId.getToken())).intValue();\r\n if(trackId==48) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n }\r\n \r\n }", "boolean hasEventCounter();", "private void validateSelectedEvent() {\n if (dataCache.selectedEvent() != null) {\n for (Event event : dataCache.allEventsFiltered()) {\n if (event.getEventID().equals(dataCache.selectedEvent().getEventID())) {\n return;\n }\n }\n }\n dataCache.setSelectedEvent(null);\n }", "@Override\n public void checkForEvent() {\n //IF DAY HAS CHANGED\n\t\tcurrentDay = mainworld.getWorldTimer().isDay();\n if (currentDay != oldDay) {\n\t\t\toldDay = currentDay;\n\t\t\tif (oldDay.equals(1)) {\n\t\t\t\t//System.out.println(\"daytonight\");\n\t\t\t\tsuper.notifyHandler(states.NIGHTTODAY);\n\t\t\t} else {\n\t\t\t\t//System.out.println(\"nighttoday\");\n\t\t\t\tsuper.notifyHandler(states.DAYTONIGHT);\n\t\t\t}\n }\n }", "@Override\n\tpublic Player check(Event event) {\n\t\tif (((PlayerInteractEvent)event).hasItem()) {\n\t\t\treturn ((PlayerInteractEvent)event).getPlayer();\n\t\t}\n\t\treturn null;\n\t}", "private boolean isEventOfList(Channel channel, List<ControlEvent> events) {\n \t\tfor (ControlEvent e : events) {\n \t\t\tif (e.getEventType() != EventTypes.DETECTOR) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (e.getEvent().getDetectorId()\n\t\t\t\t\t.equals(channel.getAbstractDevice().getID())\n\t\t\t\t\t&& e.getEvent().getChainId() == channel.getScanModule()\n\t\t\t\t\t\t\t.getChain().getId()\n\t\t\t\t\t&& e.getEvent().getScanModuleId() == channel\n\t\t\t\t\t\t\t.getScanModule().getId()) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}", "@Override\n public boolean check(Enum filterType) {\n\n if (enumsList.contains(filterType)){\n //EVENT = filterType;\n return true;\n }\n else{\n return false;\n }\n }", "public List<BELEvent> getCurrentEventsList() {\n\t\treturn currentEventsList;\n\t}", "public boolean hasEvents() {\n boolean result = false;\n SQLiteDatabase db = null;\n Cursor c = null;\n try {\n SQLiteDatabase db2 = getReadableDatabase();\n Cursor c2 = db2.rawQuery(\"select exists(select _id from Events)\", null);\n if (c2.moveToNext()) {\n if (c2.getInt(0) != 0) {\n result = true;\n } else {\n result = false;\n }\n }\n if (c2 != null) {\n c2.close();\n }\n if (db2 != null) {\n db2.close();\n }\n } catch (SQLException e) {\n Log.e(TAG, \"Error determining if there are events to send: \", e);\n if (c != null) {\n c.close();\n }\n if (db != null) {\n db.close();\n }\n } catch (Throwable th) {\n if (c != null) {\n c.close();\n }\n if (db != null) {\n db.close();\n }\n throw th;\n }\n return result;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public void actionPerformed(ActionEvent e) { Object objetoPulsado = e.getSource(); if (objetoPulsado.equals(mniAltaLibro)) { new AltaLibro(); } else if(objetoPulsado.equals(mniBajaLibro)) { new BajaLibro(); } else if(objetoPulsado.equals(mniConsultaLibro)) { new ConsultaLibro(); } else if(objetoPulsado.equals(mniModificaLibro)) { new ModificaLibro(); } }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated float BuyVolume = 7;
public Builder addAllBuyVolume( java.lang.Iterable<? extends java.lang.Float> values) { ensureBuyVolumeIsMutable(); super.addAll(values, buyVolume_); onChanged(); return this; }
[ "public void increaseVolume()\n {\n\nvolume = volume + 1;\n }", "double volume();", "public abstract void setVolume(float f, float f2);", "public void setVolume( float volume );", "public void setVolume(int volume){ this.volume = volume; }", "public static double specificVolume(){\n\t return 0.000765;\n }", "protected float getSoundVolume()\n {\n return 0.6F;\n }", "public void decreaseVolume()\n {\n\nvolume = volume - 1;\n }", "public float getVolume()\r\n {\r\n //Volume = (4/3)3.14^3\r\n return (4/3) * PI * (radius * radius * radius);\r\n }", "public void louden() {\n\t\tvolume = Math.min(10f, volume * 1.25f);\n\t}", "double hitung_volume() {\r\n double vol = panjang * lebar * tinggi;\r\n // mengembalikkan nilai\r\n return vol;\r\n\r\n }", "double calcVolume(){\n double lengthofthesides = side * 4;\n return lengthofthesides;\n }", "@Override\n\tpublic double volume() {\n\t\treturn (1/3) * getBase() * getAltura() * getProfundidade();\n\t}", "@Override\n\tpublic void setVolume(double factor) {\n\t\t\n\t}", "double volume() {\n\treturn height * width * depth;\n }", "Volume(double v) {\n this.value = v;\n }", "@Override\n\tpublic double volume() {\n\t\treturn a*a*a;\n\t}", "public int getVolume(){\n return this.currentVol;\n }", "int volume()\r\n {\r\n return r1.area()*hight;\r\n }", "public boolean setVolume(float v);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For now, we just insert everything one by one
public void insert(Iterator<ImageQALogEntry> entries) { while (entries.hasNext()) { ImageQALogEntry entry = entries.next(); MongoImageQALogEntry dbo = new MongoImageQALogEntry(new BasicDBObject()); dbo.setTimestamp(entry.getTimestamp()); dbo.setExecutionTime(entry.getExecutionTime()); dbo.setOriginalWebURL(entry.getOriginalWebURL()); dbo.setWaybackImageURL(entry.getWaybackImageURL()); dbo.setWaybackTimestamp(entry.getWaybackTimestamp()); dbo.setFC1(entry.getFC1()); dbo.setFC2(entry.getFC2()); dbo.setMC(entry.getMC()); dbo.setMessage(entry.getMessage()); dbo.setTS1(entry.getTS1()); dbo.setTS2(entry.getTS2()); dbo.setOCR(entry.getOCR()); dbo.setImage1Size(entry.getImage1Size()); dbo.setImage2Size(entry.getImage2Size()); dbo.setPSNRSimilarity(entry.getPSNRSimilarity()); dbo.setPSNRThreshold(entry.getPSNRThreshold()); dbo.setPSNRMessage(entry.getPSNRMessage()); dbo.setOriginalImageURL(entry.getOriginalImageURL()); Logger.debug("Inserting image QA log entry: " + entry.toString()); collection.insert(dbo.getBackingDBO()); } }
[ "private static void insert() {\n\t\t\n\t}", "private void insertData() {\n insertPaymentMethods();\n insertCustomers();\n insertPayment();\n insertOrders();\n insertOrderHistory();\n insertOrderItems();\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n\n DRSEntity entity = factory.manufacturePojo(DRSEntity.class);\n\n em.persist(entity);\n\n data.add(entity);\n }\n }", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n\r\n InstitucionEntity entity = factory.manufacturePojo(InstitucionEntity.class);\r\n\r\n em.persist(entity);\r\n\r\n data.add(entity);\r\n }\r\n }", "void insertBatch();", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n\r\n CompradorEntity entity = factory.manufacturePojo(CompradorEntity.class);\r\n\r\n data.add(entity);\r\n\r\n em.persist(entity);\r\n }\r\n }", "@Override\r\n\tpublic long insertAll(List<Object> list) {\n\t\treturn 0;\r\n\t}", "@Override\n public boolean processFullInsert() {\n return true;\n }", "public void insertAll() {\n\t\tGrupTipeRekening g1 = new GrupTipeRekening(\"CA\",\"Current Account\",\"Rekening Giro\");\r\n\t\tGrupTipeRekening g2 = new GrupTipeRekening(\"CC\",\"Credit card\",\"Kartu Kredit\");\r\n\t\tGrupTipeRekening g3 = new GrupTipeRekening(\"MG\",\"Merchant Group ID\",\"Merchant Grup ID\");\r\n\t\tGrupTipeRekening g4 = new GrupTipeRekening(\"SA\",\"Saving Account\",\"Rekening Tabungan\");\r\n\t\tGrupTipeRekening g5= new GrupTipeRekening(\"TA\",\"Trade Account\",\"Trade Account\");\r\n\t\tGrupTipeRekening g6 = new GrupTipeRekening(\"TD\",\"Time Deposit\",\"Deposito\");\r\n\t\tGrupTipeRekening g7 = new GrupTipeRekening(\"LO\",\"Loan Account\",\"Rekening Pinjaman\");\r\n\t\tGrupTipeRekening g8 = new GrupTipeRekening(\"DD\",\"BCA Dollar Account\",\"Rekening BCA Dollar\");\r\n\t\tList<GrupTipeRekening> grupTipeRekening = Arrays.asList(g1,g2,g3,g4,g5,g6,g7,g8);\r\n\t\tgrupTipeRekeningRepository.saveAll(grupTipeRekening);\r\n\t}", "private void createInserters() {\n com.poesys.db.dao.IDaoManager manager =\n com.poesys.db.dao.DaoManagerFactory.getManager(getSubsystem());\n final com.poesys.db.dao.IDaoFactory<com.poesys.db.memcached_test.ISelf4Self> self4SelfFactory =\n manager.getFactory(\"com.poesys.db.memcached_test.Self4Self\",\n getSubsystem(),\n 2147483647);\n com.poesys.db.dao.insert.IInsertSql<ISelf4Self> sql =\n new com.poesys.db.memcached_test.sql.InsertSelf4Self();\n com.poesys.db.dao.insert.IInsert<ISelf4Self> inserter =\n self4SelfFactory.getInsert(sql, true);\n inserters.add(inserter);\n }", "public abstract void insertAll(List<List<Object>> data);", "@Override\n public void preInsert() {\n\n }", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n\r\n CategoriaEntity entity = factory.manufacturePojo(CategoriaEntity.class);\r\n\r\n em.persist(entity);\r\n\r\n data.add(entity);\r\n }\r\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n em.persist(entity);\n dataViajero.add(entity);\n }\n for (int i = 0; i < 3; i++) {\n TarjetaDeCreditoEntity entity = factory.manufacturePojo(TarjetaDeCreditoEntity.class);\n if (i == 0) {\n entity.setViajero(dataViajero.get(0));\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n MonitorEntity entity = factory.manufacturePojo(MonitorEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "@Override\n public void autoInsertAll() {\n String[] cropGroupNames = {\"Orchards\" , \"Field crops\"};\n CropGroup cg1 = new CropGroup(1,\"Orchards\");\n CropGroup cg2 = new CropGroup(2,\"Field crops\");\n List<CropGroup> cropGroupList = new ArrayList<>();\n cropGroupList.add(cg1);\n cropGroupList.add(cg2);\n this.insertAll(cropGroupList);\n\n\n }", "private void elitistInsert( )\n {\n final int size = colony.size( );\n \n while( this.eliteArchive.empty( ) == false ) // handle first iteration where eilte archive is empty\n {\n int randomIndex = myUtils.Utility.getRandomInRange( 0, size - 1 );\n \n Path elitePath = this.eliteArchive.pop( ); // pop the element in the archive\n \n colony.set( randomIndex, elitePath );\n }\n }", "private void insert(){\n int rc;\n \n try {\n for (int i = 0; i < identity.getSize(); i++){\n OysterIdentityRecord o = identity.getOysterIdentityRecord(i);\n pstmt.setString(1, identity.getOysterID());\n \n for (Iterator<Integer> it = metadata.keySet().iterator(); it.hasNext();){\n int key = it.next();\n String item = metadata.get(key);\n String token = o.get(item);\n \n if (token != null) {\n pstmt.setString(key, token);\n } else {\n pstmt.setNull(key, Types.VARCHAR);\n }\n }\n \n rc = pstmt.executeUpdate();\n \n if (rc > 0) {\n counter += rc;\n }\n \n if (total % 100000 == 0){\n StringBuilder sb = new StringBuilder(1000);\n sb.append(\"Inserting \").append(total).append(\"...\");\n logger.info(sb.toString());\n conn.commit();\n }\n total++;\n }\n } catch(SQLException ex){\n Logger.getLogger(DBIdentityParser.class.getName()).log(Level.SEVERE, ErrorFormatter.format(ex), ex);\n }\n }", "private void insertData() {\r\n for (int i = 0; i < 3; i++) {\r\n VotacionEntity votacions = factory.manufacturePojo(VotacionEntity.class);\r\n em.persist(votacions);\r\n votacionsData.add(votacions);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n JuradoEntity entity = factory.manufacturePojo(JuradoEntity.class);\r\n em.persist(entity);\r\n data.add(entity);\r\n if (i == 0) {\r\n votacionsData.get(i).setJurado(entity);\r\n }\r\n }\r\n }", "private void insertData() \n {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n TarjetaCreditoEntity entity = factory.manufacturePojo( TarjetaCreditoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GENFIRST:event_cbxpointsubjectItemStateChanged TODO add your handling code here:
private void cbxpointsubjectItemStateChanged(java.awt.event.ItemEvent evt) { if(cbxpointsubject.getSelectedItem() != null){ String nameclass=cbxpointsubject.getSelectedItem().toString(); Frm0002BLL dsfrm0002 =new Frm0002BLL(); List<StudentClassSubjectDTO>ds= dsfrm0002.getAllStudenbyIdClassSub2(nameclass); getIntoTablePSubjectStudents(ds); } }
[ "void JCheckBoxMenuItem7_itemStateChanged(java.awt.event.ItemEvent event)\r\n\t{\n\t\t\t \r\n\t\tJCheckBoxMenuItem7_itemStateChanged_Interaction1(event);\r\n\t}", "void JCheckBoxMenuItem9_itemStateChanged(java.awt.event.ItemEvent event)\r\n\t{\n\t\t\t \r\n\t\tJCheckBoxMenuItem9_itemStateChanged_Interaction1(event);\r\n\t}", "@Override\r\n public void itemStateChanged(final ItemEvent event) {\r\n Object source = event.getSource();\r\n \r\n if (source != null && source == segmentCheckBox && labelSegmentNumber != null && textSegmentNumber != null &&\r\n \t\tnoVOIsButton != null && pointButton != null && contourButton != null) {\r\n \tlabelSegmentNumber.setEnabled(!segmentCheckBox.isSelected());\r\n \ttextSegmentNumber.setEnabled(!segmentCheckBox.isSelected());\r\n \tnoVOIsButton.setEnabled(!segmentCheckBox.isSelected());\r\n \tpointButton.setEnabled(!segmentCheckBox.isSelected());\r\n \tcontourButton.setEnabled(!segmentCheckBox.isSelected());\r\n \tif (segmentCheckBox.isSelected()) {\r\n \t\tnoVOIsButton.setSelected(true);\r\n \t\tpointButton.setSelected(false);\r\n \t\tcontourButton.setSelected(false);\r\n \t}\r\n }\r\n\r\n }", "public void itemStateChanged (ItemEvent e)\n {\n }", "@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(protocalJcb==null){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(e.getItem().equals(\"已签\")){\n\t\t\t\t\tprotocalJcb.setModel(new DefaultComboBoxModel(new String[] { \"\", \"三方已交\", \"已签未交\" }));\n\t\t\t\t}else if(e.getItem().equals(\"未签\")){\n\t\t\t\t\tprotocalJcb.setModel(new DefaultComboBoxModel(new String[] { \"\", \"未找到工作\",\"已有offer在考虑\"}));\n\t\t\t\t}else {\n\t\t\t\t\tprotocalJcb.setModel(new DefaultComboBoxModel(new String[] { \"\" }));\n\t\t\t\t}\n\t\t\t}", "void JCheckBoxMenuItem1_itemStateChanged(java.awt.event.ItemEvent event)\r\n\t{\n\t\t\t \r\n\t\tJCheckBoxMenuItem1_itemStateChanged_Interaction1(event);\r\n\t}", "@Override\n public void itemStateChanged(ItemEvent ex) {\n if (ex.getSource() == cb) {\n\n if (cb.getSelectedItem().equals(\"ALL\")) {\n allSelectedMethod();\n x = 1;\n }\n if (cb.getSelectedItem().equals(\"Name\")) {\n nameSelectedMethod();\n x = 2;\n }\n if (cb.getSelectedItem().equals(\"TYPE\")) {\n typeSelectedMethod();\n }\n if (cb.getSelectedItem().equals(\"discount\")) {\n discountSelectedMethod();\n x = 7;\n }\n if (cb.getSelectedItem().equals(\"Price\")) {\n priceSelectedMethod();\n x = 8;\n }\n\n }\n if (ex.getSource() == typeCB) {\n\n if (typeCB.getSelectedItem().equals(\"capsule\")) {\n\n x = 3;\n }\n if (typeCB.getSelectedItem().equals(\"ointment\")) {\n\n x = 4;\n }\n if (typeCB.getSelectedItem().equals(\"injection\")) {\n x = 5;\n }\n if (typeCB.getSelectedItem().equals(\"pill\")) {\n\n x = 6;\n }\n }\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\r\n\t}", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void itemStateChanged(ItemEvent e) {\n \t\t absCorrButton_itemStateChanged(e);\n \t }", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "public void itemStateChanged(ItemEvent e) {\n lpButton_itemStateChanged(e);\n }", "public void itemStateChanged(ItemEvent e) { encodeParams(); }", "private void TitleCBXItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_TitleCBXItemStateChanged\n if(evt.getItem() != null){\n AbstractTXT.setText(((BLPaper)evt.getItem()).getPAbstract());\n CitationTXT.setText(((BLPaper)evt.getItem()).getCitation());\n TitleTXT.setText(((BLPaper)evt.getItem()).getTitle());\n }\n }", "@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tChoice[0] = \"C\";\n\t\t\t}", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\r\n\t\tObject source = e.getSource();\t//Get Selected Object\r\n\t\t\r\n\t\t//Membership group radio buttons\r\n\t\tif(source == membershipTrue || source == membershipFalse){\r\n\t\t\tif(membershipTrue.isSelected()){\r\n\t\t\t\tmember = \"1\";\r\n\t\t\t}\r\n\t\t\telse if(membershipFalse.isSelected()){\r\n\t\t\t\tmember =\"0\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Payment group radio buttons\r\n\t\tif(source == paymentCash || source == paymentCredit \r\n\t\t\t\t|| source == paymentCheck){\r\n\t\t\tif(paymentCash.isSelected()){\r\n\t\t\t\tpay = \"현금\";\r\n\t\t\t}\r\n\t\t\telse if(paymentCredit.isSelected()){\r\n\t\t\t\tpay =\"신용카드\";\r\n\t\t\t}\r\n\t\t\telse if(paymentCheck.isSelected()){\r\n\t\t\t\tpay = \"체크카드\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Seat group radio buttons\r\n\t\tif(source == seatFront || source == seatBack\r\n\t\t\t\t|| source == seatWindow || source == seatAisle){\r\n\t\t\tif(seatFront.isSelected()){\r\n\t\t\t\tseat1 = \"앞\";\r\n\t\t\t}\r\n\t\t\telse if(seatBack.isSelected()){\r\n\t\t\t\tseat1 =\"뒤\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(seatWindow.isSelected()){\r\n\t\t\t\tseat2 = \"창가\";\r\n\t\t\t}\r\n\t\t\telse if(seatAisle.isSelected()){\r\n\t\t\t\tseat2 = \"복도\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void itemStateChanged(ItemEvent e) {\r\n//\t\tif (!(graphPanel.getSelectState() || graphPanel.getOverlayState())) {\r\n//\t\t\tif (e.getStateChange() == ItemEvent.DESELECTED) {\r\n//\t\t\t\tselectionNumber = 0;\r\n//\t\t\t\tgraphPanel.getSelectedChannelShowSet().remove(channelView);\r\n//\t\t\t} else if (e.getStateChange() == ItemEvent.SELECTED) {\r\n//\t\t\t\tgraphPanel.getSelectedChannelShowSet().add(channelView);\r\n//\t\t\t\tcurrentSelectionNumber++;\r\n//\t\t\t\tselectionNumber = currentSelectionNumber;\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\tselectionPerformed();\r\n\t}", "@Override\n\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\tObject src = e.getSource();\n\t\t\tif( e.getStateChange() == ItemEvent.SELECTED)\n\t\t\t{\n\t\t\t\n\t\t\t\t\tif(src == chyy || src == chmm)\n\t\t\t\t\t{\n\t\t\t\t\t\tchdd.removeItemListener(this);\n\t\t\t\t\t if(chyy.getSelectedIndex() != 0 && chmm.getSelectedIndex() != 0)\n\t\t {\n\t\t \n\t\t \n\t\t int yy = Integer.parseInt( chyy.getSelectedItem().toString() );\n\t\t int mm = Integer.parseInt( chmm.getSelectedItem().toString() );\n\t\t \n\t\t // every time it come here we will remove previous entered item \n\t\t // and then it will add automatically\n\t\t \n\t\t // for(int i=1;i<chdd.getItemCount();i++)\n\t\t // chdd.remove(1);\n\t\t \n\t\t chdd.removeAllItems();\n\t\t chdd.addItem(\"Date\");\n\t\t \n\t\t int days = 0;\n\t\t \n\t\t if(mm == 2)\n\t\t {\n\t\t if(yy%4 ==0)\n\t\t \n\t\t days = 29;\n\t\t else\n\t\t days = 28;\n\t\t }\n\t\t else \n\t\t { \n\t\t if(mm == 4 || mm == 6 || mm == 9 || mm == 11)\n\t\t days = 30;\n\t\t else \n\t\t days = 31;\n\t\t }\n\t\t \n\t\t for(int i=1 ; i<=days ;i++)\n\t\t chdd.addItem(i+\"\");\n\t\t \n\t\t }\n\t\t\t\t\t chdd.addItemListener(this);\n\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t else if(src == chdd)\n\t\t\t\t\t {\n\t\t\t\t\t\t // filling day\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t else if(src == chmslot)\n\t\t\t\t\t {\n\t\t\t\t\t\t cbms.removeItemListener(this);\n\t\t\t\t\t\t enablemorning(true);\n\t\t\t\t\t\t enableevening(false);\n\t\t\t\t\t\t fillmslottime();\n\t\t\t\t\t\t cbms.addItemListener(this);\n\t\t\t\t\t }\n\t\t\t\t\t else if(src == cheslot)\n\t\t\t\t\t {\n\t\t\t\t\t\t cbes.removeItemListener(this);\n\t\t\t\t\t\t enableevening(true);\n\t\t\t\t\t\t enablemorning(false);\n\t\t\t\t\t\t filleslottime();\n\t\t\t\t\t\t cbes.addItemListener(this);\n\t\t\t\t\t }\n\t\t\t\t\t else if(src == cbms)\n\t\t\t\t\t {\n\t\t\t\t\t\t cbme.removeAllItems();\n\t\t\t\t\t\t if(cbms.getSelectedIndex() == cbms.getItemCount()-1)\n\t\t\t\t\t\t cbme.addItem(mend);\n\t\t\t\t\t\t else\n\t\t\t\t\t\t\t cbme.addItem((cbms.getItemAt(cbms.getSelectedIndex()+1)).toString());\n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t else if(src == cbes)\n\t\t\t\t\t {\n\t\t\t\t\t\t cbee.removeAllItems();\n\t\t\t\t\t\t if(cbes.getSelectedIndex() == cbes.getItemCount()-1)\n\t\t\t\t\t\t\t cbee.addItem(eend);\n\t\t\t\t\t\t else\n\t\t\t\t\t\t\t cbee.addItem((cbes.getItemAt(cbes.getSelectedIndex()+1)).toString());\n\t\t\t\t\t\t\n\t\t\t\t\t }\n\t\t\t}\n\t\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent event) {\n\n\t\tif (event.getStateChange() == ItemEvent.SELECTED) {\n\t\t\t\n\t\t\tif (flag == false) {\n\t\t\t\t\n\t\t String item = (String)event.getItem();\n\n\t\t // System.out.println(\"from: \" + view.getJcbFrom());\n\t\t \n\t\t // fromBound = view.getJcbFrom();\n\t\t \n\t\t counter++;\n\t\t flag = true;\n\t\t // model.inform();\n\n\t\t\t} else {\n\t\t\t\t\n\t\t String item = (String)event.getItem();\n\t\t \n\t\t // System.out.println(\"tooo: \" + view.getJcbTo());\n\t\t \n\t\t // toBound = view.getJcbTo();\n\t\t counter++; \n\t\t model.inform();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//if (counter == 2) model.dataGrabbing();\n\t\t\t\n\t\t}\n\t\t\t\n\t\t/*\tSystem.out.println(\"flage false\");\n\t\t\t\n\t // Object item = event.getItem();\n\t String item = (String)event.getItem();\n\t \n\t System.out.println(\"Counter 0\");\n\t \n\t //System.out.println(item);\n\t \n\t // from = Integer.parseInt(item);\n\t System.out.println(\"from: \" + view.getJcbFrom());\n\t \n\t fromBound = view.getJcbFrom();\n\t \n\t // model.inform();\n\n\t // do something with object\n\t } else\n\t\t\n\t\tif (event.getStateChange() == ItemEvent.SELECTED && flag == true) {\n\t\t\t\n\t\t\tSystem.out.println(\"flage true\");\n\t\t\t\n\t String item = (String)event.getItem();\n\n\t System.out.println(\"Counter 1\");\n\t \n\t System.out.println(\"tooo: \" + view.getJcbTo());\n\t \n\t toBound = view.getJcbTo();\n\t \n\t model.inform();\n\n\t } */\n\t\t\n\t\tSystem.out.println(\"wesh fin\");\n\t\t\n\t\t\n\t}", "public void itemStateChanged( ItemEvent event )\r\n {\n if ( event.getSource() == filled )\r\n {\r\n boolean checkFill=filled.isSelected() ? true : false; //\r\n panel.setCurrentShapeFilled(checkFill);\r\n }\r\n \r\n // determine whether combo box selected\r\n if ( event.getStateChange() == ItemEvent.SELECTED )\r\n {\r\n //if event source is combo box colors pass in colorArray at index selected.\r\n if ( event.getSource() == colors)\r\n {\r\n panel.setCurrentShapeColor\r\n (colorArray[colors.getSelectedIndex()]);\r\n }\r\n \r\n //else if event source is combo box shapes pass in index selected\r\n else if ( event.getSource() == shapes)\r\n {\r\n panel.setCurrentShapeType(shapes.getSelectedIndex());\r\n }\r\n }\r\n \r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Check the message from client in Phase5, this message is encrypted with session key, so that server can make sure the client already get the correct session key
private byte[] checkMsgPhase5(byte[] msg) throws Exception { log.info("Checking the message received from client in Phase5, msg length = " + msg.length); if(Arrays.equals(msg, LOGIN_FAIL.getBytes())) { throw new Exception("Server failed to authenticate itself to client.."); } byte[] deMsg = util.decryptMsgWithAES(sessionKey, msg); byte[] N3tmp = Arrays.copyOfRange(deMsg, 0, NONCE_SIZE); if(Arrays.equals(N3, N3tmp) == false) { sThread.sendMsgToClient(LOGIN_FAIL.getBytes()); throw new Exception("N3 is not matched."); } byte[] N4 = Arrays.copyOfRange(deMsg, NONCE_SIZE, NONCE_SIZE*2); srvPortClient = Arrays.copyOfRange(deMsg, NONCE_SIZE*2, deMsg.length); return N4; }
[ "String key_sent_recive(String enc ){\r\n \t try\r\n {\r\n System.out.println(\"Connecting to \" + serverName\r\n + \" on port \" + port);\r\n Socket client = new Socket(serverName, port);\r\n System.out.println(\"Just connected to \"\r\n + client.getRemoteSocketAddress());\r\n OutputStream outToServer = client.getOutputStream();\r\n DataOutputStream out =\r\n new DataOutputStream(outToServer);\r\n out.writeUTF(enc);\r\n System.out.println(\"i sent encrypted key to server :\" + enc); \r\n \r\n InputStream inFromServer = client.getInputStream();\r\n DataInputStream in =\r\n new DataInputStream(inFromServer);\r\n \r\n String temp = in.readUTF();\r\n System.out.println(\"recieved encypted session key :\" + temp); \r\n client.close();\r\n return temp;\r\n }catch(IOException e)\r\n {\r\n e.printStackTrace();\r\n return \"problem in key receiving\";\r\n }\r\n \t \r\n }", "public void run() {\n isActive = false;\n long serverSessionKey = 0, clientSessionKey = 0;\n \n//\tif (!KeyServer.verifiedKeys()){\n//\t\tSystem.out.println(\"User rejected due to unverified client.\");\n//\t\tdisconnected = true;\n//\t\treturnCode = 4;\n//\t}\n\n // randomize server part of the session key\n serverSessionKey = ((long) (java.lang.Math.random() * 99999999D) << 32)\n + (long) (java.lang.Math.random() * 99999999D);\n\n try {\n returnCode = 2;\n fillInStream(2);\n if (getInputStream().readUnsignedByte() != 14) {\n shutdownError(\"Expected login Id 14 from client.\");\n disconnected = true;\n return;\n }\n getInputStream().readUnsignedByte();\n for (int i = 0; i < 8; i++) {\n // out.write(9 + server.world);\n out.write(1);\n } // is being ignored by the client\n \n // login response - 0 means exchange session key to establish\n // encryption\n // Note that we could use 2 right away to skip the cryption part,\n // but i think this\n // won't work in one case when the cryptor class is not set and will\n // throw a NullPointerException\n out.write(0);\n\n // send the server part of the session Id used (client+server part\n // together are used as cryption key)\n // println(\"serverSessionKey=\" + serverSessionKey);\n getOutputStream().writeQWord(serverSessionKey);\n directFlushOutStream();\n fillInStream(2);\n int loginType = getInputStream().readUnsignedByte(); // this is either 16\n // (new login) or 18\n // (reconnect after\n // lost connection)\n if (loginType != 16 && loginType != 18) {\n shutdownError(\"Unexpected login type \" + loginType);\n return;\n }\n // if (loginType == 18) {\n // reconnect = true;\n // }\n int loginPacketSize = getInputStream().readUnsignedByte();\n int loginEncryptPacketSize = loginPacketSize - (36 + 1 + 1 + 2); // the\n // size\n // of\n // the\n // RSA\n // encrypted\n // part\n // (containing\n // password)\n\n // misc.println_debug(\"LoginPacket size: \"+loginPacketSize+\", RSA\n // packet size: \"+loginEncryptPacketSize);\n if (loginEncryptPacketSize <= 0) {\n shutdownError(\"Zero RSA packet size!\");\n return;\n }\n fillInStream(loginPacketSize);\n if (getInputStream().readUnsignedByte() != 255 || getInputStream().readUnsignedWord() != 317) {\n println(\"invalid code\");\n returnCode = 6;\n // return;\n }\n getInputStream().readUnsignedByte();\n // misc.println_debug(\"Client type: \"+((lowMemoryVersion==1) ? \"low\"\n // : \"high\")+\" memory version\");\n for (int i = 0; i < 9; i++) {\n Integer.toHexString(getInputStream().readDWord());\n }\n // don't bother reading the RSA encrypted block because we can't\n // unless\n // we brute force jagex' private key pair or employ a hacked client\n // the removes\n // the RSA encryption part or just uses our own key pair.\n // Our current approach is to deactivate the RSA encryption of this\n // block\n // clientside by setting exp to 1 and mod to something large enough\n // in (data^exp) % mod\n // effectively rendering this tranformation inactive\n\n loginEncryptPacketSize--; // don't count length byte\n int tmp = getInputStream().readUnsignedByte();\n if (loginEncryptPacketSize != tmp) {\n shutdownError(\"Encrypted packet data length (\" + loginEncryptPacketSize\n + \") different from length byte thereof (\" + tmp + \")\");\n return;\n }\n tmp = getInputStream().readUnsignedByte();\n if (tmp != 10) {\n shutdownError(\"Encrypted packet Id was \" + tmp + \" but expected 10\");\n return;\n }\n clientSessionKey = getInputStream().readQWord();\n serverSessionKey = getInputStream().readQWord();\n \n//\t\tint uid = getInputStream().readUnsignedByte();\n//\t\t\n//\t\tif(uid == 0 || uid == 99735086) {\n//\t\t\tdisconnected = true;\n//\t\t\treturn;\n//\t\t}\n \n LoginManager.customClientVersion = getInputStream().readString();\n System.out.println(\"Client version: \" + Config.customClientVersion);\n //LoginManager.UUID = getInputStream().readString();\n //System.out.println(\"UUID: \" + LoginManager.UUID);\n clientPid = getInputStream().readDWord();\n setPlayerName(getInputStream().readString());\n if (getPlayerName() == null || getPlayerName().length() == 0) {\n setPlayerName(\"player\" + getSlot());\n }\n playerPass = getInputStream().readString();\n String playerServer = \"\";\n try {\n playerServer = getInputStream().readString();\n } catch (Exception e) {\n playerServer = \"srv.dodian.net\";\n }\n\n setPlayerName(getPlayerName().toLowerCase());\n // playerPass = playerPass.toLowerCase();\n // System.out.println(\"valid chars\");\n char[] validChars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',\n 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',\n 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',\n '_', ' ' };\n setPlayerName(getPlayerName().trim());\n int sessionKey[] = new int[4];\n\n sessionKey[0] = (int) (clientSessionKey >> 32);\n sessionKey[1] = (int) clientSessionKey;\n sessionKey[2] = (int) (serverSessionKey >> 32);\n sessionKey[3] = (int) serverSessionKey;\n\n for (int i = 0; i < 4; i++) {\n }\n inStreamDecryption = new Cryption(sessionKey);\n for (int i = 0; i < 4; i++) {\n sessionKey[i] += 50;\n }\n\n for (int i = 0; i < 4; i++) {\n }\n outStreamDecryption = new Cryption(sessionKey);\n getOutputStream().packetEncryption = outStreamDecryption;\n\n int letters = 0;\n for (int i = 0; i < getPlayerName().length(); i++) {\n boolean valid = false;\n for (int i1 = 0; i1 < validChars.length; i1++) {\n if (getPlayerName().charAt(i) == validChars[i1]) {\n valid = true;\n // break;\n }\n if (valid && getPlayerName().charAt(i) != '_' && getPlayerName().charAt(i) != ' ') {\n letters++;\n }\n }\n if (!valid) {\n returnCode = 4;\n disconnected = true;\n }\n }\n if (letters < 1) {\n returnCode = 3;\n disconnected = true;\n }\n char first = getPlayerName().charAt(0);\n properName = Character.toUpperCase(first) + getPlayerName().substring(1, getPlayerName().length()).toLowerCase();\n setPlayerName(properName.replace(\"_\", \" \"));\n longName = Utils.playerNameToInt64(getPlayerName());\n if (Server.updateRunning) {\n returnCode = 14;\n disconnected = true;\n println_debug(getPlayerName() + \" refused - update is running !\");\n }\n int loadgame = 0;\n if (returnCode == 6) {\n setPlayerName(\"_\");\n disconnected = true;\n teleportToX = 0;\n teleportToY = 0;\n } else {\n loadgame = Server.loginManager.loadgame(this, getPlayerName(), playerPass);\n switch (playerGroup) {\n case 6: // root admin\n playerRights = 2;\n premium = true;\n break;\n case 18: // root admin\n playerRights = 2;\n premium = true;\n break;\n case 10: // content dev\n playerRights = 2;\n premium = true;\n break;\n case 9: // player moderator\n case 5: // global mod\n playerRights = 1;\n premium = true;\n break;\n // case 10:\n case 11:\n case 7:\n case 27:\n premium = true;\n break;\n default:\n premium = false;\n playerRights = 0;\n }\n for (int a = 0; a < otherGroups.length; a++) {\n if (otherGroups[a] == null) {\n continue;\n }\n String temp = otherGroups[a].trim();\n if (temp != null && temp.length() > 0) {\n int group = Integer.parseInt(temp);\n switch (group) {\n case 14:\n premium = true;\n break;\n case 3:\n case 19:\n playerRights = 1;\n break;\n }\n }\n }\n for (int i = 0; i < getEquipment().length; i++) {\n if (getEquipment()[i] == 0) {\n getEquipment()[i] = -1;\n getEquipmentN()[i] = 0;\n }\n }\n if (loadgame == 0 && returnCode != 6) {\n validLogin = true;\n if (getPosition().getX() > 0 && getPosition().getY() > 0) {\n teleportToX = getPosition().getX();\n teleportToY = getPosition().getY();\n }\n } else {\n if (returnCode != 6 && returnCode != 5)\n returnCode = loadgame;\n setPlayerName(\"_\");\n disconnected = true;\n teleportToX = 0;\n teleportToY = 0;\n }\n\n }\n if (getSlot() == -1) {\n out.write(7); // \"This world is full.\"\n } else if (playerServer.equals(\"INVALID\")) {\n out.write(10);\n } else {\n out.write(returnCode); // login response (1: wait 2seconds,\n // 2=login successfull, 4=ban :-)\n if (returnCode == 21) {\n out.write(loginDelay);\n // if(returnCode == 4 && officialClient)\n // out.write(bannedHours);\n }\n\n }\n out.write(playerRights); // mod level\n out.write(0); // no log\n getUpdateFlags().setRequired(UpdateFlag.APPEARANCE, true);\n } catch (java.lang.Exception __ex) {\n __ex.printStackTrace();\n destruct();\n return;\n }\n // }\n isActive = true;\n if (getSlot() == -1 || returnCode != 2) {\n return;\n }\n packetSize = 0;\n packetType = -1;\n readPtr = 0;\n writePtr = 0;\n\n int numBytesInBuffer, offset;\n\n while (!disconnected) {\n synchronized (this) {\n if (writePtr == readPtr) {\n try {\n wait();\n } catch (java.lang.InterruptedException _ex) {\n }\n }\n\n if (disconnected) {\n return;\n }\n\n offset = readPtr;\n if (writePtr >= readPtr) {\n numBytesInBuffer = writePtr - readPtr;\n } else {\n numBytesInBuffer = bufferSize - readPtr;\n }\n }\n if (numBytesInBuffer > 0 && disconnectAt == 0) {\n try {\n out.write(buffer, offset, numBytesInBuffer);\n readPtr = (readPtr + numBytesInBuffer) % bufferSize;\n if (writePtr == readPtr) {\n out.flush();\n }\n } catch (java.net.SocketException e) {\n if (loggingOut) {\n disconnected = true;\n } else {\n disconnectAt = System.currentTimeMillis() + 45000;\n lagOut();\n }\n } catch (java.lang.Exception __ex) {\n __ex.printStackTrace();\n disconnectAt = System.currentTimeMillis() + 45000;\n }\n }\n }\n }", "boolean hasAesSessionKey();", "private String Send_SSH_CMSG_SESSION_KEY(byte[] anti_spoofing_cookie,\n\t\t\tbyte[] server_key_public_modulus, byte[] host_key_public_modulus,\n\t\t\tbyte[] supported_ciphers_mask, byte[] server_key_public_exponent,\n\t\t\tbyte[] host_key_public_exponent) throws IOException {\n\n\t\t@SuppressWarnings(\"unused\")\n\t\tString str;\n\t\t@SuppressWarnings(\"unused\")\n\t\tint boffset;\n\n\t\tbyte cipher_types; // encryption types\n\t\tbyte[] session_key; // mp-int\n\n\t\t// create the session id\n\t\t// session_id = md5(hostkey->n || servkey->n || cookie) //protocol V\n\t\t// 1.5. (we use this one)\n\t\t// session_id = md5(servkey->n || hostkey->n || cookie) //protocol V\n\t\t// 1.1.(Why is it different ??)\n\t\t//\n\n\t\tbyte[] session_id_byte = new byte[host_key_public_modulus.length\n\t\t\t\t+ server_key_public_modulus.length\n\t\t\t\t+ anti_spoofing_cookie.length];\n\n\t\tSystem.arraycopy(host_key_public_modulus, 0, session_id_byte, 0,\n\t\t\t\thost_key_public_modulus.length);\n\t\tSystem.arraycopy(server_key_public_modulus, 0, session_id_byte,\n\t\t\t\thost_key_public_modulus.length,\n\t\t\t\tserver_key_public_modulus.length);\n\t\tSystem.arraycopy(anti_spoofing_cookie, 0, session_id_byte,\n\t\t\t\thost_key_public_modulus.length\n\t\t\t\t\t\t+ server_key_public_modulus.length,\n\t\t\t\tanti_spoofing_cookie.length);\n\n\t\tbyte[] hash_md5 = md5.digest(session_id_byte);\n\n\t\t// SSH_CMSG_SESSION_KEY : Sent by the client\n\t\t// 1 byte cipher_type (must be one of the supported values)\n\t\t// 8 bytes anti_spoofing_cookie (must match data sent by the server)\n\t\t// mp-int double-encrypted session key (uses the session-id)\n\t\t// 32-bit int protocol_flags\n\t\t//\n\t\tif ((supported_ciphers_mask[3] & (byte) (1 << SSH_CIPHER_BLOWFISH)) != 0) {\n\t\t\tcipher_types = (byte) SSH_CIPHER_BLOWFISH;\n\t\t\tcipher_type = \"Blowfish\";\n\t\t} else {\n\t\t\tif ((supported_ciphers_mask[3] & (1 << SSH_CIPHER_IDEA)) != 0) {\n\t\t\t\tcipher_types = (byte) SSH_CIPHER_IDEA;\n\t\t\t\tcipher_type = \"IDEA\";\n\t\t\t} else {\n\t\t\t\tif ((supported_ciphers_mask[3] & (1 << SSH_CIPHER_3DES)) != 0) {\n\t\t\t\t\tcipher_types = (byte) SSH_CIPHER_3DES;\n\t\t\t\t\tcipher_type = \"DES3\";\n\t\t\t\t} else {\n\t\t\t\t\tif ((supported_ciphers_mask[3] & (1 << SSH_CIPHER_DES)) != 0) {\n\t\t\t\t\t\tcipher_types = (byte) SSH_CIPHER_DES;\n\t\t\t\t\t\tcipher_type = \"DES\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t.println(\"SshIO: remote server does not supported IDEA, BlowFish or 3DES, support cypher mask is \"\n\t\t\t\t\t\t\t\t\t\t+ supported_ciphers_mask[3] + \".\\n\");\n\t\t\t\t\t\tSend_SSH_MSG_DISCONNECT(\"No more auth methods available.\");\n\t\t\t\t\t\tdisconnect();\n\t\t\t\t\t\treturn \"\\rRemote server does not support IDEA/Blowfish/3DES blockcipher, closing connection.\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (debug > 0)\n\t\t\tSystem.out.println(\"SshIO: Using \" + cipher_type\n\t\t\t\t\t+ \" blockcipher.\\n\");\n\n\t\t// anti_spoofing_cookie : the same\n\t\t// double_encrypted_session_key :\n\t\t// 32 bytes of random bits\n\t\t// Xor the 16 first bytes with the session-id\n\t\t// encrypt with the server_key_public (small) then the\n\t\t// host_key_public(big) using RSA.\n\t\t//\n\n\t\t// 32 bytes of random bits\n\t\tbyte[] random_bits1 = new byte[16], random_bits2 = new byte[16];\n\n\t\t// / java.util.Date date = new java.util.Date(); ////the number of\n\t\t// milliseconds since January 1, 1970, 00:00:00 GMT.\n\t\t// Math.random() a pseudorandom double between 0.0 and 1.0.\n\t\t// random_bits2 = random_bits1 =\n\t\t// md5.hash(\"\" + Math.random() * (new java.util.Date()).getDate());\n\t\t// md5.digest((\"\" + Math.random() * (new\n\t\t// java.util.Date()).getTime()).getBytes());\n\n\t\t// random_bits1 =\n\t\t// md5.digest(SshMisc.addArrayOfBytes(md5.digest((password +\n\t\t// login).getBytes()), random_bits1));\n\t\t// random_bits2 =\n\t\t// md5.digest(SshMisc.addArrayOfBytes(md5.digest((password +\n\t\t// login).getBytes()), random_bits2));\n\n\t\tSecureRandom random = new java.security.SecureRandom(random_bits1); // no\n\t\t// supported\n\t\t// by\n\t\t// netscape\n\t\t// :-(\n\t\trandom.nextBytes(random_bits1);\n\t\trandom.nextBytes(random_bits2);\n\n\t\tsession_key = SshMisc.addArrayOfBytes(random_bits1, random_bits2);\n\n\t\t// Xor the 16 first bytes with the session-id\n\t\tbyte[] session_keyXored = SshMisc.XORArrayOfBytes(random_bits1,\n\t\t\t\thash_md5);\n\t\tsession_keyXored = SshMisc.addArrayOfBytes(session_keyXored,\n\t\t\t\trandom_bits2);\n\n\t\t// We encrypt now!!\n\t\tbyte[] encrypted_session_key = SshCrypto.encrypteRSAPkcs1Twice(\n\t\t\t\tsession_keyXored, server_key_public_exponent,\n\t\t\t\tserver_key_public_modulus, host_key_public_exponent,\n\t\t\t\thost_key_public_modulus);\n\n\t\t// protocol_flags :protocol extension cf. page 18\n\t\tint protocol_flags = 0; /* currently 0 */\n\n\t\tSshPacket1 packet = new SshPacket1(SSH_CMSG_SESSION_KEY);\n\t\tpacket.putByte((byte) cipher_types);\n\t\tpacket.putBytes(anti_spoofing_cookie);\n\t\tpacket.putBytes(encrypted_session_key);\n\t\tpacket.putInt32(protocol_flags);\n\t\tsendPacket1(packet);\n\t\tcrypto = new SshCrypto(cipher_type, session_key);\n\t\treturn \"\";\n\t}", "public final ByteBlock getEncryptedMsg() { return encryptedMsg; }", "com.google.protobuf.ByteString getAesSessionKey();", "private boolean isValidSession(KafkaMessage msg) {\n\t\treturn msg.messageId_.startsWith(Configurator.SESSION_ID_MSG_ID_PREFIX);\n\t}", "public SealedObject getEncryptedSessionKey() {\n this.encryptedSessionKey = formEncryptedSessionKey();\n return this.encryptedSessionKey;\n }", "private String getSmSession(Message message) {\n\t\t// Determine the authorization type.\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tMap<String, Object> protocolHeaders = (Map<String, Object>) message.get(Message.PROTOCOL_HEADERS);\n\t\tif (protocolHeaders == null) {\n\t\t\tthrow new HpcAuthenticationException(\"Invalid Protocol Headers\");\n\t\t}\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tArrayList<String> header = (ArrayList<String>) protocolHeaders.get(\"NIHSMSESSION\");\n\t\tif (header == null || header.isEmpty()) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn header.get(0);\n\t}", "public void send(String msg)\n { \n try\n { \n\n byte[] msg_data=null;\n\n try {\n Cipher myCipher = Cipher.getInstance(\"AES\");\n myCipher.init(Cipher.ENCRYPT_MODE, client.symetricKey);\n msg_data = myCipher.doFinal(msg.getBytes());\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n\n String redisString2 = new String(Base64.getEncoder().encode(msg_data)); \n \n client.streamOut.writeUTF(redisString2);\n client.streamOut.flush();\n\n\n client.sendSignature(msg);\n\n\n }\n \n catch(IOException ioexception)\n { \n stop();\n }\n }", "private String getSessionKey() {\n checkInitialized();\n return LoxoneCrypto.createSessionKey(sharedKey, sharedKeyIv, publicKey);\n }", "public boolean isSetKeyMsg() {\n return this.keyMsg != null;\n }", "public String getEncryptedMessage(String messageToEncrypt, String kek) {\n try {\n //For both IV and Key we are using KEK. Better if we can find an alternative to generate good IV\n byte[] keyBytes = getKeyBytes(kek);\n byte[] ivBytes = getIVBytes(kek);\n SecretKeySpec skeySpec = new SecretKeySpec(keyBytes, \"AES\");\n IvParameterSpec ivspec = new IvParameterSpec(ivBytes);\n // initialize the cipher for encrypt mode\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n cipher.init(Cipher.ENCRYPT_MODE, skeySpec, ivspec);\n // encrypt the message\n byte[] encrypted = cipher.doFinal(messageToEncrypt.getBytes());\n String enc = Base64.encodeToString(encrypted, Base64.DEFAULT);\n System.out.println(\"Ciphertext: \" + enc + \"\\n\");\n String decrypted = decrypt(enc, kek);\n System.out.println(\"decrypted\" + decrypted);\n /*return decrypted;*/\n return enc;\n } catch (Exception ex) {\n System.out\n .println(\"Exception thrown while encrypting the initial message\");\n ex.printStackTrace();\n }\n return null;\n }", "private void showVerificationCode() {\n HandshakeMessage handshakeMessage;\n\n // Blindly accept the verification code.\n try {\n handshakeMessage = mEncryptionRunner.verifyPin();\n } catch (HandshakeException e) {\n Log.e(TAG, \"Verify pin failed for new keys - Unexpected\");\n resetUnlockStateOnFailure();\n return;\n }\n\n if (handshakeMessage.getHandshakeState() != HandshakeMessage.HandshakeState.FINISHED) {\n Log.e(TAG, \"Handshake not finished after calling verify PIN. Instead got state: \"\n + handshakeMessage.getHandshakeState());\n resetUnlockStateOnFailure();\n return;\n }\n\n mEncryptionState = HandshakeMessage.HandshakeState.FINISHED;\n mEncryptionKey = handshakeMessage.getKey();\n mCurrentContext = D2DConnectionContext.fromSavedSession(mEncryptionKey.asBytes());\n\n if (mClientDeviceId == null) {\n resetUnlockStateOnFailure();\n return;\n }\n byte[] oldSessionKeyBytes = mTrustedDeviceService.getEncryptionKey(mClientDeviceId);\n if (oldSessionKeyBytes == null) {\n Log.e(TAG,\n \"Could not retrieve previous session keys! Have to re-enroll trusted device\");\n resetUnlockStateOnFailure();\n return;\n }\n\n mPrevContext = D2DConnectionContext.fromSavedSession(oldSessionKeyBytes);\n if (mPrevContext == null) {\n resetUnlockStateOnFailure();\n return;\n }\n\n // Now wait for the phone to send its MAC.\n mCurrentUnlockState = UNLOCK_STATE_WAITING_FOR_CLIENT_AUTH;\n logUnlockEvent(WAITING_FOR_CLIENT_AUTH);\n }", "public void sendSessionKey(byte[] encryptedKey, String username) throws java.rmi.RemoteException, InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, BadPaddingException, IllegalBlockSizeException;", "@DISPID(1042) //= 0x412. The runtime will prefer the VTID if present\r\n @VTID(149)\r\n boolean encrypt();", "private void parseSessionID(SSL2ServerHelloMessage message) {\n message.setSessionID(parseByteArrayField(message.getSessionIdLength().getValue()));\n LOGGER.debug(\"SessionID: \" + ArrayConverter.bytesToHexString(message.getSessionId().getValue()));\n }", "String sendEncryptedMessage(String to, String text, String sid) throws RemoteException, ClientNotFound, InterruptedException;", "boolean hasSenderNonce();", "private SealedObject formEncryptedSessionKey() {\n\n SealedObject sessionKeyObj = null;\n\n try {\n // getInstance(crypto algorithm/feedback mode/padding scheme)\n // Alice will use the same key/transformation\n Cipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n cipher.init(Cipher.ENCRYPT_MODE, this.RSAPublicKey);\n sessionKeyObj = new SealedObject(this.sessionKey.getEncoded(), cipher);\n } catch (GeneralSecurityException gse) {\n System.out.println(\"Error: wrong cipher to encrypt message\");\n gse.printStackTrace();\n System.exit(1);\n } catch (IOException ioe) {\n System.out.println(\"Error creating SealedObject\");\n ioe.printStackTrace();\n System.exit(1);\n }\n\n return sessionKeyObj;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks for Latin square
public static boolean isLatinSquare(char[][] m) { for (int i = 0; i < m.length; i++) { for (int j = 0; j < m[0].length; j++) { if (!isLatinSquare(i, j, m) || !validLetter(i, j, m)) { return false; } } } return true; // array must be latin square }
[ "public static boolean isLatinSquare(char[][] square) {\n //check rows\n for (int row = 0; row < square.length; row++) {\n if (!isLatinLine(square[row]))\n return false;\n }\n for (int j = 0; j < square[0].length; j++) {\n char[] column = new char[square.length];\n for (int i = 0; i < square.length; i++) {\n column[i] = square[i][j];\n }\n\n if (!isLatinLine(column))\n return false;\n }\n\n return true;\n }", "@VisibleForTesting\n static boolean passesAzureCharacterRules(String s) {\n return LETTERS.matcher(s).find() && DIGITS.matcher(s).find();\n }", "public static boolean isAllBasicLatin(String srcString) {\n\t\treturn basicLatinPattern.matcher(srcString).matches();\n\t}", "@Override\n public boolean test(String t) {\n return t.contains(\"京\");\n }", "private static boolean checkSolved(StringBuilder fWord) {\n\t\tfor(int i = 0; i < fWord.length(); i++) {\n\t\t\tif(fWord.charAt(i) == '-') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean isValidBoardEntry(String s) {\n if (s.length() == 2) {\n if (s.toLowerCase().equals(\"qu\")) {\n return true;\n } else {\n return false;\n }\n } else if (s.length() != 1) {\n return false;\n } else if (!Character.isLetter(s.charAt(0))) {\n return false;\n } else {\n return true;\n }\n }", "private boolean checkWord(String s) {\n String arrangement = \"^[a-zA-Z]*$\";\r\n if (s.matches(arrangement)) {\r\n return true;\r\n }\r\n return false;\r\n }", "boolean hasConversionCharacterForm();", "static public boolean Validate(String text)\n{\n for(int i=0;i<text.length();i++)\n if(text.charAt(i)<32||text.charAt(i)>127)\n return false;\n\n return true;\n}", "private boolean isword(String word) {\n // wrod should already be in lower case.\n if (word == null || word.length() == 0) {\n return false;\n }\n for (int i = 0; i < word.length(); i++) {\n if (word.charAt(i) < 97 || word.charAt(i) > 122) {\n // if any character is not a lowercase alphabet\n return false;\n }\n }\n return true;\n }", "protected static int countSyllables1(String word)\n {\n int z = 0;\n char[] x = word.toCharArray();\n String non = \"xqwrtyplkjhgfdszxcvbnm\";\n char [] nov= non.toCharArray();\n\n//\t\tString vowels = \"aioue\";\n for (char c : x ){\n\n if (c == 'a' || c == 'i' || c == 'o' || c == 'u' || c == 'e' ){\n z ++;\n\n }\n\n }\n\n\n\n System.out.println(\"found: \" + z);\n return z;\n }", "public void testCheckSymentic1() {\n\n\t\tString input = \"MCMIII\";\n\n\t\tassertNull(UniversalCurrencyConvertor.getCurrencyInstance()\n\t\t\t\t.checkSymentic(input));\n\t}", "private static boolean isPalindrome(String s) {\n int i = 0, j = s.length() - 1;\n while (i < j) {\n char x = s.charAt(i);\n char y = s.charAt(j);\n if (!Character.isDigit(x) && !Character.isAlphabetic(x)) {\n i++; continue;\n } else if (!Character.isDigit(y) && !Character.isAlphabetic(y)) {\n j--; continue;\n }\n if (Character.isAlphabetic(x)) { x = Character.toLowerCase(x); }\n if (Character.isAlphabetic(y)) { y = Character.toLowerCase(y); }\n\n if (x - y != 0) { return false; }\n i++; j--;\n }\n return true;\n }", "@Test(expected = NonLetterException.class)\n public void testWrong() throws NonLetterException {\n final char[] testWrong1 = { 'Z', '&' };\n LatinLetter.getLatinLetters(testWrong1);\n String second = \"-Start checking if all got letters are the Latin ones.\\n\"\n + \"Letter Z is a Latin one\\n\"\n + \"[!] Exception 'NonLetterException' was caught:\\n\"\n + \" '& character is not from Latin alphabet.'\\n\"\n + \"-End of the operation.\\n\\n\";\n Assert.assertEquals(\"test2\", second, this.log.getLog());\n }", "@Test\r\n\t// TO BE IMPLEMENTED BY STUDENT\r\n\tpublic void testCheckGreStringStudent()\r\n\t{\n\t assertEquals(greUtility.checkGRE(\"the\", greWords),false);\r\n\t assertEquals(greUtility.checkGRE(\"sinuous\", greWords),true); \r\n\t}", "public boolean detectCapitalUse(String word) {\n\t char[] charArray = word.toCharArray();\n\t //true represent right\n\t boolean flag=true;\n\t //true represent Upper\n\t boolean firstJudge = false;\n\t //if count=-(n-1) 均为小写 count=n-1 均为大写\n\t int count=0;\n\t firstJudge = Character.isUpperCase(charArray[0]);\n\t //如果第一个字母是小写,后面只能均为小写\n\t //如果第一个字母是大写,后面可以均为大写或均为小写\n\t for(int i=1;i<charArray.length;i++){\n\t \tif(firstJudge==false){\n\t \t\tif(Character.isUpperCase(charArray[i])){\n\t \t\t\tflag=false;\n\t \t\t\tbreak;\n\t \t\t}\n\t \t}\n\t \tif(firstJudge==true){\n\t \t\t\n\t \t\tif(Character.isUpperCase(charArray[i])){\n\t \t\t\tcount++;\n\t \t\t}\n\t \t\tif(Character.isUpperCase(charArray[i])==false){\n\t \t\t\tcount--;\n\t \t\t}\n\t \t}\n\t }\n\t if(firstJudge==false&&flag==true)return true;\n\t if(firstJudge==true){\n\t \tif(count==charArray.length-1||count==-(charArray.length-1)){\n\t \t\treturn true;\n\t \t}\n\t }\n\t return false;\n }", "static String isValid(String s) {\n char[] ca = s.toCharArray();\n HashSet<Character> hs = new HashSet<>();\n for (char c : ca) {\n if (hs.contains(c)) {\n\n } else {\n hs.add(c);\n }\n System.out.println(hs.size());\n }\n\n if (s.length() % hs.size() == 0 || s.length() % hs.size() == 1) {\n return \"YES\";\n } else {\n return \"NO\";\n }\n }", "static public boolean isSameSide(char a, char b)\n\t{\n//\t\tSystem.out.println(a+\" \"+b);\n\t\tif( a>='a' && a<='z' && b>='a' && b<='z')\n\t\t\treturn true;\n\t\tif( a>='A' && a<='Z' && b>='A' && b<='Z')\n\t\t\treturn true;\n//\t\tSystem.out.println(\"***********\");\n\t\treturn false;\n\t\t\n\t}", "private void checkEnglish(List<Student> students) {\n long hash = 0;\n for (int i = 101; i < 127; i++) {\n hash += i;\n }\n test(hash, students);\n }", "static String isValid(String s) {\n char [] array = s.toCharArray();\n int [] count = new int[26];\n for(int i=0;i<array.length;i++){\n int val = array[i]-'a';\n count[val]++;\n }\n \n boolean same = checkSame(count);\n if(same){\n return \"YES\";\n }\n \n for(int i=0;i<count.length;i++){\n if(count[i]==0){\n continue;\n }\n count[i]--;\n same = checkSame(count);\n if(same){\n return \"YES\";\n }\n count[i]++;\n }\n return \"NO\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method used to check if Enemy wants to move in forbidden way.
public boolean checkForbiddenDestination() { return (actualPosition == null &&(actualDestination == Destination.Up || actualDestination == Destination.Down)); }
[ "boolean isMoveLegal() {\n\n\t\tif (canJump() && isRequestedJumpLegal() && isRequestedMoveAJump()\n\t\t\t\t&& !firstMoveNonJump) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!canJump() && isNonJumpMoveLegal() && !isRequestedMoveAJump()) {\n\t\t\treturn true;\n\t\t}\n\t\tfirstPartOfMoveSelected = false;\n\t\tsecondPartOfMoveSelected = false;\n\t\tif (isRedPlayerTurn) {\n\t\t\tServerController.redInvalidMove();\n\t\t} else {\n\t\t\tServerController.whiteInvalidMove();\n\t\t}\n\t\treturn false;\n\t}", "public boolean isLegal(PentagoMove m) {\n if (m.getASwap() == m.getBSwap()) { return false; } // Cannot swap same tile\n PentagoCoord c = m.getMoveCoord();\n if (c.getX() >= BOARD_SIZE || c.getX() < 0 || c.getY() < 0 || c.getY() >= BOARD_SIZE) { return false; }\n if (turnPlayer != m.getPlayerID() || m.getPlayerID() == ILLEGAL) { return false; } //Check right player\n return board[c.getX()][c.getY()] == Piece.EMPTY;\n }", "boolean isLegal(Move move) {\r\n return isLegal(move.from(), move.to(), move.spear());\r\n }", "boolean unableToMoveLose();", "public boolean unableToMoveLose() {\n return (boolean) sendMessageWithReturn(new Message(\"unableToMoveLose\"));\n }", "private boolean isLegal(Move move) {\r\n\t\tmove(move);\r\n\t\tboolean legal = !isInCheck();\r\n\t\tundo(move);\r\n\t\treturn legal;\r\n\t}", "public boolean isLegal(ChessMove m)\n {\n return isLegal(m, bIsWhitesMove);\n }", "public boolean isObstacleAllowed()\r\n\t{\n\t\treturn false;\r\n\t}", "public boolean isEligibleForMovement() {\n // check if entity is offboard\n if (isOffBoard() || isAssaultDropInProgress()) {\n return false;\n }\n // check game options\n if (!game.getOptions().booleanOption(\"skip_ineligable_movement\")) {\n return true;\n }\n\n // must be active\n if (!isActive()\n || (isImmobile() && !isManualShutdown() && !canUnjamRAC() && !game\n .getOptions().booleanOption(\"vehicles_can_eject\"))) {\n return false;\n }\n\n return true;\n }", "public boolean hasLegalMovement() {\n\t\tfor (Piece p : pieces) {\n\t\t\tif (p.hasLegalMovement()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean canMove(int x, int y){\n\t\tfor(Critter c: population){\n\t\t\tif(c.x_coord == x && c.y_coord == y) //if there is a critter in the spot we are trying to move to, return false\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isMoveLegal(final Move move){\n return this.legalMoves.contains(move);\n }", "public boolean checkMoveable(int x, int y) {\n\t\tif(!this.alive) return false;\n\t\tif(!getGameInProgress()) return false;\n \tif(!((y < dungeon.getHeight()) && (y >= 0)))\treturn false;\n \tif(!((x < dungeon.getWidth()) && (x >= 0)))\t\treturn false;\n// \tif (!this.playerIsinvincible) {\n//\t \tif(x > this.getX() + 5 || x < this.getX() - 5) return false;\n//\t \tif(y > this.getY() + 5 || y < this.getY() - 5) return false;\n// \t}\n \t\n \tArrayList<Entity> list = dungeon.getEntity(x, y);\n if(!list.isEmpty()) {\n \tboolean result = true;\n \tfor (Entity e: list) {\n \t\tif(! e.movable(this)) return false;\n \t\tif (e instanceof Enemy) return false;\n }\n \treturn result;\n }\n return true;\n }", "Boolean isMoveEligible();", "private boolean isLegal(PeckingPiece piece, int x, int y)\n {\n return getLegalMoves(piece).contains(new Point(x, y));\n }", "public boolean canMove(int x, int y) {\n\t\treturn false;\r\n\t}", "public boolean isBlocked(ForgeDirection dir);", "@Override\n public boolean canSeeThroughTheExitIntoEternity(Direction direction) throws UnsupportedOperationException {\n sensor.setSensorDirection(direction);\n try {\n int[] currentPos = getCurrentPosition();\n float[] tempBatteryLevel = new float[] {batteryLevel};\n if(sensor.distanceToObstacle(currentPos, getCurrentDirection(), tempBatteryLevel) == Integer.MAX_VALUE) {\n return true;\n }\n }\n catch(Exception e) {\n Log.v(TAG, \"Error: Current Position Not In Maze5\");\n System.out.println(\"Error: Current Position Not In Maze5\");\n }\n return false;\n }", "public boolean isMoveLegal(int row, char column, boolean isWhitesTurn);", "@Override\n public boolean isLegalMove(Position p) {\n List<Position> moves = this.getLegalMoves(); // We create another list with the same elements as the param of the object\n return (moves.contains(p)) ? true : false; //if getLegalMoves contains the position we received, it return true else false.\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__ConstantValue__NamedValueAssignment" $ANTLR start "rule__ReferenceTerm__PathAssignment_2" InternalAgreeParser.g:29171:1: rule__ReferenceTerm__PathAssignment_2 : ( ruleContainmentPathElement ) ;
public final void rule__ReferenceTerm__PathAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalAgreeParser.g:29175:1: ( ( ruleContainmentPathElement ) ) // InternalAgreeParser.g:29176:1: ( ruleContainmentPathElement ) { // InternalAgreeParser.g:29176:1: ( ruleContainmentPathElement ) // InternalAgreeParser.g:29177:1: ruleContainmentPathElement { if ( state.backtracking==0 ) { before(grammarAccess.getReferenceTermAccess().getPathContainmentPathElementParserRuleCall_2_0()); } pushFollow(FollowSets000.FOLLOW_2); ruleContainmentPathElement(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getReferenceTermAccess().getPathContainmentPathElementParserRuleCall_2_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void ruleContainmentPath() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalJsonParser.g:493:2: ( ( ( rule__ContainmentPath__PathAssignment ) ) )\n // InternalJsonParser.g:494:2: ( ( rule__ContainmentPath__PathAssignment ) )\n {\n // InternalJsonParser.g:494:2: ( ( rule__ContainmentPath__PathAssignment ) )\n // InternalJsonParser.g:495:3: ( rule__ContainmentPath__PathAssignment )\n {\n before(grammarAccess.getContainmentPathAccess().getPathAssignment()); \n // InternalJsonParser.g:496:3: ( rule__ContainmentPath__PathAssignment )\n // InternalJsonParser.g:496:4: rule__ContainmentPath__PathAssignment\n {\n pushFollow(FollowSets000.FOLLOW_2);\n rule__ContainmentPath__PathAssignment();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getContainmentPathAccess().getPathAssignment()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__ContainmentPathElement__Group_1__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // InternalResoluteParser.g:13110:1: ( ( ( rule__ContainmentPathElement__PathAssignment_1_1 ) ) )\n // InternalResoluteParser.g:13111:1: ( ( rule__ContainmentPathElement__PathAssignment_1_1 ) )\n {\n // InternalResoluteParser.g:13111:1: ( ( rule__ContainmentPathElement__PathAssignment_1_1 ) )\n // InternalResoluteParser.g:13112:1: ( rule__ContainmentPathElement__PathAssignment_1_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getContainmentPathElementAccess().getPathAssignment_1_1()); \n }\n // InternalResoluteParser.g:13113:1: ( rule__ContainmentPathElement__PathAssignment_1_1 )\n // InternalResoluteParser.g:13113:2: rule__ContainmentPathElement__PathAssignment_1_1\n {\n pushFollow(FollowSets000.FOLLOW_2);\n rule__ContainmentPathElement__PathAssignment_1_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getContainmentPathElementAccess().getPathAssignment_1_1()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__TargetParameter__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDSL.g:1483:1: ( ( ( rule__TargetParameter__PathAssignment_2 ) ) )\n // InternalDSL.g:1484:1: ( ( rule__TargetParameter__PathAssignment_2 ) )\n {\n // InternalDSL.g:1484:1: ( ( rule__TargetParameter__PathAssignment_2 ) )\n // InternalDSL.g:1485:2: ( rule__TargetParameter__PathAssignment_2 )\n {\n before(grammarAccess.getTargetParameterAccess().getPathAssignment_2()); \n // InternalDSL.g:1486:2: ( rule__TargetParameter__PathAssignment_2 )\n // InternalDSL.g:1486:3: rule__TargetParameter__PathAssignment_2\n {\n pushFollow(FOLLOW_2);\n rule__TargetParameter__PathAssignment_2();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getTargetParameterAccess().getPathAssignment_2()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void ruleNextPathElementCS() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1970:2: ( ( ( rule__NextPathElementCS__ElementAssignment ) ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1971:1: ( ( rule__NextPathElementCS__ElementAssignment ) )\r\n {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1971:1: ( ( rule__NextPathElementCS__ElementAssignment ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1972:1: ( rule__NextPathElementCS__ElementAssignment )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getNextPathElementCSAccess().getElementAssignment()); \r\n }\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1973:1: ( rule__NextPathElementCS__ElementAssignment )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:1973:2: rule__NextPathElementCS__ElementAssignment\r\n {\r\n pushFollow(FollowSets000.FOLLOW_rule__NextPathElementCS__ElementAssignment_in_ruleNextPathElementCS4125);\r\n rule__NextPathElementCS__ElementAssignment();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getNextPathElementCSAccess().getElementAssignment()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__Term__ConstraintAssignment_1_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalStateConstraintTransition.g:6974:1: ( ( ruleterm ) )\n // InternalStateConstraintTransition.g:6975:2: ( ruleterm )\n {\n // InternalStateConstraintTransition.g:6975:2: ( ruleterm )\n // InternalStateConstraintTransition.g:6976:3: ruleterm\n {\n before(grammarAccess.getTermAccess().getConstraintTermParserRuleCall_1_2_0()); \n pushFollow(FOLLOW_2);\n ruleterm();\n\n state._fsp--;\n\n after(grammarAccess.getTermAccess().getConstraintTermParserRuleCall_1_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Instruction_urem__Op2Assignment_4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:33308:1: ( ( ruleValueRef ) )\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:33309:1: ( ruleValueRef )\n {\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:33309:1: ( ruleValueRef )\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:33310:1: ruleValueRef\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getInstruction_uremAccess().getOp2ValueRefParserRuleCall_4_0()); \n }\n pushFollow(FollowSets005.FOLLOW_ruleValueRef_in_rule__Instruction_urem__Op2Assignment_468824);\n ruleValueRef();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getInstruction_uremAccess().getOp2ValueRefParserRuleCall_4_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__ContainmentPathElement__NamedElementAssignment_0_0() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17114:1: ( ( ( RULE_ID ) ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17115:1: ( ( RULE_ID ) )\r\n {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17115:1: ( ( RULE_ID ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17116:1: ( RULE_ID )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getContainmentPathElementAccess().getNamedElementNamedElementCrossReference_0_0_0()); \r\n }\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17117:1: ( RULE_ID )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:17118:1: RULE_ID\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getContainmentPathElementAccess().getNamedElementNamedElementIDTerminalRuleCall_0_0_0_1()); \r\n }\r\n match(input,RULE_ID,FollowSets001.FOLLOW_RULE_ID_in_rule__ContainmentPathElement__NamedElementAssignment_0_034935); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getContainmentPathElementAccess().getNamedElementNamedElementIDTerminalRuleCall_0_0_0_1()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getContainmentPathElementAccess().getNamedElementNamedElementCrossReference_0_0_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__PathNameCS__Group__0__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11747:1: ( ( ( rule__PathNameCS__PathAssignment_0 ) ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11748:1: ( ( rule__PathNameCS__PathAssignment_0 ) )\r\n {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11748:1: ( ( rule__PathNameCS__PathAssignment_0 ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11749:1: ( rule__PathNameCS__PathAssignment_0 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getPathNameCSAccess().getPathAssignment_0()); \r\n }\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11750:1: ( rule__PathNameCS__PathAssignment_0 )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:11750:2: rule__PathNameCS__PathAssignment_0\r\n {\r\n pushFollow(FollowSets001.FOLLOW_rule__PathNameCS__PathAssignment_0_in_rule__PathNameCS__Group__0__Impl23995);\r\n rule__PathNameCS__PathAssignment_0();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getPathNameCSAccess().getPathAssignment_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__ContainedPropertyAssociation__AppliesToAssignment_4_2() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:16398:1: ( ( ruleContainmentPath ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:16399:1: ( ruleContainmentPath )\r\n {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:16399:1: ( ruleContainmentPath )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:16400:1: ruleContainmentPath\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getContainedPropertyAssociationAccess().getAppliesToContainmentPathParserRuleCall_4_2_0()); \r\n }\r\n pushFollow(FollowSets001.FOLLOW_ruleContainmentPath_in_rule__ContainedPropertyAssociation__AppliesToAssignment_4_233464);\r\n ruleContainmentPath();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getContainedPropertyAssociationAccess().getAppliesToContainmentPathParserRuleCall_4_2_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__MethodReference__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12549:1: ( ( ( rule__MethodReference__MethodAssignment_2 ) ) )\n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12550:1: ( ( rule__MethodReference__MethodAssignment_2 ) )\n {\n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12550:1: ( ( rule__MethodReference__MethodAssignment_2 ) )\n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12551:1: ( rule__MethodReference__MethodAssignment_2 )\n {\n before(grammarAccess.getMethodReferenceAccess().getMethodAssignment_2()); \n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12552:1: ( rule__MethodReference__MethodAssignment_2 )\n // ../de.gebit.integrity.dsl.ui/src-gen/de/gebit/integrity/ui/contentassist/antlr/internal/InternalDSL.g:12552:2: rule__MethodReference__MethodAssignment_2\n {\n pushFollow(FOLLOW_rule__MethodReference__MethodAssignment_2_in_rule__MethodReference__Group__2__Impl25386);\n rule__MethodReference__MethodAssignment_2();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getMethodReferenceAccess().getMethodAssignment_2()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__VariableInequalityOperation__RightAssignment_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDSL.g:5762:1: ( ( ruleCharacteristicReference ) )\n // InternalDSL.g:5763:2: ( ruleCharacteristicReference )\n {\n // InternalDSL.g:5763:2: ( ruleCharacteristicReference )\n // InternalDSL.g:5764:3: ruleCharacteristicReference\n {\n before(grammarAccess.getVariableInequalityOperationAccess().getRightCharacteristicReferenceParserRuleCall_2_0()); \n pushFollow(FOLLOW_2);\n ruleCharacteristicReference();\n\n state._fsp--;\n\n after(grammarAccess.getVariableInequalityOperationAccess().getRightCharacteristicReferenceParserRuleCall_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__URIFirstPathElementCS__ElementAssignment_1_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18042:1: ( ( ( ruleURI ) ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18043:1: ( ( ruleURI ) )\r\n {\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18043:1: ( ( ruleURI ) )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18044:1: ( ruleURI )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getURIFirstPathElementCSAccess().getElementNamespaceCrossReference_1_1_0()); \r\n }\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18045:1: ( ruleURI )\r\n // ../org.eclipse.qvto.examples.xtext.qvtoperational.ui/src-gen/org/eclipse/qvto/examples/xtext/qvtoperational/ui/contentassist/antlr/internal/InternalQVTOperational.g:18046:1: ruleURI\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getURIFirstPathElementCSAccess().getElementNamespaceURIParserRuleCall_1_1_0_1()); \r\n }\r\n pushFollow(FollowSets001.FOLLOW_ruleURI_in_rule__URIFirstPathElementCS__ElementAssignment_1_136978);\r\n ruleURI();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getURIFirstPathElementCSAccess().getElementNamespaceURIParserRuleCall_1_1_0_1()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getURIFirstPathElementCSAccess().getElementNamespaceCrossReference_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__ImageRef__PathAssignment_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.xtext.xdoc.ui/src-gen/org/eclipse/xtext/xdoc/ui/contentassist/antlr/internal/InternalXdoc.g:12075:1: ( ( ruleText ) )\n // ../org.eclipse.xtext.xdoc.ui/src-gen/org/eclipse/xtext/xdoc/ui/contentassist/antlr/internal/InternalXdoc.g:12076:1: ( ruleText )\n {\n // ../org.eclipse.xtext.xdoc.ui/src-gen/org/eclipse/xtext/xdoc/ui/contentassist/antlr/internal/InternalXdoc.g:12076:1: ( ruleText )\n // ../org.eclipse.xtext.xdoc.ui/src-gen/org/eclipse/xtext/xdoc/ui/contentassist/antlr/internal/InternalXdoc.g:12077:1: ruleText\n {\n before(grammarAccess.getImageRefAccess().getPathTextParserRuleCall_1_0()); \n pushFollow(FOLLOW_ruleText_in_rule__ImageRef__PathAssignment_124426);\n ruleText();\n\n state._fsp--;\n\n after(grammarAccess.getImageRefAccess().getPathTextParserRuleCall_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Relational__Group_1_0_2__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // InternalArgument.g:3287:1: ( ( ( rule__Relational__Rel_opAssignment_1_0_2_1 ) ) )\n // InternalArgument.g:3288:1: ( ( rule__Relational__Rel_opAssignment_1_0_2_1 ) )\n {\n // InternalArgument.g:3288:1: ( ( rule__Relational__Rel_opAssignment_1_0_2_1 ) )\n // InternalArgument.g:3289:1: ( rule__Relational__Rel_opAssignment_1_0_2_1 )\n {\n before(grammarAccess.getRelationalAccess().getRel_opAssignment_1_0_2_1()); \n // InternalArgument.g:3290:1: ( rule__Relational__Rel_opAssignment_1_0_2_1 )\n // InternalArgument.g:3290:2: rule__Relational__Rel_opAssignment_1_0_2_1\n {\n pushFollow(FOLLOW_2);\n rule__Relational__Rel_opAssignment_1_0_2_1();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getRelationalAccess().getRel_opAssignment_1_0_2_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__TypedValue__Group__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25081:1: ( ( ( rule__TypedValue__RefAssignment_1 ) ) )\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25082:1: ( ( rule__TypedValue__RefAssignment_1 ) )\r\n {\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25082:1: ( ( rule__TypedValue__RefAssignment_1 ) )\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25083:1: ( rule__TypedValue__RefAssignment_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypedValueAccess().getRefAssignment_1()); \r\n }\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25084:1: ( rule__TypedValue__RefAssignment_1 )\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:25084:2: rule__TypedValue__RefAssignment_1\r\n {\r\n pushFollow(FollowSets004.FOLLOW_rule__TypedValue__RefAssignment_1_in_rule__TypedValue__Group__1__Impl51377);\r\n rule__TypedValue__RefAssignment_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypedValueAccess().getRefAssignment_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__Instruction_sub__Op2Assignment_5() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:32787:1: ( ( ruleValueRef ) )\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:32788:1: ( ruleValueRef )\n {\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:32788:1: ( ruleValueRef )\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:32789:1: ruleValueRef\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getInstruction_subAccess().getOp2ValueRefParserRuleCall_5_0()); \n }\n pushFollow(FollowSets005.FOLLOW_ruleValueRef_in_rule__Instruction_sub__Op2Assignment_567772);\n ruleValueRef();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getInstruction_subAccess().getOp2ValueRefParserRuleCall_5_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__ImportCS__OwnedPathNameAssignment_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalCPL.g:16217:1: ( ( ruleURIPathNameCS ) )\n // InternalCPL.g:16218:2: ( ruleURIPathNameCS )\n {\n // InternalCPL.g:16218:2: ( ruleURIPathNameCS )\n // InternalCPL.g:16219:3: ruleURIPathNameCS\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getImportCSAccess().getOwnedPathNameURIPathNameCSParserRuleCall_2_0()); \n }\n pushFollow(FollowSets000.FOLLOW_2);\n ruleURIPathNameCS();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getImportCSAccess().getOwnedPathNameURIPathNameCSParserRuleCall_2_0()); \n }\n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__FromCollection__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5621:1: ( ( ( rule__FromCollection__PathAssignment_2 ) ) )\n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5622:1: ( ( rule__FromCollection__PathAssignment_2 ) )\n {\n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5622:1: ( ( rule__FromCollection__PathAssignment_2 ) )\n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5623:1: ( rule__FromCollection__PathAssignment_2 )\n {\n before(grammarAccess.getFromCollectionAccess().getPathAssignment_2()); \n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5624:1: ( rule__FromCollection__PathAssignment_2 )\n // ../com.emftriple.query.jpql.ui/src-gen/com/emftriple/query/ui/contentassist/antlr/internal/InternalJpql.g:5624:2: rule__FromCollection__PathAssignment_2\n {\n pushFollow(FOLLOW_rule__FromCollection__PathAssignment_2_in_rule__FromCollection__Group__2__Impl11600);\n rule__FromCollection__PathAssignment_2();\n _fsp--;\n\n\n }\n\n after(grammarAccess.getFromCollectionAccess().getPathAssignment_2()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__UnnamedClassifierType__Group_2_2__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7867:1: ( ( ( rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1 ) ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7868:1: ( ( rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1 ) )\r\n {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7868:1: ( ( rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1 ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7869:1: ( rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getUnnamedClassifierTypeAccess().getClassifierReferenceAssignment_2_2_1()); \r\n }\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7870:1: ( rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1 )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:7870:2: rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1\r\n {\r\n pushFollow(FollowSets000.FOLLOW_rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1_in_rule__UnnamedClassifierType__Group_2_2__1__Impl16564);\r\n rule__UnnamedClassifierType__ClassifierReferenceAssignment_2_2_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getUnnamedClassifierTypeAccess().getClassifierReferenceAssignment_2_2_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void ruleLiteralorReferenceTerm() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1496:5: ( ( ( rule__LiteralorReferenceTerm__NamedValueAssignment ) ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1497:1: ( ( rule__LiteralorReferenceTerm__NamedValueAssignment ) )\r\n {\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1497:1: ( ( rule__LiteralorReferenceTerm__NamedValueAssignment ) )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1498:1: ( rule__LiteralorReferenceTerm__NamedValueAssignment )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getLiteralorReferenceTermAccess().getNamedValueAssignment()); \r\n }\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1499:1: ( rule__LiteralorReferenceTerm__NamedValueAssignment )\r\n // ../org.osate.xtext.aadl2.propertyset.ui/src-gen/org/osate/xtext/aadl2/propertyset/ui/contentassist/antlr/internal/InternalPropertysetParser.g:1499:2: rule__LiteralorReferenceTerm__NamedValueAssignment\r\n {\r\n pushFollow(FollowSets000.FOLLOW_rule__LiteralorReferenceTerm__NamedValueAssignment_in_ruleLiteralorReferenceTerm3171);\r\n rule__LiteralorReferenceTerm__NamedValueAssignment();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getLiteralorReferenceTermAccess().getNamedValueAssignment()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the value associated with the column: bp
public java.lang.String getBp () { return bp; }
[ "public String getBPValue () \n\t{\n\t\treturn (String)get_Value(COLUMNNAME_BPValue);\n\t}", "Value<?> getCellValue(int column, int row);", "public Object getColumnValue(PazientePresenter pazienteP, int column) {\n if(column == 0) return pazienteP.getFullName();\n else if(column == 1) return pazienteP.getFullAddress();\n else return null;\n }", "public Buffer getValue(int row, String colName)\r\n\t{\r\n\t\treturn getValue(row, columns.getIndexByName(colName));\r\n\t}", "private String getCellValue(int x,int y)\n {\n return tbl_piket.getValueAt(x,y).toString();\n }", "@Override\n public Object getColumnValue(int colIndex) {\n checkColumnIndex(colIndex);\n\n Object value = null;\n if (!isNullValue(colIndex)) {\n int offset = valueOffsets[colIndex];\n ColumnType colType = colInfos.get(colIndex).getType();\n value = PageTupleUtil.getColumnValue(dbPage, offset, colType);\n }\n return value;\n }", "int getBgmValue();", "public String getColumn_Value(Map<String,String> pk, String table, String column, String date) {\n \tString query = \"SELECT DISTINCT \"+column+\" FROM hist_\"+table+\" WHERE \";\n \tint i=0;\n \tfor(Map.Entry<String,String> entry:pk.entrySet()) {\n \t\tif(i==0) {\n \t\t\tquery += entry.getKey() + \"='\" + entry.getValue() + \"'\";\n \t\t\ti=1;\n \t\t}\n \t\telse {\n \t\t\tquery += \" AND \" + entry.getKey() + \"='\" + entry.getValue() + \"'\";\n \t\t}\n \t}\n \tquery += \" AND START_DATE <= '\"+date+\"' AND (END_DATE >= '\"+date+\"' OR END_DATE IS NULL)\";\n \t//System.out.println(query);\n \tresultSet = null;\n \tString colVal = null;\n \ttry {\n \t\tstatement = connection.prepareStatement(query);\n \t\tresultSet = statement.executeQuery();\n \t\twhile(resultSet.next()) {\n \t\t\tcolVal = resultSet.getString(column);\n \t\t\tbreak;\n \t\t}\n \t} \n \tcatch(SQLException e){\n \t\te.printStackTrace();\n \t}\n \treturn colVal;\n }", "@Override\r\n\tpublic Object getValueAt(int tableRow, int tableCol) {\r\n int[] parentVals =\r\n getBayesIm().getParentValues(getNodeIndex(), tableRow);\r\n\r\n if (tableCol < parentVals.length) {\r\n Node columnNode = getBayesIm().getNode(\r\n getBayesIm().getParent(getNodeIndex(), tableCol));\r\n BayesPm bayesPm = getBayesIm().getBayesPm();\r\n return bayesPm.getCategory(columnNode, parentVals[tableCol]);\r\n }\r\n else {\r\n int colIndex = tableCol - parentVals.length;\r\n\r\n if (colIndex < getBayesIm().getNumColumns(getNodeIndex())) {\r\n return getBayesIm().getProbability(getNodeIndex(), tableRow,\r\n colIndex);\r\n }\r\n\r\n return \"null\";\r\n }\r\n }", "public Object getColumnValue(Object element, int columnIndex);", "public Object getValue(String columnName) {\n\t\treturn values[columns.getColumnIndex(columnName)];\n\t}", "public void setBPValue (String BPValue)\n\t{\n\t\tthrow new IllegalArgumentException (\"BPValue is virtual column\");\t}", "public Object getValueFromRecord(DatabaseRecord record){\r\n return record.get(this.column);\r\n }", "@Override\n public Object value(int idx) {\n Preconditions.checkElementIndex(idx, row.size(), \"column\");\n return row.get(idx);\n }", "public Object getCABAFILIA_URBANI() throws SQLException {\n\t\treturn select.getCacheValueAt(rowNumber, 5);\n\t}", "@Override\n public Object getColumnValue(String columnName) {\n return _columns.get(columnName);\n }", "public Object getValue(Column column) {\n\t\treturn values.get(column);\n\t}", "public AtomValue<?> get(AtomValue<?> columnName, AtomValue<?> columnFamilyId);", "public FloatColumn getOverallBValue() {\n return delegate.getColumn(\"overall_b_value\", DelegatingFloatColumn::new);\n }", "@Override\r\n\tpublic V get(Object row, Object column) {\n\t\tEntryNode node = getEntry(row, column);\r\n\t\treturn node == null ? null : node.getValue();\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to resize the preview image
private void resizePreviewImage() { // only resize it if there is a preview image to begin with if (previewIcon != null) { PreviewImagePanel.initializeBlankImage(); PreviewImagePanel.setImage(previewIcon.getImage()); } }
[ "public int getPictureSize() {\n return resize;\n }", "private void resize() {\n int Ho = bm.getHeight();\n int Wo = bm.getWidth();\n if (Ho > Wo) {\n if (Ho > pix_max) {\n int H = pix_max;\n int W = (int) ((double) (Wo) * ((double) (pix_max) / (double) (Ho)));\n resizeBitmap(W, H, Wo, Ho);\n Log.i(TAG, \"Bitmap resized\");\n }\n } else {\n if (Wo > pix_max) {\n int W = pix_max;\n int H = (int) ((double) (Ho) * ((double) (pix_max) / (double) (Wo)));\n resizeBitmap(W, H, Wo, Ho);\n Log.i(TAG, \"Bitmap resized\");\n }\n }\n }", "@Override\n public void resize(int width, int height) {\n \n }", "byte[] resizeImage(String original, String resized, String width, String height, boolean cropToFit);", "void onResize(double newWidth, double newHeight);", "private void resizePreviewView(int sw, int sh) {\n\t\tView container = findViewById(R.id.linearLayoutPreview);\n\n\t\tif (container == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tint cw = container.getWidth(), ch = container.getHeight();\n\t\tint pw, ph;\n\t\tdouble cc = ch / cw, sc = sh / sw, sp;\n\n\t\tif (cc > sc) {\n\t\t\tpw = sw;\n\t\t\tsp = 100 * sh / sw;\n\t\t\tph = (int) (sp * cw / 100);\n\t\t} else {\n\t\t\tph = sh;\n\t\t\tsp = 100 * sw / sh;\n\t\t\tpw = (int) (sp * ch / 100);\n\t\t}\n\n\t\t/*int newHeight = container.getHeight();\n\t\tint newWidth = (container.getHeight() * camSize.height) / camSize.width;\n\n\t\tif (newWidth > container.getWidth()) {\n\t\t\tnewWidth = container.getWidth();\n\t\t\tnewHeight = (container.getWidth() * camSize.width) / camSize.height;\n\t\t}*/\n\n\t\tLayoutParams lp = mSurfaceView.getLayoutParams();\n\t\tlp.width = pw;\n\t\tlp.height = ph;\n\t\tmSurfaceView.setLayoutParams(lp);\n\t\tdebug(\"New size: \" + lp.width + \" x \" + lp.height);\n\t\tmSurfaceView.requestLayout();\n\t}", "@Override\n\tpublic void resizeTo(int width, int height) {\n\t}", "@Override\n public abstract void resize(int width, int height);", "@Override\n public void resize() {\n\n }", "private Bitmap setReducedImageSize () {\n\n int targetImageViewWidth = takedPhoto.getWidth();\n int targetImageViewHeight = takedPhoto.getHeight();\n\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(imageFullPath, bmOptions);\n int cameraImageWidth = bmOptions.outWidth;\n int cameraImageHeight = bmOptions.outHeight;\n\n int scaleFactor = Math.min(cameraImageWidth/targetImageViewWidth, cameraImageHeight/targetImageViewHeight);\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inJustDecodeBounds = false;\n Bitmap photoReducedSize = BitmapFactory.decodeFile(imageFullPath, bmOptions);\n\n takedPhoto.setImageBitmap(photoReducedSize);\n\n return photoReducedSize;\n }", "void setCameraPreviewSize(int width, int height, boolean isCameraWidthHeightSwapped) {\n if (width == texWidth && height == texHeight && isCameraWidthHeightSwapped == texWidthHeightSwapped)\n return;\n texWidth = width;\n texHeight = height;\n texWidthHeightSwapped = isCameraWidthHeightSwapped;\n isSizeChanged = true;\n }", "@Ignore\r\n\t@Test\r\n\tpublic void resize_always_imageSizeIsEqualToTargetsie() {\r\n\t\tImageWrapper image = new DefaultResourceProvider(new ImageCache()).readBitmap(\"wiese1\");\r\n\t\tImageWrapper resizedImage = new PcImagesResizer().resize(image, 5, 5);\r\n\t\tassertThat(resizedImage.getBitmap(), allOf(hasProperty(\"width\"), is(5.0), hasProperty(\"height\"), is(5.0)));\r\n\t}", "byte[] resizeImage(String original, byte[] content, String width, String height, boolean cropToFit);", "public void onResize(int width, int height) {}", "public static void resize() {\n\r\n myRoot.setPrefWidth(getMyWidth());\r\n PStage.setWidth(getMyWidth());\r\n PStage.setHeight(getMyHeight() + 150);\r\n myCanvas.setWidth(getMyWidth());\r\n myCanvas.setHeight(getMyHeight());\r\n mysp2.setPrefWidth(getMyWidth());\r\n\r\n\r\n }", "private void previewCapturedImage() {\n\t\ttry {\n\t\t\timgPreview.setVisibility(View.VISIBLE);\n\n\t\t\t// bimatp factory\n\t\t\tBitmapFactory.Options options = new BitmapFactory.Options();\n\n\t\t\t// downsizing image as it throws OutOfMemory Exception for larger\n\t\t\t// images\n\t\t\toptions.inSampleSize = 8;\n\n\t\t\tfinal Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\timgPreview.setImageBitmap(bitmap);\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "IImage downscale(int newHeight, int newWidth);", "public int getPreviewSize()\n\t{\n\t\treturn previewSize;\n\t\t\n\t}", "void myResize();", "@Override\r\n\tpublic void resize() {\r\n\t\tsetSize(size);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unused in the text view
@Override public void refresh() { }
[ "public void removeText() {\n\t\t// Update damage area\n\t\tif (owner_ != null && owner_.getWindow() != null && texts_ != null) {\n\t\t\tRegion damage = findRegion(texts_);\n\t\t\towner_.getWindow().updateDamageArea(damage);\n\t\t}\n\n\t\t// Nullify texts\n\t\ttexts_ = null;\n\t}", "private void setTextViewText(String str) {\r\n\t\tgPlusGuyRepresentation.append(str);\r\n\t\tgPlusGuyRepresentation.append(\"\\r\\n\");\r\n\t}", "public void removeTextWatcherFromViews() {\n // set booleans to true\n ignoreNextTextChangeName = true;\n ignoreNextTextChangeEmail = true;\n ignoreNextTextChangePhone = true;\n ignoreNextTextChangeMessage = true;\n }", "TextView mo92776l();", "@Override\n\tpublic void onText(CharSequence text) {\n\t}", "@Override\n public String getTexteSauvegarde() {\n return \"\";\n }", "public void markEntireText()\n/* */ {\n/* 106 */ markText(0);\n/* */ }", "@Override\n\t\tpublic void onGlobalLayout() {\n\t\t\tViewTreeObserver obs = textView.getViewTreeObserver();\n\t\t\tobs.removeGlobalOnLayoutListener(this);\n\t\t\tboolean isMax=textView.getLineCount() > 6?true:false;\n\t\t\tLogUtil.e(textView.getLineCount()+\"\");\n\t\t\ttextView.setTag(R.id.lineCounts,textView.getLineCount());\n\t\t\tif (!isDatilPage) {\n\t\t\t\tif (isMax) {\n\t\t\t\tint lineEndIndex = textView.getLayout().getLineEnd(5); //设置第六行打省略号\n\t\t\t\tString text = textView.getText().subSequence(0, lineEndIndex-2) +\"全文\";\n\t\t\t\t\n//\t\t\t\t/setShowQw(isDatilPage, isMax,textView,title,text);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "@Override\n public void setTextFields() {}", "private void textClear() {\n\t\tdeliveryManText.setText(null);\n\t\tIDText.setText(null);;\n\t}", "public Tann_Text() {\n text = this.text;\n }", "String getPreBoundText();", "@Override\n\tpublic String getTextoExibicao() {\n\t\treturn null;\n\t}", "private TextView TextView(Home home) {\n\t\treturn null;\n\t}", "public void writeImportant(String text)\n\t{\n\t\tthis.gameView.writeImportant(text);\n\t}", "@Override\n public void afterTextChanged(Editable s) {\n editBoxWithText = true;\n\n }", "@Override\n\t\t\tpublic void onNothingSelected(AdapterView<?> parent) {\n\t\t\t\teditText46.setVisibility(View.INVISIBLE);\n\t\t\t\teditText47.setVisibility(View.INVISIBLE);\n\t\t\t\teditText48.setVisibility(View.INVISIBLE);\n\t\t\t\teditText49.setVisibility(View.INVISIBLE);\n\t\t\t\teditText50.setVisibility(View.INVISIBLE);\n\t\t\t\teditText51.setVisibility(View.INVISIBLE);\n\t\t\t\teditText52.setVisibility(View.INVISIBLE);\n\t\t\t\teditText53.setVisibility(View.INVISIBLE);\n\t\t\t\teditText54.setVisibility(View.INVISIBLE);\n\t\t\t}", "@Override\n public void onClick(View v) {\n txtView.setText(\"YoOU have cLiCkeDD the buttoNN. Hullooo..\");\n\n }", "public void resetText(){\n \n placeholder.setText(getString(R.string.placeholders));\n placeholdercount.setText(getString(R.string.placeholderscount));\n }", "private DmtTextView m135425i() {\n DmtTextView dmtTextView = new DmtTextView(getContext());\n dmtTextView.setTextSize(13.0f);\n dmtTextView.getPaint().setFakeBoldText(true);\n dmtTextView.setTextColor(getContext().getResources().getColor(R.color.lt));\n return dmtTextView;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the total applicable fare for the list of journeys. This method calculates total applicable fare for the list of journeys by grouping then by week, by day and applying weekly and daily cap on the journeys if the conditions meet.
public static double calculateTotalApplicableFare(List<Journey> journey) throws FareException{ double totalApplicableFare = 0.0; Map<Integer,List<Journey>> groupByWeek = journey.stream() .collect(Collectors.groupingBy(Journey::getWeekOfMonth)); Map<Integer,Double> weeklyFare = new HashMap<>(); groupByWeek.forEach((week,wJourney)->{ Map<Integer,List<Journey>> groupByDay = wJourney.stream() .collect(Collectors.groupingBy(Journey::getDayOfWeek)); Map<Integer,Double> dayFare = new HashMap<>(); groupByDay.forEach((day,dJourney)->{ List<Double> fareCap = FareUtil.getDailyAndWeeklyFareCapForJourneys(dJourney); if(fareCap!=null) { Double weekCap = fareCap.get(1); Double dayCap = fareCap.get(0); dayFare.put(day,dayCap); //reset total day fair to day cap if (dayFare.size()>1) { //apply weekly cap only when number of days are greater than one weeklyFare.put(week, weekCap); //reset week fair to week cap }else{ weeklyFare.put(week, getTotalDaysFair(dayFare)); } }else{ double totalDayFair = dJourney.stream() .mapToDouble(Journey::getFare).sum(); dayFare.put(day,totalDayFair); weeklyFare.put(week, getTotalDaysFair(dayFare)); } }); }); System.out.println("**** TOTAL APPLICABLE FAIR ***"); for (Map.Entry<Integer, Double> entry : weeklyFare.entrySet()) { System.out.printf("Week : %d , Total Fare: %f",entry.getKey(),entry.getValue()); System.out.println(); totalApplicableFare += entry.getValue(); } return totalApplicableFare; }
[ "public int calculateFlightHours(){\r\n int total=0;\r\n for(int i=0;i<this.assignedFlight.size();i++){\r\n total+=this.assignedFlight.get(i).getTime();\r\n }\r\n return total;\r\n }", "private static List<Appointment> getAppointmentsPerWeek(Map<Integer, List<FacilityFreeSchedule>> facilityFreeSchedulePerWeek, int customerCount, int reqEmptySpotPerWeek, int facilityId) {\n List<Appointment> appointments=new ArrayList<>();\n List<Customer> customers = DBUtil.loadCustomers(customerCount);\n Facility facility=DBUtil.get(Facility.class,facilityId);\n\n facilityFreeSchedulePerWeek.keySet().stream().forEach(p->{\n List<FacilityFreeSchedule> scheduleForSpecificWeek = facilityFreeSchedulePerWeek.get(p);\n int totalCapacityForWeek = scheduleForSpecificWeek.stream().mapToInt(FacilityFreeSchedule::getCapacity).sum();\n\n if(totalCapacityForWeek>reqEmptySpotPerWeek){\n int limitForCurrentWeek = totalCapacityForWeek - reqEmptySpotPerWeek;\n List<Customer> customersForCurrentWeek=limitForCurrentWeek<customers.size()\n ?customers.subList(0, limitForCurrentWeek):customers;\n appointments.addAll(distribute(scheduleForSpecificWeek, facility,customersForCurrentWeek ));\n DBUtil.delete(customersForCurrentWeek);\n customers.removeAll(customersForCurrentWeek);\n\n }\n });\n return appointments;\n }", "private void calculateMaxRecup(List<PlanningLong> pls){\n int maxRecup = 0;\n for(PlanningLong pl: pls){\n for(Shift shift: pl.getShifts()) {\n if(shift.getDemands().getMONDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getTUESDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getWEDNESDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getTHURSDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getFRIDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getSATURDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n if(shift.getDemands().getSUNDAY().getFreePeriodDays() > maxRecup) maxRecup = shift.getDemands().getMONDAY().getFreePeriodDays();\n }\n }\n this.maxRecup = maxRecup;\n }", "private int daysAvailable() {\n int numDaysAvailable = 0;\n for (boolean b : myWeek) {\n if (b) {\n numDaysAvailable++;\n }\n }\n return numDaysAvailable;\n }", "@Override\n\tpublic int calculateSatisfaction() {\n\t\tresult = seatMap.values().stream().filter(e -> e.getSeatList().size() != 0).map(e -> e.getSeatList())\n\t\t\t\t.collect(Collectors.toList());\n\t\tresult.forEach(a -> {\n\t\t\ta.forEach(m -> {\n\t\t\t\tif (m.getTraveller() == null)\n\t\t\t\t\tcounter--;\n\t\t\t});\n\t\t});\n\n\t\tsatisfactionResult = (counter / numOfTravellers) * 100;\n\t\treturn satisfactionResult;\n\t}", "private void calculateBreakfastShoppingList(Planner sim) {\n\n\t\tMap<Day, Map<MemberName, Map<MealType, FoodType>>> idealPlan = sim.getPlan();\n\t\tdouble pantryWeeksSize = (double) pantrySize/(double) (numFamilyMembers*21);\n\n\t\tdouble smallCaseCutoff = 2;\n\t\t//how many in small case to focus on\n\t\tdouble topNFoods = 3;\n\t\tdouble topNFoodsFreqDivisor = 2;\n\n\n\t\t////small case: try to stockpile for pickiest eaters\n\t\t/*if(pantryWeeksSize < smallCaseCutoff) {\n\t\t\t//get top n foods for breakfast\n\t\t\tMemberName memberName = squeakyFamilyMembers.get(0).getName();\n\t\t\tSystem.out.println(\"here\");\n\t\t\tfor(int i = 0; i < topNFoods; i++) {\n\t\t\t\tSystem.out.println(\"i is \" + i);\n\t\t\t\tfor(int j = 0; j < pantrySize/topNFoodsFreqDivisor; i++) {\n\t\t\t\t\tSystem.out.println(\"j is \" + j);\n\t\t\t\t\tSystem.out.println(\"rank is \" + breakfastShopRanks.get(memberName));\n\t\t\t\t\tFoodType foodType = breakfastRanks.get(memberName).get(i);\n\t\t\t\t\tthis.shoppingList.addToOrder(foodType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"here2\");\n\n\t\t\t////backups\n\n\t\t}\n\n\t\t/////large case try to satisfy everyone, stockpile for pickiest eaters\n\t\telse {*/\n\n\t\t\t////Part 1: add what everyone wants once\n\t\t\tHashMap<FoodType, Integer> foodFreqs = findFreqsFromPlanner(sim, MealType.BREAKFAST);\n\n\t\t\tHashMap<FoodType, Integer> totalFoodFreqs = new HashMap<>();\n\n\t\t\tfor(FoodType foodType : foodFreqs.keySet()) {\n\t\t\t\tint desiredFreqOneWeek = foodFreqs.get(foodType);\n\n\t\t\t\t//int desiredTotal = (int) Math.ceil(pantryWeeksSize*desiredFreqOneWeek);\n\n\t\t\t\tint currentAmount = this.pantry.getNumAvailableMeals(foodType);\n\n\t\t\t\tint difference = desiredFreqOneWeek - currentAmount;\n\n\t\t\t\ttotalFoodFreqs.put(foodType, difference);\n\t\t\t}\n\n\n\t\t\t//desired\n\t\t\tfor(FoodType foodType : totalFoodFreqs.keySet()) {\n\t\t\t\tfor(int i = 0; i < totalFoodFreqs.get(foodType); i++) {\n\t\t\t\t\tthis.shoppingList.addToOrder(foodType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t///Part 2: stock up the rest of the pantry with the bottom 30% of pickiest people's preferences\n\t\t\tdouble percentile = .3;\n\t\t\t//repeat to fill pantry n-1 times\n\t\t\tfor(int repeats = 0; repeats < pantryWeeksSize; repeats++) {\n\t\t\t\tfor(int i = 0; i < Math.max(percentile*numFamilyMembers,1); i++) {\n\t\t\t\t\tMemberName memberName = this.squeakyFamilyMembers.get(i).getName();\n\n\t\t\t\t\tfor(Day day: idealPlan.keySet()) {\n\t\t\t\t\t\tFoodType foodType = idealPlan.get(day).get(memberName).get(MealType.BREAKFAST);\n\t\t\t\t\t\tthis.shoppingList.addToOrder(foodType);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t////part 3: backups: loop through the pickiest person's preferences, add .2*pantry/3 size for each value\n\n\n\t\t\tSystem.out.println(\"shopping list is \" + this.shoppingList.getMealOrder(MealType.BREAKFAST));\n\t\t//}\n\n\n\n\t\t//////backups:\n\n\t\t//add what everyone wants once\n\t\t/*double pantryWeeksSize = (double) pantrySize/(double) (numFamilyMembers*21);\n\n\t\tHashMap<FoodType, Integer> foodFreqs = findFreqsFromPlanner(sim, MealType.BREAKFAST);\n\n\t\tHashMap<FoodType, Integer> totalFoodFreqs = new HashMap<>();\n\n\t\tfor(FoodType foodType : foodFreqs.keySet()) {\n\t\t\tint desiredFreqOneWeek = foodFreqs.get(foodType);\n\n\t\t\tint desiredTotal = (int) Math.ceil(pantryWeeksSize*desiredFreqOneWeek);\n\n\t\t\tint currentAmount = this.pantry.getNumAvailableMeals(foodType);\n\n\t\t\tint difference = desiredTotal - currentAmount;\n\n\t\t\ttotalFoodFreqs.put(foodType, difference);\n\t\t}\n\n\n\t\t//desired\n\t\tfor(FoodType foodType : totalFoodFreqs.keySet()) {\n\t\t\tfor(int i = 0; i < totalFoodFreqs.get(foodType); i++) {\n\t\t\t\tthis.shoppingList.addToOrder(foodType);\n\t\t\t}\n\t\t}*/\n\n\t\t//backups\n\n\t\t\n\t\t\n\t\t/*for (FamilyMember member : this.familyMembers) {\n\t\t\tfor (int i = 0; i < this.shoppingQuantities.get(0)/this.familyMembers.size(); i++)\n\t\t\t\tthis.shoppingList.addToOrder(this.breakfastRanks.get(member).get(0));\n\t\t}\n\n\t\tfor (FamilyMember member : this.familyMembers) {\n\t\t\tfor (int i = 0; i < this.shoppingQuantities.get(0) / this.familyMembers.size(); i++)\n\t\t\t\tthis.shoppingList.addToOrder(this.breakfastRanks.get(member).get(1));\n\t\t}\n\t\tfor (FamilyMember member : this.familyMembers) {\n\t\t\tfor (int i = 0; i < this.shoppingQuantities.get(0) / this.familyMembers.size(); i++)\n\t\t\t\tthis.shoppingList.addToOrder(this.breakfastRanks.get(member).get(2));\n\n\t\t}*/\n\t}", "public double applyOffers(List<ShoppingBasket> shoppingBasketValues, LocalDate shoppingDate);", "public List<WorkingTime> calculateCapacity()\n\t\t\tthrows InsufficientCapacityException {\n\n\t\t// Create a new Empty Sheet of Workplaces and their roundtriptimes for\n\t\t// associated output items\n\t\tMap<String, Map<String, Integer>> roundTripTimes = new HashMap<String, Map<String, Integer>>();\n\n\t\t// For each production plan calculate the roundtriptimes\n\t\tfor (ProductionPlan plan : plans) {\n\n\t\t\t// Get the amount of items to produce\n\t\t\tInteger quantity = this.productionsList.get(plan.getName()\n\t\t\t\t\t.toUpperCase());\n\n\t\t\t// Calculate the RoundTripTimes for each item\n\t\t\troundTripTimes = calculateRoundTripTime(plan.getProducer(),\n\t\t\t\t\tquantity, roundTripTimes);\n\t\t}\n\n\t\t// Create a new empty list of WorkingTime objects\n\t\tList<WorkingTime> capacities = new ArrayList<WorkingTime>();\n\n\t\t// For each calculated roundTripTime, calculate the needed capacity\n\t\tfor (Map.Entry<String, Map<String, Integer>> roundTripTime : roundTripTimes\n\t\t\t\t.entrySet()) {\n\n\t\t\t// Catch possible parsing errors\n\t\t\ttry {\n\t\t\t\tInteger workplace = Integer.parseInt(roundTripTime.getKey());\n\n\t\t\t\t// Calculate how many shifts will be needed\n\t\t\t\tDouble workingTime = roundTripTime.getValue().get(ACCUMULATED)\n\t\t\t\t\t\t.doubleValue()\n\t\t\t\t\t\t/ SHIFT_TIME_MINS;\n\t\t\t\tint shift = 1;\n\t\t\t\tDouble overtime = 0.0;\n\n\t\t\t\t// Check if there is more than one full shift is needed\n\t\t\t\tif (workingTime > 1) {\n\n\t\t\t\t\t// Cut the decimals off of the worktime\n\t\t\t\t\tshift = Integer.parseInt(shiftFormat.format(workingTime));\n\n\t\t\t\t\t// See how much overtime\n\t\t\t\t\tovertime = (workingTime - shift) * SHIFT_TIME_MINS;\n\t\t\t\t\tSystem.out.println(\"workplace=\" + workplace);\n\n\t\t\t\t\tif (workplace == 7 || workplace == 8 || workplace == 9) {\n\t\t\t\t\t\tshift += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (overtime > (SHIFT_TIME_MINS * 0.5)) {\n\t\t\t\t\t\tovertime = 0.0;\n\t\t\t\t\t\tshift += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check wether if more than 3 shifts would be needed for\n\t\t\t\t\t// the production\n\t\t\t\t\tif (shift > 3) {\n\t\t\t\t\t\tthrow new InsufficientCapacityException(\n\t\t\t\t\t\t\t\tworkplace.toString(), shift, overtime);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Calculate the overtime per day\n\t\t\t\tDouble overtimePerDay = overtime / 5;\n\n\t\t\t\t// Create a new WorkingTime object with all calculated working\n\t\t\t\t// time informations and add it to the capacities list\n\t\t\t\tWorkingTime capacity = new WorkingTime(workplace, shift,\n\t\t\t\t\t\tInteger.parseInt(overtimeFormat.format(overtimePerDay)));\n\n\t\t\t\tcapacities.add(capacity);\n\n\t\t\t} catch (InsufficientCapacityException e) {\n\n\t\t\t\tthrow e;\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\treturn capacities;\n\t}", "public void gettingTotals()\n\t{\n\t\t//Resetting variables\n\t\ttotalTS = 0;\n\t\ttotalNoTS = 0;\n\t\ttempTS = 0;\n\t\ttempNoTS = 0;\n\t\tachesTS = 0;\n\t\tachesNoTS = 0;\n\t\tthroatTS = 0;\n\t\tthroatNoTS = 0;\n\t\ttotalPatients = patientList.size();\n\t\t\n\t\t\n\t\t//For loop in which there are if statements getting how many times certain symptoms lead to tonsillitis\n\t\tfor(int i = 0; i < totalPatients; i++)\n\t\t{\n\t\t\t//If else which gets the total amount of times tonsillitis is yes, and tonsillitis is no\n\t\t\tif(patientList.get(i).getTonsillitis().equals(\"yes\"))\n\t\t\t{\n\t\t\t\ttotalTS++;\n\t\t\t}\n\t\t\telse if(patientList.get(i).getTonsillitis().equals(\"no\"))\n\t\t\t{\n\t\t\t\ttotalNoTS++;\n\t\t\t}\n\t\t\t\n\t\t\t//If else which gets the amount of times that the current temperature lead to tonsillitis, or lead to no tonsillitis\n\t\t\tif(patientList.get(i).getTemperature().equals(currentTemp) && patientList.get(i).getTonsillitis().equals(\"yes\"))\n\t\t\t{\n\t\t\t\ttempTS++;\n\t\t\t}\n\t\t\telse if(patientList.get(i).getTemperature().equals(currentTemp) && patientList.get(i).getTonsillitis().equals(\"no\"))\n\t\t\t{\n\t\t\t\ttempNoTS++;\n\t\t\t}\n\t\t\t\n\t\t\t//If else which gets the amount of times that the current aches lead to tonsillitis, or lead to no tonsillitis\n\t\t\tif(patientList.get(i).getAches().equals(currentAches) && patientList.get(i).getTonsillitis().equals(\"yes\"))\n\t\t\t{\n\t\t\t\tachesTS++;\n\t\t\t}\n\t\t\telse if(patientList.get(i).getAches().equals(currentAches) && patientList.get(i).getTonsillitis().equals(\"no\"))\n\t\t\t{\n\t\t\t\tachesNoTS++;\n\t\t\t}\n\t\t\t\n\t\t\t//If else which gets the amount of times that the current throat lead to tonsillitis, or lead to no tonsillitis\n\t\t\tif(patientList.get(i).getThroat().equals(currentThroat) && patientList.get(i).getTonsillitis().equals(\"yes\"))\n\t\t\t{\n\t\t\t\tthroatTS++;\n\t\t\t}\n\t\t\telse if(patientList.get(i).getThroat().equals(currentThroat) && patientList.get(i).getTonsillitis().equals(\"no\"))\n\t\t\t{\n\t\t\t\tthroatNoTS++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public static int priceWeekDays() {\n\n int pwd = priceParkWeekDays * Looking_Spot.days;\n\n return pwd;\n\n }", "public double calculatePayout(){\n double sum = 0.0;\n for(int i = 0; i < employees.lengthIs(); i++){\n sum += employees.getItem(i).calculateWeeklyPay(); \n }\n return sum;\n }", "public static JavaRDD<Row> getDateTimePerWeekDay(JavaRDD<Row> fullList){\r\n\t\tJavaRDD<Row> list = fullList.filter(a -> weekDay(a));\r\n\t\treturn list;\r\n\t}", "public static void prepareWeek() {\n\t\tItemList general = lists.get(0);\n\t\t\n\t\t//assigns designated ItemList with all existing tasks in the \"general\" list, to be used for task order sorting\n\t\torderedTasks.clear();\n\t\tfor(int i = 0; i < general.getList().size(); i++) {\n\t\t\torderedTasks.add(general.getList().get(i));\n\t\t}\n\t\t//initially orders tasks by predicted priority level\n\t\tif(orderedTasks.getList().size() > 1) {//only operates if there is more than one item in the list to sort\n\t\t\tUtilities.orderTasks(orderedTasks, 0);\n\t\t\t\n\t\t\t//once tasks are ordered, designates tasks to each day of the week\n\t\t\tdayPopulator();\n\t\t}\n\t\t\n\t\t\n\t\tDay day;\n\t\tfor(int i = 0; i < 7; i++) {\n\t\t\tday = (Day) lists.get(1).get(i);\n\t\t\tSystem.out.println(day.getPoints());\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\r\n public void fillDailyOperation (int weekday)\r\n {\n loadVector = new Vector<Integer>();\r\n dailyOperation = new Vector<Boolean>();\r\n\r\n for (int i = 0; i < OfficeComplexConstants.QUARTERS_OF_DAY; i++) {\r\n\r\n dailyOperation.add(false);\r\n loadVector.add(0);\r\n\r\n if (applianceOf.isOnBreak(weekday, i)) {\r\n\r\n double tempPercentage =\r\n operationPercentage\r\n + (OfficeComplexConstants.OPERATION_PARTITION * (applianceOf\r\n .employeeOnBreakNumber(weekday, i)));\r\n if (tempPercentage > gen.nextDouble()\r\n && i > OfficeComplexConstants.START_OF_LAUNCH_BREAK\r\n && i < OfficeComplexConstants.END_OF_LAUNCH_BREAK) {\r\n dailyOperation.set(i, true);\r\n loadVector.set(i, power);\r\n }\r\n }\r\n\r\n }\r\n weeklyLoadVector.add(loadVector);\r\n weeklyOperation.add(dailyOperation);\r\n }", "private int calculateCalories() {\n // use the user's weight and time swimming to calculate calories burned\n Context applicationContext = MainActivity.get_contextOfApplication();\n final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(applicationContext);\n final String units = settings.getString(\"weightUnit\", \"Imperial\");\n final String strWeight = settings.getString(\"userWeight\", \"40\");\n double weight = 1;\n\n // determine the user's settings for weight\n if (units == \"Imperial\") {\n // we're working with pounds, so convert to kilograms\n weight = Double.parseDouble(strWeight) * 0.453592;\n } else { // metric\n // we're already working with kgs\n weight = Double.parseDouble(strWeight);\n }\n\n // calculate calories burned\n int calories = (int)(weight * get_time() / 60.0 / 60.0 * 6.936);\n return calories;\n\n }", "public static void main(String[] args)\n {\n ArrayList <CO2FromWasteU> waste = new ArrayList <CO2FromWasteU> ();\n \n waste.add(new CO2FromWasteU(5, true, false, true, true));\n waste.add(new CO2FromWasteU(1, false, true, false, true));\n waste.add(new CO2FromWasteU(2, true, true, true, true));\n waste.add(new CO2FromWasteU(3, true, true, false, true));\n waste.add(new CO2FromWasteU(4, false, false, false, false));\n waste.add(new CO2FromWasteU(9, false, true, true, false));\n\n for(CO2FromWasteU dataRecord : waste)\n {\n dataRecord.calcGrossWasteEmission();\n dataRecord.calcWasteReduction();\n dataRecord.calcNetWasteReduction();\n }\n\n //prints results to the screen\n System.out.println(\"| | | | Pounds of CO2 |\");\n System.out.println(\"| | | Household Waste Recycled | Total | | Net |\");\n System.out.println(\"| Index | People | Paper | Plastic | Glass | Cans | Emission | Reduction | Emission |\");\n System.out.println(\"|-------|--------|----------|----------|---------|---------|------------|-------------|------------|\");\n\n CO2FromWasteU dataRecord;\n\n for(int index = 0; index < waste.size(); index++)\n {\n dataRecord = waste.get(index);\n System.out.printf(\"%5d %8d %10b %10b %9b\" + \" %9b %12.1f %13.1f %12.1f\\n\", index,\n dataRecord.getNumPeople(), dataRecord.getPaper(),\n dataRecord.getPlastic(), dataRecord.getGlass(),\n dataRecord.getCans(), dataRecord.getEmissions(),\n dataRecord.getReduction(), dataRecord.getNetEmissions());\n\n }\n \n System.out.println(\"|-------|--------|---------|-----------|---------|---------|------------|-------------|------------|\");\n }", "private void orderWeapons() {\r\n\t\tif (tribe.getTreasury()>0) {\r\n\t\t\tint fundsAvailable = tribe.getTreasury();\r\n\t\t\tfor (Settlement settlement : tribe.getSettlements())\r\n\t\t\t\tfor (Equipment equipment : tribe.getEquipmentAvailableToOrder()) {\r\n\t\t\t\t\tif (equipment.getMaterials() == null) {\r\n\t\t\t\t\t\tsettlement.orderEquipment(equipment, fundsAvailable);\r\n\t\t\t\t\t\tfundsAvailable = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//if(settlement.getResources().containsKey(equipment.getMaterials().keySet())) {\r\n\t\t\t\t\t\t//Order either how much resources or how much funds we have, - whichever is smaller\r\n\t\t\t\t\t\tint amountToOrder = fundsAvailable;\r\n\t\t\t\t\t\tfor (Map.Entry<IProducible, Integer> material : equipment.getMaterials().entrySet()) {\r\n\t\t\t\t\t\t\tif (amountToOrder>settlement.commodityPerTurn(material.getKey(), true)//amount we can produce\r\n\t\t\t\t\t\t\t\t\t+settlement.getResources().getOrDefault(material.getKey(), 0)) //amount already in warehouse\r\n\t\t\t\t\t\t\t\tamountToOrder = settlement.commodityPerTurn(material.getKey(), true)//amount we can produce\r\n\t\t\t\t\t\t\t\t\t\t+settlement.getResources().getOrDefault(material.getKey(), 0); //amount already in warehouse\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//>settlement.getResources().getOrDefault(equipment.getResource(), 0)?settlement.getResources().getOrDefault(equipment.getResource(), 0):fundsAvailable;\r\n\t\t\t\t\t\tsettlement.orderEquipment(equipment, amountToOrder);\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tif (tribe.getTreasury()<=0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "public short getCalories() {\n/* 21789 */ if (getTemplateId() == 488 && getRealTemplateId() == 488)\n/* 21790 */ return 0; \n/* 21791 */ float percentage = calcFoodPercentage();\n/* 21792 */ if (!this.template.calcNutritionValues())\n/* 21793 */ return (short)(int)(this.template.getCalories() * percentage); \n/* 21794 */ ItemMealData imd = ItemMealData.getItemMealData(getWurmId());\n/* 21795 */ if (imd != null) {\n/* 21796 */ return (short)(int)(imd.getCalories() * percentage);\n/* */ }\n/* 21798 */ return (short)(int)(this.template.getCalories() * percentage);\n/* */ }", "public int calculateTotalFines()\n {\n Iterator<PoliceOfficer> po = policeOfficers.iterator();\n int totalFines = 0;\n while(po.hasNext()){\n PoliceOfficer fines = po.next();\n totalFines += fines.calculateFineInCAD();\n }\n return totalFines;\n }", "private HashMap<String, BigDecimal> getWpPersonDays() {\n List<Tsrow> tsrows = tsRowManager.find(getSelectedWorkPackage());\n \n HashMap<String, BigDecimal> map = new HashMap<String, BigDecimal>();\n for (Labgrd l : labourGrades) {\n map.put(l.getLgId(), BigDecimal.ZERO);\n }\n \n totalCost = BigDecimal.ZERO;\n totalHours = BigDecimal.ZERO;\n \n for (Tsrow t : tsrows) {\n BigDecimal rowRate = t.getTimesheet().getTsPayGrade() == null \n ? t.getTimesheet().getEmployee().getEmpLabGrd().getLgRate() \n : t.getTimesheet().getTsPayGrade().getLgRate();\n BigDecimal rowHours = t.getTotal();\n \n String labGrd = t.getTimesheet().getTsPayGrade() == null \n ? t.getTimesheet().getEmployee().getEmpLabGrd().getLgId() \n : t.getTimesheet().getTsPayGrade().getLgId();\n map.put(labGrd, map.get(labGrd).add(rowHours.divide(new BigDecimal(HOURS_IN_DAY))));\n \n totalCost = totalCost.add(rowRate.multiply(rowHours));\n totalHours = totalHours.add(rowHours);\n }\n \n return map;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the object is compared with itself then return true
@Override public boolean equals(Object o) { if (o == this) { return true; } /* Check if "o" is an instance of Complex or not "null instanceof [type]" also returns false */ if (!(o instanceof Node)) { return false; } // typecast "o" to Complex so that we can compare data members Node n = (Node) o; // Compare the data members and return accordingly if( n.getX() == x & n.getY() == y & n.getDemand() == demand) return true; else return false; }
[ "public boolean isSame();", "boolean isEqual(java.lang.Object toSource, java.lang.Object toNewValue);", "public boolean equals(Object obj) {\n return compareTo(obj) == 0;\n }", "boolean areEqual(Object actual, Object other);", "public boolean equals(Object otherObject)\n {\n \treturn this.compareTo((Item)otherObject) == 0;\n }", "public boolean equals (Object object);", "@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof Town && hashCode() == other.hashCode());\n }", "protected boolean mutatesTo(Object o1, Object o2) {\n return null != o1 && null != o2 && o1.getClass() == o2.getClass();\n }", "private boolean m28725a(Object obj, Object obj2) {\n return obj == obj2 || (obj != null && obj.equals(obj2));\n }", "public boolean isSelf()\n\t{\n\t\treturn (i1.equals(i2));\n\t}", "public boolean sameValueAs(Object o)\n { return equals( o ); }", "abstract boolean equals(Object o);", "protected static <T, X> boolean isSimilarObjects(T obj1, T obj2) {\n\t\tif (obj1==obj2) return true;\n\t\ttry {\n\t\t\tassertSimilars(null,obj1, obj2);\n\t\t\treturn true;\n\t\t}\n\t\tcatch(AssertionError _) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(AssertionFailedError _) {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean equals(Object obj) {\n if (this != obj) {\n if (obj instanceof b) {\n b bVar = (b) obj;\n if (Intrinsics.areEqual(this.a, bVar.a)) {\n }\n }\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object obj)\n {\n return this.structurallyEquals(obj);\n }", "@Override\n public boolean equals(Object obj) {\n if (!(obj instanceof Rook))\n return false;\n\n Rook t = (Rook) obj;\n return (t.getColor() == this.getColor() \n && this.getPosition().equals(t.getPosition())) ? true : false;\n\n }", "@Test\n public void equalsTrueMySelf() {\n Position position1 = new Position(4, 7);\n assertTrue(position1.equals(position1));\n assertTrue(position1.hashCode() == position1.hashCode());\n }", "@Override\n public boolean equals(Object o) {\n return this == o;\n }", "public boolean equals(Object o);", "private boolean m8334a(Object obj, Object obj2) {\n return obj == obj2 || (obj != null && obj.equals(obj2));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
public void run() { try { HttpClient client = new DefaultHttpClient(); String path = "http://14.63.212.236/index.php/schedule/deleteSchedule"; HttpPost post = new HttpPost(path); HttpConnectionParams.setConnectionTimeout(client.getParams(), 30000); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("schedule_id", getSch_id() )); UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, HTTP.UTF_8); post.setEntity(ent); HttpResponse httpResponse = client.execute(post); HttpEntity resEn = httpResponse.getEntity(); String parse = EntityUtils.toString(resEn); JSONObject object = new JSONObject(parse); String result = object.getString("result"); int reg = Integer.parseInt(result); if(reg == 400){ } } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
LD a d8 = Copy the following byte into the accumulator.
private void _0x3E() { cycles += 8; a = mmu.readByte(pc++); }
[ "public static long pack8(byte[] data, int offset) {\n\t\t// pack a block to long, as LE 8 bytes\n\t\treturn data[offset ] & 0xffL |\n\t\t\t(data[offset + 1] & 0xffL) << 8 |\n \t\t\t(data[offset + 2] & 0xffL) << 16 |\n\t\t\t(data[offset + 3] & 0xffL) << 24 |\n\t\t\t(data[offset + 4] & 0xffL) << 32 |\n\t\t\t(data[offset + 5] & 0xffL) << 40 |\n\t\t\t(data[offset + 6] & 0xffL) << 48 |\n\t\t\t(data[offset + 7] & 0xffL) << 56 ;\n }", "public synchronized void a(anet.channel.bytes.ByteArray r8) {\n /*\n r7 = this;\n monitor-enter(r7);\n if (r8 == 0) goto L_0x0078;\n L_0x0003:\n r0 = r8.bufferLength;\t Catch:{ all -> 0x0075 }\n r1 = 524288; // 0x80000 float:7.34684E-40 double:2.590327E-318;\n if (r0 < r1) goto L_0x000a;\n L_0x0009:\n goto L_0x0078;\n L_0x000a:\n r0 = r7.d;\t Catch:{ all -> 0x0075 }\n r2 = r8.bufferLength;\t Catch:{ all -> 0x0075 }\n r2 = (long) r2;\t Catch:{ all -> 0x0075 }\n r4 = r0 + r2;\n r7.d = r4;\t Catch:{ all -> 0x0075 }\n r0 = r7.a;\t Catch:{ all -> 0x0075 }\n r0.add(r8);\t Catch:{ all -> 0x0075 }\n L_0x0018:\n r0 = r7.d;\t Catch:{ all -> 0x0075 }\n r2 = 524288; // 0x80000 float:7.34684E-40 double:2.590327E-318;\n r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r4 <= 0) goto L_0x0044;\n L_0x0021:\n r0 = r7.c;\t Catch:{ all -> 0x0075 }\n r0 = r0.nextBoolean();\t Catch:{ all -> 0x0075 }\n if (r0 == 0) goto L_0x0032;\n L_0x0029:\n r0 = r7.a;\t Catch:{ all -> 0x0075 }\n r0 = r0.pollFirst();\t Catch:{ all -> 0x0075 }\n r0 = (anet.channel.bytes.ByteArray) r0;\t Catch:{ all -> 0x0075 }\n goto L_0x003a;\n L_0x0032:\n r0 = r7.a;\t Catch:{ all -> 0x0075 }\n r0 = r0.pollLast();\t Catch:{ all -> 0x0075 }\n r0 = (anet.channel.bytes.ByteArray) r0;\t Catch:{ all -> 0x0075 }\n L_0x003a:\n r1 = r7.d;\t Catch:{ all -> 0x0075 }\n r0 = r0.bufferLength;\t Catch:{ all -> 0x0075 }\n r3 = (long) r0;\t Catch:{ all -> 0x0075 }\n r5 = r1 - r3;\n r7.d = r5;\t Catch:{ all -> 0x0075 }\n goto L_0x0018;\n L_0x0044:\n r0 = 1;\n r1 = anet.channel.util.ALog.isPrintLog(r0);\t Catch:{ all -> 0x0075 }\n if (r1 == 0) goto L_0x0073;\n L_0x004b:\n r1 = \"awcn.ByteArrayPool\";\n r2 = \"ByteArray Pool refund\";\n r3 = 0;\n r4 = 4;\n r4 = new java.lang.Object[r4];\t Catch:{ all -> 0x0075 }\n r5 = 0;\n r6 = \"refund\";\n r4[r5] = r6;\t Catch:{ all -> 0x0075 }\n r8 = r8.getBufferLength();\t Catch:{ all -> 0x0075 }\n r8 = java.lang.Integer.valueOf(r8);\t Catch:{ all -> 0x0075 }\n r4[r0] = r8;\t Catch:{ all -> 0x0075 }\n r8 = 2;\n r0 = \"total\";\n r4[r8] = r0;\t Catch:{ all -> 0x0075 }\n r8 = 3;\n r5 = r7.d;\t Catch:{ all -> 0x0075 }\n r0 = java.lang.Long.valueOf(r5);\t Catch:{ all -> 0x0075 }\n r4[r8] = r0;\t Catch:{ all -> 0x0075 }\n anet.channel.util.ALog.d(r1, r2, r3, r4);\t Catch:{ all -> 0x0075 }\n L_0x0073:\n monitor-exit(r7);\n return;\n L_0x0075:\n r8 = move-exception;\n monitor-exit(r7);\n throw r8;\n L_0x0078:\n monitor-exit(r7);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: anet.channel.bytes.a.a(anet.channel.bytes.ByteArray):void\");\n }", "public void pad_u8() throws IOException {\n\t\tif (count > 0) {\n\t\t\toutput.write(value >>> (8-count));\n\t\t\tlength++;\n\t\t\tvalue = 0;\n\t\t\tcount = 0;\n\t\t}\n\t}", "static void Z4C_ddN0_0001_addr_imm8(void)\n{\n\tGET_DST(OP0,NIB2);\n\tGET_ADDR(OP1);\n\tGET_IMM8(OP2);\n\taddr += RW(dst);\n\tCPB( RDMEM_B(addr), imm8 );\n}", "public void readInRLE8() {\n\n int y = m_height - 1;\n int x = 0;\n\n int a = readByte();\n int b = readByte();\n while (!(a == 0 && b == 1)) {\n\n if (a == 0) {\n if (b == 0) {\n y--;\n x = 0;\n } else if (b == 2) {\n x += readByte();\n y -= readByte();\n } else if (b >= 3) {\n for (int i = 0; i < b; i++) {\n m_image[y * m_width + x] = m_colorTable[readByte()];\n x++;\n }\n if (Math.round(b / 2.0) != b / 2.0) readByte();\n }\n } else {\n for (int i = 0; i < a; i++) {\n m_image[y * m_width + x] = m_colorTable[b];\n x++;\n }\n }\n a = readByte();\n b = readByte();\n }\n }", "public final void load() throws RecognitionException {\n\t\tint ld =0;\n\t\tint d =0;\n\t\tint literal3 =0;\n\t\tParserRuleReturnScope baseOffset44 =null;\n\t\tParserRuleReturnScope index5 =null;\n\n\t\ttry {\n\t\t\t// ../../Source/AsmSM213.g:158:7: ( 'ld' ( ( literal ',' ld= register ) | ( baseOffset4 | index ) ',' d= register ) )\n\t\t\t// ../../Source/AsmSM213.g:158:9: 'ld' ( ( literal ',' ld= register ) | ( baseOffset4 | index ) ',' d= register )\n\t\t\t{\n\t\t\tmatch(input,39,FOLLOW_39_in_load274); \n\t\t\t// ../../Source/AsmSM213.g:158:14: ( ( literal ',' ld= register ) | ( baseOffset4 | index ) ',' d= register )\n\t\t\tint alt13=2;\n\t\t\tint LA13_0 = input.LA(1);\n\t\t\tif ( (LA13_0==17) ) {\n\t\t\t\talt13=1;\n\t\t\t}\n\t\t\telse if ( (LA13_0==Hex||LA13_0==UnsignedDecimal||LA13_0==18) ) {\n\t\t\t\talt13=2;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\tnew NoViableAltException(\"\", 13, 0, input);\n\t\t\t\tthrow nvae;\n\t\t\t}\n\n\t\t\tswitch (alt13) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// ../../Source/AsmSM213.g:158:16: ( literal ',' ld= register )\n\t\t\t\t\t{\n\t\t\t\t\t// ../../Source/AsmSM213.g:158:16: ( literal ',' ld= register )\n\t\t\t\t\t// ../../Source/AsmSM213.g:158:17: literal ',' ld= register\n\t\t\t\t\t{\n\t\t\t\t\tpushFollow(FOLLOW_literal_in_load279);\n\t\t\t\t\tliteral3=literal();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\t opCode=0; op[2]=literal3; \n\t\t\t\t\tmatch(input,21,FOLLOW_21_in_load283); \n\t\t\t\t\tpushFollow(FOLLOW_register_in_load287);\n\t\t\t\t\tld=register();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\t op[0]=ld; \n\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\t// ../../Source/AsmSM213.g:159:10: ( baseOffset4 | index ) ',' d= register\n\t\t\t\t\t{\n\t\t\t\t\t// ../../Source/AsmSM213.g:159:10: ( baseOffset4 | index )\n\t\t\t\t\tint alt12=2;\n\t\t\t\t\tint LA12_0 = input.LA(1);\n\t\t\t\t\tif ( (LA12_0==Hex||LA12_0==UnsignedDecimal) ) {\n\t\t\t\t\t\talt12=1;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( (LA12_0==18) ) {\n\t\t\t\t\t\tint LA12_2 = input.LA(2);\n\t\t\t\t\t\tif ( (LA12_2==Register) ) {\n\t\t\t\t\t\t\tint LA12_3 = input.LA(3);\n\t\t\t\t\t\t\tif ( (LA12_3==19) ) {\n\t\t\t\t\t\t\t\talt12=1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( (LA12_3==21) ) {\n\t\t\t\t\t\t\t\talt12=2;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tint nvaeMark = input.mark();\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tfor (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) {\n\t\t\t\t\t\t\t\t\t\tinput.consume();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\t\t\t\t\t\tnew NoViableAltException(\"\", 12, 3, input);\n\t\t\t\t\t\t\t\t\tthrow nvae;\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tinput.rewind(nvaeMark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tint nvaeMark = input.mark();\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tinput.consume();\n\t\t\t\t\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\t\t\t\t\tnew NoViableAltException(\"\", 12, 2, input);\n\t\t\t\t\t\t\t\tthrow nvae;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\tinput.rewind(nvaeMark);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\t\t\tnew NoViableAltException(\"\", 12, 0, input);\n\t\t\t\t\t\tthrow nvae;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (alt12) {\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t// ../../Source/AsmSM213.g:159:11: baseOffset4\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpushFollow(FOLLOW_baseOffset4_in_load305);\n\t\t\t\t\t\t\tbaseOffset44=baseOffset4();\n\t\t\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\t\t\t opCode=1; op[0]=(baseOffset44!=null?((AsmSM213Parser.baseOffset4_return)baseOffset44).offset:0); op[1]=(baseOffset44!=null?((AsmSM213Parser.baseOffset4_return)baseOffset44).base:0); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t// ../../Source/AsmSM213.g:160:10: index\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpushFollow(FOLLOW_index_in_load321);\n\t\t\t\t\t\t\tindex5=index();\n\t\t\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\t\t\t opCode=2; op[0]=(index5!=null?((AsmSM213Parser.index_return)index5).base:0); op[1]=(index5!=null?((AsmSM213Parser.index_return)index5).index:0); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmatch(input,21,FOLLOW_21_in_load335); \n\t\t\t\t\tpushFollow(FOLLOW_register_in_load339);\n\t\t\t\t\td=register();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\t op[2] = d; \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}", "public LD(){\n super(\"ld\", \"Loads from dspace at x into the accumulator\", 1); \n }", "public void copyFrom(byte[] d) {\n mRS.validate();\n copy1DRangeFrom(0, mCurrentCount, d);\n }", "int getUwordLe() {\n return (payload[offset++] & 0xFF) | \n ((payload[offset++] & 0xFF) << 8);\n }", "public int rl8(int reg8) {\r\n\t\tRL8 op = OperationsFactory.rl8;\r\n\t\treturn op.rl8(reg8);\r\n\t}", "@Override\n\tpublic void iload(int offset) {\n\t\tcode += \"; iload \"+offset+\"\\n\";\n\t\tif (offset >=0) code += \"\\tpush word ptr [bp+\"+offset+\"]\\n\";\n\t\telse code += \"\\tpush word ptr [bp\"+offset+\"]\\n\";\n\t\tcode += \"\\n\";\n\t}", "public final void mD8() throws RecognitionException {\n try {\n int _type = D8;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /home/abrandl/Dropbox/ma-thesis/workspace/lucene.regex/src/main/java/de/abrandl/regex/grammar/Regex.g:517:3: ( '8' )\n // /home/abrandl/Dropbox/ma-thesis/workspace/lucene.regex/src/main/java/de/abrandl/regex/grammar/Regex.g:518:3: '8'\n {\n match('8'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n \t// do for sure before leaving\n }\n }", "public static long convertOffset4Len(long keyOffset, int len) {\n return ( keyOffset << LEN ) | len ;\n }", "public void m19454a(int numBytes) {\n this.f22726a++;\n this.f22727b += numBytes;\n }", "public native int unshift();", "static void Z56_0000_dddd_addr(void)\n{\n\tGET_DST(OP0,NIB3);\n\tGET_ADDR(OP1);\n\tRL(dst) = ADDL( RL(dst), RDMEM_L(addr) );\n}", "@Array({2}) \n\tpublic Pointer<Long > ff_dither8() {\n\t\ttry {\n\t\t\treturn (Pointer<Long >)BridJ.getNativeLibrary(\"swscale\").getSymbolPointer(\"ff_dither8\").as(org.bridj.util.DefaultParameterizedType.paramType(org.bridj.Pointer.class, java.lang.Long.class)).get();\n\t\t}catch (Throwable $ex$) {\n\t\t\tthrow new RuntimeException($ex$);\n\t\t}\n\t}", "public static byte[] unpackLong(long l) {\n return unpack(l, 8);\n }", "public void copy1DRangeFromUnchecked(int off, int count, byte[] d) {\n int dataSize = mType.mElement.getBytesSize() * count;\n data1DChecks(off, count, d.length, dataSize);\n mRS.nAllocationData1D(getIDSafe(), off, mSelectedLOD, count, d, dataSize);\n }", "private static void exCasting() {\n\n long temp7 = 5;\n// long temp6 = (temp7 = 3);\n System.out.println(temp7);\n// System.out.println(temp6);\n\n byte a = 40, b = 50;\n// byte sum = (byte) a + b;\n// System.out.println(sum);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retorna um arquivo fixo da pasta /res/raw
public static String getFileString(Resources resources, int raw) throws IOException { try { InputStream in = resources.openRawResource(raw); String s = IOUtils.toString(in); IOUtils.closeQuietly(in); return s; } catch (RuntimeException e) { Log.e(TAG, e.getMessage(), e); } return null; }
[ "private String getXMLFileFromRaw() {\n\t\t// the target filename in the application path\n\t\tString fileNameWithPath = null;\n\t\tfileNameWithPath = \"idt_unimagcfg_default.xml\";\n\n\t\ttry {\n\t\t\tInputStream in = getResources().openRawResource(\n\t\t\t\t\tR.raw.idt_unimagcfg_default);\n\t\t\tint length = in.available();\n\t\t\tbyte[] buffer = new byte[length];\n\t\t\tin.read(buffer);\n\t\t\tin.close();\n\t\t\tdeleteFile(fileNameWithPath);\n\t\t\tFileOutputStream fout = openFileOutput(fileNameWithPath,\n\t\t\t\t\tMODE_PRIVATE);\n\t\t\tfout.write(buffer);\n\t\t\tfout.close();\n\n\t\t\t// to refer to the application path\n\t\t\tFile fileDir = this.getFilesDir();\n\t\t\tfileNameWithPath = fileDir.getParent() + java.io.File.separator\n\t\t\t\t\t+ fileDir.getName();\n\t\t\tfileNameWithPath += java.io.File.separator\n\t\t\t\t\t+ \"idt_unimagcfg_default.xml\";\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfileNameWithPath = null;\n\t\t}\n\t\treturn fileNameWithPath;\n\t}", "private static String readRawResource(Context context, int resource) {\n\t\tfinal InputStream input = context.getResources().openRawResource(resource);\n\n\t\tBufferedReader buffer = new BufferedReader(new InputStreamReader(input));\n\t\tWriter writer = new StringWriter();\n\n\t\ttry {\n\t\t\tString line;\n\n\t\t\twhile ((line = buffer.readLine()) != null) {\n\t\t\t\twriter.write(line);\n\t\t\t}\n\n\t\t\tbuffer.close();\n\t\t\tinput.close();\n\t\t} catch (IOException e) {\n\t\t\tLog.e(TAG, String.format(\"Unable to read raw file. Reason: %s\", e.getMessage()));\n\t\t}\n\n\t\treturn writer.toString();\n\t}", "public File getRawFile(String name) throws IOException {\n InputStream ins = activity.getResources().openRawResource(\n activity.getResources().getIdentifier(name,\n \"raw\", activity.getPackageName()));\n File file = new File(Environment.getExternalStorageDirectory(), \"temp.jpg\");\n OutputStream os = new FileOutputStream(file);\n IOUtils.copy(ins, os);\n return file;\n }", "public void readRawFile(View view) {\n InputStream ins = getResources().openRawResource(R.raw.hello_world);\n BufferedReader bufferedReader = null;\n try {\n bufferedReader = new BufferedReader(new InputStreamReader(new BufferedInputStream(ins)));\n String line;\n String text = \"\";\n while ((line = bufferedReader.readLine()) != null) {\n text += line;\n }\n TextView tv = (TextView) findViewById(R.id.textView6);\n tv.setText(text);\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (bufferedReader != null) {\n try {\n bufferedReader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "static public String readResourceFile(String fileName) {\n String text=\"\";\n String resourceType = \"raw\";\n String packageName = appAct.getApplicationContext().getPackageName();\n Resources res = appAct.getResources();\n int identifier = res.getIdentifier( fileName, resourceType, packageName );\n InputStream file = null;\n try {\n file = res.openRawResource(identifier);\n byte[] buffer = new byte[file.available()];\n file.read(buffer, 0, buffer.length);\n // put the dog breed details into the TextView\n text = new String(buffer, \"UTF-8\");\n file.close();\n } catch (java.io.IOException e) {\n e.printStackTrace();\n }\n return text;\n }", "public static String readTextFileFromRawResource(\n final int resId) {\n\n final BufferedReader bufferedReader = new BufferedReader(\n new InputStreamReader(App.getInstance().getResources().openRawResource(resId))\n );\n\n String line;\n final StringBuilder body = new StringBuilder();\n\n try {\n while ((line = bufferedReader.readLine()) != null) {\n body.append(line).append('\\n');\n }\n } catch (IOException e) {\n return null;\n }\n\n return body.toString();\n }", "public static List<String> geFileToListFromRaw(int resId) {\n if (ctx == null) {\n return null;\n }\n\n List<String> fileContent = new ArrayList<String>();\n BufferedReader reader = null;\n try {\n InputStreamReader in = new InputStreamReader(ctx.getResources()\n .openRawResource(resId));\n reader = new BufferedReader(in);\n String line = null;\n while ((line = reader.readLine()) != null) {\n fileContent.add(line);\n }\n reader.close();\n return fileContent;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "@NotNull\n\tprivate static File readResourceToGLTempFile(final String resourceName,\n\t final boolean ratingsFileHack) throws IOException {\n\t\tfinal File resultFile = File.createTempFile(\"taste\", \"txt\");\n\t\tresultFile.deleteOnExit();\n\t\tfinal BufferedReader reader = new BufferedReader(\n\t\t\tnew InputStreamReader(GroupLensRecommender.class.getResourceAsStream(resourceName)));\n\t\tfinal PrintWriter writer = new PrintWriter(new FileWriter(resultFile));\n\t\tfor (String line; ((line = reader.readLine()) != null); ) {\n\t\t\tif (ratingsFileHack) {\n\t\t\t\t// Hack: toss the last column of data, which is a timestamp we don't want\n\t\t\t\tline = line.substring(0, line.lastIndexOf(\"::\"));\n\t\t\t}\n\t\t\tline = line.replace(\",\", \"\").replace(\"::\", \",\");\n\t\t\twriter.println(line);\n\t\t}\n\t\twriter.close();\n\t\treader.close();\n\t\treturn resultFile;\n\t}", "public static String getRawString(Resources res, int id) throws Exception {\n\t\tString result = null;\n\t\tInputStream is = null;\n\t\ttry {\n\t\t\tis = res.openRawResource(id);\n\t\t\tbyte[] raw = new byte[is.available()];\n\t\t\tis.read(raw);\n\t\t\tresult = new String(raw);\n\t\t} catch(Exception e) {\n\t\t\tthrow new Exception(\"Problem while trying to read raw\", e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch(Exception e) {\n\t\t\t}\n\t\t}\n\t\treturn result;\n\n\t}", "public static String loadFileContents(int file) throws IOException\n\t{\n\t\ttry\n\t\t{\n\t\t\tStringBuffer fileContents = new StringBuffer();\n\t\t\tString line;\n\t\t\tInputStreamReader inputStream = new InputStreamReader(GeoyarnClientApplication.getContext().getResources().openRawResource(file));\n\t\t\tBufferedReader in = new BufferedReader(inputStream);\n\t\t\twhile ((line = in.readLine()) != null)\n\t\t\t{\n\t\t\t\tfileContents.append(line);\n\t\t\t}\n\t\t\tin.close();\n\t\t\treturn fileContents.toString();\n\t\t}\n\t\tcatch (FileNotFoundException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public String getFileContents()\n {\n try\n {\n byte[] fileBytes = Files.readAllBytes(Paths.get(file.getName()));\n return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(fileBytes)).toString();\n }\n catch (IOException ioe)\n {\n return null;\n }\n }", "private static String getResFileContent(Context context, String filename) {\n\t\tInputStream is = context.getClass().getClassLoader().getResourceAsStream(filename);\n\t\tif (null == is) {\n\t\t\treturn null;\n\t\t}\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));\n\t\tStringBuilder builder = new StringBuilder();\n\t\ttry {\n\t\t\tString content = \"\";\n\t\t\twhile (bufferedReader.ready()) {\n\t\t\t\tcontent = bufferedReader.readLine();\n\t\t\t\tbuilder.append(content);\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException e) {\n\t\t\treturn null;\n\t\t}\n\t\treturn builder.toString();\n\t}", "@GET\n @Produces(MediaType.TEXT_HTML)\n public String getIt() throws IOException {\n String filename = Main.filename;\n String dataString;\n try {\n dataString = new String(Files.readAllBytes(Paths.get(path + filename)));\n } catch (IOException ioe) {\n return ioe.toString();\n }\n return dataString;\n }", "byte[] getRawContent();", "File resourcesRoot();", "protected String readAssestsFile (String fileName, Context context) {\n StringBuffer lineDataBuffer = new StringBuffer();\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(fileName), \"UTF-8\"));\n String mLine;\n while ((mLine = reader.readLine()) != null) {\n lineDataBuffer.append (mLine);\n }\n } catch (IOException e) {\n lineDataBuffer = null;\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {}\n }\n }\n return lineDataBuffer.toString();\n }", "public static InputStream contextOpenRawResources(int id){\n return getContext().getResources().openRawResource(id);\n }", "byte[] loadraw(long projectId, String fileId);", "public String getRutaPlantilla()\r\n/* 1330: */ {\r\n/* 1331:1357 */ return \"/resources/plantillas/inventario/AS2 Transferencia Bodega.xls\";\r\n/* 1332: */ }", "private static String getStringFromRawResource(Context context, int resourceId) {\n\t\tString result = null;\n\t\t\n\t\tInputStream is = context.getResources().openRawResource(resourceId);\n\t\tif (is != null) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tString line;\n\n\t\t\ttry {\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n\t\t\t\twhile ((line = reader.readLine()) != null) {\t\t\t\t\t\n\t\t\t\t\tsb.append(line).append(\"\\n\");\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.w(\"ApplicationUtils\", String.format(\"Unable to load resource %s: %s\", resourceId, e.getMessage()));\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLog.w(\"ApplicationUtils\", String.format(\"Unable to load resource %s: %s\", resourceId, e.getMessage()));\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = sb.toString();\n\t\t} else { \n\t\t\tresult = \"\";\n\t\t}\n\t\t\n\t\treturn result;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Translates xDistance horizontally and yDistance vertically
public void translate(int xDistance, int yDistance);
[ "public void translateX(float distance) {}", "void translate(double[] distance);", "private void translate(double x, double y) {\n gc.translate(x, y);\n origin.setX(origin.getX() + x);\n origin.setY(origin.getY() + y);\n }", "public double distFrom(float x, float y) {\n //System.out.println(picture.getCenterX() + \" \" + picture.getCenterY());\n //return Math.hypot(x - picture.getCenterX(), y - picture.getCenterY());\n float[] pos = intToFloatPos(this.col, this.row);\n //System.out.println(\"+GAB+ \" + pos[0] + \" \" + pos[1]);\n return Math.hypot(x - pos[0], y-pos[1]);\n }", "@Override\n\tpublic void translate(int x, int y) {\n\t\tthis.vertexPoint.setLocation(x, y);\n\t\tthis.clickableZone.setLocation(vertexPoint.x-offsetX, vertexPoint.y-offsetY);\n\t\t\n\t}", "@Override\n public void translate(double dx, double dy) {\n for (Vector2D v : points) {\n v.translate(dx, dy);\n }\n }", "@Override\r\n\tpublic void translate(int x, int y) {\n\r\n\t}", "public abstract void translate(int x, int y);", "public double getDistance(double x, double y) {\n return Math.sqrt((Math.pow((getLayoutX() - x),2)) + (Math.pow((getLayoutY() - y),2)));\n }", "public void setTranslation(float translateX, float translateY);", "public void move(double distance) {\r\n System.out.printf(\"\\n\");\r\n x += distance * Math.cos(angle);\r\n y += distance * Math.sin(angle);\r\n }", "public static void translate(Task[] tasks, double xdist, double ydist) {\n TPoint point;\n\n for (int count = 0; count < tasks.length; count++) {\n point = getPosition(tasks[count]);\n setPosition(tasks[count], new TPoint(point.getX() + xdist, point.getY() + ydist));\n }\n }", "public void translatePixel(int dx, int dy) {\n\t\tthis.pixelBounds.x += dx;\n\t\tthis.pixelBounds.y += dy;\n\t}", "@Override\n\tpublic void translate(double tx, double ty) {\n\n\t}", "public void translateOffset(int x, int y);", "public void translate(int x, int y) {\n transform.translate(x, y);\n }", "public void translate(float dx, float dy) {\r\n\t\t// translates in-place \r\n\t\tleft+=dx;\r\n\t\ttop+=dy;\r\n\t\tright+=dx;\r\n\t\tbottom+=dy; \r\n\t}", "public void translate(float x, float y) {\n\t\tthis.square.x = x;\n\t\tthis.square.y = y;\n\t}", "double calcDistance(double xcmd, double ycmd) {\n double dX = xcmd - getX();\n double dY = ycmd - getY();\n\n return (Math.sqrt((dX * dX + dY * dY)));\n }", "@Override\n\tpublic Point translate(int x, int y) {\n\t\trectangle.translate(x, y);\n\t\treturn rectangle.getOrigin();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ / / / / / / /
private String getText(int param1Int1, int param1Int2) throws BadLocationException { /* 2959 */ View view = (View)AbstractButton.this.getClientProperty("html"); /* 2960 */ if (view != null) { /* 2961 */ Document document = view.getDocument(); /* 2962 */ if (document instanceof StyledDocument) { /* 2963 */ StyledDocument styledDocument = (StyledDocument)document; /* 2964 */ return styledDocument.getText(param1Int1, param1Int2); /* */ } /* */ } /* 2967 */ return null; /* */ }
[ "private void calculatePaths() {\n\n\n }", "public static void main (String arg[]){\n\tSystem.out.println(\" ( ) ( ( \"); \n\n\tSystem.out.println(\" ( )\\\\ ) ( /( ( )\\\\ ) ( )\\\\ ) \");\n\t\n\tSystem.out.println(\" )\\\\ (()/( ( )\\\\()) )\\\\ (() / ( )\\\\ (()/( \");\n\t\n\tSystem.out.println(\" (((_) /(_)))\\\\ ((__)\\\\ (((_) /(_))((((_)( /(_))\");\n \n\tSystem.out.println(\" )\\\\____ (__)) ((__) _((_) )\\\\____ (_)) )\\\\ _ )\\\\ (_))\");\n \t\n System.out.println(\"((/ __| |_ _| | ___| | \\\\| |((/ __| |_ _| (_)_\\\\(_)\\\\ / __|\"); \n \n System.out.println(\" | (__ | | | __| | . | | (__ | | / _ \\\\ \\\\__ \\\\\");\n\n\tSystem.out.println( \" \\\\____| |___| |____| |_|\\\\_| \\\\____| |___| /_/ \\\\_\\\\ |___/\");\n }", "abstract protected String roam();", "private static void EX5() {\n\t\t\r\n\t}", "protected int snapBits(){return 9;}", "float iwdir(float pres);", "@Override\n public int getWidth(){\n return width - 10;\n }", "private static void backPath()\n\t{\n\t\tfor(int i = 0, x = 0, y = 0, prevDir = 1, nextDir = -1; \n\t\t\t\ti <= grid[gridWidth-1][gridHeight-1]; \n\t\t\t\ti++, prevDir = ((nextDir+2)%4), nextDir = -1) {\n\t\t\tif(i < grid[gridWidth-1][gridHeight-1]) {\n\t\t\t\tif(x < gridWidth-1 && nextDir == -1) {\n\t\t\t\t\tif(grid[x+1][y] == i+1) {\n\t\t\t\t\t\tnextDir = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(y > 0) {\n\t\t\t\t\tif(grid[x][y-1] == i+1 && nextDir == -1) {\n\t\t\t\t\t\tnextDir = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(x > 0) {\n\t\t\t\t\tif(grid[x-1][y] == i+1 && nextDir == -1) {\n\t\t\t\t\t\tnextDir = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(y < gridHeight-1) {\n\t\t\t\t\tif(grid[x][y+1] == i+1 && nextDir == -1) {\n\t\t\t\t\t\tnextDir = 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnextDir = 3;\n\t\t\t}\n\t\t\tif(SHOWPATH) {\n\t\t\t\tif((prevDir + nextDir) % 2 == 0) {\t//Straight\n\t\t\t\t\tpipe[x][y] = Pipe.newStraight(prevDir);\n\t\t\t\t} else {\n\t\t\t\t\tif(nextDir == ((prevDir + 1)%4)) {\n\t\t\t\t\t\tpipe[x][y] = Pipe.newBend(prevDir);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpipe[x][y] = Pipe.newBend(nextDir);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif((prevDir + nextDir) % 2 == 0) {\t//Straight\n\t\t\t\t\tpipe[x][y] = Pipe.newStraight();\n\t\t\t\t} else {\n\t\t\t\t\tpipe[x][y] = Pipe.newBend();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nextDir == 0) {\n\t\t\t\tx++;\n\t\t\t} else if(nextDir == 1) {\n\t\t\t\ty--;\n\t\t\t} else if(nextDir == 2) {\n\t\t\t\tx--;\n\t\t\t} else if(nextDir == 3) {\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t\tfor(int x = 0; x < gridWidth; x++) {\n\t\t\tfor(int y = 0; y < gridHeight; y++) {\n\t\t\t\tif(pipe[x][y] == null) {\n\t\t\t\t\tpipe[x][y] = Pipe.newRand();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void divide(){\n /* IMPLEMENTATION */\n }", "@Override\r\n void draw() {\n\r\n int i;\r\n int j;\r\n\r\n for (i = 1; i <= height; i++) {\r\n for (j = 1; j <= width; j++) {\r\n System.out.print(\"*\");\r\n }\r\n System.out.println();\r\n }\r\n\r\n System.out.println();\r\n }", "int parent(int index){\r\n return (index - 1) / 2;\r\n }", "void method0() {\npublic static final Object CELL_WRAPPER = new Object();\npublic static final int LEFT_TO_RIGHT = 0;\npublic static final int UP_TO_DOWN = 1;\npublic static final int DEFAULT_ORIENTATION = LEFT_TO_RIGHT;\nJGraph jgraph;\nprotected int orientation;\nprotected int childParentDistance;\n}", "@Override\n public long getMagnitude() {\n return 3 * left.getMagnitude() + 2 * right.getMagnitude();\n }", "@Override\n public String toString() {\n return \"/\";\n }", "public void drawtree(Vector VT,int NN,ImageProcessor ip){\n int Width,Height,Xstep,Ystep;\n Width=300;\n Height=300;\n Width=this.getWidth();\n Height=this.getHeight();\n if(Width<Height-60)\n {\n Width-=60;\n Height=Width;\n }\n else\n {\n Height-=60;\n Width=Height;\n }\n float depth;\n Tree trtop=(Tree)VT.elementAt(VT.size()-1);\n depth=trtop.resem;\n // modified by wxs 20030827-\n //N=frm.dialogResemble.N;\n N=NN;\n System.out.println(\"Ndfd\"+N);\n if(N==0) return;\n this.Vpos=Height*7/(8*N);\n if(this.algorithm==\"Neighbor Joining\"){\n // this.getNBbotpos();\n this.settoppos();\n }\n this.gettreepos(trtop,depth,false,ip);\n\n for(int ii=0;ii<VT.size();ii++){\n Tree tr=(Tree)VT.elementAt(ii);\n float res=tr.resem;\n String strleft=new String();\n String strright=new String();\n if(this.algorithm==\"Neighbor Joining\"){\n strleft=String.valueOf(tr.leftdis);\n strright=String.valueOf(tr.rightdis);\n }\n else\n {\n strleft=String.valueOf(res);\n strright=String.valueOf(res);\n }\n String left,right;\n left=tr.left;\n right=tr.right;\n\n this.drawline(tr.ltpt,tr.rtpt,tr.tppt,strleft,strright,left,right);\n\n //JOptionPane.showMessageDialog(null,str,\"图像及元素均保存\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "int midComponent();", "protected void paintHorizontalPartOfLeg(Graphics paramGraphics, Rectangle paramRectangle1, Insets paramInsets, Rectangle paramRectangle2, TreePath paramTreePath, int paramInt, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3) {\n/* 1353 */ if (!this.paintLines) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 1358 */ int i = paramTreePath.getPathCount() - 1;\n/* 1359 */ if ((i == 0 || (i == 1 && !isRootVisible())) && \n/* 1360 */ !getShowsRootHandles()) {\n/* */ return;\n/* */ }\n/* */ \n/* 1364 */ int j = paramRectangle1.x;\n/* 1365 */ int k = paramRectangle1.x + paramRectangle1.width;\n/* 1366 */ int m = paramRectangle1.y;\n/* 1367 */ int n = paramRectangle1.y + paramRectangle1.height;\n/* 1368 */ int i1 = paramRectangle2.y + paramRectangle2.height / 2;\n/* */ \n/* 1370 */ if (this.leftToRight) {\n/* 1371 */ int i2 = paramRectangle2.x - getRightChildIndent();\n/* 1372 */ int i3 = paramRectangle2.x - getHorizontalLegBuffer();\n/* */ \n/* 1374 */ if (i1 >= m && i1 < n && i3 >= j && i2 < k && i2 < i3) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1380 */ paramGraphics.setColor(getHashColor());\n/* 1381 */ paintHorizontalLine(paramGraphics, this.tree, i1, i2, i3 - 1);\n/* */ } \n/* */ } else {\n/* 1384 */ int i2 = paramRectangle2.x + paramRectangle2.width + getHorizontalLegBuffer();\n/* 1385 */ int i3 = paramRectangle2.x + paramRectangle2.width + getRightChildIndent();\n/* */ \n/* 1387 */ if (i1 >= m && i1 < n && i3 >= j && i2 < k && i2 < i3) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1393 */ paramGraphics.setColor(getHashColor());\n/* 1394 */ paintHorizontalLine(paramGraphics, this.tree, i1, i2, i3 - 1);\n/* */ } \n/* */ } \n/* */ }", "public void run() {\n\r\n\t\t\r\n\t\tTreeNode root = new TreeNode(-2);\r\n\t\troot.left = null;\r\n\t\troot.right = new TreeNode(-3); root.right.left = null; root.right.right = null;\r\n//\t\troot.left.left = new TreeNode(11); \r\n//\t\troot.left.left.left = new TreeNode(7); root.left.left.left.left = null; root.left.left.left.right = null;\r\n//\t\troot.left.left.right = new TreeNode(2); root.left.left.right.left = null; root.left.left.right.right = null;\r\n//\t\t\r\n//\t\troot.left.right = null;\r\n//\t\t\r\n//\t\troot.right.left = new TreeNode(13); root.right.left.left = null; root.right.left.right = null;\r\n//\t\troot.right.right = new TreeNode(4);\r\n//\t\troot.right.right.left = new TreeNode(5); root.right.right.left.left = null; root.right.right.left.right = null;\r\n//\t\troot.right.right.right = new TreeNode(1); root.right.right.right.left = null; root.right.right.right.right = null;\r\n\t\t\r\n\t\t\r\n\t\tint sum = -5;\r\n\t\t\r\n\t\tList<List<Integer>> lstlstPathSum = pathSum(root, sum);\r\n\t\t\r\n\t\tfor (List<Integer> lstPathSum:lstlstPathSum) {\r\n\t\t\tSystem.out.print(\"[\");\r\n\t\t\tfor (Integer nVal:lstPathSum) System.out.print(nVal + \",\");\r\n\t\t\tSystem.out.println(\"]\");\r\n\t\t}\r\n\t\t\r\n\t}", "public void LegPain() {\n\t\t\r\n\t}", "public int getTileWidth() {\n/* 91 */ return 32;\n/* */ }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Using Scanner: Initiated out put
public static void main(String[] args) { Scanner ab= new Scanner (System.in); System.out.println("Enter the Value:"); int EmpId = ab.nextInt(); { // Else and Else If if(EmpId==10) { System.out.println("True"); }else { System.out.println("False"); } } }
[ "public TerminalIO() {\n this.scanner = new Scanner(System.in);\n }", "private void selectOutput() {\r\n\t\tscan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"1 - Logfile output\");\r\n\t\tSystem.out.println(\"2 - Text output\");\r\n\t\tSystem.out.println(\"3 - Both\");\r\n\t\tString input = scan.next();\r\n\r\n\t\tswitch (input) {\r\n\t\tcase \"1\":\r\n\t\t\toutputMode = 1;\r\n\t\t\ttry {\r\n\t\t\t\t// Retrieve a timestamp using the java.util.Calendar library\r\n\t\t\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\")\r\n\t\t\t\t\t\t.format(Calendar.getInstance().getTime());\r\n\t\t\t\tFileWriter fw = new FileWriter(\"log.txt\", true);\r\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\t\tPrintWriter outFile = new PrintWriter(bw);\r\n\r\n\t\t\t\toutFile.println(\"New Session Started at\");\r\n\t\t\t\toutFile.println(timeStamp);\r\n\t\t\t\toutFile.print(\"Playing with deck: \");\r\n\t\t\t\toutFile.println(deckFile);\r\n\t\t\t\toutFile.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"Unable to access log.txt\");\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"2\":\r\n\t\t\toutputMode = 2;\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"3\":\r\n\t\t\toutputMode = 3;\r\n\t\t\ttry {\r\n\t\t\t\t// Retrieve a timestamp using the java.util.Calendar library\r\n\t\t\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\")\r\n\t\t\t\t\t\t.format(Calendar.getInstance().getTime());\r\n\t\t\t\tFileWriter fw = new FileWriter(\"log.txt\", true);\r\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\t\tPrintWriter outFile = new PrintWriter(bw);\r\n\r\n\t\t\t\toutFile.println(\"New Session Started at\");\r\n\t\t\t\toutFile.println(timeStamp);\r\n\t\t\t\toutFile.print(\"Playing with deck: \");\r\n\t\t\t\toutFile.println(deckFile);\r\n\t\t\t\toutFile.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"Unable to access log.txt\");\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"Invalid input\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n System.out.println(\"PERFECTION OUTPUT\");\n\n for (int i = in.nextInt(); i != 0; i = in.nextInt())\n System.out.format(\"%5d %s\\n\", i, type(i));\n\n System.out.println(\"END OF OUTPUT\");\n in.close();\n }", "public void scannerExample2(){\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tString input = scan.nextLine();\n\t\tStringTokenizer st = new StringTokenizer(input);\n\t\twhile(st.hasMoreTokens()){\n\t\t\tString token = st.nextToken();\n\t\t\t\n\t\t\tSystem.out.println(token);\n\t\t}\n\n\t\tif(scan != null){\n\t\t\tscan.close();\n\t\t}\n\t}", "private void echo_input()\n throws IOException\n {\n BufferedReader in = \n new BufferedReader(new InputStreamReader(in()));\n String line;\n while ((line = in.readLine()) != null)\n {\n System.out.println(line);\n out().println(line);\n }\n }", "@Override\n public void input() {\n super.input();\n System.out.print(\"Nhap dung luong: \");\n capacity = Double.valueOf(scanner.nextLine());\n System.out.print(\"Nhap so luot tai: \");\n downloads = Integer.valueOf(scanner.nextLine());\n System.out.print(\"Nhap gia thanh: \");\n price = Double.valueOf(scanner.nextLine());\n }", "private void scan() {\n\ttok = scanner.scan();\n\t//System.out.println(tok);\n }", "private InputFromConsole() {\r\n\t\tscanner = new Scanner(System.in);\r\n\t}", "public Learner(Scanner in, PrintStream out) {\n this.in = in;\n this.out = out;\n }", "private String inputWithScanner(Scanner sc) {\n return sc.nextLine();\n }", "static void getInput() {\n System.out.print(\"Site name: \");\n name = scan.nextLine();\n System.out.print(\"Author: \");\n author = scan.nextLine();\n System.out.print(\"Do you want a folder for JavaScript? \");\n js = scan.nextLine();\n System.out.print(\"Do you want a folder for CSS? \");\n css = scan.nextLine();\n }", "public static void getInput(){\r\n System.out.print(terminalPrefix);\r\n Scanner scanner = new Scanner(System.in);\r\n Input.setInput(scanner.nextLine());\r\n Input.check();\r\n }", "private static void initOutput() {\r\n\t\tif (DEBUG_MODE>0) {\r\n\t\t\ttry {\r\n\t\t\t\tout = new PrintWriter(\"output.txt\", \"UTF-8\");\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tout = new PrintWriter(System.out);\r\n\t\t}\r\n\t}", "public static void main(String[] args){\n\t\tScanner userInput = new Scanner(System.in);\n\t\t/// this line will print out after the user has input data\n\t\tSystem.out.println(userInput.nextLine());\n\t}", "private String readIn() {\r\n\t\treturn scanner.nextLine();\r\n\t}", "public void getSecondScaleResponse (Scanner stdin){\r\n additionalResponse = stdin.nextLine();\r\n }", "public void input() {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.print(\"kor:\");\r\n\t\tint kor = scan.nextInt();\r\n\t\tSystem.out.print(\"eng:\");\r\n\t\tint eng = scan.nextInt();\r\n\t\tSystem.out.print(\"math:\");\r\n\t\tint math = scan.nextInt();\r\n\t\t\r\n\t\t//exam = new Exam(kor, eng, math);\r\n\t\texam.setKor(kor);\r\n\t\texam.setEng(eng);\r\n\t\texam.setMath(math);\r\n\t}", "protected String getScannerInput() {\n\t\treturn scan.next();\n\t}", "public void readInput() {\n try (final Scanner scanner = new Scanner(System.in)) {\n while (true) {\n try {\n switch (readString(scanner, \"Command: \").toLowerCase().trim()) {\n case \"teilsumme\":\n System.out.println(MathFunctions.berechneTeilersumme(readNumber(scanner, \"Zahl: \")));\n break;\n case \"isbn\":\n System.out.println(\n \"Die Prüfziffer ist \"\n + MathFunctions.berechneChecksummeIsbn(readNumber(scanner, \"ISBN-10: \")));\n break;\n case \"stop\":\n System.exit(0);\n }\n } catch (IllegalArgumentException exception) {\n System.out.println(\"Fehler: \" + exception.getMessage());\n }\n }\n }\n }", "private void output() {\r\n\r\n\t\tframe.cardDisplay(playingField);\r\n\r\n\t\tString card;\r\n\r\n\t\t// Create a string containing the value and suit of the top of all piles\r\n\t\t// in play\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tfor (int i = 0; i <= pilesOnField; i++) {\r\n\t\t\tcard = playingField.get(i);\r\n\t\t\tsb.append(card.charAt(0));\r\n\t\t\tsb.append(card.charAt(1));\r\n\t\t\tsb.append(\" \");\r\n\t\t}\r\n\r\n\t\t// Print to console\r\n\t\tif (outputMode > 1) {\r\n\r\n\t\t\tSystem.out.println(sb.toString());\r\n\t\t}\r\n\r\n\t\t// Print to log file\r\n\t\tif (outputMode == 3 || outputMode == 1) {\r\n\r\n\t\t\ttry {\r\n\t\t\t\tFileWriter fw = new FileWriter(\"log.txt\", true);\r\n\t\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\t\tPrintWriter outFile = new PrintWriter(bw);\r\n\r\n\t\t\t\toutFile.println(sb.toString());\r\n\r\n\t\t\t\toutFile.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"Unable to access log file\");\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of current lec
public String getCurrentLecture() { CURRENT_CALENDAR = Calendar.getInstance(); Date date = CURRENT_CALENDAR.getTime(); return TIME_TABLE.get(getDayName().toUpperCase() + SEMI_COLON + getTimeInterval(date)); }
[ "public java.lang.CharSequence getLName() {\n return lName;\n }", "public String getContLname() {\n\t\treturn contLname;\n\t}", "public String getNameLC()\n {\n return _nameLC != null ? _nameLC : (_nameLC = _name.toLowerCase());\n }", "public String getName() {\r\n return \"Leitner\";\r\n }", "public String getLName() {\n return lName;\n }", "public String getlName(){\r\n return lName;\r\n }", "public String getCustLName() {\n\t\treturn custLName;\n\t}", "public String getName() {\n/* 57 */ return COSName.LAB.getName();\n/* */ }", "public String getCurrentName() {\n return this.currentName;\n }", "public String getName() {\n\t\treturn lvalue.getName();\n\t}", "public String getName()\n {\n return LanguageUtility.getLocal(unlocalizedName);\n }", "public String getEmplLname() {\r\n return (String) getAttributeInternal(EMPLLNAME);\r\n }", "public String getCurrLexeme()\n {\n return myCurrLexeme;\n }", "public String getLname(){\n\t\treturn lname;\n\t}", "public String getNameContext() {\n\t\treturn this.nameContext;\n\t}", "public final String getName() {\r\n return this.name().toLowerCase();\r\n }", "public String getLesessionName() {\n return lesessionName;\n }", "String getTermName(int ldev){\n String name = null;\n GCTermData td = getTerminal(ldev);\n if (td != null){\n name = td.terminal;\n }\n return name;\n }", "public String getNameEnglish() { return getName(); }", "java.lang.String getSangNameSelf();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field utilisateur is set (has been assigned a value) and false otherwise
public boolean isSetUtilisateur() { return this.utilisateur != null; }
[ "public final boolean isUsuarioDefaultValue() {\r\n return isDefaultValue(getUsuarioAttribute(getMtDatabase()));\r\n }", "@Transient\r\n\tpublic boolean getIsUserOnly(){\r\n\t\tif(StringUtils.isBlank(getAssignedIdentifier()) && !StringUtils.isBlank(getLoginId())){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean emptyUserVal() {\n\t\treturn (this.user.isEmpty());\n\t}", "public boolean isSetIsWtUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(ISWTUSER$30) != 0;\n }\n }", "public boolean userExist()\r\n {\r\n return exist;\r\n }", "public boolean isSetUserInput() {\r\n return this.userInput != null;\r\n }", "public boolean isSetOpUser() {\n return this.opUser != null;\n }", "public boolean isSetLogradouroDne() {\r\n return this.logradouroDne != null;\r\n }", "public Boolean getUserValid() {\n return userValid;\n }", "public boolean hasUsername() {\n return fieldSetFlags()[1];\n }", "public boolean isSetUserNum() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USERNUM_ISSET_ID);\n }", "public boolean benutzerIstKeinSpieler() {\r\n\t\treturn ((!userA.equals(LoginModell.getBenutzerName())) && (!userB.equals(LoginModell.getBenutzerName())));\r\n\t}", "public boolean isSetUserNickName() {\n return this.userNickName != null;\n }", "public boolean champsValider() {\n int compteur = 0;\n if(Informations.nonValide(editEmail, Informations.EMAIL)){\n compteur++;\n }\n if(editPsswrd.getText().toString().equals(\"\")){\n compteur++;\n }\n return compteur == 0;\n }", "private static boolean verificarLogueo() {\n\t\tExternalContext extCtx = FacesContext.getCurrentInstance().getExternalContext(); \n\t\tHttpSession sesion = (HttpSession)extCtx.getSession(false);\n\t\treturn sesion.getAttribute(Const.USUARIO) != null;\n\t}", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case USER_ORG:\n return isSetUserOrg();\n }\n throw new IllegalStateException();\n }", "public boolean TemAutor(){\r\n return this.autor1 != null;\r\n }", "boolean isSetAssigner();", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case USERNAME:\n return isSetUsername();\n case PASSWORD:\n return isSetPassword();\n case PERSISTED_TIME:\n return isSetPersistedTime();\n case TOKEN:\n return isSetToken();\n }\n throw new IllegalStateException();\n }", "protected boolean checkUser(){ return true;}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals"; BA.debugLineNum = 9;BA.debugLine="Dim server =\"
public static RemoteObject _process_globals() throws Exception{ actlapor._server = BA.ObjectToString("http://b240bd05c3dc.ngrok.io/klik113-master/mobile/"); //BA.debugLineNum = 10;BA.debugLine="Private rp As RuntimePermissions"; actlapor._rp = RemoteObject.createNew ("anywheresoftware.b4a.objects.RuntimePermissions"); //BA.debugLineNum = 11;BA.debugLine="End Sub"; return RemoteObject.createImmutable(""); }
[ "public static String _process_globals() throws Exception{\n_srvr = new anywheresoftware.b4j.object.ServerWrapper();\r\n //BA.debugLineNum = 14;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "public static RemoteObject _process_globals() throws Exception{\nmain._xui = RemoteObject.createNew (\"anywheresoftware.b4a.objects.B4XViewWrapper.XUI\");\r\n //BA.debugLineNum = 19;BA.debugLine=\"End Sub\";\r\nreturn RemoteObject.createImmutable(\"\");\r\n}", "public static String _service_create() throws Exception{\n_lwm.Initialize(\"lwm\",anywheresoftware.b4a.keywords.Common.True,processBA);\n //BA.debugLineNum = 20;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "DebuggerCLI(){\r\n\t\t\r\n\t}", "public static String _globals() throws Exception{\nmostCurrent._pnl = new anywheresoftware.b4a.objects.PanelWrapper();\n //BA.debugLineNum = 14;BA.debugLine=\"Private clsEG As clsEditableGrid\";\nmostCurrent._clseg = new b4a.example.clseditablegrid();\n //BA.debugLineNum = 15;BA.debugLine=\"Private lstTable As CustomListView\";\nmostCurrent._lsttable = new b4a.example.customlistview();\n //BA.debugLineNum = 16;BA.debugLine=\"Private general As Map\";\nmostCurrent._general = new anywheresoftware.b4a.objects.collections.Map();\n //BA.debugLineNum = 17;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static String _proces_error(String _msg) throws Exception{\nanywheresoftware.b4a.keywords.Common.Msgbox(_msg,\"error\",mostCurrent.activityBA);\n //BA.debugLineNum = 75;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static String _process_globals() throws Exception{\n_mp = new anywheresoftware.b4a.objects.MediaPlayerWrapper();\n //BA.debugLineNum = 7;BA.debugLine=\"Dim Duration, Position As Long\";\n_duration = 0L;\n_position = 0L;\n //BA.debugLineNum = 8;BA.debugLine=\"Dim tmrMedia As Timer\";\n_tmrmedia = new anywheresoftware.b4a.objects.Timer();\n //BA.debugLineNum = 9;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static String _listabel_click() throws Exception{\nanywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(\"thlefona\"));\n //BA.debugLineNum = 405;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static RemoteObject _process_globals() throws Exception{\nxuiviewsutils._utilsinitialized = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 7;BA.debugLine=\"Private xui As XUI\";\nxuiviewsutils._xui = RemoteObject.createNew (\"anywheresoftware.b4a.objects.B4XViewWrapper.XUI\");\n //BA.debugLineNum = 8;BA.debugLine=\"End Sub\";\nreturn RemoteObject.createImmutable(\"\");\n}", "public static String _katigorlabel_click() throws Exception{\nanywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(\"pixida\"));\n //BA.debugLineNum = 408;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static String _service_create() throws Exception{\n_sms1.Initialize2(\"sms1\",processBA,(int) (999));\n //BA.debugLineNum = 12;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public String _prevm_click() throws Exception{\n_movedate((int) (-1),(int) (0));\n //BA.debugLineNum = 381;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static String _process_globals() throws Exception{\n_server_mysql = \"\";\n //BA.debugLineNum = 8;BA.debugLine=\"Public code_cat,code_sub_cat,code_brand As Int\";\n_code_cat = 0;\n_code_sub_cat = 0;\n_code_brand = 0;\n //BA.debugLineNum = 9;BA.debugLine=\"Public brand_name,cat_name As String\";\n_brand_name = \"\";\n_cat_name = \"\";\n //BA.debugLineNum = 10;BA.debugLine=\"Public bool_brand_layout,bool_cat As Boolean=Fals\";\n_bool_brand_layout = false;\n_bool_cat = anywheresoftware.b4a.keywords.Common.False;\n //BA.debugLineNum = 11;BA.debugLine=\"Public bool_porfroush,bool_news_list As Boolean=F\";\n_bool_porfroush = false;\n_bool_news_list = anywheresoftware.b4a.keywords.Common.False;\n //BA.debugLineNum = 12;BA.debugLine=\"Public dir_root_image_file As String\";\n_dir_root_image_file = \"\";\n //BA.debugLineNum = 14;BA.debugLine=\"Public bool_search As Boolean=False\";\n_bool_search = anywheresoftware.b4a.keywords.Common.False;\n //BA.debugLineNum = 15;BA.debugLine=\"Public query_search As String\";\n_query_search = \"\";\n //BA.debugLineNum = 18;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "void runDebug(){\r\n Program program = bcl.loadCodes();\r\n \r\n //System.out.println(\"inter \" + program.getCode(0).toString());\r\n debugVirtualMachine vm = new debugVirtualMachine(entries,program);\r\n //vm.executeProgram();\r\n UI ui= new UI(vm, entries);\r\n ui.run();\r\n }", "public static String _process_globals() throws Exception{\n_fadeddarkred = anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (180),(int) (150),(int) (4),(int) (4));\n //BA.debugLineNum = 7;BA.debugLine=\"Public FadedBlack As Int = Colors.ARGB(100,0,0,0)\";\n_fadedblack = anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (100),(int) (0),(int) (0),(int) (0));\n //BA.debugLineNum = 8;BA.debugLine=\"Public FadedBlack2 As Int = Colors.ARGB(150,0,0,0\";\n_fadedblack2 = anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (150),(int) (0),(int) (0),(int) (0));\n //BA.debugLineNum = 9;BA.debugLine=\"Public DarkGray As Int = 0xFF4E4E4E\";\n_darkgray = (int) (0xff4e4e4e);\n //BA.debugLineNum = 10;BA.debugLine=\"Public LightGray As Int = 0xFFBBBBBB\";\n_lightgray = (int) (0xffbbbbbb);\n //BA.debugLineNum = 11;BA.debugLine=\"Public LightGrayPressed As Int = 0xFF828282\";\n_lightgraypressed = (int) (0xff828282);\n //BA.debugLineNum = 12;BA.debugLine=\"Public DarkDarkGray As Int = 0xFF313131\";\n_darkdarkgray = (int) (0xff313131);\n //BA.debugLineNum = 13;BA.debugLine=\"Public White As Int = Colors.White\";\n_white = anywheresoftware.b4a.keywords.Common.Colors.White;\n //BA.debugLineNum = 14;BA.debugLine=\"Public Transparent As Int = Colors.Transparent\";\n_transparent = anywheresoftware.b4a.keywords.Common.Colors.Transparent;\n //BA.debugLineNum = 15;BA.debugLine=\"Public Black As Int = Colors.Black\";\n_black = anywheresoftware.b4a.keywords.Common.Colors.Black;\n //BA.debugLineNum = 16;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static RemoteObject _process_globals() throws Exception{\nmain._my_phone = RemoteObject.createNew (\"anywheresoftware.b4a.phone.Phone\");\n //BA.debugLineNum = 17;BA.debugLine=\"Dim my_phone_state As PhoneWakeState\";\nmain._my_phone_state = RemoteObject.createNew (\"anywheresoftware.b4a.phone.Phone.PhoneWakeState\");\n //BA.debugLineNum = 18;BA.debugLine=\"End Sub\";\nreturn RemoteObject.createImmutable(\"\");\n}", "public static String _setdbtype(int _dbt) throws Exception{\n_curdbtype = _dbt;\r\n //BA.debugLineNum = 36;BA.debugLine=\"End Sub\";\r\nreturn \"\";\r\n}", "public static String _globals() throws Exception{\nmostCurrent._lblresult = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 16;BA.debugLine=\"Dim StrSQL As String\";\nmostCurrent._strsql = \"\";\n //BA.debugLineNum = 17;BA.debugLine=\"Dim btnReturn As Button\";\nmostCurrent._btnreturn = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 18;BA.debugLine=\"Dim livebook As ListView\";\nmostCurrent._livebook = new anywheresoftware.b4a.objects.ListViewWrapper();\n //BA.debugLineNum = 19;BA.debugLine=\"Dim lblShowebook As Label\";\nmostCurrent._lblshowebook = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 20;BA.debugLine=\"Dim JSON As JSONParser\";\nmostCurrent._json = new anywheresoftware.b4a.objects.collections.JSONParser();\n //BA.debugLineNum = 21;BA.debugLine=\"Dim response As String\";\nmostCurrent._response = \"\";\n //BA.debugLineNum = 22;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "public static RemoteObject _process_globals() throws Exception{\nfunciones._max_cache_size = BA.numberCast(int.class, 200);\n //BA.debugLineNum = 18;BA.debugLine=\"Dim App_tit As String\";\nfunciones._app_tit = RemoteObject.createImmutable(\"\");\n //BA.debugLineNum = 19;BA.debugLine=\"Dim App_ver As String\";\nfunciones._app_ver = RemoteObject.createImmutable(\"\");\n //BA.debugLineNum = 21;BA.debugLine=\"Dim App_tts As Boolean\";\nfunciones._app_tts = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 22;BA.debugLine=\"Dim App_vibrar As Boolean\";\nfunciones._app_vibrar = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 23;BA.debugLine=\"Dim App_dictado As Boolean\";\nfunciones._app_dictado = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 24;BA.debugLine=\"Dim App_wifi As Boolean\";\nfunciones._app_wifi = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 26;BA.debugLine=\"Dim Ok As Boolean\";\nfunciones._ok = RemoteObject.createImmutable(false);\n //BA.debugLineNum = 28;BA.debugLine=\"End Sub\";\nreturn RemoteObject.createImmutable(\"\");\n}", "public static String _globals() throws Exception{\nmostCurrent._inet_devname_txt = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 17;BA.debugLine=\"Private inet_login_txt As EditText\";\nmostCurrent._inet_login_txt = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 18;BA.debugLine=\"Private inet_pass_txt As EditText\";\nmostCurrent._inet_pass_txt = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 19;BA.debugLine=\"Private inet_port_txt As EditText\";\nmostCurrent._inet_port_txt = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 20;BA.debugLine=\"Private inet_server_txt As EditText\";\nmostCurrent._inet_server_txt = new anywheresoftware.b4a.objects.EditTextWrapper();\n //BA.debugLineNum = 21;BA.debugLine=\"Private Label1 As Label\";\nmostCurrent._label1 = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 22;BA.debugLine=\"Private Label2 As Label\";\nmostCurrent._label2 = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 23;BA.debugLine=\"Private Label3 As Label\";\nmostCurrent._label3 = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 24;BA.debugLine=\"Private Label4 As Label\";\nmostCurrent._label4 = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 25;BA.debugLine=\"Private Label5 As Label\";\nmostCurrent._label5 = new anywheresoftware.b4a.objects.LabelWrapper();\n //BA.debugLineNum = 26;BA.debugLine=\"Private save_ap_set_btn As Button\";\nmostCurrent._save_ap_set_btn = new anywheresoftware.b4a.objects.ButtonWrapper();\n //BA.debugLineNum = 27;BA.debugLine=\"End Sub\";\nreturn \"\";\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Activity Relationship'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseArtefactActivityRelationship(ArtefactActivityRelationship object) { return null; }
[ "public T caseActRelationship(ActRelationship object) {\n\t\treturn null;\n\t}", "public Relationship_type getRelationship() {\n return relationship;\n }", "public T caseMedicationActivity(MedicationActivity object) {\n\t\treturn null;\n\t}", "public String getRelationship() {\r\n return relationship;\r\n }", "YAnnotRelationship getRelationship();", "public Object getDestination(Object relationship) {\n\n\tif (!(relationship instanceof MRelationship)\n\t && !(relationship instanceof MLink)\n\t && !(relationship instanceof MAssociationEnd)) {\n\n\t throw new IllegalArgumentException(\"Argument is not \"\n\t\t\t\t\t + \"a relationship\");\n\t}\n\tif (relationship instanceof MLink) {\n\t Iterator it =\n\t nsmodel.getFacade().getConnections(relationship).iterator();\n\t if (it.hasNext()) {\n\t\tit.next();\n\t\tif (it.hasNext()) {\n\t\t return nsmodel.getFacade().getInstance(it.next());\n\t\t} \n\t\treturn null;\n\t }\n return null;\n\t}\n\n\n if (relationship instanceof MAssociation) {\n MAssociation assoc = (MAssociation) relationship;\n List conns = assoc.getConnections();\n if (conns.size() <= 1) {\n return null;\n }\n return ((MAssociationEnd) conns.get(1)).getType();\n }\n if (relationship instanceof MGeneralization) {\n MGeneralization gen = (MGeneralization) relationship;\n return gen.getParent();\n }\n if (relationship instanceof MDependency) {\n MDependency dep = (MDependency) relationship;\n Collection col = dep.getSuppliers();\n if (col.isEmpty()) {\n return null;\n }\n return (MModelElement) (col.toArray())[0];\n }\n if (relationship instanceof MFlow) {\n MFlow flow = (MFlow) relationship;\n Collection col = flow.getTargets();\n if (col.isEmpty()) {\n return null;\n }\n return (MModelElement) (col.toArray())[0];\n }\n if (relationship instanceof MExtend) {\n MExtend extend = (MExtend) relationship;\n return extend.getBase();\n }\n if (relationship instanceof MInclude) {\n MInclude include = (MInclude) relationship;\n return nsmodel.getFacade().getAddition(include);\n }\n if (relationship instanceof MAssociationEnd) {\n return ((MAssociationEnd) relationship).getType();\n }\n return null;\n }", "public <ActivityEdgeType> T caseActivityEdgeTraversal(final ActivityEdgeTraversal<ActivityEdgeType> object)\r\n\t{\r\n\t\treturn null;\r\n\t}", "public T visitRelationshipClause(RelationshipClause elm, C context) {\n return null;\n }", "public Object getSource(Object relationship) {\n if (!(relationship instanceof MRelationship)\n\t && !(relationship instanceof MLink)\n\t && !(relationship instanceof MAssociationEnd)) {\n\n\n throw new IllegalArgumentException(\"Argument \"\n \t\t\t + relationship.toString()\n \t\t\t + \" is not \"\n\t\t\t\t\t + \"a relationship\");\n\n\t}\n if (relationship instanceof MLink) {\n\t Iterator it =\n\t nsmodel.getFacade().getConnections(relationship).iterator();\n\t if (it.hasNext()) {\n\t\treturn nsmodel.getFacade().getInstance(it.next());\n\t } \n return null;\n }\n if (relationship instanceof MAssociation) {\n MAssociation assoc = (MAssociation) relationship;\n List conns = assoc.getConnections();\n if (conns == null || conns.isEmpty()) {\n return null;\n }\n return ((MAssociationEnd) conns.get(0)).getType();\n }\n if (relationship instanceof MGeneralization) {\n MGeneralization gen = (MGeneralization) relationship;\n return gen.getChild();\n }\n if (relationship instanceof MDependency) {\n MDependency dep = (MDependency) relationship;\n Collection col = dep.getClients();\n if (col.isEmpty()) {\n return null;\n }\n return (MModelElement) (col.toArray())[0];\n }\n if (relationship instanceof MFlow) {\n MFlow flow = (MFlow) relationship;\n Collection col = flow.getSources();\n if (col.isEmpty()) {\n return null;\n }\n return (MModelElement) (col.toArray())[0];\n }\n if (relationship instanceof MExtend) {\n MExtend extend = (MExtend) relationship;\n return extend.getExtension(); // we have to follow the arrows..\n }\n if (relationship instanceof MInclude) {\n MInclude include = (MInclude) relationship;\n // we use modelfacade here to cover up for a messup in NSUML\n return nsmodel.getFacade().getBase(include);\n }\n if (relationship instanceof MAssociationEnd) {\n return ((MAssociationEnd) relationship).getAssociation();\n }\n return null;\n }", "public T caseRelationshipConfiguration(RelationshipConfiguration object) {\n\t\treturn null;\n\t}", "public T caseProcedureActivityAct(ProcedureActivityAct object) {\n\t\treturn null;\n\t}", "RelationshipOperationType getRelationshipOperation();", "public MappingRelationship getMappingRelationship();", "@Override\n public UMLDiagramType getDiagramType() {\n \treturn UMLDiagramType.ACTIVITY;\n }", "public String getRelationship(){\n DmcTypeStringSV attr = (DmcTypeStringSV) get(MetaDMSAG.__relationship);\n if (attr == null)\n return(null);\n\n return(attr.getSV());\n }", "public WFAbstractActivity getToActivity() {\r\n return this.process.getToActivity(this.id);\r\n }", "public CodeableConcept relationship() {\n return getObject(CodeableConcept.class, FhirPropertyNames.PROPERTY_RELATIONSHIP);\n }", "public ActivityObject getObject() {\n return getObject(ActivityObject.FACTORY);\n }", "public T caseFollow(Follow object) {\n\t\treturn null;\n\t}", "public T caseChemotherapyMedicationActivityPlan(ChemotherapyMedicationActivityPlan object) {\n\t\treturn null;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for checking a purchase by invoice and purchase date and returning an item within a 15 day return policy
private void ReplaceItem(Customer c) { String input; String choice; Item itemToReplace; Long invoiceNo; Invoice enteredInvoice; System.out.println("Welcome " + c.getEmail() + "!! Your invoice details are:"); showInvoices(); try { System.out.println("Enter the invoice number."); input = consoleScan.nextLine(); invoiceNo = Long.parseLong(input); if (invoices.containsKey(invoiceNo)) { System.out.println("Invoice found"); enteredInvoice = invoices.get(invoiceNo); System.out.println("Enter the itemcode of the item to replace."); input = consoleScan.nextLine(); if (itemCodes.containsKey(input)) { itemToReplace = itemCodes.get(input); long validDate = ChronoUnit.DAYS.between(enteredInvoice.getPurchaseDate(), LocalDate.now()); if (validDate >= -15) { System.out.println( "Yes, you can return your purchase. Would you like to proceed (enter y for yes or n for no.)"); choice = consoleScan.nextLine(); if (choice.equals("y")) { System.out.println("Return successful,Your replaced item is" + itemToReplace.toString()); System.out.println("Press Enter to continue"); System.in.read(); } else if (choice.equals("n")) { System.out.println("Returning back to customer menu"); displayCustMenu(); } else { System.out.println("Not valid input"); } } else { System.out.println( "Your purchase is past the 15 day period. You are not able to return or replace your item(s)"); System.out.println("Press Enter to continue"); System.in.read(); } } else { System.out.println("You dont have this item in your invoice"); } } } catch (Exception e) { System.out.println("Not a valid choice"); } }
[ "public void purchaseItem(String purchaseItem, BigDecimal amount){\n\t\tItem items = itemsMap.get(purchaseItem);\n\t\tif(items == null || items.getCount() == 0){\n\t\t\tSystem.out.println(\"Wrong item selected\");\n\t\t\treturn;\n\t\t}else{\n\t\t\tint returnVal = amount.compareTo(items.getPrice());\n\t\t\tswitch(returnVal){\n\t\t\tcase 0:\n\t\t\t\tSystem.out.println(\"Price matched, No return amount\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tMap<Denomination, Integer>changeDue = Util.getChange(amount, items.getPrice());\n\t\t\t\tfor(Denomination denomination : changeDue.keySet()) {\n\t\t System.out.println(\"Return \" + denomination + \" bill(s) : \"+ changeDue.get(denomination));\n\t\t }\n\t\t\t\tbreak;\n\t\t\tcase -1:\n\t\t\t\tSystem.out.println(\"insufficient amount. Please insert \"+\"amount\");\n\t\t\t}\n\t\t}\t\t\n\t}", "public void searchForAutoSale(){\n\t\t\n\t\tDate d = new Date();\n\t\tDate day9 = new DateTime(d).minusDays(9).toDate();\n\t\tDate day11 = new DateTime(d).minusDays(11).toDate();\n\t\t\n\t\tjava.util.List<Rental> needsLoop = new ArrayList<Rental>();\n\t\t\n\t\ttry {\n\t\t\tneedsLoop = BusinessObjectDAO.getInstance().searchForList(\"Rental\",\n\t\t\t\t\tnew SearchCriteria(\"datedue\", day9, SearchCriteria.LESS_THAN),\n\t\t\t\t\tnew SearchCriteria(\"datedue\", day11, SearchCriteria.GREATER_THAN));//returns all rentals where they have been turned in or are 10 days late and need to be charged.\n\t\t\t\n\t\t\tSystem.out.println(\"RentalEmailBatchGUI.searchForAutoSale--needsLoop.size-->\"+needsLoop.size());\n\t\t} catch (DataException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//return list of due people but less than 10 days.\n\t\tfor(Rental r : needsLoop)\n\t\t{\n\t\t\tif (r.getDateIn()==null){\n\t\t\t\t\n\t\t\t\tautoSale.add(r);\n\t\t\t\tSystem.out.println(\"r.getid\"+r.getId());\n\t\t\t\tSystem.out.println(\"r.getdatedue\"+r.getDateDue());\n\t\t\t}\n\t\t}\n\t\t\n\t\twhich = \"autoSale\";\n\t\t\n\t}", "private boolean paymentsWithinLockDate() throws Exception {\n //Check if user has the payment create permission in the first place to save time.\n if (!Security.IsAuthorized(Permissions.PaymentCreate, nowDateTime.Date))\n {\n return false;\n }\n \n List<String> warnings = new List<String>();\n for (int i = 0;i < gridMain.getSelectedIndices().Length;i++)\n {\n //Calculate what the new pay date will be.\n DateTime newPayDate = GetPayDate(PIn.Date(table.Rows[gridMain.getSelectedIndices()[i]][\"LatestPayment\"].ToString()), PIn.Date(table.Rows[gridMain.getSelectedIndices()[i]][\"DateStart\"].ToString()));\n //Test if the user can create a payment with the new pay date.\n if (!Security.isAuthorized(Permissions.PaymentCreate,newPayDate,true))\n {\n if (warnings.Count == 0)\n {\n warnings.Add(\"Lock date limitation is preventing the recurring charges from running:\");\n }\n \n warnings.Add(newPayDate.ToShortDateString() + \" - \" + table.Rows[i][\"PatNum\"].ToString() + \": \" + table.Rows[i][\"PatName\"].ToString() + \" - \" + PIn.Double(table.Rows[i][\"FamBalTotal\"].ToString()).ToString(\"c\") + \" - \" + PIn.Double(table.Rows[i][\"ChargeAmt\"].ToString()).ToString(\"c\"));\n }\n \n }\n if (warnings.Count > 0)\n {\n String msg = \"\";\n for (int i = 0;i < warnings.Count;i++)\n {\n if (i > 0)\n {\n msg += \"\\r\\n\";\n }\n \n msg += warnings[i];\n }\n //Show the warning message. This allows the user the ability to unhighlight rows or go change the date limitation.\n MessageBox.Show(msg);\n return false;\n }\n \n return true;\n }", "@Test\n public void test4findByCustomerTxnMerchantNoAndTxnLoyaltyIdAndTxnDateBetweenOrderByTxnIdDesc() throws InspireNetzException {\n Transaction transaction = TransactionFixture.standardTransaction();\n transaction = transactionService.saveTransaction(transaction);\n\n // Get the information\n Page<Transaction> searchTransaction = transactionService.searchCustomerTransaction(transaction.getTxnMerchantNo(), transaction.getTxnDate(), transaction.getTxnRewardExpDt(), constructPageSpecification(0));\n Assert.assertNotNull(searchTransaction);\n log.info(\"Transaction Info \"+searchTransaction.toString());\n\n }", "@Test\n public void isInvoiceRequired_onlyFixedItem() throws Exception {\n final int accountId = 19;\n final boolean fixedItemsOnly = true;\n final int lastYwd = CalendarStatic.getRelativeYWD(0);\n final List<BillingBean> billingList = Arrays.asList(new BillingBean());\n new Expectations() {\n @Cascading private ChildBookingService bookingServiceMock;\n @Cascading private BillingService billingServiceMock;\n @Mocked private BillingBean billing;\n {\n ChildBookingService.getInstance(); returns(bookingServiceMock);\n BillingService.getInstance(); returns(billingServiceMock);\n\n billingServiceMock.getBillingManager().getAllBillingOutstanding(accountId, lastYwd); returns(billingList);\n billing.hasBillingBits(BillingEnum.TYPE_FIXED_ITEM); result = true;\n }\n };\n boolean result = service.isInvoiceRequired(accountId, fixedItemsOnly, lastYwd);\n assertThat(result, is(true));\n }", "@Test\r\n public void testReturnToPostedInvoice() {\r\n TestChargeEditor editor1 = createInvoice(product);\r\n\r\n FinancialAct invoiceItem = getInvoiceItem(editor1);\r\n Act investigation = getInvestigation(editor1);\r\n assertEquals(ActStatus.IN_PROGRESS, investigation.getStatus());\r\n\r\n editor1.setStatus(ActStatus.POSTED);\r\n assertTrue(SaveHelper.save(editor1));\r\n\r\n FinancialAct order = createReturn(customer, patient, product, investigationType, invoiceItem, investigation);\r\n InvestigationOrderInvoicer charger1 = new TestInvestigationOrderInvoicer(order, rules);\r\n assertFalse(charger1.canCharge(editor1));\r\n }", "@Test\n void GetDiscountAmount_ShouldReturn0Discount_When1AppleisInTheBasketAndPurchaseDate1DayAfterNextMonth() {\n Basket basket = mock(Basket.class);\n List<GroceryItem> apples = new ArrayList<GroceryItem>(GenerateGroceryItemList(\"Apple\", 1, 0.10));\n when(basket.getGroceryItems()).thenReturn(apples);\n LocalDate purchaseDate = LocalDate.now().plusMonths(2).withDayOfMonth(1);\n AppleDiscount appleDiscount = GenerateAppleDiscount(basket, purchaseDate);\n\n // WHEN the discount of the items is totaled\n Double discountAmount = appleDiscount.getDiscountAmount();\n\n // THEN the discount of the apple should be zero\n assertEquals(0.00, discountAmount);\n }", "protected boolean itemHasExpired() {\n boolean condition;\n if (item.sellIn < 0) {\n condition = true;\n } else {\n condition = false;\n }\n return condition;\n }", "List<Transaction> getProfit(Date dateFrom, Date dateTo, int store, int product, int staff);", "Sale getSale(int receiptNo);", "public void checkReturnPayments(String returnId, String fromParty, String toParty, String invoiceStatus) {\n // TODO\n }", "@Test\n public void evaluatesCustomerPurchaseAndCapedServiceCharge(){\n CafeMenu menu = CafeMenu.getCafeMenu();\n\tmenu.showCafeMenu();\n\t/** create a purchase */\n\tCafePurchase purchase = new CafePurchase();\n\tpurchase.addItem(menu.getCafeMenuItem(new Long(\"2\")),new Long(\"20\"));\n\tpurchase.addItem(menu.getCafeMenuItem(new Long(\"3\")),new Long(\"20\"));\n\tpurchase.addItem(menu.getCafeMenuItem(new Long(\"4\")),new Long(\"20\"));\n\t/** read a purchase */\n\tfor(Long itemid : purchase.getPurchase().keySet()){\n\t\tCafeItem item = menu.getCafeMenuItem(itemid);\n\t\tLong itemquantity = purchase.getPurchase().get(itemid);\n\t\tSystem.out.println(\"Current purchase --- \" + item.toString() \n\t\t +\"->Quantity :\" + itemquantity\n\t\t +\"->totalPrice :\"+item.getItemCurrency()+\"\"+\n\t\titemquantity*item.getItemPrice());\n\t}\n\t/** read total purchase */\n\t\tSystem.out.println(\"Current purchase -total-\"+purchase.getTotalAsString());\n\t/** read total purchase service charge */\n\t\tSystem.out.println(\"Current service charges-\"+purchase.getServiceChargeAsString());\n\t\n assertEquals(6, 6);\n }", "public boolean projectStillNeedsInvoicing(Project p) {\n\n boolean needsInvoicing = false;\n\n if (p.getDeliveryDate() != null) {\n\n Double clientInvoiceTotal = null;\n Double invoicedSoFar = null;\n\n if (p.getProjectAmount() != null) {\n clientInvoiceTotal = p.getProjectAmount();\n } else {\n clientInvoiceTotal = new Double(0);\n }\n\n if (p.getTotalAmountInvoiced() != null && !\"\".equals(p.getTotalAmountInvoiced())) {\n invoicedSoFar = new Double(p.getTotalAmountInvoiced().replaceAll(\",\", \"\"));\n } else {\n invoicedSoFar = new Double(0);\n }\n\n double doubleClientInvoiceTotal = roundDouble(clientInvoiceTotal.doubleValue(), 2);\n double doubleInvoicedSoFar = roundDouble(invoicedSoFar.doubleValue(), 2);\n\n if (doubleClientInvoiceTotal - doubleInvoicedSoFar > 0) {\n needsInvoicing = true;\n }\n\n }\n\n return needsInvoicing;\n }", "public ArrayList<Product> checkExpiry()\n {\n LocalDate productDate;\n ArrayList<Product> expiredProducts = new ArrayList<Product>();\n for(Product product: listOfProducts)\n {\n \n productDate = convertStringToDate(product.getProductDate());\n int daysBetween = (int)(ChronoUnit.DAYS.between(productDate,today));\n \n if(daysBetween > Integer.parseInt(product.getShelfLife()))\n {\n expiredProducts.add(product);\n }\n }\n return expiredProducts;\n }", "private void makePayment(Invoice invoice) throws Exception {\n try (TenMinutEmailService email = new TenMinutEmailService()) {\n\n String emailAddress = email.getNewEmailAddress();\n logger.info(\"email address is \" + emailAddress);\n invoice.setReceiptEmail(emailAddress);\n // create invoice\n try (EssentialSession es = new EssentialSession()) {\n String invoiceNumber = es.createInvoice(invoice);\n logger.info(\"invoice number is \" + invoiceNumber);\n invoice.setInvoiceNumber(invoiceNumber);\n // get invoice email and open invoice to pay\n invoice.setInvoiceLink(email.getInvoiceLink());\n logger.info(\"online invoice link is \" + invoice.getInvoiceLink());\n\n try (IPayment payment = getPayement(invoice)) {\n\n payment.payInvoice(invoice);\n logger.info(\"invoice payment is made\");\n }\n // check invoice status\n es.verifyInvoiceStatus(invoiceNumber, \"Paid\");\n }\n }\n }", "public boolean sampledForBillItem(BillItem billItem) {\n String jpql;\n jpql = \"select pi from PatientInvestigation pi where pi.billItem=:b\";\n Map m = new HashMap();\n m.put(\"b\", billItem);\n List<PatientInvestigation> pis = getFacade().findBySQL(jpql, m);\n //System.out.println(\"pis = \" + pis);\n for (PatientInvestigation pi : pis) {\n //System.out.println(\"pi = \" + pi);\n if (pi.getCollected() == true || pi.getReceived() == true || pi.getDataEntered() == true) {\n //System.out.println(\"can not return.\" );\n return true;\n }\n }\n return false;\n }", "@Override\n public Result charge(Invoice invoice) {\n \n return new Result();\n }", "abstract void makePurchase(double amount);", "public double withdraw(double amt, Date date, String account){\n\n\n\n withdraws.add(new Withdraw(amt, date, account));\n if(account.equals(\"Checking\")){\n checkBalance = checkBalance - amt;\n checkOverdraft(amt, \"Checking\");\n return checkBalance;\n\n }else if(account.equals(\"Saving\")){\n savingBalance = savingBalance - amt;\n checkOverdraft(amt, \"Saving\");\n return savingBalance;\n }\n return 0;\n }", "public Invoice invoice(Date date){\r\n\t\t\r\n\t\tint usedExtraMintes = getSubscriptionType().getUsedExtraMinutes();\r\n\t\tdouble charges = getSubscriptionType().invoice();\r\n\t\t\r\n\t\t//See whether subscription and invoice is in same Month\r\n\t\tCalendar cOld = Calendar.getInstance();\r\n\t\tcOld.setTime(subscriptionDate);\r\n\t\tCalendar cNew = Calendar.getInstance();\r\n\t\tcNew.setTime(date);\r\n\t\tint daysOfMonth = cNew.getActualMaximum(Calendar.DAY_OF_MONTH);\r\n\t\tdouble fee = this.subscription.getBasicFee();\r\n\t\tdouble discount = 0;\r\n\t\tif((cOld.get(Calendar.MONTH) == cNew.get(Calendar.MONTH)) && (cOld.get(Calendar.YEAR) == cNew.get(Calendar.YEAR))){\r\n\t\t\t//Subscription and invoice are in the same month\r\n\t\t\tint dayDiff = cNew.get(Calendar.DATE) - cOld.get(Calendar.DATE)+1;\r\n\t\t\tdiscount = fee*(daysOfMonth-dayDiff)/daysOfMonth;\r\n\t\t} else {\r\n\t\t\tdiscount = fee*(daysOfMonth - cNew.get(Calendar.DATE))/daysOfMonth;\r\n\t\t}\r\n\t\tcharges = charges - discount;\r\n\t\t\r\n\t\tInvoice invoice = new Invoice(this, usedExtraMintes, charges, date);\r\n\t\treturn invoice;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Look over all data sets on the plot and find the maximum value displayed in the current plot window.
private double[] determineNonTimeMinDataValueCurrentlyDisplayed() { double[] minAndTime = new double[2]; minAndTime[0] = Double.MAX_VALUE; minAndTime[1] = 0; Collection<PlotDataSeries> dataSets = dataManager.dataSeries.values(); for (PlotDataSeries data: dataSets) { double[] resultForDataSet = data.getMinValue(dataManager.plot.getCurrentTimeAxisMaxAsLong(), dataManager.plot.getCurrentTimeAxisMinAsLong()); if (resultForDataSet[0] < minAndTime[0]) { minAndTime = resultForDataSet; } } if (minAndTime[0] != Double.MAX_VALUE) { return minAndTime; } else { // Data not initialized, return a default max of 1. minAndTime[0] = 1; return minAndTime; } }
[ "public double getMaxValue(int serie)\n/* */ {\n/* 916 */ boolean maximumOfOneSeries = (serie >= 0) && (serie < this.seriesCount);\n/* 917 */ boolean sampleFound = false;\n/* */ \n/* */ \n/* 920 */ double max = -1.7976931348623157E308D;\n/* 921 */ if (maximumOfOneSeries) {\n/* 922 */ for (int i = 0; i < this.sampleCount; i++) {\n/* 923 */ ChartSample sample = this.data[serie][i];\n/* 924 */ if ((sample != null) && (sample.value != null) && (!sample.value.isNaN())) {\n/* 925 */ max = Math.max(max, sample.getFloatValue());\n/* 926 */ sampleFound = true;\n/* */ }\n/* */ \n/* */ }\n/* */ \n/* */ }\n/* */ else {\n/* 933 */ for (int i = 0; i < this.seriesCount; i++) {\n/* 934 */ for (int j = 0; j < this.sampleCount; j++) {\n/* 935 */ ChartSample sample = this.data[i][j];\n/* 936 */ if ((sample != null) && (sample.value != null) && (!sample.value.isNaN())) {\n/* 937 */ max = Math.max(max, sample.getFloatValue());\n/* 938 */ sampleFound = true;\n/* */ }\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 946 */ if (sampleFound) {\n/* 947 */ return max;\n/* */ }\n/* 949 */ return 0.0D;\n/* */ }", "public double getMax() {\n\t\tdouble max = Double.MIN_VALUE;\n\t\tfor(ArrayList<Double> line : data) {\n\t\t\tfor(double values : line) {\n\t\t\t\tif(values > max) {\n\t\t\t\t\tmax = values;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn(max);\n\t}", "private void findDataExtremes() {\n dataMinX = Double.POSITIVE_INFINITY;\n dataMaxX = Double.NEGATIVE_INFINITY;\n dataMinY = Double.POSITIVE_INFINITY;\n dataMaxY = Double.NEGATIVE_INFINITY;\n for (GraphModel model : models) {\n for (int index = 0; index < model.getPointCount(); index++) {\n double x = model.getX(index);\n double y = model.getY(index);\n if (x < dataMinX)\n dataMinX = x;\n if (x > dataMaxX)\n dataMaxX = x;\n if (y < dataMinY)\n dataMinY = y;\n if (y > dataMaxY)\n dataMaxY = y;\n }\n }\n }", "public static Number getMaximumRangeValue(DataSource data) {\r\n\r\n if (data instanceof RangeInfo) {\r\n RangeInfo info = (RangeInfo)data;\r\n return info.getMaximumRangeValue();\r\n }\r\n else if (data instanceof CategoryDataSource) {\r\n\r\n // hasn't implemented RangeInfo, so we'll have to iterate...\r\n CategoryDataSource categoryData = (CategoryDataSource)data;\r\n double maximum = Double.MIN_VALUE;\r\n int seriesCount = categoryData.getSeriesCount();\r\n for (int seriesIndex=0; seriesIndex<seriesCount; seriesIndex++) {\r\n Iterator iterator = categoryData.getCategories().iterator();\r\n while (iterator.hasNext()) {\r\n Object category = iterator.next();\r\n Number value = categoryData.getValue(seriesIndex, category);\r\n if (value.doubleValue()>maximum) {\r\n maximum = value.doubleValue();\r\n }\r\n }\r\n }\r\n return new Double(maximum);\r\n\r\n }\r\n else if (data instanceof XYDataSource) {\r\n\r\n // hasn't implemented RangeInfo, so we'll have to iterate...\r\n XYDataSource xyData = (XYDataSource)data;\r\n double maximum = Double.MIN_VALUE;\r\n int seriesCount = xyData.getSeriesCount();\r\n for (int seriesIndex=0; seriesIndex<seriesCount; seriesIndex++) {\r\n int itemCount = xyData.getItemCount(seriesIndex);\r\n for (int itemIndex=0; itemIndex<itemCount; itemIndex++) {\r\n Number value = xyData.getYValue(seriesIndex, itemIndex);\r\n if (value.doubleValue()>maximum) {\r\n maximum = value.doubleValue();\r\n }\r\n }\r\n }\r\n return new Double(maximum);\r\n\r\n }\r\n else return null;\r\n\r\n }", "private void initViewMaxChart() {\n CombinedChart maxChart = findViewById(R.id.combined_chart_max);\n maxChart.getDescription().setEnabled(false);\n maxChart.setBackgroundColor(Color.WHITE);\n maxChart.setDrawGridBackground(true);\n maxChart.setDrawBarShadow(false);\n maxChart.setHighlightFullBarEnabled(false);\n maxChart.setOnChartValueSelectedListener(this);\n\n YAxis rightAxis = maxChart.getAxisRight();\n rightAxis.setDrawGridLines(false);\n rightAxis.setAxisMinimum(80f);\n\n YAxis leftAxis = maxChart.getAxisLeft();\n leftAxis.setDrawGridLines(false);\n leftAxis.setAxisMinimum(80f);\n\n final List<String> xLabel = new ArrayList<>();\n for (int i = listPressure.size() - 1; i >= 0; i--) {\n xLabel.add(listPressure.get(i).getBloodPressureId() + Constant.EMPTY);\n }\n XAxis xAxis = maxChart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n xAxis.setAxisMinimum(0f);\n xAxis.setGranularity(1f);\n xAxis.setValueFormatter(new IAxisValueFormatter() {\n @Override\n public String getFormattedValue(float value, AxisBase axis) {\n return xLabel.get((int) value % xLabel.size());\n }\n });\n\n CombinedData dataMax = new CombinedData();\n LineData lineDatasMax = new LineData();\n lineDatasMax.addDataSet((ILineDataSet) dataChartMax());\n dataMax.setData(lineDatasMax);\n xAxis.setAxisMaximum(dataMax.getXMax() + 0.25f);\n maxChart.setData(dataMax);\n maxChart.invalidate();\n\n\n }", "public void maximize() {\n currentSample = null; // invalidate cached values\n // enumerate instances\n int docIndex = 0;\n for (DatasetInstance instance : data) {\n maximizeY(docIndex, instance.asFeatureVector());\n ++docIndex;\n }\n }", "@Override\n public DataValueDescriptor maxValue() {\n return quantilesSketch.getMaxValue();\n }", "public String getMaxData1Chart() {\r\n return maxData1Chart;\r\n }", "public void getMaximum()\n\t{\n\t\tint maximum; \t\t\t\t//To hold the highest number in the array.\n\t\tmaximum = numbers[0]; \t//Get the first number in the array\n\n\t\t//Step through the rest of the array\n\t\t//when a number greater than maximum is found\n\t\t//assign it to maximum.\n\t\tfor(int index = 1; index < numbers.length; index++)\n\t\t{\n\t\t\tif(numbers[index] > maximum)\n\t\t\t{\n\t\t\t\tmaximum = numbers[index];\n\t\t\t}\n\t\t}\n\n\t\t//Display the maximum in the message text field\n\t\tmessageTxtField.setText(\"MAX = \" + maximum);\n\n\t}", "public final float max() {\n\t\tfloat p;\n\t\tfloat max = Short.MIN_VALUE;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tp = data[y][x];\n\t\t\t\tif (p > max)\n\t\t\t\t\tmax = p;\n\t\t\t}\n\t\t}\n\t\treturn (float) max;\n\t}", "protected double getMaximumValue() {\n\t\treturn this.statistics.getMax();\n\t}", "public E getMax() {\n if (countItems > 0) {\n E max = data[0];\n for (int i = 1; i < countItems; i++) {\n max = BestDataContainer2.getMax(max, (E) data[i]);\n }\n return max;\n } else if (countItems == 0) {\n return data[0];\n }\n return null;\n }", "Value findMax();", "private void setMaximumPlots(int maxPlots) {\n\n int maxItemAge = (1000 / frequency) * maxPlots;\n\n for (int i = 0; i < channelNumber; i++) {\n metricValues[i].setMaximumItemAge(maxItemAge);\n }\n }", "public double[] getMax()\r\n/* 145: */ {\r\n/* 146:276 */ return getResults(this.maxImpl);\r\n/* 147: */ }", "protected Double getMaxMax(String key)\n\t{\n\n\t\tDouble max = -9999999999.0;\n\n\t\tfor (ChartDataPack pack : chartDataPacks)\n\t\t{\n\t\t\tDouble currMax = pack.getChartStatMap().get(key).getMax();\n\t\t\tif (currMax == null)\n\t\t\t\tcontinue;\n\n\t\t\tif (currMax > max)\n\t\t\t{\n\t\t\t\tmax = currMax;\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public Float getValueMax() {\n return this.ValueMax;\n }", "public boolean isMaxMeasuredValueVisible() {\n return model.isMaxMeasuredValueVisible();\n }", "float getMaximumValue();", "public void findMax() {\n if (array==null){\n System.out.println(\"Pyramide do not exist\");\n }\n else {\n Node root = getRoot();\n\n int pathLength = findMaxPath();\n if (!(pathLength == array.length)) {\n System.out.println( \"Max sum can't count, becouse way to the bottom of Pyramid don't exist\" );\n\n } else {\n long maxsum = findMaxUtil( root, pathLength );\n getPath( root, maxsum );\n System.out.println( \"Max sum is = \" + maxsum );\n printList();\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A round is over. Calculate pot/side pot
public void procRoundOver() { PokerPresence[] actives = activePlayers(); PokerPresence[] allin = allInsNotAdjustedPlayers(marker().pos()); PokerPresence[] folded = foldedPlayers(marker().pos()); if (allin == null || allin.length == 0) { // NO ALL IN PLAYERS // Collect the money from folded players for (int i = 0; folded != null && i < folded.length; i++) { if (_currentPot != null) { _cat.finest("Betting round is preflop " + (_bettingRound == R_PREFLOP)); if (_bettingRound == R_PREFLOP) { _currentPot.addUnCalledBet(folded[i].currentRoundBet()); } else { _currentPot.addVal(folded[i].currentRoundBet()); } _cat.finest("Folding player " + folded[i] + "\nPot " + _currentPot); } for (int j = 0; j < _pots.size(); j++) { // removing him from all pots ((Pot) _pots.get(j)).remove(folded[i]); } folded[i].resetRoundBet(); folded[i].setGameEndWorth(); } // END Collect money from folded players double roundAmt = 0; for (int i = 0; actives !=null && i < actives.length; i++) { roundAmt += actives[i].currentRoundBet(); _cat.finest(actives[i] + ", Round bet " + actives[i].currentRoundBet() +" , Total = " + roundAmt); } // reset the current Round Bet _currentRoundBet = 0; if (_currentPot != null) { if (_bettingRound == R_PREFLOP) { _currentPot.addUnCalledBet(roundAmt); _cat.finest("Pre flop " + roundAmt); } else { if (_uncalledBet) { _currentPot.addUnCalledBet(roundAmt); _cat.finest("addUnCalledBet " + roundAmt); } else if (_uncalledRaise) { //called amount to be raked, uncalled amount not _cat.finest("uncalledRaise amt " + _call_amount + ", BetValue=" + roundAmt); _currentPot.addUnCalledBet(_call_amount); _currentPot.addVal(roundAmt - _call_amount); } else { _currentPot.addVal(roundAmt); } } _table.commitTotalBet(_players); _cat.finest(_currentPot.toString()); // Charge the players required amount } return; } // END NO ALL IN PLAYERS if ((actives == null && actives.length ==0 ) && (allin != null && allin.length == 1)) { // ONE ALL IN PLAYERS AND REST FOLDED for (int i = 0; i < allin.length; i++) { _cat.finest("Allins game ends=" + allin[i]); } double calledBet=0; // Collect the money from folded players for (int i = 0; folded != null && i < folded.length; i++) { if (_currentPot != null) { _cat.finest("Betting round is preflop " + (_bettingRound == R_PREFLOP)); if (_bettingRound == R_PREFLOP) { _currentPot.addUnCalledBet(folded[i].currentRoundBet()); } else { _currentPot.addVal(folded[i].currentRoundBet()); } if (calledBet < folded[i].currentRoundBet()){ calledBet = folded[i].currentRoundBet(); } _cat.finest("Folding player " + folded[i] + "Pot " + _currentPot); } for (int j = 0; j < _pots.size(); j++) { // removing him from all pots ((Pot) _pots.get(j)).remove(folded[i]); } folded[i].resetRoundBet(); folded[i].setGameEndWorth(); } // END Collect money from folded players _cat.finest("Called Bet " + calledBet); if (allin.length == 1){ //deduct the called bet from the allin player and send rest to the pot _currentPot.addVal(calledBet); _currentPot.addUnCalledBet(allin[0].currentRoundBet() - calledBet); } else { calledBet = allin[0].currentRoundBet(); for (int i = 0; i < allin.length; i++) { if (calledBet > allin[i].currentRoundBet()){ calledBet = allin[i].currentRoundBet(); } } // add the calledBet to the pot as raked for (int i = 0; i < allin.length; i++) { if (calledBet >= allin[i].currentRoundBet()){ _currentPot.addVal(allin[i].currentRoundBet()); } else { _currentPot.addVal(calledBet); _currentPot.addUnCalledBet(allin[i].currentRoundBet() - calledBet); } } } // reset the current Round Bet _currentRoundBet = 0; return; } // END ONE ALL IN PLAYERS else { // sort the all-in players in ascending order of their all-in amount java.util.Arrays.sort(allin, new Comparator() { public int compare(Object o1, Object o2) { return (int) (((PokerPresence) o1).currentRoundBet() * 100 - ((PokerPresence) o2).currentRoundBet() * 100); } }); for (int i = 0; i < allin.length; i++) { _cat.finest("CRB=" + allin[i].currentRoundBet() + " name =" +allin[i].name()); } double totalAllIn = 0; ArrayList allInPots = new ArrayList(); double amt = 0; /** * Create as many pot as there were different current round bets */ for (int i = 0, start = 0; i < allin.length; i++, start = i) { while (i < allin.length - 1 && allin[i].currentRoundBet() == allin[i + 1].currentRoundBet()) { _cat.finest(allin[i].currentRoundBet() + ", " + allin[i] + " allin equals " + allin[i + 1]); ++i; } amt = allin[i].currentRoundBet() - totalAllIn; _cat.finest("amount of all-ins = " + amt + ", prev allin level = " + totalAllIn + ", ALLINCRB=" + allin[i].currentRoundBet()); if (amt < -0.01) { _cat.log(Level.WARNING, "CRB < TALL_IN" + amt + " gid/grid " + name() + "/" + grid()); } Pot p = new Pot((_pots.size() - 1 + allInPots.size()) == 0 ? "main" : "side-" + (_pots.size() - 1 + allInPots.size()), _rakePercent, _validMaxRake, this); // add all-in players as pot contender for (int j = i; j >= start; j--) { _cat.finest(amt + " adding all-in " + allin[j]); p.addContender(allin[j], amt); } // add higher all-ins also for (int j = i + 1; j < allin.length; j++) { _cat.finest(amt + " adding higher all-ins " + allin[j]); p.addContender(allin[j], amt); } // add all the active players as pot contender for (int j = 0; j < actives.length; j++) { _cat.finest(amt + " adding actives " + actives[j]); p.addContender(actives[j], amt); } // add folded players as pot contender if the bet allows that for (int k = 0; k < folded.length; k++) { _cat.finest(amt + " adding folded " + folded[k]); // remove the required bet from this folded player double required_amount = folded[k].currentRoundBet() - totalAllIn; _cat.finest("Required amount" + required_amount + ", Amount=" + amt + ", Folded player CRB=" + folded[k].currentRoundBet()); double amt_added; if (required_amount > amt) { amt_added = amt; } else if (required_amount > 0) { amt_added = required_amount; } else { amt_added = 0; } _cat.finest(folded[k].currentRoundBet() + ", " + amt_added); p.addVal(amt_added); } _cat.finest("POT==" + p); allInPots.add(p); totalAllIn += amt; } // reset all ins for (int i = 0; i < allin.length; i++) { allin[i].setAllInAdjusted(); } /** * Create new main pot active pot */ Pot mainPot = new Pot("side-" + (_pots.size() - 1 + allInPots.size()), _rakePercent, _validMaxRake, this); // create a new side pot // add active players as contender for main pot _cat.finest("Current Rnd Bet " + this._currentRoundBet); for (int j = 0; j < actives.length; j++) { _cat.finest(actives[j] + ", " + actives[j].currentRoundBet()); mainPot.addContender(actives[j], actives[j].currentRoundBet() - totalAllIn); } // add money from folded players to the main pot for (int k = 0; k < folded.length; k++) { _cat.finest(folded[k] + ", " + folded[k].currentRoundBet()); // remove the required bet from this folded player if (folded[k].currentRoundBet() > totalAllIn) { mainPot.addVal(folded[k].currentRoundBet() - totalAllIn); } } _cat.finest("Main pot " + mainPot); /** * Add the value of current pot to the first all-in */ Pot firstAllInPot = (Pot) allInPots.get(0); firstAllInPot.addPot(_currentPot); // contenders are same _cat.finest("First all in pot " + firstAllInPot); // add the all in pots _pots.addAll(allInPots); // set the current pot and add it to _pots _pots.remove(_currentPot); _currentPot = mainPot; _pots.add(_currentPot); // _table.commitTotalBet(_players); _currentRoundBet = 0; /* Main pot has been split and side pots have been created. A side pot is associated with players who have contributed towards it. After this association player bets in the game are committed. */ //Iterator i = _pots.iterator(); //while (i.hasNext()) { //_cat.finest("POTS=" + i.next()); //} } }
[ "double getPot();", "private int getMoneyPot() {\r\n return playerManager.getPlayer(m_botAction.getBotName(), false).getMoney();\r\n }", "public double getPot() {\n return pot;\n }", "private void roundOver()\n {\n while( player2.getPoints() <= 16 )\n {\n P2Round();\n }\n\n writer.toggleStandButton( false );\n writer.toggleHitButton( false );\n writer.toggleP2CardsPointsLabel( true, player2.getPoints() );\n\n showWhoWon();\n\n player1.resetPoints();\n player1.resetCards();\n player2.resetPoints();\n player2.resetCards();\n\n writer.toggleP1CardsPointsLabel( false, player1.getPoints() );\n writer.toggleP2CardsPointsLabel( false, player2.getPoints() );\n\n currentTurn++;\n\n /*\n try\n {\n Thread.sleep(1000 );\n }\n catch( InterruptedException ex )\n {\n Thread.currentThread().interrupt();\n }\n */\n\n if( player1.getCredit() != 0 && player2.getCredit() != 0 )\n {\n if( ( currentTurn % 2 ) == 0 )\n {\n askP1ForBet();\n }\n else\n {\n askP2ForBet();\n }\n }\n else\n {\n gameFinished();\n }\n }", "public void calcWhip(){\r\n if (inningsPitched > 0){\r\n whip = (double)(walks + hits) / inningsPitched * 3;\r\n }else{\r\n whip = 0;\r\n }\r\n }", "public int getChipsToRaise() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(99) + 1;\n\t\tint bet = 0;\n\n\t\tif (chips == 0) { // No chips to bet\n\t\t\tinHand = false;\n\t\t\treturn 0;\n\t\t}\n\t\telse if(this.playerHand.getGameValue() >= HandOfCards.FULL_HOUSE){\n\t\t\t//if hand is very strong bet half of bank (70 percent of the time)\n\t\t\tif(num > 30){\n\t\t\t\tbet = chips/2;\n\t\t\t\tchips -= bet;\n\t\t\t\treturn bet; \t\t\n\t\t\t}\n\t\t\t//30 percent of the time just bet 5 to not scare the other players\n\t\t\telse{\n\t\t\t\tif(chips < LARGE_BET){\n\t\t\t\t\tbet = chips;\n\t\t\t\t\tchips = 0;\n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbet = LARGE_BET;\n\t\t\t\t\tchips -= bet; \n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(this.playerHand.getGameValue() >= HandOfCards.THREE_OF_A_KIND){\n\t\t\t//if hand is very strong bet 1/3 of bank (60 percent of the time)\n\t\t\tif(num > 40){\n\t\t\t\tbet = chips/3;\n\t\t\t\tchips -= bet;\n\t\t\t\treturn bet; \t\t\n\t\t\t}\n\t\t\t//10 percent of the time simply check\n\t\t\telse if(num > 30){\n\t\t\t\treturn 0;\n\n\t\t\t}\n\t\t\t//30 percent of the time just bet 5 to not scare the other players\n\t\t\telse{\n\t\t\t\tif(chips < MEDIUM_BET){\n\t\t\t\t\tbet = chips;\n\t\t\t\t\tchips = 0;\n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbet = MEDIUM_BET;\n\t\t\t\t\tchips -= bet; \n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(this.playerHand.getGameValue() >= HandOfCards.ONE_PAIR){\n\t\t\t//if hand is very strong bet 1/4 of bank (70 percent of the time)\n\t\t\tif(num > 60){\n\t\t\t\tbet = chips/4;\n\t\t\t\tchips -= bet;\n\t\t\t\treturn bet; \t\t\n\t\t\t}\n\t\t\t//50 percent of the time simply check\n\t\t\telse if(num > 10){\n\t\t\t\treturn 0;\n\n\t\t\t}\n\t\t\t//30 percent of the time just bet 2 to not scare the other players\n\t\t\telse{\n\t\t\t\tif(chips<SMALL_BET){\n\t\t\t\t\tbet = chips;\n\t\t\t\t\tchips = 0;\n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbet = SMALL_BET;\n\t\t\t\t\tchips -= SMALL_BET; \n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//if hand is very strong bet 1/4 of bank (70 percent of the time)\n\t\t\tif(num > 95){\n\t\t\t\tbet = chips/8;\n\t\t\t\tchips -= bet;\n\t\t\t\treturn bet; \t\t\n\t\t\t}\n\t\t\telse if(num > 5){\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t//70 percent of the time just check\n\t\t\telse{\n\t\t\t\tif(chips<SMALL_BET){\n\t\t\t\t\tbet = chips;\n\t\t\t\t\tchips = 0;\n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbet = SMALL_BET;\n\t\t\t\t\tchips -= bet; \n\t\t\t\t\treturn bet;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean updatePot() {\n\t\tgamePotLabel.setText(\"$\" + clientRequest.getPot(TABLE));\n\t\treturn clientRequest.clientNeedsGameFrameUpdate();\n\t}", "private int calculatePrice() {\n\n toppings = 0;\n\n if(whippedCream){\n toppings += quantity * 1;\n }\n\n if(chocolate){\n toppings += quantity * 2;\n }\n\n price = quantity * perCup + toppings;\n return price;\n }", "public void printPot(){\n System.out.println(\"The pot currently contains £\" + this.getPot());\n }", "public synchronized int getPotsTotal() {\n int total = 0;\n for (Pot p : pots) {\n total += p.getPotTotal();\n }\n return total;\n }", "public double play(double wager)\r\n\t{\r\n\t\tslot1 = rollSlot();\r\n\t\tslot2 = rollSlot();\r\n\t\tslot3 = rollSlot();\r\n\t\tSystem.out.println(toString());\r\n\t\treturn super.calcWinnings(calcMultiplier());\r\n\t}", "int whoWon()\n {\n if (this.pot==0 && this.player1%2==0){\n return 1;\n }\n else if (this.pot==0 && this.player2%2==0){\n return 2;\n }\n else{\n return 0;\n }\n }", "private void playerWins(){\n //Shortening time - increase in difficulty\n gameTime = gameTime - 1 * 1000;\n //Increasing the round number\n numberOfRounds();\n //Calculating the point to add after winning a round\n countPoints();\n //Reseting the game\n resetGame();\n //Starting new round\n initGameLogic();\n }", "public void calculateToll()\r\n {\r\n double vehToll = 0.00;\r\n double trailerToll = 0.00;\r\n double passengerToll = 0.00;\r\n\r\n vehToll = calcVehicleToll();\r\n trailerToll = calcTrailerToll();\r\n passengerToll = calcPassengers();\r\n\r\n printToll(vehToll, trailerToll, passengerToll);\r\n }", "public boolean speedCalcPVP(Armor arm, Weapon wep, Person pers)\n {\n int avoidness = arm.getStatmovement() + pers.getPersonspeed() - wep.getWepaccuracy() + ((int) (Math.random() * 30) - 15);\n int cooficient = avoidness / 20;\n if (cooficient < 2)\n {\n cooficient = 2;\n }\n int i = (int) (Math.random() * 10);\n if (i < cooficient)\n {\n System.out.println(pers.getPersonname() + \" avoid this hit!!!\");\n return false; // false if missed\n\n\n } else return true;\n\n }", "public double getPoidsVoiture(){\n return (moteur.getPoidsMoteur() + caros.getPoidsCar());\n }", "public boolean consumePotion(){\n if(character.getCurrHP() <= 30 && character.getPotions() >= 2){\n character.usePotion();\n character.usePotion();\n System.out.println(\"Consuming two pots\");\n return true;\n } else if (character.getCurrHP() <= 60 && character.getPotions() >= 1){\n character.usePotion();\n System.out.println(\"Consuming one pot\");\n return true;\n }\n return false;\n }", "public void getWinnerPVP(){\r\n\tif(Player1.getGuess().equalsIgnoreCase(\"rock\") && Player2.getGuess().equalsIgnoreCase(\"paper\")){\r\n Player2.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player two wins the round!\");\r\n } else if(Player1.getGuess().equalsIgnoreCase(\"paper\") && Player2.getGuess().equalsIgnoreCase(\"scissors\")){\r\n Player2.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player two wins the round!\");\r\n } else if(Player1.getGuess().equalsIgnoreCase(\"scissors\") && Player2.getGuess().equalsIgnoreCase(\"rock\")){\r\n Player2.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player two wins the round!\");\r\n } else if(Player1.getGuess().equalsIgnoreCase(\"paper\") && Player2.getGuess().equalsIgnoreCase(\"rock\")){\r\n Player1.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player one wins the round!\");\r\n } else if(Player1.getGuess().equalsIgnoreCase(\"scissors\") && Player2.getGuess().equalsIgnoreCase(\"paper\")){\r\n Player1.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player one wins the round!\");\r\n } else if(Player1.getGuess().equalsIgnoreCase(\"rock\") && Player2.getGuess().equalsIgnoreCase(\"scissors\")){\r\n Player1.increment();\r\n JOP.msg(\"Player choose: \" + Player1.getGuess() + \" Player two choose: \" + Player2.getGuess() + \". Player one wins the round!\");\r\n } else{\r\n JOP.msg(\"It's a tie!.\");\r\n }\r\n if(Player1.getScore() >= 2){\r\n Player2.resetHighScore();\r\n Player2.resetRoundScore();\r\n Player1.resetRoundScore();\r\n Player1.incrementHighScore();\r\n JOP.msg(\"Player one wins the game!\");\r\n \r\n running = false;\r\n }\r\n if(Player2.getScore() >= 2){\r\n Player1.resetHighScore();\r\n Player1.resetRoundScore();\r\n Player2.resetRoundScore();\r\n Player2.incrementHighScore();\r\n JOP.msg(\"Player two wins the game!\");\r\n running = false;\r\n }\r\n}", "public double calcVehicleToll()\r\n {\r\n int axles = 0;\r\n double vehToll = 0.00;\r\n axles = getVehAxles();\r\n\r\n if (axles == 2)\r\n {\r\n vehToll = twoVehAxles;\r\n }\r\n else if (axles == 3)\r\n {\r\n vehToll = threeVehAxles;\r\n }\r\n else if (axles == 4)\r\n {\r\n vehToll = fourVehAxles;\r\n }\r\n else if (axles >= 5)\r\n {\r\n vehToll = fiveVehAxles;\r\n }\r\n\r\n return vehToll;\r\n }", "public int BetRound(int currentPlayer, Text pltext, Text optext)\n\t{\n\t\tif(this.NotFolded() <= 1) //Check if number of folds enough to skip betting\n\t\t{\n\t\t\treturn currentPlayer;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"==========START_BET_ROUND==========\");\n\t\tint StopHere = currentPlayer; //Stop on this player once the loop cycles around\n\t\tint turn = currentPlayer; //Player is current going\n\t\tint minimumBet; //Smallest bet player can choose\n\t\tint input; //Used to store user/ai input\n\t\tint maxBet; //used to define maximum bet\n\t\tboolean PowerupFlag = false; //Flag used to repeat turns when Powerups are played\n\t\t//Scanner Takebet;\n\t\t\n\t\tTextInputDialog dialog = new TextInputDialog(\"\");\n\t\t\n//\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n//\t\talert.setTitle(\"Confirmation Dialog with Custom Actions\");\n//\t\talert.setHeaderText(\"Look, a Confirmation Dialog with Custom Actions\");\n//\t\talert.setContentText(\"Choose your option.\");\n//\t\t\n//\t\tButtonType buttonTypeOne = new ButtonType(\"Raise\");\n//\t\tButtonType buttonTypeTwo = new ButtonType(\"Call/Check\");\n//\t\tButtonType buttonTypeThree = new ButtonType(\"Fold\");\n//\t\tButtonType buttonTypeFour = new ButtonType(\"Power-ups\");\n//\t\tButtonType buttonTypeFive = new ButtonType(\"Quit\");\n//\t\talert.getButtonTypes().setAll(buttonTypeOne, buttonTypeTwo, buttonTypeThree, buttonTypeFour, buttonTypeFive);\n//\t\t \n//\t\tOptional<ButtonType> resultButton = alert.showAndWait();\n\t\t\n\t\t\n\t\tdo\n\t\t{\n\t\t\tif(turn != -1) //if both players fold this prevents crash\n\t\t\t{\n\t\t\t PowerupFlag = false;\n\t\t\t minimumBet = betAmounts[this.GetLastPlayer(turn)] - betAmounts[turn];\n\t\t\t maxBet = this.GetMaxBet();\n\t\t\t if(minimumBet < 0) minimumBet = 0; //prevent negative minimums\n\t\t\t if(maxBet < minimumBet) //Prevent minBet from being higher than maxBet\n\t\t\t {\n\t\t\t\t minimumBet = maxBet;\n\t\t\t }\n\n\t\t\t if(players[turn].is_ai() == false)\n\t\t\t {\n//\t\t\t\t System.out.println(\"Minimum Bet is $\" + minimumBet);\n//\t\t\t\t System.out.println(\"Maximum Bet is $\" + maxBet);\n//\t\t\t\t System.out.println(\"This round you have bet $\" + betAmounts[turn]);\n//\t\t\t\t System.out.println(\"Amount left in wallet $\" + (players[turn].GetWallet() - betAmounts[turn]));\n\t\t\t }\n\t\t\t input = this.BetMenu(turn,players[turn]);\n\t\t\t switch(input)\n\t\t\t {\n\t\t\t case 1:\n\t\t\t\t if(players[turn].is_ai())\n\t\t\t\t {\n\t\t\t\t\t if(minimumBet == maxBet) input = minimumBet;\n\t\t\t\t\t else input = ThreadLocalRandom.current().nextInt(minimumBet, (maxBet + 1)/2);\n\t\t\t\t\t betAmounts[turn] += input;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t do \n\t\t\t\t\t {\n\t\t\t\t\t\t //dialog.show();\n\t\t\t\t\t\t \n\t\t\t\t\t\t //Alert betInfo = new Alert(AlertType.INFORMATION);\n\t\t\t\t\t\t dialog.setTitle(\"Betting Information\");\n\t\t\t\t\t\t dialog.setHeaderText(\"Please enter your bet amount.\");\n\t\t\t\t\t\t dialog.setContentText(\"Minimum Bet is $\" + minimumBet + \"\\nMaximum Bet is $\" + maxBet + \"\\nThis round you have bet $\" + betAmounts[turn] + \"\\nAmount left in wallet $\" + (players[turn].GetWallet() - betAmounts[turn]));\n\t\t\t\t\t\t //betInfo.show();\n\t\t\t\t\t\t \n\t\t\t\t\t\t Optional<String> result = dialog.showAndWait();\n\t\t\t\t\t\t input = Integer.valueOf(result.get());\n\t\t\t\t\t\t \n\t\t\t\t\t\t //Optional<String> betInputOptional = dialog.showAndWait();\n\t\t\t\t\t\t //betInput = Integer.parseInt(betInputOptional.get());\n\t\t\t\t\t\t \n\t\t\t\t\t\t //SCANNER FOR TAKING USER RAISE\n\t\t\t\t\t\t //System.out.println(\"How much do you want to bet?\" );\n\t\t\t\t\t\t //Takebet = new Scanner(System.in);\n\t\t\t\t\t\t //if(Takebet.hasNextInt())\n\t\t\t\t\t\t //\t input = Takebet.nextInt();\n\t\t\t\t\t\t \n\t\t\t\t\t }while(input < minimumBet || input > maxBet);\n\t\t\t\t\t betAmounts[turn] += input;\n\t\t\t\t }\n\t\t\t\t System.out.println(players[turn].getName() + \" has bet $\" + input );\n\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" has bet $\" + input);\n\t\t\t\t else optext.setText(players[turn].getName() + \" has bet $\" + input);\n\t\t\t\t StopHere = turn;\n\t\t\t\t break;\n\t\t\t case 2:\n\t\t\t\t if(minimumBet < 0)\n\t\t\t\t {\n\t\t\t\t\t minimumBet = 0; //prevent negative betting\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t betAmounts[turn] += minimumBet; \n\t\t\t\t }\n\t\t\t\t System.out.println(players[turn].getName() + \" has called with $\" + minimumBet );\n\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" has called with $\" + minimumBet);\n\t\t\t\t else optext.setText(players[turn].getName() + \" has called with $\" + minimumBet);\n\t\t\t\t break;\n\t\t\t case 3:\n\t\t\t\t System.out.println(players[turn].getName() + \" has folded!\");\n\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" has folded!\");\n\t\t\t\t else optext.setText(players[turn].getName() + \" has folded!\");\n\t\t\t\t players[turn].setFold(true);\n\t\t\t\t if(StopHere == turn)\n\t\t\t\t {\n\t\t\t\t\t StopHere = this.GetNextPlayer(turn); \n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 4:\n\t\t\t\t input = this.playPowerup(turn);\n\t\t\t\t if(input == -1)\n\t\t\t\t {\n\t\t\t\t\t System.out.println(players[turn].getName() + \" doesn't have any power-ups to play!\");\n\t\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" doesn't have any power-ups to play!\");\n\t\t\t\t\t else optext.setText(players[turn].getName() + \" doesn't have any power-ups to play!\");\n\t\t\t\t\t PowerupFlag = true;\n\t\t\t\t }\n\t\t\t\t else if(input == 7) //Check for revive\n\t\t\t\t {\n\t\t\t\t\t System.out.println(players[turn].getName() + \" has showed their revive power-up!\"); \n\t\t\t\t\t if(turn==0) pltext.setText(players[turn].getName() + \" has showed their revive power-up!\");\n\t\t\t\t\t else optext.setText(players[turn].getName() + \" has showed their revive power-up!\");\n\t\t\t\t\t PowerupFlag = true;\n\t\t\t\t }\n\t\t\t\t else if(input == 5) //Check for free call\n\t\t\t\t {\n\t\t\t\t\t betAmounts[turn] += minimumBet;\n\t\t\t\t\t players[turn].addWallet(minimumBet);\n\t\t\t\t\t PowerupFlag = false;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t System.out.println(players[turn].getName() + \" has played power-up \" + powerups[turn].getValue_S());\n\t\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" has played power-up \" + powerups[turn].getValue_S());\n\t\t\t\t\t else optext.setText(players[turn].getName() + \" has played power-up \" + powerups[turn].getValue_S());\n\t\t\t\t\t powerups[turn] = new Card(0,0);\n\t\t\t\t\t PowerupFlag = true;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 5:\n\t\t\t\t System.out.println(players[turn].getName() + \" has quit!\");\n\t\t\t\t if(turn == 0) pltext.setText(players[turn].getName() + \" has quit!\");\n\t\t\t\t else optext.setText(players[turn].getName() + \" has quit!\");\n\t\t\t\t System.exit(0);\n\t\t\t\t break;\n\t\t\t default:\n\t\t\t\t System.out.println(\"INVALID INPUT\");\n\t\t\t\t if(turn == 0) pltext.setText(\"INVALID INPUT\");\n\t\t\t\t else optext.setText(\"NVALID INPUT\");\n\t\t\t\t break;\n\t\t\t }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tStopHere = -1; //both players have folded so terminate loop\n\t\t\t}\n\t\tif(PowerupFlag == false)\n\t\t{\n\t\t\tturn = this.GetNextPlayer(turn);\n\t\t}\n\t\tSystem.out.println(\"----------------------------------------\");\n\t\t}while(StopHere != turn);\n\t\t\n\t\treturn turn;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public boolean isCredentialsNonExpired() { return true; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
System.out.println("+ " + srcFile);
public void md2class(File srcFile, File destFile) { try { // System.out.println("parent: " + destFile.getParent()); if (destFile.getParent().endsWith("ui")) { // Vygenerovat přes Velocity šablonu. ClassDefs c = null; List<String> lines = Files.readAllLines(Paths.get(srcFile.getPath())); boolean start = false; FieldDefs fld = null; Map<String, FieldDefs> reg = new TreeMap<>(); String comment = ""; for (String line : lines) { if (line.startsWith("# ")) { String className = line.replaceAll("# kendo.ui.", ""); if (!className.isEmpty()) { c = new ClassDefs(className); } } if (line.startsWith("## Configuration")) { start = true; } if (line.startsWith("## Fields")) { start = false; } if (line.startsWith("## Methods")) { start = false; } if (line.startsWith("## Events")) { start = true; } if (start) { if (line.startsWith("### ")) { if (fld != null) { if (comment.contains("Example")) { String[] as = comment.split("Example"); comment = as[0] + "Example" + CRLF + TAB + " * <pre>"; comment += TAB + "" + as[1].replaceAll("<br>", ""); comment += TAB + " * </pre>"; // comment = comment.replaceFirst("Example", "Example " + CRLF + "<pre>") + "</pre>"; } fld.setComment(comment); comment = ""; } //first = true; String fldName = line.replaceAll("### ", ""); fldName = fldName.split(" ")[0]; fld = new FieldDefs(fldName); fld.setId(fldName); List<String> p = Arrays.asList(fldName.split("\\.")); if (p.size() > 1) { String key = fldName.substring(0, fldName.lastIndexOf('.')); String value = p.get(p.size() - 1); index.put(value, value); fld.setParentId(key); fld.setName(value); reg.put(fld.getId(), fld); } else { fldName = p.get(p.size() - 1); // System.out.println(fldName + " > "); index.put(fldName, fldName); fld.setParentId(""); reg.put(fld.getId(), fld); c.add(fld); } } else { if (fld != null) { line = line.replaceAll("<", LT); line = line.replaceAll(">", GT); line = line.replaceAll("#### ", ""); line = line.replaceAll("KENDO", "SUIX"); line = line.replaceAll("Kendo UI", "Suix"); line = line.replaceAll("Kendo", "Suix"); line = line.replaceAll("kendo", "suix"); line = line.replaceAll(" ", "&#9;"); comment += TAB + " * " + line + BR + CRLF; } } } } if (c != null) { System.out.println("----- " + c.getName() + " -----"); // reg.forEach((k, v) -> System.out.println((k + ": " + v))); for (Map.Entry<String, FieldDefs> entry : reg.entrySet()) { FieldDefs f = entry.getValue(); if (!f.getParentId().isEmpty()) { FieldDefs pf = reg.get(f.getParentId()); // System.out.println(f.getParentId() + " > " + pf); pf.add(f); } } String encoding = "UTF-8"; Properties properties = new Properties(); properties.setProperty("file.resource.loader.path", projectRootDir + "/src/test/java/cz/burios/tools/"); VelocityEngine ve = new VelocityEngine(properties); VelocityContext context = new VelocityContext(); context.put("md", c); // System.out.println(c.getFields()); if (destFile.exists()) destFile.delete(); destFile.createNewFile(); try (FileWriter fis = new FileWriter(destFile)) { Template tmpl = ve.getTemplate("suix-widget-class.vtl", encoding); tmpl.merge(context, fis); } catch (Exception e) { e.printStackTrace(); } // destFile.getName(); if (!c.getName().startsWith("# ")) { File javaFile = new File(destFile.getParent() + "/" + c.getName() + ".java"); // String source = FileUtils.readFileToString(destFile, StandardCharsets.UTF_8); // FileUtils.write(javaFile, new Formatter().formatSource(source), StandardCharsets.UTF_8); FileUtils.moveFile(destFile, javaFile); } } } else { return; } /* */ } catch (Exception e) { e.printStackTrace(); } }
[ "String getSourceFile();", "public String getDescription() {\r\n\treturn \"Source Files\";\r\n}", "static String test() {\n return src() + File.separator + DIR_TEST;\n }", "static String main() {\n return src() + File.separator + DIR_MAIN;\n }", "public String toString() { \n return name_of_file;\n }", "public void showSource()\n {\n }", "public static void getFile() {\r\n\t\tSystem.out.println(file.getName());\r\n\t}", "@Override\n public String toString()\n {\n return \"file: \" + mFile.getAbsolutePath();\n }", "public void startFile() {\n\t\tSystem.out.println(\"----------------\");\n\t}", "@Override public String toString()\n{\n return symbol_name + \"@\" + file_offset + \":\" + file_length;\n}", "public File\n getSourceFile()\n {\n return fSourceFile;\n }", "public abstract File getSourceFile();", "File getSourceFile() {\n\t\treturn srcFile;\n\t}", "public String getOutputFilename();", "public String toString() {\n return file.getName();\n }", "private static String expectedOutputToString (String expectedFileName) {\n StringBuilder sb = new StringBuilder();\n try {\n Scanner fileScanner = new Scanner(new File(expectedFileName));\n while (fileScanner.hasNextLine()) {\n sb.append(fileScanner.nextLine()+ System.lineSeparator());\n }\n } catch (FileNotFoundException ex) {\n Assert.fail(expectedFileName + \"not found. Make sure this file exists. Use relative path to root in front of the file name\");\n }\n return sb.toString();\n }", "public String originFile();", "public String getSrcPathName()\n {\n return srcPathName;\n }", "private void printFile(String filename) {\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(Game.class.getResourceAsStream(filename), \"UTF-8\"))) {\n String line;\n while ((line = reader.readLine()) != null) {\n System.out.println(line);\n }\n } catch (NullPointerException ignored) {\n System.err.println(filename + \" not found\");\n } catch (java.io.IOException ignored) {\n }\n }", "@Override\n public String toString() {\n return \"This is a file reader \";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether this map ID belongs to an existing image
private static boolean hasMapId(int mapId) { return MAPS_BY_MAP_ID.containsKey(mapId); }
[ "@Override\n\tpublic boolean existsImage(ImageDTO img) {\n\t\treturn false;\n\t}", "public boolean isSetImageId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(IMAGEID$2) != 0;\n }\n }", "public boolean hasImageID(String name, ImageSize imageSize) {\n return findImageID(name, imageSize, webui) != 0;\n }", "public boolean hasImage() {\n return imageID != NO_IMAGE_PROVIDED;\n }", "public static boolean hasImage(String pName){\n return iGraphics.containsKey(pName);\n }", "boolean hasTileId();", "boolean existsByFilePathAndMappointId(String filePath, int mapPointID);", "public boolean hasImage(String imageName){\n\t\treturn uos.documentExists(FQNUtils.imageFQN(imageName), null);\n\t}", "@API(status = DEPRECATED, since = \"1.1\")\n boolean isImageSet();", "boolean hasScreenshotid();", "public boolean hasPicture()\n\t{\n\t\treturn !this.picturePath.equals(\"\");\n\t}", "@java.lang.Override\n public boolean hasImage() {\n return resourceCase_ == 6;\n }", "public boolean sameImage(IItem that) {\n return false;\n }", "public boolean contains(Object o) {\n createCollection();\n return imageCollection.contains(o);\n }", "@java.lang.Override\n public boolean hasImage() {\n return resourceCase_ == 6;\n }", "boolean hasLayerId();", "public boolean hasImage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "boolean hasGoldShoppeImageName();", "public boolean isSetIsPrimaryImage()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(ISPRIMARYIMAGE$0) != 0;\r\n }\r\n }", "public boolean hasTexture();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters all system modules. Deals with a map containing com.sun.appserv.management.j2ee.J2EEModule or Subinterfaces, basically JSR 77 objects Use getDeployedObjects for filtering config objects ie.com.sun.appserv.management.config.ModuleConfig
protected static Map stripOutSystemApps(final Map allModules) { Map deployedObjects = new HashMap(); for (Iterator it = allModules.values().iterator(); it.hasNext();) { J2EEManagedObject j2eeModule = (J2EEManagedObject) it.next(); ModuleConfig appConfig = (ModuleConfig) j2eeModule.getConfigPeer(); if ((appConfig != null) && (ObjectTypeValues.USER.equals(appConfig.getObjectType()))) { deployedObjects.put(j2eeModule.getName(), j2eeModule); } } return deployedObjects; }
[ "Map<Bundle, Module> getModules();", "public static List<Map<String, String>> shareModules() {\n val modules = new LinkedList<Map<String, String>>();\n\n instance().moduleConfigurations.values().forEach(moduleConfig -> {\n val isActive = instance().isModuleActive(moduleConfig.getConfigPath());\n val moduleInfo = new HashMap<String, String>();\n\n moduleInfo.put(\"path\", moduleConfig.getConfigPath());\n moduleInfo.put(\"name\", moduleConfig.getName());\n moduleInfo.put(\"description\", moduleConfig.getDescription());\n moduleInfo.put(\"enabled\", String.valueOf(moduleConfig.isEnabled()));\n moduleInfo.put(\"active\", String.valueOf(isActive));\n modules.add(moduleInfo);\n });\n\n return modules;\n }", "public void engageGlobalModules() throws AxisFault {\n for (Iterator i = globalModuleList.iterator(); i.hasNext();) {\n engageModule((String) i.next());\n }\n }", "List<HomeServerModuleHandler> getAllHomeServerModules();", "Collection<I> getActiveModuleInstances();", "public List<INaviModule> getModules() {\n List<INaviModule> localCachedValues = m_cachedValues;\n\n if (localCachedValues == null) {\n final IFilter<INaviModule> filter = getFilter();\n\n if (m_addressSpace.isLoaded()) {\n localCachedValues =\n filter == null ? m_addressSpace.getContent().getModules() : filter.get(m_addressSpace\n .getContent().getModules());\n } else {\n localCachedValues = new ArrayList<INaviModule>();\n }\n }\n\n m_cachedValues = localCachedValues;\n return new ArrayList<INaviModule>(localCachedValues);\n }", "public Collection getAllModules(String serviceProviderCode, String userName) throws AAException, RemoteException;", "@Override\n public Collection<Class<? extends IFloodlightService>> getModuleServices() {\n\t\n\tCollection<Class<? extends IFloodlightService>> services =\n\t\t\t\tnew ArrayList<Class<? extends IFloodlightService>>();\n\tservices.add(InterfaceShortestPathSwitching.class);\n\treturn services; \n }", "public Vector<Module> getAllModules(){\n\t\treturn modules;\n\t}", "public List getGlobalModules() {\n return globalModuleList;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tprotected Object process() throws SiDCException, Exception {\n\t\tHashMap<String, RcuRoomModuleBean> map = new HashMap<String, RcuRoomModuleBean>();\n\t\tHashMap<String, RcuRoomModuleBean> roomModuleMap = (HashMap<String, RcuRoomModuleBean>) DataCenter.getInstance()\n\t\t\t\t.get(CommonDataKey.RCU_ROOM_MODULE);\n\n\t\tif (isFilter) {\n\t\t\tfor (RcuRoomModuleBean test : roomModuleMap.values()) {\n\t\t\t\tif (!StringUtils.isBlank(entity.getName()) && test.getName().equals(entity.getName())) {\n\t\t\t\t\tmap.put(String.valueOf(test.getId()), test);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tmap = roomModuleMap;\n\t\t}\n\n\t\treturn map.values();\n\t}", "public Map<String, String> getAllModules() {\n PreparedStatement preparedStatement;\n ResultSet rs;\n Map<String, String> moduleMap = new HashMap<>();\n try (Connection connection = DBConnection.getConnection()) {\n preparedStatement = connection.prepareStatement(\"SELECT moduleId, moduleName FROM module\");\n\n rs = preparedStatement.executeQuery();\n\n while (rs.next()) {\n moduleMap.put(rs.getString(\"moduleId\"), rs.getString(\"moduleName\"));\n }\n } catch (SQLException e) {\n\n }\n return moduleMap;\n }", "List<Module> getModules();", "public synchronized ArrayList<BeanModule> loadModules()\r\n {\r\n loadModulesCache = new ArrayList<BeanModule>();\r\n NodeList nodes = getModuleNodes();\r\n for(int i=0; i<nodes.getLength(); i++)\r\n {\r\n BeanModule loadModule = genericLoader(nodes.item(i), MODULE);\r\n loadModulesCache.add(loadModule); \r\n }\r\n MODULESFILE = new File(CoreCfg.contextRoot+File.separator+\"config\"+\r\n File.separator+appClass.replaceAll(\"\\\\.\",\"-\")+\".xml\"); \r\n lastModified = MODULESFILE.lastModified();\r\n return loadModulesCache;\r\n }", "Collection<TurboModule> getModules();", "@Override\n public List<Class<?>> getModules() {\n return Arrays.asList(\n DomainAppDomainModule.class, // domain (entities and repositories)\n DomainAppFixtureModule.class, // fixtures\n DomainAppAppModule.class, // home page service etc\n org.isisaddons.module.audit.AuditModule.class,\n org.isisaddons.module.command.CommandModule.class,\n org.incode.module.document.dom.DocumentModule.class,\n org.incode.module.docrendering.xdocreport.dom.XDocReportDocRenderingModule.class,\n org.incode.module.docrendering.stringinterpolator.dom.StringInterpolatorDocRenderingModule.class,\n org.incode.module.docrendering.freemarker.dom.FreemarkerDocRenderingModule.class,\n org.isisaddons.module.stringinterpolator.StringInterpolatorModule.class,\n org.isisaddons.module.freemarker.dom.FreeMarkerModule.class,\n org.isisaddons.module.xdocreport.dom.service.XDocReportService.class,\n org.isisaddons.module.excel.ExcelModule.class,\n org.isisaddons.wicket.gmap3.cpt.applib.Gmap3ApplibModule.class,\n org.isisaddons.wicket.gmap3.cpt.service.Gmap3ServiceModule.class\n );\n }", "public void listModules();", "@ModelAttribute(\"Allmodule\")\r\n\tpublic List<Module> modules() {\r\n\t\treturn moduleService.getAll();\r\n\t}", "public List<String> getAllRegisteredModules() throws TypeStorageException {\n\t\treturn new ArrayList<String>(storage.getAllRegisteredModules(false));\n\t}", "public ModuleMultimap getModules() {\n return moduleListMap.get();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: a
public <T extends B> T mo26774a(C6693m<T> mVar, T t) { throw new UnsupportedOperationException(); }
[ "public interface C3511a {\n /* renamed from: a */\n void mo29057a(int i);\n }", "interface C4511c {\n /* renamed from: a */\n void mo29775a();\n }", "public interface ans {\n /* renamed from: a */\n void mo1174a();\n}", "public interface C24712af {\n /* renamed from: a */\n void mo64682a(List<Aweme> list);\n}", "public interface C11237e {\n /* renamed from: a */\n void mo39072a();\n}", "public interface C1837a {\n /* renamed from: a */\n void mo5414a(C1197a c1197a);\n }", "public interface C5635a {\n /* renamed from: a */\n void mo17734a(C5599a aVar);\n }", "public interface C21636a {\n /* renamed from: a */\n void mo57784a(String str);\n }", "interface cdw {\n /* renamed from: a */\n Object mo2685a(String str);\n}", "public interface C8405b<T> {\n /* renamed from: a */\n T mo21567a();\n}", "public interface aa extends ab {\r\n /* renamed from: a */\r\n void mo459a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo460a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo466b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo467b(int i) throws RemoteException;\r\n\r\n /* renamed from: h */\r\n float mo473h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n int mo474i() throws RemoteException;\r\n\r\n /* renamed from: l */\r\n int mo477l() throws RemoteException;\r\n\r\n /* renamed from: m */\r\n List<LatLng> mo478m() throws RemoteException;\r\n}", "interface C1026a {\n /* renamed from: a */\n void mo10282a(C1025el c1025el);\n\n /* renamed from: b */\n void mo10283b(C1025el c1025el);\n }", "public interface C4489a {\n /* renamed from: a */\n void mo12254a(int i);\n }", "public interface C40369ab {\n /* renamed from: a */\n void mo100344a();\n\n /* renamed from: a */\n void mo100345a(int i);\n}", "@Override // com.zhihu.android.base.widget.adapter.ZHRecyclerViewAdapter.ViewHolder\n /* renamed from: a */\n public void mo65331a(T t) {\n super.mo65331a((Object) t);\n mo82389n();\n }", "interface C0504b {\n /* renamed from: a */\n void mo7607a();\n }", "interface C17044s {\n /* renamed from: a */\n C17043r mo44275a(String str);\n}", "public interface C27423b {\n /* renamed from: a */\n C27422a mo70532a();\n\n /* renamed from: b */\n C27425d mo70533b();\n}", "public interface C11546e {\n /* renamed from: a */\n String mo29506a(Field field);\n}", "public interface C34109a {\n /* renamed from: a */\n RecommendList mo86759a();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method to set the desire dimensions
@Override public Dimension getPreferredSize() { return (new Dimension(200,200)); }
[ "public void setDimensions(Dimensions dimensions);", "public void setDimensions() {\r\n\t\t// By default, do nothing\r\n\t}", "private void setDim(){\n\t\tcols = mucchio.conta(createDir(\"n\"));\n\t\trows = mucchio.conta(createDir(\"e\"));\n\t}", "public void setDimensionsX(int x);", "public abstract void setDimensions(Dimension... dims1);", "void changeDimensions(double newWidth, double newHeight);", "public void setDimension(double width,double height){\n this.width=width;\n this.height=height;\n }", "@Test\n\tpublic void testSetDimensions() {\n\t\tthis.driver.setDimensions(width, height);\n\t\tassertNotNull(driver.width);\n\t\tassertNotNull(driver.height);\n\t}", "void setDimensions(int colCount, int rowCount);", "public void setDim(int length, int width)\n {\n this.length=length;\n this.width=width;\n }", "public void setImageSize(Dimension d){\n this.imagesize = d;\n }", "public void SetDimensions(float len , float wid )\n\t{\n\t\tlength = len;\n\t\twidth = wid ;\n\t\t\n\t}", "public void setSize(int width, int height){\n }", "private void setDimensions(){\n\n dimensionDialog = new DimensionDialog(this, true,currentProject.getUnitWidth(),currentProject.getUnitHeight(), currentProject.getUnits());\n System.err.println(\"After opening dialog.\");\n if(dimensionDialog.getAnswer()) {\n double widthVal = dimensionDialog.getCanvasWidth();\n double heightVal = dimensionDialog.getCanvasHeight();\n int unitsVal=dimensionDialog.getUnits();\n System.out.println(\"width =\"+widthVal+\" height=\"+ heightVal+\" units=\"+ unitsVal);\n currentProject.setDimensions(widthVal,heightVal, unitsVal, canvas, instructionManager);\n\n\n\n\n }\n else {\n System.err.println(\"The answer stored in CustomDialog is 'false' (i.e. user clicked no button.)\");\n }\n\n }", "void setSize(int length, int width);", "public void setDims(int width, int height)\n\t{\n\t\tsetWidth(width);\n\t\tsetHeight(height);\n\t}", "public int getDimensions() {\r\n return size;\r\n }", "public void setDimensions(float w, float h){\n \tsuper.setDimensions(w, h);\n \t\n \tpositionOutput();\n }", "public void setDimensions(int x, int y) {\n\t\tthis.worldWidth = x;\n\t\tthis.worldHeight = y;\n\t this.setChanged();\n\t this.notifyObservers(this);\n\t}", "@Override\r\n public void setScreenDimension(int width, int height) {\n height = Math.min(height, maximumSize);\r\n width = Math.min(width, maximumSize);\r\n if (isStereoDouble())\r\n width = (width + 1) / 2;\r\n if (dimScreen.width == width && dimScreen.height == height)\r\n return;\r\n //System.out.println(\"HMM \" + width + \" \" + height + \" \" + maximumSize);\r\n resizeImage(width, height, false, false, true);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set an ARCommand to hold the command GPSControllerLongitudeForRun in feature MiniDrone Feature MiniDrone description: All MiniDroneonly commands Class GPS description: GPS related commands Command ControllerLongitudeForRun description: Set the controller longitude for a run. This function reuses the current ARCommand, replacing its content with a new command created from the current params
public ARCOMMANDS_GENERATOR_ERROR_ENUM setMiniDroneGPSControllerLongitudeForRun (double _longitude) { ARCOMMANDS_GENERATOR_ERROR_ENUM err = ARCOMMANDS_GENERATOR_ERROR_ENUM.ARCOMMANDS_GENERATOR_ERROR; if (!valid) { return err; } int errInt = nativeSetMiniDroneGPSControllerLongitudeForRun (pointer, capacity, _longitude); if (ARCOMMANDS_GENERATOR_ERROR_ENUM.getFromValue (errInt) != null) { err = ARCOMMANDS_GENERATOR_ERROR_ENUM.getFromValue (errInt); } return err; }
[ "public Command getAutonomousCommand4() {\n var autoVoltageConstraint = new DifferentialDriveVoltageConstraint(\n new SimpleMotorFeedforward(Constants.DriveConstants.ksVolts,\n Constants.DriveConstants.kvVoltSecondsPerMeter,\n Constants.DriveConstants.kaVoltSecondsSquaredPerMeter),\n Constants.DriveConstants.kDriveKinematics, 7);\n\n // Create config for trajectory\n // TrajectoryConfig config = new TrajectoryConfig(Constants.AutoConstants.kMaxSpeedMetersPerSecond,\n // Constants.AutoConstants.kMaxAccelerationMetersPerSecondSquared)\n // // Add kinematics to ensure max speed is actually obeyed\n // .setKinematics(Constants.DriveConstants.kDriveKinematics)\n // // Apply the voltage constraint\n // .addConstraint(autoVoltageConstraint).setReversed(true);\n\n // Trajectory exampleTrajectory = TrajectoryGenerator.generateTrajectory(\n // new Pose2d(2.4, 3.8, new Rotation2d(1.57)),\n // List.of(new Translation2d(2.8, 2), \n // new Translation2d(3.8, 0.9)),\n // new Pose2d(4.6, 3.7, new Rotation2d(4.71)),\n // config);\n\n String trajectoryJSON = \"Pathweaver/output/Bounce4.wpilib.json\";\n Trajectory exampleTrajectory = new Trajectory();\n try {\n Path trajectoryPath = Filesystem.getDeployDirectory().toPath().resolve(trajectoryJSON);\n System.out.println(\"here\");\n System.out.println(trajectoryPath);\n exampleTrajectory = TrajectoryUtil.fromPathweaverJson(trajectoryPath);\n System.out.println(\"here\");\n } catch (IOException ex) {\n System.out.println(ex);\n // DriverStation.reportError(\"Unable to open trajectory: \" + trajectoryJSON,\n // ex.getStackTrace());\n }\n\n RamseteCommand ramseteCommand = new RamseteCommand(exampleTrajectory, m_robotDrive::getPose,\n new RamseteController(Constants.AutoConstants.kRamseteB, Constants.AutoConstants.kRamseteZeta),\n new SimpleMotorFeedforward(Constants.DriveConstants.ksVolts,\n Constants.DriveConstants.kvVoltSecondsPerMeter,\n Constants.DriveConstants.kaVoltSecondsSquaredPerMeter),\n Constants.DriveConstants.kDriveKinematics, m_robotDrive::getWheelSpeeds,\n new PIDController(Constants.DriveConstants.kPDriveVel, 0, 0),\n new PIDController(Constants.DriveConstants.kPDriveVel, 0, 0),\n // RamseteCommand passes volts to the callback\n m_robotDrive::tankDriveVolts, m_robotDrive);\n\n // Reset odometry to starting pose of trajectory.\n //m_robotDrive.resetOdometry(exampleTrajectory.getInitialPose());\n\n // Run path following command, then stop at the end.\n //Timer.delay(10.0);\n return ramseteCommand.andThen(() -> m_robotDrive.tankDriveVolts(0, 0));\n }", "public AutoCommand(DriveTrain m_drivetrain, Trajectory trajectory) {\n addRequirements(m_drivetrain);\n\n ramseteCommand = new RamseteCommand(\n trajectory,\n m_drivetrain::getPose,\n new RamseteController(AutoConstants.kRamseteB, AutoConstants.kRamseteZeta),\n new SimpleMotorFeedforward(DriveConstants.ksVolts,\n DriveConstants.kvVoltSecondsPerMeter,\n DriveConstants.kaVoltSecondsSquaredPerMeter),\n DriveConstants.kDriveKinematics,\n m_drivetrain::getWheelSpeeds,\n new PIDController(DriveConstants.kPDriveVel, 0, 0),\n new PIDController(DriveConstants.kPDriveVel, 0, 0),\n // RamseteCommand passes volts to the callback\n m_drivetrain::tankDriveVolts,\n m_drivetrain\n );\n }", "private void updateDroneLocation(){\n LatLng pos = new LatLng(droneLocationLat, droneLocationLng);\n //Create MarkerOptions object\n final MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(pos);\n markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.drone1));\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (droneMarker != null) {\n droneMarker.remove();\n }\n\n if (checkGpsCoordination(droneLocationLat, droneLocationLng)) {\n droneMarker = gMap.addMarker(markerOptions);\n }\n }\n });\n }", "protected void execute() {\n\t\tRobot.myElevator().setPIDtarget(desiredPosition);\n }", "private void moveNewRobot(Scanner fileScanner) {\n\n RobotCommandsImpl robot = new RobotCommandsImpl(marsGridMap);\n\n int positionX = Integer.parseInt(fileScanner.next());\n if(isValidPosition(positionX,'X'))\n robot.setPositionX(positionX); // set positionX\n\n int positionY = Integer.parseInt(fileScanner.next());\n if(isValidPosition(positionY,'Y'))\n robot.setPositionY(positionY); // set positionX\n\n String orientation = fileScanner.next();\n robot.setOrientation(orientation); // set Orientation\n\n fileScanner.nextLine();\n String inputCommand = fileScanner.nextLine(); // Get command instruction\n\n // Check the maximum command length is less than 100\n if (inputCommand.length()<= Martianrobotsconstants.MAX_COMMAND_LENGTH) {\n stream(inputCommand.split(\"\")).forEach(robot::move);\n if (fileScanner.hasNextLine()) fileScanner.nextLine();\n System.out.print(String.valueOf(robot.getPositionX()) // print the output poistions\n + ' '\n + robot.getPositionY()\n + ' '\n + robot.getOrientation());\n\n if (robot.isLost()) {\n System.out.print(\" LOST\");\n }\n System.out.println();\n }\n else\n throw new MartianRobotsAppException(\"Invalid command length in input data\");\n }", "public abstract void setStartingLocation(DRCStartingLocation startingLocation);", "@Override\n public void execute() {\n double distanceFromStart = m_driveSubsystem.getTotalPosition() - m_startEncoder;\n m_driveSubsystem.setArcadeSpeed(m_ramp.getValueAtPosition(distanceFromStart) * m_directionMult, 0, true, false);\n }", "public void setLongitude(double newLongitude){this.longitude = newLongitude;}", "@Override\r\n\tpublic void execute(){\r\n\t\tds.set(0.4, 0.4); //40% on both the left and right sides\r\n\t\tTimer.delay(3.000); //Have the robot drive for 3 seconds using a 3 second delay\r\n\t\tds.set(0.0, 0.0); //Stop the robot by turning the motors off\r\n\t\tfinished = true; //Allow the command to end\r\n\t}", "protected void execute() {\r\n \t// Update motor output\r\n \tRobot.driveTrain.moveToTargetAngle();\r\n }", "protected void execute() {\n \t\n \tmoveArmToSetpoint(whatSetpointWeWant, 0, 0, 0);\n \t\n }", "@Override\n public int onStartCommand(Intent intent, int flags, final int startId) {\n runnable = new Runnable() {\n @Override\n public void run() {\n if(running) {\n try {\n setLocation(latitude, longitude);\n } catch (Exception e) {\n //e.printStackTrace();\n }\n //Log.d(\"SERVICE\", \"\"+startId);\n //Log.d(\"INFOS-GET-EXTRA\", \"Latitude: \"+latitude+\" | Longitude: \"+longitude);\n handler.postDelayed(this, 1000);\n }\n }\n };\n runnable.run();\n\n return super.onStartCommand(intent, flags, startId);\n }", "public void setCommand(Commandline cmdl) {\n- throw new BuildException(taskType\n+ throw new BuildException(getTaskType()\n + \" doesn\\'t support the command attribute\",\n getLocation());\n }", "void setNilLongitude();", "@Override\n public void execute() {\n double cameraAngle = SmartDashboard.getNumber(Constants.BallAngleString, 0.0);\n double cameraDistance = SmartDashboard.getNumber(Constants.BallDistanceString, 0.0);\n Translation2d cameraToBall = new Translation2d(cameraDistance, Rotation2d.fromDegrees(cameraAngle));\n Translation2d centerToCamera = new Translation2d(Constants.BallCameraToCenterDiatance, Rotation2d.fromDegrees(Constants.BallCameraToCenterAngle));\n Translation2d vec = centerToCamera.plus(cameraToBall);\n double distance = vec.getNorm();\n double sin = (new Rotation2d(vec.getX(), vec.getY())).getSin();\n double radius = distance/2/sin;\n double vel = 0.7;\n double ratio = radius / (radius + Constants.WHEEL_BASE/2);\n double leftVelocity = vel * (1 + ratio);\n double rightVelocity = vel * (1 - ratio);\n chassis.setVelocity(leftVelocity, rightVelocity);\n }", "boolean setAutoRunCommand(String CmdAPara);", "protected void execute() {\n \t//RobotMap.sallyArmUpperArmMotor.set( Robot.oi.getLeftJS().getY()/2. );\n }", "public Command getCommand() {\n return new InstantCommand(() -> m_drivetrain.resetOdometry(trajectory.getInitialPose()), m_drivetrain)\n // drive through the waypoints in the path \n .andThen(pathRamseteCommand)\n //stop driving\n .andThen(new InstantCommand(() -> m_drivetrain.tankDriveVolts(0, 0), m_drivetrain));\n }", "public NoTurnAuton(TurretSubsystem turretSubsystem, DriveTrainSubsystem driveTrainSubsystem, ConveyorSubsystem conveyorSubsystem, IntakeSubsystem intakeSubsystem, LidarSubsystem lidarSubsystem, BlasterSubsystem blasterSubsystem, XboxController joystick) {\n // Add your commands in the super() call, e.g.\n // super(new FooCommand(), new BarCommand());\n super(\n new LowerIntakeArmCommand(intakeSubsystem),\n new DriveForwardGyroDistanceCommand(driveTrainSubsystem, Constants.AUTON_DRIVE_OFF_LINE_DISTANCE, Constants.AUTON_DRIVE_OFF_LINE_SPEED, 0, true),\n \n new TimedBlasterDistanceBasedCommand(blasterSubsystem, lidarSubsystem, 2000),\n \n new ParallelCommandGroup(\n new BlasterDistanceBasedCommand(blasterSubsystem, lidarSubsystem, joystick),\n new IndexToBlasterCommand(intakeSubsystem),\n new ConveyorCommand(conveyorSubsystem, ()->-0.7)\n )\n // new ParallelCommandGroup(\n // TEST AUTON DRIVE OFF LINE DISTANCE!!!!!!!!!!!!!!!!!!!!\n // new TimedManualTurretCommand(turretSubsystem, () -> 0, () -> 1, 2000),\n // // ),\n\n // // new TimedCommand(new TurnToTargetCommand(turretSubsystem, lidarSubsystem), 3000),\n // new TurnToTargetCommand(turretSubsystem, lidarSubsystem),\n \n );\n }", "public void setCommand(String par1Str) {\n\t\tthis.command = par1Str;\n\t\tthis.onInventoryChanged();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "ruleDependencyRule" $ANTLR start "entryRuleFreeDependencyRule" InternalSpecDSL.g:328:1: entryRuleFreeDependencyRule : ruleFreeDependencyRule EOF ;
public final void entryRuleFreeDependencyRule() throws RecognitionException { try { // InternalSpecDSL.g:329:1: ( ruleFreeDependencyRule EOF ) // InternalSpecDSL.g:330:1: ruleFreeDependencyRule EOF { before(grammarAccess.getFreeDependencyRuleRule()); pushFollow(FOLLOW_1); ruleFreeDependencyRule(); state._fsp--; after(grammarAccess.getFreeDependencyRuleRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
[ "public final void entryRuleFeature() throws RecognitionException {\n try {\n // ../de.nagarro.nteg.domain.model.ui/src-gen/org/example/domainmodel/ui/contentassist/antlr/internal/InternalDomainmodel.g:315:1: ( ruleFeature EOF )\n // ../de.nagarro.nteg.domain.model.ui/src-gen/org/example/domainmodel/ui/contentassist/antlr/internal/InternalDomainmodel.g:316:1: ruleFeature EOF\n {\n before(grammarAccess.getFeatureRule()); \n pushFollow(FOLLOW_ruleFeature_in_entryRuleFeature604);\n ruleFeature();\n\n state._fsp--;\n\n after(grammarAccess.getFeatureRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleFeature611); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleRule() throws RecognitionException {\n try {\n // ../org.xtext.example.webgme_mtl.ui/src-gen/org/xtext/example/webgme/ui/contentassist/antlr/internal/InternalMTL.g:89:1: ( ruleRule EOF )\n // ../org.xtext.example.webgme_mtl.ui/src-gen/org/xtext/example/webgme/ui/contentassist/antlr/internal/InternalMTL.g:90:1: ruleRule EOF\n {\n before(grammarAccess.getRuleRule()); \n pushFollow(FOLLOW_ruleRule_in_entryRuleRule122);\n ruleRule();\n\n state._fsp--;\n\n after(grammarAccess.getRuleRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleRule129); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRulenativeValidationRuleDeclaration() throws RecognitionException {\n try {\n // ../org.makumba.devel.plugin.eclipse.mdd.ui/src-gen/org/makumba/devel/plugin/eclipse/mdd/ui/contentassist/antlr/internal/InternalMDD.g:1014:1: ( rulenativeValidationRuleDeclaration EOF )\n // ../org.makumba.devel.plugin.eclipse.mdd.ui/src-gen/org/makumba/devel/plugin/eclipse/mdd/ui/contentassist/antlr/internal/InternalMDD.g:1015:1: rulenativeValidationRuleDeclaration EOF\n {\n if ( backtracking==0 ) {\n before(grammarAccess.getNativeValidationRuleDeclarationRule()); \n }\n pushFollow(FOLLOW_rulenativeValidationRuleDeclaration_in_entryRulenativeValidationRuleDeclaration2107);\n rulenativeValidationRuleDeclaration();\n _fsp--;\n if (failed) return ;\n if ( backtracking==0 ) {\n after(grammarAccess.getNativeValidationRuleDeclarationRule()); \n }\n match(input,EOF,FOLLOW_EOF_in_entryRulenativeValidationRuleDeclaration2114); if (failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleNode() throws RecognitionException {\n try {\n // ../fr.obeo.dsl.sprototyper.ui/src-gen/fr/obeo/dsl/ui/contentassist/antlr/internal/InternalSPrototyper.g:398:1: ( ruleNode EOF )\n // ../fr.obeo.dsl.sprototyper.ui/src-gen/fr/obeo/dsl/ui/contentassist/antlr/internal/InternalSPrototyper.g:399:1: ruleNode EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getNodeRule()); \n }\n pushFollow(FOLLOW_ruleNode_in_entryRuleNode787);\n ruleNode();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getNodeRule()); \n }\n match(input,EOF,FOLLOW_EOF_in_entryRuleNode794); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final EObject entryRuleRef() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleRef = null;\n\n\n try {\n // ../org.eclipse.xtext.xdoc/src-gen/org/eclipse/xtext/xdoc/parser/antlr/internal/InternalXdoc.g:2308:2: (iv_ruleRef= ruleRef EOF )\n // ../org.eclipse.xtext.xdoc/src-gen/org/eclipse/xtext/xdoc/parser/antlr/internal/InternalXdoc.g:2309:2: iv_ruleRef= ruleRef EOF\n {\n newCompositeNode(grammarAccess.getRefRule()); \n pushFollow(FOLLOW_ruleRef_in_entryRuleRef5165);\n iv_ruleRef=ruleRef();\n\n state._fsp--;\n\n current =iv_ruleRef; \n match(input,EOF,FOLLOW_EOF_in_entryRuleRef5175); \n\n }\n\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public final void entryRuleValidatorFeature() throws RecognitionException {\n try {\n // ../de.nagarro.nteg.domain.model.ui/src-gen/org/example/domainmodel/ui/contentassist/antlr/internal/InternalDomainmodel.g:1155:1: ( ruleValidatorFeature EOF )\n // ../de.nagarro.nteg.domain.model.ui/src-gen/org/example/domainmodel/ui/contentassist/antlr/internal/InternalDomainmodel.g:1156:1: ruleValidatorFeature EOF\n {\n before(grammarAccess.getValidatorFeatureRule()); \n pushFollow(FOLLOW_ruleValidatorFeature_in_entryRuleValidatorFeature2404);\n ruleValidatorFeature();\n\n state._fsp--;\n\n after(grammarAccess.getValidatorFeatureRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleValidatorFeature2411); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleDefinition() throws RecognitionException {\n try {\n // ../org.yakindu.sct.statechart.expressions.ui/src-gen/org/yakindu/sct/statechart/ui/contentassist/antlr/internal/InternalExpressions.g:400:1: ( ruleDefinition EOF )\n // ../org.yakindu.sct.statechart.expressions.ui/src-gen/org/yakindu/sct/statechart/ui/contentassist/antlr/internal/InternalExpressions.g:401:1: ruleDefinition EOF\n {\n before(grammarAccess.getDefinitionRule()); \n pushFollow(FOLLOW_ruleDefinition_in_entryRuleDefinition782);\n ruleDefinition();\n _fsp--;\n\n after(grammarAccess.getDefinitionRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleDefinition789); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleFQN() throws RecognitionException {\n try {\n // InternalCommunicationObject.g:395:1: ( ruleFQN EOF )\n // InternalCommunicationObject.g:396:1: ruleFQN EOF\n {\n before(grammarAccess.getFQNRule()); \n pushFollow(FOLLOW_1);\n ruleFQN();\n\n state._fsp--;\n\n after(grammarAccess.getFQNRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleFeature() throws RecognitionException {\n try {\n // ../jpadsl.ui/src-gen/jpadsl/ui/contentassist/antlr/internal/InternalJPADsl.g:425:1: ( ruleFeature EOF )\n // ../jpadsl.ui/src-gen/jpadsl/ui/contentassist/antlr/internal/InternalJPADsl.g:426:1: ruleFeature EOF\n {\n before(grammarAccess.getFeatureRule()); \n pushFollow(FOLLOW_ruleFeature_in_entryRuleFeature842);\n ruleFeature();\n\n state._fsp--;\n\n after(grammarAccess.getFeatureRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleFeature849); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleDefinition() throws RecognitionException {\n try {\n // InternalResoluteParser.g:309:1: ( ruleDefinition EOF )\n // InternalResoluteParser.g:310:1: ruleDefinition EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getDefinitionRule()); \n }\n pushFollow(FollowSets000.FOLLOW_1);\n ruleDefinition();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getDefinitionRule()); \n }\n match(input,EOF,FollowSets000.FOLLOW_2); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleConstraint() throws RecognitionException {\n try {\n // InternalStateConstraintTransition.g:754:1: ( ruleConstraint EOF )\n // InternalStateConstraintTransition.g:755:1: ruleConstraint EOF\n {\n before(grammarAccess.getConstraintRule()); \n pushFollow(FOLLOW_1);\n ruleConstraint();\n\n state._fsp--;\n\n after(grammarAccess.getConstraintRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleExpression() throws RecognitionException {\n try {\n // ../org.yakindu.sct.statechart.expressions.ui/src-gen/org/yakindu/sct/statechart/ui/contentassist/antlr/internal/InternalExpressions.g:1197:1: ( ruleExpression EOF )\n // ../org.yakindu.sct.statechart.expressions.ui/src-gen/org/yakindu/sct/statechart/ui/contentassist/antlr/internal/InternalExpressions.g:1198:1: ruleExpression EOF\n {\n before(grammarAccess.getExpressionRule()); \n pushFollow(FOLLOW_ruleExpression_in_entryRuleExpression2485);\n ruleExpression();\n _fsp--;\n\n after(grammarAccess.getExpressionRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleExpression2492); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleExpression() throws RecognitionException {\n try {\n // InternalMyDsl.g:1780:1: ( ruleExpression EOF )\n // InternalMyDsl.g:1781:1: ruleExpression EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getExpressionRule()); \n }\n pushFollow(FOLLOW_1);\n ruleExpression();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getExpressionRule()); \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleFunction() throws RecognitionException {\r\n try {\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:1328:1: ( ruleFunction EOF )\r\n // ../com.intel.llvm.ireditor.ui/src-gen/com/intel/llvm/ireditor/ui/contentassist/antlr/internal/InternalLLVM_IR.g:1329:1: ruleFunction EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getFunctionRule()); \r\n }\r\n pushFollow(FollowSets000.FOLLOW_ruleFunction_in_entryRuleFunction2774);\r\n ruleFunction();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getFunctionRule()); \r\n }\r\n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleFunction2781); if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n }\r\n return ;\r\n }", "public final void entryRuleExpression() throws RecognitionException {\n try {\n // InternalReflex.g:1205:1: ( ruleExpression EOF )\n // InternalReflex.g:1206:1: ruleExpression EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getExpressionRule()); \n }\n pushFollow(FOLLOW_1);\n ruleExpression();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getExpressionRule()); \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleAddition() throws RecognitionException {\n try {\n // InternalArgument.g:341:1: ( ruleAddition EOF )\n // InternalArgument.g:342:1: ruleAddition EOF\n {\n before(grammarAccess.getAdditionRule()); \n pushFollow(FOLLOW_1);\n ruleAddition();\n\n state._fsp--;\n\n after(grammarAccess.getAdditionRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final void entryRuleExpression() throws RecognitionException {\r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.nsl.ui/src-gen/eu/artist/postmigration/nfrvt/lang/nsl/ui/contentassist/antlr/internal/InternalNSL.g:370:1: ( ruleExpression EOF )\r\n // ../eu.artist.postmigration.nfrvt.lang.nsl.ui/src-gen/eu/artist/postmigration/nfrvt/lang/nsl/ui/contentassist/antlr/internal/InternalNSL.g:371:1: ruleExpression EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getExpressionRule()); \r\n }\r\n pushFollow(FOLLOW_ruleExpression_in_entryRuleExpression726);\r\n ruleExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getExpressionRule()); \r\n }\r\n match(input,EOF,FOLLOW_EOF_in_entryRuleExpression733); if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n }\r\n return ;\r\n }", "public final void entryRulePackage() throws RecognitionException {\n try {\n // ../de.goldschmiede.bodsl.ui/src-gen/de/goldschmiede/bodsl/ui/contentassist/antlr/internal/InternalBusinessObjectDsl.g:89:1: ( rulePackage EOF )\n // ../de.goldschmiede.bodsl.ui/src-gen/de/goldschmiede/bodsl/ui/contentassist/antlr/internal/InternalBusinessObjectDsl.g:90:1: rulePackage EOF\n {\n before(grammarAccess.getPackageRule()); \n pushFollow(FOLLOW_rulePackage_in_entryRulePackage121);\n rulePackage();\n\n state._fsp--;\n\n after(grammarAccess.getPackageRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRulePackage128); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }", "public final String entryRuleDeclaration() throws RecognitionException {\n String current = null;\n\n AntlrDatatypeRuleToken iv_ruleDeclaration = null;\n\n\n try {\n // InternalProjectWeb.g:201:51: (iv_ruleDeclaration= ruleDeclaration EOF )\n // InternalProjectWeb.g:202:2: iv_ruleDeclaration= ruleDeclaration EOF\n {\n newCompositeNode(grammarAccess.getDeclarationRule()); \n pushFollow(FOLLOW_1);\n iv_ruleDeclaration=ruleDeclaration();\n\n state._fsp--;\n\n current =iv_ruleDeclaration.getText(); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "public final void entryRuleExpression() throws RecognitionException {\n try {\n // InternalOclMapping.g:129:1: ( ruleExpression EOF )\n // InternalOclMapping.g:130:1: ruleExpression EOF\n {\n before(grammarAccess.getExpressionRule()); \n pushFollow(FOLLOW_1);\n ruleExpression();\n\n state._fsp--;\n\n after(grammarAccess.getExpressionRule()); \n match(input,EOF,FOLLOW_2); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is called when the disabled button is hit. You can use it to reset subsystems before shutting down.
public void disabledInit(){ }
[ "@Override\n public void disabledInit() {\n // drivetrain.resetSubsystem();\n // shooter.resetSubsystem();\n // intakeStorage.resetSubsystem();\n }", "public void disable()\r\n {\r\n \tdisabled = true;\r\n }", "public void disabled() {\n\t}", "public void onDisable() {\n // TODO: Place any custom disable code here\n\n // NOTE: All registered events are automatically unregistered when a plugin is disabled\n\n // EXAMPLE: Custom code, here we just output some info so we can check all is well\n System.out.println(\"[SANDKERNEL] Shutting down.\");\n }", "public void onDisable()\n\t{\n\t\tmanager.onDisable();\n\t}", "@Override\n public void onDisabled()\n {\n }", "@Override\n\tpublic void onDisable() {}", "@Override \n\tpublic void onDisable() {\n\t\n\t}", "public void onDisable(){}", "protected abstract void doDisable();", "@Override\n\tpublic void onDisable() {\n\t\tSystem.out.println(\"최후의 1인 꺼짐\");\n\t}", "public void disable()\n {\n }", "protected void cruiseDisable()\n\t{\n\t\tspeed = 0;\n\t\tstatus = \"Disabled\";\n\t}", "void resetEnabled();", "@Override\r\n\tpublic void onDisable() {\r\n\t\tthis.getLogger().info(\"disabled!\");\r\n\t}", "@Override\n public void disabledInit(){\n \tRobot.oi.launchPad.setOutputs(0);\n \t//limeLighttable.getEntry(\"ledMode\").setValue(1);\n\n }", "@Override\n public void onDisable() {\n saveConfig();\n }", "@Override\n\tpublic void disabledInit() {\n\t\tif (autonCommand != null){\n\t\t\tautonCommand.cancel();\n\t\t}\n\t//\tDrivetrainSubsystem.getInstance().stopTrapezoidControl(); \n\t\tAutonSelector.getInstance().putAutonChoosers();\n\t\tDrivetrainSubsystem.getInstance().percentVoltageMode();\n\t\tShooterSubsystem.getInstance().setMotorPower(0.0);\n\t\tIndexerSubsystem.getInstance().setMotorPower(0.0);\n\t\tDeflectorSubsystem.getInstance().setMotorPower(0.0);\n\t\tDrivetrainSubsystem.getInstance().tankDrive(0.0,0.0,false);\n\t\tTurretSubsystem.getInstance().getThread().stopTurret();\n\t\tRobotState.getInstance().setState(RobotState.State.DISABLED);\n\t}", "public void disabledInit() {\n arm.reset();\n driver.reset();\n }", "public void actionPerformed(ActionEvent e) {\n checkDisabledStatus();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove all child Widgets from this container.
public void removeAll() { for (int i = 0; i < child.length; i++) remove(i); }
[ "public void removeAll()\n {\n getComponent().removeAll();\n for (Widget w : child)\n removeAsParent(w);\n child.clear();\n childLayout.clear();\n invalidateSize();\n }", "public void removeAllChildren(){\n for (int i=0;i<Constants.NUM_DISPLAY_LAYERS;i++){\n displayList.get(i).clear();\n }\n }", "@Override\n public void clear() {\n for (int index = 0; index < container.getChildCount(); index++) {\n views.add(container.getChildAt(index));\n }\n\n container.removeAllViews();\n }", "public void removeChildren() {\r\n this.children = null;\r\n }", "public void removeAllChildren() {\n\t\t// merken aller knoten im baum\n\t\tfinal List<BaseControl> deleteList = new ArrayList<BaseControl>();\n\t\t// ganzen componenten wieder removen.\n\t\tBaseControl.Visitor delSubs = new BaseControl.Visitor() {\n\t\t\tpublic boolean visit(BaseControl host) {\n\t\t\t\tif (host != BaseControl.this) {\n\t\t\t\t\tdeleteList.add(host);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\ttravelDFS(delSubs);\n\t\t// now do the real delete to not disturb the recursion\n\t\tfor (Iterator<BaseControl> it = deleteList.iterator(); it.hasNext();) {\n\t\t\tBaseControl mortem = it.next();\n\t\t\tmortem.removeInternal();\n\t\t}\n\n\t}", "public void detachAllChildren() {\n children.clear();\n //TODO: remove child count from parent\n changed = true;\n }", "public void clearViews() {\n mView.removeAllViews();\n mChildren.clear();\n }", "@Override\n public void onDestroy() {\n widgetList.clear();\n }", "public void dispose() {\n if (children != null) {\n children.clear();\n\n children = null;\n }\n }", "@Override\n public void clearChildren() {\n for (Children c : childTrees) {\n c.clearChildren();\n }\n }", "private void clearWidgets(){\n edName.setText(null);\n rgSport.clearCheck();\n }", "public Builder clearUsedWidgets() {\n usedWidgets_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n return this;\n }", "private static void clear(){\n if(!pane.getChildren().isEmpty()){\n pane.getChildren().clear();\n }\n }", "public void removeAll () {\n\tcheckWidget ();\n\tfor (int i=0; i<itemCount; i++) {\n\t\tTableItem item = items [i];\n\t\tif (item != null && !item.isDisposed ()) item.release (false);\n\t}\n\tsetTableEmpty ();\n\tupdateRowCount();\n}", "public synchronized final void deleteWidgetWatchers() {\n _watchers.removeAllElements();\n }", "public void clear()\r\n\t{\r\n\t\tint choice = 0;\r\n\t\tchoice = JOptionPane.showConfirmDialog(null, \"Delete all widgets?\");\r\n\t\tif(choice != JOptionPane.YES_OPTION) return;\r\n\t\telse \r\n\t\t{\r\n\t\t\t/* Phil (2008-11-02): fixed the clear method so blah blah no more active objects */\r\n\t\t\tthis.activeWidget = null;\r\n\t\t\tthis.mousePosition = null;\r\n\t\t\tlevelWidgets.clear();\r\n\t\t\tworld.clear();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void clear() {\n\t\tgetChild().clear();\n\t}", "public void clear(){\n for(Body b : content) {\n b.destroy();\n }\n }", "public void guiRemoveAll() {\n \t////this wipes the frame clean, use before switching panels\n leftPanel.removeAll();\n rightPanel.removeAll();\n bottomPanel.removeAll();\n topPanel.removeAll();\n infoPanel.removeAll();\n thePanel.removeAll();\n newPanel.removeAll();\n searchBar.setText(\"\");\n frame.getContentPane().removeAll();\n frame.getContentPane().remove(thePanel);\n frame.getContentPane().remove(newPanel);\n \t frame.validate();\n frame.repaint();\n \t}", "public void removeAllElements()\n {\n for(Map.Entry entry : panels.entrySet())\n {\n Panel panel = (Panel)entry.getValue();\n panel.removeAll();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the RectoratDetail TypeCode
public org.omg.CORBA.TypeCode _type() { return RectoratDetailHelper.type(); }
[ "java.lang.String getIdentityDocTypeCode();", "public org.omg.CORBA.TypeCode _type()\n {\n return EtudiantDetailHelper.type();\n }", "public String getTypeCode();", "@Override\n\tpublic String getTypeCode() {\n\t\tif (null==this._typeCode) {\n\t\t\tthis._typeCode = this.extractTypeCode();\n\t\t}\n\t\treturn _typeCode;\n\t}", "protected String extractTypeCode() {\n\t\tString typeCode = null;\n\t\tRequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);\n\t\tif (reqCtx != null) {\n\t\t\tShowlet showlet = (Showlet) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_SHOWLET);\n\t\t\tif (showlet != null) {\n\t\t\t\tApsProperties config = showlet.getConfig();\n\t\t\t\tif (null != config) {\n\t\t\t\t\tString showletTypeCode = config.getProperty(JpwebdynamicformSystemConstants.TYPECODE_SHOWLET_PARAM);\n\t\t\t\t\tif (showletTypeCode!=null && showletTypeCode.trim().length()>0) {\n\t\t\t\t\t\ttypeCode = showletTypeCode.trim();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn typeCode;\n\t}", "public String getInstrumentTypeCode();", "public Integer getCardTypeCode() {\n return (Integer) getAttributeInternal(CARDTYPECODE);\n }", "public String getLBR_CarteiraType();", "public final String getTypeCode() {\n\t\tif(this.organizationType!=null)\n\t\t\treturn this.organizationType.getTypeCode();\n\t\telse\n\t\t\treturn \"\";\n\t}", "public static org.omg.CORBA.TypeCode type()\n {\n if (_tc == null) {\n synchronized(org.omg.CORBA.TypeCode.class) {\n if (_tc != null)\n return _tc;\n if (_working)\n return org.omg.CORBA.ORB.init().create_recursive_tc(id());\n _working = true;\n org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();\n org.omg.CORBA.StructMember []_members = new org.omg.CORBA.StructMember[3];\n\n _members[0] = new org.omg.CORBA.StructMember();\n _members[0].name = \"annee\";\n _members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort);\n _members[1] = new org.omg.CORBA.StructMember();\n _members[1].name = \"mois\";\n _members[1].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort);\n _members[2] = new org.omg.CORBA.StructMember();\n _members[2].name = \"jour\";\n _members[2].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort);\n _tc = orb.create_struct_tc(id(),\"Date\",_members);\n _working = false;\n }\n }\n return _tc;\n }", "public final String getTypeCode() {\n return typeCode;\n }", "public org.omg.CORBA.TypeCode _type()\n {\n return RMBHelper.type();\n }", "edu.umich.icpsr.ddi.SumStatType.Type.Enum getType();", "public String getCodetype() {\n return getState(false).codetype;\n }", "public TypeCode _type()\r\n {\r\n return IsPartOfHelper.type();\r\n }", "public org.omg.CORBA.TypeCode _type()\n {\n return i_TraceHelper.type();\n }", "public org.omg.CORBA.TypeCode _type()\r\n {\r\n return EtudiantInconnuHelper.type();\r\n }", "public String getDocumentTypeCode() {\n return documentTypeCode;\n }", "synchronized public static com.ericsson.otp.ic.TypeCode type() {\n \n if (_tc != null)\n return _tc;\n \n com.ericsson.otp.ic.TypeCode _tc0 =\n new com.ericsson.otp.ic.TypeCode();\n _tc0.kind(com.ericsson.otp.ic.TCKind.tk_struct);\n _tc0.id(\"IDL:com/ericsson/otp/ic/Port:1.0\");\n _tc0.name(\"Port\");\n _tc0.member_count(3);\n _tc0.member_name(0,\"node\");\n com.ericsson.otp.ic.TypeCode _tc1 =\n new com.ericsson.otp.ic.TypeCode();\n _tc1.kind(com.ericsson.otp.ic.TCKind.tk_string);\n _tc1.length(256);\n _tc0.member_type(0,_tc1);\n _tc0.member_name(1,\"id\");\n com.ericsson.otp.ic.TypeCode _tc2 =\n new com.ericsson.otp.ic.TypeCode();\n _tc2.kind(com.ericsson.otp.ic.TCKind.tk_ulong);\n _tc0.member_type(1,_tc2);\n _tc0.member_name(2,\"creation\");\n com.ericsson.otp.ic.TypeCode _tc3 =\n new com.ericsson.otp.ic.TypeCode();\n _tc3.kind(com.ericsson.otp.ic.TCKind.tk_ulong);\n _tc0.member_type(2,_tc3);\n\n _tc = _tc0;\n\n return _tc0;\n }", "public String getTypeCodeInString()\n {\n return typeCodeInString;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case number: 42 /Coverage entropy=2.14792114965299
@Test(timeout = 4000) public void test042() throws Throwable { StringReader stringReader0 = new StringReader("synchronized"); JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 1471, 595, 7); JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0); javaParserTokenManager0.getNextToken(); assertEquals(11, javaCharStream0.bufpos); assertEquals(1471, javaCharStream0.getEndLine()); }
[ "@Test(timeout = 4000)\n public void test147() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n String string0 = evaluation0.toSummaryString(true);\n assertEquals(\"=== Summary ===\\n\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test140() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.avgCost();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test153() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n \n evaluation0.useNoPriors();\n assertEquals(Double.NaN, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test152() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.weightedTrueNegativeRate();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test135() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n CostMatrix costMatrix0 = CostMatrix.parseMatlab(\".uD4;G~)**S]]\");\n Evaluation evaluation0 = new Evaluation(instances0, costMatrix0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test164() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.totalCost();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test074() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.unclassified();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test191() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.toMatrixString();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test178() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n CostMatrix costMatrix0 = new CostMatrix(0);\n Evaluation evaluation0 = new Evaluation(instances0, costMatrix0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test161() throws Throwable {\n SimpleLogistic simpleLogistic0 = new SimpleLogistic((-2795), false, true);\n AdditiveRegression additiveRegression0 = new AdditiveRegression(simpleLogistic0);\n Capabilities capabilities0 = additiveRegression0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.correlationCoefficient();\n assertEquals(Double.NaN, double0, 0.01);\n }", "@Test(timeout = 4000)\n public void test51() throws Throwable {\n JRip jRip0 = new JRip();\n Attribute attribute0 = new Attribute(\"5.55555 rounded to 2 decimal places: \", 175);\n JRip.NumericAntd jRip_NumericAntd0 = jRip0.new NumericAntd(attribute0);\n SparseInstance sparseInstance0 = new SparseInstance(1740);\n boolean boolean0 = jRip_NumericAntd0.covers(sparseInstance0);\n assertEquals(Double.NaN, jRip_NumericAntd0.getAccuRate(), 0.01);\n assertEquals(0.0, jRip_NumericAntd0.getMaxInfoGain(), 0.01);\n assertEquals(3, jRip0.getFolds());\n assertEquals(Double.NaN, jRip_NumericAntd0.getAccu(), 0.01);\n assertEquals(2.0, jRip0.getMinNo(), 0.01);\n assertFalse(boolean0);\n assertFalse(jRip0.getDebug());\n assertEquals(Double.NaN, jRip_NumericAntd0.getAttrValue(), 0.01);\n assertEquals(2, jRip0.getOptimizations());\n assertEquals(Double.NaN, jRip_NumericAntd0.getSplitPoint(), 0.01);\n assertEquals(1L, jRip0.getSeed());\n assertTrue(jRip0.getUsePruning());\n assertEquals(Double.NaN, jRip_NumericAntd0.getCover(), 0.01);\n assertTrue(jRip0.getCheckErrorRate());\n }", "@Test(timeout = 4000)\n public void test141() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = evaluation0.makeDistribution(Double.NaN);\n assertNotNull(doubleArray0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertEquals(0, doubleArray0.length);\n }", "@Test(timeout = 4000)\n public void test49() throws Throwable {\n JRip jRip0 = new JRip();\n ArrayList<Attribute> arrayList0 = new ArrayList<Attribute>();\n Instances instances0 = new Instances(\"have\", arrayList0, 850);\n Instances.mergeInstances(instances0, instances0);\n Attribute attribute0 = new Attribute(\"\", instances0, 850);\n JRip jRip1 = new JRip();\n JRip.NumericAntd jRip_NumericAntd0 = jRip0.new NumericAntd(attribute0);\n JRip.NumericAntd jRip_NumericAntd1 = jRip0.new NumericAntd(attribute0);\n jRip_NumericAntd0.splitData(instances0, 0.0, 1);\n CoverTree coverTree0 = new CoverTree();\n CoverTree coverTree1 = new CoverTree();\n JRip jRip2 = new JRip();\n System.setCurrentTimeMillis(3);\n }", "@Test(timeout = 4000)\n public void test155() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test079() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = evaluation0.makeDistribution(0.0);\n assertArrayEquals(new double[] {1.0, 0.0}, doubleArray0, 0.01);\n assertEquals(2, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n assertNotNull(doubleArray0);\n }", "@Test(timeout = 4000)\n public void test061() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numTrueNegatives(1);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test155() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[8];\n ConverterUtils.DataSource converterUtils_DataSource0 = new ConverterUtils.DataSource(instances0);\n Instance instance0 = converterUtils_DataSource0.nextElement(instances0);\n evaluation0.evaluateModelOnce(doubleArray0, instance0);\n evaluation0.toSummaryString(\".bsi\", false);\n assertEquals(1.0, evaluation0.unclassified(), 0.01);\n }", "@Test(timeout = 4000)\n public void test186() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.unclassified(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(\"\\nTotal Number of Instances 0 \\n\", string0);\n }", "@Test(timeout = 4000)\n public void test060() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.numFalsePositives((byte)74);\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The manual test only has two CacheManagers in the cluster, so there is only ever one other.
protected int expectedPeers() { return 1; }
[ "@Test\n public void testRemoteCachePeersDetectsDownCacheManagerSlow() throws InterruptedException {\n List<CacheManager> cluster = createCluster(3);\n try {\n CacheManager manager = cluster.get(0);\n\n Thread.sleep(2000);\n\n //Drop a CacheManager from the cluster\n cluster.remove(2).shutdown();\n \n //Insufficient time for it to timeout\n CacheManagerPeerProvider provider = manager.getCacheManagerPeerProvider(\"RMI\");\n for (String cacheName : manager.getCacheNames()) {\n List remotePeersOfCache1 = provider.listRemoteCachePeers(manager.getCache(cacheName));\n assertThat((List<?>) remotePeersOfCache1, hasSize(2));\n }\n } finally {\n destroyCluster(cluster);\n } \n }", "public void testManagerFlow() throws IOException, LoginException {\n if (!canRun()) {\n return;\n }\n\n // ****** Imitate JobClient code\n // Configures a task/job with both a regular file and a \"classpath\" file.\n Configuration subConf = new Configuration(conf);\n String userName = getJobOwnerName();\n subConf.set(MRJobConfig.USER_NAME, userName);\n DistributedCache.addCacheFile(firstCacheFile.toUri(), subConf);\n DistributedCache.addFileToClassPath(secondCacheFile, subConf);\n ClientDistributedCacheManager.determineTimestamps(subConf);\n ClientDistributedCacheManager.determineCacheVisibilities(subConf);\n // ****** End of imitating JobClient code\n\n Path jobFile = new Path(TEST_ROOT_DIR, \"job.xml\");\n FileOutputStream os = new FileOutputStream(new File(jobFile.toString()));\n subConf.writeXml(os);\n os.close();\n\n // ****** Imitate TaskRunner code.\n TrackerDistributedCacheManager manager = \n new TrackerDistributedCacheManager(conf, taskController);\n TaskDistributedCacheManager handle =\n manager.newTaskDistributedCacheManager(subConf);\n assertNull(null, DistributedCache.getLocalCacheFiles(subConf));\n File workDir = new File(new Path(TEST_ROOT_DIR, \"workdir\").toString());\n handle.setup(localDirAllocator, workDir, TaskTracker\n .getPrivateDistributedCacheDir(userName), \n TaskTracker.getPublicDistributedCacheDir());\n // ****** End of imitating TaskRunner code\n\n Path[] localCacheFiles = DistributedCache.getLocalCacheFiles(subConf);\n assertNotNull(null, localCacheFiles);\n assertEquals(2, localCacheFiles.length);\n Path cachedFirstFile = localCacheFiles[0];\n Path cachedSecondFile = localCacheFiles[1];\n assertFileLengthEquals(firstCacheFile, cachedFirstFile);\n assertFalse(\"Paths should be different.\", \n firstCacheFile.equals(cachedFirstFile));\n\n assertEquals(1, handle.getClassPaths().size());\n assertEquals(cachedSecondFile.toString(), handle.getClassPaths().get(0));\n\n checkFilePermissions(localCacheFiles);\n\n // Cleanup\n handle.release();\n manager.purgeCache();\n assertFalse(pathToFile(cachedFirstFile).exists());\n }", "@Test\n public void testCachesCreatedFromDefaultDoNotInteract() {\n Configuration config = new Configuration();\n config.defaultCache(new CacheConfiguration().maxEntriesLocalHeap(100));\n CacheManager manager = new CacheManager(config);\n try {\n manager.addCache(\"newfromdefault1\");\n Cache newfromdefault1 = manager.getCache(\"newfromdefault1\");\n manager.addCache(\"newfromdefault2\");\n Cache newfromdefault2 = manager.getCache(\"newfromdefault2\");\n\n assertTrue(newfromdefault1 != newfromdefault2);\n assertFalse(newfromdefault1.getName().equals(newfromdefault2.getName()));\n // status is an enum style class, so it ok for them to point to the same\n // instance if they are the same\n assertTrue(newfromdefault1.getStatus() == newfromdefault2.getStatus());\n assertFalse(newfromdefault1.getGuid() == newfromdefault2.getGuid());\n } finally {\n manager.shutdown();\n }\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void testRepeatedClusteringWithCache()\n {\n Assume.assumeTrue(Platform.getPlatform() == Platform.JAVA);\n \n final Controller controller = getCachingController(initAttributes,\n IClusteringAlgorithm.class);\n \n final Map<String, Object> processingAttributes = ImmutableMap.of(\n AttributeNames.DOCUMENTS, (Object) DOCUMENTS_DATA_MINING);\n \n controller.process(processingAttributes, getComponentClass());\n controller.process(processingAttributes, getComponentClass());\n }", "@Test\n public void testRemoteCachePeersDetectsDownCacheManager() throws InterruptedException {\n List<CacheManager> cluster = createCluster(3);\n try {\n MulticastKeepaliveHeartbeatSender.setHeartBeatStaleTime(3000);\n //Drop a CacheManager from the cluster\n cluster.remove(2).shutdown();\n assertThat(cluster, hasSize(2));\n\n //Allow change detection to occur. Heartbeat 1 second and is not stale until 5000\n waitForClusterMembership(11020, TimeUnit.MILLISECONDS, cluster);\n } finally {\n destroyCluster(cluster);\n }\n }", "@Ignore\n @Test\n public void testCacheConfigurationAreInSync() {\n Configuration configuration = new Configuration().cache(new CacheConfiguration(\"one\", 0));\n CacheManager cacheManager = new CacheManager(configuration);\n try {\n assertThat(cacheManager.getCache(\"one\").getCacheConfiguration(),\n is(cacheManager.getConfiguration().getCacheConfigurations().get(\"one\")));\n } finally {\n cacheManager.shutdown();\n }\n }", "public static CacheManager createClusteredCacheManager() {\n GlobalConfiguration globalConfiguration = GlobalConfiguration.getClusteredDefault();\n amendMarshaller(globalConfiguration);\n // amendJmx(globalConfiguration);\n Properties newTransportProps = new Properties();\n newTransportProps.put(JGroupsTransport.CONFIGURATION_STRING, JGroupsConfigBuilder.getJGroupsConfig());\n globalConfiguration.setTransportProperties(newTransportProps);\n return new DefaultCacheManager(globalConfiguration);\n }", "@Test\n public void testMemberJoinsAndRetrievesClusterListenersButMainListenerNodeDiesBeforeInstalled()\n throws TimeoutException, InterruptedException, ExecutionException {\n Cache<Object, String> cache0 = cache(0, CACHE_NAME);\n final Cache<Object, String> cache1 = cache(1, CACHE_NAME);\n\n final ClusterListener clusterListener = new ClusterListener();\n cache1.addListener(clusterListener);\n\n assertEquals(manager(0).getAddress(), manager(0).getMembers().get(0));\n\n CheckPoint checkPoint = new CheckPoint();\n waitUntilRequestingListeners(cache0, checkPoint);\n checkPoint.triggerForever(\"pre_cluster_listeners_release_\" + cache0);\n\n addClusteredCacheManager();\n\n Future<Cache<Object, String>> future = fork(() -> cache(3, CACHE_NAME));\n\n checkPoint.awaitStrict(\"post_cluster_listeners_invoked_\" + cache0, 10, TimeUnit.SECONDS);\n\n log.info(\"Killing node 1 ..\");\n // Notice we are killing the manager that doesn't have a cache with the cluster listener\n TestingUtil.killCacheManagers(manager(1));\n cacheManagers.remove(1);\n log.info(\"Node 1 killed\");\n\n checkPoint.triggerForever(\"post_cluster_listeners_release_\" + cache0);\n\n // Now wait for cache3 to come up fully\n TestingUtil.blockUntilViewsReceived(10000, false, cacheManagers);\n TestingUtil.waitForNoRebalance(caches(CACHE_NAME));\n\n Cache<Object, String> cache3 = future.get(10, TimeUnit.SECONDS);\n\n for (Object listener : cache3.getAdvancedCache().getListeners()) {\n assertFalse(listener instanceof RemoteClusterListener);\n }\n }", "@Test\n\tpublic void testAfterCacheManagerSet_1()\n\t\tthrows Exception {\n\t\tDefaultSecurityManager fixture = new DefaultSecurityManager();\n\t\tfixture.cacheManager = new HashtableCacheManager();\n\n\t\tfixture.afterCacheManagerSet();\n\n\t\t// add additional test code here\n\t}", "@Test\n public void testCreateCacheManager() throws IOException {\n Configuration config = new Configuration().cache(new CacheConfiguration(\"foo\", 100));\n String configXml = ConfigurationUtil.generateCacheManagerConfigurationText(config);\n final File configFile = File.createTempFile(\"CacheManagerTest.testCreateCacheManager\", \".xml\");\n FileWriter writer = new FileWriter(configFile);\n try {\n writer.write(configXml);\n } finally {\n writer.close();\n }\n\n Thread.currentThread().setContextClassLoader(new ClassLoader() {\n\n @Override\n public URL getResource(String name) {\n if (\"/ehcache.xml\".equals(name)) {\n try {\n return configFile.toURI().toURL();\n } catch (MalformedURLException e) {\n throw new AssertionError(e);\n }\n } else {\n return super.getResource(name);\n }\n }\n\n });\n try {\n CacheManager manager = CacheManager.create();\n try {\n assertThat(manager.getCacheNames(), arrayContaining(\"foo\"));\n } finally {\n manager.shutdown();\n }\n } finally {\n Thread.currentThread().setContextClassLoader(null);\n }\n }", "@Test\n public void testRemoveCache() throws CacheException {\n Configuration config = new Configuration().cache(new CacheConfiguration(\"foo\", 100));\n CacheManager manager = new CacheManager(config);\n try {\n assertEquals(1, manager.getConfiguration().getCacheConfigurations().size());\n assertNotNull(manager.getCache(\"foo\"));\n manager.removeCache(\"foo\");\n assertNull(manager.getCache(\"foo\"));\n\n assertEquals(0, manager.getConfiguration().getCacheConfigurations().size());\n\n // NPE tests\n manager.removeCache(null);\n manager.removeCache(\"\");\n assertEquals(0, manager.getConfiguration().getCacheConfigurations().size());\n } finally {\n manager.shutdown();\n }\n }", "@Test\n public void testCacheManagerThreads() throws CacheException,\n InterruptedException {\n final Collection<Thread> initialThreads = Collections.unmodifiableCollection(JVMUtil.enumerateThreads());\n Configuration config = new Configuration().diskStore(new DiskStoreConfiguration().path(\"${java.io.tmpdir}/CacheManagerTest/testCacheManagerThreads\"));\n for (int i = 0; i < 70; i++) {\n config.cache(new CacheConfiguration().name(Integer.toString(i)).maxEntriesLocalHeap(100).maxEntriesLocalDisk(1000)\n .persistence(new PersistenceConfiguration().strategy(Strategy.LOCALTEMPSWAP)));\n }\n CacheManager manager = new CacheManager(config);\n try {\n Collection<Thread> spawnedThreads = JVMUtil.enumerateThreads();\n spawnedThreads.removeAll(initialThreads);\n assertThat(\"Spawned Threads\", spawnedThreads, hasSize(CombinableMatcher.<Integer>both(greaterThan(0)).and(lessThanOrEqualTo(manager.getCacheNames().length + 2))));\n } finally {\n manager.shutdown();\n }\n\n /*\n * The 'termination' of a ThreadPoolExecutor does not guarantee that all\n * if it's worker threads have terminated. There is a race between\n * the worker threads terminating and evaluation this assertion. We\n * give the worker threads 10 seconds to terminate.\n */\n assertBy(10, TimeUnit.SECONDS, new Callable<Collection<Thread>>() {\n @Override\n public Collection<Thread> call() throws Exception {\n Collection<Thread> newThreads = new ArrayList<Thread>(JVMUtil.enumerateThreads());\n newThreads.removeAll(initialThreads);\n return newThreads;\n }\n }, IsEmptyCollection.<Thread>empty());\n }", "@Test\n\tpublic void testDestroyCacheManager_1()\n\t\tthrows Exception {\n\t\tDefaultSecurityManager fixture = new DefaultSecurityManager();\n\t\tfixture.cacheManager = new HashtableCacheManager();\n\n\t\tfixture.destroyCacheManager();\n\n\t\t// add additional test code here\n\t}", "@Override\n protected void runTest(Cache cache, Toolkit clusteringToolkit) {\n }", "@Bean\n CacheManager cacheManager() {\n return new HazelcastCacheManager(hazelcastInstance());\n }", "@Test\n public void testClusterShutdown_getExistingKeysFromCache() {\n for (int i = 0; i < 100; i++) {\n assertEquals(map.get(i), i);\n }\n }", "@Test\n public void testCacheSize() {\n Authenticator unit = new Authenticator(5000, 2); // only holds 2 things\n\n unit.authenticate(aCredentials);\n unit.authenticate(bCredentials);\n unit.authenticate(cCredentials);\n\n unit.authenticate(aCredentials);\n unit.authenticate(bCredentials);\n unit.authenticate(cCredentials);\n\n unit.authenticate(aCredentials);\n unit.authenticate(bCredentials);\n unit.authenticate(cCredentials);\n\n assertEquals(9, unit.getNumLoads());\n }", "@Test\n\tpublic void testGetCacheFactory_1()\n\t\tthrows Exception {\n\t\tCacheServiceImpl fixture = new CacheServiceImpl();\n\t\tfixture.setTransformerRuleDao(new TransformerRuleDaoImpl());\n\t\tfixture.setCacheFactory(new CacheFactory());\n\t\tfixture.setCacheDao(new CacheDaoImpl());\n\t\tfixture.setDynamicJdbcDao(new DynamicJdbcDaoImpl());\n\n\t\tICacheFactory<String, Object> result = fixture.getCacheFactory();\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t\tassertEquals(null, result.getCacheClient());\n\t\tassertEquals(null, result.getLocalCacheClient());\n\t\tassertEquals(null, result.getRedis());\n\t}", "@Test\n\tpublic void runDemo2(){\n\t\t CachingProvider cachingProvider = Caching.getCachingProvider(\"org.apache.commons.jcs.jcache.JCSCachingProvider\");\n\t\t run(cachingProvider);\n\t}", "@Test\n public void cachedTest() {\n // TODO: test cached\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
addNewGame Function to add a new game to the database Will return 1 if everything is ok, 0 if not, and 1 if there is a problem in the server
public int addNewGame(String gName) { response = ""; int result = 0; try{ url = new URL(APIURL+"game/addGameToDatabase"); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); //conn conn.setDoInput(true); conn.setDoOutput(true); HashMap<String, String> dataParams = new HashMap(); dataParams.put("gName", gName); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "UTF-8")); writer.write(getQuery(dataParams)); writer.flush(); writer.close(); os.close(); int responseCode = 0; String line= ""; responseCode = conn.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader br= null; try { br = new BufferedReader(new InputStreamReader(conn.getInputStream())); while ((line=br.readLine()) != null) { response+=line; } } catch (IOException ex) { ex.printStackTrace(System.out); } } else response = null; if (response!= null) { result = Integer.parseInt(response); } //result = 1; }catch(MalformedURLException ex) { result = -1; ex.printStackTrace(System.out); } catch (IOException ex) { result = -1; ex.printStackTrace(System.out); }finally{ conn.disconnect(); } return result; }
[ "public boolean addToDB() {\n final String sqlAddHighScore = \"INSERT INTO Highscore2 (Levelname, Playername, Time, Score, Credits)\" +\n \"VALUES (?, ?, ?, ?, ?);\";\n try {\n pst = conn.prepareStatement(sqlAddHighScore);\n pst.setString(1, levelName);\n pst.setString(2, playerName);\n pst.setInt(3, time);\n pst.setInt(4, score);\n pst.setInt(5, credits);\n pst.executeUpdate();\n //conn.close();\n System.out.println(\"Player added to DB\");\n return true;\n } catch(SQLException e) {\n System.err.println(e.getClass().getName() + \":\" + e.getMessage());\n System.out.println(\"Failed to add player to Highscore\");\n return false;\n }\n }", "public boolean addGame(String[] data) {\n boolean added = false;\n if (!gameExists(data[0])) {\n FileWriter fw = null;\n PrintWriter pw;\n\n try {\n fw = new FileWriter(gamesDataFilePath, true);\n pw = new PrintWriter(fw);\n String newPlayer = \"\";\n newPlayer = String.join(\" \", data);\n pw.println(newPlayer);\n fw.close();\n updateMaxId();\n added = true;\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (null != fw) {\n fw.close();\n }\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }\n\n }\n return added;\n }", "@POST\n public Response add(@Valid Game game, @Context UriInfo uriInfo) {\n \tgame.setWinner(-1);\n \t\n \t/*\n \t * Check if game object posted has an ID. If no ID is found then assign\n \t * one by adding 1 to the highest id found in the games table in \n \t * database.\n \t */\n if(game.getId() == null || game.getId() == 0) {\n \tgame.setId(gameDAO.gameIndex() + 1);\n }\n \n /*\n * Check for nextMove present in posted game object. If no nextMove is \n * present then assign to playerOne. Next, check to see if nextMove is\n * either playerOne or playerTwo.\n */\n if(game.getNextMove() == null || game.getNextMove() == 0) {\n \tgame.setNextMove(game.getPlayerOne());\n } else if((game.getNextMove() != game.getPlayerOne())\n \t\t&& (game.getNextMove() != game.getPlayerTwo())) {\n \t// return a failed response\n \treturn Response.status(Status.BAD_REQUEST).build();\n }\n \n // add row to games table\n \tgameDAO.insert(game);\n \t\n \t// build the initial gameState for the posted game\n \tGameState moveZero = new GameState();\n \tmoveZero.setGame(game.getId());\n \tmoveZero.setMoveNumber(0);\n \tmoveZero.setSlotValues(\"EEEEEEEEE\");\n \tgameStateDAO.insert(moveZero);\n \t\n \t// Build links for HATEOAS standard\n \tString uriSelf = getURIForSelf(uriInfo, game);\n \tString uriPlayerOne = getURIForPlayerOne(uriInfo, game);\n \tString uriPlayerTwo = getURIForPlayerTwo(uriInfo, game);\n \tString uriGameStates = getURIForGameStates(uriInfo, game);\n \t\n \tgame.addLink(uriSelf, \"self\");\n \tgame.addLink(uriPlayerOne, \"playerone\");\n \tgame.addLink(uriPlayerTwo, \"playertwo\");\n \tgame.addLink(uriGameStates, \"gamestates\");\n \t\n return Response.status(Status.CREATED)\n \t\t.entity(game)\n \t\t.build();\n }", "int createNewGame(Game game);", "public int addPlayer(String name, GameIf game) throws RemoteException;", "int insert(GameLogin record);", "@RequestMapping(method=RequestMethod.POST, value=\"/api/games\")\n\tpublic JSONObject addGame(@RequestBody JSONObject json) {\n\t\tString winner1 = (String) json.get(\"winner1\");\n\t\tString winner2 = (String) json.get(\"winner2\");\n\t\tString loser1 = (String) json.get(\"loser1\");\n\t\tString loser2 = (String) json.get(\"loser2\");\n\t\tGame game = new Game(winner1, winner2, loser1, loser2);\n\t\tGame newGame = gameService.addGame(game);\n\t\t\n\t\t// Calculate new teams and players elos\n\t\tteamService.calculateTeamElo(winner1, winner2, loser1, loser2);\n\t\tplayerService.calculatePlayerElo(winner1, winner2, loser1, loser2);\n\t\t\n\t\t// Get new list of teams and players\n\t\tList<Player> newPlayers = playerService.getAllPlayers();\n\t\tList<Team> newTeams = teamService.getAllTeams();\n\t\t\n\t\t// Create return value\n\t\tJSONObject returnValue = new JSONObject();\n\t\treturnValue.put(\"newGame\", newGame);\n\t\treturnValue.put(\"newTeams\", newTeams);\n\t\treturnValue.put(\"newPlayers\", newPlayers);\n\t\treturn returnValue;\n\t}", "public Game AddNewGame (Game newGame);", "public boolean createPlayedGame(PlayedGame playedGame);", "@PostMapping(\"/games\")\n public ResponseEntity<Game> createGame(@Valid @RequestBody Game game) throws URISyntaxException {\n log.debug(\"REST request to save Game : {}\", game);\n if (game.getId() != null) {\n throw new BadRequestAlertException(\"A new game cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Game result = gameService.save(game);\n return ResponseEntity.created(new URI(\"/api/games/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public static String newGame() throws IOException\n {\n String url = baseURL+\"?ID=\"+NO_ID+\"&cmd=\"+CMD_NEW_GAME;\n String result = send(url);\n return result;\n }", "@Override\n public void insertGame(Game game) throws DaoException {\n try{\n this.insertGame.setString(1,addSlashes(game.getName()));\n this.insertGame.setInt(2,game.getExp());\n this.insertGame.setString(3,addSlashes(game.getDescription()));\n this.insertGame.setString(4,addSlashes(game.getImage()));\n\n this.insertGame.executeUpdate();\n\n } catch (Exception e){\n throw new DaoException(\"Error query insertGame\", e);\n\n }\n }", "@Override\r\n\tpublic void add(Game game)throws GameException {\n\t\t\r\n\t}", "@Test\n public void testAddGetGame() {\n \n Game game = new Game();\n game.setCorrectSolution(\"1234\");\n \n testDao.addGame(game);\n \n Game gameBackFromDB = testDao.getGameById(game.getGameId());\n \n assertEquals(game, gameBackFromDB);\n }", "public void newGame() {\n\t\tgameList[gameTotal] = this;\r\n\t\tgameID = gameTotal++;\r\n\t\t\r\n\t\tString name, customRace, customGender;\r\n\t\tRace race;\r\n\t\tGender gender;\r\n\t\tAlignment alignment;\r\n\t\tGuildType guild;\r\n\t\tRace[] races = Race.values();\r\n\t\tGender[] genders = Gender.values();\r\n\t\tAlignment[] alignments = Alignment.values();\r\n\t\tGuildType[] guilds = Guild.GuildType.values();\r\n\t\tname = JOptionPane.showInputDialog(null, \"Enter name: \", \"New Game\", JOptionPane.QUESTION_MESSAGE);\r\n\r\n\t\trace = (Race) JOptionPane.showInputDialog(null, \"Choose Race: \", \"New Game\",\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, races, races[1]);\r\n\t\tif (race.equals(Race.custom)) {\r\n\t\t\tcustomRace = JOptionPane.showInputDialog(null, \"Enter custom race: \", \"New Game\",\r\n\t\t\t\t\tJOptionPane.QUESTION_MESSAGE);\r\n\t\t} else {\r\n\t\t\tcustomRace = null;\r\n\t\t}\r\n\r\n\t\tgender = (Gender) JOptionPane.showInputDialog(null, \"Choose Gender: \", \"New Game\",\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, genders, genders[1]);\r\n\t\tif (gender.equals(Gender.custom)) {\r\n\t\t\tcustomGender = JOptionPane.showInputDialog(null, \"Enter custom gender: \", \"New Game\",\r\n\t\t\t\t\tJOptionPane.QUESTION_MESSAGE);\r\n\t\t} else {\r\n\t\t\tcustomGender = null;\r\n\t\t}\r\n\r\n\t\talignment = (Alignment) JOptionPane.showInputDialog(null, \"Choose Race: \", \"New Game\",\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, alignments, alignments[0]);\r\n\t\tguild = (GuildType) JOptionPane.showInputDialog(null, \"Choose Guild: \", \"New Game\",\r\n\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, guilds, guilds[0]);\r\n\r\n\t\tthePlayer = new Player(race, customRace, gender, customGender, name, guild, alignment, 1);\r\n\t\tthePlayer.newInv(10, 10);\r\n\t\tItem newItem = new Weapon();\r\n\t\tthePlayer.getInventory().addItem(newItem);\r\n\t\tnewItem = new Armour(\"Unknown\", 1, 10, Slot.head, SubSlot.randomSubSlot(Slot.head), ArmourEffect.none, 1);\r\n\t\tthePlayer.getInventory().addItem(newItem);\r\n\t\tnewItem = new Armour(\"Unknown\", 1, 10, Slot.torso, SubSlot.randomSubSlot(Slot.torso), ArmourEffect.none, 1);\r\n\t\tthePlayer.getInventory().addItem(newItem);\r\n\t\tnewItem = new Armour(\"Unknown\", 1, 10, Slot.legs, SubSlot.randomSubSlot(Slot.legs), ArmourEffect.none, 1);\r\n\t\tthePlayer.getInventory().addItem(newItem);\r\n\t\tnewItem = new Armour(\"Unknown\", 1, 10, Slot.feet, SubSlot.randomSubSlot(Slot.feet), ArmourEffect.none, 1);\r\n\t\tthePlayer.getInventory().addItem(newItem);\r\n\t\t\r\n\t\tGame.updateGamelist();\r\n\r\n\t}", "public void addGame() {\n\t\tthis.gameCounter++;\n\t}", "@Override\r\n\tpublic GameAddResponse addGame(HashMap<String, String> params) {\r\n\t\tAddGameResponseHandler gh;\r\n\t\tGameAddResponse ur;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString querStr = URLBuilder.createQueryStr(params);\r\n\t\t\t\r\n\t\t\tLog.d(\"\",\"querStr:\"+querStr);\r\n\t\t\tLog.d(\"\", \"Url :\"+Consts.BS_ADD_GAME_ENDPOINT_URL);\r\n\t\t\tString data = htppClient.submitPostToServer(new URL(Consts.BS_ADD_GAME_ENDPOINT_URL), querStr); \r\n\t\t\tSystem.out.println(\"data \"+data);\r\n\t\t\tgh = new AddGameResponseHandler(data);\r\n\t\t\t\r\n\t\t\tur = (GameAddResponse)gh.parse();\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tur = new GameAddResponse();\r\n\t\t\tur.setStatus_code(Consts.BS_ERROR_PARSING_RESPONSE);\r\n\t\t\tur.setStatus_message(e.getMessage());\r\n\t\t} finally {\r\n\t\t\tgh = null;\r\n\t\t}\r\n\t\treturn ur;\r\n\t}", "private void addGamePlayer(int gameID, int playerNumber, int playerLocation, String colour) throws SQLException{\n String addGamePlayerQuery = \"INSERT INTO Players VALUES (?, ?, ?, ?);\";\n PreparedStatement st = null;\n\n st = con.prepareStatement(addGamePlayerQuery);\n st.setInt(1, gameID);\n st.setInt(2, playerNumber);\n st.setInt(3, playerLocation);\n st.setString(4, colour);\n st.executeUpdate();\n\n }", "public Integer startNewGame() {\n TicTacToeBoard toAdd = new TicTacToeBoard();\n toAdd.setGameState(\"occupied\");\n toAdd = dao.addGame(toAdd);\n Integer gameNumber = toAdd.getGameId();\n return gameNumber;\n }", "public void addNewGame(Game game){\n listOfGames.add(game);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
there seems to be no corresponding method on XMLDocumentFilter. just pass it down to the output, if any.
public void skippedEntity(String name) throws SAXException { if (fContentHandler != null) { fContentHandler.skippedEntity(name); } }
[ "XSLTElementProcessor(){}", "private static void filter() {\n }", "public SaxFilterMaker getSaxExtensionFilter()\n { return _xrap; }", "public XMLFilter newXMLFilter(Source src) \n\tthrows TransformerConfigurationException \n {\n\tTemplates templates = newTemplates(src);\n\tif (templates == null) return null; \n\treturn newXMLFilter(templates);\n }", "public java.lang.String getElementFilter() {\r\n return elementFilter;\r\n }", "public XMLFileFilter() {}", "private Filter() {}", "void generateOutput(TagNode node) throws SAXException;", "void filter(Filter filter);", "protected UnicodeFilter(Writer out) {\n super(out);\n }", "public String serializeOnlyFilter(Object src, Boolean cleanFilter, String... filterAttr) throws Exception;", "public interface DTMFilter {\n\n // Constants for whatToShow. These are used to set the node type that will\n // be traversed. These values may be ORed together before being passed to\n // the DTMIterator.\n\n /**\n * Show all <code>Nodes</code>.\n */\n public static final int SHOW_ALL = 0xFFFFFFFF;\n\n /**\n * Show <code>Element</code> nodes.\n */\n public static final int SHOW_ELEMENT = 0x00000001;\n\n /**\n * Show <code>Attr</code> nodes. This is meaningful only when creating an\n * iterator or tree-walker with an attribute node as its <code>root</code>;\n * in this case, it means that the attribute node will appear in the first\n * position of the iteration or traversal. Since attributes are never\n * children of other nodes, they do not appear when traversing over the main\n * document tree.\n */\n public static final int SHOW_ATTRIBUTE = 0x00000002;\n\n /**\n * Show <code>Text</code> nodes.\n */\n public static final int SHOW_TEXT = 0x00000004;\n\n /**\n * Show <code>CDATASection</code> nodes.\n */\n public static final int SHOW_CDATA_SECTION = 0x00000008;\n\n /**\n * Show <code>EntityReference</code> nodes. Note that if Entity References\n * have been fully expanded while the tree was being constructed, these\n * nodes will not appear and this mask has no effect.\n */\n public static final int SHOW_ENTITY_REFERENCE = 0x00000010;\n\n /**\n * Show <code>Entity</code> nodes. This is meaningful only when creating an\n * iterator or tree-walker with an<code> Entity</code> node as its\n * <code>root</code>; in this case, it means that the <code>Entity</code>\n * node will appear in the first position of the traversal. Since entities\n * are not part of the document tree, they do not appear when traversing\n * over the main document tree.\n */\n public static final int SHOW_ENTITY = 0x00000020;\n\n /**\n * Show <code>ProcessingInstruction</code> nodes.\n */\n public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;\n\n /**\n * Show <code>Comment</code> nodes.\n */\n public static final int SHOW_COMMENT = 0x00000080;\n\n /**\n * Show <code>Document</code> nodes. (Of course, as with Attributes and\n * such, this is meaningful only when the iteration root is the Document\n * itself, since Document has no parent.)\n */\n public static final int SHOW_DOCUMENT = 0x00000100;\n\n /**\n * Show <code>DocumentType</code> nodes.\n */\n public static final int SHOW_DOCUMENT_TYPE = 0x00000200;\n\n /**\n * Show <code>DocumentFragment</code> nodes. (Of course, as with Attributes\n * and such, this is meaningful only when the iteration root is the Document\n * itself, since DocumentFragment has no parent.)\n */\n public static final int SHOW_DOCUMENT_FRAGMENT = 0x00000400;\n\n /**\n * Show <code>Notation</code> nodes. This is meaningful only when creating\n * an iterator or tree-walker with a <code>Notation</code> node as its\n * <code>root</code>; in this case, it means that the <code>Notation</code>\n * node will appear in the first position of the traversal. Since notations\n * are not part of the document tree, they do not appear when traversing\n * over the main document tree.\n */\n public static final int SHOW_NOTATION = 0x00000800;\n\n /**\n * This bit instructs the iterator to show namespace nodes, which are\n * modeled by DTM but not by the DOM. Make sure this does not conflict with\n * {@link org.w3c.dom.traversal.NodeFilter}.\n * <p>\n * %REVIEW% Might be safer to start from higher bits and work down, to leave\n * room for the DOM to expand its set of constants... Or, possibly, to\n * create a DTM-specific field for these additional bits.\n */\n public static final int SHOW_NAMESPACE = 0x00001000;\n\n /**\n * Special bit for filters implementing match patterns starting with a\n * function. Make sure this does not conflict with\n * {@link org.w3c.dom.traversal.NodeFilter}.\n * <p>\n * %REVIEW% Might be safer to start from higher bits and work down, to leave\n * room for the DOM to expand its set of constants... Or, possibly, to\n * create a DTM-specific field for these additional bits.\n */\n public static final int SHOW_BYFUNCTION = 0x00010000;\n\n /**\n * Test whether a specified node is visible in the logical view of a\n * <code>DTMIterator</code>. Normally, this function will be called by the\n * implementation of <code>DTMIterator</code>; it is not normally called\n * directly from user code.\n *\n * @param nodeHandle\n * int Handle of the node.\n * @param whatToShow\n * one of SHOW_XXX values.\n * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP.\n */\n public short acceptNode(int nodeHandle, int whatToShow);\n\n /**\n * Test whether a specified node is visible in the logical view of a\n * <code>DTMIterator</code>. Normally, this function will be called by the\n * implementation of <code>DTMIterator</code>; it is not normally called\n * directly from user code.\n * <p>\n * TODO: Should this be setNameMatch(expandedName) followed by accept()? Or\n * will we really be testing a different name at every invocation?\n * <p>\n * %REVIEW% Under what circumstances will this be used? The cases I've\n * considered are just as easy and just about as efficient if the name test\n * is performed in the DTMIterator... -- Joe\n * </p>\n * <p>\n * %REVIEW% Should that 0xFFFF have a mnemonic assigned to it? Also: This\n * representation is assuming the expanded name is indeed split into\n * high/low 16-bit halfwords. If we ever change the balance between\n * namespace and localname bits (eg because we decide there are many more\n * localnames than namespaces, which is fairly likely), this is going to\n * break. It might be safer to encapsulate the details with a\n * makeExpandedName method and make that responsible for setting up the\n * wildcard version as well.\n * </p>\n *\n * @param nodeHandle\n * int Handle of the node.\n * @param whatToShow\n * one of SHOW_XXX values.\n * @param expandedName\n * a value defining the exanded name as defined in the\n * DTM\n * interface. Wild cards will be defined by 0xFFFF in\n * the\n * namespace and/or localname portion of the\n * expandedName.\n * @return one of FILTER_ACCEPT, FILTER_REJECT, or FILTER_SKIP.\n */\n public short acceptNode(int nodeHandle, int whatToShow, int expandedName);\n\n}", "public void visit(Filter rootFilter, Resource filteredResource) {\r\n\t\tEObject target = rootFilter.getTarget();\r\n\t\tif (copier == null) {\r\n\t\t\tcopier = new FilterCopier(true);\r\n\t\t}\r\n\t\tif (target != null) {\r\n//\t\t\tif (hasSubFilter(rootFilter)) {\r\n\t\t\t\tEObject copyEObject = copier.copy(target);\r\n\t\t\t\tfilteredResource.getContents().add(copyEObject);\r\n\t\t\t\t// filter sub content\r\n\t\t\t\tfor (Filter subFilter : rootFilter.getSubFilters()) {\r\n\t\t\t\t\tvisit(subFilter, target, copyEObject);\r\n\t\t\t\t}\r\n//\t\t\t} \r\n\t\t\t// no need with check box editor\r\n//\t\t\telse {\r\n//\t\t\t\t// all sub content is filtered\r\n//\t\t\t\tEObject copy = EcoreUtil.copy(target);\r\n//\t\t\t\tfilteredResource.getContents().add(copy);\r\n//\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public abstract ByteArrayOutputStream renderDocument2XML(lotus.domino.Document doc);", "@Override\n public void doXML(HttpServletRequest request, HttpServletResponse response, SWBParamRequest paramRequest) throws SWBResourceException, IOException\n {\n try\n {\n org.w3c.dom.Document dom=getDom(request, response, paramRequest);\n if(dom!=null) {\n response.getWriter().println(SWBUtils.XML.domToXml(dom));\n }\n }\n catch(Exception e){ log.error(e); } \n }", "@Override\r\n\tpublic int filterOrder() {\n\t\treturn 2;\r\n\t}", "@Override\n\tpublic void updateAfterFilterApply() {\n\t\t\n\t}", "public boolean isXMLShouldBeReturn();", "@Override\n public void parseDocument() {\n\n }", "FilterObject getFilter();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@SuppressWarnings("unchecked") @Override public String getNextAuctionId() { String result = ""; try { Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = 1 + cal.get(Calendar.MONTH); String mm = (month + "").length() == 1 ? "0" + month : "" + month; // DESCO/CS/AUCTION/2016/11/001 Session session = sessionFactory.getCurrentSession(); Query query = session .createQuery("select distinct (auctionName) from AuctionProcessMst order by auctionName desc"); List<String> objList = query.list(); if (objList == null || objList.size() == 0) { result = "DESCO/CS/AUCTION/" + year + "/" + mm + "/001"; } else { String lastAucId = objList.get(0); String[] temp = lastAucId.split("/"); lastAucId = temp[temp.length - 1]; int id = Integer.parseInt(lastAucId) + 1; lastAucId = String.format("%03d", id); result = "DESCO/CS/AUCTION/" + year + "/" + mm + "/" + lastAucId; } return result; } catch (Exception e) { logger.error(e.getMessage()); return null; } }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assigns the specified color to the snake.
private void chooseColor() { Color[] colors = {new Color(0,255,127), new Color(250,128,114), new Color(176,224,230), new Color(240,230,140)}; color = colors[position]; }
[ "public Color setStoneColor();", "public void change_color()\r\n\t{\r\n\t\tint n = rand.nextInt(block.colors.length);\r\n\t\tfor(Circle temp : this.saanp)\r\n\t\t{\r\n\t\t\ttemp.setFill(block.colors[n]);\r\n\t\t}\r\n\t}", "public void setColour(Color colour){\n whichColour = colour;\n }", "public void setColor(Color color) { this.color = color;\t}", "void setTint(int color);", "public void setColor(int _color){\n particlePaint.setColor(_color);\n }", "@Override\r\n\tpublic void setColor(int color) {\r\n\r\n\t}", "public void setColor(Color color){\n this.color = color;\n }", "public void setColor(PlayerColor color) {\n this.color = color;\n }", "public void setColor(Color color)\r\n {\r\n this.color = color;\r\n }", "public void setColor(Color color){\n this.color = color;\n }", "public void setColor(Color color)\r\n {\r\n this.color = color;\r\n }", "public void setColor( Color color )\n {\n this.color = color;\n }", "public void setColor()\r\n {\r\n if (square != null) // only if it's painted already...\r\n {\r\n square.changeColor(\"red\");\r\n person.changeColor(\"blue\");\r\n triangle.changeColor(\"green\");\r\n circle.changeColor(\"yellow\");\r\n }\r\n }", "public void establece_color(String color){\r\n\t\tthis.color=color;\r\n\t}", "public void setColor(Color color) {\n\tthis.color = color;\n }", "void setColor(Color col);", "public void setColour(Colour c){\n this.turn = c;\n }", "public void setColor(String c)\n {\n\n /* missing code */\n }", "void setBackgroundColor(double color);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this is called from GoAnalysis
String[] getReferenceGeneList() { String listString = referenceList.getText().trim(); if (listString.length() == 0) return null; return listString.split(",| "); }
[ "protected abstract void runAnalysis();", "public Object analyze();", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "public void mo17751g() {\n }", "private static void EX5() {\n\t\t\r\n\t}", "public void mo28221a() {\n }", "public void paly() {\n\t\t\n\t}", "@Override\n\tpublic void analyzing(DependencyFrame rFrame) {\n\t}", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n }", "private void mutationTypeAnalysis(){\r\n\r\n mta.setAnalytics(this);\r\n StaticConsoleLogger.logActivity(iteration, Activity.mutationTypeAnalysis, Activity.started);\r\n mta.handleStep1Tasks();\r\n mta.handleStep2Tasks(); \r\n StaticConsoleLogger.logActivity(iteration, Activity.mutationTypeAnalysis, Activity.finished); \r\n mta.logHMSizes();\r\n \r\n }", "@Override\n public void extornar() {\n \n }", "private void generaStatistiche() {\n\t\t\t\r\n\t\t}", "protected void mo4791d() {\n }", "@Override\n\tpublic void miseAJour() {\n\t\t\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}", "private Report()\n\t\t{\n\t\t\t\n\t\t}", "@Override\n\tvoid statisticsImpl()\n\t{\n\t}", "@Override\n\t\tpublic void visitGraph(GraphData graph) {\n\n\t\t}", "public void LegPain() {\n\t\t\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance.
public Builder() { namesAndValuesBuilder = new ImmutableListMultimap.Builder<>(); }
[ "public Create() {\n\t\t\tsuper();\n\t\t}", "T createNewInstance();", "public void create() { }", "@SuppressWarnings(\"unchecked\")\n\tpublic static JSONObject createInstance() {\n\t\tJSONObject json = new JSONObject();\n\t\ttry {\n\t\t\tjson = makeRequest(URL + \"/instance\", \"POST\");\n\t\t} catch (Exception e) {\n\t\t\tjson.put(\"type\", \"ERROR\");\n\t\t}\n\n\t\t\treturn json;\n\t}", "public void create(T newInstance);", "public static void createInstance() {\n instance = new ReverseStartRepository();\n }", "private static synchronized void createInstance() {\n if (instance == null) {\n instance = new DefaultMorphologyFactory();\n }\n }", "public static void createNewInstance() {\n INSTANCE = new Graph();\n }", "private T newInstance() {\r\n T result;\r\n try {\r\n result = constructor.newInstance();\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n }\r\n if (isConfigurable && configuration != null) {\r\n ((Configurable) result).setConf(configuration);\r\n }\r\n return result;\r\n }", "private static synchronized void createInstance()\n {\n instance = new DataProviderFactory();\n }", "private synchronized static void createInstance()\r\n\t{\r\n\t\tif (INSTANCE == null)\r\n\t\t\tINSTANCE = new PublicTransport();\r\n\t\treturn;\r\n\t}", "public T newInstance()\n\t{\n\t\ttry\n\t\t{\n\t\t\tT t = concreteClass.newInstance();\n\t\t\tUUIDInjector.inject(t);\n\t\t\treturn t;\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tLogUtils.logFormat(log, LogLevel.ERROR, MESSAGE_CANNOT_INSTANCIATE, concreteClass.toString(), ex);\n\t\t\treturn null;\n\t\t}\n\t}", "public void createInstance() {\r\n\t\t// System.out.println(\"createInstance \" + title);\r\n\t\t// Make sure that the display and timing element lists are empty\r\n\t\tdestroyInstance();\r\n\t\t// Create this Display object's ExPar descriptor array for\r\n\t\t// later use\r\n\t\tcreateExParFields();\r\n\t\t// Always enter the background field first\r\n\t\tenterBackgroundField();\r\n\t\t// Then ask the display for initialization. This enters the\r\n\t\t// display element types into the display list and associates\r\n\t\t// the display elements with their color indices. No size\r\n\t\t// dependent computations are done at this point.\r\n\t\tinitialDisplayElementIndex = create();\r\n\t}", "EntityInstance createEntityInstance();", "public MonsterInstance createInstance()\n\t{\n\t\tMonsterInstance newMonster = new MonsterInstance(this);\n\t\t\n\t\treturn newMonster;\n\t}", "private synchronized static void createInstance() {\n\t\tif(instance == null) {\n\t\t\tinstance = new Preferences();\t\t\t\n\t\t}\n\t}", "public Item createInstance() {\n\t\t// Primary Key values\n\n\t\treturn createInstance( mockValues.nextInteger() );\n\t}", "public static ExternalStorageState createInstance(Context applicationContext) {\n\t\tif (instance == null) {\n\t\t\tinstance = new ExternalStorageState(applicationContext);\n\t\t}\n\t\treturn instance;\n\t}", "T createInstance(SimpleApplication application);", "InstanceBuilder newInstance(String type, String name, String version);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Since the getAllSubmissionStatuses totally invoke method in persistence, We just use MOCK persistence class to prove it is invoked properly.
public void testGetAllSubmissionStatuses_Accuracy() { SubmissionStatus submissionStatus = DeliverableTestHelper.getValidToPersistSubmissionStatus(); submissionStatus.setId(2); try { assertEquals("getAllUploadStatus doesn't work.", submissionStatus.getId(), (persistenceUploadManager.getAllSubmissionStatuses())[0].getId()); } catch (IllegalArgumentException e) { fail("IllegalArgumentException should not be thrown."); } catch (UploadPersistenceException e) { fail("UploadPersistenceException should not be thrown."); } }
[ "public void testSubmissionStatusPersistence() throws Exception {\r\n SubmissionStatus[] submissionStatuses = new SubmissionStatus[10];\r\n\r\n for (int i = 0; i < submissionStatuses.length; i++) {\r\n submissionStatuses[i] = new SubmissionStatus();\r\n submissionStatuses[i].setSubmissionStatusId(i + 0L);\r\n submissionStatuses[i].setDescription(\"description\" + i);\r\n }\r\n\r\n long time = System.currentTimeMillis();\r\n session.beginTransaction();\r\n\r\n for (int i = 0; i < submissionStatuses.length; i++) {\r\n session.save(submissionStatuses[i]);\r\n }\r\n\r\n time = System.currentTimeMillis() - time;\r\n System.out.println(\"Stress test for SubmissionStatus took \" + time + \"ms\");\r\n\r\n // check the entity saved\r\n assertEquals(\"The value should be matched.\", submissionStatuses[0],\r\n session.get(SubmissionStatus.class,\r\n submissionStatuses[0].getSubmissionStatusId()));\r\n }", "@Test\n public void getListOfQuestions() {\n manualRepository.save(query);\n // stubbing the mock to return specific data\n when(manualRepository.findAll()).thenReturn(anyList());\n List<Query> userQueryList = manualService.getListOfQuestions();\n Assert.assertEquals(anyList(), userQueryList);\n }", "ExpenseStatus[] retrieveAllStatuses() throws PersistenceException;", "@Test\n @Transactional\n public void getAllBendHistsByIdStatusIsEqualToSomething() throws Exception {\n ListObjectStatus idStatus = bendHist.getIdStatus();\n bendHistRepository.saveAndFlush(bendHist);\n Long idStatusId = idStatus.getId();\n\n // Get all the bendHistList where idStatus equals to idStatusId\n defaultBendHistShouldBeFound(\"idStatusId.equals=\" + idStatusId);\n\n // Get all the bendHistList where idStatus equals to idStatusId + 1\n defaultBendHistShouldNotBeFound(\"idStatusId.equals=\" + (idStatusId + 1));\n }", "@Test\n void shouldReturnUncommittedChange()\n {\n Set<String> expected = Set.of(\"/myTest/myTestEntity/myProcess/process.js\");\n\n IFileStatus fileStatus = mock(IFileStatus.class);\n Optional<IFileStatus> optionalIFileStatus = Optional.of(fileStatus);\n doReturn(Set.of(\"/myTest/myTestEntity/myProcess/process.js\")).when(fileStatus).getUncommittedChanges();\n\n Set<String> result = deployLocalChangesAction.getAllUncommittedChanges(optionalIFileStatus);\n\n assertAll(\n () -> verify(fileStatus).getUncommittedChanges(),\n () -> verify(fileStatus).getUntracked(),\n () -> assertEquals(expected, result)\n );\n }", "@Override\n public Collection<Status> getAllStatuses() throws SessionException{\n try{\n logger.info(\"Getting all status from BD.\");\n List data=em.createNamedQuery(\"findAllStatus\").getResultList();\n return data;\n }catch(Exception e){\n throw new SessionException(e.getMessage());\n }\n \n }", "public void testSubmissionPersistence() throws Exception {\r\n Submission[] submissions = new Submission[10];\r\n for (int i = 0; i < submissions.length; i++) {\r\n submissions[i] = createSubmission(i);\r\n }\r\n\r\n long time = System.currentTimeMillis();\r\n session.beginTransaction();\r\n for (int i = 0; i < submissions.length; i++) {\r\n session.save(submissions[i]);\r\n }\r\n time = System.currentTimeMillis() - time;\r\n System.out.println(\"Stress test for Submission took \" + time + \"ms\");\r\n\r\n // check the entity saved\r\n assertEquals(\"The value should be matched.\", submissions[0], session.get(Submission.class, submissions[0]\r\n .getSubmissionId()));\r\n }", "@Test\n final void testGetAll() {\n List<Subreddit> list = logic.getAll();\n //store the size of list, this way we know how many accounts exits in DB\n int originalSize = list.size();\n\n //make sure account was created successfully\n assertNotNull( expectedEntity );\n //delete the new account\n logic.delete( expectedEntity );\n\n //get all accounts again\n list = logic.getAll();\n //the new size of accounts must be one less\n assertEquals( originalSize - 1, list.size() );\n }", "@SuppressWarnings(\"deprecation\")\r\n @Test\r\n public void updateStatusHistory() throws PAException {\n final Session s = PaHibernateUtil.getCurrentSession();\r\n\r\n final Date date = DateUtils.truncate(new Date(), Calendar.DAY_OF_MONTH);\r\n InterventionalStudyProtocol spNew = createInterventionalProtocol();\r\n\r\n StudyOverallStatus sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.IN_REVIEW);\r\n sos.setStatusDate(new Timestamp(DateUtils.addDays(date, -5).getTime()));\r\n sos.setAdditionalComments(\"Additional comment 4\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n s.saveOrUpdate(sos);\r\n\r\n sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.ACTIVE);\r\n sos.setStatusDate(new Timestamp(DateUtils.addDays(date, -2).getTime()));\r\n sos.setAdditionalComments(\"Additional comment 3\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n s.saveOrUpdate(sos);\r\n s.flush();\r\n\r\n List<StudyOverallStatusDTO> hist = bean.getByStudyProtocol(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n\r\n StudyOverallStatusDTO inReview = hist.get(0);\r\n StudyOverallStatusDTO active = hist.get(1);\r\n\r\n StudyOverallStatusDTO dto = new StudyOverallStatusDTO();\r\n dto.setStatusCode(CdConverter.convertToCd(StudyStatusCode.APPROVED));\r\n dto.setStatusDate(TsConverter.convertToTs(DateUtils.addDays(date, -3)));\r\n dto.setDeleted(BlConverter.convertToBl(true));\r\n hist.add(1, dto);\r\n\r\n active.setDeleted(BlConverter.convertToBl(true));\r\n active.setAdditionalComments(StConverter.convertToSt(\"Deleted\"));\r\n\r\n inReview.setStatusDate(TsConverter.convertToTs(DateUtils.addDays(date,\r\n -30)));\r\n inReview.setAdditionalComments(StConverter.convertToSt(\"Updated\"));\r\n\r\n StudyOverallStatusDTO closed = new StudyOverallStatusDTO();\r\n closed.setStatusCode(CdConverter\r\n .convertToCd(StudyStatusCode.CLOSED_TO_ACCRUAL));\r\n closed.setStatusDate(TsConverter.convertToTs(date));\r\n hist.add(closed);\r\n\r\n bean.updateStatusHistory(\r\n IiConverter.convertToStudyProtocolIi(spNew.getId()), hist);\r\n\r\n hist = bean.getByStudyProtocolWithTransitionValidations(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n assertEquals(2, hist.size());\r\n\r\n assertEquals(StudyStatusCode.IN_REVIEW.getCode(), hist.get(0)\r\n .getStatusCode().getCode());\r\n assertEquals(DateUtils.addDays(date, -30), hist.get(0).getStatusDate()\r\n .getValue());\r\n assertEquals(\"Updated\", hist.get(0).getAdditionalComments().getValue());\r\n\r\n assertEquals(StudyStatusCode.CLOSED_TO_ACCRUAL.getCode(), hist.get(1)\r\n .getStatusCode().getCode());\r\n assertEquals(date, hist.get(1).getStatusDate().getValue());\r\n\r\n hist = bean.getDeletedByStudyProtocol(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n assertEquals(1, hist.size());\r\n assertEquals(active.getIdentifier().getExtension(), hist.get(0)\r\n .getIdentifier().getExtension());\r\n assertTrue(BlConverter.convertToBool(hist.get(0).getDeleted()));\r\n\r\n }", "@Test\n public void testSubmitReviewStatusUpdate() {\n System.out.println(\"testSubmitReviewStatusUpdate\");\n setUpBusinessReview(); \n ProposalApplicableReview linkedInstance = proposalInstance.getProposalApplicableReviewFor(proposalInstance.getLastProposalReview());\n assertEquals(linkedInstance.getReviewStatus().toString(),\"Completed\");\n }", "public interface IOrderStatusTypeService {\n\n /*******************************************************************************************************************\n * B U S I N E S S M E T H O D S\n *******************************************************************************************************************/\n\n\n /*******************************************************************************************************************\n * P E R S I S T E N C E M E T H O D S\n *******************************************************************************************************************/\n\n /**\n * Adds a new orderStatusType to the storage.\n *\n * @param model a data object\n * @return OrderStatusType a data object with the primary key\n */\n dbGarmentHibernate.entity.OrderStatusType addOrderStatusType(dbGarmentHibernate.entity.OrderStatusType model) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Stores the <code>OrderStatusType</code>.\n *\n * @param model the data model to store\n */\n void saveOrderStatusType(dbGarmentHibernate.entity.OrderStatusType model) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Removes a orderStatusType.\n *\n * @param id the unique reference for the orderStatusType\n */\n void deleteOrderStatusType(java.lang.Integer id) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Retrieves a data object from the storage by its primary key.\n *\n * @param id the unique reference\n * @return OrderStatusType the data object\n */\n dbGarmentHibernate.entity.OrderStatusType getOrderStatusType(java.lang.Integer id) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Returns a list of all orderStatusType instances.\n *\n * @return a list of OrderStatusType objects.\n */\n java.util.List<dbGarmentHibernate.entity.OrderStatusType> getOrderStatusTypeList() throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Returns a subset of all orderStatusType instances.\n *\n * @param startIndex the start index within the result set (1 = first record);\n * any zero/negative values are regarded as 1, and any values greater than or equal to\n * the total number of orderStatusType instances will simply return an empty set.\n * @param endIndex the end index within the result set (<code>getOrderStatusTypeListSize()</code> = last record),\n * any values greater than or equal to the total number of orderStatusType instances will cause\n * the full set to be returned.\n * @return a collection of OrderStatusType objects, of size <code>(endIndex - startIndex)</code>.\n * throws GenericBusinessException if the chosen underlying data-retrieval mechanism does not support returning partial result sets.\n */\n java.util.List<dbGarmentHibernate.entity.OrderStatusType> getOrderStatusTypeList(int startIndex, int endIndex) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n * Obtains the total number of orderStatusType objects in the storage.\n * <b>NOTE:</b>If this session fašade is configured <b>not</b> to use the FastLaneReader,\n * this call will be very computationally wasteful as it will first have to retrieve all entities from\n * the entity bean's <code>findAll</code> method.\n *\n * @return an integer value.\n */\n int getOrderStatusTypeListSize() throws dbGarmentHibernate.exception.GenericBusinessException;\n\n /**\n *\n * Retrieves a list of data object for the specified idOrderStatusType field.\n *\n * @param idOrderStatusType the field\n * @return List of OrderStatusType data objects, empty list in case no results were found.\n */\n java.util.List<dbGarmentHibernate.entity.OrderStatusType> findOrderStatusTypeByIdOrderStatusType(java.lang.Integer idOrderStatusType) throws dbGarmentHibernate.exception.GenericBusinessException;\n /**\n *\n * Retrieves a list of data object for the specified orderStatusName field.\n *\n * @param orderStatusName the field\n * @return List of OrderStatusType data objects, empty list in case no results were found.\n */\n java.util.List<dbGarmentHibernate.entity.OrderStatusType> findOrderStatusTypeByOrderStatusName(java.lang.String orderStatusName) throws dbGarmentHibernate.exception.GenericBusinessException;\n\n\n}", "@Test\n @Order(1)\n void testGetAll_usesCSavingsAccountRepositoryFindAllJoined() {\n savingsAccountService.getAll();\n verify(savingsAccountRepository).findAllJoined();\n verifyNoMoreInteractions(savingsAccountRepository);\n }", "@Test\n\tvoid getQuestionsByCreatedOn() {\n\t\tDate date = new Date();\n\t\tTimestamp ts = new Timestamp(date.getTime());\n\t\tint id = 1;\n\t\tList<Question> allQuestions = new ArrayList<Question>();\n\t\tQuestion question1 = new Question();\n\t\tQuestion question2 = new Question();\n\t\tquestion1.setId(1);\n\t\tquestion1.setContent(\"something\");\n\t\tquestion1.setCreatedOn(ts);\n\t\tquestion2.setId(2);\n\t\tquestion2.setContent(\"something again\");\n\t\tquestion2.setCreatedOn(ts);\n\t\tMockito.when(repo.findByCreatedOn(ts)).thenReturn(Stream.of(question1, question2).collect(Collectors.toList()));\n\n\t\t\n\t\tallQuestions = serv.getQuestionsByCreatedOn(ts);\n\t\tAssertions.assertEquals(2, allQuestions.size());\n\t}", "@Test\r\n public void testGetStatusHistoryByProtocol() throws PAException {\n final Session s = PaHibernateUtil.getCurrentSession();\r\n\r\n final Date date = DateUtils.truncate(new Date(), Calendar.DAY_OF_MONTH);\r\n InterventionalStudyProtocol spNew = createInterventionalProtocol();\r\n\r\n StudyOverallStatus sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL);\r\n sos.setStatusDate(new Timestamp(date.getTime()));\r\n sos.setAdditionalComments(\"Additional comment 1\");\r\n sos.setCommentText(\"Why stopped 1\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n s.saveOrUpdate(sos);\r\n\r\n sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL_AND_INTERVENTION);\r\n sos.setStatusDate(new Timestamp(date.getTime()));\r\n sos.setAdditionalComments(\"Additional comment 2\");\r\n sos.setCommentText(\"Why stopped 2\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n s.saveOrUpdate(sos);\r\n\r\n sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.ACTIVE);\r\n sos.setStatusDate(new Timestamp(DateUtils.addDays(date, -1).getTime()));\r\n sos.setAdditionalComments(\"Additional comment 3\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n s.saveOrUpdate(sos);\r\n\r\n sos = new StudyOverallStatus();\r\n sos.setStudyProtocol(spNew);\r\n sos.setStatusCode(StudyStatusCode.IN_REVIEW);\r\n sos.setStatusDate(new Timestamp(DateUtils.addDays(date, -2).getTime()));\r\n sos.setAdditionalComments(\"Additional comment 4\");\r\n sos.setUserLastUpdated(CSMUserService.getInstance().getCSMUser(\r\n UsernameHolder.getUser()));\r\n sos.setDateLastUpdated(new Date());\r\n sos.setDeleted(true);\r\n s.saveOrUpdate(sos);\r\n\r\n s.flush();\r\n\r\n List<StatusDto> hist = bean.getStatusHistoryByProtocol(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n assertEquals(3, hist.size());\r\n\r\n assertEquals(StudyStatusCode.ACTIVE.name(), hist.get(0).getStatusCode());\r\n assertEquals(new Timestamp(DateUtils.addDays(date, -1).getTime()), hist\r\n .get(0).getStatusDate());\r\n assertEquals(\"Additional comment 3\", hist.get(0).getComments());\r\n assertTrue(StringUtils.isBlank(hist.get(0).getReason()));\r\n assertNotNull(hist.get(0).getId());\r\n\r\n assertEquals(StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL.name(), hist\r\n .get(1).getStatusCode());\r\n assertEquals(new Timestamp(date.getTime()), hist.get(1).getStatusDate());\r\n assertEquals(\"Additional comment 1\", hist.get(1).getComments());\r\n assertEquals(\"Why stopped 1\", hist.get(1).getReason());\r\n assertNotNull(hist.get(1).getId());\r\n\r\n assertEquals(\r\n StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL_AND_INTERVENTION\r\n .name(),\r\n hist.get(2).getStatusCode());\r\n assertEquals(new Timestamp(date.getTime()), hist.get(2).getStatusDate());\r\n assertEquals(\"Additional comment 2\", hist.get(2).getComments());\r\n assertEquals(\"Why stopped 2\", hist.get(2).getReason());\r\n assertNotNull(hist.get(2).getId());\r\n\r\n // Additionally, ensure the current status is properly determined as\r\n // well by other bean methods.\r\n StudyOverallStatusDTO current = bean\r\n .getCurrentByStudyProtocol(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n assertEquals(\r\n StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL_AND_INTERVENTION,\r\n CdConverter.convertCdToEnum(StudyStatusCode.class,\r\n current.getStatusCode()));\r\n\r\n // Additionally, ensure getByProtocol methods sorts in the same order as\r\n // history.\r\n List<StudyOverallStatusDTO> list = bean.getByStudyProtocol(IiConverter\r\n .convertToStudyProtocolIi(spNew.getId()));\r\n assertEquals(3, list.size());\r\n assertEquals(StudyStatusCode.ACTIVE, CdConverter.convertCdToEnum(\r\n StudyStatusCode.class, list.get(0).getStatusCode()));\r\n assertEquals(StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL,\r\n CdConverter.convertCdToEnum(StudyStatusCode.class, list.get(1)\r\n .getStatusCode()));\r\n assertEquals(\r\n StudyStatusCode.TEMPORARILY_CLOSED_TO_ACCRUAL_AND_INTERVENTION,\r\n CdConverter.convertCdToEnum(StudyStatusCode.class, list.get(2)\r\n .getStatusCode()));\r\n\r\n }", "@Test\n public void testGetAllArtists(){\n final List<Artist> databaseList = new ArrayList();\n when(artistRepository.getAllArtists()).thenReturn(databaseList);\n List<Artist> returnedList = artistService.getAllArtists();\n assertEquals(\"Asserting getAllArtists\", databaseList, returnedList);\n }", "@Test\n public void testJustImpl() {\n final BaseAmountImpl targetPersistence = new BaseAmountImpl();\n\n final OpenJPAEntityManager openJpaEM = context.mock(OpenJPAEntityManager.class);\n context.checking(new Expectations() {\n {\n oneOf(persistenceEngine).getEntityManager(); will(returnValue(openJpaEM));\n oneOf(openJpaEM).setIgnoreChanges(true);\n }\n });\n\n listener.preUpdateJobEntryHook(null, targetPersistence);\n }", "public void testManageEntity() throws Exception {\n // first a DBConnectionFactory instance is created.\n DBConnectionFactory connectionFactory = new DBConnectionFactoryImpl(DBConnectionFactoryImpl.class.getName());\n\n // then create the instance of SqlUploadPersistence class\n UploadPersistence persistence = new SqlUploadPersistence(connectionFactory);\n\n // ////////\n // load the Upload object from the persistence\n Upload upload = persistence.loadUpload(1);\n // the above loading can be batched.\n Upload[] uploads = persistence.loadUploads(new long[] {1, 2, 3});\n\n // add a new Upload object to the persistence\n Upload upload2 = new Upload();\n upload2.setId(4);\n upload2.setProject(upload.getProject());\n upload2.setOwner(upload.getOwner());\n upload2.setUploadType(upload.getUploadType());\n upload2.setUploadStatus(upload.getUploadStatus());\n upload2.setParameter(upload.getParameter());\n upload2.setCreationUser(upload.getCreationUser());\n upload2.setCreationTimestamp(upload.getCreationTimestamp());\n upload2.setModificationUser(upload.getModificationUser());\n upload2.setModificationTimestamp(upload.getModificationTimestamp());\n persistence.addUpload(upload2);\n\n // update the Upload object to the persistence\n upload2.setParameter(\"new param\");\n upload2.setDescription(\"new desc\");\n persistence.updateUpload(upload2);\n\n // finally the Upload object can be removed from the persistence\n persistence.removeUpload(upload2);\n\n // ////////\n // load the UploadType object from the persistence\n UploadType uploadType = persistence.loadUploadType(1);\n // the above loading can be batched.\n UploadType[] uploadTypes = persistence.loadUploadTypes(new long[] {1, 2, 3});\n\n // add a new UploadType object to the persistence\n UploadType uploadType2 = new UploadType();\n uploadType2.setId(10);\n uploadType2.setName(uploadType.getName());\n uploadType2.setDescription(uploadType.getDescription());\n uploadType2.setCreationUser(uploadType.getCreationUser());\n uploadType2.setCreationTimestamp(uploadType.getCreationTimestamp());\n uploadType2.setModificationUser(uploadType.getModificationUser());\n uploadType2.setModificationTimestamp(uploadType.getModificationTimestamp());\n persistence.addUploadType(uploadType2);\n\n // update the UploadType object to the persistence\n uploadType2.setDescription(\"new description\");\n persistence.updateUploadType(uploadType2);\n\n // finally the UploadType object can be removed from the persistence\n persistence.removeUploadType(uploadType2);\n\n // ////////\n // load the UploadStatus object from the persistence\n UploadStatus uploadStatus = persistence.loadUploadStatus(1);\n // the above loading can be batched.\n UploadStatus[] uploadStatuses = persistence.loadUploadStatuses(new long[] {1, 2, 3});\n\n // add a new UploadStatus object to the persistence\n UploadStatus uploadStatus2 = new UploadStatus();\n uploadStatus2.setId(10);\n uploadStatus2.setName(uploadStatus.getName());\n uploadStatus2.setDescription(uploadStatus.getDescription());\n uploadStatus2.setCreationUser(uploadStatus.getCreationUser());\n uploadStatus2.setCreationTimestamp(uploadStatus.getCreationTimestamp());\n uploadStatus2.setModificationUser(uploadStatus.getModificationUser());\n uploadStatus2.setModificationTimestamp(uploadStatus.getModificationTimestamp());\n persistence.addUploadStatus(uploadStatus2);\n\n // update the UploadStatus object to the persistence\n uploadStatus2.setDescription(\"new description\");\n persistence.updateUploadStatus(uploadStatus2);\n\n // finally the UploadStatus object can be removed from the persistence\n persistence.removeUploadStatus(uploadStatus2);\n\n // ////////\n // load the SubmissionStatus object from the persistence\n SubmissionStatus submissionStatus = persistence.loadSubmissionStatus(1);\n // the above loading can be batched.\n SubmissionStatus[] submissionStatuses = persistence.loadSubmissionStatuses(new long[] {1, 2, 3});\n\n // load submission type\n SubmissionType submissionType = persistence.loadSubmissionType(1L);\n\n // add a new SubmissionStatus object to the persistence\n SubmissionStatus submissionStatus2 = new SubmissionStatus();\n submissionStatus2.setId(10);\n submissionStatus2.setName(submissionStatus.getName());\n submissionStatus2.setDescription(submissionStatus.getDescription());\n submissionStatus2.setCreationUser(submissionStatus.getCreationUser());\n submissionStatus2.setCreationTimestamp(submissionStatus.getCreationTimestamp());\n submissionStatus2.setModificationUser(submissionStatus.getModificationUser());\n submissionStatus2.setModificationTimestamp(submissionStatus.getModificationTimestamp());\n persistence.addSubmissionStatus(submissionStatus2);\n\n // save submission\n Submission submission = new Submission(823);\n submission.setCreationUser(\"admin\");\n submission.setCreationTimestamp(new Date());\n submission.setModificationUser(\"admin\");\n submission.setModificationTimestamp(new Date());\n submission.setSubmissionStatus(submissionStatus);\n submission.setSubmissionType(submissionType);\n submission.setThumb(true);\n submission.setUserRank(2);\n submission.setExtra(true);\n submission.setUploads(Arrays.asList(persistence.loadUpload(1)));\n\n persistence.addSubmission(submission);\n\n // remove the created submission\n persistence.removeSubmission(submission);\n\n // update the SubmissionStatus object to the persistence\n submissionStatus2.setDescription(\"new description\");\n persistence.updateSubmissionStatus(submissionStatus2);\n\n // finally the SubmissionStatus object can be removed from the\n // persistence\n persistence.removeSubmissionStatus(submissionStatus2);\n\n // for UploadType, UploadStatus SubmissionStatus, SubmissionType, we can get all their\n // ids in the database\n long[] ids1 = persistence.getAllUploadTypeIds();\n long[] ids2 = persistence.getAllUploadStatusIds();\n long[] ids3 = persistence.getAllSubmissionStatusIds();\n long[] ids4 = persistence.getAllSubmissionTypeIds();\n }", "@Transactional\n public JobWorspaceResponseBean findAllJobsForShareProfileToHiringManager(String jobStatus) throws Exception {\n User loggedInUser = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n log.info(\"Inside job list for hiring Manager for HMId: {}\", loggedInUser.getId());\n long startTime = System.currentTimeMillis();\n\n List<Job> listOfLiveJobs = jobRepository.getLiveJobListForHiringManager(loggedInUser.getId());;\n List<Job> listOfDraftJobs = jobRepository.findJobByDeepQuestionSelectedByAndStatus(loggedInUser.getId(), \"Draft\");;\n JobWorspaceResponseBean responseBean = new JobWorspaceResponseBean();\n\n if(IConstant.JobStatus.PUBLISHED.getValue().equalsIgnoreCase(jobStatus)){\n responseBean.setListOfJobs(listOfLiveJobs);\n responseBean.getListOfJobs().forEach( job-> {\n if(!Arrays.asList(job.getRecruiter()).contains(null)) {\n job.setRecruiterList(userRepository.findByIdIn(Arrays.asList(job.getRecruiter()).stream()\n .mapToLong(Integer::longValue)\n .boxed().collect(Collectors.toList())));\n }\n });\n //set per stage count for every job\n getCandidateCountByStage(listOfLiveJobs, loggedInUser.getId());\n }\n else if(IConstant.JobStatus.DRAFT.getValue().equalsIgnoreCase(jobStatus)) {\n responseBean.setListOfJobs(listOfDraftJobs);\n responseBean.getListOfJobs().forEach(job -> {\n if (!Arrays.asList(job.getRecruiter()).contains(null)) {\n job.setRecruiterList(userRepository.findByIdIn(Arrays.asList(job.getRecruiter()).stream()\n .mapToLong(Integer::longValue)\n .boxed().collect(Collectors.toList())));\n }\n });\n } else {\n log.info(\"received request with wrong job status\");\n throw new WebException(\"status : \"+ jobStatus +\" does not exist \",HttpStatus.UNPROCESSABLE_ENTITY);\n }\n responseBean.setLiveJobs(listOfLiveJobs.size());\n responseBean.setDraftJobs(listOfDraftJobs.size());\n\n log.info(\"Completed getJobListForHiringManager in {} ms\", System.currentTimeMillis() - startTime);\n return responseBean;\n }", "private void mockAchievementList(){\n List<BaseAchievementConfig> achievementList = new LinkedList<>();\n // Arbitrary list of achievements\n achievementList.add(genAchievement(\"A1\", \"SILVER\"));\n achievementList.add(genAchievement(\"A1\",\"BRONZE\"));\n achievementList.add(genAchievement(\"A1\",\"GOLD\"));\n achievementList.add(genAchievement(\"A2\", \"BRONZE\"));\n achievementList.add(genAchievement(\"A2\",\"SILVER\"));\n achievementList.add(genAchievement(\"A3\",\"BRONZE\"));\n achievementList.add(genAchievement(\"A4\",\"SILVER\"));\n achievementList.add(genAchievement(\"A5\",\"GOLD\"));\n // Mock the static method and return the generated list\n gameRecordsMockedStatic.when(() -> GameRecords.getAchievementsByGame(Mockito.anyInt()))\n .thenReturn(achievementList);\n }", "@Test\n\tpublic void testGetSubmissionDetails04() throws Exception {\n\t\tQuestionnaireConfig qc = configService.getQuestionnaireConfig(\"test-questionnaire.xml\", \"0.1\", false);\n\t\tDisplayQuestionnaire dq = new DisplayQuestionnaire(qc);\n\t\tassertNotNull(dq);\n\t\tfinal long submissionId = submissionService.createNewSubmission(\"test-tgsd04\", dq, SubmissionStatus.SUBMITTED);\n\t\tResultHandler assertResponseIsFailure = new ResultHandler() {\n\t\t\t@Override\n\t\t\tpublic void handle(MvcResult result) throws Exception {\n\t\t\t\tassertEquals(\"application/json\", result.getResponse().getHeader(\"content-type\"));\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tResponseGetDatasetSummary resp = gson.fromJson(result.getResponse().getContentAsString(), ResponseGetDatasetSummary.class);\n\t\t\t\tassertFalse(resp.isSuccess());\n\t\t\t\tassertNull(resp.getPayload());\n\t\t\t\tassertFalse(resp.isPendingPublish());\n\t\t\t}\n\t\t};\n\t\tmockMvc.perform(get(\"/integration/datasetSummary/\"+submissionId))\n .andExpect(status().isOk())\n .andDo(assertResponseIsFailure);\n\t\tsubmissionDao.updateSubmissionStatus(submissionId,SubmissionStatus.DELETED); //FIXME do we need to actually delete the row or is this enough?\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Examines the comboBoxModel state and calculates the prospective value if abbreviations were applied.
public String getAbbreviatedLabel() { StringBuilder result = new StringBuilder(); for (ComboBoxModel model : models) { if (result.length() > 0) { result.append(' '); } result.append(model.getSelectedItem()); } return result.toString(); }
[ "private void comboZip_SelectionChangeCommitted(Object sender, System.EventArgs e) throws Exception {\n textCity.Text = ((ZipCode)ZipCodes.ALFrequent[comboZip.SelectedIndex]).City;\n textState.Text = ((ZipCode)ZipCodes.ALFrequent[comboZip.SelectedIndex]).State;\n textZip.Text = ((ZipCode)ZipCodes.ALFrequent[comboZip.SelectedIndex]).ZipCodeDigits;\n }", "private void updateComboList(String colName, Tab tab) {\n DefaultComboBoxModel comboBoxSearchModel = new DefaultComboBoxModel();\r\n comboBoxValue.setModel(comboBoxSearchModel);\r\n Map comboBoxForSearchValue = new HashMap();\r\n JTable table = tab.getTable();\r\n Set uniqueSearchValues = new HashSet();\r\n \r\n //Corinne 7//19/2016\r\n //the combobox values are loaded from tab class\r\n //load the unique column values for each tab\r\n for(Map.Entry<Integer, Tab> entry: tabs.entrySet()){\r\n comboBoxForSearchValue = entry.getValue().loadingDropdownList();\r\n \r\n for (int col = 0; col < table.getColumnCount(); col++) {\r\n if (table.getColumnName(col).equalsIgnoreCase(colName)) {\r\n ArrayList<Object> columnValues = (ArrayList<Object>)comboBoxForSearchValue.get(col);\r\n if (columnValues != null){\r\n uniqueSearchValues.addAll(columnValues);\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n ArrayList<Object> dropDownList = new ArrayList<Object> (uniqueSearchValues); \r\n if (colName.equalsIgnoreCase(\"programmer\")){\r\n Collections.sort(dropDownList, new ProgrammerComparator());\r\n int listLength = dropDownList.size();\r\n for (int i = 0; i < listLength; i++)\r\n { \r\n if (dropDownList.get(i) != null){\r\n String currentProgrammer = dropDownList.get(i).toString();\r\n if(inactiveProgrammers.contains(currentProgrammer))\r\n {\r\n dropDownList.add(i, SEPARATOR);\r\n break;\r\n }\r\n }\r\n } \r\n comboBoxValue.setRenderer(new ComboBoxRenderer());\r\n comboBoxValue.addActionListener(new BlockComboListener(comboBoxValue));\r\n } \r\n\r\n if (colName.equalsIgnoreCase(\"dateOpened\") || colName.equalsIgnoreCase(\"dateClosed\") || colName.equalsIgnoreCase(\"app\") ) {\r\n Collections.sort(dropDownList, new Comparator<Object>() {\r\n public int compare(Object o1, Object o2) {\r\n return o2.toString().toLowerCase().compareTo(o1.toString().toLowerCase());\r\n }\r\n\r\n });\r\n\r\n } else if (colName.equalsIgnoreCase(\"rk\")) {\r\n if (dropDownList.get(0) == \"\") {\r\n ArrayList<Object> list = new ArrayList<Object>();\r\n\r\n for (int i = 1; i < dropDownList.size(); i++) {\r\n list.add(dropDownList.get(i));\r\n }\r\n list.add(dropDownList.get(0));\r\n\r\n dropDownList = list;\r\n }\r\n }\r\n if (colName.equalsIgnoreCase(\"app\") || colName.equalsIgnoreCase(\"programmer\")) {\r\n\r\n Collections.sort(dropDownList, new NullComparator()); \r\n }\r\n\r\n comboBoxStartToSearch = false;\r\n for (Object item : dropDownList) {\r\n\r\n comboBoxSearchModel.addElement(item);\r\n\r\n// comboBoxForSearch.setSelectedItem(\"Enter \" + colName + \" here\");\r\n// comboBoxStartToSearch = true;\r\n }\r\n }", "private double calculateComboPrice(){\n return this.mainDish.getPrice() + this.drink.getPrice()\n + this.dessert.getPrice() - this.calculateComboDiscount();\n }", "@Override\n public Object getValue() {\n value = combo.getSelectedItem();\n return value;\n }", "private void calculateResult() {\n try {\r\n double res = Converter.convert(categoryIndex,\r\n (String) (spFromType.getSelectedItem()),\r\n (String) (spToType.getSelectedItem()),\r\n Double.parseDouble(edFromValue.getText().toString()));\r\n String newVal = String.valueOf(res);\r\n edToValue.setText(newVal);\r\n } catch (Exception e) {\r\n // here get if input is empty\r\n edToValue.setText(\"\");\r\n }\r\n }", "public String xMath () { return (String) xm_cb.getSelectedItem(); }", "@FXML\n public void comboBoxChange(ActionEvent event) {\n switch (state) {\n case OVERVIEW:\n overview(event);\n break;\n case TARGET:\n targetGPA(event);\n break;\n case ESTIMATE:\n estimateGPA(event);\n break;\n case CUMULATIVE:\n cumulativeGPA(event);\n break;\n }\n }", "private void calcPriceCombo() {\r\n\t\tSystem.out.println(\"*** Calculating Price of Combos ***\");\r\n\t\tfor (String combo : comboList) {\r\n\t\t\tString[] itemArr = combo.split(\"#\");\r\n\t\t\tDouble price = 0.0;\r\n\t\t\tfor (String item : itemArr) {\r\n\t\t\t\tint indx = availItems.indexOf(item);\r\n\t\t\t\tprice += itemPrice.get(indx);\r\n\t\t\t}\r\n\t\t\tcomboPrice.add(price);\r\n\t\t}\r\n\t\t\r\n\t\t//Calculating closeness of each combination with DollarAmount\r\n\t\tfor (Double cp : comboPrice) {\r\n\t\t\tcloseness.add(Math.abs(X - cp));\r\n\t\t}\r\n\t}", "@Override\n\t\t\t\tpublic void modifyText(ModifyEvent e) {\n\t\t\t\t\tif (!carryString.isEmpty()) {\n\n\t\t\t\t\t\t// Use a 2nd string to prevent an event loop\n\t\t\t\t\t\tString carryString2 = carryString;\n\t\t\t\t\t\tcarryString = \"\";\n\t\t\t\t\t\tcombo.setText(carryString2);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the content of the combo box\n\t\t\t\t\tString s = combo.getText();\n\n\t\t\t\t\t// Get list of all billing accounts\n\t\t\t\t\tArrayList<DataSetList> billing_accounts = Data.INSTANCE.getListEntries().getActiveDatasetsByCategory(\"billing_accounts\");\n\n\t\t\t\t\t// Search for the billing account with the same name as in the cell\n\t\t\t\t\tfor (DataSetList billing_account : billing_accounts) {\n\t\t\t\t\t\tif (billing_account.getStringValueByKey(\"name\").equalsIgnoreCase(s) && !s.isEmpty()) {\n\n\t\t\t\t\t\t\t// Get the VAT value from the billing account list\n\t\t\t\t\t\t\tString vatName = billing_account.getStringValueByKey(\"value\");\n\n\t\t\t\t\t\t\t// Get the VAT entry with the same name\n\t\t\t\t\t\t\tDataSetVAT vat = Data.INSTANCE.getVATs().getDataSetByStringValue(\"name\", vatName, DataSetVAT.getPurchaseTaxString());\n\n\t\t\t\t\t\t\t// Search also for the description\n\t\t\t\t\t\t\tif (vat == null)\n\t\t\t\t\t\t\t\tvat = Data.INSTANCE.getVATs().getDataSetByStringValue(\"description\", vatName, DataSetVAT.getPurchaseTaxString());\n\n\t\t\t\t\t\t\t// Update the VAT cell in the table\n\t\t\t\t\t\t\tif (vat != null) {\n\t\t\t\t\t\t\t\titem.setIntValueByKey(\"vatid\", vat.getIntValueByKey(\"id\"));\n\t\t\t\t\t\t\t\tvoucherEditor.getTableViewerItems().update(item, null);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}", "public void updateScalarBys(JComboBox cb) {\n String strs[]; Object sel = cb.getSelectedItem();\n cb.removeAllItems();\n strs = KeyMaker.scalarBlanks(getRTParent().getRootBundles().getGlobals());\n for (int i=0;i<strs.length;i++) cb.addItem(strs[i]);\n if (sel == null) cb.setSelectedIndex(0); else cb.setSelectedItem(sel);\n }", "public String yMath () { return (String) ym_cb.getSelectedItem(); }", "@Override\n protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {\n Dimension result = new Dimension();\n\n ListCellRenderer renderer = comboBox.getRenderer();\n if (renderer == null) {\n renderer = new DefaultListCellRenderer();\n }\n\n boolean sameBaseline = true;\n\n ComboBoxModel model = comboBox.getModel();\n int modelSize = model.getSize();\n int baseline = -1;\n Dimension d;\n\n Component cpn;\n\n if (modelSize > 0) {\n for (int i = 0; i < modelSize; i++) {\n // Calculates the maximum height and width based on the largest\n // element\n Object value = model.getElementAt(i);\n Component c = renderer.getListCellRendererComponent(\n listBox, value, -1, false, false);\n d = mygetSizeForComponent(c);\n result.width = Math.max(result.width, d.width);\n result.height = Math.max(result.height, d.height);\n }\n result.width += 20;\n } else {\n result = getDefaultSize();\n if (comboBox.isEditable()) {\n result.width = 100;\n }\n }\n\n if (result.width > 600) {\n result.width = 600;\n }\n return super.computePopupBounds(px, py, Math.max(result.width, pw), ph);\n }", "private void formatoCombobox(){\r\n formatoReligion();\r\n formatoEstados();\r\n formatoEstadoCivil();\r\n formatoEscolaridad();\r\n formatoHigiene();\r\n formatoTipoActividad();\r\n formatoVecesAl();\r\n formatoPreferenciaSexual();\r\n formatoSangre();\r\n formatoCalidadAli();\r\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tswitch((String)comboBox.getSelectedItem()){\n\t\t\t\t\tcase (\"100000 - 150000\"): precio = 150000; break;\n\t\t\t\t\tcase (\"150000 - 200000\"): precio = 200000;break;\n\t\t\t\t\tcase (\"200000 - 250000\"): precio = 250000;break;\n\t\t\t\t\tcase (\"mas de 250000\"): precio = 300000;break;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}", "public Case getPionCombo();", "public void itemStateChanged(ItemEvent event) {\r\n if (event.getSource() == modelJComboBox) {\r\n model = modelJComboBox.getSelectedIndex();\r\n if (model == UNIFORM_DISTANCE) dist.setProbability(0.5);\r\n else dist.setProbability(1.0 / 3);\r\n reset();\r\n } else super.itemStateChanged(event);\r\n }", "public Object getValue() {\n int i = combo.getSelectionIndex();\n Object value = null;\n if (i == -1) {\n // value does not match an entry in the combos list so the\n // user must have typed in the value manually\n value = combo.getText();\n } else {\n // the value was found in the list so return the real value.\n value = presentableItems[i].realValue;\n }\n return value;\n }", "private void updateLocation() throws SQLException {\r\n locationComboBox.removeAll();\r\n ArrayList<String> locationOptions = new ArrayList();\r\n locationOptions.add(\"ALL\");\r\n if (mainCgSet.size() > 0) {\r\n String sql;\r\n sql = \"select distinct city || ',' || state as loc from yelp_business t\" \r\n + bidFilter + \" order by loc\";\r\n System.out.println(sql);\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(sql);\r\n int cnt = 0;\r\n while (rs.next()) {\r\n cnt++;\r\n locationOptions.add(rs.getString(1));\r\n\r\n } \r\n System.out.println(\"return: \" + cnt + \" rows.\");\r\n }\r\n\r\n locationComboBox.setModel(new DefaultComboBoxModel(locationOptions.toArray()));\r\n locationComboBox.revalidate();\r\n locationComboBox.repaint();\r\n }", "double getCostForCurrentState();", "public String getSelectedBUnit(){\n return comboItemBUnit.getSelectedItem().toString();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle Set request in Q4
public String q4Set(String tweetid, String seq, String fields, String payloads) { // add to the seq map if not exist if (steps.get(tweetid) == null) { steps.put(tweetid, 1); } Integer current = Integer.parseInt(seq); // start time of block long start = System.currentTimeMillis(); while (current > steps.get(tweetid)) { long end = System.currentTimeMillis(); if (end - start > 500) { // timeout break; } try { // offer time for other Servlet threads to execute Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } // servlet may parse "+" as space payloads = payloads.replaceAll(" ", "+"); PreparedStatement stmt = null; // all fields to modify String[] field = fields.split(","); // all encoded payload String[] payload = payloads.split(","); // generate sql statement try { String sql = "INSERT INTO twitterq4 (tweetid,"; for(int i=0;i<field.length;i++){ sql=sql+field[i]+","; } sql = sql.substring(0,sql.length()-1) +")"; sql = sql + " values (?,"; for(int i=0;i<field.length;i++){ sql=sql+"?,"; } sql = sql.substring(0,sql.length()-1) +")"; // if the tweet id already exist, then only update sql = sql + " ON DUPLICATE KEY UPDATE "; for(int i=0;i<field.length;i++){ sql=sql+ field[i] + "=values("+field[i]+"),"; } sql = sql.substring(0,sql.length()-1) +";"; if (robin >= conns.length) { robin = 0; } // access the connections with round robin strategy stmt = conns[robin].prepareStatement(sql); stmt.setLong(1, Long.parseLong(tweetid)); for(int i=0;i<field.length;i++){ if (i < payload.length) { stmt.setString(i+2, payload[i]); } else { // empty payload stmt.setString(i+2, ""); } } robin++; // execute sql statement int res = stmt.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { if (stmt != null) { try { stmt.close(); } catch (SQLException e) { e.printStackTrace(); } } } // update the seq map steps.put(tweetid, current + 1); return "Apollo,9969-9464-1635\nsuccess\n"; }
[ "public void setQ(Q newQ);", "public Reply remoteSetValues(Request request) \n\tthrows ProtocolException\n {\n\tInputStream in = getInputStream(request);\n\t//Get the target resource to act on:\n\tResourceReference rr = lookup(request);\n\ttry {\n\t Resource r = rr.lock();\n\t ResourceDescription descr = \n\t\tAdminReader.readResourceDescription(in);\n\t AttributeDescription attrs[] = descr.getAttributeDescriptions();\n\t for (int i = 0 ; i < attrs.length ; i++) {\n\t\tAttributeDescription ad = attrs[i];\n\t\tr.setValue(ad.getName(), ad.getValue());\n\t }\n\t} catch (InvalidResourceException irex) {\n\t irex.printStackTrace();\n\t error(request, \"Invalid resource\");\n\t} catch (IOException ioex) {\n\t error(request, \"bad request\");\n\t} catch (AdminProtocolException apex) {\n\t error(request, apex.getMessage());\n\t} finally {\n\t rr.unlock();\n\t}\n\t// All the changes done, return OK:\n\treturn okReply(request);\n }", "@Test\n public void testSet() {\n HashSet<Object> aSet = new HashSet<Object>();\n aSet.add(1);\n aSet.add(\"2\");\n Object result = function.execute(null, null, null, aSet, null);\n assertEquals(result, aSet);\n }", "private void executeSet(Session session, CallStatement.CallStatementEntry entry, \n Resource resource) throws EngineException {\n try {\n OntologyClass ontologyClass = LsRDFTypeUtil.getOntologyClass(resource);\n List<OntologyProperty> properties = ontologyClass.listProperties();\n Object parameter = this.assignmentValue;\n String propertyName = entry.getName();\n for (OntologyProperty property : properties) {\n if (property.getLocalname().equalsIgnoreCase(propertyName)) {\n String propertyType = property.getType().getURI().toString();\n if (XSDDataDictionary.isBasicTypeByURI(propertyType)) {\n resource.setProperty(property.getURI().toString(),parameter);\n } else {\n RequestData dataParameter = (RequestData)parameter;\n session.persist(dataParameter.getData());\n resource.setProperty(property.getURI().toString(), \n session.get(Resource.class, \n new URI(dataParameter.getDataType() + \"/\" + \n dataParameter.getId())));\n }\n this.target.getData().setData(session.dumpXML());\n return;\n }\n }\n\n } catch (Exception ex) {\n throw new EngineException(\"Failed to execute the getter because : \" \n + ex.getMessage(),ex);\n }\n }", "protected void processSetRequest(SetRequest request){\r\n\t\tSetResponse response = null;\r\n\t\tDMPEvent event = null;\r\n\t\t\r\n\t\tif (request.isTrackingEnabled())\r\n\t\t\tlogger.trace(\"Processing set request for: \" + request.getTarget().getKeyAsString());\r\n\t\t\r\n\t\tDmwNamedObjectWrapper wrapper = theCache.get(request.getTarget().getName());\r\n\t\t\r\n\t\tif (wrapper == null){\r\n\t\t\tresponse = (SetResponse) request.getErrorResponse();\r\n\t\t\tresponse.setResponseText(\"Could not find object to modify: \" + request.getTarget().getKeyAsString());\r\n\t\t}\r\n\t\telse{\r\n\t\t\t// TODO: validation\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t// If anything changed in the object, applyModifier() returns true\r\n\t\t\t\t// and we create an event to report the changes\r\n\t\t\t\tif (wrapper.applyModifier(request.getModifyAttribute()))\r\n\t\t\t\t\tevent = createModifyEvent(request,wrapper);\r\n\t\t\t\t\t\r\n\t\t\t\tresponse = request.getResponse();\r\n\t\t\t\tresponse.setLastResponse(true);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tresponse = (SetResponse) request.getErrorResponse();\r\n\t\t\t\tresponse.setResponseText(\"Modification failed for object: \" + request.getTarget().getKeyAsString() + \"\\n\" + e.toString());\r\n\t\t\t\tlogger.error(\"Modification failed for object: \" + request.getTarget().getKeyAsString() + \"\\n\" + e.toString());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Fire back the response\r\n\t\trequestTracker.processResponse(response);\r\n\r\n\t\tif (event != null)\r\n\t\t\tforwardEvent(event);\r\n\t}", "public void add2Set(String setName,Object... value){\n BoundSetOperations<String, Object> setOperations = redisTemplate.boundSetOps(setName);\n setOperations.add(value);\n }", "abstract MyList set(int index, String setVal);", "abstract protected void set(Object value);", "public interface SetProxy { void set(String name, Object val); }", "@Override\n protected void setValue(Settable target, Void value) {\n target.setValue();\n }", "void set(Object editedObject, Object value);", "private void handleSetRequest(ProviderRequest request, WorkSource source) {\n this.mProviderRequest = request;\n this.mWorkSource = source;\n updateEnabled();\n updateRequirements();\n }", "public static void $($ mcq, String set){\r\n\t\tmcq.set(set);\r\n\t}", "public void setNSRLSet(HashDb set) {\r\n this.nsrlSet = set;\r\n //save();\r\n }", "public void set( T obj ){\n prevNode.set(node_index_prev,obj);\n// lastItemReturnedT = obj;\n }", "@Override\n public void accept(T val) {\n set(val);\n }", "@Override\n\tpublic void setValue() {\n\t\t\n\t}", "public void setAnswers(Set<Answer> answers);", "public CompletableFuture<Void> set(T value) {\n return submit(Set.builder()\n .withValue(value)\n .build());\n }", "public void setEGQueryResult(EGQueryResultType param){\n \n this.localEGQueryResult=param;\n \n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UPDATE THE LEVEL TO FIT THE BACKGROUDN IMAGE SIZE
public void updateBackgroundImage(String newBgImage) { level.backgroundImageFileName = newBgImage; try { backgroundImage = ImageIO.read(new File(PATH_LEVELS + level.backgroundImageFileName)); } catch (IOException e) { } int levelWidth = backgroundImage.getWidth(null); int levelHeight = backgroundImage.getHeight(null); }
[ "public static void stageResized() {\n\t\tdrawStaticGui();\n\t\tcloseStep.setPosition(p.width - stepGUIPadding - 30 - 1, stepGUIPadding + 2);\n\t\thelp.setPosition(p.width - stepGUIPadding - 60 - 1, stepGUIPadding + 2);\n\t}", "private void adjustGrassImage() {\n\r\n\t\tfinal double SCALE = 0.5;\r\n\t\tfinal double ZERO_ADJUSTMENT = 1.3;\r\n\r\n\t\tdouble grassHeight = energy * SCALE / MAX_ENERGY;\r\n\t\tdouble zeroHeight = -(GRASS_SIZE + ZERO_ADJUSTMENT);\r\n\t\tsetHeightAboveTerrain(zeroHeight + grassHeight);\r\n\t}", "@Override\n public void settings() {\n size(500, 500);\n\n\n }", "public void setLevel(Drawable lvl) {\r\n\t\tSystem.out.println(\"Set level\");\r\n\t\ttoDraw = lvl;\r\n\t\twidth = (int) toDraw.getWidth();\r\n\t\theight = (int) toDraw.getHeight();\r\n\t\tint xos = jf.getInsets().left + jf.getInsets().right + 1;\r\n\t\tint yos = jf.getInsets().top + jf.getInsets().bottom + 1;\r\n\t\tjf.setSize((width * boxWidth) + xloc + xos, (height * boxHeight) + yloc + yos);\r\n\t\tlagometer.setWidth(jf.getWidth()/2); \r\n\t\tfpsometer.setWidth(jf.getWidth()/2);\r\n\t\theapometer.setWidth(jf.getWidth());\r\n\t\tchatBox.setWidth((int) (width*boxWidth*.75));\r\n\t\tSystem.out.println(\"I make picture now\");\r\n\t\tupdate(0, 0, 0);\r\n\t}", "private void addLevel() {\n int new_size = (1 - lastLevelSize * degree) / (1 - degree);\n resize(new_size);\n\n lastLevelSize = (int) Math.pow(degree, ++height);\n }", "@Override\n public void WalkingDownMode() {\n Image image = new Image(new File(\"src/main/resources/pics/Characters/BarbarianWalk_Down.png\").toURI().toString());\n ImagePattern imagePattern = new ImagePattern(image);\n super.getPicHandler().setFill(imagePattern);\n super.getPicHandler().setWidth(20);\n super.getPicHandler().setHeight(20);\n super.getPicHandler().setX(super.getX_Current());\n super.getPicHandler().setY(super.getY_Current());\n }", "public void updateSize() {\n\t\tupdate();\n\t\tselY = fieldHeight / 2 + paddingTop;\n\t\tsc.setMaxMin(selMaxX, selMinX, selMaxY, selMinY);\n\t\tcpHueSlider.updateSize(fieldWidth, fieldHeight);\n\t}", "public abstract void backpatchSize(final int size);", "@Override\n\tpublic void updateImage() {\n\t\t\n\t}", "@Override\n\tpublic void draw(Graphics2D g2d, int xOffset, int yOffset) {\n\t\tg2d.drawImage(IMAGE, (int) locx - xOffset, (int) locy + yOffset, null);\n\t\tif (locx < HakkStage.WIDTH) {\n\t\t\tg2d.drawImage(IMAGE, (int) locx - xOffset + HakkStage.LEVEL_WIDTH,\n\t\t\t\t\t(int) locy + yOffset, null);\n\n\t\t\t// g2d.fillOval((int) (locx - (size / 2)) - xOffset\n\t\t\t// + HakkStage.LEVEL_WIDTH, (int) (locy - (size / 2))\n\t\t\t// + yOffset, (int) size, (int) size * 4);\n\n\t\t} else if (locx > HakkStage.LEVEL_WIDTH - HakkStage.WIDTH) {\n\t\t\tg2d.drawImage(IMAGE, (int) locx - xOffset - HakkStage.LEVEL_WIDTH,\n\t\t\t\t\t(int) locy + yOffset, null);\n\t\t\t// g2d.drawImage(IMAGE, (int) locx, (int) locy, null);\n\t\t\t//\n\t\t\t// g2d.fillOval((int) (locx - (size / 2)) - xOffset\n\t\t\t// - HakkStage.LEVEL_WIDTH, (int) (locy - (size / 2))\n\t\t\t// + yOffset, (int) size, (int) size * 4);\n\t\t}\n\n\t}", "public void setScale(double s) {\n scale = Math.max(0.1, scale + s);\n\n lvlW = (LevelEditor.LEVEL_WIDTH - 1) * scaleValue(LevelEditor.TILE_WIDTH);\n lvlH = LevelEditor.LEVEL_HEIGHT * scaleValue(LevelEditor.TILE_HEIGHT);\n }", "public void applySize() {\n\t\tsuper.applySize();\n\n\n int x = initCololrs(distance, false, null, null, null, null);\n x = initPen(x, false, null);\n initOthers(x, false, null, null, null, null);\n\t}", "private void changeSize() {\n y.setLocation((int)(width/1.45),(int)(height/1.636));\r\n y.setSize((int)width/10,(int)height/11);\r\n r.setLocation((int)(width/1.266),(int)(height/1.636));\r\n r.setSize((int)width/10,(int)height/11);\r\n g.setLocation((int)(width/1.45),(int)(height/1.420));\r\n g.setSize((int)width/10,(int)height/11);\r\n p.setLocation((int)(width/1.266),(int)(height/1.420));\r\n p.setSize((int)width/10,(int)height/11);\r\n b.setLocation((int)(width/1.45),(int)(height/1.256));\r\n b.setSize((int)width/10,(int)height/11);\r\n bl.setLocation((int)(width/1.266),(int)(height/1.256));\r\n bl.setSize((int)width/10,(int)height/11);\r\n y.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/64)));\r\n r.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/70)));\r\n g.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/64)));\r\n p.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/64)));\r\n b.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/77.5)));\r\n bl.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/64)));\r\n label.setBounds((int) (width / 32), 0, (int) ((width/1.9) - (width / 32) - (width / 32)), (int) (height / 53));\r\n prev.setBounds(0, 0, (int) (width / 32), (int) (height / 53));\r\n next.setBounds((int) ((width/1.9) - (width / 32)), 0, (int) (width / 32), (int) (height / 53));\r\n cardContainer.setBounds((int)(width/1.514), (int)(height/27), (int)(width/3.918), (int)(height/2.16));\r\n cardContainer.setSize((int) width, (int) height); //Method to set the content of the card to correct size\r\n cardInstr.setBounds((int)(width/1.4),(int)(height/1.792),(int)(width/4.8),(int)(height/21.6));\r\n cardInstr.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/27)));\r\n cardInstr.setFont(new Font(\"Serif\", Font.BOLD, (int)(height/27)));\r\n nextCard.setLocation((int)(width/1.25),(int)(height/1.958));\r\n nextCard.setSize((int)width/9,(int)height/21);\r\n nextCard.setFont(new Font(\"TimesRoman\", Font.BOLD, (int)(height/50)));\r\n button1.setFont(new Font(\"TimesRoman\", Font.BOLD, (int)(height/50)));\r\n button1.setLocation((int)(width/1.5),(int)(height/1.958));\r\n button1.setSize((int)width/9,(int)height/21);\r\n \r\n //Set bounds and font for music and hack:\r\n startStop.setLocation((int)(width/3.69),(int)(height/1.26));\r\n startStop.setSize((int)(width/5.4857),(int)(height/13.5));\r\n startStop.setFont(new Font(\"Rockwell\", Font.BOLD, (int)(height/54)));\r\n hack.setFont(new Font(\"Rockwell\", Font.BOLD, (int)(height/63.529)));\r\n hack.setLocation((int)(width/24),(int)(height/1.26));\r\n hack.setSize((int)(width/5.486),(int)(height/13.5));\r\n hack.setFont(new Font(\"Rockwell\", Font.BOLD, (int)(height/63.529)));\r\n \r\n //Set bounds and heights for calendar and menu:\r\n calContainer.setBounds(0, (int) height / 40, (int) (width/1.9), (int)(height/1.31204819277108));\r\n table.setRowHeight((int) (height / 8));\r\n pane.setBounds(0, (int) (height / 52.9), (int) (width / 1.9), (int) ((height/1.301204819277108) - (height / 20)));\r\n menuBar.setBounds(0, 0, (int) width, (int) height / 40);\r\n \r\n //Set bounds for random junk\r\n panel4.setSize((int)(width/3),(int)(height/5));\r\n panel4.setLocation((int)(width/3.5),(int)(height/2.561));\r\n textField.setFont(new java.awt.Font(\"TIMES NEW ROMAN\", Font.ITALIC | Font.BOLD, (int)(height/77.14)));\r\n X.setLocation((int)(width/1.6725),(int)(height/2.76));\r\n X.setSize((int)width/45,(int)height/35);\r\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 - dataStorage.getVideoWidth()) / 2, (drawH - dataStorage.getVideoHeight()) / 2, (drawW - dataStorage.getVideoWidth()) / 2, (drawH - dataStorage.getVideoHeight()) / 2);\r\n parentWindow.invalidate();\r\n }", "private void adjustSize(Image img) {\n \tint w,h, imgW,imgH;\n \n \tif (img == null) return;\n \tif (sizeStep >= 0) {\n \t imgW = sizes[sizeStep][0];\n \t imgH = sizes[sizeStep][1];\n \t} else {\n \t imgW = img.getWidth();\n \t imgH = img.getHeight();\n \t}\n \t\n \tif (imgW == 0 || imgH == 0) return;\n \tw = panelW;\n \th = imgH * panelW / imgW;\n \tif (h > panelH) {\n \t\th = panelH;\n \t\tw = imgW * panelH / imgH;\n \t\tpanel.setWidgetPosition(img, (panelW-w)/2, 0);\n \t} else {\n \t\tpanel.setWidgetPosition(img, 0, (panelH-h)/2);\n \t}\n \timg.setPixelSize(w, h);\n }", "public void setHalf(){\n setImage(\"hHalf.png\"); \n }", "private void updateScaleLevels() {\n Rect bounds = getBounds();\n if (width <= 0 || height <= 0 || bounds.isEmpty()) {\n return;\n }\n\n int vWidth = bounds.width();\n int vHeight = bounds.height();\n int dWidth = width;\n int dHeight = height;\n\n float wScale = (float) vWidth / (float) dWidth;\n float hScale = (float) vHeight / (float) dHeight;\n if (Math.max(wScale, hScale) < MAX_SCALE) {\n scaleLevels = new float[] {MIN_SCALE, wScale, hScale, MAX_SCALE};\n } else {\n scaleLevels = new float[] {MIN_SCALE, wScale, hScale};\n }\n Arrays.sort(scaleLevels);\n minScale = scaleLevels[0];\n maxScale = scaleLevels[scaleLevels.length - 1];\n }", "void updateSize(double width, double height);", "public void setImageSize() {\n switch (cbSize.getSelectionModel().getSelectedItem()) {\n case \"Small\":\n spToppings.setScaleX(SMALL_SCALE);\n spToppings.setScaleY(SMALL_SCALE);\n break;\n case \"Medium\":\n spToppings.setScaleX(MEDIUM_SCALE);\n spToppings.setScaleY(MEDIUM_SCALE);\n break;\n case \"Large\":\n spToppings.setScaleX(LARGE_SCALE);\n spToppings.setScaleY(LARGE_SCALE);\n break;\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 - dataStorage.getVideoWidth()) / 2, (drawH - dataStorage.getVideoHeight()) / 2, (drawW - dataStorage.getVideoWidth()) / 2, (drawH - dataStorage.getVideoHeight()) / 2);\r\n parentWindow.invalidate();\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Created by osboxes on 13/09/16.
public interface DnaBitStringGeneric { /** * * Fast conversion to Kmer31 family, by same bit representation * @param from * @return */ public Kmer31 getKmer31(int from); /** * Fast conversion to Kmer31 family, by same bit representation * @param from index of the starting sequence, 0-indexed text left-to-right * @param k kmer size * @return */ public ShortKmer31 getShortKmer31(int from, int k); /** * Returns subsequence in the given range. * Indexed left to right, 0-index * * @param from integer index INCLUSIVE * @param to integer index EXCLUSIVE * @return */ public String getSequence( int from, int to); /** * Returns reverseStrand (reverse and inverse) subsequence in the given range. * Indexed left to right, 0-index * * @param from integer index INCLUSIVE * @param to integer index EXCLUSIVE * @return */ public String getSequenceReverseStrand( int from, int to); /** * returns the character at the supplied index (0-indexing, left to right) * @param index * @return */ public char charAt(int index); /** * Returns the length of the sequence; has nothing to do with internal mechanics. * @return */ public int getLength(); // private void writeObject(java.io.ObjectOutputStream stream) throws IOException; // // private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException; public Iterator<Kmer31> iterator(); public String toString(); /** * Serializes object to bytes, so we can use a store that accepts byte[] * @return */ public byte[] toByteArray(); /** * Java syle iterator<Kmer31> * Additionally, has length() function. */ public static abstract class myIterator implements Iterator<Kmer31> { @Override public Kmer31 next() { return null; } @Override public void remove() { } } }
[ "@Override\n public void extornar() {\n \n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "private static void EX5() {\n\t\t\r\n\t}", "@Override\n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "protected void mo4791d() {\n }", "public void mo28221a() {\n }", "@Override\n \tpublic void init() {\n \n \t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "Eisdiele() {\r\n\r\n\t}", "public void mo17751g() {\n }", "public void mo1857d() {\n }", "protected void method_5557() {}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "@Override\n public int utilite() {\n return 0;\n }", "@Override\n protected void init()\n {\n\n }", "public void mo5201a() {\n }", "public void mo5203c() {\n }", "@Override\n\tpublic void frena() {\n\t\t\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check whether string s exists inside the Trie or not
boolean contains(String s) { // TODO TrieNode curr = this.root; // traverse through the trie for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); int pos = getPos(c); curr = curr.getChild(pos); // if node does not exist, trie does not contain string if (curr == null) { return false; } } // if we reach the end of the string, check if node is end node return curr.isEnd; }
[ "public boolean contains(String item) {\n\t\tif (root == null) return false;\n\n\t\tTrieNode current = root;\n\t\tchar charNow;\n\t\twhile(current != null){\n\t\t\t// If we find the string in the Trie, check if it is a terminal\n\t\t\tif(item.length() == 0){\n\t\t\t\tif(current.terminal) return true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcharNow = item.charAt(0);\n\t\t\tcurrent = current.children[c2i(charNow)];\n\t\t\titem = item.substring(1);\n\t\t}\n\t\t// If current TrieNode reaches end first, no word with the prefix exists\n\t\treturn false;\n\t}", "public boolean contains(String key){\n TrieNode curr = root;\n for (char c : key.toCharArray()) {\n if (curr.getChildren()==null || curr.getChild(c) == null){\n return false;\n }\n curr = curr.getChild(c);\n }\n return curr.isWord();\n }", "public boolean search(String word) {\n\t TrieNode node = root;\n\t for (char c: word.toCharArray()) {\n\t if (node.children.containsKey(c)) {\n\t node = node.children.get(c);\n\t } else {\n\t return false;\n\t }\n\t }\n\t return node.isEnd;\n\t }", "public boolean search(String word) {\n TrieNode x = search(root, word, 0); \n if (x == null) return false;\n return x.isString;\n }", "public boolean search(String str) {\n char[] data = str.toCharArray();\n TrieNode tempNode = root;\n\n for (char c : data) {\n int index = c - 'a';\n if (tempNode.child[index] == null) {\n return false;\n }\n tempNode = tempNode.child[index];\n }\n if (tempNode != null && tempNode.isEnd == false) {\n return false;\n }\n return true;\n }", "public boolean search(String word) {\n TrieNode temp = root;\n char[] w = word.toCharArray();\n int i=0;\n while(i<w.length && temp.children.containsKey(w[i])){\n temp = temp.children.get(w[i]);\n i++;\n }\n return i==w.length && temp.isEnd;\n }", "public boolean search(String word) {\n TrieNode p = helper(word);\n return p != null && p.flag;\n }", "public boolean search(String word) {\r\n HashMap<Character, TrieNode> kid = root.child ; \r\n for(int i = 0 ; i < word.length() ; i++) {\r\n char check = word.charAt(i) ;\r\n TrieNode s = new TrieNode() ; \r\n if(kid.containsKey(check)) {\r\n s = kid.get(check) ; \r\n } else\r\n return false ; \r\n kid = s.child ; \r\n if(i == word.length() - 1 && (s.isLeaf))\r\n return true ; \r\n }\r\n \r\n return false ; \r\n }", "public boolean search(String word) {\n TreeNode parent = root;\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n if (!parent.childNodes.containsKey(chars[i])) {\n return false;\n } else {\n parent = parent.childNodes.get(chars[i]);\n }\n }\n\n return parent.isTrie;\n }", "public boolean search(String word) {\r\n TrieNode curr = root;\r\n for(char ch : word.toCharArray()){\r\n int index = ch-'a';\r\n if(curr.children[index]==null){return false;}\r\n curr = curr.children[index];\r\n }\r\n return curr.isEnd;\r\n }", "static boolean search(String key)\n {\n int level;\n int length = key.length();\n int index;\n TrieNode runner = root;\n\n for(level = 0; level < length; level++)\n {\n //index below will be alphabet's position.\n index = key.charAt(level) - 'a';\n if(runner.children[index] == null){\n // Trie is empty.\n return false;\n }\n runner = runner.children[index];\n }\n\n return (runner != null && runner.isEndOfWord);\n }", "public boolean search(String word) {\r\n\t char[] charArray=word.toCharArray();\r\n\t TrieNode currentNode=root;\r\n\t for(int i=0;i<charArray.length;i++)\r\n\t {\r\n\t int position=getPosition(charArray[i]);\r\n\t if(i==charArray.length-1)\r\n\t {\r\n\t if(currentNode.nodes[position]==null) return false;\r\n\t else if(currentNode.nodes[position].valueObject==null) return false;\r\n\t \t return true;\r\n\t }\r\n\t else {\r\n\t if(currentNode.nodes[position]==null)\r\n\t return false;\r\n\t else currentNode=currentNode.nodes[position];\r\n\t \r\n\t }\r\n\t }\r\n\t return false ;\r\n\t }", "public boolean search(String word) {\n TrieNode node = new TrieNode();\n TrieNode[] childs = roots;\n for (int i = 0; i < word.length(); i++) {\n node = childs[word.charAt(i) - 'a'];\n if (node == null) {\n return false;\n }\n childs = node.nodes;\n }\n if (node.isEnd == true) {\n return true;\n } else {\n return false;\n }\n }", "public boolean search(String word) {\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n return false;\n }\n now = now.children.get(c);\n }\n return now.hasWord;\n }", "public boolean search(String word) {\n TrieNode current = root;\n //For each character of word, check if child node exists for it\n for (char ch : word.toCharArray())\n {\n //if child node doesn't exist, return false\n if (current.getChild(ch) == null)\n return false;\n else\n //If character exists, repeat above step.i.e check if its child node exists\n current = current.getChild(ch);\n }\n //When you reach the end of string and current.isEnd is true, return true else return false\n return current.isEnd;\n }", "public boolean search(String word) {\n TrieNode p = root;\n for (char c : word.toCharArray()) {\n p = p.get(c);\n if (p == null) {\n return false;\n }\n }\n return p.end;\n }", "public boolean search(String word) {\n boolean exists = true;\n TrieNode current = this.head;\n for (int pos = 0; pos < word.length(); pos++) {\n char ch = word.charAt(pos);\n if (!current.children.containsKey(ch))\n {\n exists = false;\n break;\n }\n current = current.children.get(ch);\n }\n if (!exists)\n return false;\n else\n return current.end;\n }", "public boolean contains(String key)\r\n\t{ \r\n\t\t// ADD YOUR CODE BELOW HERE\r\n\t\t//getPrefixNode(), then see if there's any characters left; also watch for root\r\n\t\tTrieNode prefix = getPrefixNode(key);\r\n\t\t//int depth = prefix.getDepth();\r\n\t\tif(prefix == null){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif((prefix.getDepth() == key.length()) && (prefix.endOfKey)){ //no characters left\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ADD YOUR CODE ABOVE HERE\r\n\t\t\r\n\t}", "static boolean search(String key)\n {\n TrieNode node = root;\n int index;\n\n for (int i = 0; i < key.length(); i++)\n {\n index = key.charAt(i) - 97;\n if (node.children[index] == null)\n return false;\n node = node.children[index];\n }\n return (node != null && node.end);\n }", "public boolean search(String word) {\n TrieNode start = parent;\n for (char c : word.toCharArray()) {\n if (start.children[c - 'a'] == null) {\n return false;\n }\n\n start = start.children[c - 'a'];\n }\n\n return start.isEnd == true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Task executed to display live images when using a single camera
private Runnable singleCameraLiveTask() { return new Runnable() { @Override public void run() { if (core_.getRemainingImageCount() == 0) { return; } if (win_.windowClosed()) //check is user closed window { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { snapLiveManager_.setLiveMode(false); } }); } else { try { TaggedImage ti = core_.getLastTaggedImage(); // if we have already shown this image, do not do it again. long imageNumber = MDUtils.getSequenceNumber(ti.tags); if (setImageNumber(imageNumber)) { imageQueue_.put(ti); } } catch (final Exception ex) { ReportingUtils.logMessage("Stopping live mode because of error..."); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { snapLiveManager_.setLiveMode(false); ReportingUtils.showError(ex); } }); } } } }; }
[ "private void showPhoto() {\n\n\n LocalPhoto localPhoto = mProperty.getLocalPhoto();\n\n if (localPhoto!=null) {\n\n\n Bitmap bitmap = localPhoto.getImageBitmap();\n\n if (bitmap != null) {\n\n// BitmapDrawable bitmap = null;\n\n// Bitmap b = BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length);\n mPhotoView.setImageBitmap(Bitmap.createScaledBitmap(bitmap, 500, 350, false));\n\n\n // String path = getActivity().getFileStreamPath(photo.getFilename()).getAbsolutePath();\n// bitmap = PictureUtils.getScaledDrawable(getActivity(), path);\n\n\n }\n\n } else {\n ExecutorService executor = Executors.newFixedThreadPool(1);\n\n if (executor!= null) {\n Future<Bitmap> streetViewFuture = executor.submit(new FetchStreetView<Bitmap>(mProperty.getGeoPoint().getLatitude(), mProperty.getGeoPoint().getLongitude()));\n\n\n // This will make the executor accept no new threads\n // and finish all existing threads in the queue\n executor.shutdown(); // moved to onDestroy\n\n // Wait until all threads are finish\n while (!executor.isTerminated()) {\n }\n\n try {\n\n if (streetViewFuture.get() != null) {\n mPhotoView.setImageBitmap(streetViewFuture.get());\n Log.i(TAG, streetViewFuture.get().toString());\n }\n } catch (InterruptedException e) {\n\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n\t\tprotected Void doInBackground(Void... arg0) {\n\t\t\tmCamera.takePicture(null, null, mPictureCallback);\n\t\t\t\n\t try {\n\t Thread.sleep(3000); // 3 second preview\n\t } catch (InterruptedException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t }\n\t\t\treturn null;\n\t\t}", "@FXML\n private void startCamera() {\n hsvValuesProp = new SimpleObjectProperty<>();\n\n this.hsvCurrentValues.textProperty().bind(hsvValuesProp);\n\n // set a fixed width for all the image to show and preserve image ratio\n this.imageViewProperties(this.originalImageView, 400);\n this.imageViewProperties(this.maskImageView, 200);\n this.imageViewProperties(this.morphImageView, 200);\n\n\n if (!this.cameraActive) {\n // start the video capture\n this.capture.open(0);\n\n // is the video stream available?\n if (this.capture.isOpened()) {\n this.cameraActive = true;\n\n // grab a frame every 33 ms (30 frames/sec)\n Runnable frameGrabber = () -> {\n // effectively grab and process a single frame\n this.currentFrame = grabFrame();\n // convert and show the frame\n Image imageToShow = CamouseController.mat2Image(this.currentFrame);\n updateImageView(originalImageView, imageToShow);\n };\n this.timer = Executors.newSingleThreadScheduledExecutor();\n this.timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MILLISECONDS);\n\n // update the button content\n this.cameraButton.setText(\"Stop Camera\");\n } else {\n // log the error\n System.err.println(\"Failed to open the camera connection...\");\n }\n } else {\n // the camera is not active at this point\n this.cameraActive = false;\n // update again the button content\n this.cameraButton.setText(\"Start Camera\");\n\n // stop the timer\n this.stopAcquisition();\n }\n\n //detect click\n //i(!isThumbExtended() && !isClicking){\n //pointer\n //isClicking = true;\n //System.out.println(\"POINTING\");\n //theTime = System.nanoTime();\n //\n }", "public void run() {\n\t\t\tmCameraAdapter.getCamera().takePicture(null, null, null, TimeLapseActivity.this);\n\t\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tstartRemoteCameraView();\n\n\t\t\t\t\t\t// MediaPlayer urlPlayer =\n\t\t\t\t\t\t// MediaPlayer.create(VideoActivity.this,\n\t\t\t\t\t\t// Uri.parse(\"tcp://192.168.1.1:5555\"));\n\t\t\t\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\tlogger().i(\"Main\", \"image\");\n\t\t\tVideoSurfaceView videoView = (VideoSurfaceView) findViewById(R.id.video);\n\t\t\tvideoView.setBitmap(new BitmapDrawable(bitmap));\n\t\t\tbitmap = null;\n\t\t}", "@Override\n public void run()\n {\n if (getUserVisibleHint())\n {\n// Log.d(LOG, \"timerTask run called\");\n final String imageUrl = Article.getRandomImageUrlFromArticlesList(articles);\n getActivity().runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n SingltonOtto.getInstance().post(new EventShowImage(imageUrl));\n }\n });\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\tGetImg();\r\n\t\t}", "@Override\n public void run() {\n loadImage(ImagesData.URLS[5], imageView, true, null);\n }", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tsuper.run();\r\n\t\t\t\t\t\tdoVideoTask();\r\n\t\t\t\t\t}", "public void startPreview() {\n try {\n getDispatchThread().runJob(new Runnable() {\n @Override\n public void run() {\n getCameraHandler()\n .obtainMessage(CameraActions.START_PREVIEW_ASYNC, null).sendToTarget();\n }});\n } catch (final RuntimeException ex) {\n getAgent().getCameraExceptionHandler().onDispatchThreadException(ex);\n }\n }", "@FXML\n\t\tprotected void startCamera()\n\t\t{\t\n\t\t\t//Abilito il pulsante per fare la cattura dell'emozione.\n\t\t\tenableEmotionDetectionButton();\t\n\t\t\tif (!this.cameraActive)\n\t\t\t{\n\t\t\t\t// start the video capture\n\t\t\t\tthis.capture.open(0);\n\t\t\t\t\n\t\t\t\t// is the video stream available?\n\t\t\t\tif (this.capture.isOpened())\n\t\t\t\t{\n\t\t\t\t\tthis.cameraActive = true;\n\t\t\t\t\t\n\t\t\t\t\t// grab a frame every 33 ms (30 frames/sec)\n\t\t\t\t\tRunnable frameGrabber = new Runnable() \n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// effectively grab and process a single frame\n\t\t\t\t\t\t\tMat frame = grabFrame();\n\t\t\t\t\t\t\t// convert and show the frame\n\t\t\t\t\t\t\tImage imageToShow = Utils.mat2Image(frame);\n\t\t\t\t\t\t\tupdateImageView(originalFrame, imageToShow);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tthis.timer = Executors.newSingleThreadScheduledExecutor();\n\t\t\t\t\tthis.timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MILLISECONDS);\n\t\t\t\t\t\n\t\t\t\t\t// update the button content\n\t\t\t\t\tthis.cameraButton.setText(\"Stop Camera\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// log the error\n\t\t\t\t\tSystem.err.println(\"Failed to open the camera connection...\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// the camera is not active at this point\n\t\t\t\tthis.cameraActive = false;\n\t\t\t\t// update again the button content\n\t\t\t\tthis.cameraButton.setText(\"Start Camera\");\n\t\t\t\t\n\t\t\t\t// stop the timer\n\t\t\t\tthis.stopAcquisition();\n\t\t\t}\n\t\t}", "public vision() {\n CameraServer.getInstance().startAutomaticCapture(0);\n CameraServer.getInstance().startAutomaticCapture(1);\n /*new Thread(() -> {\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n\n CvSink cvSink = CameraServer.getInstance().getVideo();\n CvSource outputStream = CameraServer.getInstance().putVideo(\"Blur\", 640, 480);\n\n Mat source = new Mat();\n Mat output = new Mat();\n\n while(!Thread.interrupted()) {\n if (cvSink.grabFrame(source) == 0) {\n continue;\n }\n Imgproc.cvtColor(source, output, Imgproc.COLOR_BGR2GRAY);\n outputStream.putFrame(output);\n }\n }).start();*/\n }", "public void ImagePipe(){\n\t\tcam0.setResolution(ImgW, ImgH);\n\t\t\n\t\tvt = new VisionThread(cam0, new GripPipeline(), pipeline -> {\n\t\t\t//Make sure the amount in array is right\n\t\t\tif(Robot.gp.filterContoursOutput().size() >= 2){\n\t\t\t\t//need real array numbers for which contours to draw a bounding rectangle around\n\t\t\t\t//r.x is top left corner\n\t\t\t\tRect boundLeft = Imgproc.boundingRect(Robot.gp.filterContoursOutput().get(0));\n\t\t\t\tRect boundRight = Imgproc.boundingRect(Robot.gp.filterContoursOutput().get(1));\n\t\t\t\t\tsynchronized (imgSync){CenterLeftRec = boundLeft.x + (boundLeft.width/2);\n\t\t\t\t\tCenterRightRec = boundRight.x + (boundRight.width/2);\n\t\t\t\t\t//for finding on cordinate\n\t\t\t\t\tRealCenter = ((CenterLeftRec + CenterRightRec)/2);\n\t\t\t \tHorDis = (Robot.cs.WantCenter - Robot.cs.RealCenter);} //Make sure the values are calculated then wait\n\t\t\t\t\tSystem.out.println(\"The Distance from Gear to Peg is: \" + HorDis); ThreadSleep();}});\n\t\t\n\t\tif(CamOn = true){\n\t\t\tif(FirstCamCycle=true){vt.start();} else{vt.notify();} System.out.println(\"Camera Turning On...\");} \n\t\tif(CamOn = false){\n\t\t\tif(FirstCamCycle=false){try {vt.wait();}\n\t\t\t\tcatch (InterruptedException e){e.printStackTrace(); \n\t\t\t\tSystem.out.println(\"Camera Thread Interrupted. FIGURE OUT WHY!\");}\n\t\t\tSystem.out.println(\"Camera Turning Off...\");}}}", "private void observeImageData() {\n viewModel.getImageUriLiveData().observe(this, uri -> { //Using LiveData for reacting to changes\n if (uri != null) {\n Log.d(TAG, \"Obtained new image for display\");\n binding.progressBar.hide();\n binding.assetDisplayIV.setVisibility(View.VISIBLE);\n Glide.with(MainActivity.this)\n .load(uri)\n .into(binding.assetDisplayIV);\n } else {\n onDataDisplayRequestError();\n }\n });\n }", "@Override\n public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n if (camera != null) {\n camera.startPreview();\n camera.takePicture(null, null, new Camera.PictureCallback() {\n @Override\n public void onPictureTaken(byte[] bytes, Camera camera) {\n Log.d(\"camera\", \"Picture taken\");\n UploadPhotoTask upt = new UploadPhotoTask(activity);\n upt.execute(bytes);\n //camera.startPreview();\n }\n });\n }\n }", "public void captureImageFromCamera() {\n try {\n tapViewByPackageIdAndTimeOut(\"com.android.camera:id/shutter_button\", 10);\n tapViewByPackageIdAndTimeOut(\"com.android.camera:id/done_button\", 10);\n } catch (Exception e) {\n tapViewByPackageIdAndTimeOut(\"com.android.camera2:id/shutter_button\", 10);\n tapViewByPackageIdAndTimeOut(\"com.android.camera2:id/done_button\", 10);\n }\n }", "private void takePic() {\n m_File = new File(getActivity().getExternalFilesDir(null), UUID.randomUUID() +\".jpg\");\n //TODO MAY BE A BUG\n Uri imageUri = FileProvider.getUriForFile(getActivity(),\n \"com.hod.finalapp.provider\", //(use your app signature + \".provider\" )\n m_File);\n\n mPictureUri = imageUri;\n cameraResultLauncher.launch(imageUri);\n }", "@Override\n\tpublic void run()\n\t{\n\t\twhile (true && mIsOpened)\n\t\t{\n\t\t\t// get camera frame\n\t\t\tMat frame = new Mat();\n\n\t\t\tif (false == capture.read(frame))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tint w = frame.cols();\n\t\t\tint h = frame.rows();\n\t\t\tLog.i(TAG, \"frame.width = \" + w + \" frame.height = \" + h);\n\n\t\t\tupdateRect(w, h);\n\n\t\t\t// 转换格式\n\t\t\t//RGB --> ARGB8888\n\t\t\tImgproc.cvtColor(frame, frame, Imgproc.COLOR_RGB2RGBA);\n\n\t\t\tBitmap resultImg = Bitmap.createBitmap(w, h, Config.ARGB_8888);\n\t\t\tUtils.matToBitmap(frame, resultImg);\n\n\t\t\t// 刷新显示\n\t\t\tCanvas canvas = getHolder().lockCanvas();\n\t\t\tif (canvas != null)\n\t\t\t{\n\t\t\t\t// draw camera bmp on canvas\n\t\t\t\tcanvas.drawBitmap(resultImg, null, rect, null);\n\n\t\t\t\tgetHolder().unlockCanvasAndPost(canvas);\n\t\t\t}\n\n\t\t\tif (shouldStop)\n\t\t\t{\n\t\t\t\tshouldStop = false;\n\t\t\t\tLog.i(TAG, \"mainloop will stop!\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tLog.i(TAG, \"mainloop break while!\");\n\t}", "private void update(){\n if(activeCamera == null){\n return;\n }\n\n //If framebuffer is not setup, try doing so. If that fails, skip this update\n if(frameBuffer == null){\n setupImages();\n if(frameBuffer == null){\n return;\n }\n }\n\n TestBed testBed = simulationProperty.get().getTestBed();\n Renderer renderer = testBed.getRenderer();\n WorldObject world = testBed.getWorldRepresentation();\n\n //Get the active camera and set its camera FOV to match the image width to height ratio so the image isnt warped/stretched.\n double aspect = ((double)frameBuffer.getWidth())/((double)frameBuffer.getHeight());\n setCameraAspectRatio(activeCamera, aspect);\n\n //If the camera is orthographic, update the icon rendering properties\n if(activeCamera instanceof OrthographicCamera){\n OrthographicCamera orthoCam = (OrthographicCamera) activeCamera;\n orthoCam.setIconOffset(new Vector2D(0, 7));\n orthoCam.setIconSize(10f);\n }\n\n //The view always lags behind 1 frame so that the GPU work can be done while the Java code continues and so\n //we don't have to wait.\n\n // The general workflow is as follows:\n // 1. Render image on GPU\n // 2. Copy image from GPU to RAM\n // 3. Load image into JavaFX\n\n if(imageCopyTask != null && imageCopyTask.isDone()){\n image = SwingFXUtils.toFXImage(awtImage, image);\n imageView.setImage(image);\n imageCopyTask = null;\n lastRenderTimestamps.add(System.currentTimeMillis());\n }\n\n if(renderTask != null && renderTask.isDone()){\n imageCopyTask = frameBuffer.readPixels(imageBackingBuffer);\n renderTask = null;\n }\n\n if(renderTask == null || renderTask.isDone()){\n renderTask = renderer.startRender(world, frameBuffer, activeCamera, testBed.getWorldStateLock());\n }\n\n //Update FPS counter\n lastRenderTimestamps.removeIf(timestamp -> System.currentTimeMillis() - timestamp > 1000);\n int fps = lastRenderTimestamps.size();\n fpsLabel.setText(fps+\"\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a count of activity notifications in the My Requests table for this user.
public Long countNotificationsMyRequests(UserItem userItem) { Object[] params = {userItem}; String query = "select count(*) from AccessRequestStatusItem status where status.user = ?" + " and status.hasRequestorSeen = false"; Long count = (Long)getHibernateTemplate().find(query, params).get(0); return count; }
[ "@GET(\"notification/fetchCountForUser/{id}\")\n Call<ResponseBody> getUserNotificationsCount(@Path(\"id\") int user_id);", "int getToUserCount();", "public long countNotifications(Long userOid) {\n\t\treturn 0L;\n\t}", "@Override\n public int countUserRequests(int userId) throws DAOException {\n final String query = \"select count(*) from requests where user_id=?;\";\n DBManager dbm;\n Connection con = null;\n PreparedStatement psmt = null;\n ResultSet rs = null;\n int requestsNumber;\n try {\n dbm = DBManager.getInstance();\n con = dbm.getConnection();\n psmt = con.prepareStatement(query);\n psmt.setInt(1, userId);\n rs = psmt.executeQuery();\n rs.next();\n requestsNumber = rs.getInt(1);\n con.commit();\n } catch (SQLException ex) {\n DBManager.rollback(con);\n LOG.error(Messages.ERR_CANNOT_COUNT_REQUESTS_WITH_CONDITION);\n throw new DAOException(Messages.ERR_CANNOT_COUNT_REQUESTS_WITH_CONDITION, ex);\n } finally {\n DBManager.close(con, psmt, rs);\n }\n return requestsNumber;\n }", "int countUnread(long user_id);", "int countRequestApprovedThisMonthOfUser(int userId);", "@RequestMapping(value = \"/countActivityTask\", headers = { \"Accept=application/json\" })\r\n\tpublic @ResponseBody String countActivityTask(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tList<String> ownerFilter = null;//getOwnerGroup(request, ActionType.READ.getActionCode());\r\n\t\t\r\n\t\t//if (ownerFilter != null) {\r\n\t\t\tint count = taskSummaryService.countPendingActivity(getUserId(request), (CollectionUtil.isNotEmpty(ownerFilter)) ? ownerFilter : null);\r\n\t\t\treturn JsonUtil.toJSON(count, Boolean.TRUE);\r\n\t\t//} else {\r\n\t\t//\treturn JsonUtil.toJSON(0, Boolean.TRUE);\r\n\t\t//}\r\n\t\t\r\n\t}", "public int getUnreadNotificationCount(String _username) {\n List<Notification> nots = getUnreadNotificationsForUser(_username);\n return nots.size();\n }", "public int getUserCountNonExpired();", "int getFriendsWithOfflineMessagesCount();", "public int getRequestsCount() {\n return instance.getRequestsCount();\n }", "public Long userTimelineActivityCount(final String username) {\n return jedisExecution.execute(new JedisOperation<Long>() {\n @Override\n public Long perform(Jedis jedis) {\n return jedis.zcard(String.format(RedisKeyNames.PROFILE_S_TIMELINE, username));\n }\n });\n }", "public int getNumRequests() {\r\n return mTable.size();\r\n }", "RangeStatistic getActiveRequestCount();", "@GetMapping(\"/users/count\")\n public long getUsersCount() {\n return userRepository.count();\n }", "public String getNotificationCounter(String userId) {\n MongoCollection<NotificationDAO> mongoCollection\n = DBConnection.getInstance().getConnection().getCollection(Collections.NOTIFICATIONS.toString(), NotificationDAO.class);\n String attrUserId = PropertyProvider.get(\"USER_ID\");\n String attrStatusId = PropertyProvider.get(\"STATUS_ID\");\n String statusId = PropertyProvider.get(\"NOTIFICATION_STATUS_TYPE_UNREAD_ID\");\n String attrGeneralNotifications = PropertyProvider.get(\"GENERAL_NOTIFICATIONS\");\n String attrFriendNotifications = PropertyProvider.get(\"FRIEND_NOTIFICATIONS\");\n Document selectionDocument = new Document();\n selectionDocument.put(attrUserId, userId);\n Document projectionDocument = new Document();\n projectionDocument.put(attrGeneralNotifications, \"$all\");\n projectionDocument.put(attrFriendNotifications, \"$all\");\n NotificationDAO notificationCursor = mongoCollection.find(selectionDocument).projection(projectionDocument).first();\n int generalCounter = 0;\n int friendCounter = 0;\n if (notificationCursor != null) {\n if (notificationCursor.getGeneralNotifications() != null) {\n int generalNotificationSize = notificationCursor.getGeneralNotifications().size();\n if (generalNotificationSize > 0) {\n for (int i = 0; i < generalNotificationSize; i++) {\n if (notificationCursor.getGeneralNotifications().get(i).getStatusId() != null) {\n if (notificationCursor.getGeneralNotifications().get(i) != null) {\n if (notificationCursor.getGeneralNotifications().get(i).getStatusId().equals(statusId)) {\n generalCounter++;\n }\n }\n }\n\n }\n }\n }\n if (notificationCursor.getFriendNotifications() != null) {\n int friendNotificationCounter = notificationCursor.getFriendNotifications().size();\n if (friendNotificationCounter > 0) {\n for (int j = 0; j < friendNotificationCounter; j++) {\n if (notificationCursor.getFriendNotifications().get(j) != null) {\n if (notificationCursor.getFriendNotifications().get(j).getStatusId() != null) {\n if (notificationCursor.getFriendNotifications().get(j).getStatusId().equals(statusId)) {\n friendCounter++;\n }\n }\n }\n\n }\n }\n }\n }\n JSONObject resultedNotifications = new JSONObject();\n JSONObject userInitiation = new JSONObject();\n userInitiation.put(\"friend\", friendCounter);\n userInitiation.put(\"message\", \"\");\n userInitiation.put(\"general\", generalCounter);\n userInitiation.put(\"userCurrentTimeStamp\", utility.getCurrentTime());\n userInitiation.put(\"genderId\", userModel.getUserGenderInfo(userId));\n resultedNotifications.put(\"userInitiationInfo\", userInitiation.toString());\n\n return resultedNotifications.toString();\n }", "int getRentalRequestsCount() throws ServiceException;", "public int resourceRequestCount() {\n return (int) resourceRequestTimeRequestCounter.getCount();\n }", "public Long countActivities() {\n return repository.count();\n }", "public Number getCount()\n {\n return Integer.valueOf(totalRequests);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This tests that the game is not successfully lent when the balance in one of the students' accounts is lower than the replacement cost of the game.
public void scenario4() { HallEx abh = new HallEx(); abh.setAddress("blah blah"); abh.setFine(0.75); abh.setName("ABH"); abh.setFineLimit(25.00); GameEx chess = new GameEx(); chess.setHall(abh); chess.setName("Chess"); chess.setPrice(10.00); chess.setLoanLen(2); Account bobAccount = new Account(); bobAccount.setBalance(9.00); bobAccount.setDateCreated("2020-07-17"); bobAccount.setNumber(925925925); Account johnAccount = new Account(); johnAccount.setBalance(13.00); johnAccount.setDateCreated("2002-11-15"); johnAccount.setNumber(529529529); StudentEx bob = new StudentEx(); bob.setName("Bob"); bob.setMatNumber(200000000); bob.setHall(abh); bob.setAccount(bobAccount); bob.setFines(0); StudentEx john = new StudentEx(); john.setName("John"); john.setMatNumber(657483920); john.setHall(abh); john.setAccount(johnAccount); john.setFines(15.00); abh.borrowGame(chess, bob, john, "2020-10-10"); chess.getDetails(chess); System.out.println("Fine: £" + chess.calcFine(chess)); // Then the game is returned. abh.returnGame(chess, bob, john); chess.getDetails(chess); bob.getDetails(); bobAccount.getDetails(); john.getDetails(); johnAccount.getDetails(); System.out.println("\n"); }
[ "private void checkTransactionFairness(\n int numFirstWinners,\n int numSecondWinners,\n int totalIterations) {\n assertLessThan(\"First Win Too Low\", totalIterations / 4, numFirstWinners);\n assertLessThan(\"Second Win Too Low\", totalIterations / 4, numSecondWinners);\n }", "@Test\r\n\tpublic void testBalance() {\n\t\tassertEquals(1000, testPlayer.getChips());\r\n\t\ttestPlayer.putInPot(testPot, 400);\r\n\t\t// Check balance is updating correctly\r\n\t\tassertEquals(600, testPlayer.getChips());\r\n\t}", "@Test\n\tpublic void testSubtractFromBalance() {\n\t\t\n\t\tplayer.subtractFunds(5000);\n\t\tassertEquals(player.checkBalance(), 5000);\n\t}", "@Test\r\n\tpublic void testLandOnFieldFleet4() {\r\n\t\tint expected = 5000;\r\n\t\tint actual = player.getBankAccount().getBalance();\r\n\t\tassertEquals(expected, actual);\r\n\t\tfleet1.buyField(player2);\r\n\t\tfleet2.buyField(player2);\r\n\t\tfleet3.buyField(player2);\r\n\t\tfleet4.buyField(player2);\r\n\t\tfleet1.landOnField(player);\r\n\t\texpected = 5000-4000;\r\n\t\tactual = player.getBankAccount().getBalance();\r\n\t\tassertEquals(expected, actual);\r\n\t\t// Tests if owner gets the money that was withdrawed from player. Owner paided 4000 for the field so he should have 26500\r\n\t\texpected = 30000-4000-4000-4000-4000+4000;\r\n\t\tactual = player2.getBankAccount().getBalance();\r\n\t\tassertEquals(expected, actual);\r\n\r\n\t}", "@Test\n public void testAverageGradesFailure()\n {\n double expectedValue=80,actualValue;\n actualValue=studentsAndGrades.averageGrade(NumberOfStudents,Grades);\n assertNotEquals(expectedValue,actualValue);\n }", "@Test\n public void bet37ReducesBalanceBy37() throws Exception {\n Wallet wallet = new Wallet();\n wallet.addMoney(58);\n\n // WHEN I bet 37\n wallet.bet(37);\n\n // THEN balance is 21\n assertThat(wallet.balance())\n .isEqualTo(58 - 37);\n }", "@Test\n\tpublic void testMakePurchase_6_HigherBalance() {\n\t\t//failure out of stock\n\t\tsodaPopMachine.balance = 2.00;\n\t\tassertTrue(sodaPopMachine.makePurchase(\"A\"));\n\t\tassertEquals(0.50, sodaPopMachine.balance, 0.0);\n\t}", "@Test\n public void accountMaxOnBuy(){\n FullStandardUser bezoz = new FullStandardUser.UserBuilder(\"Jeff\").balance(999999.99).build();\n Game amazon = new Game(\"Alexa\", 22, \"Jeff\", 03, 0);\n bezoz.sell(amazon, market);\n amazon.changeHold();\n adminUser1.buy(bezoz, amazon, market.getAuctionSale(), market);\n String result1 = \"Seller: Jeff added to the market\\r\\n\" +\n \"Game: Alexa is now being sold by Jeff for $22.0 at a 0.0% discount, will be available for \" +\n \"purchase tomorrow.\\r\\n\" +\n \"diego has bought Alexa from Jeff for $22.0.\\r\\n\";\n String result = \"Warning: diego's balance was maxed out upon sale of game.\\r\\n\";\n assertEquals(result1 + result, outContent.toString());\n\n }", "@Test\n public void maxi_savings_noWithdrawalAccount() {\n DateProvider dateProvider = new DateProvider();\n Date oldAccountDate = dateProvider.oldDate(dateProvider.now(), -18);\n Date oldDepositDate = dateProvider.oldDate(dateProvider.now(), -17);\n //Withdrawal date set 15 days before today's date\n Date oldWithdrawalDate = dateProvider.oldDate(dateProvider.now(), -15);\n\n Bank bank = new Bank();\n Account checkingAccount = new Account(Account.MAXI_SAVINGS);\n checkingAccount.setAccountDate(oldAccountDate);\n bank.addCustomer(new Customer(\"Harry\").openAccount(checkingAccount));\n\n checkingAccount.deposit(5000.0);\n checkingAccount.withdraw(500.0);\n\n checkingAccount.transactions.get(0).setTransactionDate(oldDepositDate);\n checkingAccount.transactions.get(1).setTransactionDate(oldWithdrawalDate);\n\n //Expected value was calculated by doing 5% of 4500 (5000 - 500)\n assertEquals(225.0, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "@Test\n\tpublic void testGinScore() {\n\t\t// customized setup\n\t\tp2.addCardToHand(new Card(Suit.H, 13));\n\t\tp2.addCardToHand(new Card(Suit.S, 5));\n\t\tp2.checkMelds();\n\t\tp2.recalculateDeadwoodScore();\n\n\t\tGameOps.calculateScores(p1, p2);\n\t\tassertEquals(p1.getTotalScore(), 35);\n\t\tassertEquals(p2.getTotalScore(), 0);\n\t}", "@Test\r\n\tpublic void testPlayerLose() throws GameIsCloseException, BankRuptException{\r\n\t\tcontext.checking(new Expectations(){ {\r\n\t\t\t// player a 20€\r\n\t\t\toneOf(player).getMoney(); will(returnValue(20));\r\n\t\t\t\r\n\t\t\t// lancer des des\r\n\t\t\texactly(2).of(dice).throwDice();\r\n\t\t\twill(onConsecutiveCalls(returnValue(4), returnValue(1)));\r\n\t\t\t\r\n\t\t\t// le joueur a perdu, la banque le debite de 10€\r\n\t\t\toneOf(bank).debit(player, 10);\r\n\t\t\toneOf(bank).getMoney(); will(returnValue(50 + 10));\r\n\t\t} });\r\n\t\t\r\n\t\r\n\t\tgame = new Game(bank, dice, dice);\r\n\t\tgame.addPlayer(player);\r\n\t\tgame.play(10);\r\n\t\t\r\n\t\tcontext.assertIsSatisfied();\r\n\t\t\r\n\t\tassertTrue(game.isOpen());\r\n\t}", "boolean testPerPassengerProfit(Tester t) {\n return t.checkInexact(this.dreamliner.perPassengerProfit(),\n ((242 * 835.0) - (33340 * 1.94)) / 242, .0001)\n && t.checkInexact(this.commuterRail.perPassengerProfit(),\n ((500 * 11.5) - (2000 * 2.55)) / 500, .0001)\n && t.checkInexact(this.silverLine.perPassengerProfit(), ((77 * 1.7) - (100 * 2.55)) / 77,\n 0.0001)\n\n && t.checkInexact(this.air1.perPassengerProfit(), ((81 * 9001.2) - (4300 * 1.94)) / 81,\n .0001)\n && t.checkInexact(this.air2.perPassengerProfit(), ((364 * 400.0) - (43020 * 1.94)) / 364,\n .0001)\n\n && t.checkInexact(this.train1.perPassengerProfit(), ((300 * 2.75) - (1200 * 2.55)) / 300,\n .0001)\n && t.checkInexact(this.train2.perPassengerProfit(), ((200 * 1.92) - (3200 * 2.55)) / 200,\n .0001)\n\n && t.checkInexact(this.bus1.perPassengerProfit(), ((72 * 1.23) - (240 * 2.55)) / 72, .0001)\n && t.checkInexact(this.bus2.perPassengerProfit(), ((2304 * 5.98) - (32039 * 2.55)) / 2304,\n .0001);\n }", "@Test\n\tpublic void testAccusationWithWrongWeapon(){\n\t\tSolution sol = new Solution();\n\t\tSolution answer = board.getTheAnswer();\n\t\tCard[] cards = board.getCards();\n\n\t\t//sets the guesses based on theAnswer\n\t\tsol.person = answer.person;\n\t\tsol.weapon = answer.weapon;\n\t\tsol.room = answer.room;\n\n\n\t\t// changes the person guess to be wrong\n\t\tif(sol.weapon == cards[20]){\n\t\t\tsol.weapon = cards[21];\n\t\t} else {\n\t\t\tsol.weapon = cards[20];\n\t\t}\n\n\n\t\tassertFalse(board.checkAccusation(sol));\n\t}", "private boolean transactionFailed(int player) {\n\n boolean bankrupt = getPlayerTotalValue(player) < 0;\n if (bankrupt) {\n // Sell all buildings and properties automatically\n sellAllPlayerProperties(player);\n } else {\n // Let the player choose what real estate to sell and/or pawn to cover deficit.\n int deficit = -playerController.getPlayerBalance(player);\n while (deficit > 0) {\n sellRealEstate(player);\n deficit = -playerController.getPlayerBalance(player);\n }\n }\n return !bankrupt; //!bankrupt is return because is has to match makeTransaction which is basically the reverse.\n }", "@RepeatedTest(100)\n public void bonusPanelConsistencyTest() {\n int expectedStars = 0;\n assertEquals(expectedStars, suguri.getStars());\n final var testRandom = new Random(testSeed);\n suguri.setSeed(testSeed);\n for (int normaLvl = 1; normaLvl <= 6; normaLvl++) {\n final int roll = testRandom.nextInt(6) + 1;\n testBonusPanel.activatedBy(suguri);\n expectedStars += roll * Math.min(3, normaLvl);\n assertEquals(expectedStars, suguri.getStars(),\"Test failed with seed: \" + testSeed);\n suguri.normaClear();\n }\n }", "@Test\n public void test12() {\n b3.setBalance(-200);\n int expected = -200;\n int actual = b3.getBalance();\n assertEquals(expected, actual);\n }", "@Test\n\tpublic void testCalculateBonusCommissions() {\n\n\t\t//test when null\n\t\tassertEquals(0.0, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(0.0, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t\t//test 1 cent below the lower bound value\n\t\tcalcProbationary.addSale(SaleType.CONSULTING_ITEM, 49999.99);\n\t\tcalcExperienced.addSale(SaleType.CONSULTING_ITEM, 99999.99);\n\n\t\tassertEquals(0.0, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(0.0, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t\t//test the lower bound value\n\t\tcalcProbationary.addSale(SaleType.CONSULTING_ITEM, 50000);\n\t\tcalcExperienced.addSale(SaleType.CONSULTING_ITEM, 100000);\n\n\t\tassertEquals(250.0, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(1500.0, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t\t//test 1 cent past the lower bounds\n\t\tcalcProbationary.addSale(SaleType.CONSULTING_ITEM, 50000.01);\n\t\tcalcExperienced.addSale(SaleType.CONSULTING_ITEM, 100000.01);\n\n\t\tassertEquals(500.00, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(3000.00, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t\t//test 1 dollar past the lower bounds\n\t\tcalcProbationary.addSale(SaleType.CONSULTING_ITEM, 50001);\n\t\tcalcExperienced.addSale(SaleType.CONSULTING_ITEM, 100001);\n\n\t\tassertEquals(750.01, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(4500.01, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t\t//test a larger number since there is no upper bounds\n\t\tcalcProbationary.addSale(SaleType.CONSULTING_ITEM, 100000000);\n\t\tcalcExperienced.addSale(SaleType.CONSULTING_ITEM, 100000000);\n\n\t\tassertEquals(500750.01, calcProbationary.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\t\tassertEquals(1504500.02, calcExperienced.calculateBonusCommission(),\n\t\t\t\tDELTA_MONEY);\n\n\t}", "private boolean isPlayerBankrupt() { return currentPlayer.getMortageWorth() + currentPlayer.getBalance() <= 0; }", "public void testAdjustPmntFailure() throws Exception {\n createInitialObjects();\n savingsOffering = helper.createSavingsOffering(\"dfasdasd1\", \"sad1\");\n savings = helper.createSavingsAccount(\"000100000000017\", savingsOffering, group,\n AccountStates.SAVINGS_ACC_APPROVED, userContext);\n AccountPaymentEntity payment = helper.createAccountPaymentToPersist(savings, new Money(currency, \"1000.0\"),\n new Money(currency, \"1000.0\"), helper.getDate(\"20/05/2006\"),\n AccountActionTypes.SAVINGS_WITHDRAWAL.getValue(), savings, createdBy, group);\n AccountTestUtils.addAccountPayment(payment, savings);\n savings.setSavingsBalance(new Money(currency, \"400.0\"));\n savings.update();\n StaticHibernateUtil.flushAndClearSession();\n savingsOffering.setMaxAmntWithdrawl(new Money(getCurrency(), \"2500\"));\n Money amountAdjustedTo = new Money(currency, \"2000.0\");\n try {\n savings.adjustLastUserAction(amountAdjustedTo, \"correction entry\");\n } catch (ApplicationException ae) {\n Assert.assertTrue(true);\n Assert.assertEquals(\"exception.accounts.ApplicationException.CannotAdjust\", ae.getKey());\n }\n \n Assert.assertEquals(savings.getAccountState().getId().shortValue(), AccountStates.SAVINGS_ACC_APPROVED);\n Assert.assertNotNull(savings.getLastPmnt());\n Assert.assertEquals(savings.getSavingsBalance(), new Money(currency, \"400.0\"));\n }", "@Test\n void checkBalanceTest() throws Exception {\n BankTeller bt1 = new BankTeller();\n bt1.createCustomerWithAccount(\"Mari\", \"love12\", 100);\n\n assertEquals(100, bt1.checkBalance(\"Mari\"));\n\n //Equivalence Class- 0 starting balance\n bt1.createCustomerWithAccount(\"Ami\", \"yes101\", 0);\n\n assertEquals(0, bt1.checkBalance(\"Ami\"));\n\n //Equivalence Class- balance >1000\n bt1.createCustomerWithAccount(\"Houry\", \"101NP\", 5000);\n\n assertEquals(5000, bt1.checkBalance(\"Houry\"));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sets model attribute for inventory
@ModelAttribute("inventory") public Inventory initInventory(){ return new Inventory(); }
[ "public void setInventory(int value) {\n this.inventory = value;\n }", "@Override\n\n public void setInventory(Inventory inventory) {\n\n this.inventory = inventory;\n\n }", "Rental setInventoryId(int inventoryId);", "public void setModel(InventoryModel model)\n\t{\n\t\tthis.model = model;\n\t}", "public void setInventory(Double inventory) {\n this.inventory = inventory;\n }", "public void setQuantity(int newQuantiy){ quantity = newQuantiy; }", "void setInventoryFilePath(Path inventoryFilePath);", "public void setPlayerInventory(Inventory playerInventory){\r\n\t\t\r\n\t\tthis.playerInventory = playerInventory;\r\n\t}", "@Basic\n @Column(name = \"inventory\")\n public Double getInventory() {\n return inventory;\n }", "public int getInventory() {\n return this.inventory;\n\n }", "public void updateStockToInventory() {\r\n\t\tinventory.update(stockList);\r\n\t}", "Item(int sn, String name, String brand, Location location, double price, Supplier supplier, int qty){\r\n serialNumber=sn; \r\n //this.attribute is used to specify that the attribute from this class is the one that being initialized.\r\n this.name=name; \r\n this.brand=brand; \r\n this.location=location; \r\n this.price=price; \r\n this.supplier=supplier; \r\n quantity=qty; \r\n }", "public Items getInventory() {\n return inventory;\n }", "public void setQuantity(int quantity){\n this.quantity = quantity;\n}", "public int getInventoryID() {\n return inventoryID;\n }", "public void setItem(Item item){\n this.item = item;\n }", "@Override\n\t\tpublic void onInventoryChanged() {\n\t\t}", "public void setItem(Item item) {\n this.item = item; \n }", "public Item(Item model){\n this.name = model.name;\n this.description = model.description;\n this.price = model.price;\n }", "public void setM_Inventory_ID (int M_Inventory_ID)\n{\nif (M_Inventory_ID <= 0) set_Value (\"M_Inventory_ID\", null);\n else \nset_Value (\"M_Inventory_ID\", new Integer(M_Inventory_ID));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case ERR: return isSetErr(); } throw new IllegalStateException(); }
[ "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case DATA:\n return isSetData();\n }\n throw new IllegalStateException();\n }", "public boolean isSetSetField() {\n return this.setField != null;\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case PRS_ID:\n return isSetPrsId();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(int fieldID) {\n switch (fieldID) {\n case REQUEST:\n return isSetRequest();\n default:\n throw new IllegalArgumentException(\"Field \" + fieldID + \" doesn't exist!\");\n }\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case RDATA:\n return isSetRdata();\n case IILNAME:\n return isSetIilname();\n case ID:\n return isSetId();\n case DFT_VALUE:\n return isSetDft_value();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case VALUE:\n return isSetValue();\n }\n throw new java.lang.IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case SHARD_ID:\n return isSetShard_id();\n case ID:\n return isSetId();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case OPERATOR_ID:\n return isSetOperatorId();\n case CATALOG:\n return isSetCatalog();\n case NUM:\n return isSetNum();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case TASK_ID:\n return isSetTaskId();\n case DRIVER_ID:\n return isSetDriverId();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\r\n if (field == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n\r\n switch (field) {\r\n case ID:\r\n return isSetId();\r\n case SALARY:\r\n return isSetSalary();\r\n case POSITION_NAME:\r\n return isSetPosition_name();\r\n }\r\n throw new IllegalStateException();\r\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case DURATION:\n return isSetDuration();\n case LANGUAGE:\n return isSetLanguage();\n case ALTERNATIVES:\n return isSetAlternatives();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case CALL_DATA:\n return isSetCall_data();\n case IILNAME:\n return isSetIilname();\n case OPR:\n return isSetOpr();\n case VALUE:\n return isSetValue();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID1:\n return isSetId1();\n case LINK_TYPE:\n return isSetLink_type();\n case MIN_TIMESTAMP:\n return isSetMin_timestamp();\n case MAX_TIMESTAMP:\n return isSetMax_timestamp();\n case OFFSET:\n return isSetOffset();\n case LIMIT:\n return isSetLimit();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case RDATA:\n return isSetRdata();\n case IILID:\n return isSetIilid();\n case DOCID:\n return isSetDocid();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case ACCESS_TOKEN:\n return isSetAccess_token();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case HR_ID:\n return isSetHrId();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case PID:\n return isSetPid();\n case LOOKUP_ID:\n return isSetLookupId();\n case LOOKUP_VAL:\n return isSetLookupVal();\n case LOOKUP_DESC:\n return isSetLookupDesc();\n case STATUS:\n return isSetStatus();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case TRANSACTION_ID:\n return isSetTransactionId();\n case DATA:\n return isSetData();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case TITLE:\n return isSetTitle();\n case URL:\n return isSetUrl();\n case STATE:\n return isSetState();\n case OP:\n return isSetOp();\n case OP_TIME:\n return isSetOp_time();\n case BACK:\n return isSetBack();\n case DETAILS:\n return isSetDetails();\n }\n throw new IllegalStateException();\n }", "public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case LOCAL_REV:\n return isSetLocalRev();\n case COUNT:\n return isSetCount();\n }\n throw new IllegalStateException();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
painting a yellow block for tetris piece
public void paintBlock(Graphics g, int row, int col, int blockSize) { g.setColor(board.getRandomColor()); g.fillRect(col * blockSize, row * blockSize, blockSize, blockSize); g.setColor(Color.BLACK); g.drawRect(col * blockSize, row * blockSize, blockSize, blockSize); }
[ "public void paintComponent(final Graphics the_graphics) {\n \n super.paintComponent(the_graphics);\n final Graphics2D g2d = (Graphics2D) the_graphics;\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2d.setPaint(Color.LIGHT_GRAY);\n g2d.setStroke(new BasicStroke(1));\n for (int row = 0; row <= SQUARE_SIZE; row++) {\n \n g2d.drawLine(0, SQUARE_SIZE * row, PANEL_WIDTH, SQUARE_SIZE * row);\n }\n for (int column = 0; column <= ROW_LENGTH; column++) {\n g2d.drawLine(column * SQUARE_SIZE, 0, column * SQUARE_SIZE, PANEL_HEIGHT);\n }\n for (int i = 0; i <= ROW_LENGTH; i++) {\n //final Block[] row_blocks = my_playing_board.getFrozenBlocks().get(i);\n for (int j = 0; j <= ROW_HEIGHT; j++) {\n if (my_playing_board.currentPieceAt(i, j)) {\n //System.out.println(my_playing_board);\n g2d.setPaint(Color.RED);\n g2d.fill3DRect(i * SQUARE_SIZE, 360 - ((j - 1) \n * SQUARE_SIZE), SQUARE_SIZE, SQUARE_SIZE, true);\n }\n if (my_playing_board.blockAt(i, j) != null \n && my_playing_board.blockAt(i, j) != Block.EMPTY) {\n g2d.setPaint(Color.BLUE);\n g2d.fill3DRect(i * SQUARE_SIZE, 360 - ((j - 1) \n * SQUARE_SIZE), SQUARE_SIZE, SQUARE_SIZE, true);\n }\n }\n }\n if (my_playing_board.gameIsOver()) {\n g2d.fillRect(0, 0, PANEL_WIDTH, PANEL_HEIGHT);\n g2d.setPaint(Color.LIGHT_GRAY);\n g2d.drawString(\"Game Over!\", 75, PANEL_WIDTH);\n }\n \n }", "@Override\n\tprotected synchronized void paintComponent(Graphics g) \n { \n\t\tsuper.paintComponent(g);\n \n // paint occupied blocks with color blue\n for (Coord shapeCell : myGameGrid.getOccupiedBlocks())\n {\n int X = shapeCell.getRow()*pixels;\n int Y = shapeCell.getCol()*pixels + sideWidth;\n g.setColor(Color.BLUE);\n g.fillRect(Y,X,pixels,pixels);\n }\n\n // draw grid with black lines\n g.setColor(Color.BLACK);\n g.drawRect(sideWidth,0, width*pixels,height*pixels);\n\t\tfor (int i = sideWidth; i < width*pixels + sideWidth; i += pixels) \n {\n\t\t\tg.drawLine(i, 0, i, height*pixels);\n\t\t}\n\n\t\tfor (int i = 0; i < height*pixels; i += pixels) \n {\n\t\t\tg.drawLine(sideWidth, i, sideWidth + width*pixels, i);\n\t\t}\n\t}", "private void drawBoard() {\n\t\tfor (int i = 0; i < pieces.length; i++) {\n\t\t\tfor (int j = 0; j < pieces[0].length; j++) {\n\t\t\t\tif (currX == i && currY == j) {\n\t\t\t\t\tStdDrawPlus.setPenColor(StdDrawPlus.WHITE);\n\t\t\t\t} else if ((i + j) % 2 == 0) {\n\t\t\t\t\tStdDrawPlus.setPenColor(StdDrawPlus.LIGHT_GRAY);\n\t\t\t\t} else {\n\t\t\t\t\tStdDrawPlus.setPenColor(StdDrawPlus.BLACK);\n\t\t\t\t}\n\t\t\t\tStdDrawPlus.filledSquare(i + .5, j + .5, .5);\n\t\t\t}\n\t\t}\n\t}", "public void paintComponent(Graphics g){\n\t\tsuper.paintComponent(g);\n\t\tGraphics2D g2 = (Graphics2D) g;\n\t\tif(displayPiece != null){\n\t\t\tfor(Block block : displayPiece.getBlocks()){\n\t\t\t\tg2.setColor(displayPiece.getColor());\n\t\t\t\tg2.fill(block);\n\t\t\t\tg2.setColor(Color.BLACK);\n\t\t\t\tg2.draw(block);\n\t\t\t}\t\n\t\t}\n\t}", "public void paintCheck(ChessColor color);", "public void paintComponent(Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n g2.setStroke(new BasicStroke(WT));\n int dotx;\n int doty;\n int centX;\n int centY;\n for (int row = 0; row < nRows; row++) {\n for (int col = 0; col < nCols; col++) {\n grid[row][col].pixelX = col*sqSize + sqSize/2;\n grid[row][col].pixelY = row*sqSize + sqSize/2;\n if (grid[row][col].dot || grid[row][col].powerup) {\n g.setColor(Color.PINK);\n if (grid[row][col].dot) {\n // Draw a dot and continue. Continue basically\n // says you're done on this iteration of the loop\n // so go to the next one\n dotx = grid[row][col].pixelX-dotd/2;\n doty = grid[row][col].pixelY-dotd/2;\n g.fillRect(dotx, doty, dotd, dotd);\n continue;\n } else if (grid[row][col].powerup) {\n // draw a powerup\n dotx = grid[row][col].pixelX-sqSize/2;\n doty = grid[row][col].pixelY-sqSize/2;\n g.fillOval(dotx, doty, sqSize, sqSize);\n continue;\n }\n }\n // If there's no dot, then there might be a wall. We\n // can use a switch statement to address each possible\n // value.\n centX = grid[row][col].pixelX;\n centY = grid[row][col].pixelY;\n g.setColor(Color.BLUE);\n switch (grid[row][col].wall) {\n case NONE:\n break;\n case HORIZ:\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX+sqSize/2, centY));\n break;\n case VERT:\n g2.draw(new Line2D.Float(centX, centY-sqSize/2, centX, centY+sqSize/2));\n break;\n case T:\n g2.draw(new Line2D.Float(centX-sqSize/2, centY-sqSize/2+WT, centX+sqSize/2, centY-sqSize/2+WT));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX+sqSize/2, centY));\n break;\n case B:\n g2.draw(new Line2D.Float(centX-sqSize/2, centY+sqSize/2-WT, centX+sqSize/2, centY+sqSize/2-WT));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX+sqSize/2, centY));\n break;\n case L:\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY-sqSize/2, centX-sqSize/2+WT, centY+sqSize/2));\n g2.draw(new Line2D.Float(centX, centY-sqSize/2, centX, centY+sqSize/2));\n break;\n case R:\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY-sqSize/2, centX+sqSize/2-WT, centY+sqSize/2));\n g2.draw(new Line2D.Float(centX, centY-sqSize/2, centX, centY+sqSize/2));\n break;\n case TLC:\n g2.draw(new Arc2D.Float(centX, centY, sqSize, sqSize, 90, 90, Arc2D.OPEN));\n break;\n case TRC:\n g2.draw(new Arc2D.Float(centX-sqSize, centY, sqSize, sqSize, 0, 90, Arc2D.OPEN));\n break;\n case BLC:\n g2.draw(new Arc2D.Float(centX, centY-sqSize, sqSize, sqSize, 180, 90, Arc2D.OPEN));\n break;\n case BRC:\n g2.draw(new Arc2D.Float(centX-sqSize, centY-sqSize, sqSize, sqSize, 270, 90, Arc2D.OPEN));\n break;\n case TLCD:\n g2.draw(new Arc2D.Float(centX, centY, sqSize, sqSize, 90, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-sqSize/2+WT, centY-sqSize/2+WT, 2*sqSize-2*WT, 2*sqSize-2*WT, 90, 90, Arc2D.OPEN));\n break;\n case TRCD:\n g2.draw(new Arc2D.Float(centX-sqSize, centY, sqSize, sqSize, 0, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-3*sqSize/2+WT, centY-sqSize/2+WT, 2*sqSize-2*WT, 2*sqSize-2*WT, 0, 90, Arc2D.OPEN));\n break;\n case TRCU: // DONE RIGHT!\n g2.draw(new Arc2D.Float(centX-sqSize, centY-sqSize, sqSize, sqSize, 270, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-sqSize/2-WT, centY-sqSize/2-WT, 2*WT, 2*WT, 270, 90, Arc2D.OPEN));\n break;\n case TLCU: // DONE RIGHT!\n g2.draw(new Arc2D.Float(centX, centY-sqSize, sqSize, sqSize, 180, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX+sqSize/2-WT, centY-sqSize/2-WT, 2*WT, 2*WT, 180, 90, Arc2D.OPEN));\n break;\n case BLCU: // seems right\n g2.draw(new Arc2D.Float(centX, centY-sqSize, sqSize, sqSize, 180, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-sqSize/2+WT, centY-3*sqSize/2+WT, 2*sqSize-2*WT, 2*sqSize-2*WT, 180, 90, Arc2D.OPEN));\n break;\n case BRCU:\n g2.draw(new Arc2D.Float(centX-sqSize, centY-sqSize, sqSize, sqSize, 270, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-3*sqSize/2+WT, centY-3*sqSize/2+WT, 2*sqSize-2*WT, 2*sqSize-2*WT, 270, 90, Arc2D.OPEN));\n break;\n case BRCD: // DONE RIGHT!\n g2.draw(new Arc2D.Float(centX-sqSize, centY, sqSize, sqSize, 0, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX-sqSize/2-WT, centY+sqSize/2-WT, 2*WT, 2*WT, 0, 90, Arc2D.OPEN));\n break;\n case BLCD: // DONE RIGHT!\n g2.draw(new Arc2D.Float(centX, centY, sqSize, sqSize, 90, 90, Arc2D.OPEN));\n g2.draw(new Arc2D.Float(centX+sqSize/2-WT, centY+sqSize/2-WT, 2*WT, 2*WT, 90, 90, Arc2D.OPEN));\n // g2.draw(new Line2D.Float(centX+sqSize/2, centY+sqSize/2-WT, centX+sqSize/2-WT/2, centY+sqSize/2-WT));\n break;\n case TTL:\n g2.draw(new Arc2D.Float(centX-sqSize, centY, sqSize, sqSize, 0, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY-sqSize/2+WT, centX+sqSize/2, centY-sqSize/2+WT));\n break;\n case TTR:\n g2.draw(new Arc2D.Float(centX, centY, sqSize, sqSize, 90, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY-sqSize/2+WT, centX+sqSize/2, centY-sqSize/2+WT));\n break;\n case LTT:\n g2.draw(new Arc2D.Float(centX, centY-sqSize, sqSize, sqSize, 180, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY-sqSize/2, centX-sqSize/2+WT, centY+sqSize/2));\n break;\n case LTB:\n g2.draw(new Arc2D.Float(centX, centY, sqSize, sqSize, 90, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY-sqSize/2, centX-sqSize/2+WT, centY+sqSize/2));\n break;\n case RTT:\n g2.draw(new Arc2D.Float(centX-sqSize, centY-sqSize, sqSize, sqSize, 270, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY-sqSize/2, centX+sqSize/2-WT, centY+sqSize/2));\n break;\n case RTB:\n g2.draw(new Arc2D.Float(centX-sqSize, centY, sqSize, sqSize, 0, 90, Arc2D.OPEN));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY-sqSize/2, centX+sqSize/2-WT, centY+sqSize/2));\n break;\n case ITLC:\n g2.draw(new Line2D.Float(centX, centY, centX+sqSize/2, centY));\n g2.draw(new Line2D.Float(centX, centY, centX, centY+sqSize/2));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY+sqSize/2-WT, centX+sqSize/2, centY+sqSize/2-WT));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY+sqSize/2-WT, centX+sqSize/2-WT, centY+sqSize/2));\n break;\n case ITRC:\n g2.draw(new Line2D.Float(centX, centY, centX-sqSize/2, centY));\n g2.draw(new Line2D.Float(centX, centY, centX, centY+sqSize/2));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY+sqSize/2-WT, centX-sqSize/2, centY+sqSize/2-WT));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY+sqSize/2-WT, centX-sqSize/2+WT, centY+sqSize/2));\n break;\n case IBLC:\n g2.draw(new Line2D.Float(centX, centY, centX+sqSize/2, centY));\n g2.draw(new Line2D.Float(centX, centY, centX, centY-sqSize/2));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY-sqSize/2+WT, centX+sqSize/2, centY-sqSize/2+WT));\n g2.draw(new Line2D.Float(centX+sqSize/2-WT, centY-sqSize/2+WT, centX+sqSize/2-WT, centY-sqSize/2));\n break;\n case IBRC:\n g2.draw(new Line2D.Float(centX, centY, centX-sqSize/2, centY));\n g2.draw(new Line2D.Float(centX, centY, centX, centY-sqSize/2));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY-sqSize/2+WT, centX-sqSize/2, centY-sqSize/2+WT));\n g2.draw(new Line2D.Float(centX-sqSize/2+WT, centY-sqSize/2+WT, centX-sqSize/2+WT, centY-sqSize/2));\n break;\n case DOOR:\n g.setColor(Color.PINK);\n g.fillRect(centX-sqSize/2, centY+2*WT/3, sqSize, sqSize/2-2*WT);\n break;\n case BER:\n g2.draw(new Line2D.Float(centX-sqSize/2, centY+sqSize/2-WT, centX+sqSize/2, centY+sqSize/2-WT));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX+sqSize/2, centY));\n g2.draw(new Line2D.Float(centX+sqSize/2, centY, centX+sqSize/2, centY+sqSize/2-WT));\n break;\n case BEL:\n g2.draw(new Line2D.Float(centX-sqSize/2, centY+sqSize/2-WT, centX+sqSize/2, centY+sqSize/2-WT));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX+sqSize/2, centY));\n g2.draw(new Line2D.Float(centX-sqSize/2, centY, centX-sqSize/2, centY+sqSize/2-WT));\n break;\n\n default: break;\n }\n }\n }\n }", "@Override\r\n public void render(Graphics g) {\r\n g.drawImage(block_image, x, y, null);\r\n /*\r\n g.setColor(Color.black);\r\n g.fillRect(x, y, 32, 32);\r\n */\r\n }", "public void paint(Position pos, boolean highLight) {\n gridCV[pos.getLine()][pos.getCol()].paint(pos.getLine(), pos.getCol(), highLight);\n }", "@Override\n public void paintComponent(Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n\n boolean checkerboard = false;\n \n Color myWhite = new Color(250,253,253);\n Color myBlack = new Color(77,80,80);\n for (int i = 0; i < 8; i++) {\n checkerboard=!checkerboard;\n for (int j = 0; j < 8; j++){\n Rectangle rect = new Rectangle(i*PIX,j*PIX,PIX,PIX);\n checkerboard=!checkerboard;\n if (checkerboard) { g2.setColor(myBlack); }\n else { g2.setColor(myWhite);}\n g2.fill(rect);\n }\n }\n\n for (int i = 0; i < Controller.Pieces.size(); i++) { // draw all particles\n Sprite thisPiece = Controller.Pieces.get(i);\n if(thisPiece!=selectedPiece) {\n thisPiece.draw(g2);\n }\n }\n if (selectedPiece!=null){\n selectedPiece.draw(g2);\n }\n }", "@Override\r\n\tpublic void paint(Graphics arg0) {\n\t\tsuper.paint(arg0);\r\n\t\tdrawGrid(arg0);\t\r\n\t\targ0.drawString(\"黑棋 : \" + formatTime(black_time) , 55, 473);\r\n\t\targ0.drawString(\"白棋 : \" + formatTime(white_time) , 290, 473);\r\n\t\t\r\n\t\t\tfor(int i =0; i<17;i++){\r\n\t\t\t\tfor(int j = 0;j<17;j++){\r\n\t\t\t\t\tif(mValue[i][j]==1)\r\n\t\t\t\t\t\tdrawChess(arg0,Color.black,i,j);\r\n\t\t\t\t\telse if(mValue[i][j]==2){\r\n\t\t\t\t\t\tdrawChess(arg0,Color.white,i,j);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\t\t\t\t\r\n\t}", "public synchronized void paint() {\n\t\t_block = (canvas.getHeight()-(_lineWidth*game.getParams().getHeight()))/game.getParams().getHeight();\n\t\t_lineWidth = Math.max(1, 0.075*_block);\n\t\t_cupBegY = 0;\n\t\t_cupBegX = canvas.getWidth()/2-game.getParams().getWidth()*_block*1.0/2-(game.getParams().getWidth()-1)*_lineWidth/2;\n\t\t\n\t\tGraphicsContext image = canvas.getGraphicsContext2D();\n\n\t\tpaintBackground(image);\n\t\tpaintBlocks(image);\n\t\t\n\t\t_infoBegX = 1.01*(canvas.getWidth()-_cupBegX+_lineWidth*game.getParams().getWidth()*0.5);\n\t\t_infoBegY = canvas.getHeight()/5;\n\t\tpaintInfoPlate(image);\n\t\tpaintInfo(image);\n\t}", "public void paint(Graphics2D g){\n //loop through all tiles in the map to render\n for (int x = 0; x < WIDTH; x++){\n for (int y = 0; y < HEIGHT; y++){\n //if the cell is blocked, it will draw it \n int alpha = 0;\n Color transparent;\n transparent = new Color(0, 0, 0, alpha);\n g.setColor(Color.white);\n if (data[x][y] == NOT_CLEAR){\n g.setColor(Color.black); \n }\n \n g.fillRect(x*BLOCK_SIZE, y*BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE);\n } \n }\n }", "private static void draw() {\n\t\tWindow.out.background(\"yellow\");\n\t\t\n\t\t// Go to every x, y position\n\t\tfor (int x = 0 ; x < width ; x++) {\n\t\t\tfor (int y = 0 ; y < height ; y++) {\n\t\t\t\t\n\t\t\t\t// Pick the drawing color based on what is in the board position.\n\t\t\t\tif (board[x][y] == 0) {\n\t\t\t\t\tif (active == x) {\n\t\t\t\t\t\tWindow.out.color(\"gray\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tWindow.out.color(\"black\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (board[x][y] == 1) {\n\t\t\t\t\tWindow.out.color(\"red\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tWindow.out.color(\"blue\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Draw a black circle\n\t\t\t\tWindow.out.circle(x * size + size / 2, y * size + size / 2, size * 4 / 9);\n\t\t\t}\n\t\t}\n\t}", "public void paintComponent(Graphics g) {\n\t int margin = 1;\n\t Dimension dim = getSize();\n\t super.paintComponent(g);\n\t if(currColor == \"GREEN\") g.setColor(new Color(108, 196, 84));\t\t\t//regular unblocked cell\n\t if(currColor == \"DARK_GREEN\") g.setColor(new Color(57, 104, 33));\t\t//Hard to traverse cell\n\t if(currColor == \"BLACK\") g.setColor(Color.black);\t\t\t\t\t\t//blocked cell\n\t if(currColor == \"LIGHT_BLUE\") g.setColor(Color.blue.brighter());\t\t//Regular unblocked with highway\n\t if(currColor == \"DARK_BLUE\") g.setColor(Color.blue.darker());\t\t\t//Hard to traverse with highway\n\t if(currColor == \"PURPLE\") g.setColor(new Color(204, 0, 204));\t\t\t//START\n\t if(currColor == \"RED\") g.setColor(new Color(255, 0, 0));\t\t\t\t//GOAL\n\t if(currColor == \"BLUE_GREEN\") g.setColor(new Color(0, 102, 102));\t\t//FRINGE\n\t if(currColor == \"LIGHT_BLUE_GREEN\") g.setColor(new Color(51, 255, 156));//SEARCHED new Color(0, 204, 153)\n\t if(currColor == \"GOLD\") g.setColor(new Color(255, 217, 0));\t\t\t\t//PATH\n\t if(currColor == \"WHITE\") g.setColor(Color.WHITE);\n\t g.fillRect(margin, margin, dim.width, dim.height);\n\t }", "public static void drawBlock(DrawSurface d, int x, int y, int width, int height, Color colorOfBlock) {\n //dark\n d.setColor(Color.darkGray.darker());\n d.fillRectangle(x, y + 5, width - 4, height - 5);\n //color\n d.setColor(colorOfBlock);\n d.fillRectangle(x + 1, y, width, height - 2);\n //dots\n d.setColor(Color.GRAY.darker().darker().darker());\n d.fillRectangle(x + 5, y + 4, 3, 3);\n d.fillRectangle(x + 5, y + height - 8, 3, 3);\n d.fillRectangle(x - 5 + width, y + height - 8, 3, 3);\n d.fillRectangle(x - 5 + width, y + 4, 3, 3);\n //bright\n d.setColor(Color.LIGHT_GRAY.brighter());\n d.fillRectangle(x + 4, y, width - 3, 2);\n d.fillRectangle(x + width, y, 1, height - 5);\n }", "private void drawBlock(WritableRaster wr, Color color, int length, int x, int y) {\n int[] pixels = new int[length];\n for (int i = 0; i < pixels.length; i++) {\n pixels[i] = color.getRGB();\n }\n wr.setDataElements(x, y, length, 1, pixels);\n }", "private void paintLargestBlock(int row, int column, int size) {\n for (int i = row; i < row + size; i++) {\n for (int j = column; j < column + size; j++) {\n paintSquare(i, j);\n }\n }\n }", "protected void paintTile(String light_edge_color,\n String main_color, String shadow_edge_color,\n int count_column, int count_row) {\n // coloring the light top and left edges respectively\n gc.setFill(Color.web(light_edge_color));\n gc.fillRect(columnCell.get(count_column), rowCell.get(count_row),\n gridXSpace, TILE_EDGE_EFFECT_THICKNESS);\n gc.fillRect(columnCell.get(count_column), rowCell.get(count_row),\n TILE_EDGE_EFFECT_THICKNESS, gridYSpace);\n\n // coloring main tile body\n gc.setFill(Color.web(main_color));\n gc.fillRect(columnCell.get(count_column) + TILE_EDGE_EFFECT_THICKNESS,\n rowCell.get(count_row) + TILE_EDGE_EFFECT_THICKNESS,\n gridXSpace - TILE_EDGE_EFFECT_THICKNESS,\n gridYSpace - TILE_EDGE_EFFECT_THICKNESS);\n\n // coloring tile's shadow for bottom and right edges respectively\n gc.setFill(Color.web(shadow_edge_color));\n gc.fillRect(columnCell.get(count_column) + TILE_EDGE_EFFECT_THICKNESS,\n rowCell.get(count_row) + gridYSpace - TILE_EDGE_EFFECT_THICKNESS,\n gridXSpace - TILE_EDGE_EFFECT_THICKNESS,\n TILE_EDGE_EFFECT_THICKNESS);\n gc.fillRect(columnCell.get(count_column)\n + gridXSpace - TILE_EDGE_EFFECT_THICKNESS,\n rowCell.get(count_row) + TILE_EDGE_EFFECT_THICKNESS,\n TILE_EDGE_EFFECT_THICKNESS,\n gridYSpace - TILE_EDGE_EFFECT_THICKNESS);\n }", "@Override\r\n\tpublic void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\t\tint cellWidth = this.getWidth() / 4;\r\n\t\tint tileSize = 4*cellWidth/5;\r\n\t\tint shape;\r\n\t\tColor color;\r\n\t\tTile tile;\r\n\t\tfor (int i = 0; i < tiles.size(); i++) {\r\n\t\t\ttile = tiles.get(i);\r\n\t\t\tshape = tile.getShape();\r\n\t\t\tcolor = tile.getActualColor();\r\n\t\t\tg.setColor(color);\r\n\t\t\tif (shape == 0) {\r\n\t\t\t\tg.fillOval(i*cellWidth + cellWidth/10, cellWidth/10, tileSize, tileSize); \r\n\t\t\t} else if (shape == 1) {\r\n\t\t\t\tg.fillRect(i*cellWidth + cellWidth/10, cellWidth/10, tileSize, tileSize);\r\n\t\t\t} \r\n\t\t}\r\n\t}", "public void showMine() {\n colorIndex = 5;\n setBackground(COLORS[colorIndex]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CRUD RESTful methods below Alta
public Perfil crear(Perfil p) { log.info("Antes de crear: " + p); // excepción si la instancia tiene id // excepción si la instancia no tiene info em.persist(p); log.info("Despues de crear: " + p); return p; }
[ "public interface BooksClient {\n\n @GET(\"books\")\n Call<List<Book>> all();\n\n @POST(\"books\")\n Call<SimpleResponse> insert(@Body Book book);\n\n}", "public interface ApiContenedor {\n @GET(\"api/contenedores/get?\")\n Call<List<Contenedor>> getContenedores(@Query(\"id\") String id);\n\n @GET(\"api/contenedores/get\")\n Call<List<Contenedor>> getContenedores();\n\n @POST(\"api/contenedores/agregar\")\n Call<Contenedor> agregar(@Body Contenedor contenedor);\n\n @POST(\"api/contenedores/modificar\")\n Call<Contenedor> modificar(@Body Contenedor contenedor);\n}", "@Path(\"/comment\")\n@Consumes(\"application/json\")\n@Produces(\"application/json\")\npublic interface CommentRestApi {\n\n @GET\n @Path(\"/byArticleId/{articleId}\")\n List<Comment> getByArticleId(@PathParam(\"articleId\")Long articleId);\n\n @POST\n Comment save(Comment comment);\n\n @DELETE\n @Path(\"/{id}\")\n Response delete(@PathParam(\"id\") Long id);\n\n}", "@GET\n @Path(\"vinculaAutor/{idautor}/{idlivro}\") //http://localhost:8080/dac-rest/api/integrantes/1\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response vinculaAutorALivro(@PathParam(\"idlivro\") int idLivro, @PathParam(\"idautor\") int idAutor)\n {\n Livro l = service.FindById(idLivro);\n Autor a = service.findByAutorByid(idAutor);\n l.addAutor(a);\n service.Update(l);\n GenericEntity<Livro> entity = new GenericEntity<Livro>(l) {\n };\n return Response.ok() \n .entity(entity)\n .build();\n }", "private void createRuleApi() {\n\t// ../rules --> GET all rules\n\trest(restApiBasePath + \"/rules\").get().outTypeList(Rule.class)\n\t\t.to(\"bean:ruleApi?method=getRules\");\n\n\t// ../rules -->POST: creates a new rule\n\trest(restApiBasePath + \"/rules\").post().type(Rule.class).to(\"bean:ruleApi?method=addRule\");\n\n\t// ../rules/<ID> -->GET rules with <ID>\n\trest(restApiBasePath + \"/rules/{ruleId}\").get().outType(Rule.class)\n\t\t.to(\"bean:ruleApi?method=getRuleByID(${header.ruleId})\");\n\n\t// ../rules/<ID> -->PUT: updates the rule with this id\n\trest(restApiBasePath + \"/rules/{ruleId}\").put().type(Situation.class)\n\t\t.to(\"bean:ruleApi?method=updateRuleSituation(${header.ruleId})\");\n\n\t// ../rules/<ID> -->Delete: deletes the rule with this id\n\trest(restApiBasePath + \"/rules/{ruleId}\").delete()\n\t\t.to(\"bean:ruleApi?method=deleteRule(${header.ruleId})\");\n\n\t// ../rules/<ID>/actions --> GET all actions of rule <ID>\n\trest(restApiBasePath + \"/rules/{ruleId}/actions\").get().outTypeList(Action.class)\n\t\t.to(\"bean:ruleApi?method=getActionsByRule(${header.ruleId})\");\n\n\t// ../rules/<ID>/actions -->POST: creates a new action\n\trest(restApiBasePath + \"/rules/{ruleId}/actions\").post().type(Action.class)\n\t\t.to(\"bean:ruleApi?method=addAction(${header.ruleId})\");\n\n\t// ../rules/<ID>/actions/<actionID> --> GET action with <actionID>\n\trest(restApiBasePath + \"/rules/{ruleId}/actions/{actionId}\").get().outType(Action.class)\n\t\t.to(\"bean:ruleApi?method=getActionByID(${header.actionId})\");\n\n\t// ../rules/<ID>/actions/<actionID> --> PUT: updates the action with\n\t// <actionID>\n\trest(restApiBasePath + \"/rules/{ruleId}/actions/{actionId}\").put().type(Action.class)\n\t\t.to(\"bean:ruleApi?method=updateAction(${header.actionId})\");\n\n\t// ../rules/<ID>/actions/<actionID> --> DELETE: deltes the action with\n\t// <actionID>\n\trest(restApiBasePath + \"/rules/{ruleId}/actions/{actionId}\").delete()\n\t\t.to(\"bean:ruleApi?method=deleteAction(${header.actionId})\");\n\n }", "@Path(\"/account\")\n@Consumes({\"*/xml\", MediaType.APPLICATION_JSON})\n@Produces({MediaType.APPLICATION_JSON})\npublic interface AccountRestDef extends RestDef {\n\n //登录, 用户根据用户名和密码登录\n @GET\n @Path(\"/login/{\" + PARAM_USER_NAME + \"}/{\" + PARAM_PASSWORD + \"}\")\n UserInfo getAccountInfo(\n @PathParam(PARAM_USER_NAME) String userName,\n @PathParam(PARAM_PASSWORD) String password);\n\n //根据用户ID和最后更新日期获取最新用户信息\n @GET\n @Path(\"/get/{\" + PARAM_USER_ID + \"}\")\n UserInfo getAccountInfoByID(\n @PathParam(PARAM_USER_ID) String userId,\n @QueryParam(PARAM_LAST_UPDATE_TIME) String lastUpdateTime);\n\n //创建新用户\n @POST\n @Path(\"/create\")\n UserInfo createAccountInfo(UserBase userBase);\n\n //更新用户基本信息\n @PUT\n @Path(\"/update/base/{\" + PARAM_USER_ID + \"}\")\n void updateAccountBase(@PathParam(PARAM_USER_ID) String userId,\n UserBase userBase);\n\n //更新用户所有信息\n @PUT\n @Path(\"/update/detail/{\" + PARAM_USER_ID + \"}\")\n void updateAccountInfo(@PathParam(PARAM_USER_ID) String userId,\n UserInfo userInfo);\n\n //创建或者更新好友关系\n @POST\n @Path(\"/friends/create/{\" + PARAM_USER_ID + \"}\")\n void createOrUpdateUserFriend(@PathParam(PARAM_USER_ID) String userId,\n UserFriend userFriend);\n\n //获取我的关注\n @GET\n @Path(\"/friends/get/{\" + PARAM_USER_ID + \"}\")\n List<UserFriend> getUserFriends(\n @PathParam(PARAM_USER_ID) String userId,\n @QueryParam(PARAM_LAST_UPDATE_TIME) String lastUpdateTime);\n\n //获取推荐列表\n @GET\n @Path(\"/friends/recommend/{\" + PARAM_PAGE_NO + \"}\")\n List<SearchUserInfo> getRecommendFriends(\n @PathParam(PARAM_PAGE_NO) String pageNo);\n\n //创建用户动作\n @POST\n @Path(\"/action/create/{\" + PARAM_USER_ID + \"}\")\n void createUserAction(@PathParam(PARAM_USER_ID) String userId,\n UserAction userAction);\n\n //获取最新的用户动作\n @GET\n @Path(\"/action/get/{\" + PARAM_USER_ID + \"}\")\n List<UserAction> getNewlyUserAction(\n @PathParam(PARAM_USER_ID) String userId);\n\n //获取用户动作\n @GET\n @Path(\"/action/others/get/{\" + PARAM_USER_ID + \"}\")\n List<UserAction> getUserActionById(\n @PathParam(PARAM_USER_ID) String userId);\n\n //根据用户的昵称,搜索用户\n @GET\n @Path(\"/search/get/{\" + PARAM_NICK_NAME + \"}\")\n List<SearchUserInfo> searchAccountInfoByName(\n @PathParam(PARAM_NICK_NAME) String nickName);\n\n //根据lastupdatetime获取最新好友更新之后的状态\n @GET\n @Path(\"/friendsort/get/{\" + PARAM_USER_ID + \"}\")\n List<FriendSortInfo> getFriendSort(\n @PathParam(PARAM_USER_ID) String userId,\n @QueryParam(PARAM_LAST_UPDATE_TIME) String lastUpdateTime);\n\n //获取用户道具\n @GET\n @Path(\"/props/get/{\" + PARAM_USER_ID + \"}\")\n List<UserProp> getUserProps(\n @PathParam(PARAM_USER_ID) String userId,\n @QueryParam(PARAM_LAST_UPDATE_TIME) String lastUpdateTime);\n\n //新增用户道具\n @POST\n @Path(\"/props/create/{\" + PARAM_USER_ID + \"}\")\n void createOrUpdateUserProp(@PathParam(PARAM_USER_ID) String userId,\n List<UserProp> userProps);\n\n //获取随机奖励\n @GET\n @Path(\"/reward/get/{\" + PARAM_USER_ID + \"}\")\n RewardDetails getRandomReward(\n @PathParam(PARAM_USER_ID) String userId);\n}", "public interface RestApi {\n\n\n @GET(\"/contacts.json\")\n Call<List<Contact>> getContacts();\n\n @GET(\"/contacts/{contact_id}.json\")\n Call<Contact> getContactDetails(@Path(\"contact_id\") String contactId);\n\n @PUT(\"/contacts/{contact_id}.json\")\n Call<Contact> updateContact(@Body JsonObject jsonObject, @Path(\"contact_id\") String contactId);\n\n @POST(\"/contacts.json\")\n Call<Contact> saveContact(@Body JsonObject jsonObject);\n\n\n}", "public static void main(String[] args) {\n\n\t\tClient client = ClientBuilder.newClient();\n//\t\tWebTarget target = client.target(\"http://localhost:8080/patient/patientservice/getpatients\");\n//\t\tBuilder request = target.request();\n//\t\tResponse response = request.get();\n//\t\tList<Patient> list = response.readEntity(new GenericType<List<Patient>>() {});\n//\t\tSystem.out.println(response.getStatus());\n//\t\tfor (Patient patient : list) {\n//\t\t\tSystem.out.println(patient.getId() + \" \" + patient.getName());\n//\t\t}\n\n\t\t// get patient by id\n\n//\t\tClient client = ClientBuilder.newClient();\n//\t\tWebTarget target = client.target(\"http://localhost:8080/patient/patientservice/getpatientbyid/1\");\n//\t\tBuilder request = target.request();\n//\t\tResponse response = request.get();\n//\t\tPatient patient = response.readEntity(Patient.class);\n//\t\tSystem.out.println(patient.getId()+\" \"+patient.getName());\n\n\t\t// createPatient\n\n\t\tWebTarget target = client.target(\"http://localhost:8080/patient/patientservice/createpatient\");\n\t\tBuilder request = target.request();\n\t\tPatient patient = new Patient();\n\t\tpatient.setName(\"Bharath\");\n// request.header(\"Content-Type\", MediaType.APPLICATION_JSON);\n//\t request.header(\"Content-Type\", \"application/json\");\n\t\tResponse response = request.post(Entity.entity(patient, MediaType.APPLICATION_XML), Response.class);\n\t\tSystem.out.println(response.getStatus());\n\n\t\t// updatePatient\n\n\n//\t\tWebTarget target = client.target(\"http://localhost:8080/patient/patientservice/update\");\n//\t\tBuilder request = target.request();\n//\t\tPatient patient = new Patient();\n//\t\tpatient.setId(3);\n//\t\tpatient.setName(\"Bharath\");\n//\t\tResponse response = request.put(Entity.entity(patient, MediaType.APPLICATION_XML), Response.class);\n//\t\tSystem.out.println(response.getStatus());\n\n\t\t// deletePatient\n\n\n//\t\tWebTarget target = client.target(\"http://localhost:8080/patient/patientservice/delete/3\");\n//\t\tBuilder request = target.request();\n//\t\tResponse response = request.delete();\n//\t\tSystem.out.println(response.getStatus());\n\n\t\tclient.close();\n\t}", "@Api(value=\"trashCollect接口\",description = \"医废收集\")\npublic interface TrashCollectControllerApi {\n\n @ApiOperation(\"分页查询医废收集列表\")\n @ApiImplicitParams({\n //required=true是否必填,paramType=\"path\"是http请求路径,dataType=\"int\"数据类型\n @ApiImplicitParam(name=\"page\",value = \"页 码\",required=true,paramType=\"path\",dataType=\"int\"),\n @ApiImplicitParam(name=\"size\",value = \"每页记录 数\",required=true,paramType=\"path\",dataType=\"int\") })\n public QueryResponseResult findList(int page, int size, TrashCollectRequest trashCollectRequest) ;\n\n @ApiOperation(\"添加医废收集\")\n public TrashCollectResult add(TrashCollect trashCollect);\n\n @ApiOperation(\"通过id查询医废收集\")\n @ApiImplicitParams({@ApiImplicitParam(name=\"id\",value = \"医废收集id\",required=true,paramType=\"path\",dataType=\"String\") })\n public TrashCollectResult findById(String id);\n\n\n @ApiOperation(\"通过id修改医废收集\")\n public TrashCollectResult edit(String id, TrashCollect trashCollect);\n\n @ApiOperation(\"通过id删除医废收集\")\n @ApiImplicitParams({@ApiImplicitParam(name=\"id\",value = \"医废收集id\",required=true,paramType=\"path\",dataType=\"String\") })\n public ResponseResult delete(String id);\n}", "public interface ApiService {\n\n @GET(\"main\")\n Call<List<Category>> getCategories();\n\n @GET(\"categories/{id}\")\n Call<List<CategoryViewModel>> getCategoriesModel(@Path(\"id\") String id);\n\n @POST(\"register/user\")\n Call<User> postUser(@Body User user);\n\n\n @POST(\"post/order/{userId}\")\n Call<List<CategoryViewModel>> postCategories(@Path(\"userId\") String id);\n\n}", "public interface UserApi {\n @GET(\"register1.php?operasi=insert\")\n Call<ResponseBody> register(@Query(\"name\") String name,\n @Query(\"username\") String username,\n @Query(\"age\") String age,\n @Query(\"password\") String password);\n\n @GET(\"register1.php?operasi=view\")\n Call<ResponseBody> getBiodata();\n\n @GET(\"register1.php?operasi=get_biodata_by_id&id={id}\")\n Call<ResponseBody> getBiodata(@Path(\"id\") String id);\n\n @GET(\"register1.php?operasi=update&id={id}&nama={nama}&alamat={alamat}\")\n Call<ResponseBody> update(@Path(\"id\") String id,\n @Path(\"nama\") String nama,\n @Path(\"alamat\") String alamat);\n\n @GET(\"register1.php?operasi=delete&id={id}\")\n Call<ResponseBody> delete(@Path(\"id\") String id);\n}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse response){\n\t\tString method = req.getParameter(\"method\");\r\n\t\tif (\"findById\".equals(method)) {\r\n\t\t\tfindById(req, response);\r\n\t\t}\r\n\t}", "@GetMapping //tells that which http verb would be used - in this case get\n public List<Session> list(){\n return sessionRepository.findAll(); //This is how powerful jpa is - it builds this method for us\n }", "@RepositoryRestResource(path=\"usuarios\")\npublic interface UsuarioDao extends PagingAndSortingRepository<Usuario, Long> {\n\t\n\t@RestResource(path=\"buscar-username\")\n\tpublic Usuario findByUsername(@Param(\"username\") String username);\n\n}", "@GetMapping(\"/usuarios\")\n @ApiOperation(\"Recupera todos los usuarios.\")\n public List<Usuario> recuperarUsuarios(){\n return servicio.recuperarUsuarios();\n }", "@Path(\"/v1/orders\")\npublic interface OrderResource {\n\n /**\n * Gets an order by its key.\n * @param id\n * @return\n */\n @GET\n @Path(\"/{id}\")\n @Produces({ MediaType.APPLICATION_JSON })\n public Response getOrder(@PathParam(\"id\") Long id);\n \n /**\n * Creates an order record based on the data passed in. Returns the id of the record.\n * @param orderDto\n * @return The id of the new record\n */\n @POST\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response createOrder(OrderDto orderDto);\n\t\n /**\n * Updates an order record based on the data passed in. Changing the customer\n * will result in a 422 UNPROCESSABLE_ENTITY.\n * @param orderDto\n * @return the id of the record.\n */\n @PUT\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response updateOrder(@PathParam(\"id\") Long id, OrderDto orderDto);\n \n /**\n * Deletes an order by its key.\n * @param id\n * @return\n */\n @DELETE\n @Path(\"/{id}\")\n @Produces({ MediaType.APPLICATION_JSON })\n public Response deleteOrder(@PathParam(\"id\") Long id);\n}", "public interface ToDoAPI {\n\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"/todo/gettododata\")\n Call<ArrayList<ToDoNoteItem>> getToDoDate(@Body GetToDoDateRequestBody getToDoDateRequestBody);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"/todo/createnewtodo\")\n Call<Boolean> createNewToDo(@Body CreateToDoRequestBody getToDoDateRequestBody);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"/todo/updatetodocontent\")\n Call<Boolean> updateToDoContent(@Body EditToDoContentRequestBody editToDoContentRequestBody);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"/todo/deletetodo\")\n Call<Boolean> deleteToDo(@Body DeleteToDoRequestBody deleteToDoRequestBody);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"/todo/updatefinshtodo\")\n Call<Boolean> updateFinshToDo(@Body UpdateFinshToDoRequestBody updateFinshToDoRequestBody);\n\n}", "public void testCRUD() {\r\n\t\tlog.info(\"Inicio - testCRUD()\");\r\n\r\n\t\tlog.info(\"------Agregar------\");\r\n\r\n\t\tTarjeta t = new Tarjeta();\r\n\t\tt.setActivo(true);\r\n\t\tt.setCodigo(\"codigo\");\r\n\t\tt.setNumPlaca(\"numPlaca\");\r\n\r\n\t\ttry {\r\n\t\t\ttl.agregar(t);\r\n\t\t} catch (AvException e) {\r\n\t\t\tlog.error(\"Error ocurrido al agregar una tarjeta\");\r\n\t\t\tfail(\"Error al intentar agregar una tarjeta\");\r\n\t\t}\r\n\t\tlog.info(\"Nuevo id : \" + t.getId());\r\n\r\n\t\tlog.info(\"------Actualizar------\");\r\n\r\n\t\tt.setCodigo(\"test\");\r\n\t\tt.setNumPlaca(\"test\");\r\n\r\n\t\ttry {\r\n\t\t\ttl.actualizar(t);\r\n\t\t} catch (AvException e) {\r\n\t\t\tlog.error(\"Error ocurrido al actualizar una tarjeta\");\r\n\t\t\tfail(\"Error al intentar actualizar una tarjeta\");\r\n\t\t}\r\n\r\n\t\tlog.info(\"------Obtener------\");\r\n\r\n\t\tt = tl.obtener(t.getId());\r\n\r\n\t\tassertNotNull(\"No se pudo obtener la tarjeta previamente creada\", t);\r\n\t\tassertEquals(\"No coinciden los codigos\", \"test\", t.getCodigo());\r\n\t\tassertEquals(\"No coincide los num. de placa\", \"test\", t.getNumPlaca());\r\n\r\n\t\tlog.info(\"------Eliminar------\");\r\n\r\n\t\ttry {\r\n\t\t\ttl.eliminar(t);\r\n\t\t} catch (AvException e) {\r\n\t\t\tlog.error(\"Error al restaurar los datos en la base de datos\");\r\n\t\t\tfail(\"Error al restaurar los datos en la base de datos\");\r\n\t\t}\r\n\r\n\t\tlog.info(\"Fin - testCRUD()\");\r\n\t}", "public interface EmployeeResource {\n\n\t/**\n\t * Retrieves the {@link Employee} resource by id.\n\t *\n\t * @param id\n\t * employee id.\n\t * @return {@link Employee} resource.\n\t */\n\t@RequestMapping(\"/v1/bfs/employees/{id}\")\n\tResponseEntity<EmployeeEnitity> employeeGetById(@PathVariable(\"id\") Long id);\n /**\n * Add Employee\n */\n\t@RequestMapping(\"/v1/bfs/employees\")\n\tResponseEntity<EmployeeEnitity> addEmployee(@RequestBody EmployeeEnitity employee);\n\n}", "private void createHistoryApi() {\n\trest(restApiBasePath + \"/history\").get().outTypeList(HistoryEntry.class)\n\t\t.to(\"bean:historyApi?method=getHistory\");\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes an instance of TrafficsImpl.
TrafficsImpl(TrafficClientImpl client) { this.service = RestProxy.create(TrafficsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; }
[ "public TraceFactoryImpl()\n {\n super();\n }", "public Traccion() {\r\n\t\t\tsuper();\r\n\t\t}", "public Trail() {\r\n\t\t// initialise instance variables\r\n\t\tNatureFeature[] features = new NatureFeature[4];\r\n\t}", "public Tutor() {\n\n\t}", "void initiate()\n {\n TravelDisutility travelDisutility = new DistanceAsTravelDisutility();\n\n TaxiSchedulerParams params = new TaxiSchedulerParams(tcg.isDestinationKnown(),\n tcg.isVehicleDiversion(), tcg.getPickupDuration(), tcg.getDropoffDuration(), 1.);\n\n resetSchedules(context.getVrpData().getVehicles().values());\n\n TaxiScheduler scheduler = new TaxiScheduler(context, params, travelTime, travelDisutility);\n\n RuleBasedTaxiOptimizerParams optimParams = new RuleBasedTaxiOptimizerParams(null);\n\n TaxiOptimizerContext optimContext = new TaxiOptimizerContext(context, travelTime,\n travelDisutility, optimParams, scheduler);\n optimizer = new RuleBasedTaxiOptimizer(optimContext);\n\n }", "public Trainer() {\r\n\r\n\t}", "public Trades()\r\n\t{\r\n\t\ttrades = new ArrayList<Trade>();\r\n\t}", "public TracingService() {\n }", "public TenureList() {\n }", "public Trainer() {\n }", "public Trailers() {\n }", "public TmodelFactoryImpl() {\n\t\tsuper();\n\t}", "protected void init() {\r\n setTraversalVisitor(new AeTraversalVisitor(new AeDefTraverser(), this));\r\n }", "public Trace(){\n\t\tthis(new ArrayList<>());\n\t}", "public TechnicalTicketDetails() {\n }", "public MTLFactoryImpl()\n {\n super();\n }", "public TcManager() {\n TcManager.instance = this;\n }", "public void initialize() {\n \n this.configuration = this.configurationService.loadDefault();\n\n this.costCenters = this.movementService.listCostCenters(false);\n \n // se nao houver uma configuracao, cria uma\n if (this.configuration == null) {\n this.configuration = new Configuration();\n this.movementClasses = this.movementService.listMovementClasses(false);\n } else {\n this.loadMovementClasses();\n }\n }", "public XMLTrailParser(){\n trailSystem = new TrailSystem();\n /* end constructor */\n }", "public Trajectory() {\n points = new LinkedList();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fonction qui renvoit la construction hasardeuse d'un bateau
public ArrayList<String> hasardcontruc(String name) { String finalpos = null; ArrayList<String> loca = new ArrayList<String>(); String a = hasard(); if (name.equals("carrier")) { finalpos = Config.compfonc(a, 5); if (!Config.isCorrect(finalpos)) { return hasardcontruc(name); } else { loca = Config.locacalcul(a, finalpos); return loca; } } else if (name.equals("battleship")) { finalpos = Config.compfonc(a, 4); if (!Config.isCorrect(finalpos)) { return hasardcontruc(name); } else { loca = Config.locacalcul(a, finalpos); return loca; } } else if (name.equals("cruiser")) { finalpos = Config.compfonc(a, 3); if (!Config.isCorrect(finalpos)) { return hasardcontruc(name); } else { loca = Config.locacalcul(a, finalpos); return loca; } } else if (name.equals("submarine")) { finalpos = Config.compfonc(a, 3); if (!Config.isCorrect(finalpos)) { return hasardcontruc(name); } else { loca = Config.locacalcul(a, finalpos); return loca; } } else { finalpos = Config.compfonc(a, 2); if (!Config.isCorrect(finalpos)) { return hasardcontruc(name); } else { loca = Config.locacalcul(a, finalpos); return loca; } } }
[ "public Bateau(){\n\t\t\n\t}", "private void inizia() {\n this.braccioVert = this.creaBraccio(true);\n this.braccioOrizz = this.creaBraccio(false);\n }", "private Birim_Veri_Al(){}", "@Override\n\t\t\tpublic void afficherPlateau(Plateau plateau) {\n\t\t\t\t\n\t\t\t}", "private void escribirEnPantalla() {\n }", "private ArbreBinaireOrdonne(){\n this.element = null;\n this.sag = null;\n this.sad = null;\n }", "void añadeJuez(){\n if(!tieneJuez){\n Casilla numJuez = new Casilla(numCasillaCarcel,\"Juez\");\n this.añadeCasilla(numJuez);\n tieneJuez = true;\n }\n }", "public Levyt(){\n\t\t\t//oletus muodostaja\n\t\t}", "Cuentas() {\n cabeza = null; /* cabeza queda apuntando a nulo */\n }", "public Arco(){\r\n this.flechaPuesta = true;\r\n }", "Eisdiele() {\r\n\r\n\t}", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "public void ataqueConstructorZerg(){\n Actor Aconst = this.getOneIntersectingObject(ConstructorZerg.class);\n if (Aconst != null){\n int random = Greenfoot.getRandomNumber(100);\n int daño = (48*random)/100;\n setEnergia(-daño);\n }\n }", "public void busca() {}", "private Abierto(){}", "@Override\r\n\tpublic void borraOrdenCollita(OrdenCollita ordencollita) {\n\r\n\t}", "void abstraheren();", "@Override\r\n\tpublic void attaque(Vaisseau vaisseau) {\n\r\n\t}", "ArvoreBinaria() {\n raiz = null;\n }", "public void transparenciaBoton() {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads items from query scope and params.
@SuppressWarnings("unchecked") protected void loadItems() { try { APCallback<List<T>> callback = new APCallback<List<T>>() { @Override public void finished(final List<T> arg0, Throwable ex) { if(ex != null) { ex.printStackTrace(); return; } if(mPermenantItems != null) { arg0.addAll(0, mPermenantItems); } setItems(arg0); if(mOnLoadListener != null) mOnLoadListener.onLoad(arg0); } }; Method cacheMethod = getClazz().getMethod("fetchInCacheWithParameterPredicate", String.class, Map.class); Object list = cacheMethod.invoke(null, mQueryScope, mQueryParams); if(list != null && ((List<T>) list).size() != 0) { callback.onSuccess((List<T>) list); } if(mQueryParams == null) { Method m = getClazz().getMethod("queryInBackground", String.class, IAPFutureCallback.class); m.invoke(null, mQueryScope, callback); } else { Method m = getClazz().getMethod("queryInBackground", String.class, Map.class, IAPFutureCallback.class); m.invoke(null, mQueryScope, mQueryParams, callback); } } catch(NoSuchMethodException e) { e.printStackTrace(); } catch(IllegalAccessException e) { e.printStackTrace(); } catch(InvocationTargetException e) { e.printStackTrace(); } }
[ "void loadItems();", "public void loadItems() {\n if (itemList == null) {\n try {\n updateItems();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }", "private void loadParams() {\n\t\tIterator i = _params.keySet().iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tString key = (String) i.next();\n\t\t\t_params.put(key, request.getParameter(key));\n\t\t}\n\t}", "public List<E> loadItems(int page);", "@GetMapping\n public ResponseEntity<List<Item>> getAllItems(@RequestParam Map<String,Object> allParams) {\n List<Item> items = Collections.emptyList();\n if(allParams.containsKey(\"itemStatus\") && allParams.containsKey(\"itemEnteredByUser\")) {\n items = itemService.getItemByParams((ItemStatus) allParams.get(\"itemStatus\"), (String) allParams.get(\"itemEnteredByUser\"));\n } else if(allParams.containsKey(\"itemStatus\") && allParams.containsKey(\"itemEnteredByUser\")){\n\n } else {\n items = itemService.getAllItems();\n }\n return new ResponseEntity<>(items, HttpStatus.OK);\n }", "List<Athlete> load(Object... additionalParams);", "ItemDataWrapper getItem(Map<String, String> pathParameters, Map<String, String> queryParameters, HttpPoolUtils poolUtils, Map<String, String> headers) throws Exception {\n return (ItemDataWrapper) get(HttpUrls.ITEMS_ID, pathParameters, queryParameters, ItemDataWrapper.class, poolUtils, headers);\n }", "private void loadData() {\n // Show ProgressDialog if not visible\n if (mProgressDialog == null || !mProgressDialog.isShowing()) {\n showProgressDialog(true);\n }\n\n // Build query string\n buildQueryString();\n\n // Load data from API\n RestAdapter adapter = RetrofitAdapter.getRestAdapter();\n ApiService service = adapter.create(ApiService.class);\n service.getCurrencyByPeriod(mFromDateString, mTillDateString, mCurrencyCode,\n new Callback<ArrayList<Currency>>() {\n @Override\n public void success(ArrayList<Currency> currencyList, Response response) {\n mMainCurrencyList = new ArrayList<>();\n mMainCurrencyList = currencyList;\n mSecondaryCurrencyList = Utilities.getDataForPeriod(mMainCurrencyList,\n mPressedBtnNum);\n if (mSecondaryCurrencyList != null && mSecondaryCurrencyList.size() > 0) {\n showResultView();\n } else {\n showErrorView();\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n showErrorView();\n Log.d(\"RetrofitError\", error.toString());\n }\n });\n }", "public void loadItems() {\n SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);\n payments = prefs.getStringSet(\"payments\", emptySet);\n paymentsList = new ArrayList<>(payments);\n\n }", "public List<Item> getAllItems(){\n return itemInstance.findItemEntities();\n }", "public void loadData() {\n JsonArrayRequest request = new JsonArrayRequest(\n \"http://www.efstratiou.info/projects/newsfeed/getList.php\",\n netListener, errorListener);\n //Submit request\n NewsApp.getInstance().getRequestQueue().add(request);\n }", "@Override\r\n\tpublic List<?> getByParams(JsonRequestParams params, Query query) {\n\t\treturn null;\r\n\t}", "public void loadById(T item, int id);", "private void queryItems() {\n tvLoad.setText(R.string.connecting);\n\n //sorts the ingredients in alphabetical order\n Query query = db.getReference(Collections.ingredients.name())\n .child(this.userId)\n .orderByChild(filterMode);\n // targets matching items if filter is entered\n if (!filterQuery.isEmpty())\n query = query.equalTo(filterQuery);\n\n // Query count of items to retrieve\n query.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull @NotNull DataSnapshot snapshot) {\n totalProgress = snapshot.getChildrenCount();\n\n //If there are no items, show no ingredients prompt\n if (totalProgress == 0) {\n clEmpty.setVisibility(View.VISIBLE);\n setEnabledButtons(true);\n clLoad.setVisibility(View.GONE);\n }\n else\n fetchItems();\n }\n @Override\n public void onCancelled(@NonNull @NotNull DatabaseError error) {\n Log.e(\"ILA Query failed\", \"Could not retrieve product count from database.\");\n }\n });\n }", "void beginOrScopeQueryAndPart();", "private void loadData() {\n List<Session> sessions = sessionDao.findAll().toBlocking().single();\n\n List<SearchResult> titleResults = Observable.from(sessions)\n .map(SearchResult::createTitleType)\n .toList().toBlocking().single();\n\n List<SearchResult> descriptionResults = Observable.from(sessions)\n .map(SearchResult::createDescriptionType)\n .toList().toBlocking().single();\n\n List<SearchResult> speakerResults = Observable.from(sessions)\n .map(SearchResult::createSpeakerType)\n .toList().toBlocking().single();\n\n titleResults.addAll(descriptionResults);\n titleResults.addAll(speakerResults);\n adapter.setAllList(titleResults);\n }", "public void initializeItems() {\n\t\titemTask = new ItemTask();\n\t\titemTask.execute((Date)null);\n }", "@Override\n public Loader<Cursor> onCreateLoader(int id, Bundle args) {\n Uri Itemname_ItemPrice_ActiveBids = ProjectContract.ItemNameEntry.buildQueryUri();\n\n return new CursorLoader(this,\n Itemname_ItemPrice_ActiveBids,\n MAIN_FORECAST_PROJECTION,\n null,\n null,\n null);\n }", "private void requestData() {\n RequestQueue queue = Volley.newRequestQueue(getActivity());\n Type type = new TypeToken<ArrayList<Item>>() {\n }.getType();\n queue.add(new LSEAsyncRequest(url, type, null, successListener(), errorListener()));\n queue.start();\n }", "@Override\n public void loadInitial(@NonNull LoadInitialParams<Long> params, @NonNull LoadInitialCallback<Tweet> callback) {\n //no index should be passed on initial load\n //call api to take data at specified index item position\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify Mon to Sun days are visible
void validateWeekdays(int noOfDays, int currentDate) { for(int index=1;index<=7;index++) { driver.findElement(By.xpath(propRead.propRead("weekday"+index))).isDisplayed(); } // Verify days in month for(int index=1;index<=noOfDays;index++) { if(index<currentDate) { if(index<10) Assert.assertEquals(driver.findElement(By.xpath("//div[@id='fare_"+(yearValue+monthValue+0+index)+"']//parent::div[@class='DayPicker-Day DayPicker-Day--disabled']")).getAttribute("aria-disabled"),"true"); else Assert.assertEquals(driver.findElement(By.xpath("//div[@id='fare_"+(yearValue+monthValue+index)+"']//parent::div[@class='DayPicker-Day DayPicker-Day--disabled']")).getAttribute("aria-disabled"),"true"); } else if(index==currentDate){ //Verify Present Date is selected and enabled Assert.assertTrue(driver.findElement(By.xpath("//div[@id='fare_"+(todayDate.format(format))+"']//parent::div[@class='DayPicker-Day DayPicker-Day--today DayPicker-Day--selected']")).isEnabled()); } else { if(index<10) Assert.assertEquals(driver.findElement(By.xpath("//div[@id='fare_"+(yearValue+monthValue+0+index)+"']//parent::div[@class='DayPicker-Day']")).getAttribute("aria-disabled"),"false"); else Assert.assertEquals(driver.findElement(By.xpath("//div[@id='fare_"+(yearValue+monthValue+index)+"']//parent::div[@class='DayPicker-Day']")).getAttribute("aria-disabled"),"false"); } } }
[ "protected void checkWeekDay(){\n Calendar c = Calendar.getInstance();\n int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);\n\n if (Calendar.SATURDAY == dayOfWeek || Calendar.SUNDAY == dayOfWeek) {\n status = \"Libur Kerja\";\n }\n }", "boolean isSetWednesday();", "@Test\n\tpublic void testDaysInAWeekTime() {\n\n\t\tList<LocalDateTime> dias = this.beautyDateService.datesInAWeek();\n\n\t\tAssert.assertTrue(!dias.stream().anyMatch(d -> d.getHour() == 12));\n\n\t}", "boolean isSetTuesday();", "public static boolean isDay() {\n\t\treturn timeOfDay < 300;\n\t}", "public boolean isSetSunday()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(SUNDAY$4) != 0;\n }\n }", "boolean hasS2CCurDay();", "boolean hasTimeweekday();", "public boolean isFullDay();", "public static Matcher<Date> isWednesday()\n {\n return new IsDayOfWeek<>( DayOfWeek.WEDNESDAY, DateMatchers:: dateToZoneDateTime );\n }", "public boolean isSetMonday()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(MONDAY$6) != 0;\n }\n }", "@Test\n\tpublic void Dayweek()\n\t{\n\t\t\n\t\tint result=DataStructure.day(11, 28, 2019);\n\t\tassertEquals(result, 4);\n\t}", "private static boolean isWeekDay(Calendar i) {\n\t\tif (i.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY\r\n\t\t\t\t|| i.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean isDateBased() {\n return ordinal() >= DAY_OF_WEEK.ordinal() && ordinal() <= ERA.ordinal();\n }", "@Test(timeout = 4000)\n public void test21() throws Throwable {\n JDayChooser jDayChooser0 = new JDayChooser();\n jDayChooser0.initDecorations();\n FocusEvent focusEvent0 = new FocusEvent(jDayChooser0, 2448);\n Object object0 = jDayChooser0.getTreeLock();\n focusEvent0.setSource(object0);\n jDayChooser0.focusGained(focusEvent0);\n jDayChooser0.updateUI();\n jDayChooser0.setWeekOfYearVisible(true);\n GVTAttributedCharacterIterator.TextAttribute gVTAttributedCharacterIterator_TextAttribute0 = GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL;\n ActionEvent actionEvent0 = new ActionEvent(focusEvent0, (int) gVTAttributedCharacterIterator_TextAttribute0.WRITING_MODE_TTB, \"day\", (int) gVTAttributedCharacterIterator_TextAttribute0.WRITING_MODE_RTL);\n jDayChooser0.setDayBordersVisible(true);\n jDayChooser0.setFocus();\n JDayChooser jDayChooser1 = new JDayChooser();\n SoftBevelBorder softBevelBorder0 = new SoftBevelBorder((int) gVTAttributedCharacterIterator_TextAttribute0.ARABIC_MEDIAL);\n jDayChooser1.setBorder(softBevelBorder0);\n jDayChooser0.setMaxDayCharacters((int) gVTAttributedCharacterIterator_TextAttribute0.ARABIC_INITIAL);\n jDayChooser0.drawDays();\n assertTrue(jDayChooser0.isWeekOfYearVisible());\n }", "public static boolean isWeekend(String d){\n if (d == \"Sat\" || d == \"Sun\" )\n return true;\n else return false;\n }", "@Override\n public boolean shouldDecorate(CalendarDay day) {\n return days.contains(new DateTime(day.getYear(), day.getMonth(), day.getDay(), 0, 0, 0, 0));\n }", "boolean hasDailyMaintenanceWindow();", "@Test(timeout = 4000)\n public void test22() throws Throwable {\n JDayChooser jDayChooser0 = new JDayChooser();\n jDayChooser0.setSundayForeground((Color) null);\n jDayChooser0.drawDays();\n assertEquals(14, jDayChooser0.getDay());\n }", "@Override\n public void checkForEvent() {\n //IF DAY HAS CHANGED\n\t\tcurrentDay = mainworld.getWorldTimer().isDay();\n if (currentDay != oldDay) {\n\t\t\toldDay = currentDay;\n\t\t\tif (oldDay.equals(1)) {\n\t\t\t\t//System.out.println(\"daytonight\");\n\t\t\t\tsuper.notifyHandler(states.NIGHTTODAY);\n\t\t\t} else {\n\t\t\t\t//System.out.println(\"nighttoday\");\n\t\t\t\tsuper.notifyHandler(states.DAYTONIGHT);\n\t\t\t}\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Util method to write an attribute with the ns prefix
private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { xmlWriter.writeAttribute(writerPrefix, namespace, attName, attValue); } else { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); xmlWriter.writeAttribute(prefix, namespace, attName, attValue); } }
[ "private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue,\r\n\t\t\tjavax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {\r\n\t\tif (namespace.equals(\"\")) {\r\n\t\t\txmlWriter.writeAttribute(attName, attValue);\r\n\t\t} else {\r\n\t\t\tregisterPrefix(xmlWriter, namespace);\r\n\t\t\txmlWriter.writeAttribute(namespace, attName, attValue);\r\n\t\t}\r\n\t}", "private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName,\n\t\t\t\tjava.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter)\n\t\t\t\tthrows javax.xml.stream.XMLStreamException {\n\t\t\tif (xmlWriter.getPrefix(namespace) == null) {\n\t\t\t\txmlWriter.writeNamespace(prefix, namespace);\n\t\t\t\txmlWriter.setPrefix(prefix, namespace);\n\n\t\t\t}\n\n\t\t\txmlWriter.writeAttribute(namespace, attName, attValue);\n\n\t\t}", "private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName,\n javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter)\n throws javax.xml.stream.XMLStreamException {\n java.lang.String attributeNamespace = qname.getNamespaceURI();\n java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);\n\n if (attributePrefix == null) {\n attributePrefix = registerPrefix(xmlWriter, attributeNamespace);\n }\n\n java.lang.String attributeValue;\n\n if (attributePrefix.trim().length() > 0) {\n attributeValue = attributePrefix + \":\" + qname.getLocalPart();\n } else {\n attributeValue = qname.getLocalPart();\n }\n\n if (namespace.equals(\"\")) {\n xmlWriter.writeAttribute(attName, attributeValue);\n } else {\n registerPrefix(xmlWriter, namespace);\n xmlWriter.writeAttribute(attributePrefix, namespace, attName, attributeValue);\n }\n }", "private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName,\r\n\t\t\tjavax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter)\r\n\t\t\t\t\tthrows javax.xml.stream.XMLStreamException {\r\n\r\n\t\tjava.lang.String attributeNamespace = qname.getNamespaceURI();\r\n\t\tjava.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);\r\n\t\tif (attributePrefix == null) {\r\n\t\t\tattributePrefix = registerPrefix(xmlWriter, attributeNamespace);\r\n\t\t}\r\n\t\tjava.lang.String attributeValue;\r\n\t\tif (attributePrefix.trim().length() > 0) {\r\n\t\t\tattributeValue = attributePrefix + \":\" + qname.getLocalPart();\r\n\t\t} else {\r\n\t\t\tattributeValue = qname.getLocalPart();\r\n\t\t}\r\n\r\n\t\tif (namespace.equals(\"\")) {\r\n\t\t\txmlWriter.writeAttribute(attName, attributeValue);\r\n\t\t} else {\r\n\t\t\tregisterPrefix(xmlWriter, namespace);\r\n\t\t\txmlWriter.writeAttribute(namespace, attName, attributeValue);\r\n\t\t}\r\n\t}", "protected String mk_xmlns_attr(String prefix, String ns)\n {\n if (prefix == null) {\n return \"xmlns:unknown=\\\"\" + ns + \"\\\"\";\n }\n if (prefix.equals(\"\")) {\n return \"xmlns=\\\"\" + ns + \"\\\"\";\n } else {\n return \"xmlns:\" + prefix + \"=\\\"\" + ns + \"\\\"\";\n }\n }", "public Attr setAttributeNodeNS(Attr newAttr) throws DOMException;", "public void setAttribute(String n, Object v) {\n \tif(WellKnownAttr.PREFIX_TO_NAMESPACE_MAP.equals(n)) {\n \t\tsetNamespaces((Map) v);\n \t} else if(v instanceof String || v == null) {\n \t\tsetAttribute(n, (String) v);\n \t} \n }", "void appendNSDeclaration(int prefixIndex, int namespaceIndex, boolean isID) {\n/* 2205 */ int namespaceForNamespaces = this.m_nsNames.stringToIndex(\"http://www.w3.org/2000/xmlns/\");\n/* */ \n/* */ \n/* 2208 */ int w0 = 0xD | this.m_nsNames.stringToIndex(\"http://www.w3.org/2000/xmlns/\") << 16;\n/* */ \n/* */ \n/* 2211 */ int w1 = this.currentParent;\n/* */ \n/* 2213 */ int w2 = 0;\n/* */ \n/* 2215 */ int w3 = namespaceIndex;\n/* */ \n/* 2217 */ int ourslot = appendNode(w0, w1, w2, w3);\n/* 2218 */ this.previousSibling = ourslot;\n/* 2219 */ this.previousSiblingWasParent = false;\n/* */ }", "@Override\n public void writeNamespace(final String prefix, final String namespaceURI) throws XMLStreamException {\n if (shouldWriteNamespace(namespaceURI)) {\n xsw.writeNamespace(prefix, namespaceURI);\n } else {\n urisByPrefix.put(prefix, namespaceURI);\n }\n }", "private static void writeName(String prefix,\n String uri,\n String localName, Writer out) throws IOException {\n if (prefix != null && !\"\".equals(prefix)) out.write(prefix + \":\");\n if (localName != null) out.write(localName);\n }", "void appendAttribute(int namespaceIndex, int localNameIndex, int prefixIndex, boolean isID, int m_char_current_start, int contentLength) {\n/* 2245 */ int w0 = 0x2 | namespaceIndex << 16;\n/* */ \n/* */ \n/* 2248 */ int w1 = this.currentParent;\n/* */ \n/* 2250 */ int w2 = 0;\n/* */ \n/* 2252 */ int w3 = localNameIndex | prefixIndex << 16;\n/* 2253 */ System.out.println(\"set w3=\" + w3 + \" \" + (w3 >> 16) + \"/\" + (w3 & 0xFFFF));\n/* */ \n/* 2255 */ int ourslot = appendNode(w0, w1, w2, w3);\n/* 2256 */ this.previousSibling = ourslot;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2261 */ w0 = 3;\n/* */ \n/* 2263 */ w1 = ourslot;\n/* */ \n/* 2265 */ w2 = m_char_current_start;\n/* */ \n/* 2267 */ w3 = contentLength;\n/* 2268 */ appendNode(w0, w1, w2, w3);\n/* */ \n/* */ \n/* 2271 */ this.previousSiblingWasParent = true;\n/* */ }", "private static void addNamespace(XMLStreamWriter writer, String prefix, String namespaceUri)\n throws XMLStreamException {\n if ((prefix == null) || (prefix.trim().length() == 0)) {\n writer.setDefaultNamespace(namespaceUri);\n writer.writeDefaultNamespace(namespaceUri);\n } else {\n writer.setPrefix(prefix, namespaceUri);\n writer.writeNamespace(prefix, namespaceUri);\n }\n }", "protected /*override*/ void OnWriteNamespace (NamespaceDeclaration nd)\r\n\t{\n\t}", "XmlAttribute createXmlAttribute();", "public Attr createAttributeNS(String namespaceURI,\n String qualifiedName)\n throws DOMException;", "public OdfNamespace setNamespace(String prefix, String uri) {\r\n\t\t//collision detection, when a new prefix/URI pair exists\r\n\t\tOdfNamespace newNamespace = null;\r\n\t\t//Scenario a) the URI already registered, use existing prefix\r\n\t\t// but save all others for the getPrefixes function. There might be still some\r\n\t\t// in attribute values using prefixes, that were not exchanged.\r\n\t\tString existingPrefix = mPrefixByUri.get(uri);\r\n\t\tif (existingPrefix != null) {\r\n\t\t\t//Use the existing prefix of the used URL, neglect the given\r\n\t\t\tnewNamespace = OdfNamespace.newNamespace(existingPrefix, uri);\r\n\r\n\t\t\t//Add the new prefix to the duplicate prefix map for getPrefixes(String uri)\r\n\t\t\tSet<String> prefixes = mDuplicatePrefixesByUri.get(uri);\r\n\t\t\tif (prefixes == null) {\r\n\t\t\t\tprefixes = new HashSet<String>();\r\n\t\t\t\tmDuplicatePrefixesByUri.put(uri, prefixes);\r\n\t\t\t}\r\n\t\t\tprefixes.add(prefix);\r\n\t\t} else {\r\n\t\t\t//Scenario b) the prefix already exists and the URI does not exist\r\n\t\t\tString existingURI = mUriByPrefix.get(prefix);\r\n\t\t\tif (existingURI != null && !existingURI.equals(uri)) {\r\n\t\t\t\t//Change the prefix appending \"__\" plus counter.\r\n\t\t\t\tint i = 1;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tint suffixStart = prefix.lastIndexOf(\"__\");\r\n\t\t\t\t\tif (suffixStart != -1) {\r\n\t\t\t\t\t\tprefix = prefix.substring(0, suffixStart);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//users have to take care for their attribute values using namespace prefixes.\r\n\t\t\t\t\tprefix = prefix + \"__\" + i;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\texistingURI = mUriByPrefix.get(prefix);\r\n\t\t\t\t} while (existingURI != null && !existingURI.equals(uri));\r\n\t\t\t}\r\n\t\t\tnewNamespace = OdfNamespace.newNamespace(prefix, uri);\r\n\t\t\tmPrefixByUri.put(uri, prefix);\r\n\t\t\tmUriByPrefix.put(prefix, uri);\r\n\t\t}\r\n\t\t// if the file Dom is already associated to parsed XML add the new namespace to the root element\r\n\t\tElement root = getRootElement();\r\n\t\tif (root != null) {\r\n\t\t\troot.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:\" + prefix, uri);\r\n\t\t}\r\n\t\treturn newNamespace;\r\n\t}", "public String getSAMLAttributeNamespace() {\n return attributeNS;\n }", "public void setXMLspace(String space) {\n/* 146 */ setAttributeNS(\"http://www.w3.org/XML/1998/namespace\", \"xml:space\", space);\n/* */ }", "public abstract Attribute createAttribute(String localName, String value);", "void addAttribute(String attributeName, String attributeValue);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mandatory empty constructor for the fragment manager to instantiate the fragment (e.g. upon screen orientation changes).
public ShowMyParentFragment() { }
[ "public ActivityFragment() {}", "public HrmFragment() {\n super();\n }", "public _4_1_Fragment () {\n\t\t\n\t}", "public ExhibitorFragment() {\n }", "public NewsFragment() {\n }", "public NewsListFragment() {\n }", "public MyTodoListFragment() {\n }", "public InFragment() {\n // Required empty public constructor\n }", "public FragmentB() {\n // Required empty public constructor\n }", "public FriendFragment() {\n }", "public HikeFragment() {\n }", "public AlumnoFragment() {\n }", "public SermonsFragment() {\n }", "public BaseActivityFragment() {\n\t}", "public FriendsListsFragment() {\n }", "public DealerFragment() {\n }", "public BlankFragment() {\n\t}", "public WeatherFragment () {\n }", "public AppDetailFragment() {\n\t\t\n\t}", "public MainInternalFragment() {\n // Required empty public constructor\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an image file name
File createImageFile() throws IOException { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.ENGLISH).format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); File image = File.createTempFile( imageFileName, /* prefix */ ".jpg", /* suffix */ storageDir /* directory */ ); // Save a file: path for use with ACTION_VIEW intents mTakenPhotoPath = image.getAbsolutePath(); mPropertyActivityViewModel.getTakenPhotoPath().setValue(image.getAbsolutePath()); Log.d(TAG, "Photo Path :" + mTakenPhotoPath); return image; }
[ "private static String createFileName() {\n String filename;\n Date date = new Date(System.currentTimeMillis());\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat dateFormat = new SimpleDateFormat(\"'IMG'_yyyyMMdd_HHmmss\");\n filename = dateFormat.format(date) + \".jpg\";\n return filename;\n }", "private String generateImageName() {\n Date date = new Date();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n return \"Images-\" + simpleDateFormat.format(date) + \".jpg\";\n }", "public String createName() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy_MM_dd_HH_mm_ss\");\n Date now = new Date();\n String filename = formatter.format(now); //+\".JPEG\";\n return filename;\n }", "private String makeImageName() {\n StringBuffer name = new StringBuffer(\"t\");\n name.append(EUtils.makePaddedInt(iImageTime + iTimeInc));\n name.append(\"-p\");\n String p = EUtils.makePaddedInt(iImagePlane + iPlaneInc, 2);\n name.append(p);\n switch(iUseZip) {\n case 0:\n case 1:\n name.append(\".tif\");\n break;\n default:\n name.append(\".zip\");\n }\n return(name.toString());\n }", "public static String createImageFileName() {\n String fileName = null;\n // Create a file name based on the current date.\n Calendar cal = Calendar.getInstance();\n fileName = ViewUtil.safeFormatCalendar(LONG_YEAR_MONTH_DAY_24HOUR_TIME_MINUTE_SECOND, cal) + \".jpg\";\n\n return fileName;\n }", "int createImage(String filename);", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n\n String imageFileName = \"RIP_JPEG_\" + timeStamp + \".jpg\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n File image = new File(storageDir,imageFileName);\n\n this.file_name = image.getName();\n return image;\n }", "public static File createImageFile(String name) {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n name = TextUtils.isEmpty(name) ? timeStamp : \"\";\n File file = new File(SpUtil.getImagePath());\n try {\n file.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return file;\n }", "private File createImageFile() throws IOException {\n // Create an image file name that is collision-resistant\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmm\").format(new Date());\n String imageFileName = \"Meal_\" + timeStamp + \"_\";\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n\n return File.createTempFile(\n imageFileName, //prefix\n \".jpg\", //suffix\n storageDir //directory\n );\n }", "private Uri createImageFile() throws IOException {\n\t\tString timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n\t\tfilenameOnly = JPEG_FILE_PREFIX + utils.getIMEI() +\"_\"+ timeStamp + JPEG_FILE_SUFFIX;\n\t\tfullPathFilename = ImageUtils.IMAGE_FILEPATH+filenameOnly;\n\t\tLog.d(\"Full FilePath\", fullPathFilename);\t\t\n\t\tUri uri = Uri.parse(fullPathFilename);\n\t\treturn uri;\n\t}", "public static File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.US).format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \".JPEG\";\n File storageDir = new File(Environment.getExternalStorageDirectory()+\"/hunter/ocr\");\n if (!storageDir.exists())\n storageDir.mkdirs();\n return new File(storageDir, imageFileName);\n /*return File.createTempFile(\n imageFileName, *//* prefix *//*\n \"\", *//* suffix *//*\n storageDir *//* directory *//*\n );*/\n }", "private File createImageFile(String name,boolean append) throws IOException {\n int suflix = 1;\n File image;\n File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);\n do{\n image = new File(storageDir.getAbsolutePath() + \"/\" + name + \"_\" + suflix + \".jpg\");\n suflix++;\n }while(image.exists());\n\n //image = new File(filename);\n\n // Save a file: path for use with ACTION_VIEW intents\n return image;\n }", "private static File createImageFile() throws IOException {\n @SuppressLint(\"SimpleDateFormat\") String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"img_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);\n return File.createTempFile(imageFileName, \".jpg\", storageDir);\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DCIM);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\n File storageDir = Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES);\n File image = File.createTempFile(\n imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String imageFileName = personName + \"-\" + timeStamp;\n File image = File.createTempFile(\n imageFileName,\n \".jpg\",\n storageDir\n );\n String mCurrentPhotoPath = image.getAbsolutePath();\n System.out.println(\"path: \" + mCurrentPhotoPath);\n return image;\n }", "public static String getUniqueImageName() {\n Random r = new Random();\n int num = r.nextInt(10000 - 15) + 15;\n String fileName = \"img_\" + num + \".png\";\n return fileName;\n }", "private File createImageFile() throws IOException {\n String timeStamp = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss_SSS\").format(new Date());\n String imageFileName = timeStamp;\n File storageDir = App.getPhotoCache();\n File image = File.createTempFile(imageFileName, /* prefix */\n \".jpg\", /* suffix */\n storageDir /* directory */\n );\n return image;\n }", "private File createImageFile(){\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\r\n String imageFileName = \"JPEG_\" + timeStamp + \"_\";\r\n String path = Environment.getExternalStorageDirectory()+\"/Icon\";\r\n File storageDir = new File(path);\r\n if (!storageDir.exists()){storageDir.mkdirs();}\r\n File image = new File(storageDir, imageFileName+\".jpg\");\r\n currentPhotoPath = image.getAbsolutePath();\r\n return image;\r\n }", "public String createImage(String fileName, String type, Object text_or_bytes, int quality);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; }
[ "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflator = getMenuInflater();\n\t\tinflator.inflate(R.menu.activity_action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n public boolean onCreateOptionsMenu( android.view.Menu menu)\r\n {\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_activity_actions, menu);\r\n return super.onCreateOptionsMenu(menu);\r\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tmenu.clear();\n\t\tinflater.inflate(R.menu.main_action, menu);\n\t\t// ((IdtActivity)\n\t\t// getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.abc_ic_ab_back_mtrl_am_alpha);\n\t\t// repl(Fra, args, isFinish);\n\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater(); // Get menu inflater from context\n \tinflater.inflate(R.menu.menu, menu); // use inflater to inflate menu from resource xml\n \treturn true; // \n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.base_action_bar, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater=getMenuInflater();\n\t\tinflater.inflate(R.menu.menuitem, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(android.view.Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.inventory_menu, menu);\n iMenu = menu;\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action_bar_item, menu);\n\t\tadditem = menu.findItem(R.id.new_show);\n\t\tacceptitem = menu.findItem(R.id.accept_show);\n\t\tedititem = menu.findItem(R.id.edit_show);\n\t\tdeleteitem = menu.findItem(R.id.delete_show);\n\t\tif (menu != null) {\n\t\t\tsetActionBar();// function to set menu item display\n\t\t}\n\t\treturn super.onCreateOptionsMenu(menu);\n\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.cmdlist_activity_action, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.info_actions, menu);\r\n return super.onCreateOptionsMenu(menu);\r\n }", "private void inflateAdditionalMenu() {\n\t\tinflateMenu = true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\tgetMenuInflater().inflate(org.ideas4j.DoSomething.R.menu.menubar, menu);\n\treturn true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n this.menu = menu;\n\n MenuItem action_add = menu.findItem(R.id.action_add);\n action_add.setVisible(false);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action_bar, menu);\r\n\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.item_info, menu);\n \t\treturn true;\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The interface show that administrator add user error
public void addUserfail(){ JFmain.getContentPane().remove(JPmanageuser); JFmain.repaint(); JPadduserfail = new JPanel(new GridLayout(2,1)); JLabel JLadduserfail = new JLabel("Wrong!"); JPanel JPadduserfailback = new JPanel(); JPadduserfail.add(JLadduserfail); JPadduserfail.add(JPadduserfailback); JButton JBadduserfailback = new JButton("Back"); JBadduserfailback.addActionListener(new adduserfailbackListen()); JPadduserfailback.add(JBadduserfailback); JFmain.getContentPane().add(JPadduserfail); JFmain.setVisible(true); }
[ "public int addAdmin() {\n\n\t\tSystem.out.println(\"***********Add New Admin***********\");\n\t\t// take user information as input from user\n\t\tSystem.out.print(\"Enter the Name: \");\n\t\tname = input.nextLine();\n\t\tSystem.out.print(\"Enter the username: \");\n\t\tuser_name = input.nextLine();\n\t\tSystem.out.print(\"Enter the password: \");\n\t\tpassword = input.nextLine();\n\t\tSystem.out.print(\"Enter the address: \");\n\t\taddress = input.nextLine();\n\n\t\tinfo = name + \",\" + user_name + \",\" + password + \",\" + address;\n\t\ttry {\n\t\t\titems = admincommand.sendACommand(\"addadmin\", info);\n\n\t\t\t// if all the user details are not filled properly\n\t\t\tif (items.get(0).getMessage().equals(\"-2\"))\n\t\t\t\tSystem.out.println(\"Please enter all the fields properly!!\");\n\n\t\t\t// if new admin can not be added as username is already present\n\t\t\telse if (items.get(0).getMessage().equals(\"-1\"))\n\t\t\t\tSystem.out.println(\"Username already present. Please use another username!!\");\n\n\t\t\t// if new admin is added in user list\n\t\t\telse if (items.get(0).getMessage().equals(\"1\")) {\n\t\t\t\tSystem.out.println(\"Admin: \" + name + \" is registered/added successfully!!\");\n\t\t\t\tSystem.out.println(\"Please share the credentials with admin to login.\");\n\t\t\t}\n\n\t\t\t// if new admin can not be added\n\t\t\telse if (items.get(0).getMessage().equals(\"0\"))\n\t\t\t\tSystem.out.println(\"New Admin can not be added. Please try again!!\");\n\n\t\t} catch (AuthorizationException ex) {\n\t\t\t// catch user define exception in case of user role is not\n\t\t\t// authorized to access this operation\n\t\t\tSystem.out.println(ex.getMessage());\n\t\t}\n\n\t\treturn 0;\n\t}", "public String registerAdmin() {\r\n if (!usrSrv.userExist(username)) {\r\n usrSrv.registerAdminUser(username, userpassword, name, surname, currency);\r\n } else {\r\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"User already exists\"));\r\n return \"users\";\r\n }\r\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"User registered\"));\r\n return \"users\";\r\n }", "public void displayContactAddError() {\n this.displayError(\">>> Unable to add this user to contacts.\");\n }", "public void addUserPermission(ActionEvent event) {\n\t\tif(choosePermissionCBX2.getSelectionModel().getSelectedItem()!=null && itDepartmentManagerTable3.getSelectionModel().getSelectedItem()!=null)\n\t\t\tmainClient.handleMessageFromClientUI(\"66#\"+ itDepartmentManagerTable3.getSelectionModel().getSelectedItem().getEngineerID()+\"#\"+choosePermissionCBX2.getSelectionModel().getSelectedItem());\n\t\telse\n\t\t\tmainClient.getloginWindowController().okMsgCaller(\"Please Choose User first and then choose permission to add.\");\n\t}", "public String buttonAdd_action() {\n String username = (getTextFieldUsername().getText() != null ? getTextFieldUsername().getText().toString() : \"\");\n String password = (getPasswordFieldPassword().getText() != null ? getPasswordFieldPassword().getText().toString() .toString() : \"\");\n String accountType = getDropDownAccountType().getSelected().toString();\n getApplicationBean1().getDataSourceFacade().getUserDSL().addUser(username, password, accountType);\n return null;\n }", "void registerationFailed(){\n \tinformationAlert.setTitle(\"Sign up \");\n \tinformationAlert.setHeaderText(null);\n \tinformationAlert.setContentText(\"Username and Email must ne unique\");\n \tinformationAlert.showAndWait();\n }", "@Override\n\tpublic void addUser() {\n\t\tSystem.out.println(\"添加用户\");\n\t}", "public void addUser (ActionEvent e) throws IOException {\n\t\t// Open a second window that prompts the user for new user's credentials\n\t\tStageManager stageManager = new StageManager();\n\t\tstageManager.getStage(\"Add_User\").showAndWait();\n\t\t\n\t\t// After adding a user, re-display to update view\n\t\tdisplayUsers();\n\t}", "public void addUser(ActionEvent event)\r\n\t{\r\n\t\tResultSet result = this.getUsersPageCtrl().getPrincipalUiCtrl().getDatabase().executionQuery(String.format(\"call checkUser(\\\"%s\\\")\", user_Tf.getText()));\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(!result.next())\r\n\t\t\t{\r\n\t\t\t\tif(this.checkTexfield())\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.getUsersPageCtrl().getPrincipalUiCtrl().getDatabase().executionQuery(\r\n\t\t\t\t\t\t\tString.format(\"call createUtilisateur(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",\\\"%s\\\")\",\r\n\t\t\t\t\t\t\trole_Cb.getSelectionModel().getSelectedItem(),\r\n\t\t\t\t\t\t\tsurname_Tf.getText(),\r\n\t\t\t\t\t\t\tname_Tf.getText(),\r\n\t\t\t\t\t\t\temail_Tf.getText(),\r\n\t\t\t\t\t\t\tadresse_Tf.getText(),\r\n\t\t\t\t\t\t\ttel_Tf.getText(),\r\n\t\t\t\t\t\t\tuser_Tf.getText(),\r\n\t\t\t\t\t\t\tpassword_Tf.getText()\r\n\t\t\t\t\t\t\t));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getUsersPageCtrl().initTableView();\r\n\t\t\t\t\t((Node)event.getSource()).getScene().getWindow().hide();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\terror_Lb.setText(\"L'utilisateur existe déjà veuillez changer de user merci.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tLoggerWrapper.getInstance().getMylogger().log(Level.SEVERE,e.toString(),e);\r\n\t\t}\r\n\t}", "public void addAdmin() throws IOException {\r\n System.out.println(\"Enter username for admin: \");\r\n String username = bufferedReader.readLine();\r\n\r\n if (users.isUser(username, users.getAdmins())) {\r\n System.out.println(\"Username is already taken\");\r\n return;\r\n }\r\n\r\n System.out.println(\"Now set a password: \");\r\n String password = bufferedReader.readLine();\r\n\r\n Admin admin = new Admin(username, password);\r\n users.add(admin);\r\n System.out.println(\"Admin created\");\r\n }", "private void createAdminUser() {\n\t\tUser adminUser = userService.getSystemAdminUser().getDataObject();\r\n\t\t\r\n\t\tif(adminUser != null) {\r\n\t\t\tlogger.info(\"System Admin user already exists\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlogger.info(\"System Admin user does not exist, creating....\");\r\n\t\t\tadminUser = createAdminUserObject();\r\n\t\t\tServiceResponse<Void> response = userService.addUser(adminUser);\r\n\t\t\t\r\n\t\t\tif(response.getAckCode() != AckCodeType.SUCCESS) {\r\n\t\t\t\tlogger.error(\"System Admin user does not exist but unable to create one\");\r\n\t\t\t\tfor(String msg : response.getMessages()) {\r\n\t\t\t\t\tlogger.error(msg);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tlogger.info(\"System Admin user created successfully. Creating Announcements forum and Welcome discussion\");\r\n\t\t\t\tForum announcementsForum = createAnouncementsForum(adminUser);\r\n\t\t\t\tDiscussion discussion = createWelcomeDiscussion(announcementsForum, adminUser);\r\n\t\t\t\t\r\n\t\t\t\tcreateBulletinTag(discussion);\r\n\t\t\t\t\r\n\t\t\t\t// create first chat room\r\n\t\t\t\tcreateFirstChatRoom();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic String perform() {\n\t\tif(ClientState.instance().getName().equals(StringConstants.ADMIN_USER)){\n\t\t\tif(this.username.equals(StringConstants.ADMIN_USER)){\n\t\t\t\treturn StringConstants.CANT_DUPLICATE_ADMIN;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tString newUser = BulletinBoardIO.addUser(username, password);\n\t\t\t\tthis.broadcast = String.format(StringConstants.NEW_USER_ADDED, username);\n\t\t\t\treturn newUser;\n\t\t\t} catch (Exception e) {\n\t\t\t\treturn e.getMessage();\n\t\t\t}\n\t\t}else{\n\t\t\treturn StringConstants.ONLY_ADMIN_CAN_CREATE_USERS;\n\t\t}\n\t}", "private void ManageUser()\r\n\t{\n\t\t\tint userSelection, userCounter = 0;\r\n\t\t\tArrayList<User> userList = login.getUserCatalog();\r\n\t\t\tfor(User item: userList)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"[\"+userCounter+\"] :\" + item.getName() + \" \" + item.getPassword());\r\n\t\t\t\tuserCounter++;\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"Please enter the user you would like to manage.\");\r\n\t\t\tuserSelection = input.readInt();\r\n\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"You selected user: \" + userList.get(userSelection).getName() + \" \" \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t + userList.get(userSelection).getPassword());\t\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"Please enter the new Name. Please leave empty if stays the same.\");\r\n\t\t\tString newName = input.readString();\r\n\t\t\tSystem.out.println(\"Please enter the new Surname. Please leave empty if stays the same.\");\r\n\t\t\tString newSurname = input.readString();\r\n\t\t\tSystem.out.println(\"Please enter the new User Name. Please leave empty if stays the same.\");\r\n\t\t\tString newUsername = input.readString();\r\n\t\t\tSystem.out.println(\"Please enter the new Password. Please leave empty if stays the same.\");\r\n\t\t\tString newPassword = input.readString();\r\n\t\t\tSystem.out.println(\"is the User and admin? Y/N\");\r\n\t\t\tchar isAdmin = input.readChar();\r\n\t\t\tboolean newIsAdministrator = false;\r\n\t\t\tif(isAdmin=='Y')\r\n\t\t\t{\r\n\t\t\t\tnewIsAdministrator = true;\r\n\t\t\t}\r\n\t\t\tif(!newName.isEmpty())\r\n\t\t\t{\r\n\t\t\t\tuserList.get(userSelection).setName(newName);\r\n\t\t\t}\r\n\t\t\tif(!newSurname.isEmpty())\r\n\t\t\t{\r\n\t\t\t\tuserList.get(userSelection).setSurname(newSurname);\r\n\t\t\t}\r\n\t\t\tif(!newUsername.isEmpty())\r\n\t\t\t{\r\n\t\t\t\tuserList.get(userSelection).setUsername(newUsername);\r\n\t\t\t}\r\n\t\t\tif(!newPassword.isEmpty())\r\n\t\t\t{\r\n\t\t\t\tuserList.get(userSelection).setPassword(newPassword);\r\n\t\t\t}\r\n\t\t\tuserList.get(userSelection).setAdmin(newIsAdministrator);\r\n\t\t\tlogin.modifyUser(userList);\r\n\t\t\tSystem.out.println(\"You've updated the user details successfully\");\r\n\t\t\tprintScreens();\r\n\r\n\t}", "private void addUser() {\n\t\tpanel.setVisible(false);\n\t\tpanelAddUser = new JPanel();\n\t\tpanelAddUser.setBackground(Color.pink);\n\t\tuname = new JLabel(\"Enter a Username: \");\n\t\tpword = new JLabel(\"Enter a Password: \");\n\t\tcpword = new JLabel(\"Confirm Password: \");\n\t\tbtnCancel = new JButton(\"Cancel\");\n\t\tbtnAdd = new JButton(\"Create Account\");\n unameFillin = new JTextField(20); \n pwordFillin = new JPasswordField(20);\n pwordFillinConfirm = new JPasswordField(20);\n\t\tpanelAddUser.add(uname);\n\t\tpanelAddUser.add(unameFillin);\n\t\tpanelAddUser.add(pword);\n\t\tpanelAddUser.add(pwordFillin);\n\t\tpanelAddUser.add(cpword);\n\t\tpanelAddUser.add(pwordFillinConfirm);\n\t\tpanelAddUser.add(btnAdd);\n\t\tpanelAddUser.add(btnCancel);\n signin.getContentPane().add(BorderLayout.CENTER, panelAddUser);\n\t\tpanelAddUser.setVisible(true);\n\t\t\n\t btnCancel.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\t//go back to previous window\n\t\t\t\tpanelAddUser.setVisible(false);\n\t\t\t\tpanel.setVisible(true);\n\t\t\t}\n\t\t});\n\t \n\t btnAdd.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\taddUserIntoDB();\n\t\t\t}\n\t\t});\n\t}", "public String execute(){\n\t\t//TODO:: Form Validation\n\t\tlogger.info(\"INFO:: Entering the add user execute method\");\n\t\tString returnMessage;\n\t\tFacesMessage fm;\n\t\t\n\t\t// get faces context\n\t\tFacesContext currentInstance = FacesContext.getCurrentInstance();\n\t\tif(user != null && user.getEmail().length() > 3 && user.getPassword().length() > 7){\n\t\t//:: implement add method from StockListService\n\t\ttry{\n\t\t\tuserService.add(user);\n\t\t\tlogger.info(\"INFO:: User saved successfully\");\n\t\t\treturnMessage = \"registrationsuccess\";\n\t\t\t// message we want to show\n\t\t\tfm = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Saved\", \"User Saved\");\n\t\t\t// display the message\n\t\t\tcurrentInstance.addMessage(null, fm);\n\t\t} \n\t\tcatch(Exception e) {\n\t\t\treturnMessage = \"fail\";\n\t\t\tlogger.error(\"ERROR:: User did not save successfully.\");\n\t\t\tlogger.error(e);\n\t\t\tfm = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Whoops!\", \"Something went wrong. Please try again later.\");\n\t\t\tcurrentInstance.addMessage(null, fm);\n\t\t}\n\t\t} else {\n\t\t\tfm = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Uh Oh\", \"Looks like you missed something\");\n\t\t\tcurrentInstance.addMessage(null, fm);\n\t\t\treturnMessage = \"nullentry\";\n\t\t}\n\t\t//TODO:: navigate to home page on success/handle errors on fail\n\t\treturn returnMessage;\n\t}", "@RequestMapping(value = \"/add\", \n\t\t\tmethod = RequestMethod.POST)\n\t//@ExceptionHandler({ CustomException.class })\n\tpublic String addUser(\n\t\t\t@ModelAttribute(\"register1\") \n\t\t\t@Valid User u, \n\t\t\tModel model,Map model1) {\n\t\t\n\t\t\t\tthis.iUserService.addUser(u);\n\t\t\t\t// new user, add it\n\t\t\t\tmodel1.put(\"Alert\",\"Thank you for registration\");\n\t\t\t\n\t\t\t\treturn \"Studentdashboard\";\n\t\t\t\t// existing user, call update\n\t\t\t\t//this.userService.updateUser(u);\n}", "private void userAdd(final String user){\n\t\tAlertDialog.Builder message = new AlertDialog.Builder(this);\n\t\tmessage.setTitle(\"Attenzione!\");\n\t\tmessage.setMessage(\"Sta per essere creato il nuovo utente '\" + user + \"'. Continuare?\");\n\t\tmessage.setPositiveButton(\"Sì\", new DialogInterface.OnClickListener() {\n\t\t\t\tpublic void onClick(DialogInterface dlg, int sumthin) {\n\t\t\t\t\t//Inserisco l'utente\n\t\t\t\t\tContentValues values = new ContentValues(1);\n\t\t\t\t\tvalues.put(POIProvider.Users.NAME, user);\n\t\t\t\t\tgetContentResolver().insert(POIProvider.Users.CONTENT_URI, values);\n\t\t\t\t\tlogin(user);\n\t\t\t\t}\n\t\t\t});\n\t\tmessage.setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n\t\t\t\tpublic void onClick(DialogInterface dlg, int sumthin) {\n\t\t\t\t\t//Non fa nulla - Ritorna alla schermata di inserimento utente\n\t\t\t\t}\n\t\t\t});\n\t\tmessage.show();\n\t}", "@RequestMapping(value = \"/admin/InternalAccountManagement/add.html\", method = RequestMethod.POST)\n\tprivate ModelAndView add_user_post(ModelAndView model, InternalUser2 form, BindingResult br){\n\t\tString message = isValid_add(form, br);\n\t\tif(message.equalsIgnoreCase(\"\")){\n\t\t\tinternalUserDOA.saveOrUpdate2(form);\n//\t\t\tSystem.out.println(form.getInUserId());\n\t\t\tmessage += \"User information has been added\";\n\t\t}\n\t\tmodel.addObject(\"form\", form);\n\t\tmodel.addObject(\"message\", message);\n\t model.setViewName(\"add_in_user\");\n//\t System.out.println(\"added.\");\n\t\treturn model;\n\t}", "@SuppressWarnings(\"unused\")\n @RequestMapping(\"/addAdmin\")\n private User addAdmin() {\n User user = new User();\n user\n .setId(\"incubatorboss@gmail.com\");\n user.setEmailId(\"incubatorboss@gmail.com\");\n user.setRoleName(User.ROLE_ADMIN);\n user.setDisplayName(\"Admin\");\n user.setCreatedOn(new Date());\n user.setStatus(User.STATUS_ACTIVE);\n return userService.saveUser(user);\n }", "int addAdmin(Admin adm);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public void afterTextChanged(Editable s) { String enteredQty = edt_count.getText().toString().trim(); int qty = Integer.parseInt(enteredQty.isEmpty() ? "0" : enteredQty); if (qty <= 0) { buy_cart.setEnabled(false); tv_total.setText("0.00"); txt_availableScheme.setText(""); } else { buy_cart.setEnabled(true); int mMinPackOfQty = minPackOfQty[0]; Log.e("Modulo Rem", "-->" + qty % mMinPackOfQty); /*if (qty >= mMinPackOfQty && C.modOf(qty,mMinPackOfQty) == 0) { String productpricce = tv_pop_sellingprice.getTag().toString(); amount1 = Double.parseDouble(s.toString()); amount1 = Double.parseDouble(productpricce) * amount1; //float finalValue = (float) (Math.round(amount1 * 100) / 100); double w = round(amount1, 2); String str = String.format("%.2f", w); tv_total.setText(str); } else { tv_total.setText(""); }*/ String productpricce = tv_pop_sellingprice.getTag().toString(); amount1 = Double.parseDouble(s.toString()); amount1 = Double.parseDouble(productpricce) * amount1; //float finalValue = (float) (Math.round(amount1 * 100) / 100); double w = round(amount1, 2); String str = String.format("%.2f", w); tv_total.setText(str); int schemeSelectedPosition = -1; ArrayList<Bean_schemeData> selectedProductSchemes = new ArrayList<Bean_schemeData>(); for (int i = 0; i < bean_Schme_data.size(); i++) { if (bean_Schme_data.get(i).getSchme_prod_id().equals(selectedProductID[0])) { selectedProductSchemes.add(bean_Schme_data.get(i)); } } for (int i = 0; i < selectedProductSchemes.size(); i++) { int schemeQty = Integer.parseInt(selectedProductSchemes.get(i).getSchme_qty()); //Log.e("Scheme minQty","Qty : "+schemeQty+", ProductID - "+bean_product1.get(0).getPro_id()); Log.e("Scheme Pro ID", selectedProductSchemes.get(i).getSchme_prod_id() + " - " + selectedProductID[0]); if (selectedProductSchemes.get(i).getSchme_prod_id().equals(selectedProductID[0])) { if (qty < schemeQty) { schemeSelectedPosition = i; break; } else { schemeSelectedPosition = selectedProductSchemes.size() - 1; } } } if (selectedProductSchemes.size() > 0 && schemeSelectedPosition >= 0) { txt_availableScheme.setText(selectedProductSchemes.get(schemeSelectedPosition).getSchme_name()); } else { txt_availableScheme.setText(""); } } }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }