query
stringlengths 8
1.54M
| document
stringlengths 9
312k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
save data to dest table TODO ignore columns cl_des.doesColumnNameExist(columnData_des, "DateCreated") | private void save() {
// does this data exist in dest table, (can have multile keys)
long count = doIdentsExistAlready(database_des);
String fields = getFields();
if (fields == null || fields.trim().length() == 0) {
//log.info("Transfer.save(): skipping save(). " +
// "probably b/c we only have a primary key and/or one to many is the only thing being used. " +
// "Its possible your only moving one to many records. Ignore this if only moving one to many.");
return;
}
String sql = "";
if (count > 0) { // update
String where = getSql_WhereQueryIfDataExists();
sql = "UPDATE " + tableRight + " SET " + fields + " WHERE " + where;
} else { // insert
sql = "INSERT INTO " + tableRight + " SET " + fields;
}
testColumnValueSizes(columnData_des);
log.info(index + " Transfer.save(): " + sql);
ql_des.update(database_des, sql, false);
deleteSourceRecord();
index--;
} | [
"private void createDestTable() {\n String primaryKeyName = cl_src.getPrimaryKey_Name(columnData_src);\n tl_des.createTable(database_des, tableRight, primaryKeyName);\n }",
"public function save()\n {\n global $Database;\n \n $query = new QueryBuilder();\n $columns = [];\n \n foreach($this->_columns as $key => $val) {\n if((!is_object($key) && !is_array($key)) &&\n !Functions::With(\"_\", $key)) {\n $columns[$key] = $val;\n }\n }\n \n if($this->_isInsert) {\n $query->insert(static::getTable())\n ->values($columns);\n } else {\n $query->update(static::getTable())\n ->set($columns)\n ->where([\n static::$_primaryKey => $this->_columns[static::$_primaryKey]\n ]);\n }\n \n $Database->execute($query);\n }",
"private void copyData(CopyTable table) throws Exception\n\t{\n\t\tLOG.info(\"Starting with copy of data from '\" + table.getDescription() + \"' to disk...\");\n\t\t\n\t\t// select data from source database\n\t\tStatement selectStmt =\n\t\t\tCopyToolConnectionManager.getInstance().getSourceConnection(table.getSource()).createStatement();\n\n\t\t// get number of rows in table\n\t\tResultSet resultSet =\n\t\t\tselectStmt.executeQuery(table.generateCountQuery());\n\t\tresultSet.next();\n\t\t\n\t\tlong rowCount = resultSet.getLong(1);\n\t\tLOG.info(\"Found \" + rowCount + \" rows in '\" + table.getDescription() + \"'\");\n\t\t\n\t\tresultSet.close();\n\t\t\n\t\t// get all data from table\n\t\tresultSet = selectStmt.executeQuery(table.generateSelectQuery());\n\n\t\t// get meta data (column info and such)\n\t\tResultSetMetaData metaData = resultSet.getMetaData();\n\t\t\n\t\tString tmpDir = config.getTempDirectory();\n\t\t\n\t\tString tmpFilePrefix = table.getTempFilePrefix();\n\t\t\n\t\t// serialize meta data to disk\n\t\tFile metaDataFile = new File(tmpDir, tmpFilePrefix + \"_metadata.ser\");\n\t\tFileOutputStream fileOut = new FileOutputStream(metaDataFile);\n\t\tObjectOutputStream out = new ObjectOutputStream(fileOut);\n\t\tout.writeObject(new SerializableResultSetMetaData(metaData));\n\t\tout.close();\n\t\tfileOut.close();\n\t\tLOG.info(\"Serialized metadata to temp file: \" + metaDataFile.getAbsolutePath());\n\t\n\t\t\n\t\tif (rowCount == 0)\n\t\t{\n\t\t\twriteInsertCountFile(tmpDir, tmpFilePrefix, 0L);\n\t\t\tLOG.info(\"Finished copying data of '{}' to disk (no data to copy)\", table.getDescription());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// write data to disk\n\t\tFile temp = new File(tmpDir, tmpFilePrefix + \"_data.csv\");\t\t\n\t\tLOG.info(\"Writing data to temp file: \" + temp.getAbsolutePath());\n\t\t\n\t\tBufferedWriter bw = new BufferedWriter\n\t\t\t (new OutputStreamWriter(new FileOutputStream(temp), \"UTF-8\"));\n\n\t\tlong startTime = System.currentTimeMillis();\n\t\tlong insertCount = 0;\n\t\tint columnCount = metaData.getColumnCount();\n\t\t\n\t\twhile (resultSet.next())\n\t\t{\n\t\t\tfor (int i = 1; i <= columnCount; i++)\n\t\t\t{\n\t\t\t\tObject value = resultSet.getObject(i);\n\n\t\t\t\tif (value == null)\n\t\t\t\t{\n\t\t\t\t\tbw.write(NULL_VALUE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString valueStr;\n\t\t\t\t\tif (value instanceof BigDecimal)\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueStr = ((BigDecimal)value).toPlainString();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueStr = value.toString();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (table.isAutoTrim())\n\t\t\t\t\t\tvalueStr = valueStr.trim();\n\n\t\t\t\t\t// escape \\ with \\\\\n\t\t\t\t\tvalueStr = valueStr.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\");\n\n\t\t\t\t\t// escape \" with \\\"\n\t\t\t\t\tvalueStr = valueStr.replaceAll(\"\\\"\", \"\\\\\\\\\\\"\");\n\t\t\t\t\t\n\t\t\t\t\tbw.write(\"\\\"\" + valueStr + \"\\\"\");\n\t\t\t\t}\t\t\t\n\n\t\t\t\t// column separator (not for last column)\n\t\t\t\tif (i < columnCount)\n\t\t\t\t{\n\t\t\t\t\tbw.write(\",\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// record separator\n\t\t\tbw.newLine();\n\n\t\t\tinsertCount++;\n\n\t\t\tif (insertCount % 100000 == 0)\n\t\t\t{\n\t\t\t\tbw.flush();\n\t\t\t\tprintInsertProgress(startTime, insertCount, rowCount, \"written to disk\");\n\t\t\t}\n\t\t}\n\t\tbw.flush();\n\t\tbw.close();\n\t\tprintInsertProgress(startTime, insertCount, rowCount, \"written to disk\");\n\t\t\n\t\twriteInsertCountFile(tmpDir, tmpFilePrefix, insertCount);\n\t\t\n\t\tLOG.info(\"Finished copying data of '\" + table.getDescription() + \"' to disk!\");\n\t}",
"private void writeDailyClimateData(DanubiaCalendar actTime){\n\t\ttry{\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\t\t\tConnection con = DriverManager.getConnection(database);\n\t\t\tStatement stmt = con.createStatement();\n\t\t\tif (firstday) {\n\t\t\t\tfirstday = false;\n\t\t\t\ttry{\n\t\t\t\t stmt.executeUpdate(\"DROP TABLE \"+\"SourceDailyClimateData_\"+climatescenario);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){}\n\t\t\t\ttry {\n\t\t\t\t\tString table = \"CREATE TABLE SourceDailyClimateData_\"+climatescenario+\"(\"+ \"ActorID INTEGER, \"+ \" Date DATE, \"+ \"MeanTemp FLOAT(6,1), \"+ \"MaxTemp FLOAT(6,1), \"+ \"MinTemp FLOAT(6,1), \"+ \"precipSum FLOAT(6,2), \"+ \"precipMax FLOAT(6,2), \"+ \"sunDuranceSum FLOAT(6,1), \"+ \"windSpeedMean FLOAT(6,2), \"+ \"WindSpeedMax FLOAT(6,2), \"+ \"relHum FLOAT(6,2), \"+ \"THI FLOAT(6,1), \"+ \"watertemp FLOAT(6,1), \"+ \"TCI INTEGER)\";\n\t\t\t\t\tstmt.executeUpdate(table);\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t} else {\t\n\t\tfor(Actor a : actorMap().getEntries()){\n\t\t\tString table = \"INSERT INTO SourceDailyClimateData_\"+climatescenario+\" \\n\"+\"VALUES(\";\n\t\t\tDA_SourceArea d = (DA_SourceArea)a;\n\t\t\ttable+=d.getId()+\n\t\t\t\t\t\",\"+\"'\"+actTime.getYear()+\"-\"+actTime.getMonth()+\"-\"+actTime.getDay()+\"'\"+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.airTemperatureMean+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.airTemperatureMax+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.airTemperatureMin+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.precipitationSum+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.precipitationMax+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.sunshineDurationSum+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.windSpeedMean+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.windSpeedMax+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.relativeHumidityMean+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.temperatureHumidityIndex+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.watertemp+\n\t\t\t\t\t\",\"+d.ca.dailyClimate.TCI+\n\t\t\t\t\t\"\\n\"+\")\";\n\t\t\tstmt.executeUpdate(table);\n\t\t\t}\n\t\tcon.close();\n\t\t}}\n\t\tcatch (Exception e) {\n\t\te.printStackTrace();\n\t\t}\n\t}",
"public static boolean saveDataDriver(DataDriver dd, String destPath)\n {\n \tFileExt destExt = getFileExt(destPath);\n \ttry \n \t{\n\t \tswitch(destExt)\n\t \t{\n\t \t\tcase XLS: \t\t\t\n\t \t\tcase XLSX:\n\t \t\t\tWorkbook wb = createWorkbook(destExt);\n\t \t\t\tSheet sheet = wb.createSheet();\n//\t \t\t\tString[] dataRow;\n//\t \t\t\tfor(int r = 0; dd.hasNext(); r++)\n//\t \t\t\t{\n//\t \t\t\t\tdataRow = dd.next();\n//\t \t\t\t\tRow row = sheet.createRow(r);\n//\t\t \t\t\tfor(int c = 0; c < dataRow.length; c++)\n//\t\t \t\t\t{\n//\t\t \t\t\t\trow.createCell(c).setCellValue(dataRow[c]);\n//\t\t \t\t\t}\n//\t \t\t\t}\n\t \t\t\tDataRow dataRow;\n\t \t\t\tRow row = sheet.createRow(0);\n\t \t\t\tfor(int c = 0; c < dd.getHeaders().toArray().length; c++)\n\t \t\t\t{\n\t \t\t\t\trow.createCell(c).setCellValue(dd.getHeaders().toArray()[c]);\n\t \t\t\t}\n\t \t\t\tfor(int r = 1; dd.hasNext(); r++)\n\t \t\t\t{\n\t \t\t\t\tdataRow = dd.nextRow();\n\t \t\t\t\trow = sheet.createRow(r);\n\t\t \t\t\tfor(int c = 0; c < dataRow.length; c++)\n\t\t \t\t\t{\n\t\t \t\t\t\trow.createCell(c).setCellValue(dataRow.getItem(dataRow.getHeaders().toArray()[c]));\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t\tsaveExcel(wb, destPath);\n\t \t\t\tbreak;\n\t \t\tcase CSV:\n\t \t\t\tCSVWriter csv = new CSVWriter(new FileWriter(destPath));\n\t \t\t\tLinkedList<String[]> rows = new LinkedList<String[]>();\n\t \t\t\trows.add(dd.getHeaders().toArray());\n\t \t\twhile(dd.hasNext())\n\t \t\t{\n\t \t\t\trows.add(dd.next());\n\t \t\t}\n\t \t\tcsv.writeAll(rows);\n\t \t\tcsv.close();\n\t \t\t\tbreak;\n\t \t\tdefault:\n\t \t\t\t// Bad\n\t \t\t\treturn false;\n\t \t}\n \t}\n \tcatch(Exception e)\n \t{\n \t\treturn false;\n \t}\n \treturn true;\n }",
"private void prepare_ob_data() \n\t\t{\n\t\t\tint i;\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-DD hh:mm:ss\");\n\t\t\tdelete_data(1, 7);\n for(i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\ttry{\n\t\t\t\t\tdtCollectTime[i] = sdf.parse(sDate[i]);\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\n\t\t\t//prepare collect info data, non join field, str2col\n\t\t\tfor (i = 0; i < count; i++) \n\t\t\t{\n\t\t\t\tRKey rkey = new RKey(new CollectInfoKeyRule(2, (byte) '0', i+1));\n\t\t\t\tInsertMutator im = new InsertMutator(collectInfoTable.getTableName(), rkey);\n\t\n\t\t\t\tValue value00 = new Value();\n\t\t\t\tif( i != 6 )\n \t\t\tvalue00.setString(sUserNick[i]);\n\t\n\t\t\t\tValue value02 = new Value();\n\t\t\t\tvalue02.setSecond(dtCollectTime[i].getTime());\n\n\t\t\t\tValue value03= new Value();\n\t\t\t\tvalue03.setMicrosecond(lCollecTimePrecise[i]);\n\t\n\t\t\t\tim.addColumn(sColumns[0], value00);\n\t\t\t\tim.addColumn(sColumns[2], value02);\n\t\t\t\tim.addColumn(sColumns[3], value03);\n\t\n\t\t\t\tAssert.assertTrue(\"Insert fail!\", obClient.insert(im).getResult());\n\t\t\t}\n\t\t\t//prepare item info date, jstr2col\n\t\t\tfor (i = 0; i < count; i++) \n\t\t\t{\n\t\t\t\tRKey rkey = new RKey(new ItemInfoKeyRule((byte) '0', i+1));\n\t\t\t\tInsertMutator im = new InsertMutator(itemInfoTable.getTableName(), rkey);\n\t\n\t\t\t\tValue value01 = new Value();\n\t\t\t\tvalue01.setNumber(lOwnerId[i]);\n\t\n\t\t\t\tim.addColumn(sColumns[1], value01);\n\t\n\t\t\t\tAssert.assertTrue(\"Insert fail!\", obClient.insert(im).getResult());\n\t\t\t}\n\t\t\tverify_insert_data();\n\t\t}",
"public void write() {\n\t\ttry {\n\t\t\tcreateTable(this.tableName, this.attrContainer);\n\t\t\tinsertData(this.tableName, this.dataContainer);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"CelebrosExportData buildCelebrosExportData(String table, String data, LanguageModel language, CMSSiteModel site, long timestamp);",
"private void saveData() {\n MySQLConnector dataWriter = new MySQLConnector();\n dataWriter.dropTables(); // Delete old tables\n dataWriter.createTables(); // Create new tables\n dataWriter.populateTables(register); // Write data into new tables\n }",
"static void copyTable(String table) throws SQLException {\n\n // query the table\n sourceDB.executeQuery(\"SELECT * FROM \"+table);\n\n // get the metadata\n ResultSetMetaData sourceMD = sourceDB.rs.getMetaData();\n int sourceColumns = sourceMD.getColumnCount();\n\n // loop over the records\n while (sourceDB.rs.next()) {\n\n // build the INSERT query for this record\n String query = \"INSERT INTO \"+table+\" VALUES (\";\n for (int col=1; col<=sourceColumns; col++) {\n\tif (col>1) query += \",\";\n\tif (sourceMD.getColumnName(col).equals(\"refid\")) {\n\t query += \"DEFAULT\";\n\t} else if (isInteger(sourceMD.getColumnType(col))) {\n\t int val = sourceDB.rs.getInt(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += val;\n\t }\n\t} else if (isString(sourceMD.getColumnType(col))) {\n\t String val = sourceDB.rs.getString(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += \"'\"+Util.escapeQuotes(val)+\"'\";\n\t }\n\t} else if (isBoolean(sourceMD.getColumnType(col))) {\n\t boolean val = sourceDB.rs.getBoolean(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += val;\n\t }\n\t} else if (isTimestamp(sourceMD.getColumnType(col))) {\n\t Timestamp val = sourceDB.rs.getTimestamp(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += \"'\"+val+\"'\";\n\t }\n\t} else {\n\t throw new SQLException(\"Data type \"+sourceMD.getColumnType(col)+\" (\"+sourceMD.getColumnTypeName(col)+\") is not supported.\");\n\t}\n }\n query += \")\";\n\n // run the INSERT query against the target database; continue past errors\n try {\n\ttargetDB.executeUpdate(query);\n } catch (Exception ex) {\n\tSystem.out.println(ex.toString());\n\tSystem.out.println(query);\n }\n\n }\n\n }",
"public void export(IDatasourceInfo dsInfo);",
"public void export() {\n CoreDao dao = new CoreDao(DaoConfig.forDatabase(dbName));\n for (String sql : createSqls) {\n try {\n dao.executeSQLUpdate(sql);\n } catch (RuntimeException e) {\n e.printStackTrace();\n // Ignore\n }\n }\n }",
"@SuppressWarnings(\"deprecation\")\n\tpublic void writeTable()\n\t{\n\t\tIterator<WPPost> itr = readValues.iterator();\n\t\t\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tWPPost post = itr.next();\n\t\t\tPreparedStatement prStm;\n\t\t\tint res = 0;\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tif(post.getPostDateGMT() == null)\n\t\t\t\t{\n\t\t\t\t\tpost.setPostDateGMT(new Timestamp(0));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(post.getPostModifiedGMT() == null)\n\t\t\t\t{\n\t\t\t\t\tpost.setPostModifiedGMT(new Timestamp(0));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tprStm = conn.prepareStatement(WRITE_STATEMENT);\n\t\t\t\tprStm.setInt(1, post.getId());\n\t\t\t\tprStm.setInt(2, post.getPostAuthor());\n\t\t\t\tprStm.setTimestamp(3, post.getPostDate());\n\t\t\t\tprStm.setTimestamp(4, post.getPostDateGMT());\n\t\t\t\tprStm.setString(5, post.getPostContent());\n\t\t\t\tprStm.setString(6, post.getPostTitle());\n\t\t\t\tprStm.setString(7, post.getPostExcerpt());\n\t\t\t\tprStm.setString(8, post.getPostStatus());\n\t\t\t\tprStm.setString(9, post.getCommentStatus());\n\t\t\t\tprStm.setString(10, post.getPingStatus());\n\t\t\t\tprStm.setString(11, post.getPostPassword());\n\t\t\t\tprStm.setString(12, post.getPostName());\n\t\t\t\tprStm.setString(13, post.getToPing());\n\t\t\t\tprStm.setString(14, post.getPinged());\n\t\t\t\tprStm.setTimestamp(15, post.getPostModified());\n\t\t\t\tprStm.setTimestamp(16, post.getPostModifiedGMT());\n\t\t\t\tprStm.setString(17, post.getPostContentFiltered());\n\t\t\t\tprStm.setInt(18, post.getPostParent());\n\t\t\t\tprStm.setString(19, post.getGuid());\n\t\t\t\tprStm.setInt(20, post.getMenuOrder());\n\t\t\t\tprStm.setString(21, post.getPostType());\n\t\t\t\tprStm.setString(22, post.getPostMimeType());\n\t\t\t\tprStm.setInt(23, post.getCommentCount());\n\t\t\t\t\n\t\t\t\tres = prStm.executeUpdate();\n\t\t\t\t\n\t\t\t\tif(res == 0)\n\t\t\t\t{\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new WriteWPPostException(post.toString());\n\t\t\t\t\t} \n\t\t\t\t\tcatch (WriteWPPostException e) \n\t\t\t\t\t{\n\t\t\t\t\t\t//e.printStackTrace(); // TODO Debug Mode! Delete This!\n\t\t\t\t\t\tthis.rowsWithErrors.add(post);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\tcatch (SQLException e1) \n\t\t\t{\n\t\t\t\t//e1.printStackTrace(); // TODO Debug Mode! Delete This!\n\t\t\t\tthis.rowsWithErrors.add(post);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void copyStagingFileToTemporaryTable() {\n }",
"@Override\n public int insertObject(Object obj) {\n int flag=0;\n RemedyExport remedyExport = (RemedyExport)obj;\n ResultSet rs = null;\n \n // insert new record to remedyExport\n String query = \"INSERT INTO remedy_export VALUES \"+remedyExport;\n try{\n connection = ConnectionFactory.getConnection();\n statement = connection.createStatement();\n flag = statement.executeUpdate(query);\n //System.out.println(\"Insert one record to Remedy Export table: \"+remedyExport);\n } catch (SQLException ex) {\n Logger.getLogger(EntityDAO.class.getName()).log(Level.SEVERE, null, ex);\n } finally{\n DbUtil.close(statement);\n DbUtil.close(connection); \n } \n return flag; \n }",
"private void saveCopyToDB(Copy copy) {\r\n Connection dbConnection = null;\r\n PreparedStatement statement = null;\r\n PreparedStatement sqlStatement = null;\r\n try {\r\n dbConnection = DBHelper.getConnection();\r\n // PreparedStatement sqlStatement = dbConnection.prepareStatement(\r\n // \"DELETE FROM copies WHERE copyID=\" + copy.getCopyID());\r\n // sqlStatement.executeUpdate();\r\n\r\n statement = dbConnection\r\n .prepareStatement(\"SELECT * FROM copies WHERE copyID=?\");\r\n statement.setInt(1, copy.getCopyID());\r\n ResultSet results = statement.executeQuery();\r\n\r\n if (!results.next()) {\r\n results.close();\r\n SimpleDateFormat normalDateFormat = new SimpleDateFormat(\r\n \"dd/MM/yyyy\");\r\n sqlStatement = dbConnection.prepareStatement(\r\n \"INSERT INTO copies \" + \"VALUES(?,?,?,?,?,?,?)\");\r\n\r\n sqlStatement.setInt(1, copy.getCopyID());\r\n sqlStatement.setInt(2, uniqueID);\r\n sqlStatement.setInt(4, copy.getLoanDuration());\r\n sqlStatement.setString(5,\r\n formatDate(copy.getBorrowDate(), normalDateFormat));\r\n sqlStatement.setString(6,\r\n formatDate(copy.getLastRenewal(), normalDateFormat));\r\n sqlStatement.setString(7,\r\n formatDate(copy.getDueDate(), normalDateFormat));\r\n\r\n String userName = null;\r\n if (copy.getBorrower() != null) {\r\n userName = copy.getBorrower().getUsername();\r\n sqlStatement.setString(3, userName);\r\n }\r\n else {\r\n sqlStatement.setString(3, null);\r\n }\r\n sqlStatement.executeUpdate();\r\n dbConnection.close();\r\n } else {\r\n\r\n SimpleDateFormat normalDateFormat = new SimpleDateFormat(\r\n \"dd/MM/yyyy\");\r\n\r\n sqlStatement = dbConnection.prepareStatement(\r\n \"UPDATE copies SET rID=?,keeper=?,\" +\r\n \"loanDuration=?,borrowDate=?,lastRenewal=?,\" +\r\n \"dueDate=? WHERE copyID=?\");\r\n copy.getCopyID();\r\n sqlStatement.setInt(7, copy.getCopyID());\r\n sqlStatement.setInt(1, uniqueID);\r\n sqlStatement.setInt(3, copy.getLoanDuration());\r\n\r\n sqlStatement.setString(4,\r\n formatDate(copy.getBorrowDate(), normalDateFormat));\r\n sqlStatement.setString(5,\r\n formatDate(copy.getLastRenewal(), normalDateFormat));\r\n sqlStatement.setString(6,\r\n formatDate(copy.getDueDate(), normalDateFormat));\r\n\r\n String userName = null;\r\n if (copy.getBorrower() != null) {\r\n userName = copy.getBorrower().getUsername();\r\n sqlStatement.setString(2, userName);\r\n }\r\n else {\r\n sqlStatement.setString(2, null);\r\n }\r\n\r\n sqlStatement.executeUpdate();\r\n }\r\n dbConnection.close();\r\n }\r\n catch (SQLException e) {\r\n e.printStackTrace();\r\n } \r\n }",
"public void dataFileCreate() {\r\n\t\tString COMMA_DELIMITER = \",\";\r\n\t\tString NEW_LINE_SEPERATOR = \"\\n\";\r\n\t\tString FILE_HEADER = \"Title,First Name,Last Name,Email,Phone Number\";\r\n\t\ttry {\r\n\t\t\tList<Customer> dataList = new ArrayList<Customer>();\r\n\t\t\tdataList.add(\r\n\t\t\t\t\tnew Customer(title, customerFirstName, customerLastName, custromerEmailId, customerPhoneNumber));\r\n\r\n\t\t\tFileWriter fileWriter = new FileWriter(\"CustomerDetails.csv\");\r\n\t\t\tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\r\n\t\t\tbufferWriter.append(FILE_HEADER);\r\n\r\n\t\t\tfor (Customer c : dataList) {\r\n\t\t\t\tbufferWriter.write(NEW_LINE_SEPERATOR);\r\n\t\t\t\tbufferWriter.write(c.getTitle());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getFirstName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getLastName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getEmailAddress());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(String.valueOf(c.getPhone()));\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t}\r\n\r\n\t\t\tbufferWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"@Insert({\n \"insert into t_dsdata_record (datafile_code, order_code, \",\n \"datafile_name, datafile_time, \",\n \"data_consistency, data_url,datafile_size)\",\n \"values (#{datafileCode,jdbcType=INTEGER}, #{orderCode,jdbcType=INTEGER}, \",\n \"#{datafileName,jdbcType=VARCHAR}, #{datafileTime,jdbcType=DATE}, \",\n \"#{dataConsistency,jdbcType=INTEGER}, #{dataUrl,jdbcType=VARCHAR}, #{datafileSize,jdbcType=DECIMAL})\"\n })\n int insert(TDsdataRecord record);",
"private void getDestinationValuesForComparison() {\n\n //if (oneToMany_RelationshipSql == null && oneToMany != null) {\n setOneToManySqlRelationship();\n //}\n \n // this will skip comparing dest values, saving time, and just moving the data to dest regardless of overwrite policy\n if (compareDestValues == false) {\n for (int i=0; i < columnData_des.length; i++) {\n String s = null;\n columnData_des[i].setValue(s);\n }\n return;\n }\n \n // TODO do I need to keep getting the keys, or save them in class var\n // TODO asumming that the primary key is the same\n String srcPrimKeyValue = cl_src.getPrimaryKey_Value(columnData_src);\n String desPrimKeyColName = cl_des.getPrimaryKey_Name(columnData_des);\n \n if (srcPrimKeyValue == null || srcPrimKeyValue.length() == 0) {\n log.warn(\"Transfer.getDestinationValuesForComparison(): How come there is no primary key???\");\n }\n \n String sql = \"SELECT * FROM \" + tableRight + \" WHERE \" +\n \"(\" + desPrimKeyColName + \"='\" + ql_src.escape(srcPrimKeyValue) + \"')\";\n \n log.trace(\"getDestinationValuesForComparison(): \" + sql);\n \n boolean b = false;\n Connection conn = null;\n Statement select = null;\n try {\n conn = database_des.getConnection();\n select = conn.createStatement();\n ResultSet result = select.executeQuery(sql);\n while (result.next()) {\n\n for (int i=0; i < columnData_des.length; i++) {\n String value = result.getString(columnData_des[i].getColumnName());\n columnData_des[i].setValue(value);\n b = true;\n }\n \n }\n result.close();\n select.close();\n conn.close();\n result = null;\n select = null;\n conn = null;\n } catch (SQLException e) {\n e.printStackTrace();\n log.error(\"error\", e);\n }\n \n if (b == false) {\n for (int i=0; i < columnData_des.length; i++) {\n String s = null;\n columnData_des[i].setValue(s);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displays the scores in columnar form. Golfer is the header for each column | public void displayColumns() {
System.out.println("SCORES");
System.out.println("0\t1\t2\t3\t4\t5"); // \t will space to the next tab
for(int i = 0; i<scores[0].length;i++) {
for(int c = 0; c<scores.length;c++) {
System.out.printf(scores[c][i] +"\t");
}
System.out.println();
}
// marker (for formatting)
System.out.println("-\t-\t-\t-\t-\t-");
} | [
"public void displayScoresHeader() {\n\t\tSystem.out.println(\"### Scores ###\");\n\t}",
"public static void displayGrades(){\r\n //print out grades to board\r\n for(int row =0; row< grade.length; row++){\r\n for(int col=0; col<grade[row].length; col++){\r\n grade[row][col] = grade[row][col];\r\n \r\n if(col <1)\r\n System.out.printf(\"%-18s\",grade[row][col]);// Have the first column have enoughspacing for large names \r\n else\r\n System.out.printf(\"%-10s\",grade[row][col]); //keep everything after first column from having to large of a spacing \r\n }\r\n \r\n System.out.println(\" \"); \r\n }\r\n }",
"void displayScores() {\r\n\tPlayer[] players = gameControl.getPlayers();\r\n\tint[] index = gameControl.rankPlayers();\r\n\ttaScores.setText(\"Round: \" + gameControl.getGameState().getGameRound() + \"\\n\");\r\n\ttaScores.appendText(String.format(\"%-10s%13s%10s%7s\\n\", \"Player\", \"MB\", \"Research\", \"Level\"));\r\n\ttaScores.appendText(String.format(\"%-10s%13s%10s%7s\\n\", \"------\", \"--\", \"--------\", \"-----\"));\r\n\tfor (int i = 0; i < gameControl.getGameRules().getNumberOfPlayers(); i++) {\r\n\t taScores.appendText(String.format(\"%d. %-10s\", i + 1, players[index[i]].getName()));\r\n\t taScores.appendText(players[index[i]].getScore());\r\n\t}\r\n }",
"public void display() {\n\t\tdisplayColumnHeaders();\n\t\taddHyphens();\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\taddSpaces();\n\t\t\tSystem.out.print(\" row \" + row + ' ');\n\t\t\tfor (int col = 0; col < 3; col++)\n\t\t\t\tSystem.out.print(\"| \" + getMark(row, col) + \" \");\n\t\t\tSystem.out.println(\"|\");\n\t\t\taddSpaces();\n\t\t\taddHyphens();\n\t\t}\n\t}",
"private void showHighScores() {\n\n\t\t// Define labels for the scoreBoard.\n\t\tGLabel title = new GLabel(\"HISTORY HIGH SCORES\");\n\t\ttitle.setColor(Color.YELLOW);\n\n\t\t// Add label to scoreBoard.\n\t\tscoreBoard.add(title, getWidth() * 0.738, getHeight() * 0.1);\n\n\t\tGLabel rank = new GLabel(\"RANK\");\n\t\trank.setColor(Color.YELLOW);\n\t\tGLabel name = new GLabel(\"NAME\");\n\t\tname.setColor(Color.YELLOW);\n\t\tGLabel score = new GLabel(\"SCORE\");\n\t\tscore.setColor(Color.YELLOW);\n\t\tscoreBoard.add(rank, title.getX() - title.getWidth() * 0.5, title.getY() + title.getHeight() * 1.5);\n\t\tscoreBoard.add(name, title.getX() + title.getWidth() * 0.5 - name.getWidth() * 0.5, rank.getY());\n\t\tscoreBoard.add(score, title.getX() + title.getWidth() * 1.15, rank.getY());\n\n\t\t// Since method readHighScores gets the data from the txt file\n\t\t// and puts them into arrays fameName and fameScore,\n\t\t// here it extracts data from the two arrays and turn them into\n\t\t// GLabels to show on the screen.\n\t\t// These labels are also a part of the GCompound scoreBoard.\n\t\tfor (int i = 0; i < hallOfFame.length; i++) {\n\t\t\tString num = Integer.toString(i + 1);\n\t\t\tGLabel numLabel = new GLabel(num);\n\t\t\tnumLabel.setColor(Color.YELLOW);\n\t\t\tscoreBoard.add(numLabel, rank.getX() + rank.getWidth() * 0.5 - numLabel.getWidth() * 0.5,\n\t\t\t\t\trank.getY() + rank.getHeight() * 1.4 * (i + 1));\n\t\t}\n\n\t\tfor (int i = 0; i < hallOfFame.length; i++) {\n\t\t\tString names = fameName[i];\n\t\t\tGLabel namesLabel = new GLabel(names);\n\t\t\tnamesLabel.setColor(Color.YELLOW);\n\t\t\tscoreBoard.add(namesLabel, name.getX() + name.getWidth() * 0.5 - namesLabel.getWidth() * 0.5,\n\t\t\t\t\tname.getY() + name.getHeight() * 1.4 * (i + 1));\n\t\t}\n\n\t\tfor (int i = 0; i < hallOfFame.length; i++) {\n\t\t\tint scores = fameScore[i];\n\t\t\tString scoresStr = Integer.toString(scores);\n\t\t\tGLabel scoresLabel = new GLabel(scoresStr);\n\t\t\tscoresLabel.setColor(Color.YELLOW);\n\t\t\tscoreBoard.add(scoresLabel, score.getX() + score.getWidth() * 0.5 - scoresLabel.getWidth() * 0.5,\n\t\t\t\t\tscore.getY() + score.getHeight() * 1.4 * (i + 1));\n\t\t}\n\n\t\tadd(scoreBoard, 0, 0);\n\n\t}",
"void displayColumnHeaders() {\n\t\tSystem.out.print(\" \");\n\t\tfor (int j = 0; j < 3; j++)\n\t\t\tSystem.out.print(\"|col \" + j);\n\t\tSystem.out.println();\n\t}",
"public static void DisplayClassScores() {\r\n\r\n\t}",
"public void displayDBScores(){\n\t\tCursor c = db.getScores();\n\t\tif(c!=null) {\n\t\t\tc.moveToFirst();\n\t\t\twhile(!c.isAfterLast()){\n\t\t\t\tdisplayScore(c.getString(0),c.getInt(1));\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tc.close();\n\t\t}\n\t}",
"public void displayResults() {\n int counter = rt.getCounter();\n if (counter == 1) {\n IJ.setColumnHeadings(rt.getColumnHeadings());\n }\n IJ.write(rt.getRowAsString(counter - 1));\n }",
"public void addColumnGleasonScore() {\n addColumnInPrimarySection(ColumnMetaData.KEY_SECTION_GLEASON_PRIMARY);\n addColumnInPrimarySection(ColumnMetaData.KEY_SECTION_GLEASON_SECONDARY);\n addColumnInPrimarySection(ColumnMetaData.KEY_SECTION_GLEASON_TOTAL);\n }",
"private void displayScores()\n {\n for (int i = 0; i < players.length; i++)\n {\n System.out.println(\"Player \" + (i + 1) + \": \" + players[i].getName() + \" got \" + players[i].totalScore() + \" points.\");\n }\n }",
"private void displayBoardColumns() {\n System.out.print(\"| | A | B | C | D | E | F | G | H \");\n }",
"private void fillTable() {\n\n table.row();\n table.add();//.pad()\n table.row();\n for (int i = 1; i <= game.getNum_scores(); i++) {\n scoreRank = new Label(String.format(\"%01d: \", i), new Label.LabelStyle(fonts.getInstance().getClouds(), Color.WHITE));\n scoreValue = new Label(String.format(\"%06d\", game.getScores().get(i-1)), new Label.LabelStyle(fonts.getInstance().getRancho(), Color.WHITE));\n table.add(scoreRank).expandX().right();\n table.add(scoreValue).expandX().left();\n table.row();\n }\n\n }",
"public static void displayHighscores() {\n\t\tCollections.sort(highScores); // sort high scores\n\t\tSystem.out.println(\"NAME: SCORE\");\n\t\tSystem.out.println(\"-----------\");\n\t\tfor(int i = 0; i < highScores.size(); i++) {\n\t\t\tSystem.out.println(highScores.get(i).getName().toUpperCase() +\": \" +highScores.get(i).getScore());\n\t\t} System.out.println();\n\t}",
"public void display(String[] col){\r\n\t\t// if the content container if empty, output info\r\n\t\tif(num_row == 0){\r\n\t\t\tSystem.out.println(\"Empty set.\");\r\n\t\t}else{\r\n\t\t\t// called function to update format controller\r\n\t\t\tupdateFormat();\r\n\t\t\t// if selectd column is \"*\", means display all columns\r\n\t\t\tif(col[0].equals(\"*\")){\r\n\t\t\t\t// print line\r\n\t\t\t\tfor(int l: format)\r\n\t\t\t\t\tSystem.out.print(line(\"-\", l+3));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print column name\r\n\t\t\t\tfor(int j = 0; j < columnName.length; j++)\r\n\t\t\t\t\tSystem.out.print(fix(format[j], columnName[j])+\"|\");\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print line\r\n\t\t\t\tfor(int l: format)\r\n\t\t\t\t\tSystem.out.print(line(\"-\", l+3));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print data\r\n\t\t\t\tfor(String[] i : content.values()){\r\n\t\t\t\t\tfor(int j = 0; j < i.length; j++)\r\n\t\t\t\t\t\tSystem.out.print(fix(format[j], i[j])+\"|\");\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t// else output selected column\r\n\t\t\t}else{\r\n\t\t\t\tint[] control = new int[col.length];\r\n\t\t\t\tfor(int j = 0; j < col.length; j++)\r\n\t\t\t\t\tfor(int i = 0; i < columnName.length; i++)\r\n\t\t\t\t\t\tif(col[j].equals(columnName[i]))\r\n\t\t\t\t\t\t\tcontrol[j] = i;\r\n\t\t\t\t// print line\r\n\t\t\t\tfor(int j = 0; j < control.length; j++)\r\n\t\t\t\t\tSystem.out.print(line(\"-\", format[control[j]]+3));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print column name\r\n\t\t\t\tfor(int j = 0; j < control.length; j++)\r\n\t\t\t\t\tSystem.out.print(fix(format[control[j]], columnName[control[j]])+\"|\");\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print line\r\n\t\t\t\tfor(int j = 0; j < control.length; j++)\r\n\t\t\t\t\tSystem.out.print(line(\"-\", format[control[j]]+3));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t// print data\r\n\t\t\t\tfor(String[] i : content.values()){\r\n\t\t\t\t\tfor(int j = 0; j < control.length; j++)\r\n\t\t\t\t\t\tSystem.out.print(fix(format[control[j]], i[control[j]])+\"|\");\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void display(Student[] students) {\n System.out.print(\"\\nPrint Graph:\\n |\");\n for (int i = 0; i < students.length; i++) {\n System.out.printf(\"#%-2d|\", students[i].id);//column label\n }\n for (int i = 0; i < students.length; i++) {\n //grid\n System.out.println();\n for (int j = 0; j < 10; j++) {\n System.out.print(\"---|\");\n }\n System.out.println();\n\n //row label\n System.out.printf(\"#%-2d|\", students[i].id);\n for (int j = 0; j < students.length; j++) {\n int r = students[i].getFriendRep(students[j]);\n String rep = (r == 0) ? \" \" : String.valueOf(r); \n System.out.printf(\"%-3s|\", rep);\n }\n }\n }",
"public void printBoxScore() {\n\t\tSystem.out.print(getVisitorTeam()+\" at \"+getHomeTeam()+ \" on \"+getDateString()+\": \");\n\t\t//Conditional statement below ensures that program outputs the winning team score first and then the losing team score (i.e. 24-17)\n\t\tif (getVisitorScore() > getHomeScore()) {\n\t\t\tSystem.out.println(getVisitorScore()+\"-\"+getHomeScore());\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(getHomeScore()+\"-\"+getVisitorScore());\n\t\t}\n\t\tint length = 21; //Random length chosen for number of spaces before scoreByQuarter for each team would be printed. Looks good. \n\t\tString homeOutput = getHomeTeam();\n\t\tString visitorOutput = getVisitorTeam();\n\t\tint[] homeQuarterStats = getHomeScoreByQuarter();\n\t\tint[] visitorQuarterStats = getVisitorScoreByQuarter();\n\t\tfor (int i=0; i<length-getHomeTeam().length(); i++) {\n\t\t\thomeOutput += \" \";\n\t\t}\n\t\tfor (int i=0; i<length-getVisitorTeam().length(); i++) {\n\t\t\tvisitorOutput += \" \";\n\t\t}\n\t\tfor (int i=0; i<4; i++) {\n\t\t\thomeOutput += homeQuarterStats[i] + \" \";\n\t\t\t//Conditional statement used for proper positioning for score. i.e. Getting the 0 below the 4 in 14 for the first quarter\n\t\t\tif (homeQuarterStats[i] > 9 && visitorQuarterStats[i] < 10) {\n\t\t\t\tvisitorOutput += \" \" + visitorQuarterStats[i] + \" \";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvisitorOutput += visitorQuarterStats[i] + \" \";\n\t\t\t}\n\t\t}\n\t\thomeOutput += \"- \" + getHomeScore();\n\t\tvisitorOutput += \"- \" + getVisitorScore();\n\t\tSystem.out.println(homeOutput);\n\t\tSystem.out.println(visitorOutput);\n\t\tint scoreCount = 0;\n\t\tfor (int q=1; q<5; q++) {\n\t\t\tswitch(q) {\n\t\t\tcase 1: System.out.println(\"First Quarter\"); break;\n\t\t\tcase 2: System.out.println(\"Second Quarter\"); break;\n\t\t\tcase 3: System.out.println(\"Third Quarter\"); break;\n\t\t\tcase 4: System.out.println(\"Fourth Quarter\"); break;\n\t\t\t}\n\t\t\tfor (int s=0; s<scores.length; s++) {\n\t\t\t\tif (scores[s].getQuarter() == q) {\n\t\t\t\t\tSystem.out.println(scores[s].toString());\n\t\t\t\t\tscoreCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scoreCount == 0) {\n\t\t\t\tSystem.out.println(\"No Score\");\n\t\t\t}\n\t\t}\n\t}",
"private void printScore() {\n\t\tSystem.out.print(\"Score: \");\n\t\tfor (ScoreItem item : othello.getScore().getPlayersScore()) {\n\t\t\tSystem.out.print(getPlayerNameFromId(item.getPlayerId()) + \" (\" + item.getScore() + \") \");\n\t\t}\n\t}",
"private void displayFinalScores(){\n for (int player=1; player<=nPlayers; player++) {\n display.updateScorecard(UPPER_BONUS, player, scoreCard[player][UPPER_BONUS]);\n display.updateScorecard(UPPER_SCORE, player, scoreCard[player][UPPER_SCORE]);\n display.updateScorecard(LOWER_SCORE, player, scoreCard[player][LOWER_SCORE]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
These settings relate to your QuickTime MOV output container. | public MovSettings getMovSettings() {
return this.movSettings;
} | [
"public void setMovSettings(MovSettings movSettings) {\n this.movSettings = movSettings;\n }",
"private static double outputQuality()\r\n {\r\n return Iterator.mode ? 0.3 : 0.8;\r\n }",
"public void setDefaultParameters() {\n\t\toptions = 0;\n\t\toutBits = null;\n\t\ttext = new byte[0];\n\t\tyHeight = 3;\n\t\taspectRatio = 0.5f;\n\t}",
"gov.nasa.gsfc.spdf.ssc.OutputOptions addNewOutputOptions();",
"private static void forceBasicEditorConfiguration() {\n Game.graphics().setBaseRenderScale(1.0f);\n Game.config().debug().setDebugEnabled(true);\n Game.config().graphics().setGraphicQuality(Quality.VERYHIGH);\n Game.config().graphics().setReduceFramesWhenNotFocused(false);\n }",
"public void settings() {\n int widthOfWindow = 900;\n int heightOfWindow = 900;\n\n //Size of the program window\n size(widthOfWindow, heightOfWindow);\n //making the movement smooth, i think, comes from processing\n smooth();\n }",
"public void setVideoQuality(int r12, boolean r13, boolean r14) {\n /*\n r11 = this;\n r0 = TAG;\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = \"liteav_api setVideoQuality \";\n r1.append(r2);\n r1.append(r12);\n r2 = \", \";\n r1.append(r2);\n r1.append(r13);\n r2 = \", \";\n r1.append(r2);\n r1.append(r14);\n r1 = r1.toString();\n com.tencent.liteav.basic.log.TXCLog.d(r0, r1);\n r0 = android.os.Build.VERSION.SDK_INT;\n r1 = 3;\n r2 = 18;\n r3 = 2;\n r4 = 1;\n if (r0 >= r2) goto L_0x0034;\n L_0x002f:\n if (r12 == r3) goto L_0x0033;\n L_0x0031:\n if (r12 != r1) goto L_0x0034;\n L_0x0033:\n r12 = 1;\n L_0x0034:\n r0 = r11.mConfig;\n if (r0 != 0) goto L_0x003f;\n L_0x0038:\n r0 = new com.tencent.rtmp.TXLivePushConfig;\n r0.<init>();\n r11.mConfig = r0;\n L_0x003f:\n r0 = r11.mConfig;\n r0.setVideoFPS(r2);\n r0 = 1200; // 0x4b0 float:1.682E-42 double:5.93E-321;\n r5 = 301; // 0x12d float:4.22E-43 double:1.487E-321;\n r6 = 1800; // 0x708 float:2.522E-42 double:8.893E-321;\n r7 = 600; // 0x258 float:8.41E-43 double:2.964E-321;\n r8 = 800; // 0x320 float:1.121E-42 double:3.953E-321;\n r9 = 48000; // 0xbb80 float:6.7262E-41 double:2.3715E-319;\n r10 = 0;\n switch(r12) {\n case 1: goto L_0x01d4;\n case 2: goto L_0x01ab;\n case 3: goto L_0x0184;\n case 4: goto L_0x00cc;\n case 5: goto L_0x00a7;\n case 6: goto L_0x0071;\n default: goto L_0x0055;\n };\n L_0x0055:\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r3);\n r13 = TAG;\n r14 = new java.lang.StringBuilder;\n r14.<init>();\n r0 = \"setVideoPushQuality: invalid quality \";\n r14.append(r0);\n r14.append(r12);\n r12 = r14.toString();\n com.tencent.liteav.basic.log.TXCLog.e(r13, r12);\n return;\n L_0x0071:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r4);\n r13 = r11.mConfig;\n r13.setVideoResolution(r10);\n r13 = r11.mConfig;\n r13.setAudioSampleRate(r9);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r4);\n r13 = r11.mConfig;\n r14 = 5;\n r13.setAutoAdjustStrategy(r14);\n r13 = r11.mConfig;\n r14 = 190; // 0xbe float:2.66E-43 double:9.4E-322;\n r13.setMinVideoBitrate(r14);\n r13 = r11.mConfig;\n r14 = 400; // 0x190 float:5.6E-43 double:1.976E-321;\n r13.setVideoBitrate(r14);\n r13 = r11.mConfig;\n r14 = 810; // 0x32a float:1.135E-42 double:4.0E-321;\n r13.setMaxVideoBitrate(r14);\n r13 = 1;\n goto L_0x00c9;\n L_0x00a7:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r4);\n r13 = r11.mConfig;\n r14 = 6;\n r13.setVideoResolution(r14);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r10);\n r13 = r11.mConfig;\n r14 = 350; // 0x15e float:4.9E-43 double:1.73E-321;\n r13.setVideoBitrate(r14);\n r13 = r11.mConfig;\n r13.setAudioSampleRate(r9);\n L_0x00c8:\n r13 = 0;\n L_0x00c9:\n r10 = 1;\n goto L_0x01fb;\n L_0x00cc:\n r13 = android.os.Build.VERSION.SDK_INT;\n r14 = 4;\n if (r13 >= r2) goto L_0x00fb;\n L_0x00d1:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r10);\n r13 = r11.mConfig;\n r13.setVideoResolution(r10);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r4);\n r13 = r11.mConfig;\n r13.setAutoAdjustStrategy(r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r5);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r8);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r8);\n goto L_0x017d;\n L_0x00fb:\n r13 = r11.mVideoQuality;\n if (r13 != r4) goto L_0x0128;\n L_0x00ff:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r4);\n r13 = r11.mConfig;\n r13.setVideoResolution(r10);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r4);\n r13 = r11.mConfig;\n r13.setAutoAdjustStrategy(r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r5);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r8);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r8);\n goto L_0x017d;\n L_0x0128:\n r13 = r11.mVideoQuality;\n if (r13 != r1) goto L_0x0155;\n L_0x012c:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r4);\n r13 = r11.mConfig;\n r13.setVideoResolution(r3);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r4);\n r13 = r11.mConfig;\n r13.setAutoAdjustStrategy(r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r7);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r6);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r6);\n goto L_0x017d;\n L_0x0155:\n r13 = r11.mConfig;\n r13.enableAEC(r4);\n r13 = r11.mConfig;\n r13.setHardwareAcceleration(r4);\n r13 = r11.mConfig;\n r13.setVideoResolution(r4);\n r13 = r11.mConfig;\n r13.setAutoAdjustBitrate(r4);\n r13 = r11.mConfig;\n r13.setAutoAdjustStrategy(r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r7);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r0);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r0);\n L_0x017d:\n r13 = r11.mConfig;\n r13.setAudioSampleRate(r9);\n goto L_0x00c8;\n L_0x0184:\n r0 = r11.mConfig;\n r0.enableAEC(r10);\n r0 = r11.mConfig;\n r0.setHardwareAcceleration(r4);\n r0 = r11.mConfig;\n r0.setVideoResolution(r3);\n r0 = r11.mConfig;\n r0.setAudioSampleRate(r9);\n r11.setAdjustStrategy(r13, r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r7);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r6);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r6);\n goto L_0x01fa;\n L_0x01ab:\n r2 = r11.mConfig;\n r2.enableAEC(r10);\n r2 = r11.mConfig;\n r2.setHardwareAcceleration(r3);\n r2 = r11.mConfig;\n r2.setVideoResolution(r4);\n r2 = r11.mConfig;\n r2.setAudioSampleRate(r9);\n r11.setAdjustStrategy(r13, r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r7);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r0);\n r13 = r11.mConfig;\n r14 = 1500; // 0x5dc float:2.102E-42 double:7.41E-321;\n r13.setMaxVideoBitrate(r14);\n goto L_0x01fa;\n L_0x01d4:\n r0 = r11.mConfig;\n r0.enableAEC(r10);\n r0 = r11.mConfig;\n r0.setHardwareAcceleration(r3);\n r0 = r11.mConfig;\n r0.setVideoResolution(r10);\n r0 = r11.mConfig;\n r0.setAudioSampleRate(r9);\n r11.setAdjustStrategy(r13, r14);\n r13 = r11.mConfig;\n r13.setMinVideoBitrate(r5);\n r13 = r11.mConfig;\n r13.setVideoBitrate(r8);\n r13 = r11.mConfig;\n r13.setMaxVideoBitrate(r8);\n L_0x01fa:\n r13 = 0;\n L_0x01fb:\n r11.mVideoQuality = r12;\n r12 = r11.mConfig;\n r14 = r10 ^ 1;\n r12.enableVideoHardEncoderMainProfile(r14);\n r12 = r11.mConfig;\n if (r10 == 0) goto L_0x0209;\n L_0x0208:\n r1 = 1;\n L_0x0209:\n r12.setVideoEncodeGop(r1);\n r12 = r11.mNewConfig;\n if (r12 == 0) goto L_0x0218;\n L_0x0210:\n r12 = r11.mNewConfig;\n r12.I = r10;\n r12 = r11.mNewConfig;\n r12.J = r13;\n L_0x0218:\n r12 = r11.mConfig;\n r11.setConfig(r12);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.rtmp.TXLivePusher.setVideoQuality(int, boolean, boolean):void\");\n }",
"private void qcomInitPreferences(PreferenceGroup group){\n ListPreference powerMode = group.findPreference(KEY_POWER_MODE);\n ListPreference zsl = group.findPreference(KEY_ZSL);\n ListPreference colorEffect = group.findPreference(KEY_COLOR_EFFECT);\n ListPreference faceDetection = group.findPreference(KEY_FACE_DETECTION);\n ListPreference touchAfAec = group.findPreference(KEY_TOUCH_AF_AEC);\n ListPreference selectableZoneAf = group.findPreference(KEY_SELECTABLE_ZONE_AF);\n ListPreference saturation = group.findPreference(KEY_SATURATION);\n ListPreference contrast = group.findPreference(KEY_CONTRAST);\n ListPreference sharpness = group.findPreference(KEY_SHARPNESS);\n ListPreference autoExposure = group.findPreference(KEY_AUTOEXPOSURE);\n ListPreference antiBanding = group.findPreference(KEY_ANTIBANDING);\n ListPreference mIso = group.findPreference(KEY_ISO);\n ListPreference lensShade = group.findPreference(KEY_LENSSHADING);\n ListPreference histogram = group.findPreference(KEY_HISTOGRAM);\n ListPreference denoise = group.findPreference(KEY_DENOISE);\n ListPreference redeyeReduction = group.findPreference(KEY_REDEYE_REDUCTION);\n ListPreference hfr = group.findPreference(KEY_VIDEO_HIGH_FRAME_RATE);\n ListPreference hdr = group.findPreference(KEY_AE_BRACKET_HDR);\n ListPreference jpegQuality = group.findPreference(KEY_JPEG_QUALITY);\n ListPreference videoSnapSize = group.findPreference(KEY_VIDEO_SNAPSHOT_SIZE);\n ListPreference pictureFormat = group.findPreference(KEY_PICTURE_FORMAT);\n //BEGIN: Added by zhanghongxing at 2013-01-06 for DER-173\n ListPreference videoColorEffect = group.findPreference(KEY_VIDEO_COLOR_EFFECT);\n //END: Added by zhanghongxing at 2013-01-06\n \n \n// ListPreference videoEffect = group.findPreference(KEY_VIDEO_EFFECT);\n\n\n if (touchAfAec != null) {\n filterUnsupportedOptions(group,\n touchAfAec, mParameters.getSupportedTouchAfAec());\n }\n\n if (selectableZoneAf != null) {\n filterUnsupportedOptions(group,\n selectableZoneAf, mParameters.getSupportedSelectableZoneAf());\n }\n\n if (mIso != null) {\n filterUnsupportedOptions(group,\n mIso, mParameters.getSupportedIsoValues());\n }\n\n /* if (lensShade!= null) {\n filterUnsupportedOptions(group,\n lensShade, mParameters.getSupportedLensShadeModes());\n }*/\n\n\t\tif (redeyeReduction != null) {\n filterUnsupportedOptions(group,\n redeyeReduction, mParameters.getSupportedRedeyeReductionModes());\n }\n\n if (hfr != null) {\n filterUnsupportedOptions(group,\n hfr, mParameters.getSupportedVideoHighFrameRateModes());\n }\n\n if (denoise != null) {\n filterUnsupportedOptions(group,\n denoise, mParameters.getSupportedDenoiseModes());\n }\n\n if (pictureFormat != null) {\n // getSupportedPictureFormats() returns the List<Integar>\n // which need to convert to List<String> format.\n List<Integer> SupportedPictureFormatsInIntArray = mParameters.getSupportedPictureFormats();\n List<String> SupportedPictureFormatsInStrArray = new ArrayList<String>();\n for (Integer picIndex : SupportedPictureFormatsInIntArray) {\n SupportedPictureFormatsInStrArray.add(cameraFormatForPixelFormatVal(picIndex.intValue()));\n }\n// if(1 == mParameters.getInt(\"raw-format-supported\")) {\n // getSupportedPictureFormats() doesnt have the support for RAW Pixel format.\n // so need to add explicitly the RAW Pixel Format.\n// SupportedPictureFormatsInStrArray.add(PIXEL_FORMAT_RAW);\n// }\n //BEGIN: Modified by zhanghongxing at 2013-03-12 for FBD-115\n // Remove the picture format.\n // filterUnsupportedOptions(group, pictureFormat, SupportedPictureFormatsInStrArray);\n filterUnsupportedOptions(group, pictureFormat, null);\n //END: Modified by zhanghongxing at 2013-03-12\n }\n\n if (colorEffect != null) {\n filterUnsupportedOptions(group,\n colorEffect, mParameters.getSupportedColorEffects());\n CharSequence[] entries = colorEffect.getEntries();\n if(entries == null || entries.length <= 0 ) {\n filterUnsupportedOptions(group, colorEffect, null);\n }\n }\n\n if (antiBanding != null) {\n filterUnsupportedOptions(group,\n antiBanding, mParameters.getSupportedAntibanding());\n }\n if (autoExposure != null) {\n filterUnsupportedOptions(group,\n autoExposure, mParameters.getSupportedAutoexposure());\n }\n if (!mParameters.isPowerModeSupported())\n {\n filterUnsupportedOptions(group,\n videoSnapSize, null);\n }else{\n filterUnsupportedOptions(group, videoSnapSize, sizeListToStringList(\n mParameters.getSupportedPictureSizes()));\n }\n if (histogram!= null) {\n filterUnsupportedOptions(group,\n histogram, mParameters.getSupportedHistogramModes());\n }\n\n if (hdr!= null) {\n// filterUnsupportedOptions(group,\n// hdr, mParameters.getSupportedAEBracketModes());\n }\n\n //BEGIN: Added by zhanghongxing at 2013-01-06 for DER-173\n if (videoColorEffect != null) {\n //BEGIN: Modified by zhanghongxing at 2013-04-09 for FBD-722/723\n //Remove the front camera video color effect.\n filterUnsupportedOptions(group,\n videoColorEffect, mParameters.getSupportedColorEffects());\n CharSequence[] entries = videoColorEffect.getEntries();\n if(entries == null || entries.length <= 0 ) {\n filterUnsupportedOptions(group, videoColorEffect, null);\n }\n //END: Modified by zhanghongxing at 2013-04-09\n }\n //END: Added by zhanghongxing at 2013-01-06\n \n// if (videoEffect != null) {\n// filterUnsupportedOptions(group,\n// \t\tvideoEffect, mParameters.getSupportedColorEffects());\n// } \n }",
"public void setEncodings() {\n//Configurations\n\t//initial option values\n \t nEncodings = 0;\n \t//enable rectangle copys\n\t encodings[nEncodings++] = RfbProto.EncodingCopyRect;\n\t//best all purpose encoding\n \t int preferredEncoding = RfbProto.EncodingTight;\n \t @SuppressWarnings(\"unused\")\n\t\tboolean enableCompressLevel = true;\n \t encodings[nEncodings++] = preferredEncoding;\n\t//failback encoding priorities\n \t encodings[nEncodings++] = RfbProto.EncodingHextile;\n \t encodings[nEncodings++] = RfbProto.EncodingZlib;\n \t encodings[nEncodings++] = RfbProto.EncodingCoRRE;\n \t encodings[nEncodings++] = RfbProto.EncodingRRE;\n\t//default compression level\n\t\tcompressLevel = viewer.setCompression;\n\t\tif (compressLevel != 0) \n\t\t encodings[nEncodings++] = RfbProto.EncodingCompressLevel0 + compressLevel;\n \t\telse //lowest compression setting disables compression\n\t\t compressLevel = -1;\n //default image quality\n\t //note this relies on using tight encoding as prefered (which is currently statically set)\n\t\tjpegQuality = viewer.setQuality;\n\t\tencodings[nEncodings++] = RfbProto.EncodingQualityLevel0 + jpegQuality;\n // Request cursor shape updates if necessary.\n requestCursorUpdates = true;\n encodings[nEncodings++] = RfbProto.EncodingXCursor;\n encodings[nEncodings++] = RfbProto.EncodingRichCursor;\n ignoreCursorUpdates = false;\n\t// remaining encoding settings - (im not sure what these do :-( )\n\t encodings[nEncodings++] = RfbProto.EncodingPointerPos; //this may be removed if the cursor is hidden but it does no real harm\n \t encodings[nEncodings++] = RfbProto.EncodingLastRect;\n \t encodings[nEncodings++] = RfbProto.EncodingNewFBSize;\n\t//color level settings\n\t eightBitColors = false; //8bit sux\n\t//reverseMouseButtons2And3 setting\n\t reverseMouseButtons2And3 = false;\n\t//viewOnly off\n\t viewOnly = false; //statically disabled - may be added in based on passed parameter\n\t//shareDesktop on\n\t shareDesktop = true;\t//their is no good reason to turn this off\n\t//debuging data dump\n\t\n /* System.out.println(\"encodings array\\n------------\");\n\tfor (int x=0; x < 20; x++) {\n\t\tSystem.out.println(x+\": \"+encodings[x]);\n\t}\n\tSystem.out.println(\"nEncodings: \"+nEncodings); \n\tSystem.out.println(\"compressLevel: \"+compressLevel);\n\tSystem.out.println(\"jpegQuality: \"+jpegQuality); \n\tSystem.out.println(\"Flags\\n------------\");\n\tSystem.out.println(\"eightBitColors: \"+(eightBitColors?\"True\":\"False\"));\n\tSystem.out.println(\"requestCursorUpdates: \"+(requestCursorUpdates?\"True\":\"False\"));\n\tSystem.out.println(\"ignoreCursorUpdates: \"+(ignoreCursorUpdates?\"True\":\"False\"));\n\tSystem.out.println(\"reverseMouseButtons2And3: \"+(reverseMouseButtons2And3?\"True\":\"False\"));\n\tSystem.out.println(\"shareDesktop: \"+(shareDesktop?\"True\":\"False\"));\n\tSystem.out.println(\"viewOnly: \"+(viewOnly?\"True\":\"False\"));\n*/\n\t//end of debug\n\n\t viewer.setEncodings(); //apply encodings array changes to the canvas via the viewer function\n\n}",
"public CodecOptions(CodecOptions options) {\n if (options != null) {\n this.width = options.width;\n this.height = options.height;\n this.channels = options.channels;\n this.bitsPerSample = options.bitsPerSample;\n this.littleEndian = options.littleEndian;\n this.interleaved = options.interleaved;\n this.signed = options.signed;\n this.maxBytes = options.maxBytes;\n this.previousImage = options.previousImage;\n this.lossless = options.lossless;\n this.colorModel = options.colorModel;\n this.quality = options.quality;\n this.tileWidth = options.tileWidth;\n this.tileHeight = options.tileHeight;\n this.tileGridXOffset = options.tileGridXOffset;\n this.tileGridYOffset = options.tileGridYOffset;\n }\n }",
"public void settings() {\r\n\t\tsize(SCREEN_SIZE, SCREEN_SIZE);\r\n\t\tsmooth(2);\r\n\r\n\t}",
"void setUseEncoderMode() {\n motorLeft.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorRight.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }",
"private void configurarCodec(){\n\n\t\t// Necessario para utilizar o Processor como um Player.\n\t\tprocessor.setContentDescriptor(null);\n\n\n\t\tfor (int i = 0; i < processor.getTrackControls().length; i++) {\n\n\t\t\tif (processor.getTrackControls()[i].getFormat() instanceof VideoFormat) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Instantiate and set the frame access codec to the data flow path.\n\t\t\t\t\tTrackControl videoTrack = processor.getTrackControls()[i];\n\t\t\t\t\tCodec codec[] = { new CodecVideo() };\n\t\t\t\t\tvideoTrack.setCodecChain(codec);\n\t\t\t\t\tbreak;\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\n\t\tprocessor.prefetch();\n\n\t}",
"public void set_standard_format () {\n\t\tf_friendly_format = false;\n\n\t\tmainshock_time = 0L;\n\t\tmainshock_mag = 0.0;\n\t\tmainshock_lat = 0.0;\n\t\tmainshock_lon = 0.0;\n\t\tmainshock_depth = 0.0;\n\n\t\treturn;\n\t}",
"public String getVideoPreset();",
"void setVideoResolution(Resolution resolution);",
"public void setVideoOutEnabled(boolean enabled)\n {\n final String funcName = \"setVideoOutEnabled\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"enabled=%s\", Boolean.toString(enabled));\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n videoOutEnabled = enabled;\n }",
"private void setOutputFormatSize(Dimension size) {\n\t\tVideoFormat outputFormat = (VideoFormat) getOutputFormat();\n\n\t\tif (outputFormat != null) {\n\t\t\toutputFormat = setSize(outputFormat, size);\n\t\t\tif (outputFormat != null) {\n\t\t\t\tsetOutputFormat(outputFormat);\n\t\t\t}\n\t\t}\n\t}",
"gov.nasa.gsfc.spdf.ssc.OutputOptions getOutputOptions();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset Card related Transactions for specific customer | @ApiOperation(value = "Update Payee Response for specific users")
@PostMapping(value = "/init/{customerId}/cards/transactions", consumes = {"application/json"})
public ResponseEntity<String> resetCardTransactionsResponse(
@RequestBody Map<String, CardTransactionsResponse> cardTransactionsResponseMap,
@PathVariable(name = "customerId", required = true) String customerId,
@PathVariable(name = "accountId", required = true) String accountId) {
ApplicationLogger.logInfo("Updating card response...", this.getClass());
CoreBankingModel coreBankingModel = coreBankingService.getCoreBankingModel(customerId);
coreBankingModel.setCardTransactionsResponse(cardTransactionsResponseMap);
coreBankingService.saveCoreBankingModel(coreBankingModel);
String response = "Re-initialised card response successfully";
return ResponseEntity.ok(response);
} | [
"public void clearCustomer()\n\t{\n\t\tcustomer = null;\n\t}",
"public void resetChange(){\n\t\tCustomerPanel custPanel=txCtrl.getCustomerPanel();\n\t\tif(custPanel!=null){\n\t\t\tcustPanel.resetChange();\n\t\t}\n\t}",
"void unsetCustomerParameters();",
"void unsetSettlementAmount();",
"public void clearCashAdvanceCustomerIdentification() {\n genClient.clear(CacheKey.cashAdvanceCustomerIdentification);\n }",
"@ApiOperation(value = \"Update accounts transactions Response for specific users\")\n @PostMapping(value = \"/init/{customerId}/accounts/transactions\", consumes = {\"application/json\"})\n public ResponseEntity<String> resetAccountTransactionsResponse(\n @RequestBody Map<String, AccountTransactionsResponse> accountTransactionsResponseMap,\n @PathVariable(name = \"customerId\", required = true) String customerId,\n @PathVariable(name = \"accountId\", required = true) String accountId) {\n ApplicationLogger.logInfo(\"Updating account transactions response...\", this.getClass());\n CoreBankingModel coreBankingModel = coreBankingService.getCoreBankingModel(customerId);\n coreBankingModel.setAccountTransactionsResponse(accountTransactionsResponseMap);\n coreBankingService.saveCoreBankingModel(coreBankingModel);\n String response = \"Re-initialised account response successfully!\";\n return ResponseEntity.ok(response);\n }",
"void unsetCreditAmount();",
"public void resetCharges() {\n\t\tthis.serviceFee = 0;\n\t\tthis.activityUnits = 0;\n\t}",
"private void endCustomer(MyCustomer customer){ \n\tDo(\"Table \" + customer.tableNum + \" is cleared!\");\n\thost.msgTableIsFree(customer.tableNum);\n\tcustomers.remove(customer);\n\tstateChanged();\n }",
"public void checkout(Customer customer, Order order){\n final int cost = order.getCost();\n if(customer.charge(cost)){\n inventory.remove(order.size());\n }\n }",
"public void clearCustomerChangeFlag() {\n\n\t\tsoldToCodeSearch = false;\n\t\tshipToCodeSearch = false;\n\t\tendCustomerCodeSearch = false;\n\t\tsoldToCodeItemSearch = 0;\n\t\tshipToCodeItemSearch = 0;\n\t\tendCustomerCodeItemSearch = 0;\n\t\tresetCustomerSearch();\n\n\t\t// logger.log(Level.INFO,\n\t\t// \"PERFORMANCE END - clearCustomerChangeFlag()\");\n\t}",
"@Test\n public void resetTest() {\n\n Match match = new Match();\n VirtualView virtualView = new VirtualView(new Server());\n SingleActionManager singleActionManager = new SingleActionManager(match, virtualView, new TurnManager(match, virtualView));\n Payment payment = new Payment(match, virtualView, singleActionManager);\n\n payment.reset();\n\n assertNull(payment.getLeftCost());\n assertNull(payment.getInitialCost());\n List<Powerup> powerups = new ArrayList<>();\n assertEquals(powerups, payment.getSelectedPowerups());\n assertNull(payment.getUsablePowerup());\n }",
"void unsetDebitAmount();",
"public void customerDone(Customer customer) {\r\n\r\n //invokes set methods\r\n setCustomerServiced(1);\r\n setCustomerWaiting(-1);\r\n\r\n //counts average waiting time\r\n double avgWaitingTime = customer.getCheckOutDoneTime() - customer.getShoppingDoneTime()\r\n - ((customer.getNumberOfItems() * checkOutTimePerItem) + timeToProcessCustomerPayment);\r\n\r\n //set average waiting time to running total time of processed customer \r\n setRunningTotalTimeOfProcessedCustomer(avgWaitingTime);\r\n\r\n //removes the customer from the list\r\n lineList.remove(customer);\r\n\r\n System.out.println(customer.toString());\r\n\r\n }",
"void unsetSettlement();",
"private void add_customer_resetMouseClicked(java.awt.event.MouseEvent evt)\n {\n reset_customer_form();\n }",
"private void removeCustomer(){\n System.out.println(\"cashpoint \" + id + \" processed customer \" + queue.get(0).getId());\n System.out.println(\"customer \" + queue.get(0).getId() + \" pays \" + queue.get(0).getBill() + \"€\");\n Balance.getInstance().addValue(this.id, queue.get(0).getBill());\n queue.remove(0);\n System.out.println(getQueueSize() + \" customers at cashpoint \" + id);\n }",
"public void deAuthenticateCustomer() {\n this.currentCustomerAuthenticated = false;\n this.currentCustomer = null;\n }",
"public com.diviso.graeshoppe.order.avro.Order.Builder clearCustomerId() {\n customerId = null;\n fieldSetFlags()[1] = false;\n return this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an entity ID from a UTF8 text Kiji row key. | public EntityId fromKijiRowKey(String text) {
return fromKijiRowKey(Bytes.toBytes(text));
} | [
"public abstract EntityId fromKijiRowKey(byte[] kijiRowKey);",
"public abstract EntityId fromHBaseRowKey(byte[] hbaseRowKey);",
"public abstract String generateFirstRowKey(final long id);",
"private NodeIdentifier getKeyFromDatabaseEntry(DatabaseEntry keyEntry)\n\t\t\tthrows IOException {\n\t\tbyte[] keyData = keyEntry.getData();\n\t\tIWritable.DataIn keyDataIn = new IWritable.DataIn.Impl(new DataInputStream(\n\t\t\t\tnew ByteArrayInputStream(keyData)), 0);\n\t\t// once we read this indentifir the dataIn cursor is no longer in location 0.\n\t\tlong indentifier = keyDataIn.readLong();\n\t\t// this is called a second time in order to use it in the \n\t\t// NodeIdentifier constructor, we need to have the cursor on location 0.\n\t\tkeyDataIn = new IWritable.DataIn.Impl(new DataInputStream(\n\t\t\t\tnew ByteArrayInputStream(keyData)), 0);\n\n\t\tNodeIdentifier key = new NodeIdentifier(indentifier, keyDataIn);\n\t\treturn key;\n\t}",
"public TSRowKeyToTSUID() {\n\t\t\tsuper(PVarchar.INSTANCE, \"TSUID\");\n\t\t}",
"String createIdStringPart();",
"protected String createPKString(DbEntity entity) {\n List pk = entity.getPrimaryKey();\n\n if (pk == null || pk.size() == 0) {\n throw new CayenneRuntimeException(\n \"Entity '\" + entity.getName() + \"' has no PK defined.\");\n }\n\n StringBuffer buffer = new StringBuffer();\n buffer.append(\"CREATE PRIMARY KEY \").append(entity.getName()).append(\" (\");\n\n Iterator it = pk.iterator();\n\n // at this point we know that there is at least on PK column\n DbAttribute firstColumn = (DbAttribute) it.next();\n buffer.append(firstColumn.getName());\n\n while (it.hasNext()) {\n DbAttribute column = (DbAttribute) it.next();\n buffer.append(\", \").append(column.getName());\n }\n\n buffer.append(\")\");\n return buffer.toString();\n }",
"EntityKey getEntityKey();",
"public void testEntityKey() {\r\n\t\tEntityKey input = new EntityKey();\r\n\t\tinput.setEntityId(new Long(1));\r\n\t\tinput.setEntityType(\"Album\");\r\n\t\tinput.setUserId(new Long(50));\r\n\t\t\r\n\t\tHashtable<String, Object> hash = new Hashtable<String, Object>();\r\n\t\thash.put(\"entityid\", input.getEntityId());\r\n\t\thash.put(\"userid\", input.getUserId());\r\n\t\thash.put(\"entitytype\",input.getEntityType());\r\n\t\tinput.getType();\r\n\r\n\t\tEntityKey output = new EntityKey();\r\n\t\toutput.createFromHashtable(hash);\r\n\t\t\r\n\t\tassertEquals(BaseDataType.ENTITY_KEY_DATATYPE, output.getType());\r\n\t\tassertEquals(input.mEntityId, output.mEntityId);\r\n\t\tassertEquals(input.mEntityType, output.mEntityType);\r\n\t}",
"java.lang.String getKeyId();",
"PrimaryKey createPrimaryKey();",
"public TSRowKeyToBytes() {\n\t\t\tsuper(PVarbinary.INSTANCE, \"TSUIDBYTES\");\n\t\t}",
"protected ElementId getId(Row row) {\n return getElementId(row.getAs(ParquetConstants.IDENTIFIER));\n }",
"public static EntityIdFactory create(RowKeyFormat format) {\n Preconditions.checkNotNull(format);\n switch (format.getEncoding()) {\n case RAW:\n return new RawEntityIdFactory(format);\n case HASH:\n return new HashedEntityIdFactory(format);\n case HASH_PREFIX:\n return new HashPrefixedEntityIdFactory(format);\n default:\n throw new RuntimeException(String.format(\"Unknown row key format: '%s'.\", format));\n }\n }",
"public abstract String generateLastRowKey(final long id);",
"java.lang.String getKeyUid();",
"public EntityIdFactory(RowKeyFormat format) {\n mFormat = Preconditions.checkNotNull(format);\n }",
"long getLetterId();",
"public static IndexKey ofEntity(Object entity) {\n IndexKey indexKey = new IndexKey();\n indexKey.key = EntityValues.getId(entity) != null ? EntityValues.getId(entity) : entity;\n return indexKey;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The goal of this interface is to declare the required getters and setters the target class needs to implement. This will enable the class to be able to store the secrets in Sources, and to pull the secrets from it. | public interface SourcesSecretable {
/**
* Get the contents of the secret token.
* @return the contents of the secret token.
*/
String getSecretToken();
/**
* Set the contents of the secret token.
* @param secretToken the contents of the secret token.
*/
void setSecretToken(String secretToken);
/**
* Get the ID of the "secret token" secret stored in Sources.
* @return the ID of the secret.
*/
Long getSecretTokenSourcesId();
/**
* Set the ID of the "secret token" secret stored in Sources.
* @param secretTokenSourcesId the ID of the secret.
*/
void setSecretTokenSourcesId(Long secretTokenSourcesId);
/**
* Get the basic authentication object.
* @return the basic authentication object.
*/
BasicAuthentication getBasicAuthentication();
/**
* Set the basic authentication object.
* @param basicAuthentication the basic authentication object to be set.
*/
void setBasicAuthentication(BasicAuthentication basicAuthentication);
/**
* Get the ID of the "basic authentication" secret stored in Sources.
* @return the ID of the secret.
*/
Long getBasicAuthenticationSourcesId();
/**
* Set the ID of the "basic authentication" secret stored in Sources.
* @param basicAuthenticationSourcesId the ID of the secret.
*/
void setBasicAuthenticationSourcesId(Long basicAuthenticationSourcesId);
} | [
"public interface BaseCredentialsProvider {\n}",
"public interface ConfigSource\n{\n\t/**\n\t * Get the properties that this source has available.\n\t *\n\t * @return\n\t */\n\tMapIterable<String, Object> getProperties();\n\n\t/**\n\t * Get the keys that are available directly under the given path.\n\t *\n\t * @param path\n\t * @return\n\t */\n\tRichIterable<String> getKeys(@NonNull String path);\n\n\t/**\n\t * Attempt to get a value from this source. This is expected to only return\n\t * wrapped primitives, {@link String} or {@code null} if the value is not\n\t * available.\n\t *\n\t * @param path\n\t * @return\n\t */\n\tObject getValue(String path);\n}",
"public interface DBCredentials {\n\t\t\n\t// JDBC driver name and database URL\n static final String JDBC_DRIVER = \"com.mysql.cj.jdbc.Driver\"; \n static final String DB_URL = \"jdbc:mysql://localhost/mydb\";\n\n // Database credentials\n static final String USERNAME = \"root\";\n static final String PASSWORD = \"#MoshiBae0w0\";\n}",
"public interface IPSSecretKey extends IPSKey\n{\n /**\n * Get the number of bits required for this secret key.\n *\n * @return the number of bits to use in setSecret\n */\n public int getSecretSizeInBits();\n\n\n /**\n * Set the secret to the specified byte array. It must have the\n * appropriate number of bytes to match the bit count returned by\n * getSecretSizeInBits.\n *\n * @param secret the secret to use to generate the key\n *\n * @throws IllegalArgumentException if the secret is invalid for this object\n */\n public void setSecret(byte[] secret) throws IllegalArgumentException;\n\n\n}",
"public interface Protector {\r\n\r\n String protectedValue(String value) throws ConfigProtectException;\r\n\r\n String plainValue(String value) throws ConfigProtectException, ConfigProtectKeyException;\r\n\r\n boolean isProtected(String value) throws ConfigProtectException;\r\n\r\n boolean setKey(File file) throws ConfigProtectException, IOException;\r\n\r\n void setKey(String key);\r\n\r\n}",
"public interface ApiKey {\n\n /**\n * Returns the public unique identifier. This can be publicly visible to anyone - it is not\n * considered secure information.\n *\n * @return the public unique identifier.\n */\n String getId();\n\n /**\n * Returns the raw SECRET used for API authentication. <b>NEVER EVER</b> print this value anywhere\n * - logs, files, etc. It is TOP SECRET. This should not be publicly visible to anyone other\n * than the person to whom the ApiKey is assigned. It is considered secure information.\n *\n * @return the raw SECRET used for API authentication.\n */\n String getSecret();\n\n}",
"public interface Credential {\n}",
"public AccountKeyDatastoreSecrets() {\n }",
"private SecretManagerSource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public interface DatabaseSecretProperties extends VaultSecretBackendDescriptor {\n\n\t/**\n\t * Role name.\n\t * @return the role name\n\t */\n\tString getRole();\n\n\t/**\n\t * Whether the configuration uses static roles.\n\t * @return {@literal true} if the configuration uses static roles.\n\t * @since 2.2\n\t */\n\tboolean isStaticRole();\n\n\t/**\n\t * Backend path.\n\t * @return the backend path.\n\t */\n\tString getBackend();\n\n\t/**\n\t * @return name of the target property for the obtained username.\n\t */\n\tString getUsernameProperty();\n\n\t/**\n\t * @return name of the target property for the obtained password.\n\t */\n\tString getPasswordProperty();\n\n}",
"interface WithProperties {\n /**\n * Specifies properties.\n * @param properties Properties of the secret\n * @return the next definition stage\n */\n WithCreate withProperties(SecretProperties properties);\n }",
"public interface PropertyStorage {\n\n\t/**\n\t * retrieve proerty value from storage service.\n\t * This interface does not need to pay attention for \n\t * @param name the property to retrieve\n\t * @return the value of the property or null, if it doesn't exist\n\t */\n\tpublic <T, U> T get(Property<T, U> name);\n\t\n\t/**\n\t * This method initializes the storage service and is called before\n\t * any calls to get and put.\n\t */\n\tpublic void init();\n}",
"public Secret() {\n\n\t}",
"public interface Credentials extends Serializable {\n /**\n * Returns the authentication type.\n * Pravega can support multiple authentication types in a single deployment.\n *\n * @return the authentication type expected by the these credentials.\n */\n String getAuthenticationType();\n\n /**\n * Returns the authorization token to be sent to Pravega.\n * @return A token in token68-compatible format (as defined by RFC 7235).\n */\n String getAuthenticationToken();\n}",
"public interface Source<T> extends Serializable {\n void setup(Context context);\n Collection<T> get();\n void cleanup();\n}",
"public interface IClient\n{\n\n /** \n * Sets the address and port of the server.\n * \n * @param host IServer - holds host address and port\n * @throws Exception for any errors\n */\n public void setServer(IServer host) throws Exception;\n\n /** \n * Sets the logOn credentials to be used to access the server.\n * \n * @param credentials ICredentials - holds logInUser and Password\n * @throws Exception for any errors\n */\n public void setCredentials(ICredentials credentials) throws Exception;\n\n}",
"public interface DataSource extends ModelEntity, Buildable<DataSourceBuilder> {\n\n /**\n * @return the description of the data source\n */\n String getDescription();\n\n /**\n * @return the URL of the data source\n */\n String getURL();\n\n /**\n * @return the tenant id of the data source\n */\n String getTenantId();\n\n /**\n * @return the created date of the data source\n */\n Date getCreatedAt();\n\n /**\n * @return the updated date of the data source\n */\n Date getUpdatedAt();\n\n /**\n * @return the type of the data source\n */\n String getType();\n\n /**\n * @return the identifier of the data source\n */\n String getId();\n\n /**\n * @return the name of the data source\n */\n String getName();\n\n /**\n * @return the credentials of the data source\n */\n DataSourceCredentials getCredentials();\n}",
"SecretsClient getSecrets();",
"public interface StrengthVarManager {\r\n\r\n /**\r\n * Replaces the actual variables with the ones from the file.\r\n * \r\n * @param file the file from which to load the variables.\r\n */\r\n public void load(File file);\r\n\r\n /**\r\n * @return all the actually available variables\r\n */\r\n public StrengthVarSet getStrengthVarSet();\r\n\r\n /**\r\n * add a listener\r\n * \r\n * @param listener the listener to add\r\n */\r\n public void addListener(StrengthVarManagerListener listener);\r\n\r\n /**\r\n * remove a listener\r\n * \r\n * @param listener the listener to remove\r\n */\r\n public void removeListener(StrengthVarManagerListener listener);\r\n\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get the next Cartesian combination of indices for inputs. Return true if a new Cartesian combination of indices exists and false otherwise. | private boolean nextIndices(List<List<T>> inputs, List<Integer> indices) {
// First iteration, initialize each index to zero
if (indices.isEmpty()) {
for (int i=0; i<inputs.size(); i++) {
indices.add(0);
}
return true;
}
// Not first iteration, calculate next Cartesian product of indices
for (int i=(inputs.size()-1); i>=0; i--) {
List<T> input = inputs.get(i);
int nextIndex = (indices.get(i)+1) % input.size();
indices.set(i, nextIndex);
// Only want to increment one index per call, if nextIndex is greater
// than zero, that has already happened so just return true
if (nextIndex>0) { return true; }
}
// None of the indices incremented, return false
return false;
} | [
"private void checkIfHasNextCartesianProduct() {\n nextIndex = vectorSize - 1;\n while (nextIndex >= 0 &&\n indices[nextIndex] + 1 >= vector.get(nextIndex).size()) {\n nextIndex--;\n }\n }",
"@Override\n public List<T> next() {\n if (index == 0) {\n return generateCartesianProduct();\n }\n\n if (nextIndex < 0) {\n throw new RuntimeException(\"No more cartesian product.\");\n }\n\n // Move to the next element\n indices[nextIndex]++;\n\n for (int i = nextIndex + 1; i < vectorSize; i++) {\n indices[i] = 0;\n }\n\n return generateCartesianProduct();\n }",
"public boolean hasMoreCombination() {\n\t\treturn cursor < combos.length;\n\t}",
"public boolean combinationIsAble() {\n\t\t\n \tMap<String, Integer> candyQuantity = LittleRedRidingHood.getCandyQuantities();\n \tint totalCandies = 0, total;\n \tboolean isEmpty = true;\n \t\n \tIterator<Entry<String, Integer>> cqIterator = candyQuantity.entrySet().iterator();\n\t\twhile(cqIterator.hasNext()){\n\t\t\t\n\t\t\tEntry<String, Integer> entry = cqIterator.next();\n\t\t\ttotalCandies += entry.getValue();\n\t\t}\n \t\n\t\ttotal = totalCandies;\n\t\t\n\t\tfor(int i = 0; i < candies.length; i++)\n\t\t\tif(getCandy(i) == 1){\n \t\t\tisEmpty = false;\n \t\t\tbreak;\n\t\t\t}\n\t\t\n \tfor(int i = 0; i < getCandies().size(); i++) {\n \t\t\n \t\t// To avoid \"candy debt\"\n \t\tif((candyQuantity.get(getCandies().get(i)) - 1) < 0)\n \t\t\treturn false;\n \t\ttotalCandies--;\n \t}\n \t\n \t// To avoid combination of no candy used or using more candies that we have\n \t// or to avoid possibility of ending in a zone with just 1 candy (infinite loop)\n \tif((totalCandies < 1) || isEmpty || (total - totalCandies >= 4))\n \t\treturn false;\n \t\n\t\treturn true;\n\t}",
"public boolean copperConnected() {\n boolean[] marked = new boolean[this.V];\n marked = copperConnected(0, marked);\n int i = 0;\n for(boolean bool: marked) {\n if( !bool ) return false;\n }\n return true;\n }",
"public int[][] nextGen() {\n for (int row = 1; row < map.length - 1; row++)\n for (int col = 1; col < map.length - 1; col++) {\n if (checkMid(row, col) == 3 && map[row][col] == 0)\n tmpMap[row][col] = 1;\n else if ((checkMid(row, col) == 2 || checkMid() == 3) && map[row][col] == 1)\n tmpMap[row][col] = 1;\n else\n tmpMap[row][col] = 0;\n }\n //prepare next generation in left and right part of the map\n for (int col = 0; col < map.length; col = col + map.length - 1)\n for (int row = 1; row < map.length - 1; row++)\n killSides(row, col);\n //prepare next generation in bottom and top part of the map\n for (int row = 0; row < map.length; row = row + map.length - 1)\n for (int col = 1; col < map.length - 1; col++)\n killSides(row, col);\n //prepare next generation in corners of the map\n for (int row = 0; row < map.length; row = row + map.length - 1)\n for (int col = 0; col < map.length; col = col + map.length - 1) {\n if (checkCorners(row, col) == 3 && map[row][col] == 0)\n tmpMap[row][col] = 1;\n else if ((checkCorners(row, col) == 2 || checkCorners() == 3) && map[row][col] == 1)\n tmpMap[row][col] = 1;\n else\n tmpMap[row][col] = 0;\n }\n return tmpMap;\n }",
"private void generateCombination(int input[], int start, int pos, List<Set<Integer>> allSets, int result[]) {\n\t\tif(pos == input.length) {//si se llega al inicio entonces nos salimos de la funcion\n\t\t\treturn;\n\t\t}\n\t\tSet<Integer> set = createSet(result, pos);//cremos el conjunto para eso entramos al funcion crear conjunto\n\t\tallSets.add(set);//agremaos el conjubto creado\n\t\tfor(int i=start; i < input.length; i++) {//iteramos del inicio hata el tamano del arreglo input\n\t\t\tresult[pos] = input[i];//\n\t\t\tgenerateCombination(input, i+1, pos+1, allSets, result);//volvemoa entrar para seguir genrando los conjuntos\n\t\t}\n\t}",
"private void checkCombination(int[] indexArr){\n for(int j = 0; j < indexArr.length; j++){\n if(indexArr[j] >= numOfItems) //if index value greater than number of items exit\n return;\n }\n\n for(int i = 0; i < indexArr.length; i++) { \n for(int j = i + 1; j < indexArr.length; j++) { \n if(indexArr[i] == indexArr[j]){ //if the same index is duplicated exit, can't use same element twice (won't happen with our combos but safety net)\n return; \n }\n } \n } \n\n String myItems[][] = new String[number][categories.length]; //creates an empty 2D array the size of the furniture pieces and # of items requested to know whether the combo is sucesfful\n\n for(int num = 0; num < number; num++){\n for(int cat = 0; cat < myItems[0].length; cat++){\n myItems[num][cat] = \"N\"; //default nothing has been added all furniture items are N\n }\n }\n \n for(int j = 0; j < indexArr.length; j++){\n for(int category = 0; category < myItems[0].length; category++){\n for(int num = 0; num < number; num++){ //go down the category to fulfill other orders if ones before already Y for that furniture piece\n if(myItems[num][category].equals(\"N\")){\n myItems[num][category] = typeAvailable[indexArr[j]][category]; //copies in the Y and N values at the given index to our items array to see if can fill up the whole thing with Y\n break;\n }\n }\n }\n }\n\n if(comboFound(myItems)){ //if our array is all Y, sucesfull combo!\n this.fulfilled = true;\n Integer price = 0;\n\n for(int i = 0; i < indexArr.length; i++){\n price += Integer.parseInt(itemsAvailablePrice[indexArr[i]]); //set temp price variable as addition of all prices at inputed index\n }\n\n if(this.cheapestPrice == 0){ //no other combo has been sucesfull previously\n this.cheapestPrice = price; //set private variable cheapestPrice to temporary price\n int j = 0;\n this.itemCombination = new String[indexArr.length];\n for(int i = 0; i < indexArr.length; i++){ \n this.itemCombination[j] = itemIds[indexArr[i]]; //set itemCombination array to the IDs at inputed index\n j++;\n } \n } else if(this.cheapestPrice > price){ //another combo was sucesfull but our price is cheaper\n this.cheapestPrice = price;\n int j = 0;\n this.itemCombination = new String[indexArr.length];\n for(int i = 0; i < indexArr.length; i++){\n this.itemCombination[j] = itemIds[indexArr[i]];\n j++;\n } \n } \n }\n \n }",
"public static boolean isConnectedAndAcyclic(int[] parents) {\n int numVisited = 0;\n // 1-indexed array indicating whether each node (including the wall at position 0) has been visited.\n boolean[] visited = new boolean[parents.length+1];\n Arrays.fill(visited, false);\n // Visit the nodes reachable from the wall in a pre-order traversal.\n IntStack stack = new IntStack();\n stack.push(-1);\n while (stack.size() > 0) {\n // Pop off the current node from the stack.\n int cur = stack.pop();\n if (visited[cur+1] == true) {\n continue;\n }\n // Mark it as visited.\n visited[cur+1] = true;\n numVisited++;\n // Push the current node's unvisited children onto the stack.\n for (int i=0; i<parents.length; i++) {\n if (parents[i] == cur && visited[i+1] == false) {\n stack.push(i);\n }\n }\n }\n return numVisited == parents.length + 1;\n }",
"private boolean checkDiag(IntUnaryOperator diag) {\n return IntStream.range(0, positions.size()).map(diag).distinct().count() == positions.size();\n }",
"public boolean circularArrayLoop(int[] nums) {\n boolean found = false;\n for ( int i=0; i<nums.length; i++ ) {\n Integer ps = i;\n Integer pf = next(nums, 0, i);\n int dir = nums[i];\n while ( ps != null && pf != null && ps != pf ) {\n ps = next(nums, dir, ps);\n pf = next(nums, dir, next(nums, dir, pf));\n }\n if ( ps != null && ps == pf ) {\n found = true;\n break;\n }\n }\n return found;\n }",
"public boolean hasNextSet() {\n return (firstIndexOfCurrentSet + increment <= lastIndex);\n }",
"public List<List<T>> cartesianProduct(List<List<T>> inputs) throws CartesianProductException {\n \n if (inputs==null || inputs.isEmpty()) {\n \n throw new CartesianProductException(\"inputs List cannot be null or empty\");\n }\n \n for (List<T> input : inputs) {\n \n if (input==null || input.isEmpty()) {\n \n throw new CartesianProductException(\"inputs cannot contain null or empty List\");\n }\n }\n \n List<Integer> indices = new ArrayList<>();\n \n List<List<T>> outputs = new ArrayList<>();\n\n while (nextIndices(inputs, indices)) {\n \n List<T> output = new ArrayList<>();\n \n for (int i=0; i<inputs.size(); i++) {\n \n output.add(inputs.get(i).get(indices.get(i)));\n }\n \n outputs.add(output);\n }\n \n return outputs;\n }",
"private void genCombinations(int[] input, int start, int index, int[] combos) {\n if (index == input.length) {\n return;\n }\n addCombo(combos, index);\n for (int i = start; i < input.length; i++) {\n combos[index] = input[i];\n genCombinations(input, i+1, index+1, combos);\n }\n }",
"public List<T> determineNextCombination() {\r\n\t\tif (!this.isFirstCall) {\r\n\t\t\t// all combinations were calculated\r\n\t\t\tif (!this.isFurtherCombinationAvailable())\r\n\t\t\t\treturn null;\r\n\r\n\t\t\t// initialize data for state reconstruction\r\n\t\t\tthis.isReconstructionFinished = false;\r\n\r\n\t\t\tArrayList<Integer> tmpList = this.reconstructStateIndices;\r\n\t\t\ttmpList.clear();\r\n\r\n\t\t\tthis.reconstructStateIndices = this.currentStateIndices;\r\n\t\t\tthis.reconstructionDepth = this.currentDepth;\r\n\r\n\t\t\t// reset information about the new combination\r\n\t\t\tthis.currentStateIndices = tmpList;\r\n\t\t\tthis.currentDepth = -1;\r\n\t\t} else {\r\n\t\t\t// in case of the first call, we do not have to reconstruct anything\r\n\t\t\tthis.isFirstCall = false;\r\n\t\t}\r\n\r\n\t\tthis.reconstructAndDetermineNewCombination(0, 0);\r\n\t\tthis.nbOfCalculatedCombinations++;\r\n\r\n\t\treturn new ArrayList<T>(this.combination);\r\n\t}",
"default boolean isNext(int vidxa, int vidxb) {\n return findIndexOfNext(vidxa, vidxb) != -1;\n }",
"public boolean hasNext() {\n if (isBruteForce) {\n return (currentIndex < numEdges);\n } else {\n return currentIndexInCandidates < candidates.size();\n }\n }",
"boolean piecesContiguous(Side player) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n if (_pieces[i][j].side() == player) {\n boolean[][] traverse = new boolean[8][8];\n return getCount(player) == contiguousHelp(traverse, i,\n j, player);\n }\n }\n }\n\n }",
"public boolean isXsolution() {\n\t\tfor (int k=1; k<size*size; k++) {\n\t\t\tint count1 = 0;\n\t\t\tint count2 = 0;\n\t\t\tfor (int l=0; l<size*size; l++) {\n\t\t\t\tif (board[l][l]==k) count1++;\n\t\t\t\tif (board[l][size*size-l-1]==k) count2++;\n\t\t\t}\n\t\t\tif (count1!=1 || count2!=1) return false;\n\t\t}\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an instance of DevelopmentComponentUpdater. | public DevelopmentComponentUpdater(final String location, final DevelopmentComponentFactory dcFactory) {
this.location = location;
this.dcFactory = dcFactory;
} | [
"public DevelopmentComponentUpdater(final String location, final DevelopmentComponentFactory dcFactory) {\r\n this.dcFactory = dcFactory;\r\n antHelper = new AntHelper(location, dcFactory);\r\n }",
"public Updater()\n { \n }",
"Component createComponent();",
"public abstract PackageConfigurationUpdater createPackageConfigurationUpdater();",
"public long createNewVersionForDesignDevContest(TCSubject tcSubject, long projectId, long tcDirectProjectId,\r\n boolean autoDevCreating, boolean minorVersion) {\r\n throw new UnsupportedOperationException();\r\n }",
"Component getUpdatableComponent();",
"public void createComponent() {\n\t\tString cptFile = \"CreateEpt.cpt\";\n\t\tnew FileBootloader(this.m_Context).store(cptFile);\n\t\t\n\t\tthis.m_Component = new SComponent(\"create_ept\", \"creator\");\n\t\tthis.m_Endpoint = this.m_Component.addEndpoint(\"addept\", EndpointType.EndpointSink, \"E0D2B4C85BC6\");\n\t\t//this.m_Component.addRDC(\"192.168.0.3:50123\");\n\t\tthis.m_Component.start(this.m_Context.getFilesDir() + \"/\" + cptFile, 44440, false);\n\t\tthis.m_Component.setPermission(\"\", \"\", true);\n\t}",
"@Override\n public Component getInstance(ComponentDef def, Map<String, Object> attributes) throws QuickFixException {\n return new ComponentImpl(def.getDescriptor(), attributes);\n }",
"public static ProductUpdateBuilder of() {\n return new ProductUpdateBuilder();\n }",
"public SettingsUpdater newSettingsUpdater() {\n\t\tif (prototype == null) {\n\t\t\tprototype = new SettingsUpdater();\n\t\t}\n\t\tprototype.setEuclidianHost(app);\n\t\tprototype.setSettings(app.getSettings());\n\t\tprototype.setAppConfig(app.getConfig());\n\t\tprototype.setKernel(app.getKernel());\n\t\tprototype.setFontSettingsUpdater(getFontSettingsUpdater());\n\t\treturn prototype;\n\t}",
"public RigFirmwareUpdateManager() {\n \tinitStateVariables();\n }",
"ComponentService createComponentService();",
"private UpdateManager () {}",
"SchedulerBuilder() {\n try {\n schedulerClass = Class.forName(SimulatorProperties.getImplementation());\n } catch (ClassNotFoundException e) {\n Msg.critical(\"Scheduler class not found. Check the value simulator.implementation in the simulator properties file.\");\n System.err.println(e);\n System.exit(-1);\n }\n }",
"public TaxCategoryUpdate build() {\n Objects.requireNonNull(version, TaxCategoryUpdate.class + \": version is missing\");\n Objects.requireNonNull(actions, TaxCategoryUpdate.class + \": actions is missing\");\n return new TaxCategoryUpdateImpl(version, actions);\n }",
"public static TinyDP newDeploymentPackage()\n {\n return new TinyDPImpl( new DPBuilder(), null, new Bucket(), StoreFactory.defaultStore() );\n }",
"ComponentRefType createComponentRefType();",
"public void setViewServiceDevelopmentStatus(ComponentDevelopmentStatus viewServiceDevelopmentStatus)\n {\n this.viewServiceDevelopmentStatus = viewServiceDevelopmentStatus;\n }",
"public static void newUpdateScreen(){\n updater = new StatusUpdater(true);\n updater.setVisible(true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set shutdown flag Reject further work Call shutdown on thread pool Wait till queue is empty Exit then | public void shutdown(){
shutdown = true;
incomingElementsQueueExecutorService.shutdown();
} | [
"public void shutdown() {\n shutdown = true;\n for (Thread thread : threads) {\n thread.interrupt();\n }\n synchronized (tasksQueue) {\n try {\n while (!tasksQueue.isEmpty()) {\n PoolTask<?> task = tasksQueue.take();\n task.reject(new IllegalStateException(\"Shutdown happened. No more tasks accepted\"));\n }\n } catch (InterruptedException exception) {\n //We do not want to leave ThreadPool in inconsistent state\n throw new RuntimeException(\"Thread was interrupted during ThreadPool shutdown\", exception);\n }\n }\n }",
"public void shutdown() {\n running = false;\n synchronized (queue) {\n queue.notifyAll();\n }\n }",
"public void shutdown() {\n\t\tstageStatus = SHUTDOWN;\n\n\t\tif (inputQueue.size() <= 100 * processRate * currentPoolSize) {\n\t\t\t// We have only a small number of messages, we must wait until it's down.\n\t\t\t// We sleep as most 5 seconds.\n\t\t\tint i = 500;\n\t\t\twhile (i-- > 0) {\n\t\t\t\tThreadUtil.sleep(10);\n\t\t\t\tif (inputQueue.size() == 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Interrupt all the threads.\n @SuppressWarnings(\"unchecked\")\n LinkedList<Worker> clone = (LinkedList<Worker>) workerList.clone();\n\t\t\t// Signal all threads try to terminate.\n\t\t\tfor (Worker w : clone) {\n\t\t\t\tw.interrupt();\n\t\t\t}\n\t\t}\n\t}",
"public synchronized void shutdown() {\n\t\tthis.poolShutDownInitiated = true;\n\t\tSystem.out.println(\"ThreadPool SHUTDOWN initiated.\");\n\t}",
"public void shutdown() {\r\n\t\tifOpen = false;\r\n\t\tSystem.out.println(\"shutting down\");\r\n\t\tthis.pool.shutdown();\r\n\t\tSystem.out.println(\"waiting termination\");\r\n\t\ttry {\r\n\t\t\tthis.pool.awaitTermination(maxTime, TimeUnit.MILLISECONDS);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void shutdown(){\n if(!shutdownRequested){\n shutdownRequested = true;\n LOG.info(\"Shutting down queue {}_{}_{}\", fileNamePrefix, customerId, equipmentId);\n addToQueue(poisonPill); \n }\n }",
"protected void shutdown() {\n synchronized (this) {\n if (alive) {\n alive = false;\n requestQueue.close();\n interrupt();\n }\n\n try {\n join(1000);\n } catch (InterruptedException ignored) {\n }\n\n // notify all pending write requests that the thread has been shut down\n IOException ioex = new IOException(\"IO-Manager has been closed.\");\n\n while (!this.requestQueue.isEmpty()) {\n WriteRequest request = this.requestQueue.poll();\n if (request != null) {\n try {\n request.requestDone(ioex);\n } catch (Throwable t) {\n IOManagerAsync.LOG.error(\n \"The handler of the request complete callback threw an exception\"\n + (t.getMessage() == null\n ? \".\"\n : \": \" + t.getMessage()),\n t);\n }\n }\n }\n }\n }",
"void stopThreadPool() {\n\n if (!mThreadPoolExecutor.isShutdown()) {\n mThreadPoolExecutor.getQueue().clear();\n mThreadPoolExecutor.shutdown();\n\n new Thread(() -> {\n\n while (!mThread.isInterrupted() && mThread.isAlive()) {\n\n if (mThreadPoolExecutor.isShutdown() && mThreadPoolExecutor.isTerminated()) {\n mThread.interrupt();\n Log.d(TAG, \"Interrupting mThread - thread pool isShutdown\");\n }\n\n try {\n Thread.sleep(500L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n }).start();\n }\n }",
"public void shutdown() {\r\n\t\tpoolExecutor.shutdown();\r\n\t}",
"public void shutdown() {\n if (logger.isInfoEnabled()) {\n logger.info(\"Shutting down ThreadPoolExecutor\" + (this.beanName != null ? \" '\" + this.beanName + \"'\" : \"\"));\n }\n if (this.waitForTasksToCompleteOnShutdown) {\n this.threadPoolExecutor.shutdown();\n } else {\n this.threadPoolExecutor.shutdownNow();\n }\n }",
"protected void shutdown() {\n synchronized (this) {\n if (alive) {\n alive = false;\n requestQueue.close();\n interrupt();\n }\n\n try {\n join(1000);\n } catch (InterruptedException ignored) {\n }\n\n // notify all pending write requests that the thread has been shut down\n IOException ioex = new IOException(\"IO-Manager has been closed.\");\n\n while (!this.requestQueue.isEmpty()) {\n ReadRequest request = this.requestQueue.poll();\n if (request != null) {\n try {\n request.requestDone(ioex);\n } catch (Throwable t) {\n IOManagerAsync.LOG.error(\n \"The handler of the request complete callback threw an exception\"\n + (t.getMessage() == null\n ? \".\"\n : \": \" + t.getMessage()),\n t);\n }\n }\n }\n }\n }",
"public void shutdown() {\n lock.lock();\n try {\n state = State.SHUTDOWN;\n if (serialExecutorMap.isEmpty()) {\n executor.shutdown();\n }\n } finally {\n lock.unlock();\n }\n }",
"@Test\n\tpublic void ShutdownTest()\n\t{\n\t\tThreadPool testThreadPool = new ThreadPool(new SongValidator(),2,100);\n\t\ttestThreadPool.shutdown();\n\t\tassertTrue(testThreadPool.getAvailableExpirator()==null);\n\t}",
"private void shutdown() {\n if (executorService != null) {\n try {\n if (!ordered && executorService instanceof ThreadPoolExecutor) {\n // discard any tasks not yet executing\n ((ThreadPoolExecutor)executorService).getQueue().clear();\n }\n executorService.shutdown();\n continuousFailureDetector.stop();\n executorService.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS);\n executorService.shutdownNow();\n } catch (InterruptedException ex) {\n executorService.shutdownNow();\n Thread.currentThread().interrupt();\n }\n }\n }",
"private void finalShutdown() {\n log.info(\"Starting worker's final shutdown.\");\n\n if (executorService instanceof SchedulerCoordinatorFactory.SchedulerThreadPoolExecutor) {\n // This should interrupt all active record processor tasks.\n executorService.shutdownNow();\n }\n if (metricsFactory instanceof CloudWatchMetricsFactory) {\n ((CloudWatchMetricsFactory) metricsFactory).shutdown();\n }\n shutdownComplete = true;\n }",
"public void shutdown() {\n\t\tthis.executor.shutdown();\n\t}",
"public void forceShutdown() {\r\n\t\tpoolExecutor.shutdownNow();\r\n\t}",
"private void shutdown() {\n try {\n threadPool.shutdown();\n threadPool.awaitTermination(SimulationEngine.SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n threadPool.shutdownNow();\n }\n LOGGER.info(\"Shutdown complete\");\n }",
"public void shutdown()\n {\n shutdownInUseThreads();\n m_disposed = true;\n try\n {\n m_pool.close();\n }\n catch( final Exception e )\n {\n final String message = \"Error closing pool: \" + e;\n m_monitor.unexpectedError( message, e );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces the binding for the specified name in this registry with the supplied remote reference. If a previous binding for the specified name exists, it is discarded. | public void rebind(String name, Remote ref) throws RemoteException; | [
"public void bind(String name, Remote ref) throws RemoteException, AlreadyBoundException;",
"public void bindEjbReference(String referenceName, String jndiName) throws ConfigurationException;",
"public void rebind(String name, Object obj)\n throws NamingException, RemoteException {\n\n rootContext.rebind(name, obj);\n }",
"public void unbind(String name) throws RemoteException, NotBoundException;",
"public void bindEjbReferenceForEjb(String ejbName, String ejbType,\n String referenceName, String jndiName) throws ConfigurationException;",
"public void bindEjbReferenceForEjb(String ejbName, String ejbType,\n String referenceName, String jndiName) throws ConfigurationException;",
"public void xsetRefName(org.apache.xmlbeans.XmlString refName)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFNAME$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(REFNAME$0);\n }\n target.set(refName);\n }\n }",
"public void setRefName(java.lang.String refName)\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(REFNAME$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REFNAME$0);\n }\n target.setStringValue(refName);\n }\n }",
"void unbind(String name) throws Exception;",
"public void bindDatasourceReference(String referenceName, String jndiName) throws ConfigurationException;",
"public void unbind(Name name) throws NamingException {\n // Just use the string version for now.\n unbind(name.toString());\n }",
"public void yUnbind(String bind_name);",
"void setRef(java.lang.String ref);",
"@HTTP(\n method = \"PUT\",\n path = \"/apis/config.openshift.io/v1/networks/{name}\",\n hasBody = true\n )\n @Headers({ \n \"Content-Type: application/json\",\n \"Accept: */*\"\n })\n KubernetesCall<Network> replaceNetwork(\n @Path(\"name\") String name, \n @Body Network body);",
"public Binding removeBinding(QName name);",
"@HTTP(\n method = \"PUT\",\n path = \"/apis/config.openshift.io/v1/networks/{name}\",\n hasBody = true\n )\n @Headers({ \n \"Content-Type: application/json\",\n \"Accept: */*\"\n })\n KubernetesCall<Network> replaceNetwork(\n @Path(\"name\") String name, \n @Body Network body, \n @QueryMap ReplaceNetwork queryParameters);",
"public void bindDatasourceReferenceForEjb(String ejbName, String ejbType, \n String referenceName, String jndiName) throws ConfigurationException;",
"public final void setBundleRef(String varName)\n {\n _bundleRef = varName;\n }",
"@SuppressWarnings(\"unused\")\n private void unbindDynamicClassLoaderManager(final ServiceReference ref) {\n if (this.dynamicClassLoaderManager == ref) {\n this.dynamicClassLoaderManager = null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a bunch of visitors (Book, CD, and DVD) | public static void main(String[] args) {
Visitable myBook = new Book(8.52, 1.05);
Visitable myCD = new CD(18.52, 3.05);
Visitable myDVD = new DVD(6.53, 4.02);
// add each vistor to the array list
items.add(myBook);
items.add(myCD);
items.add(myDVD);
Visitor visitor = new USPostageVisitor();
double myPostage = calculatePostage(visitor);
System.out.println("The total postage for my items shipped to the US is: " + myPostage);
visitor = new SouthAmericaPostageVisitor();
myPostage = calculatePostage(visitor);
System.out.println("The total postage for my items shipped to South America is: " + myPostage);
} | [
"public void createAgents(int count) {\n for (int idx = 0; idx < count; ++idx) {\n Agent agent = new Agent(idx, 0);\n addAgent(agent);\n }\n }",
"private void createVehicles() {\n for (int i = 0; i < 10; i++) {\n vehicles.add(new Car());\n vehicles.add(new Truck());\n vehicles.add(new Motorcycle());\n }\n }",
"void inicializarVisitados();",
"public void createAll() {\n\t\t\n\t\tcreateDoctor(\"http://www.kh-hh.de/mio/practitioner\", \"1337\", \"Laser\", \n\t\t\t\t\"Eduard\", \"Geverdesstraße 9\", \"23554\", \"Lübeck\", AdministrativeGenderCodesEnum.M);\n\n\t\tcreateDoctor(\"http://www.kh-hh.de/mio/practitioner\", \"1338\", \"House\", \n\t\t\t\t\"Gregory\", \"221B Baker Street\", \"W1U\", \"London\", AdministrativeGenderCodesEnum.M);\n\t\n\t\tcreateDoctor(\"http://www.kh-hh.de/mio/practitioner\", \"1339\", \"Reid\", \n\t\t\t\t\"Elliot\", \"Burton St. 15\", \"90706\", \"Seattle\", AdministrativeGenderCodesEnum.F);\n\n\t\tcreateDoctor(\"http://www.kh-hh.de/mio/practitioner\", \"1340\", \"Grey\", \n\t\t\t\t\"Meredith\", \"201 S. Jackson St.\", \"98104\", \"Los Angeles\", AdministrativeGenderCodesEnum.F);\n\n\t\tcreateDoctor(\"http://www.kh-hh.de/mio/practitioner\", \"1341\", \"Dog\", \n\t\t\t\t\"Doc\", \"Hundestraße 12\", \"23552\", \"Lübeck\", AdministrativeGenderCodesEnum.UNK);\n\t}",
"@Override\n public void visitCreatedContents(ContentVisitor visitor) {\n DataStorage ds = DataStorage.getInstance();\n HashSet<Integer> visited = new HashSet<>();\n lectores.forEach((s) -> ds.getUser(s, (u) -> u.visitCreatedContents(visitor, visited)));\n }",
"void createEdges() {\n for (Vertex taxi : taxis) {\n for (Vertex person : people) {\n // If the travel time from the taxi to person is below the required tim\n // then the taxi can service the person.\n if (travelTime(taxi, person) <= timeToCollect) {\n // Taxi is able to service this person so add an edge between them\n taxi.adjList.add(person);\n person.adjList.add(taxi);\n }\n }\n }\n }",
"@PostMapping(\"/visitor\")\n @Timed\n public ResponseEntity<Visitor> createVisitor(HttpServletRequest requestContext) throws URISyntaxException {\n log.debug(\"REST request to create Visitor : {}\");\n Visitor visitor = new Visitor();\n visitor.setIp(requestContext.getRemoteAddr());\n visitor.setBrowser(requestContext.getHeader(\"User-Agent\"));\n Visitor result = visitorService.save(visitor);\n return ResponseEntity.created(new URI(\"/api/visitors/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }",
"public void createMovies() {\n\t\tfor(int i=1;i<=2071;i++) {\n\t\t\tMovies movie=new Movies(i);\n//\t\t\tcalculateMovieBaseImportance(movie);//former version\n\t\t\tmovies.add(movie);\n//\t\t\tevents.add(movie);//former version\n\t\t}\n\t}",
"private void createBookings(){\n\n Customer customer1 = customerRepo.list().get(2);\n Customer customer2 = customerRepo.list().get(3);\n Event event1 = eventRepo.list().get(1);\n Event event2 = eventRepo.list().get(3);\n\n Booking booking1 = new Booking(customer1, 1, event1);\n Booking booking2 = new Booking(customer1, 3, event2);\n Booking booking3 = new Booking(customer2, 2, event2);\n\n bookingRepo.add(booking1);\n bookingRepo.add(booking2);\n bookingRepo.add(booking3);\n }",
"public static void createVender() throws IOException {\n\t\tString name = names[random(50)] + \" \" + names[random(50)];\n\t\tvenders.add(vendId);\n\t\twriter.write(\"INSERT INTO Vender (Id, Name, Location) Values (\" + vendId++ +\", '\" + name + \"', '\" + streets[random(50)] + \"'\" + line);\n\t\twriter.flush();\n\t}",
"public PageVisits() {\n LOG.info(\"=========================================\");\n LOG.info(\"Page Visit Counter is being created\");\n LOG.info(\"=========================================\");\n }",
"void createByDirectories(){\n for(Directory dir:directories){\n this.createPageFromDirectory(dir);\n }\n }",
"private void createGraphs() {\n initialGraphCreation.accept(caller, listener);\n graphCustomization.accept(caller, listener);\n caller.generateAndAdd(params.getNumCallerEvents(), callerAddToGraphTest);\n listener.generateAndAdd(params.getNumListenerEvents(), listenerAddToGraphTest);\n generationDefinitions.accept(caller, listener);\n }",
"public static void createPageRanks()\n\t{\n\t\tlist = new ArrayList<pageRank>(30);\n\t\tfor (int i = 0; i < 30; i++)\n\t\t{\n\t\t\tpage = new pageRank();\n\t\t\tlist.add(page);\n\t\t}\n\t}",
"private void visitPublications(Collection<? extends Publication> publicationList, Visitor visitor) {\n\n publicationList.forEach(publication -> publication.accept(visitor));\n }",
"public void createVehicles(List<Vehicle> vehicles);",
"private void obtainAllPetVetVisits(Pet pet) {\n TrObtainAllVetVisits trObtainAllVetVisits = VetVisitsControllersFactory.createTrObtainAllVetVisits();\n trObtainAllVetVisits.setUser(ServerData.getInstance().getUser());\n trObtainAllVetVisits.setPet(pet);\n trObtainAllVetVisits.execute();\n }",
"public DieselVisit() {\r\n\t}",
"public void setVisits(int visits) {\n this.visits = visits;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check which Goal radio button was clicked and set sign for goal calorie calculation | @Override
public void onClick(View v) {
switch (goalRadioGroup.getCheckedRadioButtonId()) {
case R.id.lose_weight_radio_button:
goalSign = -1;
break;
case R.id.maintain_weight_radio_button:
goalSign = 0;
break;
case R.id.gain_weight_radio_button:
goalSign = 1;
break;
}
/* Check which Goal Speed radio button was clicked and set amount of calories to
add or gain */
switch (goalSpeedRadioGroup.getCheckedRadioButtonId()) {
case R.id.aggressive_radio_button:
additionalGoalCalories = 500;
break;
case R.id.suggested_radio_button:
additionalGoalCalories = 250;
break;
case R.id.slowly_radio_button:
additionalGoalCalories = 100;
break;
}
// Calculate calories to meet user's goal based on their stats and display the amount
calculateGoalCalories(tdee, goalSign, additionalGoalCalories);
goalCaloriesTextView.setText(String.valueOf(goalCalories));
} | [
"private void bruteForceJRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bruteForceJRadioButtonMenuItemActionPerformed\n bruteForceJRadioButton.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Brute Force\");\n// clearStats();\n }",
"private void bruteForceJRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bruteForceJRadioButtonActionPerformed\n bruteForceJRadioButtonMenuItem.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Brute Force\");\n// clearStats();\n }",
"private void sortedEdgeJRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortedEdgeJRadioButtonMenuItemActionPerformed\n sortedJRadioButton.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Sorted Edge\");\n// clearStats();\n }",
"private void nearestJRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nearestJRadioButtonActionPerformed\n nearestNeighborJRadioButtonMenuItem.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Nearest Neighbor\");\n// clearStats();\n }",
"private void nearestNeighborJRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nearestNeighborJRadioButtonMenuItemActionPerformed\n nearestJRadioButton.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Nearest Neighbor\");\n// clearStats();\n }",
"private void sortedJRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortedJRadioButtonActionPerformed\n sortedEdgeJRadioButtonMenuItem.setSelected(true);\n calculateJButton.doClick();\n// methodJLabel.setText(\"Sorted Edge\");\n// clearStats();\n }",
"private void btnAtanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtanActionPerformed\n if (radDegrees.isSelected()) {\n txtDisplay.setText(Calculations.degRadCalc(6, 1, \n txtDisplay.getText()));\n } else {\n txtDisplay.setText(Calculations.degRadCalc(6, 2, \n txtDisplay.getText()));\n }\n }",
"private void btnTanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTanActionPerformed\n if (radDegrees.isSelected()) {\n txtDisplay.setText(Calculations.degRadCalc(3, 1, \n txtDisplay.getText()));\n } else {\n txtDisplay.setText(Calculations.degRadCalc(3, 2, \n txtDisplay.getText()));\n }\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().equals(\"Submit\")) {\n int calories = Integer.parseInt(textFields[0].getText());\n int protein = Integer.parseInt(textFields[1].getText());\n int fat = Integer.parseInt(textFields[2].getText());\n int carbs = Integer.parseInt(textFields[3].getText());\n user.setCustomGoal(calories,protein,fat,carbs);\n runCalCount.loadNewMainPage();\n }\n }",
"private void btnSinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSinActionPerformed\n if (radDegrees.isSelected()) {\n txtDisplay.setText(Calculations.degRadCalc(1, 1, \n txtDisplay.getText()));\n } else {\n txtDisplay.setText(Calculations.degRadCalc(1, 2, \n txtDisplay.getText()));\n }\n }",
"private void customMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_customMousePressed\n surCharge = true;\n extra = true;\n if (!threeHours.isSelected()){\n JOptionPane.showMessageDialog(null, \"Rushed Job, 200% surcharge will be applied at receipt\" , \"Rushed Jobs\", JOptionPane.WARNING_MESSAGE);\n }\n }",
"public void onRadioButtonClicked(View view) {\n boolean checked = ((RadioButton) view).isChecked();\n switch (view.getId()) {\n case R.id.radio_fahrenheit:\n if (checked)\n measurement = \"us\";\n break;\n case R.id.radio_celsius:\n if (checked)\n measurement = \"si\";\n break;\n }\n }",
"private void btnAsinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAsinActionPerformed\n if (radDegrees.isSelected()) {\n txtDisplay.setText(Calculations.degRadCalc(4, 1, \n txtDisplay.getText()));\n } else {\n txtDisplay.setText(Calculations.degRadCalc(4, 2, \n txtDisplay.getText()));\n }\n }",
"private void calculateJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_calculateJButtonActionPerformed\n //getPath, one with radsiob btons\n getPath();\n displayStats();\n }",
"public void signChange(){\n workspace.setText(String.valueOf(-1*Double.parseDouble(workspace.getText().toString())));\n }",
"private void btn_calcAllowancesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_calcAllowancesActionPerformed\n \n calcAllowances();\n \n }",
"@Override\r\n public void onClick(View view) {\r\n if (game.isSpecialQuestionAnswered())\r\n {\r\n //special question was answered\r\n game.setSpecialQuestionAnswered(false);\r\n\r\n Toast.makeText(\r\n getActivity(),\r\n getString(\r\n R.string.specialQuestionPointIncrease\r\n , Vars.SPECIAL_QUESTION_POINTS_INCREASE),\r\n Toast.LENGTH_SHORT).show();\r\n\r\n //for this selected flag increase all its questions points by the amount\r\n for (Question question : game.getQuestionSet(flagId).getQuestions())\r\n {\r\n question.setPoints(question.getPoints() + Vars.SPECIAL_QUESTION_POINTS_INCREASE);\r\n }\r\n }\r\n else {\r\n //prevent from click multiple time to open multiple third screen\r\n flagImage.setEnabled(false);\r\n game.setCurrentQuestionSet(flagId);\r\n startActivity(new Intent(getActivity(), QuestionSelectionActivity.class));\r\n }\r\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n CheckOperation(calButtons.super.getText());\n }",
"public void actionPerformed( ActionEvent event )\n {\n smallJRadioButtonActionPerformed( event );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Create Content without contentType. Expected : 400 CLIENT_ERROR | @Test
public void createContentWithoutContentType() throws Exception {
String createContentReq = "{\"request\": {\"content\": {\"name\": \"Unit Test\",\"code\": \"unit.test\",\"mimeType\": \"application/pdf\"}}}";
String path = basePath + "/create";
actions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)
.header("X-Channel-Id", "channelKA").content(createContentReq));
Assert.assertEquals(400, actions.andReturn().getResponse().getStatus());
Response resp = getResponse(actions);
Assert.assertEquals("ERR_GRAPH_ADD_NODE_VALIDATION_FAILED", resp.getParams().getErr());
Assert.assertEquals("CLIENT_ERROR", resp.getResponseCode().toString());
} | [
"@Test\n\tpublic void createContentWithInvalidContentType() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"name\\\": \\\"Unit Test\\\",\\\"code\\\": \\\"unit.test\\\",\\\"mimeType\\\": \\\"application/pdf\\\",\\\"contentType\\\":\\\"pdf\\\"}}}\";\n\t\tString path = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse resp = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_GRAPH_ADD_NODE_VALIDATION_FAILED\", resp.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", resp.getResponseCode().toString());\n\t}",
"@Test\n\tpublic void createContentWithoutMimeType() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"name\\\": \\\"Unit Test\\\",\\\"code\\\": \\\"unit.test\\\",\\\"contentType\\\":\\\"Resource\\\"}}}\";\n\t\tString path = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse resp = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_CONTENT_INVALID_CONTENT_MIMETYPE_TYPE\", resp.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", resp.getResponseCode().toString());\n\t}",
"@Test\n\tpublic void createContentWithInvalidMimeType() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"name\\\": \\\"Unit Test\\\",\\\"code\\\": \\\"unit.test\\\",\\\"mimeType\\\": \\\"pdf\\\",\\\"contentType\\\":\\\"Resource\\\"}}}\";\n\t\tString path = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse resp = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_GRAPH_ADD_NODE_VALIDATION_FAILED\", resp.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", resp.getResponseCode().toString());\n\t}",
"@Test\n\tpublic void createContentWithoutCode() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"name\\\": \\\"Unit Test\\\",\\\"mimeType\\\": \\\"application/pdf\\\",\\\"contentType\\\":\\\"Resource\\\"}}}\";\n\t\tString path = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse resp = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_GRAPH_ADD_NODE_VALIDATION_FAILED\", resp.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", resp.getResponseCode().toString());\n\t}",
"@Test\n\tpublic void createContentWithoutName() throws Exception {\n\t\tString createContentReq = \"{\\\"request\\\": {\\\"content\\\": {\\\"code\\\": \\\"unit.test\\\",\\\"mimeType\\\": \\\"application/pdf\\\",\\\"contentType\\\":\\\"Resource\\\"}}}\";\n\t\tString path = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(path).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse resp = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_GRAPH_ADD_NODE_VALIDATION_FAILED\", resp.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", resp.getResponseCode().toString());\n\t}",
"@Test\n\tpublic void createContentWithInvalidOwnershipType() throws Exception{\n\t\tString createContentReq = \"{\\\"request\\\":{\\\"content\\\":{\\\"name\\\":\\\"ResourceContent\\\",\\\"code\\\":\\\"ResourceContent\\\",\\\"contentType\\\":\\\"Resource\\\",\\\"mimeType\\\":\\\"application/pdf\\\",\\\"ownershipType\\\":[\\\"created\\\"]}}}\";\n\t\tString createPath = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(createPath).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(400, actions.andReturn().getResponse().getStatus());\n\t\tResponse createResponse = getResponse(actions);\n\t\tAssert.assertEquals(\"ERR_GRAPH_ADD_NODE_VALIDATION_FAILED\", createResponse.getParams().getErr());\n\t\tAssert.assertEquals(\"CLIENT_ERROR\", createResponse.getResponseCode().toString());\n\t}",
"@PostMapping(\"/documents\")\r\n\tpublic ResponseEntity<String> create(String content) {\r\n\t\tString docId = this.documentHandler.createDocument(content);\r\n\t\tHttpHeaders headers = new HttpHeaders();\r\n\t\theaders.setContentType(MediaType.TEXT_PLAIN);\r\n\t\theaders.setAcceptCharset(Collections.singletonList(StandardCharsets.US_ASCII));\r\n\t\theaders.setContentLength(docId.length());\r\n\t\treturn new ResponseEntity<String>(docId, headers, HttpStatus.CREATED);\r\n\t}",
"protected abstract byte[] doCreateContent();",
"@Test\n\tpublic void createContentWithoutOwnershipType() throws Exception{\n\t\tString createContentReq = \"{\\\"request\\\":{\\\"content\\\":{\\\"name\\\":\\\"ResourceContent\\\",\\\"code\\\":\\\"ResourceContent\\\",\\\"contentType\\\":\\\"Resource\\\",\\\"mimeType\\\":\\\"application/pdf\\\"}}}\";\n\t\tString createPath = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(createPath).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(200, actions.andReturn().getResponse().getStatus());\n\t\tResponse createResponse = getResponse(actions);\n\t\tString contentId = (String)createResponse.getResult().get(\"node_id\");\n\t\t\n\t\tString readPath = basePath + \"/read/\" + contentId;\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.get(readPath).contentType(MediaType.APPLICATION_JSON));\n\t\tAssert.assertEquals(200, actions.andReturn().getResponse().getStatus());\n\t\tResponse readResponse = getResponse(actions);\n\t\tList<String> ownershipType = (List<String>)((Map)readResponse.getResult().get(\"content\")).get(\"ownershipType\");\n\t\tString[] expected = {\"createdBy\"};\n\t\tAssert.assertArrayEquals(expected, ownershipType.toArray(new String[ownershipType.size()]));\n\t}",
"@Ignore\n\tpublic void createCategoryWithInvalidPathExpect4xx(){\n\t\tsetURI();\n\t\tgiven().\n\t\tspec(getRequestSpecification(contentType, userId, APIToken, channelId)).\n\t\tbody(jsonCreateCategoryRequest).\n\t\twith().\n\t\tcontentType(JSON).\n\t\twhen().\n\t\tpost(\"/framework/v3/category/master/creat\").\n\t\tthen().\n\t\t//log().all().\n\t\tspec(get404ResponseSpec());\t\t\n\t}",
"@Test\n public void createObjectWithEmptyData() throws Exception {\n MvcResult testResult = this.mockMvc.perform(put(\"/data/myRepo\").content(new String(\"\".getBytes(), StandardCharsets.UTF_8))).andDo(print()).andExpect(status().isBadRequest()).andReturn();\n assertEquals(null, testResult.getResponse().getContentType());\n\n }",
"public Content createContent();",
"@Test\n\tpublic void createContentWithValidOwnershipType() throws Exception{\n\t\tString createContentReq = \"{\\\"request\\\":{\\\"content\\\":{\\\"name\\\":\\\"ResourceContent\\\",\\\"code\\\":\\\"ResourceContent\\\",\\\"contentType\\\":\\\"Resource\\\",\\\"mimeType\\\":\\\"application/pdf\\\",\\\"ownershipType\\\":[\\\"createdFor\\\"]}}}\";\n\t\tString createPath = basePath + \"/create\";\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.post(createPath).contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.header(\"X-Channel-Id\", \"channelKA\").content(createContentReq));\n\t\tAssert.assertEquals(200, actions.andReturn().getResponse().getStatus());\n\t\tResponse createResponse = getResponse(actions);\n\t\tString contentId = (String)createResponse.getResult().get(\"node_id\");\n\t\t\n\t\tString readPath = basePath + \"/read/\" + contentId;\n\t\tactions = mockMvc.perform(MockMvcRequestBuilders.get(readPath).contentType(MediaType.APPLICATION_JSON));\n\t\tAssert.assertEquals(200, actions.andReturn().getResponse().getStatus());\n\t\tResponse readResponse = getResponse(actions);\n\t\tList<String> ownershipType = (List<String>)((Map)readResponse.getResult().get(\"content\")).get(\"ownershipType\");\n\t\tString[] expected = {\"createdFor\"};\n\t\tAssert.assertArrayEquals(expected, ownershipType.toArray(new String[ownershipType.size()]));\n\t}",
"public String createContent(String spaceId, String contentId);",
"@Test\n public void testErrorUploadWithoutFile() throws Exception\n {\n final ClientResource uploadArtifactClientResource =\n new ClientResource(this.getUrl(PoddWebConstants.PATH_ARTIFACT_UPLOAD));\n \n final FormDataSet form = new FormDataSet();\n form.setMultipart(true);\n \n try\n {\n RestletTestUtils.doTestAuthenticatedRequest(uploadArtifactClientResource, Method.POST, form,\n MediaType.TEXT_HTML, Status.CLIENT_ERROR_BAD_REQUEST, this.testWithAdminPrivileges);\n Assert.fail(\"Should have thrown a ResourceException with Status Code 400\");\n }\n catch(final ResourceException e)\n {\n Assert.assertEquals(\"Not the expected HTTP status code\", Status.CLIENT_ERROR_BAD_REQUEST, e.getStatus());\n }\n }",
"TContent createContent(byte[] bytes, ContentFactory<TContent> contentFactory);",
"@Headers({\n \"Content-Type:application/json\"\n })\n @POST(\"content/articles\")\n Call<ArticleResource> createArticle(\n @retrofit2.http.Body ArticleResource articleResource\n );",
"abstract public Content createContent();",
"@Test\n public void badRequest400Validation() {\n\n RestClient client = new RestClient();\n try {\n client.put(\"/api/v1/validate\", \"\");\n Assertions.fail();\n } catch (HttpClientErrorException ex) {\n logger.info(\"Result: {}\", ex.getResponseBodyAsString());\n\n Assertions.assertEquals(HttpStatus.BAD_REQUEST, ex.getStatusCode());\n Assertions.assertEquals(\"{\\\"code\\\":-1,\\\"error_id\\\":\\\"validation\\\",\\\"message\\\":\\\"must not be null\\\"}\",\n ex.getResponseBodyAsString());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encode file to base64 binary string. | public static String encodeFileToBase64BinaryString(File fileName) throws IOException {
return new String(Base64.encode(FileUtils.readFileToByteArray(fileName)));
} | [
"public static String encodeToBase64String(MultipartFile file) throws IOException, SQLException {\n byte[] fileBytes = file.getBytes();\n String base64String = Base64Utils.encodeToString(fileBytes);\n\n return base64String;\n }",
"public static String base64Encode(byte[] input) {\n return DatatypeConverter.printBase64Binary(input);\n }",
"private static String encodeToBase64(byte[] data) {\n return Base64.encodeToString(data, BASE64_EFLAGS);\n }",
"public static String base64Encode(byte[] bytes)\n {\n return DatatypeConverter.printBase64Binary(bytes);\n }",
"public String base64Encode(String str) throws StoreFactoryException;",
"public static String encode(byte[] data) {\n return DatatypeConverter.printBase64Binary(data);\n }",
"public static String encodeBase64(String input) {\n return DatatypeConverter.printBase64Binary(\n input.getBytes(StandardCharsets.UTF_8));\n }",
"public String encodeUriToBase64Binary(Context context, Uri uri) {\n String encodedFile = null;\n InputStream inputStream;\n String pathOfFile = getPath(context, uri);\n if (pathOfFile != null) {\n File file = new File(pathOfFile);\n try {\n inputStream = context.getContentResolver().openInputStream(uri);\n byte[] bytes = new byte[(int)file.length()];\n inputStream.read(bytes);\n encodedFile = Base64.encodeToString(bytes, Base64.NO_WRAP);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return encodedFile;\n }",
"public static String codBase64(byte [] a) {\n String b = Base64.encodeToString(a,Base64.DEFAULT);\n return b;\n }",
"default String codificarBase64(String contenido) {\n\t\tbyte[] encoded = Base64.getEncoder().encode(contenido.getBytes(StandardCharsets.UTF_8));\n\t\treturn new String(encoded);\n\t}",
"public static String encode(ChallengeData toEncode) throws IOException\n {\n data = toEncode;\n byte[] inBytes = getByteStream(data);\n base64 = Base64.getEncoder().encodeToString(inBytes);\n \n return base64;\n }",
"String encode(File message, File key,File crypted);",
"public String getBase64() {\n return new String(data);\n }",
"private static String encodeFileToBase64Binary(String path, boolean image){\n try {\n String encodedFile = \"\";\n\n if (image) {\n byte[] bytesEncoded = Base64.encodeBase64(path.getBytes());\n encodedFile = new String(bytesEncoded);\n } else {\n StringBuilder strBuilder = new StringBuilder(path);\n strBuilder.insert(strBuilder.lastIndexOf(\".\"), \"2\");\n File dllFile = new File(strBuilder.toString());\n FileInputStream fileInputStreamReader = new FileInputStream(dllFile);\n byte[] bytes = new byte[(int) dllFile.length()];\n fileInputStreamReader.read(bytes);\n encodedFile = new String(Base64.encodeBase64(bytes), \"UTF-8\");\n }\n\n return encodedFile;\n\n } catch (Exception e) {\n System.out.println(\"Error\");\n\n return null;\n }\n }",
"private static String base64Encode(byte[] bytes)\n {\n\n String outputString = new String(Base64.encodeBase64(bytes));\n\n return outputString;\n }",
"@JsonValue\n public String toBase64()\n {\n byte[] asBytes = toBytes();\n return StringUtils.fromUtf8(StringUtils.encodeBase64(asBytes));\n }",
"public void testBase64Encode() {\n \n String dataDir = getDataDirectory() + File.separator;\n assertDirectoryExists(dataDir, \"Missing data directory\");\n \n String inputFileName = dataDir + \"Problem9.class\";\n assertFileExists(inputFileName, \"input file '\" + inputFileName + \"'\");\n \n String correctlyEncodedFileName = dataDir + \"Problem9.CorrectlyBase64Encoded\" ;\n assertFileExists(correctlyEncodedFileName, \"Correct file '\" + correctlyEncodedFileName + \"'\");\n \n// String tempDirName = \".\" + File.separator + \"tempBase64Test\" + File.separator;\n// String tempDirName = getOutputDataDirectory() + File.separator;\n// ensureDirectory(tempDirName);\n String outputFileName = getOutputTestFilename(\"computedBase64File\");\n \n //the required files and directories exist; read input file as a byte array\n byte [] bytes = getFileBytes(inputFileName);\n assertNotNull(bytes);\n \n //encode the input file into Base64 using the class under test\n String encodedInputFile = Base64.encode(bytes);\n assertNotNull(encodedInputFile);\n \n //write the Base64-encoded text data out as a file\n String [] fileLines = new String [1];\n fileLines[0] = encodedInputFile;\n try {\n Utilities.writeLinesToFile(outputFileName, fileLines);\n } catch (FileNotFoundException e) {\n failTest(\"Exception writing encoded file '\" + outputFileName + \"': \" + e.getMessage(), e);\n }\n \n File computedFile = new File(outputFileName);\n File correctFile = new File(correctlyEncodedFileName);\n try {\n //compare the two Base64 text files for equality\n assertFileContentsEquals(computedFile, correctFile);\n } catch (IOException e) {\n failTest(\"Exception comparing file '\" + outputFileName + \"' with file '\" + correctlyEncodedFileName + \"': \"+ e.getMessage(), e);\n }\n \n// //cleanup: remove the temporary folder\n// String outputDir = getOutputDataDirectory();\n// clearDir(outputDir);\n// removeDir(outputDir);\n \n }",
"private static String encodeBase64(String stringToEncode){\r\n\t\treturn Base64.getEncoder().encodeToString(stringToEncode.getBytes());\t\r\n\t}",
"public static String byteToBase64(byte[] data){\n BASE64Encoder endecoder = new BASE64Encoder();\n return endecoder.encode(data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deplace le robot d'une case en bas si le deplacement est possible. | private void down() {
Point p = robot.getPosition();
if (grille.deplacementPossible(robot, p.getX(), p.getY() + 1)) {
robot.setPosition(p.getX(), p.getY() + 1);
}
} | [
"public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void dessineCarte(){\n\tfor(int i=0;i<data.getCarte().getNbLignes();i++) {\n\t for(int j=0;j<data.getCarte().getNbColonnes();j++) {\n\t\tdessineCase(data.getCarte().getCase(i,j));\n\t }\n\t}\n }",
"void unsetCapital();",
"public void deplacerPiece(int x1 , int y1 , int x2 , int y2) {\n\t\tif (positionInvalide(x1,y1)) { System.out.println(\"position de départ invalide\");\n\t\treturn;\n\t\t}\n\t\tif (positionInvalide(x2,y2)) { System.out.println(\"position d'arrivée invalide\");\n\t\treturn;\n\t\t}\n\t\n\t\t\n\t\tif (this.caseVide(x1, y1)) { System.out.println(\"la case est vide\");\n\t\t}\n\t\t\n\t\telse if (!this.chercherPiece(x1, y1).deplacementValide(x1, y1, x2, y2, this)) {System.out.println(\"déplacement invalide\");}\n\t\telse if (this.caseVide(x2, y2)) {\n\t\t\tif(this.chercherPiece(x1, y1).getName()==\"Pion\") {this.chercherPiece(x1, y1).setPremierDeplacement(false);}\n\t\t\tthis.chercherPiece(x1, y1).deplacePiece(x2, y2);\n\t\t\tgrille[x1*2-1][y1*2-1]=' ';\n\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ATTAQUE !\");\n\t\t\tif(this.chercherPiece(x1, y1).getName()==\"Pion\") {this.chercherPiece(x1, y1).setPremierDeplacement(false);}\n\t\t\tthis.chercherPiece(x2, y2).setOut(true);\n\t\t\tthis.chercherPiece(x2, y2).deplacePiece(0, 0);\n\t\t\tthis.chercherPiece(x1, y1).deplacePiece(x2, y2);\n\t\t\tgrille[x1*2-1][y1*2-1]=' ';\n\n\t\t}\n\n\t}",
"public void displace() {\n \n isPlaced = false;\n \n }",
"public String choixDeplacement(Robot r, Plateau p, String actionName){\r\n\t\tString deplacementName;\r\n\t\tint nbRobotSurBase = 0;\r\n\t\tint nbPossibilite;\r\n\t\tboolean testObstacle1 = false;\r\n\t\tboolean testObstacle2 = false;\r\n\t\tboolean testObstacle3 = false;\r\n\t\tboolean testObstacle4 = false;\r\n\t\tboolean test = false;\r\n\r\n\t\tequipe = r.getEquipe();\r\n\r\n\t\t//On verifie que au moins un robot est dehors\r\n\t\tfor(Robot rob : listeRobotEquipe){\r\n\t\t\tif(rob.estSurBase()){\r\n\t\t\t\tnbRobotSurBase++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(nbRobotSurBase == listeRobotEquipe.size()){\r\n\t\t\tif(equipe == 1){\r\n\t\t\t\tif(r.getType().substring(0, 1).equals(\"c\") || r.getType().substring(0, 1).equals(\"C\")){\r\n\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+1, r.getCoordonnees().getHauteur()))\r\n\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+1, r.getCoordonnees().getHauteur()))\r\n\t\t\t\t\t\tdeplacementName = \"d\";\t\r\n\t\t\t\t\telse if(!p.estObstacle(r.getCoordonnees().getLargeur()+1, r.getCoordonnees().getHauteur()+1))\r\n\t\t\t\t\t\tdeplacementName = \"c\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(r.getType().substring(0, 1).equals(\"c\") || r.getType().substring(0, 1).equals(\"C\")){\r\n\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()-1))\r\n\t\t\t\t\t\tdeplacementName = \"z\";\t\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()-1))\r\n\t\t\t\t\t\tdeplacementName = \"z\";\t\r\n\t\t\t\t\telse if(!p.estObstacle(r.getCoordonnees().getLargeur()-1, r.getCoordonnees().getHauteur()-1))\r\n\t\t\t\t\t\tdeplacementName = \"a\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Ia aleatoire\r\n\t\telse if(niveauDeDifficulte == 1){\r\n\t\t\tif(actionName == \"d\"){\r\n\t\t\t\tif(r.getType().substring(0, 1).equals(\"c\") || r.getType().substring(0, 1).equals(\"C\")){\r\n\t\t\t\t\tnbPossibilite = alea.nextInt(2);\r\n\t\t\t\t\tswitch (nbPossibilite) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tnbPossibilite = alea.nextInt(7);\r\n\t\t\t\t\tswitch (nbPossibilite) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tdeplacementName = \"a\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\tdeplacementName = \"e\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\tdeplacementName = \"w\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdeplacementName = \"c\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tnbPossibilite = alea.nextInt(3);\r\n\t\t\t\tswitch (nbPossibilite) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//IA intelligente\r\n\t\telse{\r\n\t\t\tif(actionName == \"d\"){\r\n\t\t\t\tif(r.getType().substring(0, 1).equals(\"c\") || r.getType().substring(0, 1).equals(\"C\")){\r\n\t\t\t\t\tif(r.getCoordonnees().getHauteur() == p.getHauteur()-1 && r.getCoordonnees().getLargeur() != p.getLargeur()-1 && r.getCoordonnees().getLargeur() != 0){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\t//deplacementName = \"d\";\t\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == p.getLargeur()-1 && r.getCoordonnees().getHauteur() != p.getHauteur()-1 && r.getCoordonnees().getHauteur() != 0){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getHauteur() == 0 && r.getCoordonnees().getLargeur() != p.getLargeur()-1 && r.getCoordonnees().getLargeur() != 0){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == 0 && r.getCoordonnees().getHauteur() != p.getHauteur()-1 && r.getCoordonnees().getHauteur() != 0){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == 0 && r.getCoordonnees().getHauteur() == p.getHauteur()-1){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getHauteur() == p.getHauteur()-1 && r.getCoordonnees().getLargeur() == 0){\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\t\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * robot t et p\r\n\t\t\t\t */\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(r.getCoordonnees().getHauteur() == p.getHauteur()-1 && r.getCoordonnees().getLargeur() != p.getLargeur()-1 && r.getCoordonnees().getLargeur() != 0){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 1\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTGAUCHE.getLargeur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"a\");\r\n\t\t\t\t\t\t//deplacementName = \"a\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTDROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"e\");\r\n\t\t\t\t\t\t//deplacementName = \"e\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\t\r\n\t\t\t\t\t\t//deplacementName = \"d\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == p.getLargeur()-1 && r.getCoordonnees().getHauteur() != p.getHauteur()-1 && r.getCoordonnees().getHauteur() != 0){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 2\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"a\");\r\n\t\t\t\t\t\t//deplacementName = \"a\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"w\");\r\n\t\t\t\t\t\t//deplacementName = \"w\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\t//deplacementName = \"s\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getHauteur() == 0 && r.getCoordonnees().getLargeur() != p.getLargeur()-1 && r.getCoordonnees().getLargeur() != 0){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 3\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\t//deplacementName = \"d\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASDROITE.getLargeur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"c\");\r\n\t\t\t\t\t\t//deplacementName = \"c\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\t//deplacementName = \"s\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"w\");\r\n\t\t\t\t\t\t//deplacementName = \"w\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == 0 && r.getCoordonnees().getHauteur() != p.getHauteur()-1 && r.getCoordonnees().getHauteur() != 0){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 4\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\t//deplacementName = \"s\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\t//deplacementName = \"d\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTDROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"e\");\r\n\t\t\t\t\t\t//deplacementName = \"e\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASDROITE.getLargeur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"c\");\r\n\t\t\t\t\t\t//deplacementName = \"c\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getLargeur() == 0 && r.getCoordonnees().getHauteur() == p.getHauteur()-1){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 5\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTDROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"e\");\r\n\t\t\t\t\t\t//deplacementName = \"e\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\t//deplacementName = \"d\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(r.getCoordonnees().getHauteur() == 0 && r.getCoordonnees().getLargeur() == p.getLargeur()-1){\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 6\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"w\");\r\n\t\t\t\t\t\t//deplacementName = \"w\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\t//deplacementName = \"s\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tSystem.out.println(\"YOLLLO 7\");\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"z\");\r\n\t\t\t\t\t\t//deplacementName = \"z\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASDROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"c\");\r\n\t\t\t\t\t\t//deplacementName = \"c\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"d\");\r\n\t\t\t\t\t\t//deplacementName = \"d\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIABASGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIABASGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"w\");\r\n\t\t\t\t\t\t//deplacementName = \"w\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTDROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTDROITE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"e\");\r\n\t\t\t\t\t\t//deplacementName = \"e\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"q\");\r\n\t\t\t\t\t\t//deplacementName = \"q\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DIAHAUTGAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DIAHAUTGAUCHE.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"a\");\r\n\t\t\t\t\t\t//deplacementName = \"a\";\r\n\t\t\t\t\t\tif(!p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()))\r\n\t\t\t\t\t\t\tdeplacementPossible.add(\"s\");\r\n\t\t\t\t\t\t//deplacementName = \"s\";\r\n\r\n\t\t\t\t\t\tint nbAlea = alea.nextInt(deplacementPossible.size());\r\n\t\t\t\t\t\tdeplacementName = deplacementPossible.get(nbAlea);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(r.getType().substring(0, 1).equals(\"c\") || r.getType().substring(0, 1).equals(\"C\")){\r\n\t\t\t\t\tcpt = 1;\r\n\t\t\t\t\tdo{\r\n\t\t\t\t\t\tif(p.getContenu(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()+cpt) != null && p.getContenu(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()+cpt).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()+cpt)){\r\n\t\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\t\t\ttest = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()-cpt) != null && p.getContenu(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()-cpt).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur(), r.getCoordonnees().getHauteur()-cpt)){\r\n\t\t\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\t\t\ttest = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()-cpt, r.getCoordonnees().getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()-cpt, r.getCoordonnees().getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()-cpt, r.getCoordonnees().getHauteur())){\r\n\t\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\t\t\ttest = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (p.getContenu(r.getCoordonnees().getLargeur()+cpt, r.getCoordonnees().getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()+cpt, r.getCoordonnees().getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()+cpt, r.getCoordonnees().getHauteur())){\r\n\t\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\t\t\ttest = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tdeplacementName = \" \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcpt++;\r\n\t\t\t\t\t}while(cpt < 11 && test == false);\r\n\t\t\t\t}\r\n\t\t\t\telse if(r.getType().substring(0, 1).equals(\"t\") || r.getType().substring(0, 1).equals(\"T\")){\r\n\t\t\t\t\tif(p.getContenu(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur())){\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur())){\r\n\t\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur())){\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()) != null && p.getContenu(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()).getEquipe() != r.getEquipe() && !p.estObstacle(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur())){\r\n\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdeplacementName = \" \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(p.getContenu(r.getCoordonnees().getLargeur()+Constante.BAS.getLargeur(), r.getCoordonnees().getHauteur()+Constante.BAS.getHauteur()) == null){\r\n\t\t\t\t\t\tdeplacementName = \"s\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.HAUT.getLargeur(), r.getCoordonnees().getHauteur()+Constante.HAUT.getHauteur()) != null){\r\n\t\t\t\t\t\tdeplacementName = \"z\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.GAUCHE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.GAUCHE.getHauteur()) != null){\r\n\t\t\t\t\t\tdeplacementName = \"q\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(p.getContenu(r.getCoordonnees().getLargeur()+Constante.DROITE.getLargeur(), r.getCoordonnees().getHauteur()+Constante.DROITE.getHauteur()) != null){\r\n\t\t\t\t\t\tdeplacementName = \"d\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdeplacementName = \" \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn deplacementName;\t\t\r\n\t}",
"public void demandeDeplacement(int dx, int dy)\n\t{\n\t\t// Nouvelles coordonnées en fonction des directions d\n\t\tthis.x = this.x + dx;\n\t\tthis.y = this.y + dy;\n\t\t\n\t\tfor (PirateEcouteur piratecouteur : this.pirateEcouteurs.getListeners(PirateEcouteur.class)) {\n\t\t\t//Traitement trésor\n\t\t\tif(this.monkeyIsland.getTresor().coordonneesEgales(this.x, this.y)){\n\t\t\t\tthis.butin++;\n\t\t\t\tthis.monkeyIsland.suppressionTresor();\n\t\t\t\tthis.monkeyIsland.creationTresor();\n\t\t\t}\n\t\t\t//Traitement déplacement pirate\n\t\t\tif(this.monkeyIsland.singeEstPresent(this.x, this.y)){\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t\t//Marcher sur un singe entraine la mort\n\t\t\t\tpiratecouteur.mortPirate(0);\n\t\t\t\tbreak;\n\t\t\t}else if(Constantes.MER != this.monkeyIsland.valeurCarte(this.x, this.y)){\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t}else{\n\t\t\t\tpiratecouteur.deplacementPirate(0, this.x, this.y);\n\t\t\t\tpiratecouteur.mortPirate(0);\n\t\t\t}\n\t\t\t//Libération clavier pour pouvoir se déplacer\n\t\t\tpiratecouteur.liberationClavier();\n\t\t}\n\t}",
"public void changePlace(){\n\t\tswitch (crPlace){\n\t\tcase DOWN:\n\t\t\tgroundBody.setTransform(wwidth/2,wheight, 0);\n\t\t\tcrPlace = Place.UP; \n\t\t\tbreak;\n\t\tcase UP:\n\t\t\tgroundBody.setTransform(wwidth/2,0, 0);\n\t\t\tcrPlace = Place.DOWN; \n\t\t\tbreak;\n\t\tdefault : return ; \n\t\t}\n\t}",
"private void eliminiereSonderzeichen() {\n\t\tfor (String wort:wortListe) {\n\t\t\tString wortClean = wort.toLowerCase();\n\t\t\tfor(Character zeichen:zeichenErsetzen) {\n\t\t\t\twortClean = wortClean.replace(zeichen.toString(), \"\");\n\t\t\t}\n\t\t\t//System.out.println(wortClean);\n\t\t\tfuegeWortAn(wortClean);\n\t\t}\n\t}",
"public void mueveDisparo()\n {\n switch(position)\n {\n case 0://Disparo hacia arriba\n setLocation(getX(),getY() - speedShot);\n break;\n case 1: //Disparo hacia abajo\n setLocation(getX(),getY() + speedShot);\n break;\n case 2://Disparo hacia la derecha\n setLocation(getX() + speedShot,getY());\n break;\n case 3://Diaparo hacia la izquierda\n setLocation(getX() - speedShot,getY());\n break;\n }\n \n }",
"void unscramble();",
"public void replaceMisspelling(String word);",
"private static void testReplaceWord() {\n\t\tboolean error = false;\n\n\n\t\t{ //1. \n\t\t\tString word = \"machine\";\n\t\t\tString expected = \"computer\";\t\t\n\t\t\tString result = Eliza.replaceWord(word, Config.INPUT_WORD_MAP);\n\t\t\tif (result == null || !result.equals(expected)) {\n\t\t\t\terror = true;\n\t\t\t\tSystem.out.println(\"testReplaceWord 1 failed. result:'\" + result + \"' expected:'\" + expected + \"'\");\n\t\t\t}\n\t\t}\t\n\n\t\t{ //2. \n\t\t\tString word = \"yourself\";\n\t\t\tString expected = \"myself\";\n\t\t\tString result = Eliza.replaceWord(word, Config.PRONOUN_MAP);\n\t\t\tif (result == null || !result.equals(expected)) {\n\t\t\t\terror = true;\n\t\t\t\tSystem.out.println(\"testReplaceWord 2 failed. result:'\" + result + \"' expected:'\" + expected + \"'\");\n\t\t\t}\n\t\t}\n\n\t\t//additional suggestions:\n\t\t//Do these tests meet all the requirements described in the replaceWord header comment,\n\t\t//such as handling a null wordMap?\n\n\t\tif (error) {\n\t\t\tSystem.err.println(\"testReplaceWord failed\");\n\t\t} else {\n\t\t\tSystem.out.println(\"testReplaceWord passed\");\n\t\t}\n\t}",
"private static void replaceLCPPwithALT_L(Shape nShape, Orientation nOrient) {\n newTetro = new Tetrominoe(nShape, nOrient);\n switch (nOrient) {\n case ORIG: //replace L with ORIG ALT_L\n switch (MainGameFrame.currentPlayPiece.tOrientation) {\n case ORIG: // replace ORIG L with ORIG ALT_L\n //obfuscated\n break;\n case CW90: // replace CW90 L with ORIG ALT_L\n unusedSquare = MainGameFrame.currentPlayPiece.occupiedSquares[2];\n MainGameFrame.filledPlayArea[unusedSquare.x][unusedSquare.y].color = Color.WHITE;\n newTetro.occupiedSquares[0].x = MainGameFrame.currentPlayPiece.occupiedSquares[3].x;\n newTetro.occupiedSquares[0].y = MainGameFrame.currentPlayPiece.occupiedSquares[3].y - 1;\n newTetro.occupiedSquares[1].x = MainGameFrame.currentPlayPiece.occupiedSquares[3].x;\n newTetro.occupiedSquares[1].y = MainGameFrame.currentPlayPiece.occupiedSquares[3].y;\n newTetro.occupiedSquares[2].x = MainGameFrame.currentPlayPiece.occupiedSquares[0].x;\n newTetro.occupiedSquares[2].y = MainGameFrame.currentPlayPiece.occupiedSquares[0].y;\n newTetro.occupiedSquares[3].x = MainGameFrame.currentPlayPiece.occupiedSquares[1].x;\n newTetro.occupiedSquares[3].y = MainGameFrame.currentPlayPiece.occupiedSquares[1].y;\n MainGameFrame.currentPlayPiece = newTetro;\n break;\n case CW180: // replace CW180 L with ORIG ALT_L\n //obfuscated\n break;\n case CW270: // replace CW270 L with ORIG ALT_L\n //obfuscated\n break;\n }\n break;\n case CW90://replace L with CW90 ALT_L\n //obfuscated\n break;\n case CW180: //replace L with CW180 ALT_L\n //obfuscated\n break;\n case CW270: //replace L with CW270 ALT_L\n //obfuscated\n break;\n }\n }",
"void unsetCapitalInKind();",
"public int deplacement() {\n\n\t\tint resultatAvance;\n\t\tdo {\n\t\t\t\n\t\t\tresultatAvance = voitureActuelle.avancer();\n\t\t\tvoitureActuelle.reinitialiserTraffic();\n\n\t\t} while(resultatAvance == 1); //Reessayer d'avancer tant que la voiture rencontre des problemes de trajet\n\n\t\treturn resultatAvance;\n\t}",
"public void deplacementFinie() {\n\t\tbouton1.setEnabled(false);\n\t\tif(!jeu.isAction())\n\t\t\tbouton2.setEnabled(true);\n\t\tbouton3.setEnabled(true);\n\t\t\n\t}",
"public void comportement() {\n\t\tif (compteurPas > 0) {\n seDeplacer(deplacementEnCours);\n compteurPas--;\n\n // sinon charge le prochain deplacement\n\t\t} else {\n\t\t // recalcul le chemin si la cible a bouge\n boolean cibleBouger = calculPosCible();\n if (cibleBouger)\n calculerChemin();\n\n if (suiteDeDeplacement.size() > 0) {\n deplacementEnCours = suiteDeDeplacement.pollFirst();\n compteurPas = Case.TAILLE / vitesse;\n // pour le sprite\n if (deplacementEnCours == 'E')\n direction = true;\n else if (deplacementEnCours == 'O')\n direction = false;\n }\n }\n\t\tattaque = attaquer();\n\t}",
"public void deplacerHero1(int x, int y){\n\t\tif (!isPaused() && !isPerdu()) {\n\t\t\thero1.deplacementTrajectoire(carte, x, y);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A CurveMeasure is like a AtMeasure, but the behavior defined creates a curve of points (atValue, result) on a lot of xValues (atValues) specified by CurveMeasure interface users. Whatever class that implements the CurveMeasure interface has to implement the behavior defined by Measure interface. | public interface CurveMeasure extends Measure{
/**
* Returns a MeasureSet object that contains the measure result to all topic and atValues specified on the run selected.
* @param run - name of run
* @param xValues - atValues array.
* @return MeasureSet - The object that encapsulates the measure result.
* @throws IOException -If happened a problem when open the result file
* @throws InterruptedException -
* @throws InvalidItemNameException - If the data is not a number.
* @throws ItemNotFoundException - If a topic does not exist.
* @throws InvalidItemNameException - If a topics with the same name exists.
*/
public MeasureSet getValue(String run, String [] xValues)
throws IOException, InterruptedException, NumberFormatException, ItemNotFoundException,
InvalidItemNameException, QrelItemNotFoundException, TopicNotFoundException,
InvalidQrelFormatException;
/**
* Returns a MeasureSet object that contains the measure result to selected topics and atValues specified on the run selected.
* @param run - name of run
* @param xValues - atValues array.
* @param topicNumbers - selected topic name array
* @return MeasureSet - The object that encapsulates the measure result.
* @throws IOException -If happened a problem when open the result file
* @throws InterruptedException -
* @throws InvalidItemNameException - If the data is not a number.
* @throws ItemNotFoundException - If a topic does not exist.
* @throws InvalidItemNameException - If a topics with the same name exists.
*/
public MeasureSet getValue(String run, String [] xValues, String[] topicNumbers) throws IOException,
InterruptedException, NumberFormatException, ItemNotFoundException, InvalidItemNameException,
QrelItemNotFoundException, TopicNotFoundException,
InvalidQrelFormatException;
} | [
"Measure createMeasure();",
"public interface CurvePainter {\n\n /**\n * paint specified curve\n * \n * @param g2d\n * the graphics context\n * @param curve\n * the curve to paint\n */\n public void paintCurve(Graphics2D g2d, Curve curve);\n}",
"public abstract DataValue add(DataMeasure measure);",
"@Override\n public double getMeasure() {\n return measure;\n }",
"public abstract Set<Measure> supportedMeasures();",
"public boolean isCurveCalculated(CurveMetadata meta, DiscretizedFunc xVals);",
"public interface ChartScorer { \n\n\t/** Returns a Chart, based on a scoring over the Signs in the top-most SignHash given the string position. */ \n\n\tpublic Chart score (Chart chart, int stringPos); \n\n\t/** Sets the beam width function to be used in controlling the number of prefered analyses included in the resulting top-most SignHash */\n\n\tpublic void setBeamWidthFunction (BeamWidthFunction bf); \n\n}",
"public interface ForexPricingMethod {\n\n /**\n * Computes the present value of the instrument.\n * @param instrument The instrument.\n * @param curves The yield curves.\n * @return The present value.\n */\n MultipleCurrencyAmount presentValue(final ForexDerivative instrument, final YieldCurveBundle curves);\n\n /**\n * Computes the currency exposure of the instrument.\n * @param instrument The instrument.\n * @param curves The yield curves.\n * @return The currency exposure.\n */\n MultipleCurrencyAmount currencyExposure(ForexDerivative instrument, YieldCurveBundle curves);\n\n}",
"@Test\n public void basicMeasureTest(){\n List<MusicElement> elements = new ArrayList<MusicElement>();\n elements.add(new Note(new Pitch('C'), new Fraction(1,1),false));\n elements.add(new Note(new Pitch('A'), new Fraction(1,1),false));\n new Measure(elements);\n }",
"@Test\n public void testGetMeasures() {\n Bar instance = new Bar();\n \n assertEquals(0, instance.getMeasures().size());\n \n instance.addMeasure();\n instance.addMeasure();\n instance.addMeasure(); \n instance.addMeasure();\n instance.addMeasure();\n \n assertEquals(5, instance.getMeasures().size());\n }",
"public interface MeasurePropertyType\n\t\t{\n\t\tpublic String getDesc();\n\t\t\n\t\t/**\n\t\t * Which properties, must be fixed and the same for all particles \n\t\t */\n\t\tpublic Set<String> getColumns();\n\t\t\n\t\t/**\n\t\t * Evaluate a stack, store in info. If a particle is not in the list it must be\n\t\t * created. All particles in the map must receive data.\n\t\t */\n\t\tpublic void analyze(ProgressHandle progh, EvStack stackValue, EvStack stackMask, ParticleMeasure.FrameInfo info);\n\t\t}",
"public interface ClusterMeasure {\n\n /**\n * Returns an index to measure the quality of clustering.\n * @param y1 the cluster labels.\n * @param y2 the alternative cluster labels.\n */\n public double measure(int[] y1, int[] y2);\n\n}",
"MeasuringPoint getMeasuringPoint();",
"public ChunkDataSetBuilder addMeasure(BugPronenessMeasure measure) {\n\t\tthis.measures.add(measure);\n\t\tthis.attributes.addAttribute(new Attribute(measure.getName()));\n\t\treturn this;\n\t}",
"public abstract ImmutableSet<Measure> configuredMeasures(CalculationTarget target);",
"public interface GoodnessOfFitCalculator {\r\n\t// GoodnessOfFit method which takes a collection of points which is the measured data and then a theory to test\r\n\tdouble goodnessOfFit(Collection<Point> actual, Theory theory);\r\n\t\r\n}",
"public void setMeasure(int measure) {\n\t\tthis.measure = measure;\n\t}",
"public interface PointsGenerator {\r\n\t/**\r\n\t * Creates a <code>Series</code> object, which supplies the points.\r\n\t * \r\n\t * @param dimension dimension of the unit cube from which the points are selected\r\n\t * @return <code>Series</code> iterator\r\n\t * @see de.torstennahm.series.Series\r\n\t */\r\n\tSeries<double[]> makeSeries(int dimension);\r\n}",
"public interface CurveApproxCspaceTechnique\n extends Comparable<CurveApproxCspaceTechnique>, CurveApprox {\n public static final BigDecimal MINIMUM_MAX_LENGTH = BigDecimal.ZERO;\n\n BigDecimal getMaxLength();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prints the information that is necessary to be organized for club information | public String toString(){
return ("\nClub Name:\t\t" + clubName + "\n"+
"Number Of Members:\t" + numOfMembers + "\n"+
"University:\t\t" + university + "\n"+
"President:\t\t" + president + "\n\n");
} | [
"public void printInfo(){\n System.out.println(hubName);\n System.out.println(netmask);\n System.out.println(subnetFull);\n System.out.println(subnet);\n System.out.println(clientaddressList);\n System.out.println(infList);\n }",
"public void printDetails()\n {\n for(Member member : memberCollection)\n {\n System.out.println(\"this society is called \" + societyName + member);\n }\n }",
"void displayInfo () {\n if (batch==null ) { \n System.out.println(\"Name : \"+name);\n System.out.println(\"Address : \"+address);\n System.out.println(\"\\n\");\n } else {\n System.out.println(\"Name : \"+name);\n System.out.println(\"batch : \"+batch);\n System.out.println(\"ID : \"+id);\n System.out.println(\"CGPA : \"+cg);\n System.out.println(\"\\n\");\n }\n }",
"@Override\n public void printFootballClub() {\n if (footballClubs.isEmpty()){\n System.out.println(\"\\n!!!!!------Football Club List is Empty------!!!!!\");\n return;\n }\n\n\n System.out.println(\"\\n|--------------------------------------List of the all club--------------------------------------| \");\n\n Comparator comparator_1 = Comparator.comparing(FootballClub::getNumOfPoint).thenComparing(FootballClub::getScoreGoals);\n //footballClubs.sort(Comparator.comparing(FootballClub::getNumOfPoint).thenComparing(FootballClub::getReceiveGoals));\n Collections.sort(footballClubs,comparator_1);\n Collections.reverse(footballClubs);\n\n System.out.println(\"==============================================================================================================================================================|\");\n System.out.format(\"%-20s%-20s%-25s%-13s%-13s%-13s%-13s%-13s%-13s%-13s%n\",\"| Name \",\" | Location\",\" | Manager Name\",\"| win\",\"| Draw\",\"| Defeat\",\"| Score Goals\",\"| Receive Goals\",\"| Point\",\"| Matches\");\n System.out.println(\"==============================================================================================================================================================|\");\n\n\n //display all details\n for (SportClub club_A : footballClubs){\n\n if (club_A instanceof FootballClub) {\n System.out.format(\"%-21s%-23s%-25s%-13d%-13d%-13d%-13d%-15d%-13d%-13d%n\", club_A.getNameOfTheClub(), club_A.getLocation(), club_A.getNameOfTheManager(),\n ((FootballClub) club_A).getNumOfWinMatches(), ((FootballClub) club_A).getNumOfDrawMatches(), ((FootballClub) club_A).getNumOfDefeatMatches(),\n ((FootballClub) club_A).getScoreGoals(), ((FootballClub) club_A).getReceiveGoals(), ((FootballClub) club_A).getNumOfPoint(), ((FootballClub) club_A).getNumOfMatchesPlay());\n\n }\n if (club_A instanceof UniversityFootballClub){\n System.out.format(\"%-21s%-23s%-25s%-13d%-13d%-13d%-13d%-15d%-13d%-13d%n\", club_A.getNameOfTheClub(), club_A.getLocation(), club_A.getNameOfTheManager(),\n ((FootballClub) club_A).getNumOfWinMatches(), ((FootballClub) club_A).getNumOfDrawMatches(),((FootballClub) club_A).getNumOfDefeatMatches(),\n ((FootballClub) club_A).getScoreGoals(), ((FootballClub) club_A).getReceiveGoals(), ((FootballClub) club_A).getNumOfPoint(), ((FootballClub) club_A).getNumOfMatchesPlay(),\n ((UniversityFootballClub) club_A).getUniversityName(), ((UniversityFootballClub) club_A).getUniversityRank());\n\n }else if (club_A instanceof SchoolFootballClub){\n System.out.format(\"%-21s%-23s%-25s%-13d%-13d%-13d%-13d%-15d%-13d%-13d%n\", club_A.getNameOfTheClub(), club_A.getLocation(), club_A.getNameOfTheManager(), ((FootballClub) club_A).getNumOfWinMatches(), ((FootballClub) club_A).getNumOfDrawMatches(),\n ((FootballClub) club_A).getNumOfDefeatMatches(), ((FootballClub) club_A).getScoreGoals(), ((FootballClub) club_A).getReceiveGoals(),\n ((FootballClub) club_A).getNumOfPoint(), ((FootballClub) club_A).getNumOfMatchesPlay(),\n ((SchoolFootballClub) club_A).getSchoolName(), ((SchoolFootballClub) club_A).getSchoolRank());\n }\n System.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------------------------|\");\n\n }\n System.out.println();\n\n\n }",
"private void printTurnInfo() {\n System.out.println(\"\\n=====================[ Turn \" + (turnCount + 1) + \" - (P\" + whoPlaying.getPlayerNum() + \") ]=====================\");\n if (playedDeck.getSize() > 0) {\n System.out.println(\"Played Last: \" + getDeckString(playedDeck) + \"\\t\\t | \" + roundState);\n }\n System.out.println(\"Your Hand: \" + getDeckString(whoPlaying.getHand()) + \"\\t\\t | Size: \" + whoPlaying.getHand().getSize());\n }",
"public void printInfo(){\n\t\tSystem.out.println(\"User Name: \"+this.userName);\n\t\tSystem.out.println(\"Name: \"+this.name);\n\t\tSystem.out.println(\"Unique ID: \"+this.uniqueID);\n\t}",
"public void printInfo()\r\n {\r\n System.out.println(toString());\r\n System.out.println(\"Date Of Birth: \" + dob.toString());\r\n System.out.println(\"Phone Number: \" + phoneNumber);\r\n System.out.println(\"Person Type: \" + personStatus);\r\n System.out.println(address.toString());\r\n }",
"public void displayDetails() {\n System.out.println(\"Title:\" + title);\n System.out.println(\"Directed by\" + director);\n System.out.println(\"Running time: \" + runTime + \" minutes\");\n System.out.println(\"Cost: £\" + cost);\n }",
"public void printStatistics() {\n System.out.println(\"Number of Campers: \" + campers.size());\n }",
"private void printSummary () \n\t {\n\t for (int i = 0; i < this.numPlayers; i++) {\n\t System.out.println(this.players[i] + \" has \" + \n\t this.players[i].getNumChips() + \" chips.\");\n\t }\n\t }",
"public void playerDetailedInfo(Player p){\n System.out.println(\"Indicator: \" + indicator + \"\\nJoker: \"+joker);\n System.out.println(\"Winner: Player\" + p.getPlayerNo());\n System.out.println(\"Tile size: \" + p.getTiles().size());\n System.out.println(\"Joker count: \" + p.getJokerCount());\n System.out.println(\"Double score: \" + p.getDoubleCount()*2);\n System.out.println(\"All tiles in ascending order:\\t\" + p.getTiles());\n System.out.println(\"Clustered according to number: \\t\" + p.getNoClus());\n System.out.println(\"Total number clustering score: \" + p.totalNoClustering());\n System.out.println(\"Clustered according to color: \\t\" + p.getColClus());\n System.out.println(\"Total color clustering score: \" + p.totalColCluster());\n System.out.println(\"Final score of Player\"+p.getPlayerNo()+\": \" + p.getPlayerScore());\n }",
"public void diplayTownInfo()\n\t{\n\t\tSystem.out.println(\"Welcome to \" + townName);\n\t\tSystem.out.println(\"Visit the \" + museum.getName() + \" of \" + museum.getType());\n\t}",
"@Override\n public void displayStats() {\n if (clubDetailsList.size() == 0){\n System.out.println(\"No sports clubs currently stored.\");\n }\n else {\n int i = 1;\n for (SportsClub club : clubDetailsList) {\n System.out.println(i + \". \" + club.getNameOfClub());\n i++;\n }\n int clubName = validation.validateInt(\"Select club to display stats of\");\n try {\n System.out.println(clubDetailsList.get(clubName - 1));\n } catch (Exception e){\n System.out.println(\"Club with that number does not exist\");\n }\n }\n }",
"public void printDetails()\n {\n System.out.println(title);\n System.out.println(\"by \" + author);\n System.out.println(\"no. of pages: \" + pages);\n \n if(refNumber == \"\"){\n System.out.println(\"reference no.: zzz\");\n }\n else{\n System.out.println(\"reference no.: \" + refNumber);\n }\n \n System.out.println(\"no. of times borrowed: \" + borrowed);\n }",
"@Override\n public void displaySelectedFootballClubStatics(String footballClubName) {\n if (footballClubList.size() == 0) {\n System.out.println(\"\\n ***The Premier League is already empty!!***\\n\");\n } else {\n for (SportsClub footballClub : footballClubList) {\n if (footballClubName.equals(footballClub.getClubName())) {\n System.out.println(\"\\n==> Football club statistics: \");\n System.out.println(\"=> Football club name: \" + footballClub.getClubName());\n System.out.println(\"=> Football club location: \" + footballClub.getClubLocation());\n System.out.println(\"=> Football club chairman: \" + footballClub.getChairman());\n System.out.println(\"=> Football club founded year: \" + footballClub.getFoundedYear());\n FootballClub tempClub = (FootballClub) footballClub; //create variable to access subclass methods\n\n String tableFormat = \"| %-10d| %-10d| %-10d| %-10d| %-10d| %-10d| %-10d| %-10d|%n\";\n System.out.println(\"\\n|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|\");\n System.out.println(\"| MATCHES PLAYED | WIN | DEFEATS | DRAWS | GOALS SCORED | GOALS RECEIVED | GOAL DIFFERENCE | POINTS |\");\n System.out.println(\"|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|\");\n System.out.format(tableFormat,tempClub.getNumOfMatchesPlayed(),tempClub.getWin(),tempClub.getDefeats(),tempClub.getDraws(),tempClub.getNumOfGoalsScored(), tempClub.getNumOfGoalsReceived(),tempClub.getGoalDifference(),tempClub.getNumOfPoints());\n System.out.println(\"|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|\");\n return;\n }\n }\n System.out.println(\"\\n ****\\\"\"+footballClubName +\"\\\" isn't an existing football club in Premier League!!***\\n\");\n }\n }",
"public void toPrint(){\n System.out.println(\"--- START OBJECT DETAILS ---\");\n System.out.println(\"RaceCar Engine: \" + raceCarEngine.toString());\n for(int i=0; i<4; i++){\n System.out.println(\"RaceCar Tire: \" + (i+1) + \" \" + raceCarTire[i].toString());\n }\n System.out.println(\"RaceCar Body: \" + carBody);\n System.out.println(\"RaceCar Status: \" + carStarted);\n System.out.println(\"--- END OBJECT DETAILS ---\");\n }",
"public void printInfo()\n {\n System.out.println(name + \" at (\" + x +\",\" + y + \")\");\n }",
"public void printPlayerInformation() {\n\t\t System.out.println(\"Name : \"+getName());\n\t\t System.out.println(\"Stars : \"+getCurrentStar());\n\t\t System.out.println(\"Total Points : \"+getTotalPoints());\n\t}",
"private void displayChampionshipDetails()\n {\n displayLine();\n System.out.println(\"########Formula 9131 Championship Details########\");\n displayLine();\n System.out.println(getDrivers().getChampionshipDetails());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the prerequisites for the course. | public void setPrerequisites(CourseGroup prerequisites) {
this.prerequisites = prerequisites;
} | [
"public void setPreRequisites(Set<Course> preRequisites) {\n this.preRequisites = preRequisites;\n }",
"void addPrerequisites(List<String> prereq) {\n _prerequisites.addAll(prereq);\n }",
"void setRequiredCourses(ArrayList<Course> requiredCourses) {\r\n this.requiredCourses = requiredCourses;\r\n }",
"public void addPrereq(Course course) {\n this.prereqs.add(course);\n }",
"public void addPrerequisiteCourse(CourseUnit prerequisiteCourse) {\r\n this.prerequisiteCourses.add(prerequisiteCourse);\r\n }",
"public Course[] getPrerequisiteCourses() {\r\n return PREREQUISITE_COURSES;\r\n }",
"public void addPreReq(Course course) {\r\n\t\tpreReq.add(course);\r\n\t}",
"public Set<Course> getPreRequisites() {\n return preRequisites;\n }",
"public void startPreparation()\n {\n //Enters in critical region.\n mutex.down();\n\n //Get current thread.\n ClientProxy c = ( (ClientProxy) Thread.currentThread());\n\n //Chef confirms the order, waking up the waiter\n waitForChef.up();\n\n //Update chef's state to preparing course\n c.setChefState(ChefStates.PREPCO);\n repoStub.updateCourse(numCoursesDelivered + 1);\n\n //Leaves critical region.\n mutex.up();\n }",
"public void testSetCourses() {\n System.out.println(\"setCourses\");\n ArrayList<Course> courses = null;\n Student instance = null;\n instance.setCourses(courses);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public void setCourses(ArrayList<Course> Courses) {\n\t\tthis.Courses = Courses;\n\t}",
"private void setUpRequirements() {\r\n if (this.nodeTemplate.getRequirements() != null) {\r\n for (final TRequirement requirement : this.nodeTemplate.getRequirements().getRequirement()) {\r\n this.requirements.add(new RequirementImpl(requirement));\r\n }\r\n }\r\n }",
"public ArrayList<Course> getPrereqs() {\r\n\t\treturn this.prereqs;\r\n\t}",
"public void setCourse(UnivClass c){\n\t\tcourses.enqueue(c);\n\t}",
"public static void main(String[] args) {\n Course AbstractAdvancedJavaSuperClass = new AdvancedJavaCourse(\"AdvancedJava\", \"-003\");\r\n Course AbstractJavaSuperClass = new IntroJavaCourse(\"IntroJava\", \"-002\");\r\n Course AbstractProgramClass = new IntroToProgrammingCourse(\"Intro\", \"-001\");\r\n\r\n AbstractAdvancedJavaSuperClass.setCredits(4);\r\n AbstractJavaSuperClass.setCredits(4.0);\r\n AbstractProgramClass.setCredits(4.0);\r\n \r\n //this is a test\r\n \r\n AbstractAdvancedJavaSuperClass.setPrerequisites(AbstractJavaSuperClass.getCourseNumber());\r\n AbstractJavaSuperClass.setPrerequisites(AbstractProgramClass.getCourseNumber());\r\n \r\n System.out.println(AbstractProgramClass.getCapitalizedCourseName()\r\n + \" \" + AbstractProgramClass.getCourseNumber() );\r\n \r\n System.out.println(AbstractJavaSuperClass.getCourseName()\r\n + \" \" + AbstractJavaSuperClass.getCourseNumber() \r\n + \" \" + AbstractJavaSuperClass.getPrerequisites());\r\n \r\n System.out.println(AbstractAdvancedJavaSuperClass.getCourseName()\r\n + \" \" + AbstractAdvancedJavaSuperClass.getCourseNumber() \r\n + AbstractAdvancedJavaSuperClass.getPrerequisites() );\r\n}",
"Collection<ActivityData> getPrerequisites();",
"public void setDependencies(List<Dependency> dependencies) {\n this.dependencies = dependencies;\n }",
"public void continuePreparation()\n {\n //Enters in critical region.\n mutex.down();\n\n //Get current thread.\n ClientProxy c = ( (ClientProxy) Thread.currentThread());\n\n //Update chef's state to preparing course.\n c.setChefState(ChefStates.PREPCO);\n repoStub.updateCourse(numCoursesDelivered + 1);\n\n //Leaves critical region.\n mutex.up();\n }",
"public String addPrerequisites(Prerequisite[] prereqs) throws MalformedURLException, IOException{\n\t\tString route = crRoot + \"/api/prerequisites.php\";\n\t\tStringBuffer xml = new StringBuffer(\"<prerequisites>\");\n\t\tHashMap<String, String> params = new HashMap<String, String>();\n\t\t\n\t\tfor(Prerequisite p : prereqs){\n\t\t\txml.append(p.serialize());\n\t\t}\n\t\txml.append(\"</prerequisites>\");\n\t\tparams.put(\"prerequisite\", xml.toString());\n\t\t\n\t\treturn this.bufferStream(this.sendPostRequest(route, params));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FieldType s the new way to set the configuration. Before, in version 3.6, we had doc.add(new Field(CONTENTS_NAME, new FileReader(f),//Index file content TermVector.WITH_POSITIONS_OFFSETS)); Now we simply set this up in FieldType | protected Document getDocument(File f) throws IOException{
Document doc = new Document();
FieldType tft = new FieldType(TextField.TYPE_STORED);
tft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
Field textField = new Field(CONTENTS_NAME, new FileReader(f), tft);
doc.add(textField);
// TODO uncertain whether we need TYPE_STORED
FieldType sft = new FieldType(StringField.TYPE_STORED);
//tft.setIndexOptions(IndexOptions.);
Field stringField = new Field("filename", f.getName(), sft);
doc.add(stringField);
FieldType pft = new FieldType(StringField.TYPE_STORED);
Field pathField = new Field("fullpath", f.getCanonicalPath(), pft);
doc.add(pathField);
/*
* doc.add(new Field("filename", f.getName(), //Index file name Field.Store.YES,
* Field.Index.NOT_ANALYZED));
*
* doc.add(new Field("fullpath", f.getCanonicalPath(), //Index file full path
* Field.Store.YES, Field.Index.NOT_ANALYZED));
*
*/
return doc;
} | [
"@Test\n public void setFieldIndexFormat() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.write(\"A\");\n builder.insertBreak(BreakType.LINE_BREAK);\n builder.insertField(\"XE \\\"A\\\"\");\n builder.write(\"B\");\n\n builder.insertField(\" INDEX \\\\e \\\" · \\\" \\\\h \\\"A\\\" \\\\c \\\"2\\\" \\\\z \\\"1033\\\"\", null);\n\n doc.getFieldOptions().setFieldIndexFormat(FieldIndexFormat.FANCY);\n doc.updateFields();\n\n doc.save(getArtifactsDir() + \"Field.SetFieldIndexFormat.docx\");\n //ExEnd\n }",
"public FastClasspathScanner enableFieldTypeIndexing() {\n enableFieldTypeIndexing(true);\n return this;\n }",
"public static void addFullTextField(String name, String value, Document indexDoc) {\r\n // store base\r\n indexDoc.add(new Field(name, value, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS_OFFSETS));\r\n \r\n // store stemmed\r\n indexDoc.add(new Field(name + STEMMED_SUFFIX, value, Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.NO));\r\n\r\n // store stored\r\n indexDoc.add(new Field(name + STORED_SUFFIX, value, Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));\r\n \r\n }",
"private FieldType getContents_store() {\n return IndexManager.getContents_store();\n }",
"public static void addKeywordField(String name, String value, Document indexDoc) {\r\n if (value == null || value.trim().equals(\"\")) {\r\n // Store an indicator that the field is unset.\r\n indexDoc.add(new Field(name + PRESENT_SUFFIX, \"0\", Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.NO));\r\n } else {\r\n // Store an indicator that the field is set\r\n indexDoc.add(new Field(name + PRESENT_SUFFIX, \"1\", Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.NO));\r\n \r\n // Store the base version:\r\n // This version is tokenized, unstored and contains no\r\n // term-vector information. The tokenization is determined\r\n // by the analyzer but should be general enough for a simple\r\n // unqualified keyword search.\r\n indexDoc.add(new Field(name, value, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.NO));\r\n \r\n // Store the sort version: (if not already stored)\r\n // This field is normalized here and stored untokenized.\r\n if (indexDoc.getField(name + SORT_SUFFIX) == null) {\r\n indexDoc.add(new Field(name + SORT_SUFFIX, normalizeForSort(value), Field.Store.NO, Field.Index.UN_TOKENIZED, Field.TermVector.NO));\r\n }\r\n \r\n // Store the facet version:\r\n // This field must be STORED and UN_TOKENIZED to support the\r\n // various algorithms for facet generation.\r\n indexDoc.add(new Field(name + FACET_SUFFIX, value, Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));\r\n \r\n // Store the exact version:\r\n // This field must be UN_TOKENIZED.\r\n indexDoc.add(new Field(name + EXACT_SUFFIX, value, Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));\r\n \r\n // Store the stemmed version:\r\n // This field is tokenized, and the analyzer must be configured\r\n // to stem this sort of field.\r\n indexDoc.add(new Field(name + STEMMED_SUFFIX, value, Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.NO));\r\n }\r\n\r\n }",
"FieldType createFieldType();",
"public void setLBR_MDFeDocType (String LBR_MDFeDocType);",
"private static void setFieldDataToIndexTextField(String fieldName, Map<String, Object> indexFieldProperties) {\n // create keyword type property\n Map<String, Object> textTypeProperty = new HashMap<>();\n textTypeProperty.put(\"type\", \"text\");\n textTypeProperty.put(\"fielddata\", true);\n addFieldMapping(fieldName, textTypeProperty, indexFieldProperties);\n }",
"public void setDocumentType (String DocumentType);",
"@Test\n public void fieldIndexFormatting() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n index.setLanguageId(\"1033\");\n\n // Setting this property's value to \"A\" will group all the entries by their first letter,\n // and place that letter in uppercase above each group.\n index.setHeading(\"A\");\n\n // Set the table created by the INDEX field to span over 2 columns.\n index.setNumberOfColumns(\"2\");\n\n // Set any entries with starting letters outside the \"a-c\" character range to be omitted.\n index.setLetterRange(\"a-c\");\n\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n\n // These next two XE fields will show up under the \"A\" heading,\n // with their respective text stylings also applied to their page numbers.\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apple\");\n indexEntry.isItalic(true);\n\n Assert.assertEquals(\" XE Apple \\\\i\", indexEntry.getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apricot\");\n indexEntry.isBold(true);\n\n Assert.assertEquals(\" XE Apricot \\\\b\", indexEntry.getFieldCode());\n\n // Both the next two XE fields will be under a \"B\" and \"C\" heading in the INDEX fields table of contents.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Banana\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Cherry\");\n\n // INDEX fields sort all entries alphabetically, so this entry will show up under \"A\" with the other two.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Avocado\");\n\n // This entry will not appear because it starts with the letter \"D\",\n // which is outside the \"a-c\" character range that the INDEX field's LetterRange property defines.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Durian\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"1033\", index.getLanguageId());\n Assert.assertEquals(\"A\", index.getHeading());\n Assert.assertEquals(\"2\", index.getNumberOfColumns());\n Assert.assertEquals(\"a-c\", index.getLetterRange());\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n Assert.assertEquals(\"\\fA\\r\" +\n \"Apple, 2\\r\" +\n \"Apricot, 3\\r\" +\n \"Avocado, 6\\r\" +\n \"B\\r\" +\n \"Banana, 4\\r\" +\n \"C\\r\" +\n \"Cherry, 5\\r\\f\", index.getResult());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apple \\\\i\", \"\", indexEntry);\n Assert.assertEquals(\"Apple\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertTrue(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apricot \\\\b\", \"\", indexEntry);\n Assert.assertEquals(\"Apricot\", indexEntry.getText());\n Assert.assertTrue(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Banana\", \"\", indexEntry);\n Assert.assertEquals(\"Banana\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(4);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Cherry\", \"\", indexEntry);\n Assert.assertEquals(\"Cherry\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(5);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Avocado\", \"\", indexEntry);\n Assert.assertEquals(\"Avocado\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(6);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Durian\", \"\", indexEntry);\n Assert.assertEquals(\"Durian\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n }",
"MemberMetadata setFieldType(String type);",
"FieldDefinition createFieldDefinition();",
"public abstract void setFileType(TagContent type) throws TagFormatException;",
"private void addContentToLuceneDoc() {\n\t\t// Finish storing the document in the document store (parts of it may already have been\n\t\t// written because we write in chunks to save memory), retrieve the content id, and store\n\t\t// that in Lucene.\n\t\tint contentId = storeCapturedContent();\n\t\tcurrentLuceneDoc.add(new NumericField(ComplexFieldUtil.fieldName(\"contents\", \"cid\"),\n\t\t\t\tStore.YES, false).setIntValue(contentId));\n\n\t\t// Store the different properties of the complex contents field that were gathered in\n\t\t// lists while parsing.\n\t\tcontentsField.addToLuceneDoc(currentLuceneDoc);\n\t}",
"public void setFieldType(int value) {\r\n this.fieldType = value;\r\n }",
"public void setDocumentType(String documentType);",
"List<FieldType> getFields(DocType document);",
"public FieldDefinition(String file)\n\t{\n\t\tsetFile(file);\n\t}",
"public interface IndexMetadata extends Freezable<IndexMetadata> {\n\t\n\tAnnotatedFields annotatedFields();\n\t\n\tdefault AnnotatedField mainAnnotatedField() {\n\t return annotatedFields().main();\n\t}\n\t\n default AnnotatedField annotatedField(String name) {\n return annotatedFields().get(name);\n }\n \n\tMetadataFields metadataFields();\n\t\n\tdefault MetadataField metadataField(String name) {\n\t return metadataFields().get(name);\n\t}\n\n\t/**\n\t * Get the display name for the index.\n\t *\n\t * If no display name was specified, returns the name of the index directory.\n\t *\n\t * @return the display name\n\t */\n\tString displayName();\n\n\t/**\n\t * Get a description of the index, if specified\n\t * @return the description\n\t */\n\tString description();\n\n\t/**\n\t * Is the content freely viewable by all users, or is it restricted?\n\t * @return true if the full content may be retrieved by anyone\n\t */\n\tboolean contentViewable();\n\n /**\n * What's the text direction of this corpus?\n * @return text direction\n */\n\tTextDirection textDirection();\n\n\t/**\n\t * What format(s) is/are the documents in?\n\t *\n\t * This is in the form of a format identifier as understood\n\t * by the DocumentFormats class (either an abbreviation or a\n\t * (qualified) class name).\n\t *\n\t * @return the document format(s)\n\t */\n\tString documentFormat();\n\n\t/**\n\t * What version of the index format is this?\n\t * @return the index format version\n\t */\n\tString indexFormat();\n\n\t/**\n\t * When was this index created?\n\t * @return date/time\n\t */\n\tString timeCreated();\n\n\t/**\n\t * When was this index last modified?\n\t * @return date/time\n\t */\n\tString timeModified();\n\n\t/**\n\t * When was the BlackLab.jar used for indexing built?\n\t * @return date/time\n\t */\n\tString indexBlackLabBuildTime();\n\n\t/**\n\t * When was the BlackLab.jar used for indexing built?\n\t * @return date/time stamp\n\t */\n\tString indexBlackLabVersion();\n\n\t/**\n\t * How many tokens are in the index?\n\t * @return number of tokens\n\t */\n\tlong tokenCount();\n\n\t/**\n\t * Is this a new, empty index?\n\t *\n\t * An empty index is one that doesn't have a main contents field yet,\n\t * or has a main contents field but no indexed tokens yet.\n\t *\n\t * @return true if it is, false if not.\n\t */\n\tboolean isNewIndex();\n\n default boolean subannotationsStoredWithParent() {\n return false;\n }\n\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the valorOutros value for this CustoEfetivoTotal. | public java.lang.Double getValorOutros() {
return valorOutros;
} | [
"public BigDecimal getValorTotal(){\r\n\t\r\n\t\t// percorre a lista de ItemVenda - stream especie de interator do java 8\r\n\t\treturn itens.stream()\r\n\t .map(ItemVenda::getValorTotal) // para cada um dos itens, obtem o valor total do item\t\r\n\t .reduce(BigDecimal::add) // soma todos os valores total \r\n\t .orElse(BigDecimal.ZERO); // caso não tenha nenhum item retorna zeo\r\n\t}",
"public void setValorOutros(java.lang.Double valorOutros) {\n this.valorOutros = valorOutros;\n }",
"public double getCustoTotal(){\r\n return despesas + entrada;\r\n }",
"public double getValorTotal() {\n return valorTotal;\n }",
"public java.math.BigDecimal getVALORIMPUESTOS() {\r\n return VALORIMPUESTOS;\r\n }",
"public float valorTotalItem()\r\n {\r\n float total = (jogo.getValor() - (jogo.getValor() * desconto)) * quantidade;\r\n return total;\r\n }",
"public Integer obterTotalClientesAnteriores() \r\n\t\t\tthrows ErroRepositorioException;",
"public int getEgresosPorCompras(){\n return this.egresosPorCompras;\n }",
"public cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento.TotalesServicio[] getTotalesServicioArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(TOTALESSERVICIO$4, targetList);\r\n cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento.TotalesServicio[] result = new cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento.TotalesServicio[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento[] getTotalesSegmentoArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(TOTALESSEGMENTO$0, targetList);\r\n cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento[] result = new cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenSegmento.TotalesSegmento[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public float valorTotalItem()\r\n {\r\n float total = (produto.getValor() - (produto.getValor() * desconto)) * quantidade;\r\n return total;\r\n }",
"public int getDatossolicitudBfmarcaProductoSolicitado() {\n return datossolicitudBfmarcaProductoSolicitado;\n }",
"@Override\n\tpublic int getValorSeguro() {\n\t\treturn this.valor;\n\t}",
"public java.lang.String getDescricao_cargo_totvs() {\n return descricao_cargo_totvs;\n }",
"public cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenPeriodo.TotalesPeriodo.TotalesServicio[] getTotalesServicioArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(TOTALESSERVICIO$4, targetList);\r\n cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenPeriodo.TotalesPeriodo.TotalesServicio[] result = new cl.sii.siiDte.libroboletas.LibroBoletaDocument.LibroBoleta.EnvioLibro.ResumenPeriodo.TotalesPeriodo.TotalesServicio[targetList.size()];\r\n targetList.toArray(result);\r\n return result;\r\n }\r\n }",
"public Double darTiempoTotal(){\n\t\treturn tiempoComputacionalGrasp+tiempoComputacionalSetCovering;\n\t}",
"public double calculaValor() throws QuartoDesocupadoException{\n\t\tif(this.getEstadia() != null){\n\t\t\treturn this.getEstadia().calculaValor(this.tipo);\t\t\t\n\t\t}\n\t\tthrow new QuartoDesocupadoException(String.format(\"Quarto %s nao esta ocupado.\", this.getNumero()));\n\t}",
"public java.math.BigDecimal getValTotBoletasVendidas() {\n\t\treturn valTotBoletasVendidas;\n\t}",
"public java.lang.Integer getValor_servicio() {\n return valor_servicio;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that the sum of all angles is 360 | protected boolean angleValidityCheck(double alpha, double beta, double gamma, double delta){
if(alpha+beta+gamma+delta!=360)
throw new IllegalArgumentException("Total of all angles should always be 360");
return true;
} | [
"private boolean checkAngle() {\n\t\tint bornes = FILTER_BORNES;\n\t\treturn checkAngleBornes(angle, 0d, bornes) || checkAngleBornes(angle, 90d, bornes) || checkAngleBornes(angle, 180d, bornes);\n\t}",
"public boolean isAngleOkay(){if(wheelError() < Constants.TURNING_ADD_POWER_THRESHOLD) {return true;} else {return false;}}",
"public void checkForAngle() {\r\n \r\n long iterations = (long)(SECONDS_IN_TWELVE_HOURS/timeSlice);\r\n \r\n for(int i = 0; i < iterations; i++) {\r\n if(inputAngle < (MAXIMUM_DEGREE_VALUE/2)) {\r\n if(Math.abs(inputAngle - clock.getHandSmallerAngle()) < epsilonValue) {\r\n System.out.println(\"\" + clock.toString());\r\n }\r\n }\r\n else {\r\n if(Math.abs(inputAngle - clock.getHandLargerAngle()) < epsilonValue) {\r\n System.out.println(\"\" + clock.toString());\r\n }\r\n }\r\n clock.tick(); \r\n } \r\n }",
"public static double wrapAngle360(double angle){\r\n return angle%360;\r\n }",
"@Test\n void degreesToRadians() {\n float degrees = 180;\n assertEquals(Math.PI, Utilities.degreesToRadians(degrees), DELTA);\n\n degrees = 270;\n assertEquals(Math.PI * 3 / 2, Utilities.degreesToRadians(degrees), DELTA);\n }",
"public static void main(String[] args) {\n\n short angle1 = 0;\n short angle2 = 180;\n short angle3 = 0;\n\n int sumOfAngles = angle1 + angle2 + angle3;\n\n boolean validTriangle = sumOfAngles == 180;\n\n if (validTriangle){\n System.out.println(\"the shape is a triangle\");\n }\n if(!validTriangle){\n System.out.println(\"the shape is not valid\");\n }\n\n\n\n\n\n }",
"public static boolean anglePairs(int angle1, int angle2, int angle3) {\n int oneTwo = angle1 + angle2;\n int twoThree = angle2 + angle3;\n int oneThree = angle1 + angle3;\n boolean comple = false;\n boolean supple = false;\n boolean yesCompSup = false;\n if (oneTwo == 90 || twoThree == 90 || oneThree == 90) {\n comple = true;\n }\n if (oneTwo == 180 || twoThree == 180 || oneThree == 180) {\n supple = true;\n }\n if (comple == true && supple == true) {\n yesCompSup = true;\n }\n return yesCompSup;\n}",
"protected void calculateTotalDegrees() {\r\n\t\tmTotalCircleDegrees = (360f - (mStartAngle - mEndAngle)) % 360f; // Length of the entire circle/arc\r\n\t\tif (mTotalCircleDegrees <= 0f) {\r\n\t\t\tmTotalCircleDegrees = 360f;\r\n\t\t}\r\n\t}",
"protected void calculateTotalDegrees() {\n\t\tmTotalCircleDegrees = (360f - (mStartAngle - mEndAngle)) % 360f; // Length of the entire circle/arc\n\t\tif (mTotalCircleDegrees <= 0f) {\n\t\t\tmTotalCircleDegrees = 360f;\n\t\t}\n\t}",
"boolean hasIsFixAngle();",
"public static double constrain360(double input)\r\n {\r\n double temp = input % 360.0;\r\n return input >= 0.0 ? temp : temp + 360.0;\r\n }",
"@Test\n void radiansToDegrees() {\n float radians = (float) Math.PI / 2;\n assertEquals(90, Utilities.radiansToDegrees(radians), DELTA);\n\n radians = (float) (2 * Math.PI);\n assertEquals(360, Utilities.radiansToDegrees(radians), DELTA);\n\n }",
"public static double to_360(double deg) {\n return modulo(deg,360);\n }",
"private static boolean searchRotationAngle(Point3d[] centers, int axis, double maxAngle, double targetArea) {\n Point3d[] origCenters = new Point3d[3];\n for (int i = 0; i < centers.length; i++) origCenters[i] = new Point3d(centers[i].x, centers[i].y, centers[i].z);\n double from = 0;\n double to = maxAngle;\n while (true) {\n double mid = (from + to) / 2;\n switch (axis) {\n case 0:\n for (int i = 0; i < centers.length; i++) {\n centers[i] = new Point3d(\n origCenters[i].x,\n origCenters[i].y * Math.cos(mid) - origCenters[i].z * Math.sin(mid),\n origCenters[i].y * Math.sin(mid) + origCenters[i].z * Math.cos(mid));\n }\n break;\n case 1:\n for (int i = 0; i < centers.length; i++) {\n centers[i] = new Point3d(\n origCenters[i].x * Math.cos(mid) - origCenters[i].z * Math.sin(mid),\n origCenters[i].y,\n origCenters[i].x * Math.sin(mid) + origCenters[i].z * Math.cos(mid));\n }\n break;\n case 2:\n for (int i = 0; i < centers.length; i++) {\n centers[i] = new Point3d(\n origCenters[i].x * Math.cos(mid) - origCenters[i].y * Math.sin(mid),\n origCenters[i].x * Math.sin(mid) + origCenters[i].y * Math.cos(mid),\n origCenters[i].z);\n }\n break;\n default:\n throw new IllegalStateException();\n }\n double currentArea = computeArea(centers);\n if (Math.abs(currentArea - targetArea) < 1E-6) {\n System.err.println(\"Angle (degrees): \" + (mid * 180.0 / Math.PI) + \" on axis \" + axis + \" computer area: \" + currentArea + \" from \" + from + \" to \" + to);\n return true;\n } else if (currentArea < targetArea) {\n if (from >= to - 1E-7) return false;\n from = mid;\n } else {\n to = mid;\n }\n }\n }",
"private int isDegreeValueInsideArcLimits(float degrees, Arc arc) {\n if (degrees < (DEGREES_90 + arc.getStartAngle())) {\n return -1;\n } else if (degrees > arc.getMaxSweepAngle() + (DEGREES_90 + arc.getStartAngle())) {\n return 1;\n } else {\n return 0;\n }\n }",
"public static boolean isInDegrees(TimeSeriesTable table) {\n return opensimCommonJNI.TableUtilities_isInDegrees(TimeSeriesTable.getCPtr(table), table);\n }",
"public static double boundDegrees360(double angle) {\n\t\twhile (angle >= 360.0) {\n\t\t\tangle -= 360.0;\n\t\t}\n\t\twhile (angle < 0.0) {\n\t\t\tangle += 360.0;\n\t\t}\n\t\treturn angle;\n\t}",
"protected boolean areAllAnglesRight(double alpha, double beta, double gamma, double delta){\n return (alpha==beta && beta==gamma && gamma==delta && delta==alpha);\n }",
"private static double convertBearingTo360(double dBearing){\n\t\t\n\t\t//dOut = output\n\t\t\n\t\tdouble dOut;\n\t\t\n\t\tdOut = dBearing;\n\t\t\n\t\twhile(dOut>360){\n\t\t\tdOut=dOut-360.;\n\t\t}\n\t\twhile(dOut<0){\n\t\t\tdOut=dOut+360.;\n\t\t}\n\t\t\n\t\treturn dOut;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch share functionality tests | @Test (priority = 1)
public void switchShare() throws InterruptedException, Exception {
Actions share = new Actions(driver);
WebElement sh = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/a")); Thread.sleep(3000);
share.moveToElement(sh).build().perform(); Thread.sleep(3000); sh.click();
System.out.println("Share switch link clicked");
Actions share1 = new Actions(driver);
WebElement dallpp = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/ul/li[3]/a"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", dallpp); // scroll here
share1.moveToElement(dallpp).build().perform(); Thread.sleep(3000);
dallpp.click(); Thread.sleep(3000);
NotificationsCS.captureScreenShot(driver);
Actions share2 = new Actions(driver);
WebElement sh1 = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/a")); Thread.sleep(3000);
share2.moveToElement(sh1).build().perform(); Thread.sleep(3000); sh1.click(); Thread.sleep(3000);
WebElement kg = driver.findElement(By.xpath("html/body/nav/div/div[1]/ul[1]/li/ul/li[10]/a"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", kg); // scroll here
share2.moveToElement(kg).build().perform(); Thread.sleep(4000);
kg.click(); Thread.sleep(3000);
System.out.println("KG Share opened, to test notifications");
} | [
"private void doTests()\n {\n doDeleteTest(); // doSelectTest();\n }",
"@Test public void runCommonTests() {\n\t\trunAllTests();\n\t}",
"@Test\n public void onSearchRideActionTest() {\n onSearchRideActionWithNetworkConfigTest(false);\n onSearchRideActionWithNetworkConfigTest(true);\n }",
"@Test\n @SmallTest\n @Feature({\"Homepage\"})\n public void testToggleSwitch() {\n mHomepageTestRule.useCustomizedHomepageForTest(TEST_URL_FOO);\n mHomepageTestRule.useChromeNTPForTest();\n\n launchHomepageSettings();\n\n Assert.assertTrue(ASSERT_MESSAGE_SWITCH_ENABLE, mSwitch.isEnabled());\n Assert.assertTrue(ASSERT_MESSAGE_TITLE_ENABLED, mTitleTextView.isEnabled());\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_ENABLED, mChromeNtpRadioButton.isEnabled());\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_ENABLED, mCustomUriRadioButton.isEnabled());\n Assert.assertTrue(\"Homepage should be enabled.\", HomepageManager.isHomepageEnabled());\n\n // Check the widget status\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_NTP_CHECK, mChromeNtpRadioButton.isChecked());\n Assert.assertFalse(\n ASSERT_MESSAGE_RADIO_BUTTON_CUSTOMIZED_CHECK, mCustomUriRadioButton.isChecked());\n Assert.assertEquals(ASSERT_MESSAGE_EDIT_TEXT, TEST_URL_FOO,\n mCustomUriRadioButton.getPrimaryText().toString());\n\n // Click the switch\n mSwitch.performClick();\n Assert.assertFalse(\"After toggle the switch, \" + ASSERT_MESSAGE_TITLE_DISABLED,\n mTitleTextView.isEnabled());\n Assert.assertFalse(\"After toggle the switch, \" + ASSERT_MESSAGE_RADIO_BUTTON_DISABLED,\n mChromeNtpRadioButton.isEnabled());\n Assert.assertFalse(\"After toggle the switch, \" + ASSERT_MESSAGE_RADIO_BUTTON_DISABLED,\n mCustomUriRadioButton.isEnabled());\n Assert.assertFalse(\"Homepage should be disabled after toggle switch.\",\n HomepageManager.isHomepageEnabled());\n\n // Check the widget status - everything should remain unchanged.\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_NTP_CHECK, mChromeNtpRadioButton.isChecked());\n Assert.assertFalse(\n ASSERT_MESSAGE_RADIO_BUTTON_CUSTOMIZED_CHECK, mCustomUriRadioButton.isChecked());\n Assert.assertEquals(ASSERT_MESSAGE_EDIT_TEXT, TEST_URL_FOO,\n mCustomUriRadioButton.getPrimaryText().toString());\n\n mSwitch.performClick();\n Assert.assertTrue(ASSERT_MESSAGE_TITLE_ENABLED, mTitleTextView.isEnabled());\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_ENABLED, mChromeNtpRadioButton.isEnabled());\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_ENABLED, mCustomUriRadioButton.isEnabled());\n Assert.assertTrue(\"Homepage should be enabled again.\", HomepageManager.isHomepageEnabled());\n\n // Check the widget status - everything should remain unchanged.\n Assert.assertTrue(ASSERT_MESSAGE_RADIO_BUTTON_NTP_CHECK, mChromeNtpRadioButton.isChecked());\n Assert.assertFalse(\n ASSERT_MESSAGE_RADIO_BUTTON_CUSTOMIZED_CHECK, mCustomUriRadioButton.isChecked());\n Assert.assertEquals(ASSERT_MESSAGE_EDIT_TEXT, TEST_URL_FOO,\n mCustomUriRadioButton.getPrimaryText().toString());\n\n // Histogram for location change should not change when toggling switch preference.\n assertUserActionRecorded(false);\n }",
"@Test\r\n public void testEnableStraightPlayMode(){\r\n\r\n }",
"public void executeTest(MultiTestMethod method);",
"private void testSomething() {\n testGetPickupStates();\n }",
"@Test(dependsOnMethods={\"C_Verify_First_Name_Is_Displayed_On_Home_Page_After_Signing_Into_App\"})\n\tpublic void D_Send_Review_Thru_CombinedWizard_Using_Existing_Session() {\n\t\t test.sendReviewCombinedWizardAndVerifyGivenReviewAppearOnHomePage(test.getYamlVal(\"otherprofile.username\"),test.getYamlVal(\"otherprofile.reviewComment\"), test.getYamlVal(\"otherprofile.starRating\"), true,test.getYamlVal(\"recommendFriendList.email1\"), test.getYamlVal(\"recommendFriendList.email2\"), test.getYamlVal(\"recommendFriendList.email3\"),test.getYamlVal(\"otherprofile.username\"));\n\t}",
"@Override\n public void testReExportService() {\n }",
"@Test\n\tpublic void testAliasesForBehaviorDrivenDevelopment() {\n\n\t}",
"@Test\n public void testFromSameAuthor(){\n // Not implemented yet\n }",
"@Test\n public void testShareButton() {\n //Clicking the submit button and checking for correct toast pop\n onView(withId(R.id.shareButton)).perform(click());\n onView(withText(\"Clicked on Share\"))\n .inRoot(withDecorView(Matchers.not(is(mActivityRule.getActivity().getWindow().getDecorView()))))\n .check(matches(isDisplayed()));\n }",
"public void invokeTest() {\n\t\t\t\n\t\t}",
"@Test\n\tpublic void test02_LikesunlikeYourActivities() {\n\t\tinfo(\"Test 2: Likes/unlike your activities\");\n\t\t/*Step Number: 1\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 1: Add new activities\n\t\t *Input Data: \n\t\t\t- Sign in system\n\t\t\t- Select Activities page on User Toolbar portlet in the upper right corner of the screen\n\t\t\t- Select activity in the left pane\n\t\t\t- Enter some text into text box\n\t\t\t- Click on [Share] button\n\t\t *Expected Outcome: \n\t\t\tAdd an activity successfully:\n\t\t\t- This activity is added into users activities list.User who is in your contact, can view your active on his/her activity list*/\n\t\tString username1 = txData.getContentByArrayTypeRandom(4) + getRandomString();\n\t\tString email1 = username1+\"@gmail.com\";\n\t\tinfo(\"Add new user\");\n\t\tnavTool.goToAddUser();\n\t\taddUserPage.addUser(username1, password, email1, username1, username1);\n\t\tmagAc.signIn(username1,password);\n\t\tUtils.pause(3000);\n\n\t\tnavTool.goToMyActivities();\n\t\tString activity1 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\thpAct.addActivity(activity1, \"\");\n\t\t\n\t\t/*Step number: 2\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 2: Like activity\n\t\t *Input Data: \n\t\t\t- Click on Like under activity\n\t\t *Expected Outcome: \n\t\t\tShow the message: “you like thisâ€. Like link is change to Unlike link*/\n\t\thpAct.likeActivity(activity1);\n\t\t\n\t\t/*Step number: 3\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 3: Unlike a activity\n\t\t *Input Data: \n\t\t\t- User who liked the activity logs in\n\t\t\t- Select the activity\n\t\t\t- Click on Unlike link\n\t\t *Expected Outcome: \n\t\t\tUser is moved out list of users like the activity. Unlike link is changed to Like link*/ \n\t\thpAct.unlikeActivity(activity1);\n\t}",
"public void startTests() {\n if(testSettings.accessibleProperties || testSettings.accessibleInterface)\n testProperties();\n if(testSettings.tabTraversal)\n testTraversal();\n }",
"@Test\n public void testEnterTemplates() {\n //System.out.println(\"enterTemplates\");\n }",
"@Test\n \tpublic void testAccess() {\t\t\n \t\ttry {\n \t\t// Test that the owner can add an action\n \t\tcontext.login(person);\n \t\tCustomActionValue value1 = sub.addCustomAction(def, true).save();\n \t\tvalue1.setValue(false);\n \t\tvalue1.save();\n \t\t\n \t\t// Test that a reviewer can add an action\n \t\tcontext.login(MockPerson.getReviewer());\n \t\tvalue1.setValue(false);\n \t\tvalue1.save();\n \n \t\t// Test that a someone else can not add an action.\n \t\tcontext.login(MockPerson.getStudent());\n \t\ttry {\n \t\t\tsub.addCustomAction(def, true).save();\n \t\t\tfail(\"Someone else was able to add an action value to a submission.\");\n \t\t} catch (SecurityException se) {\n \t\t\t/* yay */\n \t\t}\t\n \t\t} finally {\n \t\tcontext.login(MockPerson.getAdministrator());\n \t\t}\n \t}",
"@Test(dependsOnMethods = \"selectSite\")\n public void isSiteFavouriteTest()\n {\n SharePage page = resolvePage(driver).render();\n dashBoard = page.getNav().selectMyDashBoard().render();\n MySitesDashlet dashlet = dashBoard.getDashlet(\"my-sites\").render();\n //Site created by api is not a favorite by default.\n Assert.assertFalse(dashlet.isSiteFavourite(siteName));\n dashlet.selectFavorite(siteName);\n Assert.assertTrue(dashlet.isSiteFavourite(siteName));\n Assert.assertFalse(dashlet.isSiteFavourite(sampleSiteFullName));\n }",
"@Test(groups = {\"functest\", \"platform\", \"PlatformReg2\"}, priority = 2)\n \tpublic void testBlankStoryWithJSEmbedMapSocialShares() \n \t{\n \t\tWorkspacePage workspacePage = new WorkspacePage(driver);\n \t\tStoryTypePage storyTypePage = new StoryTypePage(driver);\n \t\tNewStoryPage newStoryPage = new NewStoryPage(driver);\n\n \t\tAssert.assertEquals(driver.getTitle(), \"Workspace\", \"Itsman is down or not reachable at this moment\");\n \t\tworkspacePage.clickNewStoryButton();\t\t// Click on New Story Button\n \t\tstoryTypePage.clickBlankStoryButton();\t\t// Click on Blank Story Button\n \t\tnewStoryPage.enterTitleFieldData(\"Text story with JS, Map & Social Shares\");\t// Enter the Title field data\n \t\tnewStoryPage.enterSubTitleFieldData(dataPropertyFile.getProperty(\"Sub_Title\"));\n \t\tnewStoryPage.selectHeroImage(dataPropertyFile.getProperty(\"Hero_Image_Name\"));\t\t\t\t// Select Hero Image with Image Caption\t\t\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterTextFieldData(dataPropertyFile.getProperty(\"Text_Data\"));\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.addMap(dataPropertyFile.getProperty(\"Location_To_Search\"));\t\t\t\t\t\t// Add Map location\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterJSEmbedFieldData(dataPropertyFile.getProperty(\"JSEmbed\"));\t\t// Enter JS Embed field data\n\t\t\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterYoutubeFieldData(dataPropertyFile.getProperty(\"Youtube_URL\"));\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterSoundCloudFieldData(dataPropertyFile.getProperty(\"SoundCloud_URL\"));\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterInstaFieldData(dataPropertyFile.getProperty(\"Instagram_URL\"));\n \t\tnewStoryPage.clickNewCardAddButton();\n \t\tnewStoryPage.enterTwitterFieldData(dataPropertyFile.getProperty(\"Twitter_URL\"));\n\t\t\n \t\tnewStoryPage.clickMetadataLink();\t\t\t// Change the tab to Metadata\n \t\tnewStoryPage.enterSocialShareFieldData(dataPropertyFile.getProperty(\"Social_Share\"));\t// Enter Social Share Data \n \t\tnewStoryPage.enterTagFieldData(dataPropertyFile.getProperty(\"Tag_Name\"));\t\t\t// Enter the Tag Data\n \t\tnewStoryPage.enterSectionFieldData(dataPropertyFile.getProperty(\"Section_Name\"));\t\t// Enter the Section Data\n \t\tnewStoryPage.enterCustomURLFieldData(dataPropertyFile.getProperty(\"Custom_URL\"));\t\t// Enter Custom URL\n \t\tnewStoryPage.clickSaveButton();\t\t\t\t// Click Save button\n \t\tAssert.assertTrue(newStoryPage.clickSubmitButton(), \"One of the mandatory field is not filled before Submitting the story\");\n \t\tnewStoryPage.clickApproveButton();\t\t\t// Click Approve button\n \t\tnewStoryPage.clickPublishButton();\t\t\t// Click Publish button\t\t\n \t\tAssert.assertTrue(newStoryPage.clickPublishLink(), \"One of the card element might left empty while publishing a Blank Story\");\n \t\tAssert.assertTrue(Verification.verifyStoryOnWorkspace(\"Published\", newStoryPage.getEnteredStoryTitle()));\n\t\t\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate docs array with 8 preconfigured docs | private void initialiseDocArray()
{
docs[0] = new Doc(1234500001, "A New Hope", "pdf");
docs[1] = new Doc(1234500002, "Empire Strikes Back", "msg");
docs[2] = new Doc(1234500003, "Return of the Jedi", "txt");
docs[3] = new Doc(1234500004, "The Hobbit", "pdf");
docs[4] = new Doc(1234500005, "Fellowship of the Ring", "txt");
docs[5] = new Doc(1234500006, "Two Towers", "msg");
docs[6] = new Doc(1234500007, "Return of the King", "pdf");
docs[7] = new Doc(1234500008, "Macbeth", "txt");
} | [
"public void setDocs(Doc[] newDocs) \n {\n\tdocs = newDocs;\n }",
"private void initializeAddDocObjects()\r\n {\r\n initializeUpdateHandler();\r\n initializeAddUpdateCommand();\r\n initializeDocBuilder();\r\n }",
"public void setDocs(String docs) {\n\t\tthis.docs = docs;\n\t}",
"private void createDocs() {\n\t\t\n\t\tArrayList<Document> docs=new ArrayList<>();\n\t\tString foldername=\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\input\";\n\t\tFile folder=new File(foldername);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tfor (File file : listOfFiles) {\n\t\t\ttry {\n\t\t\t\tFileInputStream fisTargetFile = new FileInputStream(new File(foldername+\"\\\\\"+file.getName()));\n\t\t\t\tString fileContents = IOUtils.toString(fisTargetFile, \"UTF-8\");\n\t\t\t\tString[] text=fileContents.split(\"ParseText::\");\n\t\t\t\tif(text.length>1){\n\t\t\t\t\tString snippet=text[1].trim().length()>100 ? text[1].trim().substring(0, 100): text[1].trim();\n\t\t\t\t\tDocument doc=new Document();\n\t\t\t\t\tdoc.setFileName(file.getName().replace(\".txt\", \"\"));\n\t\t\t\t\tdoc.setUrl(text[0].split(\"URL::\")[1].trim());\n\t\t\t\t\tdoc.setText(snippet+\"...\");\n\t\t\t\t\tdocs.add(doc);\n\t\t\t\t}\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t}\t\n\t\tDBUtil.insertDocs(docs);\n\t}",
"public void setNumberOfDocs(Integer numberOfDocs) {\n this.numberOfDocs = numberOfDocs;\n }",
"public void seperateDocsInFile() {\r\n try {\r\n docsBeforeParse = new HashMap<>();\r\n for (int i = 0; i < FILES_PER_CHUNK && filesCounter < totalFilesToRead; i++) {\r\n Document document = Jsoup.parse(new File(filePaths.get(filesCounter)), \"UTF-8\");\r\n Elements documents = document.getElementsByTag(\"DOC\");\r\n filesCounter++;\r\n splitDoc_Header_Text(documents);\r\n }\r\n }\r\n catch (Exception e){ e.getCause(); }\r\n }",
"private void createIndex(String[][] docs) {\n Collections.shuffle(Arrays.asList(docs), random());\n for (String[] doc : docs) {\n assertU(adoc(doc));\n if (random().nextBoolean()) {\n assertU(commit());\n }\n }\n assertU(commit());\n }",
"Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);",
"public void init() {\n\t\tfor(int i = 0; i < 5; i++) {\n\t\t\tpageLists.add(new Page(i));\n\t\t}\n\t}",
"public void initializeDocumentList(){\n\t\tdocumentList = new ArrayList<String>();\n\t\tFile file; \n\t\tScanner s;\n\t\ttry{\n\t\t\tfile = new File(documentNamesFile);\n\t\t\ts = new Scanner(file);\n\t\t\twhile(s.hasNextLine()){\n\t\t\t\tString name = s.nextLine();\n\t\t\t\tdocumentList.add(name);\n\t\t\t}\n\t\t} catch( IOException e){\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t}",
"public void setDocuments(List<WebExampleDocumentDescriptor> documents) {\n clear();\n addAll(documents);\n }",
"public void setMinMergeDocs(int minMergeDocs)\n {\n this.minMergeDocs = minMergeDocs;\n }",
"private synchronized void populateQueue() {\n\t \n\t \n\t \n\t if (this.totalQueueCount.get() >= luceneUtils.getNumDocs() || randomStartpoints.isEmpty()) \n\t { if (theQ.size() == 0) exhaustedQ.set(true); return; }\n\t\n\tint added = 0;\n int startdoc = randomStartpoints.poll();\n int stopdoc = Math.min(startdoc+ qsize, luceneUtils.getNumDocs());\n \n for (int a = startdoc; a < stopdoc; a++) {\n for (String field : flagConfig.contentsfields())\n try {\n int docID = a;\n Terms incomingTermVector = luceneUtils.getTermVector(a, field);\n totalQueueCount.incrementAndGet();\n if (incomingTermVector != null){ \n theQ.add(new DocIdTerms(docID,incomingTermVector));\n added++;\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n \n if (added > 0)\n System.err.println(\"Initialized TermVector Queue with \" + added + \" documents\");\n \n }",
"public ClsNodeDocument[] GetDocuments (ClsNodeDocument[] searchDocs);",
"@Override\n\tprotected DocumentCollection getInitialDocuments() {\n\t\treturn Core.getInstance().getRemoteDocuments();\n\t}",
"private void read() {\n\n\n\n\n File f = new File(pathToDocumentsFolder);\n Elements docs;\n File[] allSubFiles = f.listFiles();\n for (File file : allSubFiles) {\n if (file.isDirectory()) {\n File[] documentsFiles = file.listFiles();\n for (File fileToGenerate : documentsFiles) {\n docs = separateDocs(fileToGenerate);\n if (docs != null) {\n generateDocs(docs);\n }\n }\n\n }\n\n }\n try {\n // when done, insert poison element\n documentBuffer.put(new Document(null,null,null,null));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"private void initializeDocBuilder()\r\n {\r\n try\r\n {\r\n if (documentBuilder == null)\r\n {\r\n Class<?> indexSchemaClass = Class.forName(\"org.apache.solr.schema.IndexSchema\");\r\n Object indexSchema = solrCore.getClass().getMethod(\"getSchema\").invoke(solrCore);\r\n \r\n Class<?> documentBuilderClass = Class.forName(\"org.apache.solr.update.DocumentBuilder\"); \r\n documentBuilder = documentBuilderClass.getConstructor(indexSchemaClass).newInstance(indexSchema);\r\n }\r\n }\r\n catch (Exception e)\r\n {\r\n String errmsg = \"Error: Problem creating documentBuilder in SolrCoreProxy\";\r\n System.err.println(errmsg); \r\n throw new SolrRuntimeException(errmsg, e);\r\n }\r\n }",
"protected abstract IRefdocs loadRefdocs();",
"Collection<Document> getDocuments();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the pawn can capture another pawn by en passant | private boolean canCaptureEnPassant(Board board, Point pt) {
Piece temp = board.getPieceAt(pt);
if(temp != null)
if (temp instanceof Pawn && temp.getColor() != this.color)
if (((Pawn)temp).enPassantOk)
return true;
return false;
} | [
"private static boolean canCapture(Piece p, Piece middle) {\n if (p.side() == middle.side())\n return false;\n else\n return true;\n }",
"private boolean isBeingCapturedBySameEnemyTeam() {\n return commandPostTeam != getCapturingTeam() && attemptedCaptureTeam == getCapturingTeam();\n }",
"public boolean onEnPassant() {\n\t\tfinal FigureColor opponentColor = FigureColor.getOpponentColor(this.pawnColor);\n\t\tfinal BaseFigure lastUsedFigure = MoveWatcherEvent.getLastUsedFigure(opponentColor);\n\n\t\tif (lastUsedFigure.getFigureType() == FigureSet.PAWN) {\n\t\t\tfinal FigurePawn opponentPawn = (FigurePawn) lastUsedFigure;\n\n\t\t\tif (opponentPawn.getMoveInformation() == PawnMoveInformation.MOVED_TWO_FIELDS) {\n\t\t\t\tif (Matrix.INSTANCE.onPawnNeighbors(this, opponentPawn)) {\n\t\t\t\t\tthis.flagForEnPassant = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis.flagForEnPassant = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.flagForEnPassant;\n\t}",
"private boolean isLastMoveEnPassentCapture()\r\n\t{\r\n\t\tMove lastMove = getLastMove();\r\n\t\tif (lastMove == null) return false;\r\n\t\tif (appliedMoves.size() - 2 < 0) return false;\r\n\t\tMove beforeLastMove = appliedMoves.get(appliedMoves.size() - 2);\r\n\t\tif (beforeLastMove == null) return false;\r\n\t\t\r\n\t\tif (!(lastMove.capture instanceof Pawn)) return false;\r\n\t\tif (Math.abs(lastMove.from.coordinate.x - lastMove.to.coordinate.x) != 1) return false;\r\n\t\tif (Math.abs(lastMove.from.coordinate.y - lastMove.to.coordinate.y) != 1) return false;\r\n\r\n\t\t//Move before must have been a double move\r\n\t\tif (Math.abs(beforeLastMove.from.coordinate.y - beforeLastMove.to.coordinate.y) != 2) return false;\r\n\t\t//Pawn must have been removed\r\n\t\tif (fields[beforeLastMove.to.coordinate.x][beforeLastMove.to.coordinate.y].piece != null) return false;\r\n\t\t//Before last move's target must be on same y coordinate as from coordinate of last move\r\n\t\tif (beforeLastMove.to.coordinate.y != lastMove.from.coordinate.y) return false;\r\n\t\t//Before last move's target must be only one x coordinate away from coordinate of last move\r\n\t\tif (Math.abs(beforeLastMove.to.coordinate.x - lastMove.from.coordinate.x) != 1) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"private boolean isBeingCapturedByDifferentEnemyTeam() {\n return commandPostTeam != getCapturingTeam() && attemptedCaptureTeam != getCapturingTeam();\n }",
"boolean canPass();",
"public boolean canEndTurn() {\n\t\tif (hasMoved || hasCaptured) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Test\n public void canCaptureBlack(){\n Square squareF4 = new Square(f4, 5, 4);\n Square squareB5 = game.chessBoard.getSquareAt(1,3);\n\n Piece enemy1 = new Pawn(squareB5, Colour.BLACK);\n squareB5.setOccupiedBy(enemy1);\n assertTrue(pawnB.canCapture(squareB5));\n // in front of Pawn\n squareC5.setOccupiedBy(enemy1);\n assertFalse(pawnB.canCapture(squareC5));\n // too far away\n assertFalse(pawnB.canCapture(squareF4));\n }",
"public boolean canEnpassantLeft(Piece p) {\n\t\t\n\t\tif( (!(p instanceof Pawn)) || p == null) { //check is piece p is a pawn\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(p.color == 'w') { //white pawn\n\t\t\tif(p.getX() != 3) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tint row = p.getX();\n\t\t\tint column = p.getY();\n\t\t\tString left_space = Board.convertToFileRank(row, column - 1);\n\t\t\t\n\t\t\t// EnPassant 1 (Left-Diagonal) - white\n\t\t\tif(board.getPiece(left_space) != null && board.getPiece(left_space) instanceof Pawn && board.getPiece(left_space).color != this.color) {\n\t\t\t\tif( ((Pawn)(board.getPiece(left_space))).hasMovedTwo == true ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //black pawn\n\t\t\t\n\t\t\tif(p.getX() != 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tint row = p.getX();\n\t\t\tint column = p.getY();\n\t\t\tString left_space = Board.convertToFileRank(row, column - 1);\n\t\t\t\n\t\t\t// EnPassant 1 (Left-Diagonal) - black\n\t\t\tif(board.getPiece(left_space) != null && board.getPiece(left_space) instanceof Pawn && board.getPiece(left_space).color != this.color) {\n\t\t\t\tif( ((Pawn)(board.getPiece(left_space))).hasMovedTwo == true ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public boolean canEndTurn() {\n if (pieceWasMoved == true || (selected != null && selected.hasCaptured() == true)) {\n return true;\n }\n return false;\n }",
"public boolean canEndTurn(){\n return movedThisTurn || capturedThisTurn; //must have moved or captured\n }",
"public boolean hasCaptured(Piece p) {\n return captured.contains(p);\n }",
"protected boolean checkEndGame(){\n return player1.getPlayerDeck().getPrestige()>=15 || player2.getPlayerDeck().getPrestige()>=15;\n }",
"boolean canPickup(Player player);",
"@Override\n boolean canCaptureEnemy(Cell toCell) {\n if (toCell.getPiece() != null && isEnemy(toCell)) {\n moveList.add(toCell);\n return true;\n }\n return false;\n\n }",
"private boolean canAttack(Piece p, Location loc)\n {\n int thisRow = getLocation(p).getRow();\n int thisCol = getLocation(p).getCol();\n int otherRow = loc.getRow();\n int otherCol = loc.getCol();\n int rowDiff = Math.abs(otherRow-thisRow);\n int colDiff = Math.abs(otherCol-thisCol);\n switch (p.getType())\n {\n case PAWN:\n return rowDiff==1&&colDiff==1 &&\n ((p.white()&&otherRow<thisRow)||(!p.white()&&otherRow>thisRow));\n \n case KING:\n return adjacent(getLocation(p),loc);\n \n case KNIGHT:\n return rowDiff>0 && colDiff>0 && rowDiff+colDiff==3;\n \n //rook, bishop, queen are identical, except for their preconditions\n case ROOK:case BISHOP:case QUEEN:\n if ((p.getType()==Type.ROOK&&rowDiff>0&&colDiff>0)\n ||(p.getType()==Type.BISHOP&&rowDiff!=colDiff)\n ||(p.getType()==Type.QUEEN&&rowDiff>0&&colDiff>0&&rowDiff!=colDiff))\n return false;\n Location next = getLocation(p).closerTo(loc);\n while (!next.equals(loc))\n {\n if (getPiece(next)!=null) //checks for piece in the way\n return false;\n next = next.closerTo(loc);\n }\n return true;\n }\n return false; //will never happen because all piece types covered\n }",
"private boolean allowsEnPassant(int square) {\t\t\r\n\t\tint numMoves = moveList.size();\r\n\t\tif (numMoves == 0) return false;\r\n\t\tMove lastMove = moveList.get(numMoves - 1);\r\n\t\t\r\n\t\tif (lastMove.piece() % PIECES == PAWN) {\t\t\t\r\n\t\t\tif (lastMove.to() - lastMove.from() == 2 * BOARD_SIZE &&\r\n\t\t\t\t\tsquare == lastMove.from() + BOARD_SIZE) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (lastMove.from() - lastMove.to() == 2 * BOARD_SIZE &&\r\n\t\t\t\t\tsquare == lastMove.to() + BOARD_SIZE) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public abstract boolean isAttacking(Chesspiece origin);",
"private boolean isBeingCapturedByOwnTeam() {\n return commandPostTeam == getCapturingTeam();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of traffic violations in a driver's or vehicle's history. | @Override
public ArrayList<ITrafficViolation> getTrafficViolations() {
return trafficViolations;
} | [
"public AbstractHistory(\n ArrayList<ITrafficViolation> trafficViolations) {\n this.trafficViolations = trafficViolations;\n }",
"public AbstractHistory(\n ArrayList<ITrafficViolation> trafficViolations,\n ArrayList<IVehicleCrash> crashes) {\n this.trafficViolations = trafficViolations;\n this.crashes = crashes;\n }",
"List<ConstraintViolation> getViolations();",
"public static ArrayList<BattleHistory> getHistory(Client client) {\n ArrayList<BattleHistory> battleHistories = new ArrayList<>();\n try {\n String query = \"select * from history where name='\" + client.getName() + \"';\";\n Config.statement.execute(query);\n ResultSet resultSet = Config.statement.getResultSet();\n\n while (resultSet.next()) {\n String opponentName = resultSet.getString(\"opponent\");\n Date date = resultSet.getDate(\"time\");\n int wonCrowns = resultSet.getInt(\"crowns\");\n int lostCrowns = resultSet.getInt(\"opponent_crowns\");\n BattleHistory.Result result = (resultSet.getBoolean(\"result\") ? BattleHistory.Result.WIN : BattleHistory.Result.LOOSE);\n battleHistories.add(new BattleHistory(opponentName, date, wonCrowns, lostCrowns, result));\n }\n } catch (SQLException throwable) {\n throwable.printStackTrace();\n }\n return battleHistories;\n }",
"List<ConstraintViolation> getViolations(String paramName);",
"@GetMapping(\n value = \"/driver-vehicle-history\",\n produces = \"application/json\")\n List<Vehicle> getDriversVehicleHistory(@RequestParam(value = \"driverId\", required = true) int driverId);",
"public Collection<ScmConstraintViolation> getViolations() {\n return unmodifiableCollection(violations);\n }",
"@Override\n\tpublic final List<RuleViolation> getRuleViolations() {\n\t\treturn new ArrayList<>(ruleViolationMap.values());\n\t}",
"Set<ConstraintViolation<T>> getViolations();",
"public Set<ConstraintViolation<Object>> getViolations()\n\t{\n\t\treturn violations;\n\t}",
"java.util.List<com.google.rpc.BadRequest.FieldViolation> \n getFieldViolationsList();",
"@Deprecated\n List<FieldViolation> getFieldViolations();",
"private List<String> getViolations(String jdepsOutput) {\n String jdepsSeparator = \"---------------------\";\n int index = jdepsOutput.lastIndexOf(jdepsSeparator);\n if (index > 0) {\n String violations = jdepsOutput.substring(jdepsOutput.lastIndexOf(jdepsSeparator) + jdepsSeparator.length() + 1);\n LOGGER.info(violations);\n // break on any line break, filter blank lines, and collect as list\n return Arrays.stream(violations.split(\"\\\\R\")).filter(line -> !line.trim().isEmpty()).collect(Collectors.toList());\n }\n\n return List.of();\n }",
"List<Audit> getAuditListSortedByIpAddressDesc();",
"public java.util.List<AwsEc2NetworkInterfaceViolation> getAwsEc2NetworkInterfaceViolations() {\n return awsEc2NetworkInterfaceViolations;\n }",
"public ProblemsWithVehicle(LocalDate dateOfViolation, IDriver driver) {\n super(dateOfViolation, driver);\n }",
"List<SourceStats> getAllReliabilityStatistics() throws ServiceException;",
"public List getDriverAbsentList() throws Exception ;",
"@Deprecated\n List<FieldViolation> getFieldViolations(String fieldName);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles bookkeeping necessary when the turn ends. Specifically updating whose turn it is. | private void endTurn() {
currentTurn = getNextPlayer();
} | [
"private void endTurnState() {\n nullLastError();\n logger.d(\"End turn.\");\n\n // get turn data\n int[] p1TurnWord = new int[Constrains.MAX_NUMBER_OF_STONES];\n int[] p2TurnWord = new int[Constrains.MAX_NUMBER_OF_STONES];\n int[] data = (int[])getData();\n for(int i = 0; i < Constrains.MAX_NUMBER_OF_STONES; i++) {\n p1TurnWord[i] = data[i];\n p2TurnWord[i] = data[i+Constrains.MAX_NUMBER_OF_STONES];\n }\n\n // send end turn message\n try {\n tcpClient.sendEndTurnMessage(p1TurnWord, p2TurnWord);\n } catch (IOException e) {\n logger.e(\"Error while sending end turn message: \"+e.getMessage());\n setLastError(Error.NO_CONNECTION());\n\n // call callback\n callback.run();\n\n // switch to idle state\n setDaemonState(ClientDaemonState.IDLE);\n return;\n }\n\n setDaemonState(ClientDaemonState.WAIT_FOR_END_TURN_CONFIRM);\n }",
"public void endTurn(){\n who = !who; //switch players\n movedThisTurn = false; //haven't moved\n capturedThisTurn = false; //haven't captured\n selected.doneCapturing(); \n selected = null; //haven't selected\n }",
"private void endTurn() {\n\t\t// Upon completion of move, change the color of the current turn.\n\t\tif (currentTurnColor == PlayerColor.RED) {\n\t\t\tcurrentTurnColor = PlayerColor.BLUE;\n\t\t} else {\n\t\t\tcurrentTurnColor = PlayerColor.RED;\n\t\t}\n\n\t\tturnsCounter++;\n\t}",
"public void playerTurnEnd() {\n playersTurn = false;\n }",
"void finishTurn();",
"public void endTurn()\n\t{\n\t\tthis.decrementEffectDurations();\n\t\tdoneWithTurn = true;\n\t}",
"public void finishTurn(){\n\t\tPlayer cP=playerArray[this.currentPlayer];\n\t\tif(theDice.isThrowedInJail()||cP.isBankrupt()){\n\t\t\tpassTheDice2NextUser(cP);\n\t\t}\n\t\t// TODO This method needs to have Game ended Winner!\n\t\telse if (theDice.isMrMonopolyMove()){\n\t\t\tdoMrMonopolyMove(cP);\n\t\t\ttheDice.setMrMonopolyMove(false);\n\t\t}\n\t\telse if (theDice.isBusMove()){\n\t\t\tdoBusMove(cP);\n\t\t\ttheDice.setBusMove(false);\n\t\t}\n\t\telse if (theDice.isDouble()){\n\t\t\t//ConsoleGenerator.write2Console(\"hey\");\n\t\t\tcP.setTakingTurn(false);\n\t\t\tplayerArray[this.currentPlayer].setCanRoll(true);\n\t\t\tConsoleGenerator.write2Console(\"Player No:\" + this.currentPlayer+\". Please throw the damn dice since you throwed double\\n\");\n\t\t}\n\t\telse{\n\t\t\tpassTheDice2NextUser(cP);\n\t\t}\n\n\t}",
"public void toEndingTurn() {\n }",
"void completeTurn() {\n\n\t\tremoveNotification();\n\n\t\tString matchId = match.getMatchId();// The Id for our match\n\t\tString pendingParticipant = GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match);// We set who's turn it\n\t\t// is next since\n\t\t// we're done,\n\t\t// should always be\n\t\t// opponents turn\n\t\t// for us.\n\t\tbyte[] gameState = writeGameState(match);// We build the game state\n\t\t\t\t\t\t\t\t\t\t\t\t\t// bytes from the current\n\t\t\t\t\t\t\t\t\t\t\t\t\t// game state.\n\n\t\t// This actually tries to send our data to Google.\n\t\tGames.TurnBasedMultiplayer.takeTurn(gameHelper.getApiClient(), matchId,\n\t\t\t\tgameState, pendingParticipant).setResultCallback(\n\t\t\t\tnew ResultCallback<TurnBasedMultiplayer.UpdateMatchResult>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResult(UpdateMatchResult result) {\n\t\t\t\t\t\tturnUsed = true;\n\n\t\t\t\t\t\t// TODO:Handle this better\n\t\t\t\t\t\tif (!GooglePlayGameFragment.this.checkStatusCode(match,\n\t\t\t\t\t\t\t\tresult.getStatus().getStatusCode())) {\n\t\t\t\t\t\t\tLog.d(\"test\", result.getStatus().getStatusCode()\n\t\t\t\t\t\t\t\t\t+ \" Something went wrong\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t}",
"public void endTurnCurrent() {\n playerStatus.nActionsDone = 0;\n playerStatus.isActive = false;\n playerStatus.isFirstTurn = false;\n }",
"public void finishGame() {\n\t\t// this.game = null;\n\t\tsetTimePlayed(this.game.getFinishTime() - this.game.getStartTime());\n\n\t\t// this is our hook\n\t\tupdateHistoricalStats();\n\t\tincGamesPlayed();\n\t\tif (getGame().getTeam(this).equals(getGame().getWinner()))\n\t\t\tincWins();\n\n\t}",
"private void HandleOnMoveEnd(Board board, Piece turn, boolean success){\n\t}",
"public void currentActivePlayerEndsTurn() {\n this.currentActivePlayer.endTurn();\n }",
"private void handleEndTurnMessage(){\n controller.setCurrentPlayerWantToEndTurn(true);\n }",
"void turnDone();",
"protected void seasonEnd() throws RemoteException {\n\t\tif (boatsConfirmedAtWharf() != boats.length) {\n\t\t\tchangeState(INTERNAL_STATE_DIROPER.waiting_for_boats);\n\t\t} else {\n\t\t\tchangeState(INTERNAL_STATE_DIROPER.ending_a_campaign);\n\t\t}\n\t}",
"public void buttonEndTurn() {\n\t\tendTurn();\n\t\t}",
"public void clientEndTurn() {\n\t\tassertPlayerExists(activePlayer.getId());\n\t\tthis.activePlayer.endTurn();\n\t\tclientStartTurn();\n\t}",
"private void endTurn() {\n\t\t\n\t\tif (roundChanger == 1) {\n\t\t\tString currentPlayer = textFieldCurrentPlayer.getText();\n\t\t\tif (currentPlayer.equals(\"Player1\")) {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3();\n\t\t\t} else {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3();\n\t\t\t} \n\t\t\tchangeCurrentPlayerText();\n\t\t\tturn = 0;\n\t\t\troundChanger = 2;\n\t\t} else {\n\t\t\tString winningPlayer = calculateScore(player1, player2);\n\t\t\ttextFieldCurrentPlayer.setText(winningPlayer);\n\t\t\troundChanger = 1;\n\t\t\trollsTaken = 0;\n\t\t\tround = round + 1;\n\t\t\ttextFieldPlayerOneScore.setText(Integer.toString(player1.getPoints()));\n\t\t\ttextFieldPlayerTwoScore.setText(Integer.toString(player2.getPoints()));\n\t\t\ttextAreaInstructions.setText(\"Try to get the highest roll possible!\");\n\t\t\tcheckForGameOver();\n\t\t}\n\t\ttogglebtnD1.setSelected(false);\n\t\ttogglebtnD2.setSelected(false);\n\t\ttogglebtnD3.setSelected(false);\n\t\tdisableDice();\n\t\tturn = 0;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column IMAL141_DEV_O18.S_CONTROL_PARAM.ADD_NUMBER1_MAND | public String getADD_NUMBER1_MAND() {
return ADD_NUMBER1_MAND;
} | [
"public String getADD_NUMBER2_MAND() {\r\n return ADD_NUMBER2_MAND;\r\n }",
"public String getADD_DATE1_MAND() {\r\n return ADD_DATE1_MAND;\r\n }",
"public String getADD_STRING1_MAND() {\r\n return ADD_STRING1_MAND;\r\n }",
"public String getADD_NUMBER5_MAND() {\r\n return ADD_NUMBER5_MAND;\r\n }",
"public String getADD_STRING11_MAND() {\r\n return ADD_STRING11_MAND;\r\n }",
"public void setADD_NUMBER1_MAND(String ADD_NUMBER1_MAND) {\r\n this.ADD_NUMBER1_MAND = ADD_NUMBER1_MAND == null ? null : ADD_NUMBER1_MAND.trim();\r\n }",
"public String getADD_STRING2_MAND() {\r\n return ADD_STRING2_MAND;\r\n }",
"public String getADD_NUMBER3_MAND() {\r\n return ADD_NUMBER3_MAND;\r\n }",
"public String getADD_DATE2_MAND() {\r\n return ADD_DATE2_MAND;\r\n }",
"public String getADD_STRING15_MAND() {\r\n return ADD_STRING15_MAND;\r\n }",
"public String getADD_STRING10_MAND() {\r\n return ADD_STRING10_MAND;\r\n }",
"public String getAddInt() {\n this.addInt();\n return this.addintegral;\n\n }",
"public int getAddition() {\n return addition_type;\n }",
"public String getADD_DATE5_MAND() {\r\n return ADD_DATE5_MAND;\r\n }",
"public String getADD_STRING9_MAND() {\r\n return ADD_STRING9_MAND;\r\n }",
"public String getADD_NUMBER1_DESC() {\r\n return ADD_NUMBER1_DESC;\r\n }",
"public String getADD_NUMBER4_MAND() {\r\n return ADD_NUMBER4_MAND;\r\n }",
"public String getADD_STRING12_MAND() {\r\n return ADD_STRING12_MAND;\r\n }",
"public String getADD_STRING13_MAND() {\r\n return ADD_STRING13_MAND;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the has_balance state which is a possible internal Wallet state. | public State has_balance_state() {
return has_balance;
} | [
"public boolean isSetBalance() {\n return this.balance != null;\n }",
"public State has_saving_no_balance_state() {\n\t\treturn has_saving_no_balance;\n\t}",
"public boolean isSetBalance() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BALANCE_ISSET_ID);\n }",
"public boolean isSetBalance() {\n\t\treturn org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BALANCE_ISSET_ID);\n\t}",
"public boolean isSetBalance() {\n return EncodingUtils.testBit(__isset_bitfield, __BALANCE_ISSET_ID);\n }",
"public State no_saving_no_balance_state() {\n\t\treturn no_saving_no_balance;\n\t}",
"public WalletBalance getDirtyBalance()\n {\n if (mDirtyBalance!=null) return mDirtyBalance;\n return getBalance();\n }",
"public String bankAccountState() {\n return this.bankAccountState;\n }",
"public BigDecimal getAvailBalance()\n {\n return getDirtyBalance().getAvailableBalance();\n }",
"public BigDecimal getBbalance() {\n return bbalance;\n }",
"public State low_balance_state() {\n\t\treturn low_balance;\n\t}",
"public com.token.vl.service.MoneyWs getAvailable_Balance() {\n return available_Balance;\n }",
"public AccountState getAccountState() {\r\n checkAccountState();\r\n return accountState;\r\n }",
"public com.token.vl.service.MoneyWs getCurrent_balance() {\n return current_balance;\n }",
"public Long getAvailableBalance() {\n return availableBalance;\n }",
"boolean hasConsensusState();",
"public int getBATState() {\n if (DBG) log(\"getBATState\");\n try {\n mServiceLock.readLock().lock();\n if (mService != null && isEnabled()) {\n return mService.getBATState();\n }\n if (mService == null) Log.w(TAG, \"Proxy not attached to service\");\n return STATE_DISABLED;\n } catch (RemoteException e) {\n Log.e(TAG, \"Stack:\" + Log.getStackTraceString(new Throwable()));\n return STATE_DISABLED;\n } finally {\n mServiceLock.readLock().unlock();\n }\n }",
"public CoreComponentTypes.apis.ebay.BasicAmountType getOutstandingBalance() {\r\n return outstandingBalance;\r\n }",
"public Amount getCurrentBalance() { return balance; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the sum from pile[i] to the end | public int stoneGameII(int[] piles) {
int n = piles.length;
memo = new int[n][n];
sums = new int[n];
sums[n-1] = piles[n-1];
for(int i = n -2; i>=0;i--) {
sums[i] = sums[i+1] + piles[i]; //the sum from piles[i] to the end
}
int score = helper(0, 1, piles);
return score;
} | [
"public static int sum() {\n int sum = 0;\n for (int i=0; i<=100; i++){\n sum += i;\n }\n return sum;\n }",
"public int totalGemValue() {\r\n\t\ttotal = 0;\r\n\t\ttotal += gemPile[0];\r\n\t\ttotal += gemPile[1] * 2;\r\n\t\ttotal += gemPile[2] * 3;\r\n\t\ttotal += gemPile[3] * 4;\r\n\t\treturn total;\r\n\t}",
"public int sum(int i) {\n int sum = 0;\n while (i > 0) {\n sum += sums[i];\n i -= lowBit(i);\n }\n return sum;\n }",
"public int getSize()\r\n {\r\n return pile.size();\r\n }",
"public void findSquareRootOfPile() {\n\t\tint square = (int) Math.round(Math.sqrt(count));\n\t\tSystem.out.print(square);\n\t}",
"public int sum(){ \n int sum,counter;\n counter=sum=0; \n for(counter=0;counter<arr.length;counter++){\n sum+=arr[counter];\n }\n return sum;\n }",
"double getSum();",
"public int pileSize()\n {\n return warPile.getSize();\n }",
"public void sumValues(){\n\t\tint index = 0;\n\t\tDouble timeIncrement = 2.0;\n\t\tDouble timeValue = time.get(index);\n\t\tDouble packetValue;\n\t\twhile (index < time.size()){\n\t\t\tDouble packetTotal = 0.0;\n\t\t\twhile (timeValue < timeIncrement && index < packets.size()){\n\t\t\t\ttimeValue = time.get(index);\n\t\t\t\tpacketValue = packets.get(index);\n\t\t\t\tpacketTotal= packetTotal + packetValue;\n\t\t\t\tindex = index + 1;\n\t\t\t}\n\t\t\tArrayList<Double> xy = new ArrayList<Double>();\n\t\t\txy.add(timeIncrement);\n\t\t\txy.add(packetTotal);\n\t\t\ttotalIncrements.add(xy);\n\t\t\t// to get max and min need separate arrays\n\t\t\ttimeIncrements.add(timeIncrement);\n\t\t\tbyteIncrements.add(packetTotal);\n\t\t\ttimeIncrement = timeIncrement + 2.0;\t\n\t\t}\n\t\treturn;\n\n\t}",
"private int barSum(int index) {\n int sum = 0;\n for(int x = 0; x < index; x++) {\n sum += data[x];\n }\n return sum; \n }",
"private int getSum(){\n int result = 0; \n for(int dice: diceArr){\n result += dice; \n }\n return result; \n }",
"public int sum() {\n int sum = 0;\n for (int j = 0; j < YNUM; j++) {\n for (int i = 0; i < XNUM; i++) {\n sum += board[j][i];\n }\n }\n return sum;\n }",
"double getPourcentageIsotope();",
"public int sum()\n\t{\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < arraySize; index++)\n\t\t{\n\t\t\tsum += array[index];\n\t\t}\n\t\treturn sum;\n\t}",
"public void sumPrimes(){\n for( int i = 2; i < maxNumber; i++ )\n if( Prime.isPrime( i ) )\n sum += i;\n }",
"public int getSum(){\n int sum = 0;\n\n for(int i = 0; i < denomination.length; i++){\n sum += denomination[i] * billCount[i];\n }\n\n return sum;\n }",
"public int sum() {\n // TODO\n for(int n = 0; n<dieArray.length; n++){\n sum+=dieArray[n].getValue();\n }\n return sum;\n }",
"public int getPileHeight()\n {\n // If there is a box above this one, sum up the total height\n // of the pile of boxes.\n // This works recursively to add up the height of every box above this one in the pile.\n if (aboveBox != null)\n {\n return height + aboveBox.getPileHeight();\n }\n else\n {\n return height;\n }\n\n }",
"private int getSum(int[][] grid, int i, int j, int sz) {\n int x = i;\n int y = j;\n int sum = 0;\n\n // Go left down.\n for (int k = 0; k < sz; ++k)\n sum += grid[--x][++y];\n\n // Go right down.\n for (int k = 0; k < sz; ++k)\n sum += grid[++x][++y];\n\n // Go right up.\n for (int k = 0; k < sz; ++k)\n sum += grid[++x][--y];\n\n // Go left up.\n for (int k = 0; k < sz; ++k)\n sum += grid[--x][--y];\n\n return sum;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that we can map BioPAX Physical Interactions Correctly. | public void testPhysicalInteractions() throws Exception {
Model model = BioPaxUtil.read(new FileInputStream(getClass().getResource("/DIP_ppi.owl").getFile()));
MapBioPaxToCytoscape mapper = new MapBioPaxToCytoscape();
mapper.doMapping(model);
CyNetwork cyNetwork = createNetwork("network2", mapper);
int nodeCount = cyNetwork.getNodeCount();
assertEquals(3, nodeCount);
// First, find the Target Interaction: physicalInteraction1.
int targetNodeIndex = 0;
RootGraph rootGraph = cyNetwork.getRootGraph();
Iterator nodeIterator = cyNetwork.nodesIterator();
while (nodeIterator.hasNext()) {
CyNode node = (CyNode) nodeIterator.next();
String uri = Cytoscape.getNodeAttributes()
.getStringAttribute(node.getIdentifier(), MapBioPaxToCytoscape.BIOPAX_RDF_ID);
if (uri.endsWith("physicalInteraction1")) {
targetNodeIndex = node.getRootGraphIndex();
}
}
// Get All Edges Adjacent to this Node
int[] edgeIndices = rootGraph.getAdjacentEdgeIndicesArray(targetNodeIndex, true, true, true);
// There should be two edges; one for each participant
assertEquals(2, edgeIndices.length);
} | [
"private void testMap() {\n\t\t_knowledgeMapA.updateLocation(new Point(2, 2), 4, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 3), 5, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 4), 6, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(2, 0), 7, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(0, 2), 8, 4);\n\t\t_knowledgeMapA.updateLocation(new Point(3, 2), 9, 4);\n\t\t_knowledgeMapA.updateLocation(new Point(5, 2), 1, 4);\n\t\t_knowledgeMapA.updateLocation(new Point(6, 2), 2, 2);\n\t\t_knowledgeMapA.updateLocation(new Point(1, 2), 3, 2);\n\n\t\t_knowledgeMapB.updateLocation(new Point(2, 2), 23, 5);\n\t\t_knowledgeMapB.updateLocation(new Point(2, 3), 24, 3);\n\t\t_knowledgeMapB.updateLocation(new Point(2, 4), 25, 1);\n\t\t_knowledgeMapB.updateLocation(new Point(2, 0), 26, 3);\n\t\t_knowledgeMapB.updateLocation(new Point(0, 2), 27, 2);\n\t\t_knowledgeMapB.updateLocation(new Point(3, 2), 28, 3);\n\t\t_knowledgeMapB.updateLocation(new Point(5, 2), 29, 2);\n\t\t_knowledgeMapB.updateLocation(new Point(6, 2), 21, 1);\n\t\t_knowledgeMapB.updateLocation(new Point(1, 2), 22, 6);\n\n\t\t_knowledgeMapA.exchangeInformation(_knowledgeMapB);\n\n\t\tassertEquals(23, _knowledgeMapA.getLocationKnowledge(new Point(2, 2)).intValue());\n\t\tassertEquals(24, _knowledgeMapA.getLocationKnowledge(new Point(2, 3)).intValue());\n\t\tassertEquals(6, _knowledgeMapA.getLocationKnowledge(new Point(2, 4)).intValue());\n\t\tassertEquals(26, _knowledgeMapA.getLocationKnowledge(new Point(2, 0)).intValue());\n\t\tassertEquals(8, _knowledgeMapA.getLocationKnowledge(new Point(0, 2)).intValue());\n\t\tassertEquals(9, _knowledgeMapA.getLocationKnowledge(new Point(3, 2)).intValue());\n\t\tassertEquals(1, _knowledgeMapA.getLocationKnowledge(new Point(5, 2)).intValue());\n\t\tassertEquals(2, _knowledgeMapA.getLocationKnowledge(new Point(6, 2)).intValue());\n\t\tassertEquals(22, _knowledgeMapA.getLocationKnowledge(new Point(1, 2)).intValue());\n\n\t\tassertEquals(23, _knowledgeMapB.getLocationKnowledge(new Point(2, 2)).intValue());\n\t\tassertEquals(24, _knowledgeMapB.getLocationKnowledge(new Point(2, 3)).intValue());\n\t\tassertEquals(6, _knowledgeMapB.getLocationKnowledge(new Point(2, 4)).intValue());\n\t\tassertEquals(26, _knowledgeMapB.getLocationKnowledge(new Point(2, 0)).intValue());\n\t\tassertEquals(8, _knowledgeMapB.getLocationKnowledge(new Point(0, 2)).intValue());\n\t\tassertEquals(9, _knowledgeMapB.getLocationKnowledge(new Point(3, 2)).intValue());\n\t\tassertEquals(1, _knowledgeMapB.getLocationKnowledge(new Point(5, 2)).intValue());\n\t\tassertEquals(2, _knowledgeMapB.getLocationKnowledge(new Point(6, 2)).intValue());\n\t\tassertEquals(22, _knowledgeMapB.getLocationKnowledge(new Point(1, 2)).intValue());\n\n\t\tassertEquals(5, _knowledgeMapA.getLocationKnowledgeAge(new Point(2, 2)));\n\t\tassertEquals(3, _knowledgeMapA.getLocationKnowledgeAge(new Point(2, 3)));\n\t\tassertEquals(2, _knowledgeMapA.getLocationKnowledgeAge(new Point(2, 4)));\n\t\tassertEquals(3, _knowledgeMapA.getLocationKnowledgeAge(new Point(2, 0)));\n\t\tassertEquals(4, _knowledgeMapA.getLocationKnowledgeAge(new Point(0, 2)));\n\t\tassertEquals(4, _knowledgeMapA.getLocationKnowledgeAge(new Point(3, 2)));\n\t\tassertEquals(4, _knowledgeMapA.getLocationKnowledgeAge(new Point(5, 2)));\n\t\tassertEquals(2, _knowledgeMapA.getLocationKnowledgeAge(new Point(6, 2)));\n\t\tassertEquals(6, _knowledgeMapA.getLocationKnowledgeAge(new Point(1, 2)));\n\n\t\tassertEquals(5, _knowledgeMapB.getLocationKnowledgeAge(new Point(2, 2)));\n\t\tassertEquals(3, _knowledgeMapB.getLocationKnowledgeAge(new Point(2, 3)));\n\t\tassertEquals(2, _knowledgeMapB.getLocationKnowledgeAge(new Point(2, 4)));\n\t\tassertEquals(3, _knowledgeMapB.getLocationKnowledgeAge(new Point(2, 0)));\n\t\tassertEquals(4, _knowledgeMapB.getLocationKnowledgeAge(new Point(0, 2)));\n\t\tassertEquals(4, _knowledgeMapB.getLocationKnowledgeAge(new Point(3, 2)));\n\t\tassertEquals(4, _knowledgeMapB.getLocationKnowledgeAge(new Point(5, 2)));\n\t\tassertEquals(2, _knowledgeMapB.getLocationKnowledgeAge(new Point(6, 2)));\n\t\tassertEquals(6, _knowledgeMapB.getLocationKnowledgeAge(new Point(1, 2)));\n\t}",
"@Test\n public void mapToDirectAcquisitionContract() {\n assertTrue(true);\n }",
"public void testComplexMapping() throws Exception {\n\t\tModel model = BioPaxUtil.read(new FileInputStream(getClass().getResource(\"/biopax_complex.owl\").getFile()));\n\t\tMapBioPaxToCytoscape mapper = new MapBioPaxToCytoscape();\n\t\tmapper.doMapping(model);\n\n\t\tCyNetwork cyNetwork = createNetwork(\"network1\", mapper);\n\t\tint nodeCount = cyNetwork.getNodeCount();\n\t\tassertEquals(3, nodeCount);\n\n\t\t// First, find the Target Complex: CPATH-126.\n\t\tint targetNodeIndex = 0;\n\t\tRootGraph rootGraph = cyNetwork.getRootGraph();\n\t\tIterator nodeIterator = cyNetwork.nodesIterator();\n\n\t\twhile (nodeIterator.hasNext()) {\n\t\t\tCyNode node = (CyNode) nodeIterator.next();\n\t\t\tString uri = Cytoscape.getNodeAttributes()\n\t .getStringAttribute(node.getIdentifier(), MapBioPaxToCytoscape.BIOPAX_RDF_ID);\n\t\t\tif (uri.contains(\"CPATH-126\")) {\n\t\t\t\ttargetNodeIndex = node.getRootGraphIndex();\n\t\t\t}\n\t\t}\n\n\t\t// Get All Edges Adjacent to this Node\n\t\tint[] edgeIndices = rootGraph.getAdjacentEdgeIndicesArray(targetNodeIndex, true, true, true);\n\n\t\t// There should be two edges; one for each member protein\n\t\tassertEquals(2, edgeIndices.length);\n\t\t\n\t\tCytoscape.destroyNetwork(cyNetwork);\n\t}",
"@Test\r\n public void specialPowerTest() {\r\n workerArtemis.move(map.getGrid()[2][3]);\r\n workerArtemis.specialPower(map.getGrid()[2][4]);\r\n assertTrue(workerArtemis.getHasUsedSpecialPower());\r\n }",
"@Test\r\n public void hasBuiltCanUseSpecialPower() {\r\n workerArtemis.move(map.getGrid()[2][3]);\r\n workerArtemis.build(map.getGrid()[2][4]);\r\n assertFalse(workerArtemis.canUseSpecialPower());\r\n }",
"@Test\n public void shouldCreateKnownBsmCoreData() {\n \n Integer testMsgCnt = 127;\n Integer expectedMsgCnt = 127;\n \n Integer testId = 0b11111111111111111111111111111111;\n String expectedId = \"FF\";\n \n Integer testSec = 65534;\n Integer expectedSec = 65534;\n \n Integer testLat = 900000000;\n BigDecimal expectedLat = BigDecimal.valueOf(90.0000000).setScale(7);\n \n Integer testLong = 1800000000;\n BigDecimal expectedLong = BigDecimal.valueOf(180.0000000).setScale(7);\n \n Integer testElev = 61439;\n BigDecimal expectedElev = BigDecimal.valueOf(6143.9);\n \n // Positional accuracy\n Integer testSemiMajorAxisAccuracy = 254;\n BigDecimal expectedSemiMajorAxisAccuracy = BigDecimal.valueOf(12.70).setScale(2);\n \n Integer testSemiMinorAxisAccuracy = 254;\n BigDecimal expectedSemiMinorAxisAccuracy = BigDecimal.valueOf(12.70).setScale(2);\n \n Integer testSemiMajorAxisOrientation = 65534;\n BigDecimal expectedSemiMajorAxisOrientation = BigDecimal.valueOf(359.9945078786);\n \n \n Integer testTransmissionState = 6;\n String expectedTransmissionState = \"reserved3\";\n \n Integer testSpeed = 8190;\n BigDecimal expectedSpeed = BigDecimal.valueOf(163.80).setScale(2);\n \n Integer testHeading = 28799;\n BigDecimal expectedHeading = BigDecimal.valueOf(359.9875);\n \n Integer testSteeringWheelAngle = 126;\n BigDecimal expectedSteeringWheelAngle = BigDecimal.valueOf(189.0).setScale(1);\n \n // Acceleration set \n Integer testAccelLong = 2000;\n BigDecimal expectedAccelLong = BigDecimal.valueOf(20.00).setScale(2);\n \n Integer testAccelLat = 2000;\n BigDecimal expectedAccelLat = BigDecimal.valueOf(20.00).setScale(2);\n \n Integer testAccelVert = 127;\n BigDecimal expectedAccelVert = BigDecimal.valueOf(2.54);\n \n Integer testAccelYaw = 32767;\n BigDecimal expectedAccelYaw = BigDecimal.valueOf(327.67);\n \n // Brake system status\n byte[] testWheelBrakesBytes = new byte[1];\n testWheelBrakesBytes[0] = (byte) 0b10000000;\n String expectedBrakeAppliedStatus = \"unavailable\";\n \n Integer testTractionControlStatus = 3;\n String expectedTractionControlStatus = \"engaged\";\n \n Integer testAntiLockBrakeStatus = 3;\n String expectedAntiLockBrakeStatus = \"engaged\";\n \n Integer testStabilityControlStatus = 3;\n String expectedStabilityControlStatus = \"engaged\";\n \n Integer testBrakeBoostApplied = 2;\n String expectedBrakeBoostApplied = \"on\";\n \n Integer testAuxiliaryBrakeStatus = 3;\n String expectedAuxiliaryBrakeStatus = \"reserved\";\n \n // Vehicle size\n Integer testVehicleWidth = 1023;\n Integer expectedVehicleWidth = 1023;\n \n Integer testVehicleLength = 4095;\n Integer expectedVehicleLength = 4095;\n \n BSMcoreData testcd = new BSMcoreData();\n testcd.msgCnt = new MsgCount(testMsgCnt);\n testcd.id = new TemporaryID(new byte[]{testId.byteValue()});\n testcd.secMark = new DSecond(testSec);\n testcd.lat = new Latitude(testLat);\n testcd._long = new Longitude(testLong);\n testcd.elev = new Elevation(testElev);\n testcd.accuracy = new PositionalAccuracy(\n new SemiMajorAxisAccuracy(testSemiMajorAxisAccuracy),\n new SemiMinorAxisAccuracy(testSemiMinorAxisAccuracy),\n new SemiMajorAxisOrientation(testSemiMajorAxisOrientation));\n testcd.transmission = new TransmissionState(testTransmissionState);\n testcd.speed = new Speed(testSpeed);\n testcd.heading = new Heading(testHeading);\n testcd.angle = new SteeringWheelAngle(testSteeringWheelAngle);\n testcd.accelSet = new AccelerationSet4Way(\n new Acceleration(testAccelLong),\n new Acceleration(testAccelLat),\n new VerticalAcceleration(testAccelVert),\n new YawRate(testAccelYaw));\n testcd.brakes = new BrakeSystemStatus(\n new BrakeAppliedStatus(testWheelBrakesBytes),\n new TractionControlStatus(testTractionControlStatus),\n new AntiLockBrakeStatus(testAntiLockBrakeStatus),\n new StabilityControlStatus(testStabilityControlStatus),\n new BrakeBoostApplied(testBrakeBoostApplied),\n new AuxiliaryBrakeStatus(testAuxiliaryBrakeStatus));\n testcd.size = new VehicleSize(\n new VehicleWidth(testVehicleWidth),\n new VehicleLength(testVehicleLength));\n \n BasicSafetyMessage testbsm = new BasicSafetyMessage();\n testbsm.coreData = testcd;\n \n J2735Bsm actualbsm = null;\n try {\n actualbsm = OssBsm.genericBsm(testbsm);\n \n if (actualbsm.coreData == null) {\n fail(\"Bsm core data failed to populate\");\n }\n \n } catch (OssBsmPart2Exception e) {\n fail(\"Unexpected exception: \" + e.getClass());\n }\n \n J2735BsmCoreData actualcd = actualbsm.coreData;\n \n assertEquals(\"Incorrect message count\", expectedMsgCnt, actualcd.msgCnt);\n assertEquals(\"Incorrect message id\", expectedId, actualcd.id);\n assertEquals(\"Incorrect second\", expectedSec, actualcd.secMark);\n assertEquals(\"Incorrect lat position\", expectedLat, actualcd.position.getLatitude());\n assertEquals(\"Incorrect long position\", expectedLong, actualcd.position.getLongitude());\n assertEquals(\"Incorrect elev position\", expectedElev, actualcd.position.getElevation());\n assertEquals(\"Incorrect semi major accuracy\", expectedSemiMajorAxisAccuracy, actualcd.accuracy.semiMajor);\n assertEquals(\"Incorrect semi minor accuracy\", expectedSemiMinorAxisAccuracy, actualcd.accuracy.semiMinor);\n assertEquals(\"Incorrect semi major orient\", expectedSemiMajorAxisOrientation, actualcd.accuracy.orientation);\n assertEquals(\"Incorrect transmission state\", expectedTransmissionState, actualcd.transmission.name());\n assertEquals(\"Incorrect speed\", expectedSpeed, actualcd.speed);\n assertEquals(\"Incorrect heading\", expectedHeading, actualcd.heading);\n assertEquals(\"Incorrect steering wheel angle\", expectedSteeringWheelAngle, actualcd.angle);\n assertEquals(\"Incorrect accel long\", expectedAccelLong, actualcd.accelSet.getAccelLong());\n assertEquals(\"Incorrect accel lat\", expectedAccelLat, actualcd.accelSet.getAccelLat());\n assertEquals(\"Incorrect accel vert\", expectedAccelVert, actualcd.accelSet.getAccelVert());\n assertEquals(\"Incorrect accel yaw\", expectedAccelYaw, actualcd.accelSet.getAccelYaw());\n for (Map.Entry<String, Boolean> curVal: actualcd.brakes.wheelBrakes.entrySet()) {\n if (curVal.getKey() == expectedBrakeAppliedStatus) {\n assertTrue(\"Incorrect brake applied status, expected \" + curVal.getKey() + \" to be true\", curVal.getValue());\n } else {\n assertFalse(\"Incorrect brake applied status, expected \" + curVal.getKey() + \" to be false\", curVal.getValue());\n }\n }\n assertEquals(\"Incorrect brake tcs status\", expectedTractionControlStatus, actualcd.brakes.traction);\n assertEquals(\"Incorrect brake abs status\", expectedAntiLockBrakeStatus, actualcd.brakes.abs);\n assertEquals(\"Incorrect brake scs status\", expectedStabilityControlStatus, actualcd.brakes.scs);\n assertEquals(\"Incorrect brake boost status\", expectedBrakeBoostApplied, actualcd.brakes.brakeBoost);\n assertEquals(\"Incorrect brake aux status\", expectedAuxiliaryBrakeStatus, actualcd.brakes.auxBrakes);\n assertEquals(\"Incorrect vehicle width\", expectedVehicleWidth, actualcd.size.getWidth());\n assertEquals(\"Incorrect vehicle length\", expectedVehicleLength, actualcd.size.getLength());\n }",
"@Test\n public void affinityTest() {\n // TODO: test affinity\n }",
"public void testGetOnDemandMapper_Accuracy() {\n OnDemandMapper mapper = new OnDemandMapper();\n abstractor = new DatabaseAbstractor(null, mapper);\n assertEquals(\"getOnDemandMapper is not correct.\", abstractor.getOnDemandMapper(), mapper);\n }",
"@Test\n\t public void test_map1() {\n\t mapDriver.withMapper(new PointCleaner.ZoneCleanMapper())\n\t .withInput(new LongWritable(10), new Text(\"71,19,4\"))\n\t .withOutput(new Text(\"2_0\"), new Text(\"71_19\")).runTest();\n\t // System.out.println(\"expected output:\" +\n\t // mapDriver.getExpectedOutputs());\n\t }",
"public void testGetMapper_Accuracy() {\n Mapper mapper = new Mapper(new HashMap());\n\n abstractor = new DatabaseAbstractor(mapper);\n assertEquals(\"getMapper is not correct.\", abstractor.getMapper(), mapper);\n }",
"@Test\n public void testRwbmInternal()\n {\n generateEvents(\"dist-rwbm-internal-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }",
"@Test(expected = IllegalArgumentException.class)\r\n public void oldPositionSpecialPowerTest() {\r\n workerArtemis.move(map.getGrid()[2][3]);\r\n workerArtemis.specialPower(map.getGrid()[2][2]);\r\n assertFalse(workerArtemis.getHasUsedSpecialPower());\r\n assertTrue(workerArtemis.canUseSpecialPower());\r\n }",
"@Test\n public void aiPlanTest() {\n // Setup and AI object to test with.\n learnBarrierArrayTest();\n hunterPrey.aiPlan(); // TODO add tests\n }",
"public static void main(String[] args) {\n boolean errored = false;\n\n String oiClassName = System.getProperty(\"robotinspector.oimap.class\");\n\n if (oiClassName == null) {\n System.out.println(\"OI class not set, so not checking\");\n } else {\n try {\n Class<?> mapClass = RobotInspector.class.getClassLoader()\n .loadClass(oiClassName);\n System.out.println(\"Checking operator interface at \"\n + mapClass.getName() + \"...\");\n OI oi = new OI(mapClass, false);\n System.out.println(\"Validating...\");\n oi.validate();\n System.out.println(\"Mapping...\");\n oi.drawMaps();\n System.out.println(\"Robot ports successfully mapped.\");\n } catch (ClassNotFoundException e) {\n System.err.printf(\"Could not find robot map class: %s\",\n oiClassName);\n errored = true;\n } catch (BadOIMapException e) {\n System.err.println(\"OI error: \" + e.getMessage());\n System.err.println(\"Check your OIMap file!\");\n errored = true;\n } catch (IOException e) {\n System.err.println(\n \"IOException occured while making joystick diagram: \"\n + e.getMessage());\n System.err.println(\n \"We can continue with the build, but you don't get any diagrams.\");\n }\n }\n\n String mapClassName = System\n .getProperty(\"robotinspector.robotmap.class\");\n\n if (mapClassName == null) {\n System.out\n .println(\"Robot Map class is not set, so nothing to check\");\n } else {\n try {\n Class<?> mapClass = RobotInspector.class.getClassLoader()\n .loadClass(mapClassName);\n System.out.println(\n \"Checking robot map at \" + mapClass.getName() + \"...\");\n new PortMapper().mapPorts(mapClass);\n System.out.println(\"Robot ports successfully mapped.\");\n } catch (ClassNotFoundException e) {\n System.err.printf(\"Could not find robot map class: %s\",\n mapClassName);\n errored = true;\n } catch (DuplicatePortException | InvalidPortException e) {\n System.err.println(\"Wiring error: \" + e.getMessage());\n System.err.println(\"Check your RobotMap file!\");\n errored = true;\n } catch (IOException e) {\n System.err.println(\n \"IOException occured while making wiring diagram: \"\n + e.getMessage());\n System.err.println(\n \"We can continue with the build, but you don't get any diagrams.\");\n }\n }\n\n if (errored) {\n System.exit(-1);\n }\n }",
"@Test\r\n \tpublic void testEpcAosChrgsAcctAgt01() throws Throwable {\r\n \r\n \t\tList<IInterpretationResult> results;\r\n \t\tresults = super.interpretConstraintsForInstance(CONSTRAINT_DIRECTORY\r\n \t\t\t\t+ \"/epcAosChrgsAcctAgt\", MODELINSTANCE_NAME_01, Arrays\r\n \t\t\t\t.asList(new String[] { \"PaymentInstructionInformation2\" }));\r\n \r\n \t\tassertNotNull(results);\r\n \t\tassertEquals(2, results.size());\r\n \r\n \t\tthis.assertIsTrue(results.get(0));\r\n \t\tthis.assertIsTrue(results.get(1));\r\n \t}",
"@Test\n public void testReplicatedBm()\n {\n generateEvents(\"repl-bm-test\");\n checkEvents(false, true);\n BackingMapListener.INSTANCE.assertContext();\n }",
"@Test\n public void ensemblProteinIdTest() {\n // TODO: test ensemblProteinId\n }",
"@Test public void calcROItest() {\n DirectMC h = new DirectMC(\"AdMailing\", 10000.00, 3.00, 2000);\n Assert.assertEquals(.4286, h.calcROI(), 1);\n }",
"private static void test () throws Exception {\n\n try {\n\n\n // ISCII91 is an 8-byte encoding which retains the ASCII\n // mappings in the lower half.\n\n mapEquiv(0, 0x7f, \"7 bit ASCII range\");\n\n // Checks a range of characters which are unmappable according\n // to the standards.\n\n checkUnmapped(0x81, 0x9f, \"UNMAPPED\");\n\n // Vowel Modifier chars can be used to modify the vowel\n // sound of the preceding consonant, vowel or matra character.\n\n byte[] testByte = new byte[1];\n char[] vowelModChars = {\n '\\u0901', // Vowel modifier Chandrabindu\n '\\u0902', // Vowel modifier Anuswar\n '\\u0903' // Vowel modifier Visarg\n };\n\n checkRange(0xa1, 0xa3, vowelModChars, \"INDIC VOWEL MODIFIER CHARS\");\n\n char[] expectChars = {\n '\\u0905', // a4 -- Vowel A\n '\\u0906', // a5 -- Vowel AA\n '\\u0907', // a6 -- Vowel I\n '\\u0908', // a7 -- Vowel II\n '\\u0909', // a8 -- Vowel U\n '\\u090a', // a9 -- Vowel UU\n '\\u090b', // aa -- Vowel RI\n '\\u090e', // ab -- Vowel E ( Southern Scripts )\n '\\u090f', // ac -- Vowel EY\n '\\u0910', // ad -- Vowel AI\n '\\u090d', // ae -- Vowel AYE ( Devanagari Script )\n '\\u0912', // af -- Vowel O ( Southern Scripts )\n '\\u0913', // b0 -- Vowel OW\n '\\u0914', // b1 -- Vowel AU\n '\\u0911', // b2 -- Vowel AWE ( Devanagari Script )\n };\n\n checkRange(0xa4, 0xb2, expectChars, \"INDIC VOWELS\");\n\n char[] expectConsChars =\n {\n '\\u0915', // b3 -- Consonant KA\n '\\u0916', // b4 -- Consonant KHA\n '\\u0917', // b5 -- Consonant GA\n '\\u0918', // b6 -- Consonant GHA\n '\\u0919', // b7 -- Consonant NGA\n '\\u091a', // b8 -- Consonant CHA\n '\\u091b', // b9 -- Consonant CHHA\n '\\u091c', // ba -- Consonant JA\n '\\u091d', // bb -- Consonant JHA\n '\\u091e', // bc -- Consonant JNA\n '\\u091f', // bd -- Consonant Hard TA\n '\\u0920', // be -- Consonant Hard THA\n '\\u0921', // bf -- Consonant Hard DA\n '\\u0922', // c0 -- Consonant Hard DHA\n '\\u0923', // c1 -- Consonant Hard NA\n '\\u0924', // c2 -- Consonant Soft TA\n '\\u0925', // c3 -- Consonant Soft THA\n '\\u0926', // c4 -- Consonant Soft DA\n '\\u0927', // c5 -- Consonant Soft DHA\n '\\u0928', // c6 -- Consonant Soft NA\n '\\u0929', // c7 -- Consonant NA ( Tamil )\n '\\u092a', // c8 -- Consonant PA\n '\\u092b', // c9 -- Consonant PHA\n '\\u092c', // ca -- Consonant BA\n '\\u092d', // cb -- Consonant BHA\n '\\u092e', // cc -- Consonant MA\n '\\u092f', // cd -- Consonant YA\n '\\u095f', // ce -- Consonant JYA ( Bengali, Assamese & Oriya )\n '\\u0930', // cf -- Consonant RA\n '\\u0931', // d0 -- Consonant Hard RA ( Southern Scripts )\n '\\u0932', // d1 -- Consonant LA\n '\\u0933', // d2 -- Consonant Hard LA\n '\\u0934', // d3 -- Consonant ZHA ( Tamil & Malayalam )\n '\\u0935', // d4 -- Consonant VA\n '\\u0936', // d5 -- Consonant SHA\n '\\u0937', // d6 -- Consonant Hard SHA\n '\\u0938', // d7 -- Consonant SA\n '\\u0939', // d8 -- Consonant HA\n };\n\n checkRange(0xb3, 0xd8, expectConsChars, \"INDIC CONSONANTS\");\n\n char[] matraChars = {\n '\\u093e', // da -- Vowel Sign AA\n '\\u093f', // db -- Vowel Sign I\n '\\u0940', // dc -- Vowel Sign II\n '\\u0941', // dd -- Vowel Sign U\n '\\u0942', // de -- Vowel Sign UU\n '\\u0943', // df -- Vowel Sign RI\n '\\u0946', // e0 -- Vowel Sign E ( Southern Scripts )\n '\\u0947', // e1 -- Vowel Sign EY\n '\\u0948', // e2 -- Vowel Sign AI\n '\\u0945', // e3 -- Vowel Sign AYE ( Devanagari Script )\n '\\u094a', // e4 -- Vowel Sign O ( Southern Scripts )\n '\\u094b', // e5 -- Vowel Sign OW\n '\\u094c', // e6 -- Vowel Sign AU\n '\\u0949' // e7 -- Vowel Sign AWE ( Devanagari Script )\n };\n\n // Matras or Vowel signs alter the implicit\n // vowel sound associated with an Indic consonant.\n\n checkRange(0xda, 0xe7, matraChars, \"INDIC MATRAS\");\n\n char[] loneContextModifierChars = {\n '\\u094d', // e8 -- Vowel Omission Sign ( Halant )\n '\\u093c', // e9 -- Diacritic Sign ( Nukta )\n '\\u0964' // ea -- Full Stop ( Viram, Northern Scripts )\n };\n\n checkRange(0xe8, 0xea,\n loneContextModifierChars, \"LONE INDIC CONTEXT CHARS\");\n\n\n // Test Indic script numeral chars\n // (as opposed to international numerals)\n\n char[] expectNumeralChars =\n {\n '\\u0966', // f1 -- Digit 0\n '\\u0967', // f2 -- Digit 1\n '\\u0968', // f3 -- Digit 2\n '\\u0969', // f4 -- Digit 3\n '\\u096a', // f5 -- Digit 4\n '\\u096b', // f6 -- Digit 5\n '\\u096c', // f7 -- Digit 6\n '\\u096d', // f8 -- Digit 7\n '\\u096e', // f9 -- Digit 8\n '\\u096f' // fa -- Digit 9\n };\n\n checkRange(0xf1, 0xfa,\n expectNumeralChars, \"NUMERAL/DIGIT CHARACTERS\");\n int lookupOffset = 0;\n\n char[] expectNuktaSub = {\n '\\u0950',\n '\\u090c',\n '\\u0961',\n '\\u0960',\n '\\u0962',\n '\\u0963',\n '\\u0944',\n '\\u093d'\n };\n\n /*\n * ISCII uses a number of code extension techniques\n * to access a number of lesser used characters.\n * The Nukta character which ordinarily signifies\n * a diacritic is used in combination with existing\n * characters to escape them to a different character.\n * value.\n */\n\n byte[] codeExtensionBytes = {\n (byte)0xa1 , (byte)0xe9, // Chandrabindu + Nukta\n // =>DEVANAGARI OM SIGN\n (byte)0xa6 , (byte)0xe9, // Vowel I + Nukta\n // => DEVANAGARI VOCALIC L\n (byte)0xa7 , (byte)0xe9, // Vowel II + Nukta\n // => DEVANAGARI VOCALIC LL\n (byte)0xaa , (byte)0xe9, // Vowel RI + Nukta\n // => DEVANAGARI VOCALIC RR\n (byte)0xdb , (byte)0xe9, // Vowel sign I + Nukta\n // => DEVANAGARI VOWEL SIGN VOCALIC L\n (byte)0xdc , (byte)0xe9, // Vowel sign II + Nukta\n // => DEVANAGARI VOWEL SIGN VOCALIC LL\n\n (byte)0xdf , (byte)0xe9, // Vowel sign Vocalic R + Nukta\n // => DEVANAGARI VOWEL SIGN VOCALIC RR\n (byte)0xea , (byte)0xe9 // Full stop/Phrase separator + Nukta\n // => DEVANAGARI SIGN AVAGRAHA\n };\n\n lookupOffset = 0;\n byte[] bytePair = new byte[2];\n\n for (int i=0; i < (codeExtensionBytes.length)/2; i++ ) {\n bytePair[0] = (byte) codeExtensionBytes[lookupOffset++];\n bytePair[1] = (byte) codeExtensionBytes[lookupOffset++];\n\n String unicodeStr = new String (bytePair,\"ISCII91\");\n if (unicodeStr.charAt(0) != expectNuktaSub[i]) {\n throw new Exception(\"Failed Nukta Sub\");\n }\n }\n\n lookupOffset = 0;\n byte[] comboBytes = {\n (byte)0xe8 , (byte)0xe8, //HALANT + HALANT\n (byte)0xe8 , (byte)0xe9 //HALANT + NUKTA aka. Soft Halant\n };\n char[] expectCombChars = {\n '\\u094d',\n '\\u200c',\n '\\u094d',\n '\\u200d'\n };\n\n for (int i=0; i < (comboBytes.length)/2; i++ ) {\n bytePair[0] = (byte) comboBytes[lookupOffset++];\n bytePair[1] = (byte) comboBytes[lookupOffset];\n String unicodeStr = new String (bytePair, \"ISCII91\");\n if (unicodeStr.charAt(0) != expectCombChars[lookupOffset-1]\n && unicodeStr.charAt(1) != expectCombChars[lookupOffset]) {\n throw new Exception(\"Failed ISCII91 Regression Test\");\n }\n lookupOffset++;\n }\n\n } catch (UnsupportedEncodingException e) {\n System.err.println (\"ISCII91 encoding not supported\");\n throw new Exception (\"Failed ISCII91 Regression Test\");\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests ctor CutStateNodeAbstractActionCutStateNodeAbstractAction(String,StateVertex,Clipboard) for accuracy. Verify : the newly created CutStateNodeAbstractAction instance should not be null. | public void testCtor() {
assertNotNull("Failed to create a new CutStateNodeAbstractAction instance.", action);
} | [
"public void testCtor_NullClipboard() {\n assertNotNull(\"Failed to create a new CutStateNodeAbstractAction instance.\",\n new MockCutStateNodeAbstractAction(\"Cut\", state, null));\n }",
"public void testCtor_NullState() {\n try {\n new MockCutStateNodeAbstractAction(\"Cut\", null, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testCtor_NullClipboard() {\n assertNotNull(\"Failed to create a new CopyJoinNodeAction instance.\", new CopyJoinNodeAction(state, null));\n }",
"public void testCtor_EmptyName() {\n try {\n new MockCutStateNodeAbstractAction(\" \", state, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testCtor_Accuracy2() {\n assertNotNull(\"Failed to create the action!\",\n new CutCommentAction(this.comment, Toolkit.getDefaultToolkit().getSystemClipboard()));\n }",
"public void testCtor_NullContainer() {\n state = new SimpleStateImpl();\n try {\n new MockCutStateNodeAbstractAction(\"Cut\", state, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testCtor_Accuracy1() {\n assertNotNull(\"Failed to create the action!\",\n new CutCommentAction(this.comment, null));\n }",
"public void testCtor_NullName() {\n try {\n new MockCutStateNodeAbstractAction(null, state, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testCtor_NullState() {\n try {\n new CopyJoinNodeAction(null, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testExecute_Unrecognizable() {\n MockStateVertex mockStateVertex = new MockStateVertex();\n mockStateVertex.setContainer(container);\n action = new MockCutStateNodeAbstractAction(\"Cut\", mockStateVertex, clipboard);\n try {\n action.execute();\n fail(\"ActionExecutionException expected.\");\n } catch (ActionExecutionException e) {\n //good\n }\n }",
"public void testCtor() {\n assertNotNull(\"Failed to create a new CopyJoinNodeAction instance.\", action);\n }",
"public void testConstructor() {\n CutSubsystemAction cutSubsystemAction = new CutSubsystemAction(subsystem);\n assertNotNull(\"Instance of CutSubsystemAction should be created.\", cutSubsystemAction);\n }",
"public void testCtor() {\n assertNotNull(\"Failed to create a new DiagramElementUndoableAction instance.\", action);\n }",
"public void testCtor2NullClipboard() {\n try {\n new CutObjectAction(object, null);\n fail(\"stimulus is null, IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n // expect\n }\n }",
"public void testExecute_ActivityObjectCloneException() throws ActionExecutionException {\n MockObjectFlowState mockObjectFlowState = new MockObjectFlowState(\"Test\");\n mockObjectFlowState.setContainer(container);\n action = new MockCutStateNodeAbstractAction(\"Cut\", (StateVertex) mockObjectFlowState, clipboard);\n try {\n action.execute();\n fail(\"ActivityObjectCloneException expected.\");\n } catch (ActivityObjectCloneException e) {\n //good\n }\n }",
"public void testConstructorWithNamespace() {\n CutSubsystemAction cutSubsystemAction = new CutSubsystemAction(subsystem, clipboard);\n assertNotNull(\"Instance of CutSubsystemAction should be created.\", cutSubsystemAction);\n }",
"public void testCtor_WrongKind() {\n state = new PseudostateImpl();\n try {\n new CopyJoinNodeAction(state, clipboard);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }",
"public void testCtor2NullStimulus() {\n try {\n new CutObjectAction(null, clip);\n fail(\"stimulus is null, IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n // expect\n }\n }",
"public void testConstructor() throws Exception {\n PasteIncludeAction pasteIncludeAction = new PasteIncludeAction(transferable, namespace);\n assertNotNull(\"Instance of PasteIncludeAction should be created.\", pasteIncludeAction);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the message matches this classes message type, then the class will return a new message of this type, part of the chain of responsibility | @Override
public Message getMessageType(Message message) {
if (message.getHeader().getMessageType() == MESSAGE_TYPE) {
return new AbilityMessage(message);
} else {
// Send it on to the next in the chain
if (this.messageChain != null) {
return this.messageChain.getMessageType(message);
}
}
return null;
} | [
"public void readNewMessage() throws IOException, ClassNotFoundException, IllegalAccessException,\n InvocationTargetException, IllegalArgumentException {\n mReadMessage = (Message) mInStream.readObject();\n if (mReadMessage instanceof NewMessageType) {\n // we add the message to the mInStream\n NewMessageType nmt = (NewMessageType) mReadMessage;\n mInStream.addClass(nmt.getName(),nmt.getClassData()); // adding the class\n System.out.println(Strings.getNewMessageTypeMessage(nmt.getName())); // writing the message\n }\n else if (!(mReadMessage instanceof RelayMessage) && !(mReadMessage instanceof StatusMessage)) {\n // we have an unknown message type, so we throw an InvalidMessageTypeException\n System.out.println(Strings.getUnknownTypeMessage(mReadMessage));\n Class c = mReadMessage.getClass();\n Method mthds[] = c.getDeclaredMethods();\n for (Method m : mthds) {\n if (m.isAnnotationPresent(Execute.class)) {\n if (!m.isAccessible()) {\n m.setAccessible(true);\n }\n m.invoke(mReadMessage, new Object[0]);\n }\n }\n }\n }",
"public abstract Message buildMessage();",
"<T extends Message> T newMessage(Class<T> clazz) throws HL7Exception;",
"private static Message extractNextMessageFromHTL(InputStream is) throws IOException {\n\t\t// The first byte of each crossbear.Message is its type\n\t\tint messageType = is.read();\n\n\t\t// In case the last message has been read in.read() returned \"-1\" -> return null\n\t\tif (messageType == -1) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Verify message type: It has to be either MESSAGE_TYPE_PUBLIC_IP_NOTIFX, MESSAGE_TYPE_CURRENT_SERVER_TIME or MESSAGE_TYPE_IPVX_SHA256_TASK\n\t\tif (messageType != Message.MESSAGE_TYPE_PUBLIC_IP_NOTIF4 && messageType != Message.MESSAGE_TYPE_PUBLIC_IP_NOTIF6 && messageType != Message.MESSAGE_TYPE_CURRENT_SERVER_TIME\n\t\t\t\t&& messageType != Message.MESSAGE_TYPE_IPV4_SHA256_TASK && messageType != Message.MESSAGE_TYPE_IPV6_SHA256_TASK) {\n\t\t\t\n\t\t\tthrow new IllegalArgumentException(\"The provided messageType \" + messageType + \" was not expected\");\n\t\t}\n\n\t\t// Read the message's length field (which are bytes 2 & 3 of each crossbear.Message)\n\t\tbyte[] messageLengthB = Message.readNBytesFromStream(is, 2);\n\t\tint messageLength = Message.byteArrayToInt(messageLengthB);\n\n\t\t// Try to read one message from the input (validation is performed inside the message's constructor)\n\t\tbyte[] raw = Message.readNBytesFromStream(is, messageLength - 3);\n\n\t\t// Build the Message based on the bytes read from the InputStream\n\t\tif (messageType == Message.MESSAGE_TYPE_PUBLIC_IP_NOTIF4) {\n\t\t\treturn new PublicIPNotification(raw, 4);\n\t\t} else if (messageType == Message.MESSAGE_TYPE_PUBLIC_IP_NOTIF6) {\n\t\t\treturn new PublicIPNotification(raw, 6);\n\t\t} else if (messageType == Message.MESSAGE_TYPE_CURRENT_SERVER_TIME) {\n\t\t\treturn new CurrentServerTime(raw);\n\t\t} else if (messageType == Message.MESSAGE_TYPE_IPV4_SHA256_TASK) {\n\t\t\treturn new HuntingTask(raw, 4);\n\t\t} else if (messageType == Message.MESSAGE_TYPE_IPV6_SHA256_TASK) {\n\t\t\treturn new HuntingTask(raw, 6);\n\t\t} else {\n\t\t\tthrow new IllegalArgumentException(\"The provided messageType \" + messageType + \" was not expected\");\n\t\t}\n\t}",
"public void expectedMessage(Class<? extends Message> aMessageType);",
"messages.Basemessage.BaseMessage.Type getType();",
"MsgBody.MessageType getMessageType();",
"public static Message makeMessage(byte[] buffer) \n {\n\t short type = (short)((buffer[0] & 0xff <<8)|buffer[1] & 0xff); \n\t switch (type) {\n case CONNECT_TYPE: { System.out.println(\"msg received CONNECT_TYPE\");\n return new Connect(buffer); }\n case ACKCONNECT_TYPE: { System.out.println(\"msg received ACKCONNECT_TYPE\");\n return new AckConnect(buffer); }\n case OPEN_TYPE: { System.out.println(\"msg received OPEN_TYPE\");\n return new Open(buffer); }\n\t\t\t case ACKOPEN_TYPE: \n \t \t\t case ACKLOCK_TYPE:\n \t \t\t case ACKEDIT_TYPE: \n\t \t\t case SERVRELEASE_TYPE: { System.out.println(\"msg received ACK*\");\n return new Ack(buffer); }\n case REQLOCK_TYPE: { System.out.println(\"msg received REQLOCK_TYPE\");\n return new ReqLock(buffer); }\n case RELEASE_TYPE: { System.out.println(\"msg received RELEASE_TYPE\");\n return new Release(buffer); }\n case MOVE_TYPE: { System.out.println(\"msg received MOVE_TYPE\");\n return new Move(buffer); }\n case REQCONTENTS_TYPE: { System.out.println(\"msg received REQCONTENTS_TYPE\");\n return new ReqContents(buffer); }\n case CONTENTS_TYPE: { System.out.println(\"msg received CONTENTS_TYPE\");\n return new Contents(buffer); }\n case SYNC_TYPE: { System.out.println(\"msg received SYNC_TYPE\");\n return new Sync(buffer); }\n case STATUS_TYPE: { System.out.println(\"msg received STATUS_TYPE\");\n return new Status(buffer); }\n case EDIT_TYPE: { System.out.println(\"msg received EDIT_TYPE\");\n return new Edit(buffer); }\n\t\t case CLOSE_TYPE: { System.out.println(\"msg received CLOSE_TYPE\");\n return new Close(buffer); }\n case ERROR_TYPE: { System.out.println(\"msg received ERROR_TYPE\");\n return new Error(buffer); }\n default: { System.out.println(\"Error: Invalid message type\");\n return null; }\n\t\t}\n }",
"public Message newMessage(String type, String addr) {\n\tMessage message = null;\n\n\tif (type.equals(MessageConnection.TEXT_MESSAGE)) {\n\n\t message = new TextObject(addr);\n\t} else {\n\t if (type.equals(MessageConnection.BINARY_MESSAGE)) {\n\n message = new BinaryObject(addr);\n\t } else {\n throw new IllegalArgumentException(\n \"Message type not supported\");\n\t }\n\t}\n\n\n\treturn message;\n }",
"MessagesType createMessagesType();",
"public T caseMessage(Message object) {\n\t\treturn null;\n\t}",
"public abstract MessageType getHandledMessageType();",
"public abstract MessageType copyFrom(MessageType other);",
"public Message processClientMessage(Message msg) throws MessageTypeException {\t\t\t\t\t\n\t\tClientMessage clmsg = (ClientMessage) msg;\t\t\n\t\tString surl = getShortUrl(clmsg);\t\t\n\t\tint primaryId = findPrimary(surl); \n\t\tif (primaryId == nodeId){\t\t\t\n\t\t\tNodeMessage reply = (NodeMessage)MessageHandler.handleMessage(createNodeMessage(clmsg, surl),\n\t\t\t\t\tstorageService, replicaManager);\n\t\t\treturn reply; \n\t\t}\n\t\telse {\t\t\n\t\t\tNodeMessage nmsg = createNodeMessage(clmsg, surl);\n\t\t\tGossipMember member = getMemberFromId(primaryId);\n\t\t\tString ipAddr = member.getHost();\n\t\t\tint port = requestManager.getPort();\t\t\t\n\t\t\tMessage reply=null;\n\t\t\ttry {\n\t\t\t\treply = requestManager.sendMessage(nmsg, ipAddr, port);\n\t\t\t} catch (UnknownHostException | InterruptedException | ExecutionException e) {\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn reply;\n\t\t}\t\t\n\t}",
"public Message mergeMessage(Message newMsg) throws NavajoException;",
"public void expectedMessage(Class<? extends Message> aMessageType, int aTotal);",
"@Override \n\tpublic MessageWrapper handleMessage(MessageWrapper msgWrapper) {\n\t\tString from = msgWrapper.getFromAddress();\n\t\tString to = msgWrapper.getToAddress();\n\t\tString data = msgWrapper.getMessageData();\n\t\tMessageWrapper $ = null;\n\t\tswitch (TTalkMessageType.values()[msgWrapper.getMessageType()]) {\n\t\t\tcase SEND:\n\t\t\t\tif (m_onlineUsers.contains(to))\n\t\t\t\t\t$ = msgWrapper;\n\t\t\t\telse {\n\t\t\t\t\tif (!m_outgoingMessages.containsKey(to))\n\t\t\t\t\t\tm_outgoingMessages.put(to, new ArrayList<MessageWrapper>());\n\t\t\t\t\tm_outgoingMessages.get(to).add(msgWrapper);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase LOGIN:\n\t\t\t\tm_onlineUsers.add(from);\n\t\t\t\tif (!m_friendsLists.containsKey(from))\n\t\t\t\t\tm_friendsLists.put(from, new HashSet<String>());\n\t\t\t\tif (!m_outgoingMessages.containsKey(from))\n\t\t\t\t\tm_outgoingMessages.put(from, new ArrayList<MessageWrapper>());\n\t\t\t\t$ = new MessageWrapper(getAddress(), from, JsonAuxiliary.messageWrapperListToJson(m_outgoingMessages.get(from)),\n\t\t\t\t TTalkMessageType.RETREIVE.getValue());\n\t\t\t\tm_outgoingMessages.get(from).clear();\n\t\t\t\tbreak;\n\t\t\tcase FRIEND_REQUEST:\n\t\t\t\tif (m_onlineUsers.contains(to))\n\t\t\t\t\t$ = new MessageWrapper(getAddress(), to, from, TTalkMessageType.FRIEND_REQUEST.getValue());\n\t\t\t\telse {\n\t\t\t\t\tif (!m_outgoingMessages.containsKey(to))\n\t\t\t\t\t\tm_outgoingMessages.put(to, new ArrayList<MessageWrapper>());\n\t\t\t\t\tm_outgoingMessages.get(to).add(new MessageWrapper(getAddress(), to, from, TTalkMessageType.FRIEND_REQUEST.getValue()));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FRIEND_REQUEST_ACCEPT:\n\t\t\t\tif (!m_friendsLists.containsKey(data))\n\t\t\t\t\tm_friendsLists.put(data, new HashSet<String>());\n\t\t\t\tm_friendsLists.get(from).add(data);\n\t\t\t\tm_friendsLists.get(data).add(from);\n\t\t\t\t$ = new MessageWrapper(getAddress(), data, from, TTalkMessageType.FRIEND_REQUEST_ACCEPT.getValue());\n\t\t\t\tbreak;\n\t\t\tcase FRIEND_REQUEST_DECLINE:\n\t\t\t\t$ = new MessageWrapper(getAddress(), data, from, TTalkMessageType.FRIEND_REQUEST_DECLINE.getValue());\n\t\t\t\tbreak;\n\t\t\tcase LOGOUT:\n\t\t\t\tm_onlineUsers.remove(from);\n\t\t\t\tbreak;\n\t\t\tcase IS_ONLINE:\n\t\t\t\tif (m_friendsLists.get(from).contains(data))\n\t\t\t\t\t$ = new MessageWrapper(getAddress(), from, m_onlineUsers.contains(data) ? \"1\" : \"0\",\n\t\t\t\t\t TTalkMessageType.IS_ONLINE.getValue());\n\t\t\t\telse\n\t\t\t\t\t$ = new MessageWrapper(getAddress(), from, \"-1\", TTalkMessageType.IS_ONLINE.getValue());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// TODO: exception?\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $;\n\t}",
"public String determineMessageToReSend( String inputMessage );",
"protected static AbstractMessage getMergeRequestInstanceByCode(int typeCode) {\n switch (typeCode) {\n case MessageType.TYPE_GLOBAL_BEGIN:\n return new GlobalBeginRequest();\n case MessageType.TYPE_GLOBAL_COMMIT:\n return new GlobalCommitRequest();\n case MessageType.TYPE_GLOBAL_ROLLBACK:\n return new GlobalRollbackRequest();\n case MessageType.TYPE_GLOBAL_STATUS:\n return new GlobalStatusRequest();\n case MessageType.TYPE_GLOBAL_LOCK_QUERY:\n return new GlobalLockQueryRequest();\n case MessageType.TYPE_BRANCH_REGISTER:\n return new BranchRegisterRequest();\n case MessageType.TYPE_BRANCH_STATUS_REPORT:\n return new BranchReportRequest();\n default:\n throw new IllegalArgumentException(\"not support typeCode,\" + typeCode);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the Object to the serializer, if it implements the ca.uregina.thg.client.common.net.Serializable interface | public void write(othi.thg.common.Serializer obj) throws IOException {
obj.writeObject(this);
} | [
"void serialize(Object o, ByteBuf b);",
"void serialize(Object obj, OutputStream stream) throws IOException;",
"private void encodeOSRFSerializable(OSRFSerializable obj, StringBuffer sb) {\n\n OSRFRegistry reg = obj.getRegistry();\n String[] fields = reg.getFields();\n Map<String, Object> map = new HashMap<String, Object>();\n map.put(JSONReader.JSON_CLASS_KEY, reg.getNetClass());\n\n if( reg.getWireProtocol() == OSRFRegistry.WireProtocol.ARRAY ) {\n\n /** encode arrays as lists */\n List<Object> list = new ArrayList<Object>(fields.length);\n for(String s : fields)\n list.add(obj.get(s));\n map.put(JSONReader.JSON_PAYLOAD_KEY, list);\n\n } else {\n\n /** encode hashes as maps */\n Map<String, Object> subMap = new HashMap<String, Object>();\n for(String s : fields)\n subMap.put(s, obj.get(s));\n map.put(JSONReader.JSON_PAYLOAD_KEY, subMap);\n \n }\n\n /** now serialize the encoded object */\n write(map, sb);\n }",
"private void serializeObject(final Object object, final StringBuffer buffer)\n {\n serializeObject(object, buffer, true);\n }",
"byte[] serialize(Serializable object);",
"String serialize(Object object);",
"String serialize(Object object, SerializerEncoding encoding) throws IOException;",
"byte[] serialize(Object o) throws IOException;",
"private byte[] serialize(Serializable object) throws Exception {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n ObjectOutputStream objectStream = new ObjectOutputStream(stream);\n objectStream.writeObject(object);\n objectStream.flush();\n return stream.toByteArray();\n }",
"public void addObject(ZSerializable obj) throws IOException {\n\t\t\t\t// Check for class provided writeReplace substitution method.\n\t\t\t\t// Method can not be static.\n\ttry {\n\t Method writeReplaceMethod = obj.getClass().getDeclaredMethod(\"writeReplace\", NULL_ARGS);\n\t int mods = writeReplaceMethod.getModifiers();\n\t if ((mods & Modifier.STATIC) == 0) {\n\t\t\t\t// Determine replacement object\n\t\tObject replacementObj = null;\n\t\ttry {\n\t\t replacementObj = writeReplaceMethod.invoke(obj, NULL_ARGS);\n\n\t\t\t\t// Keep list of unsaved objects so we can skip any references to original\n\t\t if (replacementObj == null) {\n\t\t\tif (!unsavedObjs.containsKey(obj)) {\n\t\t\t unsavedObjs.put(obj, new Integer(id));\n\t\t\t id++;\n\t\t\t}\n\t\t\tobj = null;\n\t\t } else {\n\t\t\tif (replacementObj != obj) {\n\t\t\t if (!replacedObjs.containsKey(obj)) {\n\t\t\t\treplacedObjs.put(obj, replacementObj);\n\t\t\t }\n\t\t\t if (replacementObj instanceof ZSerializable) {\n\t\t\t\tobj = (ZSerializable)replacementObj;\n\t\t\t } else {\n\t\t\t\tthrow new IOException(\"ZObjectOutputStream.addObject: Error saving: \" + obj + \n\t\t\t\t\t\t \", Replacement is not ZSerializable: \" + replacementObj);\n\t\t\t }\n\t\t\t}\n\t\t }\n\n\t\t} catch (IllegalAccessException e) {\n\t\t throw new IOException(\"ZObjectOutputStream.addObject: Error saving: \" + obj + \n\t\t\t\t\t \", Can't access writeReplace method: \" + e);\n\t\t} catch (InvocationTargetException e) {\n\t\t throw new IOException(\"ZObjectOutputStream.addObject: Error saving: \" + obj + \", \" + e);\n\t\t}\n\t }\n\t} catch (NoSuchMethodException e) {\n\t\t\t\t// If no replacement method - then just continue along without replacing object\n\t}\n\n\tif (obj != null) {\n\t if (!objs.containsKey(obj)) {\n\t\tobjs.put(obj, new Integer(id));\n\t\tid++;\n\t\tobj.writeObjectRecurse(this);\n\t }\n\t}\n }",
"public static String encodeObject(java.io.Serializable serializableObject, int options) {",
"public void write(Object obj) {\n try {\n if (out == null) {\n out = new ObjectOutputStream(socket.getOutputStream());\n }\n out.writeObject(obj);\n } catch (Exception e) {\n Log.e(TAG, \"Unable to write to clients :(\");\n }\n }",
"public void sendObjectToClient(Object o) {\n try {\n out.writeObject(o);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public interface ICustomObjectSerializer {\n\n\t/**\n\t * Must return true if the handler can serialize this object.\n\t * @param object\n\t * @return\n\t */\n\tpublic boolean handlesObject(Object object);\n\t\n\t/**\n\t * Must return true if the handler can deserialize objects of this type.\n\t * @param clazz\n\t * @return\n\t */\n\tpublic boolean handlesType(Class<?> clazz);\n\t\n\t/**\n\t * Serialize an object.\n\t * @param elm\n\t * @param object\n\t */\n\tpublic void serialize(Element elm, Object object) throws TransportException;\n\t\n\t/**\n\t * Deserialize an object.\n\t * @param elm\n\t * @return\n\t */\n\tpublic Object deserialize(Element elm) throws TransportException;\n\t\n}",
"@Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n out.write(getEncoded());\n }",
"public void writeObject(Object obj) throws IOException;",
"private static void serialize(Object obj, String locationToSerialize) {\n\t\ttry (FileOutputStream fileOut = new FileOutputStream(\n\t\t\t\tlocationToSerialize);\n\t\t\t\tObjectOutputStream objectOut = new ObjectOutputStream(fileOut)) {\n\t\t\tobjectOut.writeObject(obj);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"FileNotFoundException during serialization (Gitlet possibly uninitialized)\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IOException during serialization.\");\n\t\t}\n\t}",
"void added(Serializable id, Object o);",
"Object defaultReplaceObject(Object obj) throws IOException {\n\t logger.log(Level.FINEST, \"Object in stream instance of: {0}\", obj.getClass());\n\t try {\n\t\tif (obj instanceof DynamicProxyCodebaseAccessor ){\n\t\t logger.log(Level.FINEST, \"Object in stream instance of DynamicProxyCodebaseAccessor\");\n\t\t obj = \n\t\t ProxySerializer.create(\n\t\t\t (DynamicProxyCodebaseAccessor) obj,\n\t\t\t aout.defaultLoader,\n\t\t\t aout.getObjectStreamContext()\n\t\t );\n\t\t} else if (obj instanceof ProxyAccessor ) {\n\t\t logger.log(Level.FINEST, \"Object in stream instance of ProxyAccessor\");\n\t\t obj = \n\t\t ProxySerializer.create(\n\t\t\t (ProxyAccessor) obj,\n\t\t\t aout.defaultLoader,\n\t\t\t aout.getObjectStreamContext()\n\t\t );\n\t\t}\n\t } catch (IOException e) {\n\t\tlogger.log(Level.FINE, \"Unable to create ProxyAccessorSerializer\", e);\n\t\tthrow e;\n\t }\n\t Class c = obj.getClass();\n\t Class s = serializers.get(c);\n\t if (c.isAnnotationPresent(AtomicSerial.class)){} // Ignore\n\t else if (c.isAnnotationPresent(AtomicExternal.class)){} // Ignore\n\t // REMIND: stateless objects, eg EmptySet?\n\t else if (s != null){\n\t\ttry {\n\t\t Constructor constructor = s.getDeclaredConstructor(c);\n\t\t obj = constructor.newInstance(obj);\n\t\t} catch (NoSuchMethodException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (SecurityException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (InstantiationException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (IllegalAccessException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (IllegalArgumentException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t} catch (InvocationTargetException ex) {\n\t\t logger.log(Level.FINE, \"Unable to contruct serializer\", ex);\n\t\t}\n\t }\n\t else if (obj instanceof Map) obj = new MapSerializer((Map) obj);\n\t else if (obj instanceof Set) obj = new SetSerializer((Set) obj);\n\t else if (obj instanceof Collection) obj = new ListSerializer((Collection) obj);\n\t else if (obj instanceof Permission) obj = new PermissionSerializer((Permission) obj);\n\t else if (obj instanceof Throwable) obj = new ThrowableSerializer((Throwable) obj);\n\t logger.log(Level.FINEST, \"Returning object in stream instance of: {0}\", obj.getClass());\n\t return obj;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the unique name associated with the i'th numeric attribute. All strings will be converted to lower case first. | public boolean setNumericName(String name, int i) {
if (i < getNumNumericalVars() && i >= 0)
numericalVariableNames.put(i, name);
else
return false;
return true;
} | [
"public void setUniqueName(String name){\n //uniqueName = name;\n\n int range = Integer.MAX_VALUE / 3 * 2;\n Random rand = new Random();\n int i = rand.nextInt(range);\n Integer j = new Integer(i);\n uniqueName = name + j.toString();\n }",
"public String getNumericName(int i) {\n if (i < getNumNumericalVars() && i >= 0)\n return numericalVariableNames.getOrDefault(i, \"Numeric Feature \" + i);\n else\n throw new IndexOutOfBoundsException(\"Can not acces variable for invalid index \" + i);\n }",
"public void setName(int idx, String name) {\n\t\tnvPairs.set(idx << 1, name);\n\t}",
"public void setAttr(int i, Object attr) {\n if (attrs == null) {\n attrs = new Object[MAX_ATTR];\n }\n attrs[i] = attr;\n }",
"String getAttributeUnnormalizedValue(int i);",
"String getAttributeName(int i);",
"public void setName(String name, int index)\n\t{\n\t\tcounters.get(index).setName(name);\n\t}",
"public void setAttributeName(java.lang.String attributeName)\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(ATTRIBUTENAME$2, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ATTRIBUTENAME$2);\n }\n target.setStringValue(attributeName);\n }\n }",
"private void setAutomaticName() {\n final long id = this.id >= 0 ? this.id : this.simulation.getNumEntities();\n this.name = String.format(\"%s%d\", getClass().getSimpleName(), id);\n }",
"void setInt(int attributeValue);",
"public void setAttr1 (String value, String name) {\n setAttr1(value, entryNames.indexOf(name));\n }",
"public void setNametype(Integer nametype) {\r\n this.nametype = nametype;\r\n }",
"public void setValue(Number i) {\n setText(i.toString());\n }",
"public void setAttribute(String attr) { this.attribute = attr; }",
"public void attribute(String name, int value)\r\n throws IOException, IllegalStateException {\r\n if (!this.isNude) throw new IllegalArgumentException(\"Cannot write attribute: too late!\");\r\n this.writer.write(' ');\r\n this.writer.write(name);\r\n this.writer.write(\"=\\\"\");\r\n this.writer.write(Integer.toString(value));\r\n this.writer.write('\"');\r\n }",
"public void setNameOfVertex(String name, int index)\n {\n vertexes.get(index).setAttribute(ATTRIBUTNAME, name);\n }",
"public void setNumAttributes(int numAttributes) {\n m_NumAttributes = numAttributes;\n }",
"public void abbrNumber() {\n for (int i = 0; i < sample.length; i++) {\n sample[i].abbr = \"\" + (i + 1);\n }\n }",
"@Override\n public String setName(int numSat, SatelliteSystem sys) {\n return super.setName(numSat, sys);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A modified version of localization using at waypoints. The final position and orientation of the robot is changed from the original version. In this version however, the final orientation is 180 degrees different to the localize_waypoint() method. | public static void localize_waypoint_2() {
stepOne_waypoint_2();
stepTwo_waypoint();
} | [
"public static void localize_waypoint() {\n stepOne_waypoint();\n stepTwo_waypoint();\n }",
"public void localize(double x0, double y0){\n // Slow down robot so that it does not miss the line\n this.driver.setForwardSpeed(100);\n \n // Correct the robot's odometer's Y position by finding a horizontal line\n lineLocalization(LineOrientation.Horizontal);\n \n // Get away from the last line so the robot does not detect it again\n this.driver.forward(2,false);\n \n // Turn robot so that the next line the robot crosses will be a vertical line\n this.driver.turnBy(45,false);\n \n // Correct the robot's odometer's X position by finding a vertical line\n lineLocalization(LineOrientation.Vertical);\n \n // Once the odometer's position is correctly set, travel to (x0,y0) and orient the robot correctly\n this.driver.travelTo(0,0);\n this.driver.turnTo(0);\n this.odometer.setX(x0);\n this.odometer.setY(y0);\n }",
"public void doLocalization() {\r\n\t\t\r\n\t\t\r\n\t\tangleA=0;\r\n\t\tangleB=0;\r\n\t\tint UCdistance,expmtDistance;\r\n\t\texpmtDistance = 38;\r\n\t\tint count=0;\r\n\t\tboolean facingToWall=true;\r\n\t\t\r\n\t\t\t// rotate the robot until it sees no wall\r\n\t\t\tnav.rotate(165,-165);\r\n\t\t\tfacingToWall = true;\r\n\t\t\t\r\n\t\t\twhile(facingToWall)\r\n\t\t\t{\r\n\t\t\t\tUCdistance = getFilteredData();\r\n\t\t\t\tif(UCdistance>expmtDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\tif(UCdistance>expmtDistance&&count>=3)\r\n\t\t\t\t{\r\n\t\t\t\t\tfacingToWall = false;\r\n\t\t\t\t\tcount=0;\r\n\t\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tsleep(3000);\r\n\t\t\t\r\n\t\t\t// keep rotating until the robot sees a wall, then latch the angle\r\n\t\t\twhile(!facingToWall)\r\n\t\t\t{\r\n\t\t\t\tUCdistance = getFilteredData();\t\r\n\t\t\t\tif(UCdistance<expmtDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(UCdistance<expmtDistance&&count>=3)\r\n\t\t\t\t{\r\n\t\t\t\t\tfacingToWall = true;\r\n\t\t\t\t\tangleA = odo.getTheta();\r\n\t\t\t\t\tSound.beep();\r\n\t\t\t\t\tnav.stopMotor();\r\n\t\t\t\t\tcount=0;\r\n\t\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\r\n\t\t\t// switch direction and wait until it sees no wall\r\n\t\t nav.rotate(-165,165);\r\n\t\t\twhile(facingToWall)\r\n\t\t\t{\r\n\t\t\t\tUCdistance = getFilteredData();\t\r\n\t\t\t\t\r\n\t\t\t\tif(UCdistance>expmtDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(UCdistance>expmtDistance&&count>=3)\r\n\t\t\t\t{\r\n\t\t\t\t\tfacingToWall = false;\r\n\t\t\t\t\tcount=0;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// keep rotating until the robot sees a wall, then latch the angle\r\n\t\t\tsleep(3000);\r\n\t\t\t\r\n\t\t\twhile(!facingToWall)\r\n\t\t\t{\r\n\t\t\t\tUCdistance = getFilteredData();\t\t\r\n\t\t\t\tif(UCdistance<expmtDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(UCdistance<expmtDistance&&count>=3)\r\n\t\t\t\t{\r\n\t\t\t\t\tfacingToWall = true;\r\n\t\t\t\t\tangleB = odo.getTheta();\r\n\t\t\t\t\tSound.beep();\r\n\t\t\t\t\tnav.stopMotor();\r\n\t\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\t// angleA is clockwise from angleB, so assume the average of the\r\n\t\t\t// angles to the right of angleB is 45 degrees past 'north'\r\n\t\t\t// we slightly correct the angle '45' to '44' based on the error we measured\r\n\t\t\tangle = 45 - (angleA - angleB)/2;\r\n\t\t\t\r\n\t\t\t// update the odometer position (example to follow:)\r\n\t\t\todo.setTheta(angle);\r\n\t\t\tnav.turnTo(0);\r\n\r\n\r\n\t\t \r\n\t}",
"public void doLocalization(int corner){\r\n\t\t\r\n\t\tusLocalizerDone=false;\r\n\t\tdetermineLocType();\r\n\t\tif (loc == LocalizerType.FALLING_EDGE) {\r\n\t\t\t//go to see the back wall\r\n\t\t\tturnToNoWall(Navigation.Turn.CLOCK_WISE);\r\n\t\t\tturnToWall(Navigation.Turn.CLOCK_WISE);\r\n\t\t\tdouble angle1 = odo.getTheta(); //Record back wall angle\r\n\t\t\t//go to see the left wall\r\n\t\t\tturnToNoWall(Navigation.Turn.COUNTER_CLOCK_WISE);\r\n\t\t\tturnToWall(Navigation.Turn.COUNTER_CLOCK_WISE);\r\n\t\t\tdouble angle2 = odo.getTheta(); //Record left wall angle\r\n\t\t\t//compute the difference\r\n\t\t\tdouble angle = Math.toDegrees(getDiffAngle(Math.toRadians(angle1), Math.toRadians(angle2))) / 2 + angle1;\r\n\t\t\t//set the new calculated theta\r\n\t\t\todo.setTheta(odo.getTheta() +225 - angle); //reset angle\r\n\t\t\t\r\n\t\t} else if (loc == LocalizerType.RISING_EDGE) {\r\n\t\t\t//go to see the back wall\r\n\t\t\tturnToWall(Navigation.Turn.CLOCK_WISE);\r\n\t\t\tturnToNoWall(Navigation.Turn.COUNTER_CLOCK_WISE);\r\n\t\t\tdouble angle1 = odo.getTheta();\t//Back wall angle\r\n\t\t\t//go to see the left wall\r\n\t\t\tturnToWall(Navigation.Turn.CLOCK_WISE);\r\n\t\t\tturnToNoWall(Navigation.Turn.CLOCK_WISE);\r\n\t\t\tdouble angle2 = odo.getTheta(); //Left wall angle\r\n\t\t\t//compute the difference\r\n\t\t\tdouble angle = Math.toDegrees(getDiffAngle(Math.toRadians(angle1), Math.toRadians(angle2))) / 2 + angle1;\r\n\t\t\t//set the new calculated theta\r\n\t\t\todo.setTheta(odo.getTheta() +225 - angle); //reset angle\r\n\t\t}\r\n\t\t//Adjust the theta depending on what the corner is\r\n\t\todo.setTheta(odo.getTheta()-90*corner);\r\n\t\tusLocalizerDone=true;\r\n\t}",
"private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }",
"private String generateLocalizationText() {\n String loc = \"l_english:\\n\";\n for (int i = 0; i < regions.length; i++) {\n loc += regions[i].generateAreaRegionLocalization();\n }\n loc += \" \" + formattedName() + \": \\\"\" + name + \"\\\"\\n\";\n loc += \" \" + formattedName() + \"_name: \\\"\" + name + \"\\\"\\n\";\n loc += \" \" + formattedName() + \"_adj: \\\"\" + name + \"\\\"\\n\";\n\n return loc;\n }",
"public void doLocalization() {\r\n\t\tdouble latchA, latchB;\t//angle of wall A and Wall B\r\n\r\n\t\tif (locType == LocalizationType.FALLING_EDGE) {\r\n\t\t\t// rotate the robot until it sees no wall\r\n\t\t\tif (getFilteredData(10) <= maxDist)\t{\r\n\t\t\t\twhile (getFilteredData(10) <= maxDist-3)\t{\r\n\t\t\t\t\tnavigator.turnRight(TURN_SPEED);\r\n\t\t\t\t}\r\n\t\t\t\t//turn right by 35 degrees to avoid picking up wall again\r\n\t\t\t\tnavigator.turnTo(odometer.getTheta() - Math.toRadians(35));\t\r\n\t\t\t}\r\n\t\t\t// keep rotating until the robot sees a wall, then latch the angle\r\n\t\t\twhile (getFilteredData(10) > dist)\t{\r\n\t\t\t\tnavigator.turnRight(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\tlatchA = (odometer.getTheta());\r\n\t\t\tSound.beep();\r\n\t\t\tnavigator.turnLeft(TURN_SPEED);\t// again turn left for a few second to avoid latching on to the same wall\r\n\t\t\ttry { Thread.sleep(1500);}\r\n\t\t\tcatch (InterruptedException ex)\t{\r\n\t\t\t\tThread.currentThread().interrupt();\r\n\t\t\t}\r\n\t\t\t// switch direction and wait until it sees no wall\r\n\t\t\twhile (getFilteredData(10) <= maxDist-3)\t{\r\n\t\t\t\tnavigator.turnLeft(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\t// keep rotating until the robot sees a wall, then latch the angle\r\n\t\t\twhile (getFilteredData(10) > dist)\t{\r\n\t\t\t\tnavigator.turnLeft(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\tlatchB = odometer.getTheta();\r\n\t\t\tSound.beep();\r\n\t\t\t\r\n\t\t} \r\n\t\telse {\r\n\t\t\t/*\r\n\t\t\t * The robot should turn until it sees the wall, then look for the\r\n\t\t\t * \"rising edges:\" the points where it no longer sees the wall.\r\n\t\t\t * This is very similar to the FALLING_EDGE routine, but the robot\r\n\t\t\t * will face toward the wall for most of it.\r\n\t\t\t */\r\n\t\t\t//turn left until robot sees a wall\r\n\t\t\twhile(getFilteredData(10) > 20)\t{\r\n\t\t\t\tnavigator.turnLeft(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\t//turn right until the wall is appropriate distance away\r\n\t\t\twhile (getFilteredData(10) <= dist)\t{\r\n\t\t\t\tnavigator.turnRight(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\tlatchA = odometer.getTheta();\t//latch onto first angle\r\n\t\t\tSound.beep();\r\n\t\t\t//turn left until robot looses wall\r\n\t\t\twhile(getFilteredData(10) < maxDist-3)\t{\r\n\t\t\t\tnavigator.turnLeft(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\t//turn right past appropriate distance\r\n\t\t\twhile(getFilteredData(10) > 20)\t{\r\n\t\t\t\tnavigator.turnRight(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\t//turn left until wall is dist away\r\n\t\t\twhile (getFilteredData(10) <= dist)\t{\r\n\t\t\t\tnavigator.turnLeft(TURN_SPEED);\r\n\t\t\t}\r\n\t\t\tlatchB = odometer.getTheta();\t//latch onto second angle\r\n\t\t\tSound.beep();\r\n\t\t}\r\n\t\tdouble theta = odometer.getTheta() + calcAngle(latchA,latchB);\t// new theta is calculated\r\n\t\todometer.setPosition(new double [] {0.0, 0.0, theta}, new boolean [] {true, true, true});\t//set theta\r\n\t\t\r\n\t\tnavigator.turnTo(Math.toRadians(180));\t//turn to face wall parallel with y axis\r\n\t\todometer.setX(getFilteredData(30) - tile + sensorPosition);\t//calculate position in x relative to wall\r\n\t\tnavigator.turnTo(Math.toRadians(270));\t//turn to face wall parallel with x axis\r\n\t\todometer.setY(getFilteredData(30) - tile + sensorPosition);\t//calculate position in y relative to wall\r\n\t\tnavigator.turnTo(0); //turn to face 0 for demo\r\n\t}",
"public interface StepLocalization {\n\n /**\n * Translation of a text.\n *\n * @param textToTranslate string to be translated.\n * @return translated text\n */\n static String translate(String textToTranslate) {\n var engine = DEFAULT_LOCALIZATION_ENGINE.get();\n var locale = DEFAULT_LOCALE_PROPERTY.get();\n\n if (engine == null) {\n return textToTranslate;\n }\n return engine.translation(textToTranslate, locale);\n }\n\n /**\n * Makes a translation\n *\n * @param object is an object which may be used for auxiliary purposes\n * @param method is a method which may be used for auxiliary purposes\n * @param args objects which may be used for auxiliary purposes\n * @param <T> is a type of a given objec\n * @return translated text\n */\n static <T> String translate(T object, Method method, Object... args) {\n var engine = DEFAULT_LOCALIZATION_ENGINE.get();\n var locale = DEFAULT_LOCALE_PROPERTY.get();\n\n var description = method.getAnnotation(Description.class);\n if (description != null) {\n var templateParameters = templateParameters(object, method, args);\n var fullDescription = buildTextByTemplate(description.value(), templateParameters);\n if (engine == null || locale == null) {\n return fullDescription;\n }\n\n return engine.methodTranslation(method, fullDescription, templateParameters, locale);\n } else {\n return translateByClass(object, engine, locale);\n }\n }\n\n static <T> String translate(T object) {\n var engine = DEFAULT_LOCALIZATION_ENGINE.get();\n var locale = DEFAULT_LOCALE_PROPERTY.get();\n return translateByClass(object, engine, locale);\n }\n\n static String translate(Field f) {\n var engine = DEFAULT_LOCALIZATION_ENGINE.get();\n var locale = DEFAULT_LOCALE_PROPERTY.get();\n return translateMember(f, engine, locale);\n }\n\n static String translate(AdditionalMetadata<?> f) {\n var engine = DEFAULT_LOCALIZATION_ENGINE.get();\n var locale = DEFAULT_LOCALE_PROPERTY.get();\n return translateMember(f, engine, locale);\n }\n\n private static <T> String translateByClass(T toBeTranslated,\n StepLocalization localization,\n Locale locale) {\n var clazz = toBeTranslated.getClass();\n var cls = clazz;\n while (clazz.getAnnotation(Description.class) == null && !clazz.equals(Object.class)) {\n clazz = clazz.getSuperclass();\n }\n\n var cls2 = clazz;\n return ofNullable(cls2.getAnnotation(Description.class))\n .map(description -> {\n var templateParameters = templateParameters(toBeTranslated, cls);\n var fullDescription = buildTextByTemplate(description.value(), templateParameters);\n if (localization == null || locale == null) {\n return fullDescription;\n }\n\n return localization.classTranslation(cls2, fullDescription, templateParameters, locale);\n })\n .orElse(null);\n }\n\n private static <T extends AnnotatedElement & Member> String translateMember(T translateFrom,\n StepLocalization localization,\n Locale locale) {\n var memberAnnotation = stream(translateFrom.getAnnotations())\n .filter(annotation -> annotation.annotationType().getAnnotation(Metadata.class) != null)\n .findFirst()\n .orElse(null);\n\n if (memberAnnotation == null) {\n return null;\n }\n\n try {\n var m = memberAnnotation.annotationType().getDeclaredMethod(\"value\");\n m.setAccessible(true);\n var value = (String) m.invoke(memberAnnotation);\n\n if (localization == null || locale == null) {\n return value;\n }\n\n return localization.memberTranslation(translateFrom, value, locale);\n } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {\n throw new RuntimeException(e);\n }\n }\n\n private static <T> Map<String, String> templateParameters(T object, AnnotatedElement annotatedElement, Object... args) {\n var result = new HashMap<String, String>();\n\n if (annotatedElement instanceof Method) {\n var method = (Method) annotatedElement;\n Annotation[][] parameterAnnotations = method.getParameterAnnotations();\n for (int argIndex = 0; argIndex < args.length; argIndex++) {\n Annotation[] annotations = parameterAnnotations[argIndex];\n\n for (Annotation annotation : annotations) {\n if (!(annotation instanceof DescriptionFragment)) {\n continue;\n }\n var stepDescriptionFragment = (DescriptionFragment) annotation;\n var paramValue = ofNullable(args[argIndex])\n .map(o -> getParameterForStep(o, stepDescriptionFragment.makeReadableBy()))\n .orElseGet(() -> valueOf((Object) null));\n\n result.put(stepDescriptionFragment.value(), paramValue);\n }\n }\n return result;\n }\n\n var clz = (Class<?>) annotatedElement;\n while (!clz.equals(Object.class)) {\n stream(clz.getDeclaredFields())\n .filter(field -> !isStatic(field.getModifiers()) && field.getAnnotation(DescriptionFragment.class) != null)\n .forEach(field -> {\n field.setAccessible(true);\n var stepDescriptionFragment = field.getAnnotation(DescriptionFragment.class);\n try {\n var paramValue = ofNullable(field.get(object))\n .map(o -> getParameterForStep(o, stepDescriptionFragment.makeReadableBy()))\n .orElseGet(() -> valueOf((Object) null));\n\n result.put(stepDescriptionFragment.value(), paramValue);\n } catch (IllegalAccessException e) {\n throw new RuntimeException(e);\n }\n });\n\n clz = clz.getSuperclass();\n }\n return result;\n }\n\n static String buildTextByTemplate(String template, Map<String, String> templateParameters) {\n var strContainer = new Object() {\n String contained;\n\n public String getContained() {\n return contained;\n }\n\n public void setContained(String s) {\n this.contained = s;\n }\n };\n\n strContainer.setContained(template);\n templateParameters.forEach((key, value) -> {\n var s = strContainer.getContained();\n s = s.replace(\"{\" + key + \"}\", value);\n strContainer.setContained(s);\n });\n\n return strContainer.getContained();\n }\n\n /**\n * Makes translation by usage of a class.\n *\n * @param clz is a class whose metadata may be used for auxiliary purposes\n * @param description is a description of a step. It is fully completed by value taken\n * from {@link Description} of a class and by values which are taken from\n * fields annotated by {@link DescriptionFragment}\n * @param descriptionTemplateParams is a map of parameters and their values. These parameters are taken from\n * fields annotated by {@link DescriptionFragment}. This parameter is included\n * because the map is possible to be re-used for some reasons.\n * @param locale is a used locale\n * @param <T> is a type of a class\n * @return translated text\n */\n <T> String classTranslation(Class<T> clz,\n String description,\n Map<String, String> descriptionTemplateParams,\n Locale locale);\n\n /**\n * Makes translation by usage of a method.\n *\n * @param method is a method whose metadata may be used for auxiliary purposes\n * @param description is a description of a step. It is fully completed by value taken\n * from {@link Description} of a method and by values which are taken from\n * method parameters annotated by {@link DescriptionFragment}\n * @param descriptionTemplateParams is a map of parameters and their values. These parameters are taken from\n * method parameters annotated by {@link DescriptionFragment}.This parameter is included\n * because the map is possible to be re-used for some reasons.\n * @param locale is a used locale\n * @return translated text\n */\n String methodTranslation(Method method,\n String description,\n Map<String, String> descriptionTemplateParams,\n Locale locale);\n\n /**\n * Makes translation by usage of other annotated element that differs from {@link Class} and {@link Method}\n *\n * @param member is an annotated element whose metadata may be used for auxiliary purposes\n * @param description is a description taken from the member\n * @param locale is a used locale\n * @param <T> is a type of a member\n * @return translated text\n */\n <T extends AnnotatedElement & Member> String memberTranslation(T member,\n String description,\n Locale locale);\n\n /**\n * Makes translation of a text.\n *\n * @param text to be translated\n * @param locale is a used locale\n * @return translated text\n */\n String translation(String text, Locale locale);\n}",
"@FXML\n public void translation(){\n double x = Double.parseDouble(translation_x.getText());\n double y = Double.parseDouble(translation_y.getText());\n double z = Double.parseDouble(translation_z.getText());\n\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n t1.getTetraeder()[0].setPoint(A[0]+x,A[1]+y,A[2]+z);\n t1.getTetraeder()[1].setPoint(B[0]+x,B[1]+y,B[2]+z);\n t1.getTetraeder()[2].setPoint(C[0]+x,C[1]+y,C[2]+z);\n t1.getTetraeder()[3].setPoint(D[0]+x,D[1]+y,D[2]+z);\n\n redraw();\n }",
"public void setDirectionMap(){\n Coordinate coordinateN = new Coordinate();\n coordinateN.setXY(0,1);\n oneMovePerDirection.put(\"N\", coordinateN);\n Coordinate coordinateE = new Coordinate();\n coordinateE.setXY(1,0);\n oneMovePerDirection.put(\"E\", coordinateE);\n Coordinate coordinateW = new Coordinate();\n coordinateW.setXY(-1,0);\n oneMovePerDirection.put(\"W\", coordinateW);\n Coordinate coordinateS = new Coordinate();\n coordinateS.setXY(0,-1);\n oneMovePerDirection.put(\"S\", coordinateS);\n\n // Store direction where one rotation points\n oneRotation.put(\"NR\", \"E\"); //one rotation from North to the Right points East\n oneRotation.put(\"NL\", \"W\"); //one rotation from North to the Left points West\n oneRotation.put(\"ER\", \"S\"); //one rotation from East to the Right points South\n oneRotation.put(\"EL\", \"N\"); //one rotation from East to the Left points North\n oneRotation.put(\"SR\", \"W\"); //one rotation from South to the Right points West\n oneRotation.put(\"SL\", \"E\"); //one rotation from South to the Left points East\n oneRotation.put(\"WR\", \"N\"); //one rotation from West to the Right points North\n oneRotation.put(\"WL\", \"S\"); //one rotation from West to the Left points South\n }",
"public void changePitch(double angle) throws RemoteException\r\n {\r\n // Don't move while this object is being copied...\r\n if (canMove == false) return;\r\n\r\n double radangle = (angle / 180.0) * java.lang.Math.PI;\r\n double cost = java.lang.Math.cos(radangle);\r\n double sint = java.lang.Math.sin(radangle);\r\n \r\n // First change lookat:\r\n // Translate lookat to origin.\r\n lookat.x -= position.x;\r\n lookat.y -= position.y;\r\n lookat.z -= position.z;\r\n // Rotate to uvw coord sys.\r\n ThreeVec lookatuvw = new ThreeVec(u.dot(lookat),\r\n v.dot(lookat),\r\n w.dot(lookat));\r\n // Rotate around u axis.\r\n ThreeVec lookatuvwrot = new ThreeVec(lookatuvw.x,\r\n lookatuvw.y * cost -\r\n lookatuvw.z * sint,\r\n lookatuvw.y * sint +\r\n lookatuvw.z * cost);\r\n // Rotate back to xyz coord sys.\r\n ThreeVec lookatxyz = new ThreeVec(x.dot(lookatuvwrot),\r\n y.dot(lookatuvwrot),\r\n z.dot(lookatuvwrot));\r\n // Translate back into place.\r\n lookat.x = lookatxyz.x + position.x;\r\n lookat.y = lookatxyz.y + position.y;\r\n lookat.z = lookatxyz.z + position.z;\r\n \r\n // Next change VUP.\r\n // Rotate to uvw coord sys.\r\n ThreeVec VUPuvw = new ThreeVec(u.dot(VUP),\r\n v.dot(VUP),\r\n w.dot(VUP));\r\n // Rotate around u axis.\r\n ThreeVec VUPuvwrot = new ThreeVec(VUPuvw.x,\r\n VUPuvw.y * cost -\r\n VUPuvw.z * sint,\r\n VUPuvw.y * sint +\r\n VUPuvw.z * cost);\r\n // Rotate back to xyz coord sys.\r\n VUP.x = x.dot(VUPuvwrot);\r\n VUP.y = y.dot(VUPuvwrot);\r\n VUP.z = z.dot(VUPuvwrot);\r\n\r\n resetAxesAndVertices();\r\n\r\n if (copy == false)\r\n {\r\n\tfor (int c = 0; c < remoteCopies.size(); c++)\r\n\t {\r\n\t try {\r\n\t VObject remoteCopy =\r\n\t\t((RemoteCopyAndOwnerId)remoteCopies.elementAt(c)).remoteCopy;\r\n\t remoteCopy.changePitch(angle);\r\n\t } catch (Exception e) { reportErrorAndDie(e); }\r\n\t }\r\n }\r\n }",
"private static void replaceLCPPwithALT_L(Shape nShape, Orientation nOrient) {\n newTetro = new Tetrominoe(nShape, nOrient);\n switch (nOrient) {\n case ORIG: //replace L with ORIG ALT_L\n switch (MainGameFrame.currentPlayPiece.tOrientation) {\n case ORIG: // replace ORIG L with ORIG ALT_L\n //obfuscated\n break;\n case CW90: // replace CW90 L with ORIG ALT_L\n unusedSquare = MainGameFrame.currentPlayPiece.occupiedSquares[2];\n MainGameFrame.filledPlayArea[unusedSquare.x][unusedSquare.y].color = Color.WHITE;\n newTetro.occupiedSquares[0].x = MainGameFrame.currentPlayPiece.occupiedSquares[3].x;\n newTetro.occupiedSquares[0].y = MainGameFrame.currentPlayPiece.occupiedSquares[3].y - 1;\n newTetro.occupiedSquares[1].x = MainGameFrame.currentPlayPiece.occupiedSquares[3].x;\n newTetro.occupiedSquares[1].y = MainGameFrame.currentPlayPiece.occupiedSquares[3].y;\n newTetro.occupiedSquares[2].x = MainGameFrame.currentPlayPiece.occupiedSquares[0].x;\n newTetro.occupiedSquares[2].y = MainGameFrame.currentPlayPiece.occupiedSquares[0].y;\n newTetro.occupiedSquares[3].x = MainGameFrame.currentPlayPiece.occupiedSquares[1].x;\n newTetro.occupiedSquares[3].y = MainGameFrame.currentPlayPiece.occupiedSquares[1].y;\n MainGameFrame.currentPlayPiece = newTetro;\n break;\n case CW180: // replace CW180 L with ORIG ALT_L\n //obfuscated\n break;\n case CW270: // replace CW270 L with ORIG ALT_L\n //obfuscated\n break;\n }\n break;\n case CW90://replace L with CW90 ALT_L\n //obfuscated\n break;\n case CW180: //replace L with CW180 ALT_L\n //obfuscated\n break;\n case CW270: //replace L with CW270 ALT_L\n //obfuscated\n break;\n }\n }",
"private void translateLocationMessage() {\n\n\n rawCadenaLocation = rawCadenaLocation.trim();\n if (!rawCadenaLocation.matches(\"\\\\d{4}\\\\.\\\\d{4}[NS],\\\\d{4}\\\\.\\\\d{4}[EW]\")) {\n locationDetermined = false;\n errorMessage = \"Error: Location format is not correct\";\n }\n String raw = rawCadenaLocation;\n String[] latLong = raw.split(\",\");\n String lat = latLong[0];\n String lon = latLong[1];\n boolean northern = lat.substring(lat.length() - 1, lat.length()).equals(\"N\");\n boolean eastern = lon.substring(lon.length() - 1, lon.length()).equals(\"E\");\n lat = lat.substring(0, lat.length() - 1); // 5957.2109\n lon = lon.substring(0, lon.length() - 1);\n String latDeg = lat.substring(0, 2); // 59\n String lonDeg = lon.substring(0, 2);\n String latMin = lat.substring(2); // 57.2109\n String lonMin = lon.substring(2);\n GglLat = (Integer.parseInt(latDeg) + Double.parseDouble(latMin) / 60) * (northern ? 1 : -1);\n GglLng = (Integer.parseInt(lonDeg) + Double.parseDouble(lonMin) / 60) * (eastern ? 1 : -1);\n System.out.println(\" *** Translated location format: \" + GglLat + \",\" + GglLng);\n locationDetermined = true;\n\n }",
"public static void adjustPositionForTunnel() {\n //If the car is towed, we release before localization\n boolean needToRecuperateCar = false;\n if(Hook.isCarTowed()) {\n Hook.retractHook();\n needToRecuperateCar = true;\n }\n \n Driver.setSpeeds(ROTATE_SPEED, ROTATE_SPEED);\n Driver.turnBy(90);\n leftMotor.forward();\n rightMotor.forward();\n USLocalization.waitLineDetection();\n Driver.setSpeeds(ROTATE_SPEED, ROTATE_SPEED);\n Driver.moveStraightFor(SENSOR_TO_CENTER);\n\n //We go back half a tile to position in the middle\n Driver.moveStraightFor(-1.0/2);\n\n Driver.turnBy(-90);\n\n Driver.setSpeeds(ROTATE_SPEED, ROTATE_SPEED);\n Driver.moveStraightFor(-1.0/3); //To adjust position horizontally also using the line we are on\n leftMotor.forward();\n rightMotor.forward();\n USLocalization.waitLineDetection();\n Driver.setSpeeds(ROTATE_SPEED, ROTATE_SPEED);\n Driver.moveStraightFor(SENSOR_TO_CENTER);\n\n //We adjust the angle of the odometer since we are facing right in front\n double t = odometer.getXyt()[2];\n double theta = 0;\n if(t > 46 && t < 134) {\n theta = 90;\n }\n else if(t > 136 && t < 224) {\n theta = 180;\n }\n else if(t > 226 && t < 314) {\n theta = 270;\n }\n else {\n theta = 0;\n }\n odometer.setTheta(theta);\n \n //If the car was released, we need to hook it back.\n if(needToRecuperateCar) {\n Hook.deployHook();\n }\n }",
"public void addWaypoints(){\n\t\tthis.mapView.getPositions().addAll(this.mission.getPositions());\n\t\tthis.mapView.updateView();\n\t\tupdateView();\n\t}",
"private String constructWaypointsAndVehicles(ArrayList<String> vehiclePath, String scenarioName)\n {\n Path waypointFilePath = Paths.get(AccidentParam.waypointFilePath);\n Path vehicleFilePath = Paths.get(AccidentParam.vehicleFilePath);\n Path luaPathFollowerFilePath = Paths.get(AccidentParam.luaAIFilePath);\n Path luaAIPathFollowerConfigFilePath = Paths.get(AccidentParam.luaAIConfigFilePath);\n Path luaAILeaveTriggerPath = Paths.get(AccidentParam.luaAICarLeaveTriggerFilePath);\n\n Set<String> impactedCoords = new HashSet<String>();\n\n StringBuilder waypointStrBuilderTemplate = new StringBuilder();\n StringBuilder waypointListStrBuilder = new StringBuilder();\n StringBuilder vehicleStrBuilderTemplate = new StringBuilder();\n StringBuilder vehicleListStrBuilder = new StringBuilder();\n StringBuilder luaPathStrBuilderTemplate = new StringBuilder();\n StringBuilder luaAIConfigStrBuilderTemplate = new StringBuilder();\n StringBuilder luaAILeaveTriggerStrBuilderTemplate = new StringBuilder();\n\n\n\n try {\n // Load waypoint template and convert to String\n List<String> waypointFileContent = Files.readAllLines(waypointFilePath, Charset.defaultCharset());\n\n for (int i = 0; i < waypointFileContent.size(); i++) {\n waypointStrBuilderTemplate.append(waypointFileContent.get(i) + \"\\n\");\n }\n\n String waypointTemplate = waypointStrBuilderTemplate.toString();\n\n // Load vehicle template and convert to String\n List<String> vehicleFileContent = Files.readAllLines(vehicleFilePath, Charset.defaultCharset());\n\n for (int i = 0; i < vehicleFileContent.size(); i++) {\n vehicleStrBuilderTemplate.append(vehicleFileContent.get(i) + \"\\n\");\n }\n\n String vehicleTemplate = vehicleStrBuilderTemplate.toString();\n\n // // Construct Observer Vehicle Obj\n String vehicleInfoStr = \"\"; //vehicleTemplate.replace(\"$actorID\", \"0\");\n // vehicleInfoStr = vehicleInfoStr.replace(\"$position\", vehiclePath.get(0));\n // vehicleInfoStr = vehicleInfoStr.replace(\"$colorCode\", \"255 255 255\");\n // vehicleInfoStr = vehicleInfoStr.replace(\"$isAIControlled\", \"0\");\n // vehicleListStrBuilder.append(vehicleInfoStr);\n\n // Cut additional nodes from the base waypointFilePath\n\n vehiclePath.remove(0);\n vehiclePath.remove(vehiclePath.size() - 1);\n\n Street currentStreet = null;\n\n // If there is only 1 road, we work with that road only\n if (testCaseInfo.getStreetList().size() == 1) {\n currentStreet = testCaseInfo.getStreetList().get(0);\n }\n\n double radius = Double.parseDouble(currentStreet.getStreetPropertyValue(\"curve_radius\"));\n\n int laneNumber = Integer.parseInt(currentStreet.getStreetPropertyValue(\"lane_num\"));\n // Construct the waypoints based on the waypointFilePath of each vehicle\n for (VehicleAttr vehicleAttr : vehicleList) {\n ArrayList<String> vehicleMovementPath = vehicleAttr.getMovementPath();\n\n // If this is not the striker car, convert the coords in this waypointFilePath to BeamNG format\n if (!vehicleMovementPath.get(0).equals(vehiclePath.get(0))) {\n // ConsoleLogger.print('d',\"Not the processed coord list, vehicle is \" + vehicleAttr.getVehicleId() +\n // \" on street? \" + vehicleAttr.getOnStreet() + \" vehMovPath size \" + vehicleMovementPath.size());\n String crashType = testCaseInfo.getCrashType().toLowerCase();\n\n if (crashType.contains(\"forward impact\")) {\n// // If this is a static car, then check whether it is on the pavement or parking line, and set coord accordingly\n// if (vehicleMovementPath.size() == 1\n// && (vehicleAttr.getOnStreet() == 0 || vehicleAttr.getOnStreet() == -1)) {\n// String convertedCoord = convertCoordToBeamNGFormat(vehicleMovementPath.get(0));\n//\n// // Append zCoord to a non zCoord coord\n// if (convertedCoord.split(\" \").length == 2)\n// {\n// if (!AccidentParam.isGradingConcerned)\n// {\n// convertedCoord += \" 0\";\n// }\n// }\n//\n// String newYCoord = \"\";\n//\n// // For straight road, need to place the waypoint far away from the road a bit compared to curvy\n// // road\n// ConsoleLogger.print('d',\"Standing Road side \" + vehicleAttr.getStandingRoadSide());\n// if (radius == 0.0) {\n//\n// double parkingLineExtraDistance = 0;\n//\n// if (!currentStreet.getStreetPropertyValue(\"road_park_line\").equals(\"0\")\n// && !currentStreet.getStreetPropertyValue(\"road_park_line\").equals(\"\") )\n// {\n// ConsoleLogger.print('d',\"Parking Line extra distance set to 2\");\n// parkingLineExtraDistance = 2;\n// }\n//\n// if (vehicleAttr.getStandingRoadSide().equals(\"left\")) {\n// newYCoord = AccidentParam.df6Digit.format(Double.parseDouble(convertedCoord.split(\" \")[1]) +\n// (int) (laneNumber / 2.0 * AccidentParam.laneWidth + AccidentParam.parkingLineWidth / 2) + parkingLineExtraDistance - 0.5 );\n// //(int) (laneNumber / 2.0 * AccidentParam.laneWidth + AccidentParam.parkingLineWidth / 2 + parkingLineExtraDistance) - 0.5 );\n// } else if (vehicleAttr.getStandingRoadSide().equals(\"right\")) {\n// newYCoord = AccidentParam.df6Digit.format(Double.parseDouble(convertedCoord.split(\" \")[1]) -\n// (int) (laneNumber / 2.0 * AccidentParam.laneWidth - AccidentParam.parkingLineWidth / 2 ) - parkingLineExtraDistance + 0.5);\n//\n// }\n//\n// } else {\n// if (vehicleAttr.getStandingRoadSide().equals(\"left\")) {\n// newYCoord = AccidentParam.df6Digit.format(Double.parseDouble(convertedCoord.split(\" \")[1]) +\n// (laneNumber / 2.0 * AccidentParam.laneWidth) - 1.5);\n// //(laneNumber / 2.0 * AccidentParam.laneWidth + AccidentParam.parkingLineWidth + 1) + 1);\n// } else if (vehicleAttr.getStandingRoadSide().equals(\"right\")) {\n//\n// newYCoord = AccidentParam.df6Digit.format(Double.parseDouble(convertedCoord.split(\" \")[1]) -\n// (laneNumber / 2.0 * AccidentParam.laneWidth) + 1.5);\n// ConsoleLogger.print('d',\"Right Curve Park \" + Double.parseDouble(convertedCoord.split(\" \")[1])\n// + \" \" + (laneNumber / 2.0 * AccidentParam.laneWidth) + \" \");\n// }\n//// newYCoord = AccidentParam.df6Digit.format(Double.parseDouble(convertedCoord.split(\" \")[1]) -\n//// (laneNumber / 2 * AccidentParam.laneWidth - 1)) ;\n// }\n//\n// ConsoleLogger.print('d',\"convert coord \" + convertedCoord);\n// ConsoleLogger.print('d',\"newYCoord \" + newYCoord);\n// String newCoord = updateCoordElementAtDimension(1, convertedCoord, newYCoord);\n// ConsoleLogger.print('d',\"newCoord \" + newCoord);\n//\n// // Set the updated impact point to the other car\n// for (VehicleAttr otherVehicle : vehicleList) {\n// ConsoleLogger.print('d',\"other veh ID \" + otherVehicle.getVehicleId());\n// if (otherVehicle.getVehicleId() != vehicleAttr.getVehicleId()) {\n// ArrayList<String> otherVehicleMovementPath = otherVehicle.getMovementPath();\n// for (int j = 0; j < otherVehicleMovementPath.size(); j++) {\n// String[] pathNodeElements = otherVehicleMovementPath.get(j).split(\" \");\n// String[] convertedCoordElements = convertedCoord.split(\" \");\n//\n// // Check whether this is the crash points between the 2 cars\n// if (pathNodeElements[0].equals(convertedCoordElements[0])\n// && pathNodeElements[1].equals(convertedCoordElements[1])) {\n// // Update the right grade value (zCoord)\n//\n// newCoord = updateCoordElementAtDimension(2, newCoord, pathNodeElements[2]);\n//\n// // Adjust the car position far away a bit to ensure crash\n// String adjustedCoord = updateCoordElementAtDimension(0, newCoord,\n// (Double.parseDouble(convertedCoordElements[0]) + 3) + \"\");\n//\n// otherVehicleMovementPath.set(j, adjustedCoord);\n// otherVehicle.setMovementPath(otherVehicleMovementPath);\n//\n// vehicleMovementPath.set(0, newCoord);\n// vehicleAttr.setMovementPath(vehicleMovementPath);\n//\n// // For straight road, put the wp away the street a bit\n// if (radius == 0.0) {\n// if (vehicleAttr.getStandingRoadSide().equals(\"left\")) {\n// newYCoord = AccidentParam.df6Digit.format((Double.parseDouble(newYCoord)) - 1);\n// } else if (vehicleAttr.getStandingRoadSide().equals(\"right\")) {\n// newYCoord = AccidentParam.df6Digit.format((Double.parseDouble(newYCoord)) + 1);\n// }\n// newCoord = updateCoordElementAtDimension(1, newCoord, newYCoord);\n//\n// ConsoleLogger.print('d',\"new coord straight road update \" + newCoord);\n// }\n//\n// adjustedCoord = updateCoordElementAtDimension(1, adjustedCoord, newYCoord);\n//\n//\n// ConsoleLogger.print('d',\"Found same impact coord at \" + j + \" value \" + adjustedCoord);\n// impactedCoords.add(adjustedCoord);\n// }\n// }\n// }\n// } // End looping through other vehicles and set impact points\n// } // End checking vehicle is on parking line or pavement\n// else {\n for (int i = 0; i < vehicleMovementPath.size(); i++) {\n String newCoord = convertCoordToBeamNGFormat(vehicleMovementPath.get(i));\n vehicleMovementPath.set(i, newCoord);\n }\n// }\n } // End adjusting waypoint for forward impact\n else if (crashType.contains(\"sideswipe\")) {\n ConsoleLogger.print('d',\"In Sideswipe crash\");\n // Convert x:y coords to BeamNG coord format\n for (VehicleAttr currVehicle : vehicleList) {\n ArrayList<String> currVehicleCoordList = currVehicle.getMovementPath();\n\n // If this is not the chosen base vehicle, append the grade to the vehicle\n if (!currVehicleCoordList.get(0).equals(vehiclePath.get(0))) {\n double roadGradeDegree = Double.parseDouble(\n currentStreet.getStreetPropertyValue(\"road_grade_deg\"));\n\n double currentRoadGrade = Double.parseDouble(\n vehiclePath.get(vehiclePath.size() - 1).split(\" \")[2]);\n\n // Append the grade based on previous and current xCoords\n for (int c = currVehicleCoordList.size() - 1; c > 0; c--) {\n String coordAtC = currVehicleCoordList.get(c);\n String prevCoord = currVehicleCoordList.get(c - 1);\n\n // Find the prev and current xCoords\n double xCoordAtC = Double.parseDouble(coordAtC.split(\":\")[0]);\n double xCoordPrev = Double.parseDouble(prevCoord.split(\":\")[0]);\n\n // If grading is not concerned, set as 0, otherwise, compute the grade\n double gradeIncrement = AccidentParam.isGradingConcerned ?\n AccidentConstructorUtil.computeGradeIncrement(xCoordPrev, xCoordAtC, currentRoadGrade)\n : 0;\n\n // Set the updated grade degree into the coord value at curr and prev positions\n currVehicleCoordList.set(c,\n convertCoordToBeamNGFormat(coordAtC) + \" \"\n + AccidentParam.df6Digit.format(currentRoadGrade)\n );\n\n currVehicleCoordList.set(c - 1,\n convertCoordToBeamNGFormat(prevCoord + \":\") + \" \"\n + AccidentParam.df6Digit.format(currentRoadGrade - gradeIncrement)\n );\n\n currentRoadGrade -= gradeIncrement;\n } // End convert x:y coord to BeamNG format for each coord\n } // End checking if the current car is not the same as the base car\n\n }\n }\n } // End checking the same vehicle waypointFilePath\n } // End looping through each vehicle\n\n //}\n // Begin constructing waypoint objects\n\n ConsoleLogger.print('d',\"Veh List Size \" + vehicleList.size());\n for (VehicleAttr currentVehicle : vehicleList)\n {\n ArrayList<String> currentVehiclePath = currentVehicle.getMovementPath();\n\n // Construct AI Vehicle Obj\n// vehicleInfoStr = vehicleTemplate.replace(\"$actorID\",\n// \"\" + currentVehicle.getVehicleId());\n// vehicleInfoStr = vehicleInfoStr.replace(\"$position\", currentVehiclePath.get(0));\n// vehicleInfoStr = vehicleInfoStr.replace(\"$colorCode\", currentVehicle.getColor());\n// vehicleInfoStr = vehicleInfoStr.replace(\"$jbeam\", currentVehicle.getBeamngVehicleModel());\n// vehicleInfoStr = vehicleInfoStr.replace(\"$partConfig\", currentVehicle.getPartConfig());\n// vehicleInfoStr = vehicleInfoStr.replace(\"$isAIControlled\", \"1\");\n// vehicleListStrBuilder.append(vehicleInfoStr);\n ConsoleLogger.print('d',\"Construct vehicle obj for vehicle#\" + currentVehicle.getVehicleId());\n vehicleListStrBuilder = constructVehicleObject(\"\" + currentVehicle.getVehicleId(),\n currentVehiclePath.get(0), currentVehicle.getColor(), currentVehicle.getBeamngVehicleModel(),\n currentVehicle.getPartConfig(),\"1\", vehicleListStrBuilder);\n\n // Construct the waypoints for mobile car\n if (currentVehiclePath.size() > 1)\n {\n // For sideswipe crash, add another waypoint at 10m ahead to make the cars move naturally\n if (testCaseInfo.getCrashType().toLowerCase().contains(\"sideswipe\"))\n {\n // If this is a parked vehicle, skip constructing waypoint path coz we will do it in Lua config\n String lastWaypoint = currentVehiclePath.get(currentVehiclePath.size() - 1);\n\n currentVehiclePath.add(updateCoordElementAtDimension(0,\n lastWaypoint,\n \"\" + Double.parseDouble(lastWaypoint.split(\" \")[0] + 10)));\n\n // Parked car will go further away if non-critical param is set\n if (AccidentConstructorUtil.getNonCriticalDistance() > 0)\n {\n if (currentVehicle.getActionList().get(0).equals(\"park\"))\n currentVehiclePath.add(updateCoordElementAtDimension(0,\n lastWaypoint,\n \"\" + Double.parseDouble(lastWaypoint.split(\" \")[0] + 15)));\n }\n\n }\n // Construct waypoint obj lists\n StringBuilder waypointPathLuaStrBuilder = new StringBuilder();\n\n // If this is a parked car, check if the second coord (crash coord) matches with the second last\n // coord of chosen vehicle (also should be crash coord)\n if (currentVehicle.getOnStreet() <= 0 && currentVehiclePath.get(1).equals(vehiclePath.get(vehiclePath.size() - 2)))\n {\n for (int i = vehiclePath.size() - 2; i < vehiclePath.size(); i++)\n {\n ConsoleLogger.print('d',\"Choose the base coord waypoint at \" + i);\n String waypointName = \"wp\" + i + \"_\" + vehicleIdOfBasePath;\n waypointPathLuaStrBuilder.append(\"\\'\" + waypointName + \"\\',\");\n }\n\n // If non-critical param is given, set the wp of the current vehicle, add the last waypoint inside\n if (AccidentConstructorUtil.getNonCriticalDistance() > 0)\n {\n String waypointInfoStr = waypointTemplate.replace(\"$name\", \"wp_goal\");\n waypointPathLuaStrBuilder.append(\"\\'wp_goal\\',\");\n waypointInfoStr = waypointInfoStr.replace(\"$coord\",\n currentVehiclePath.get(currentVehiclePath.size() - 1));\n waypointInfoStr = waypointInfoStr.replace(\"$scale\", \"3 3 3\");\n waypointListStrBuilder.append(waypointInfoStr);\n }\n\n\n // Add the waypoint list into the current vehicle waypointNodeNameList\n currentVehicle.setWaypointPathNodeName(waypointPathLuaStrBuilder.\n deleteCharAt(waypointPathLuaStrBuilder.length() - 1).toString());\n\n // Construct a lane of parked cars\n // TODO: Check if any car is in the near pos of constructed parked cars\n vehicleListStrBuilder = constructLaneFilledOfParkedCar(currentVehiclePath, currentStreet,\n currentVehicle, laneNumber, vehicleTemplate, vehicleListStrBuilder);\n break;\n }\n\n for (int i = 1; i < currentVehiclePath.size(); i++) {\n String waypointName = \"wp\" + i + \"_\" + currentVehicle.getVehicleId();\n String waypointInfoStr = waypointTemplate.replace(\"$name\", waypointName); // wp[index]_[carID]\n\n waypointPathLuaStrBuilder.append(\"\\'\" + waypointName + \"\\',\");\n\n String scaleValue = \"5 5 5\";\n\n if (testCaseInfo.getCrashType().contains(\"sideswipe\"))\n {\n scaleValue = \"3 3 3\";\n }\n // If this is an impact point, set the scale = laneNumber * laneWidth\n if (impactedCoords.contains(currentVehiclePath.get(i)))\n {\n scaleValue = \"\";\n for (int j = 0; j < 3; j++)\n scaleValue += laneNumber * AccidentParam.laneWidth / 2 + \" \";\n }\n waypointInfoStr = waypointInfoStr.replace(\"$coord\", currentVehiclePath.get(i));\n waypointInfoStr = waypointInfoStr.replace(\"$scale\", scaleValue.trim());\n\n\n waypointListStrBuilder.append(waypointInfoStr);\n\n\n }\n\n // Add the waypoint list into the current vehicle waypointNodeNameList\n currentVehicle.setWaypointPathNodeName(waypointPathLuaStrBuilder.\n deleteCharAt(waypointPathLuaStrBuilder.length() - 1).toString());\n }\n else if (currentVehiclePath.size() == 1 || currentVehicle.getOnStreet() < 1) // if this is a parked car\n {\n ConsoleLogger.print('d',\"Construct parked vehicle vehicle#\" + currentVehicle.getVehicleId());\n vehicleListStrBuilder = constructLaneFilledOfParkedCar(currentVehiclePath, currentStreet,\n currentVehicle, laneNumber, vehicleTemplate, vehicleListStrBuilder);\n }\n\n } // End constructing Vehicle List and Waypoint list\n\n // Generate Lua File for AI Waypoints Follower\n\n List<String> luaAIFollowPathTemplateList = Files.readAllLines(luaPathFollowerFilePath, Charset.defaultCharset());\n\n for (String luaAITemplateLine : luaAIFollowPathTemplateList)\n {\n luaPathStrBuilderTemplate.append(luaAITemplateLine + \"\\n\");\n }\n\n String luaAITemplate = luaPathStrBuilderTemplate.toString();\n\n // Generate Lua AI Waypoints Follower Config\n List<String> luaAIConfigTemplateList = Files.readAllLines(luaAIPathFollowerConfigFilePath, Charset.defaultCharset());\n\n for (String luaAIConfigLine : luaAIConfigTemplateList)\n {\n luaAIConfigStrBuilderTemplate.append(luaAIConfigLine + \"\\n\");\n }\n\n // Construct the config for each vehicle\n StringBuilder allAIConfigStr = new StringBuilder();\n for (VehicleAttr currentVehicle : vehicleList)\n {\n // Only configure AI Waypoint Follower if the car is moving\n if (currentVehicle.getMovementPath().size() > 1)\n {\n if (currentVehicle.getOnStreet() >= 1) {\n String luaAIConfigTemplate = luaAIConfigStrBuilderTemplate.toString();\n luaAIConfigTemplate = luaAIConfigTemplate.replace(\"$waypointNameList\",\n currentVehicle.getWaypointPathNodeName());\n\n luaAIConfigTemplate = luaAIConfigTemplate.replace(\"$speed\", (currentVehicle.getVelocity() / 2) + \"\");\n luaAIConfigTemplate = luaAIConfigTemplate.replace(\"$actorID\", currentVehicle.getVehicleId() + \"\");\n allAIConfigStr.append(luaAIConfigTemplate + \"\\n\\n\");\n }\n }\n }\n\n // If we have a sideswipe, construct the \"wait and crash logic for parked car\"\n if (testCaseInfo.getCrashType().toLowerCase().contains(\"sideswipe\"))\n {\n // If there are 2 vehicles, construct the ID and waypoints based on the vehicle\n if (vehicleList.size() == 2)\n {\n VehicleAttr strikerVehicle = null;\n VehicleAttr victimVehicle = null;\n\n for (VehicleAttr vehicleAttr : vehicleList)\n {\n if (vehicleAttr.getVehicleId() == 1 && vehicleAttr.getOnStreet() >= 1)\n {\n strikerVehicle = vehicleAttr;\n }\n else if (vehicleAttr.getVehicleId() == 2 && vehicleAttr.getOnStreet() < 1)\n {\n victimVehicle = vehicleAttr;\n }\n }\n\n String carLeaveTriggerTemplate = loadTemplateFileContent(luaAILeaveTriggerPath);\n\n carLeaveTriggerTemplate = carLeaveTriggerTemplate\n .replace(\"$P2ID\", victimVehicle.getVehicleId() + \"\")\n .replace(\"$wpList\", victimVehicle.getWaypointPathNodeName())\n .replace(\"$speed\", AccidentParam.defaultSpeed / 2 + \"\")\n .replace(\"$P1ID\", strikerVehicle.getVehicleId() + \"\")\n // TODO: COmpute Trigger Distance using equation\n .replace(\"$triggerDistance\", (victimVehicle.getLeaveTriggerDistance()) + \"\")\n .replace(\"$collisionDistance\", AccidentParam.DISTANCE_BETWEEN_CARS + \"\");\n\n ConsoleLogger.print('d',\"Construct moving car logic for sideswipe, trigger distance \" + victimVehicle.getLeaveTriggerDistance());\n\n luaAITemplate = luaAITemplate.replace(\"--$OtherVehicleStartToRunCode\", carLeaveTriggerTemplate);\n\n } /// End processing 2 vehicles case\n } // End processing sideswipe case\n\n // Add the AI config into the AI Lua template\n luaAITemplate = luaAITemplate.replace(\"$setAiMovementPath\", allAIConfigStr.toString());\n ConsoleLogger.print('d',\"Scenario COnfig path \" + AccidentParam.scenarioConfigFilePath);\n ConsoleLogger.print('d',\"Lua AI Template \\n\" + luaAITemplate);\n\n Path scenarioConfigPath = Paths.get(AccidentParam.scenarioConfigFilePath + \"\\\\\" + scenarioName + \".lua\");\n Files.write(scenarioConfigPath, luaAITemplate.getBytes());\n\n// ConsoleLogger.print('d',\"Vehicle List \\n\" + vehicleListStrBuilder.toString());\n// ConsoleLogger.print('d',\"Waypoint List \\n\" + waypointListStrBuilder.toString());\n return vehicleListStrBuilder.toString() + \"\\n\\n\"\n + waypointListStrBuilder.toString() + \"\\n\\n\";\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n ConsoleLogger.print('d',\"Exception in Vehicles And Waypoints constructions \" + ex);\n return \"Error in Vehicles and Waypoints Construction \" + ex ;\n }\n }",
"private void doUSLocalization() // Falling and Rising Edge Method\r\n\t{\r\n\t\trobot.rotate(-50); // rotate clockwise\r\n\t\trobot.rotate(-50);\r\n\r\n\t\t// Falling and Rising Edge Method\r\n\t\tdouble angleA = 0, angleB = 0;\r\n\r\n\t\tint Wall = 0;\r\n\t\tint noWall = 0;\r\n\t\tboolean first = true;\r\n\t\tboolean second = false;\r\n\t\twhile (first) // Checks for rising edge\r\n\t\t{\r\n\t//\t\tRConsole.println(\"\" + uspL.getDistance());\r\n\t\t\t// Reads wall\r\n\t\t\tif (uspL.getDistance() < 30 && uspR.getDistance() < 30) {\r\n\t\t\t\tWall = Wall + 1;\r\n\t\t\t}\r\n\r\n\t\t\t// Reads no wall after reading wall (falling edge)\r\n\t\t\tif (Wall > 3 && uspL.getDistance() > 50 && uspR.getDistance() > 50) {\r\n\t\t\t\tSound.setVolume(20);\r\n\t\t\t\tSound.beep();\r\n\t\t\t\tfirst = false;\r\n\t\t\t\tsecond = true;\r\n\t\t\t\tWall = 0;\r\n\t\t\t\tangleA = odo.getCoordinates().getTheta(); // latch angle\r\n\t\t\t\t// LCD.drawString(\"anlgeA \" + angleA + \" \", 0, 3);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (second) // Checks for falling edge\r\n\t\t{\r\n\t\t\t// Reads no wall\r\n\t\t\tif (uspL.getDistance() > 50 && uspR.getDistance() > 50) {\r\n\t\t\t\tnoWall = noWall + 1;\r\n\t\t\t}\r\n\r\n\t\t\t// Reads wall after reading no wall (rising edge)\r\n\t\t\tif (noWall > 3 && uspL.getDistance() < 30\r\n\t\t\t\t\t&& uspR.getDistance() < 30) {\r\n\t\t\t\tSound.setVolume(20);\r\n\t\t\t\tSound.beep();\r\n\t\t\t\tsecond = false;\r\n\t\t\t\tnoWall = 0;\r\n\t\t\t\tangleB = odo.getCoordinates().getTheta(); // latch angle\r\n\t\t\t\t// LCD.drawString(\"angleB \" + angleB + \" \", 0, 4);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\trobot.stop();\r\n\t\tif (Odometer.adjustAngle(angleA - angleB) < ERROR_THRESHOLD) {\r\n\t\t\tthis.doUSLocalization();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Computation of new angle\r\n\t\tdouble theta = Odometer.adjustAngle(30 - Odometer.adjustAngle(angleA\r\n\t\t\t\t- angleB) / 2);\r\n\r\n\t\tLCD.drawString(\"newtheta \" + theta + \" \", 0, 5);\r\n\r\n\t\trobot.rotateAxis(360 - theta, 5);\r\n\t}",
"void localizationChanged();",
"private void drawWaypoints() {\r\n\t\tint x1 = (width - SIZE_X) / 2;\r\n\t\tint y1 = (height - SIZE_Y) / 2;\r\n\r\n\t\tfloat scissorFactor = (float) _resolutionResolver.getScaleFactor() / 2.0f;\r\n\r\n\t\tint glLeft = (int) ((x1 + 10) * 2.0f * scissorFactor);\r\n\t\tint glWidth = (int) ((SIZE_X - (10 + 25)) * 2.0f * scissorFactor);\r\n\t\tint gluBottom = (int) ((this.height - y1 - SIZE_Y) * 2.0f * scissorFactor);\r\n\t\tint glHeight = (int) ((SIZE_Y) * 2.0f * scissorFactor);\r\n\r\n\t\tGL11.glEnable(GL11.GL_SCISSOR_TEST);\r\n\t\tGL11.glScissor(glLeft, gluBottom, glWidth, glHeight);\r\n\r\n\t\tGL11.glPushMatrix();\r\n\t\tGL11.glScalef(_textScale, _textScale, _textScale);\r\n\r\n\t\t_startCell = getStartCell();\r\n\t\t_cellStartX = (int) (((float) x1 + (float) 13) / _textScale);\r\n\t\t_cellStartY = (int) (((float) y1 + (float) 22) / _textScale);\r\n\r\n\t\tint x2 = _cellStartX;\r\n\t\tint y2 = _cellStartY + (int) ((float) 0 * (float) CELL_SIZE_Y / _textScale);\r\n\r\n\t\tImmutableList<UltraTeleportWaypoint> list = UltraTeleportWaypoint.getWaypoints();\r\n\t\tfor (int i = 0; i < 2; ++i) {\r\n \t\tfor (int j = 0; j < list.size() && j < MAX_CELL_COUNT; ++j) {\r\n\r\n \t\t\tint x = _cellStartX;\r\n \t\t\tint y = _cellStartY + (int) ((float) j * (float) CELL_SIZE_Y / _textScale);\r\n\r\n \t\t\tdouble posX = list.get(j + _startCell).getPos().getX();\r\n \t\t\tdouble posY = list.get(j + _startCell).getPos().getY();\r\n \t\t\tdouble posZ = list.get(j + _startCell).getPos().getZ();\r\n\r\n \t\t\tString strX = String.format(\"x: %4.1f\", posX);\r\n \t\t\tString strY = String.format(\"y: %4.1f\", posY);\r\n \t\t\tString strZ = String.format(\"z: %4.1f\", posZ);\r\n \t\t\tString text = strX + \" \" + strY + \" \" + strZ;\r\n\r\n \t\t\tif (i == 0) {\r\n \t\t\t this.fontRendererObj.drawStringWithShadow(text, x + 18, y, list.get(j).getColor());\r\n\r\n \t\t\t boolean selected = j + _startCell < _selectedList.size() ? _selectedList.get(j + _startCell) : false;\r\n\r\n \t\t\t GL11.glPushMatrix();\r\n GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);\r\n \t\t\t this.mc.renderEngine.bindTexture(selected ? BUTTON_ON_RESOURCE : BUTTON_OFF_RESOURCE);\r\n \t\t\t HubbyUtils.drawTexturedRectHelper(0, x + CELL_SIZE_X + 18, y - 3, 16, 16, 0, 0, 256, 256);\r\n \t\t\t GL11.glPopMatrix();\r\n \t\t\t}\r\n \t\t\telse if (i == 1) {\r\n \t\t\t\tBlockPos pos = new BlockPos((int)posX, (int)posY - 1, (int)posZ);\r\n \t\t\t Block block = Minecraft.getMinecraft().theWorld.getBlockState(pos).getBlock();\r\n \t\t\tif (block != null) {\r\n \t\t\t Item itemToRender = Item.getItemFromBlock(block);\r\n \t\t\t itemToRender = itemToRender != null ? itemToRender : Item.getItemFromBlock((Block)Block.blockRegistry.getObjectById(3));\r\n \t\t\t ItemStack is = new ItemStack(itemToRender, 1, 0);\r\n \t\t\t _itemRender.renderItemAndEffectIntoGUI(is, x - 1, y - 3);\r\n \t _itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, is, x - 1, y - 3, \"\"); // TODO: is the last param correct?\r\n \t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n\t\t}\r\n\r\n\t\tGL11.glPopMatrix();\r\n\t\tGL11.glDisable(GL11.GL_SCISSOR_TEST);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== ======================= PRIVATE ============================== Get the metadata from dom element and put into PM_PictureMetadaten. | private void getMetadaten(PM_Picture picture,
Element bildElement) {
picture.meta.setInit(true); // init mode proceed
// ---- Attributes im bild-Tag ----------------------
if (getAttribute(bildElement, XML_VALID).equals("no")) {
picture.meta.setInvalid(true);
} else {
picture.meta.setInvalid(false);
}
setDate( picture, bildElement);
picture.meta.setCategory(getAttribute(bildElement, XML_QS));
setImageSize(picture, bildElement);
// picture.meta
// .setRotationString(getAttribute(bildElement, XML_ROTATE));
setRotation(picture, bildElement);
picture.meta.setMiniSequence(getAttribute(bildElement, XML_MINI_SQUENCE));
// test
String s = getAttribute(bildElement, XML_MINI_SQUENCE);
if (s != null && s.length() != 0) {
System.out.println("---- mini sequence: " +s);
}
// end
String spiegeln = getAttribute(bildElement, XML_SPIEGELN);
picture.meta.setMirror(spiegeln.equalsIgnoreCase("S"));
if (getAttribute(bildElement, XML_BEARBEITET).equals("ja")) {
picture.meta.setModified(true);
} else {
picture.meta.setModified(false);
}
// tags
picture.meta.setIndex1(getTagValue(bildElement, XML_INDEX));
picture.meta.setRemarks(getTagValue(bildElement, XML_BEMERKUNGEN));
picture.meta.setIndex2(getTagValue(bildElement, XML_ORT));
picture.meta.setSequenz(getTagValue(bildElement, XML_SEQUENCE));
// im cut-tag
List elements = bildElement.elements(XML_CUT);
Element cutElement = null;
if (elements.size() != 0) {
cutElement = (Element) elements.get(0);
}
setCutRectangle( picture, cutElement);
// picture.meta.setCutX(getAttribute(cutElement, XML_CUT_X));
// picture.meta.setCutY(getAttribute(cutElement, XML_CUT_Y));
// picture.meta.setCutBreite(getAttribute(cutElement, XML_CUT_B));
// picture.meta.setCutHoehe(getAttribute(cutElement, XML_CUT_H));
// work done
picture.meta.setInit(false); // end init mode
} | [
"ElementMetadata getElementMetadata();",
"public String getProductPictureDetails(){\r\n\t\t\t\r\n\t\t\treturn (hasProductPicture())?McsElement.getElementByXpath(driver, PRODUCT_PIC_CONTAINER+\"//img\").getAttribute(\"src\"): \"\";\r\n\t\t}",
"org.chromium.components.paint_preview.common.proto.PaintPreview.MetadataProto getMetadata();",
"public xPIC getPic() {\r\n return pic_;\r\n }",
"public PictureData getPictureData() { return data; }",
"public org.w3c.dom.Element getProductMetadata() {\n return productMetadata;\n }",
"public abstract void setPicture(TagContent pic) throws TagFormatException;",
"public String getPicture() {\n \t\treturn picture;\n \t}",
"public String getPicture() {\r\n return picture;\r\n }",
"public Image getImage(){\r\n return this.elementImage;\r\n }",
"public String getPicture() {\n return picture;\n }",
"Map<String, Object> getImageMetadata(InputStream in);",
"com.google.protobuf.ByteString getPicture();",
"@NonNull\n String getMetadataTag() {\n return mElement.getMetadataTag();\n }",
"@Override\n\tpublic Meta_data get_Meta_data() {\n\t\tMeta_data meta_data = new Meta_data_layer(elements);\n\t\treturn meta_data;\n\t}",
"private void parseThumbnailProperty(XMPMetadata metadata, QName altName,\n\t\t\tComplexPropertyContainer container)\n\t\t\t\t\tthrows XmpUnexpectedTypeException, XmpParsingException,\n\t\t\t\t\tXMLStreamException, XmpUnknownPropertyTypeException,\n\t\t\t\t\tXmpPropertyFormatException {\n\t\texpectCurrentLocalName(\"li\");\n\t\tThumbnailType thumbnail = new ThumbnailType(metadata, altName\n\t\t\t\t.getPrefix(), altName.getLocalPart());\n\t\tint elmtType = reader.get().nextTag();\n\t\tQName eltName;\n\t\tString eltContent;\n\t\twhile (!((elmtType == XMLStreamReader.END_ELEMENT) && reader.get()\n\t\t\t\t.getName().getLocalPart().equals(\"li\"))) {\n\t\t\teltName = reader.get().getName();\n\t\t\teltContent = reader.get().getElementText();\n\t\t\tif (eltName.getLocalPart().equals(\"height\")) {\n\t\t\t\tthumbnail.setHeight(eltName.getPrefix(),\n\t\t\t\t\t\teltName.getLocalPart(), Integer.valueOf(eltContent));\n\t\t\t} else if (eltName.getLocalPart().equals(\"width\")) {\n\t\t\t\tthumbnail.setWidth(eltName.getPrefix(), eltName.getLocalPart(),\n\t\t\t\t\t\tInteger.valueOf(eltContent));\n\t\t\t} else if (eltName.getLocalPart().equals(\"image\")) {\n\t\t\t\tthumbnail.setImg(eltName.getPrefix(), eltName.getLocalPart(),\n\t\t\t\t\t\teltContent);\n\t\t\t} else if (eltName.getLocalPart().equals(\"format\")) {\n\t\t\t\tthumbnail.setFormat(eltName.getPrefix(),\n\t\t\t\t\t\teltName.getLocalPart(), eltContent);\n\t\t\t} else {\n\t\t\t\tthrow new XmpParsingException(\n\t\t\t\t\t\t\"Unknown property name for a thumbnail element : \"\n\t\t\t\t\t\t\t\t+ eltName.getLocalPart());\n\t\t\t}\n\t\t\telmtType = reader.get().nextTag();\n\t\t}\n\t\tcontainer.addProperty(thumbnail);\n\t}",
"private void trackMetadata(Node iNode, String iApplicationProfileType, String iBaseDirectory)\n {\n Node metadataNode = DOMTreeUtility.getNode(iNode, \"metadata\");\n\n if (metadataNode != null)\n {\n mMetadataNodeCount++;\n\n String identifier = DOMTreeUtility.getAttributeValue(iNode, \"identifier\");\n\n if ( iApplicationProfileType.equals(\"asset\") && identifier.equals(\"\") )\n {\n identifier = DOMTreeUtility.getAttributeValue( iNode.getParentNode(), \"identifier\");\n if ( _Debug )\n {\n System.out.println( \" File Count \" + mResourceFileCount );\n }\n }\n\n // 외부 metadata 파일을 읽어온다.\n // Gets all the location metadata\n Vector locationNodeList = DOMTreeUtility.getNodes(metadataNode, \"location\");\n\n // iterate through the vector and get the attribute names and values\n int locationNodeListSize = locationNodeList.size();\n for (int i = 0; i < locationNodeListSize; i++)\n {\n if ( _Debug )\n {\n System.out.println( \"──────────────────────────────\" );\n System.out.println( \": Start of external <metadata> : \" + mMetadataNodeCount + \", \" + identifier );\n System.out.println( \"──────────────────────────────\" );\n }\n \n MetadataData metadataData = new MetadataData();\n metadataData.setApplicationProfileType(iApplicationProfileType);\n\n // Gets the location value of each node\n String locationValue = DOMTreeUtility.getNodeValue((Node) locationNodeList.elementAt(i));\n locationValue = mManifestResourcesXMLBase + mResourceXMLBase + locationValue;\n\n metadataData.setIdentifier(identifier);\n metadataData.setLocation(locationValue);\n metadataData.setMetadataSeq(mMetadataNodeCount);\n metadataData.setResourceFileSeq(mResourceFileCount);\n\n \n // Create an adldomparser object\n ADLDOMParser adldomparser = new ADLDOMParser();\n\n // Gets the path to the file to be parsed\n String metadataFile = iBaseDirectory;\n metadataFile = metadataFile.replace('\\\\', '/');\n metadataFile = metadataFile + locationValue;\n\n // retrieve adldomparser attribute values and assign to the\n // SCORMValidator\n adldomparser.parseForWellformedness(metadataFile, false);\n Document metaDocument = adldomparser.getDocument();\n\n // Checks if document was found\n if (metaDocument != null)\n {\n if ( _Debug )\n {\n System.out.println( \" -> Found metadata XML File : \" + metadataFile );\n }\n\n // Checks for scorm 2004\n if (isSCORM_2004_Metadata((Node) metaDocument.getDocumentElement(), false))\n {\n // <lom> 를 저장 (DB에 저장하기 위해 external file일 경우에도 \"lom\" Node를 저장함)\n Node lomNode = (Node) metaDocument.getDocumentElement();\n metadataData.setRootLOMNode(lomNode);\n\n mMetadataDataList.add(metadataData);\n if ( _Debug )\n {\n System.out.println( \" -> isSCORM_2004_Metadata() == true : mMetadataDataList.add() OK.\" );\n //metadataData.printToConsole();\n }\n }\n\n }\n else\n {\n if ( _Debug )\n {\n System.out.println( \" -> No metadata XML File : \" + metadataFile );\n // meta data not found\n }\n }\n\n // resets parser\n adldomparser = null;\n\n if ( _Debug )\n {\n System.out.println( \"──────────────────────────────\" );\n System.out.println( \": End of external <metadata> : \" + mMetadataNodeCount );\n System.out.println( \"──────────────────────────────\" );\n System.out.println();\n System.out.println();\n System.out.println();\n }\n }\n\n\n\n // 내부 metadata 를 읽어온다. ( \"lom\" element로 시작함 )\n // Gets all the inline metadata from the current node\n Vector lomNodelist = DOMTreeUtility.getNodes(metadataNode, \"lom\");\n\n // iterate through the vector and get the attribute names and values\n int lomNodeListSize = lomNodelist.size();\n\n for (int j = 0; j < lomNodeListSize; j++)\n {\n if ( _Debug )\n {\n System.out.println( \"──────────────────────────────\" );\n System.out.println( \": Start of inline <metadata> : \" + mMetadataNodeCount + \", \" + identifier );\n System.out.println( \"──────────────────────────────\" );\n }\n\n // TODO 새로운 MetaData에 Setting\n MetadataData metadataData = new MetadataData();\n metadataData.setApplicationProfileType(iApplicationProfileType);\n\n // Gets the location value of each node\n metadataData.setIdentifier(identifier);\n\n Node lomNode = (Node) lomNodelist.elementAt(j);\n metadataData.setRootLOMNode(lomNode);\n metadataData.setLocation(\"inline\");\n metadataData.setMetadataSeq(mMetadataNodeCount);\n metadataData.setResourceFileSeq(mResourceFileCount);\n\n // Tests to see if this in-line meta data should be added to the\n // test list\n // must be SCORM 2004 metadata to be added.\n if (isSCORM_2004_Metadata(lomNode, false))\n {\n mMetadataDataList.add(metadataData);\n if ( _Debug )\n {\n System.out.println( \" -> isSCORM_2004_Metadata() == true : mMetadataDataList.add() OK.\" );\n }\n }\n else\n {\n // special case dealing with qualified elements\n if (!(lomNode.getLocalName().equals(lomNode.getNodeName())))\n {\n if (lomNode.getLocalName().equals(\"lom\"))\n {\n if (mLomNamespaceExistsAtRoot)\n {\n mMetadataDataList.add(metadataData);\n if ( _Debug )\n {\n System.out.println( \" -> Not isSCORM_2004_Metadata metadataDataList add\" );\n }\n }\n }\n }\n }\n \n //metadataData.printToConsole();\n \n if ( _Debug )\n {\n System.out.println( \"──────────────────────────────\" );\n System.out.println( \": End of inline <metadata> : \" + mMetadataNodeCount );\n System.out.println( \"──────────────────────────────\" );\n System.out.println();\n System.out.println();\n System.out.println();\n }\n }\n }\n }",
"public byte[] getMetadata()\n {\n return JPEGUtils.getMetadata(m_RawData);\n }",
"private Point getGIFOffset(IIOMetadata metaData)\n {\n Node tree = metaData.getAsTree(\"javax_imageio_gif_image_1.0\");\n NodeList childNodes = tree.getChildNodes();\n\n for (int j=0; j<childNodes.getLength(); j++) { Node nodeItem = childNodes.item(j);\n\n if (nodeItem.getNodeName().equals(\"ImageDescriptor\")){\n NamedNodeMap attrs = nodeItem.getAttributes();\n Node attrX = attrs.getNamedItem(\"imageLeftPosition\");\n int dx = Integer.valueOf(attrX.getNodeValue());\n Node attrY = attrs.getNamedItem(\"imageTopPosition\");\n int dy = Integer.valueOf(attrY.getNodeValue());\n return new Point(dx,dy);\n }\n }\n return new Point();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of a property as a boolean. | public boolean getBoolean(String property); | [
"boolean getBoolean(String propertyName);",
"public boolean getBoolean(String property, boolean defaultValue);",
"public boolean getBoolean(String property)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\tif (value == null)\n\t\t\tthrow new PropertiesPlusException(property+\" is not defined.\");\n\t\t\n\t\tvalue = value.trim();\n\t\tif (value.equalsIgnoreCase(\"true\"))\n\t\t\treturn true;\n\t\t\n\t\tif (value.equalsIgnoreCase(\"false\"))\n\t\t\treturn false;\n\t\t\n\t\tthrow new PropertiesPlusException(String.format(\n\t\t\t\t\t\"%s = %s cannot be converted to type boolean\", property, value));\n\t}",
"public boolean getBooleanProperty(String key) {\n String val = getProperty(key);\n return (null == val ? true : Boolean.valueOf(val).booleanValue());\n }",
"public boolean isProperty();",
"private native static boolean getBoolProp(JavaScriptObject object, \r\n String propertyName)\r\n /*-{\r\n\treturn !! object[propertyName];\r\n }-*/;",
"public Boolean getValue() {\r\n return Boolean.valueOf(this.value);\r\n }",
"boolean getBoolValue();",
"BooleanProperty getOn();",
"public boolean booleanValue();",
"public boolean getAsBoolean(final String name) {\r\n Boolean result = false;\r\n String prop = (String) this.properties.get(name);\r\n if (prop != null) {\r\n prop = prop.toLowerCase();\r\n if (prop != null && (TRUE.equals(prop) || ONE.equals(prop))) {\r\n result = true;\r\n }\r\n }\r\n return result;\r\n }",
"public Boolean propertyToBoolean(String property, boolean defaultValue) {\n String value = this.properties.getProperty(property);\n if (value == null) {\n return defaultValue;\n }\n if (value.equalsIgnoreCase(\"true\")) {\n return true;\n } else if (value.equalsIgnoreCase(\"false\")) {\n return false;\n } else {\n return null;\n }\n }",
"public boolean getBoolean() throws ValueFormatException {\n throw getValueFormatException(PropertyType.TYPENAME_BOOLEAN);\n }",
"@JsonIgnore\n public boolean getBooleanValue() {\n if (type != Type.BOOLEAN) {\n throw new IllegalStateException(\"Attribute \" + name + \" is type \" + type);\n }\n return Boolean.parseBoolean(value);\n }",
"public boolean getObjectAsBoolean() {\n boolean bValue = false;\n if (this.type == BOOLEAN) {\n bValue = this.value.equals(\"true\");\n }\n return bValue;\n }",
"public Boolean getBoolean(String pKey)\r\n {\r\n if (! mProperties.containsKey(pKey))\r\n {\r\n String msg = \"property \" + pKey + \" not found\";\r\n throw new PropertyNotFoundException(msg);\r\n }\r\n\r\n return (Boolean) mProperties.get(pKey);\r\n }",
"public Boolean asBoolean() {\r\n\t\treturn DataConverterRegistry.convert(Boolean.class, value);\r\n\t}",
"public boolean getIsFauxProperty() {\n \treturn isFauxProperty(property);\n }",
"public boolean getBoolean(String key) {\n\t\t//return Boolean.valueOf(getString(key)).booleanValue(); // mdb removed 5/12/09\n\t\t\n\t\t// mdb added 5/12/09\n\t\tString value = getProperty(key);\n\t\tif (value != null && (value.equals(\"1\") || value.toLowerCase().equals(\"true\")))\n\t\t\treturn true;\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the equality comparator used to compare the objects in this collection. | default EqualityComparator<? super E> getComparator() {
// Most implementations do not support custom equality comparators,
// and just use the equals() and hashCode() implementations of the objects by default.
return EqualityComparator.getDefault();
} | [
"protected EqualsComparator _getEqualsComparator() {\n return _mEqualsComparator;\n }",
"public AttributeComparator getComparator() {\n\t\treturn comparator;\n\t}",
"public Comparator getComparator() {\n return comparator;\n }",
"public String getComparator() {\n\t\treturn comparator;\n\t}",
"public static Comparator<Class<?>> comparator() {\n return COMPARATOR;\n }",
"public Comparator<BCell> getComparator() {\n return comparator;\n }",
"public static Comparator BytewiseComparator() {\n\t\treturn new BytewiseComparatorImpl();\n\t}",
"protected ModuleObjectComparator getComparator() {\r\n \r\n return ReferenceItemComparator.getInstance();\r\n }",
"public DominanceComparator getComparator() {\r\n\t\treturn comparator;\r\n\t}",
"public String getComparatorForNull() {\n return comparatorForNull;\n }",
"public static Comparator simpleComparator() {\n if (simpleComparatorImpl == null) {\n simpleComparatorImpl = new Comparator() {\n public boolean equals(Object o) {\n return o == simpleComparatorImpl;\n }\n public int compare(Object o1, Object o2)\n throws ClassCastException {\n return ((Dependency)o1).component()\n .compareTo(((Dependency)o2).component());\n }\n };\n }\n return simpleComparatorImpl;\n }",
"public static JwComparator<AcItemsVo> getReferenceIdComparator()\n {\n return AcItemsVoTools.instance.getReferenceIdComparator();\n }",
"public static JwComparator<AcCustodySummaryVo> getHashKeyComparator()\n {\n return AcCustodySummaryVoTools.instance.getHashKeyComparator();\n }",
"public AddressComparator getComparator(){\n \treturn new AddressComparator(this);\n }",
"public Comparator getComparador() {\n // Usar el primer elemento del arreglo para comparar\n return new ComparadorUno(0);\n }",
"ElementComparator<T> comparator();",
"public IComparisonOperator getComparisonOperator() {\n return comparisonOperator;\n }",
"protected Comparator getNameComparator()\n {\n if(nameComparator == null)\n {\n nameComparator = new SMComponentNameComparator();\n }\n\n return nameComparator;\n }",
"public static <T extends Comparable<? super T>> Comparator<T> comparator() {\r\n\t\treturn new Comparator<T>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(T o1, T o2) {\r\n\t\t\t\tif (o1 != null && o2 == null) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else\r\n\t\t\t\tif (o1 == null && o2 != null) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else\r\n\t\t\t\tif (o1 == o2) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\treturn o1.compareTo(o2);\r\n\t\t\t};\r\n\t\t};\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an independant data copy of the brain | public NeuralBrainData copy() {
return new NeuralBrainData(this);
} | [
"public Data copyData() {\r\n\t\treturn (new Bay(this)).data(); // Make a new Bay that will copy the data we view into it\r\n\t}",
"Copydata createCopydata();",
"CellularAutomata createCellularAutomata();",
"private Instances deepCopy(Instances data) {\n Instances newInst = new Instances(data);\n\n newInst.clear();\n\n for (int i = 0; i < data.size(); i++) {\n Instance ni = new DenseInstance(data.numAttributes());\n for (int j = 0; j < data.numAttributes(); j++) {\n ni.setValue(newInst.attribute(j), data.instance(i).value(data.attribute(j)));\n }\n newInst.add(ni);\n }\n\n return newInst;\n }",
"public ICData (ICData dataset)\n\t{\n\t\t// Create a name for the new dataset\n\t\t_name = \"Copy.of.\" + dataset.getName();\n\t\n\t\t//Copy the list of attributes\n\t\t_attList = new ArrayList <ICAtt> ();\n\t\tObject [] attributes = dataset.attributes();\n\t\tfor (int i=0; i<attributes.length; i++)\n\t\t\tthis._attList.add(new ICAtt ((ICAtt)attributes[i]));\t\n\t\n\t\t//Copy the list of attributes\n\t\t_instances = new ArrayList <ICInst> ();\n\t\tObject [] instances = dataset.instances();\n\t\tfor (int i=0; i<instances.length; i++)\n\t\t\tthis._instances.add(new ICInst ((ICInst)instances[i]));\t\n\t\t\n\t\tif (dataset._classIndexes != null)\n\t\t{\n\t\t\t_classIndexes = new ArrayList <Integer> ();\n\t\t\tObject [] classes = dataset.getClassIndexes().toArray();\n\t\t\tfor (int i=0; i<classes.length;i++)\n\t\t\t\t_classIndexes.add(((Integer)classes[i]).intValue());\n\t\t}//if\n\t}",
"@Override\n public Object clone() {\n return new DataBundle(this);\n }",
"public Object clone(){\r\n\t\tSampleData obj = new SampleData(letter,getWidth(),getHeight());\r\n\t\tfor ( int y=0;y<getHeight();y++ )\r\n\t\t\tfor ( int x=0;x<getWidth();x++ )\r\n\t\t\t\tobj.setData(x,y,getData(x,y));\r\n\t\treturn obj;\r\n\t}",
"public /*@pure@*/ Object copy() {\n\n Instance result = new Instance(this);\n result.m_Dataset = m_Dataset;\n return result;\n }",
"Data createData();",
"abstract public DataSet<Type> shallowClone();",
"private void cloning() {\n\t\t\n\t\tArrays.sort(population);\n\t\tint index = 0;\n\t\tfor (int rank = 1; rank <= population.length; rank++) {\n\t\t\t\n\t\t\tint copies = (int)((paramβ*paramN)/((double) rank) + 0.5);\n\t\t\tfor (int copy = 0; copy < copies; copy++) {\n\t\t\t\tclonedPopulation[index] = (Antibody) population[rank-1].clone();\n\t\t\t\tclonedPopulationRanks[index] = rank;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"protected Factorization copy(){\n Factorization newFactor = new Factorization(this.mdc);\n //shallow copy\n newFactor.setRecipes(recipes);\n newFactor.setIngredients(ingredients);\n newFactor.setUserMap(userMap);\n newFactor.setUserMapReversed(userMap_r);\n newFactor.setRecipeMap(recipeMap);\n newFactor.setRecipeMapReversed(recipeMap_r);\n newFactor.setIngredientMap(ingredientMap);\n newFactor.setIngredientMapReversed(ingredientMap_r);\n \n //deep copy\n List<User> userCopy = new ArrayList<User>();\n for(User curr: this.users){\n userCopy.add(new User(curr.getId()));\n }\n newFactor.setUsers(userCopy);\n newFactor.setDataset(dataset.copy());\n newFactor.updateInitialSpace();\n return newFactor;\n }",
"private Dataset generateDatasetReplicaWithDiscretizedAttributes(Dataset dataset, List<OperatorAssignment> unaryOperatorAssignments, OperatorsAssignmentsManager oam) throws Exception {\n Dataset replicatedDatast = dataset.replicateDataset();\n for (OperatorAssignment oa : unaryOperatorAssignments) {\n ColumnInfo ci = oam.generateColumn(replicatedDatast, oa, true);\n replicatedDatast.addColumn(ci);\n }\n return replicatedDatast;\n }",
"protected Brain DNAtoBrain() {\n\t\treturn new Brain(this, this.ID, genes.values(), nodes,\n\t\t\t\tpopulation.sigmoidCoefficient);\n\t}",
"protected abstract SelfChainingDataObject getNewIndependentInstance();",
"public ProcessedDynamicData deepCopy( ) {\r\n\r\n ProcessedDynamicData copy = new ProcessedDynamicData( this.channelId );\r\n\r\n copy.channelId = this.channelId;\r\n copy.dateTimeStamp = new java.util.Date( this.dateTimeStamp.getTime() );\r\n copy.samplingRate = this.samplingRate;\r\n copy.eu = this.eu;\r\n\r\n copy.min = this.min;\r\n copy.max = this.max;\r\n\r\n copy.measurementType = this.measurementType;\r\n copy.measurementUnit = this.measurementUnit;\r\n\r\n // data and labels\r\n List<Double> dataCopy = new Vector<Double>();\r\n for( int i = 0; i < this.data.size(); i++ ) {\r\n dataCopy.add( new Double( this.data.get( i ) ) );\r\n }\r\n copy.setData( dataCopy );\r\n\r\n List<Double> dataLabels = new Vector<Double>();\r\n for( int i = 0; i < this.dataLabels.size(); i++ ) {\r\n dataLabels.add( new Double( this.dataLabels.get( i ) ) );\r\n }\r\n copy.setDataLabels( dataLabels );\r\n\r\n // create a deep copy of overalls\r\n if( overalls != null ) {\r\n copy.overalls = new OverallLevels( this.overalls.getChannelId() );\r\n copy.overalls.setDateTimeStampMillis( this.getDateTimeStampMillis() );\r\n Vector<String> overallKeys = this.overalls.getKeys();\r\n for( int i = 0; i < overallKeys.size(); i++ ) {\r\n copy.overalls.addOverall( new String( overallKeys.elementAt( i ) ),\r\n new Double( this.overalls.getOverall( overallKeys.elementAt( i ) ) ) );\r\n }\r\n }\r\n\r\n copy.xEUnit = this.xEUnit;\r\n copy.yEUnit = this.yEUnit;\r\n\r\n copy.xSymbol = this.xSymbol;\r\n copy.ySymbol = this.ySymbol;\r\n copy.xPhysDomain = this.xPhysDomain;\r\n copy.yPhysDomain = this.yPhysDomain;\r\n \r\n copy.noOfAppendedZeros = this.noOfAppendedZeros;\r\n\r\n return copy;\r\n }",
"private Dataset createDataset1() {\n final RDF factory1 = createFactory();\n\n final IRI name = factory1.createIRI(\"http://xmlns.com/foaf/0.1/name\");\n final Dataset g1 = factory1.createDataset();\n final BlankNode b1 = createOwnBlankNode(\"b1\", \"0240eaaa-d33e-4fc0-a4f1-169d6ced3680\");\n g1.add(b1, b1, name, factory1.createLiteral(\"Alice\"));\n\n final BlankNode b2 = createOwnBlankNode(\"b2\", \"9de7db45-0ce7-4b0f-a1ce-c9680ffcfd9f\");\n g1.add(b2, b2, name, factory1.createLiteral(\"Bob\"));\n\n final IRI hasChild = factory1.createIRI(\"http://example.com/hasChild\");\n g1.add(null, b1, hasChild, b2);\n\n return g1;\n }",
"Copy createCopy();",
"@Override\n\tpublic Automaton clone() {\n\t\tAutomaton a;\n\t\t// Try to create a new object.\n\t\ttry {\n\t\t\ta = getClass().newInstance();\n\t\t} catch (final Throwable e) {\n\t\t\t// Well golly, we're sure screwed now!\n\t\t\tlogger.error(\"Warning: clone of automaton failed: {}\", e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t\ta.setEnvironmentFrame(getEnvironmentFrame());\n\n\t\t// Copy over the states.\n\t\tfinal HashMap<State, State> map = new HashMap<>(); // Old states to new\n\t\t// states.\n\t\tstates.forEach(state -> {\n\t\t\tfinal State newState = new State(state.getID(), new Point(state.getPoint()), a);\n\t\t\tnewState.setLabel(state.getLabel());\n\t\t\tnewState.setName(state.getName());\n\t\t\tmap.put(state, newState);\n\t\t\ta.addState(newState);\n\t\t\tif (this instanceof MooreMachine) {\n\t\t\t\t((MooreMachine) a).setOutput(newState, ((MooreMachine) this).getOutput(state));\n\t\t\t}\n\t\t});\n\n\t\tfinalStates.forEach(state -> {\n\t\t\ta.addFinalState(map.get(state));\n\t\t});\n\n\t\ta.setInitialState(map.get(getInitialState()));\n\n\t\t// Copy over the transitions.\n\n\t\tstates.forEach(state -> {\n\t\t\tfinal State from = map.get(state);\n\t\t\tgetTransitionsFromState(state).forEach(transition -> {\n\t\t\t\tfinal State to = map.get(transition.getToState());\n\t\t\t\tSystem.err.println(\"Transition name: \" + transition.toString());\n\t\t\t\tfinal Transition toBeAdded = transition.clone();\n\t\t\t\ttoBeAdded.setFromState(from);\n\t\t\t\ttoBeAdded.setToState(to);\n\t\t\t\tSystem.err.println(\"toBeAdded is null: \" + (toBeAdded == null));\n\t\t\t\tSystem.err.println(\"toBeAdded.from is null: \" + (toBeAdded.getFromState() == null));\n\t\t\t\tSystem.err.println(\"toBeAdded.to is null: \" + (toBeAdded.getToState() == null));\n\t\t\t\ta.addTransition(toBeAdded);\n\t\t\t});\n\t\t});\n\n\t\tfinal List<Note> notes = getNotes();\n\t\tfinal List<Note> copyNotes = a.getNotes();\n\t\tcheckArgument(notes.size() == copyNotes.size());\n\n\t\tIntStream.range(0, notes.size()).forEach(i -> {\n\t\t\ta.addNote(new Note(notes.get(i).getAutoPoint(), notes.get(i).getText()));\n\t\t\tcopyNotes.get(i).setView(notes.get(i).getView());\n\t\t});\n\t\t// Should be done now!\n\t\treturn a;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
computeHashCodeOfNode Compute hash code of node pNode taking into account the hash codes of its children so that any two subtrees have the same hash code if they have the same shape. | int
computeHashCodeOfNode(HIR pNode)
{
int lCode, lNodeIndex, lChild, lChildCount;
Sym lSym;
if (fDbgLevel > 3)
ioRoot.dbgFlow.print(7, " computeHashCodeOfNode ");
if (pNode == null)
return 0;
lNodeIndex = pNode.getIndex();
lCode = getHashCodeOfIndexedNode(lNodeIndex);
if (lCode != 0) // Hash code is already computed. return it.
return lCode;
lCode = pNode.getOperator() + System.identityHashCode(pNode.getType());
lSym = pNode.getSym();
if (lSym != null) { // This is a leaf node attached with a symbol.
lCode = lCode * 2 + System.identityHashCode(lSym);
}
else {
lChildCount = pNode.getChildCount();
for (lChild = 1; lChild <= lChildCount; lChild++) {
lCode = lCode * 2
+ computeHashCodeOfNode((HIR)(pNode.getChild(lChild)));
}
}
//##60 BEGIN
// Assign different hash code for l-value compared to r-value.
//##65 if ((pNode.getParent()instanceof AssignStmt) &&
//##65 (pNode.getParent().getChild1() == pNode))
if (FlowUtil.isAssignLHS(pNode)) //##65
{
lCode = lCode * 2;
}
//##60 END
lCode = (lCode & 0x7FFFFFFF) % EXP_ID_HASH_SIZE;
if (fDbgLevel > 3)
ioRoot.dbgFlow.print(7, Integer.toString(lCode, 10));
setHashCodeOfIndexedNode(lNodeIndex, lCode);
return lCode;
} | [
"private int recTreeHashCode(Node node) {\n // Get the parents HashCode.\n int hashCode = node.getTupleSet().hashCode();\n\n // Get the children's HashCode.\n int childrenHashCode = 1;\n for (Node child: node.children) {\n // Sum the children's HashCode.\n childrenHashCode += recTreeHashCode(child);\n }\n\n // Add the hashCodes.\n return hashCode + childrenHashCode;\n }",
"@Test\n public void testHashCode() {\n int hash = 5;\n hash = 97 * hash + 2;\n hash = 97 * hash + 0;\n assertEquals(hash, node.hashCode());\n }",
"@Test\n public void testHashCode() {\n System.out.println(\"hashCode\");\n\n Category c = new Category(\"Bajoras\", \"15DC\");\n Node node = new Node(c);\n\n Node node2 = new Node(c);\n\n assertEquals(node.hashCode(), node2.hashCode());\n\n //Mutation tests\n assertNotEquals(\"\".hashCode(), node.hashCode());\n int num = 97 * 7 + node.getElement().hashCode();\n assertEquals(num, node.hashCode());\n }",
"public int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((node2 == null) ? 0 : node1.hashCode() + node2.hashCode());\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic int hashCode() {\r\n\t\treturn (int) this.nodes[0].hashCode()*this.nodes[1].hashCode();\r\n\t}",
"@Override\n public int hashCode() {\n int inMult = 31, outMult = 47;\n\n int hash = this.children.keySet().stream()\n .mapToInt(edge -> edge.hashCode() + (edge.isIncoming() ? inMult : outMult) * this.children.get(edge).hashCode())\n .sum();\n\n return hash;\n }",
"public int hashCode() {\n return (7 + this.key.hashCode() + this.value.hashCode() / 5) \n + this.left.hashCode()\n + this.right.hashCode();\n }",
"public int equalHashCode() {\n { PropertyList self = this;\n\n { int code = 108398967;\n\n { Stella_Object key = null;\n Stella_Object value = null;\n Cons iter000 = self.thePlist;\n\n for (;!(iter000 == Stella.NIL); iter000 = iter000.rest.rest) {\n key = iter000.value;\n value = iter000.rest.value;\n code = (code ^ (Stella_Object.safeEqualHashCode(key)));\n code = (code ^ (Stella_Object.safeEqualHashCode(value)));\n }\n }\n return (code);\n }\n }\n }",
"public int hashCode() { \n int res = this.valorHash;\n if (res != 0) { return res; }\n \n // for(int i = 0; i < termino.length(); i++){\n // int aux = 1; \n // for(int j = 0; j < termino.length()-i-1;j++){\n // aux *= this.baseHashCode;\n // } \n // res += this.termino.charAt(i)*aux;\n // }\n \n // COMPLETAR: calcular el valor de res para this.termino en this.baseHashCode\n // de forma EFICIENTE, i.e. usando la regla de Horner\n for (int i = 0; i< this.termino.length(); i++){\n res = this.baseHashCode * res + this.termino.charAt(i);\n } \n /* FIN COMPLETAR */ \n this.valorHash = res;\n return res;\n }",
"public int hashCode() {\n if (this.parent == null)\n return super.hashCode();\n return Util.combineHashCodes(getElementName().hashCode(), this.parent.hashCode());\n }",
"public int hashcode();",
"private int computeHashCode() {\r\n int result = pieceType.hashCode();\r\n result = 31 * result + pieceColor.hashCode();\r\n result = 31 * result + position;\r\n result = 31 * result + (isFirstMove? 1: 0);\r\n return result;\r\n }",
"@Override\n public int hashCode() {\n return Objects.hash(getNodeU(), getNodeV()) + Objects.hash(getNodeV(), getNodeU());\n }",
"int computeHashCode(T object);",
"@Override\n public int hashCode() {\n // name's hashCode is multiplied by an arbitrary prime number (13)\n // in order to make sure there is a difference in the hashCode between\n // these two parameters:\n // left: a right: aa\n // left: aa right: a\n return left.hashCode() * 13 + (right == null ? 0 : right.hashCode());\n }",
"public int hashCode() {\n // Path is immutable, we can store the computed hash code value\n int h = 17;\n for (int i = 0; i < this.queue.size(); i++) {\n h = 37 * h + this.queue.get(i).hashCode();\n }\n return h;\n }",
"int computeHashCode(byte val);",
"public int getTIPCNodeHash() {\n ByteBuffer bb = ByteBuffer.wrap(getBytes());\n int a = bb.getInt(3 * 4);\n return a;\n }",
"@Override\n public int hashCode() {\n return Objects.hashCode(nodes(), edgeToIncidentNodes);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a value of property OfficialArtistWebpage from an RDF2Go node. First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1. | public static void setOfficialArtistWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {
Base.set(model, instanceResource, OFFICIALARTISTWEBPAGE, value);
} | [
"public void setOfficialArtistWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void setOfficialArtistWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void addOfficialArtistWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void addOfficialArtistWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.add(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void removeOfficialArtistWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void removeOfficialArtistWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void setOfficialFileWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALFILEWEBPAGE, value);\r\n\t}",
"public static void addOfficialArtistWebpage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.add(model, instanceResource, OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public abstract void setArtistWebpage(TagContent page)\r\n\t\t\tthrows TagFormatException;",
"public void setOfficialFileWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALFILEWEBPAGE, value);\r\n\t}",
"public static void removeOfficialArtistWebpage(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void setLeadArtist( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), LEADARTIST, value);\r\n\t}",
"public static void removeOfficialArtistWebpage( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(model, instanceResource, OFFICIALARTISTWEBPAGE, value);\r\n\t}",
"public void setOfficialInternetRadioStationHomepage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public void setOriginalArtist( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALARTIST, value);\r\n\t}",
"public void setOfficialAudioSourceWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}",
"public void addOfficialFileWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), OFFICIALFILEWEBPAGE, value);\r\n\t}",
"public void setOfficialInternetRadioStationHomepage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.set(this.model, this.getResource(), OFFICIALINTERNETRADIOSTATIONHOMEPAGE, value);\r\n\t}",
"public ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllOfficialArtistWebpage_asNode_() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), OFFICIALARTISTWEBPAGE, org.ontoware.rdf2go.model.node.Node.class);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get versionPath of type UTF8String. | public UTF8String getVersionPath() {
return this.versionPath;
} | [
"public void setVersionPath(final UTF8String versionPath) {\n this.versionPath = versionPath;\n }",
"public String getVPath() {\n return vPath;\n }",
"protected String buildVersionedPath(final String path, final AbstractResourceVersion version) {\n\t\tif (!version.isValid()) {\n\t\t\treturn path;\n\t\t}\n\t\tfinal int idx = path.lastIndexOf('.');\n\t\tif (idx > 0) {\n\t\t\treturn path.substring(0, idx) + \"-\" + version.getVersion() + path.substring(idx);\n\t\t} else {\n\t\t\treturn path + \"-\" + version.getVersion();\n\t\t}\n\t}",
"String getStringsPathFile();",
"public native final static String getVersionString();",
"String getNativePath();",
"String getVersionString();",
"java.lang.String getVStr();",
"java.lang.String getVString();",
"String getCharacterVDBResource(String resourcePath) throws Exception;",
"private static String loadVersionString()\n {\n return \"1.0b9\";\n\n /*Package pkg = Package.getPackage(\"de.hunsicker.jalopy\");\n\n\n if (pkg == null)\n {\n throw new RuntimeException(\n \"could not find package de.hunsicker.jalopy\");\n }\n\n String version = pkg.getImplementationVersion();\n\n if (version == null)\n {\n throw new RuntimeException(\n \"no implementation version string found in package manifest\");\n }\n\n return version;*/\n }",
"Path getVolantFilePath();",
"String getStringsTestPathFile();",
"String getVersion( String version );",
"byte[] getBinaryVDBResource(String resourcePath) throws Exception;",
"public String getPathString() {\n return Utils.getPathAsString(getPath());\n }",
"java.lang.String getVersion();",
"FilePathInfo parseVirtualPath(String path);",
"public String getRawPath()\n {\n // encode to URI and get encoded ('raw') path. \n try\n {\n return this.toURI().getRawPath();\n }\n catch (VlException e)\n {\n System.out.println(\"***Error: Exception:\"+e); \n e.printStackTrace();\n return this.getPath();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR start "notExpression" /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:384:1: notExpression : ( NOT )? arithmeticExpression ; | public final CQLParser.notExpression_return notExpression() throws RecognitionException {
CQLParser.notExpression_return retval = new CQLParser.notExpression_return();
retval.start = input.LT(1);
Object root_0 = null;
Token NOT93=null;
CQLParser.arithmeticExpression_return arithmeticExpression94 = null;
Object NOT93_tree=null;
errorMessageStack.push("NOT expression");
try {
// /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:2: ( ( NOT )? arithmeticExpression )
// /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:4: ( NOT )? arithmeticExpression
{
root_0 = (Object)adaptor.nil();
// /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:4: ( NOT )?
int alt25=2;
int LA25_0 = input.LA(1);
if ( (LA25_0==NOT) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:388:5: NOT
{
NOT93=(Token)match(input,NOT,FOLLOW_NOT_in_notExpression1816);
NOT93_tree = (Object)adaptor.create(NOT93);
root_0 = (Object)adaptor.becomeRoot(NOT93_tree, root_0);
}
break;
}
pushFollow(FOLLOW_arithmeticExpression_in_notExpression1821);
arithmeticExpression94=arithmeticExpression();
state._fsp--;
adaptor.addChild(root_0, arithmeticExpression94.getTree());
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
errorMessageStack.pop();
}
catch(RecognitionException re)
{
reportError(re);
throw re;
}
finally {
}
return retval;
} | [
"private Node parseNot() {\n\t\tNode child = null;\n\t\t\n\t\tif (tokenIsType(TokenType.OPERATOR) && \"not\".equals(getTokenValue())) {\n\t\t\tgetNextToken();\n\t\t\t\n\t\t\tchild = parseNot();\n\t\t\t\n\t\t\treturn new UnaryOperatorNode(\n\t\t\t\t\t\"not\", \n\t\t\t\t\tchild, \n\t\t\t\t\tbool -> !bool\n\t\t\t);\n\t\t}\n\t\t\n\t\tchild = parseExpression();\n\t\t\n\t\treturn child;\n\t}",
"private JCExpression NOT(JCExpression expr) { return m().Unary(JCTree.NOT, expr); }",
"public static UnaryExpression not(Expression expression) {\n return makeUnary(ExpressionType.Not, expression, expression.getType());\n }",
"public final EObject ruleNotExpression() throws RecognitionException {\n EObject current = null;\n\n Token lv_negated_0_0=null;\n EObject lv_inner_1_0 = null;\n\n\n enterRule(); \n \n try {\n // InternalDsl.g:1468:28: ( ( ( ( ( 'not' ) )=> (lv_negated_0_0= 'not' ) )? ( (lv_inner_1_0= rulePrimaryExpression ) ) ) )\n // InternalDsl.g:1469:1: ( ( ( ( 'not' ) )=> (lv_negated_0_0= 'not' ) )? ( (lv_inner_1_0= rulePrimaryExpression ) ) )\n {\n // InternalDsl.g:1469:1: ( ( ( ( 'not' ) )=> (lv_negated_0_0= 'not' ) )? ( (lv_inner_1_0= rulePrimaryExpression ) ) )\n // InternalDsl.g:1469:2: ( ( ( 'not' ) )=> (lv_negated_0_0= 'not' ) )? ( (lv_inner_1_0= rulePrimaryExpression ) )\n {\n // InternalDsl.g:1469:2: ( ( ( 'not' ) )=> (lv_negated_0_0= 'not' ) )?\n int alt25=2;\n int LA25_0 = input.LA(1);\n\n if ( (LA25_0==37) && (synpred8_InternalDsl())) {\n alt25=1;\n }\n switch (alt25) {\n case 1 :\n // InternalDsl.g:1469:3: ( ( 'not' ) )=> (lv_negated_0_0= 'not' )\n {\n // InternalDsl.g:1476:1: (lv_negated_0_0= 'not' )\n // InternalDsl.g:1477:3: lv_negated_0_0= 'not'\n {\n lv_negated_0_0=(Token)match(input,37,FOLLOW_23); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n newLeafNode(lv_negated_0_0, grammarAccess.getNotExpressionAccess().getNegatedNotKeyword_0_0());\n \n }\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElement(grammarAccess.getNotExpressionRule());\n \t }\n \t\tsetWithLastConsumed(current, \"negated\", true, \"not\");\n \t \n }\n\n }\n\n\n }\n break;\n\n }\n\n // InternalDsl.g:1490:3: ( (lv_inner_1_0= rulePrimaryExpression ) )\n // InternalDsl.g:1491:1: (lv_inner_1_0= rulePrimaryExpression )\n {\n // InternalDsl.g:1491:1: (lv_inner_1_0= rulePrimaryExpression )\n // InternalDsl.g:1492:3: lv_inner_1_0= rulePrimaryExpression\n {\n if ( state.backtracking==0 ) {\n \n \t newCompositeNode(grammarAccess.getNotExpressionAccess().getInnerPrimaryExpressionParserRuleCall_1_0()); \n \t \n }\n pushFollow(FOLLOW_2);\n lv_inner_1_0=rulePrimaryExpression();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getNotExpressionRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"inner\",\n \t\tlv_inner_1_0, \n \t\t\"com.isax.validation.dsl.Dsl.PrimaryExpression\");\n \t afterParserOrEnumRuleCall();\n \t \n }\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public T not(ExpNode expr) {\n predicateParser.not();\n predicateParser.addToken(expr);\n return getThis();\n }",
"public final EObject ruleNegation() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject lv_operator_0_0 = null;\r\n\r\n EObject lv_value_1_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2475:28: ( ( ( (lv_operator_0_0= ruleNotOperator ) ) ( (lv_value_1_0= ruleBooleanUnit ) ) ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2476:1: ( ( (lv_operator_0_0= ruleNotOperator ) ) ( (lv_value_1_0= ruleBooleanUnit ) ) )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2476:1: ( ( (lv_operator_0_0= ruleNotOperator ) ) ( (lv_value_1_0= ruleBooleanUnit ) ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2476:2: ( (lv_operator_0_0= ruleNotOperator ) ) ( (lv_value_1_0= ruleBooleanUnit ) )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2476:2: ( (lv_operator_0_0= ruleNotOperator ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2477:1: (lv_operator_0_0= ruleNotOperator )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2477:1: (lv_operator_0_0= ruleNotOperator )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2478:3: lv_operator_0_0= ruleNotOperator\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getNegationAccess().getOperatorNotOperatorParserRuleCall_0_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleNotOperator_in_ruleNegation5293);\r\n lv_operator_0_0=ruleNotOperator();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getNegationRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"operator\",\r\n \t\tlv_operator_0_0, \r\n \t\t\"NotOperator\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2494:2: ( (lv_value_1_0= ruleBooleanUnit ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2495:1: (lv_value_1_0= ruleBooleanUnit )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2495:1: (lv_value_1_0= ruleBooleanUnit )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2496:3: lv_value_1_0= ruleBooleanUnit\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getNegationAccess().getValueBooleanUnitParserRuleCall_1_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleBooleanUnit_in_ruleNegation5314);\r\n lv_value_1_0=ruleBooleanUnit();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getNegationRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"value\",\r\n \t\tlv_value_1_0, \r\n \t\t\"BooleanUnit\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"private void parseNotExp()\r\n {\r\n parseAtomExp();\r\n while (current.kind == Kind.TOKEN_DOT || current.kind == Kind.TOKEN_LBRACK) {\r\n if (current.kind == Kind.TOKEN_DOT) {\r\n advance();\r\n if (current.kind == Kind.TOKEN_LENGTH) {\r\n advance();\r\n return;\r\n }\r\n eatToken(Kind.TOKEN_ID);\r\n eatToken(Kind.TOKEN_LPAREN);\r\n parseExpList();\r\n eatToken(Kind.TOKEN_RPAREN);\r\n } else {\r\n advance();\r\n parseExp();\r\n eatToken(Kind.TOKEN_RBRACK);\r\n }\r\n }\r\n return;\r\n }",
"public final void mNOTOP() throws RecognitionException {\n try {\n int _type = NOTOP;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // Simpleocl.g:11984:6: ( ( 'not' ) )\n // Simpleocl.g:11985:2: ( 'not' )\n {\n // Simpleocl.g:11985:2: ( 'not' )\n // Simpleocl.g:11985:2: 'not'\n {\n match(\"not\"); \n\n\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n \t// do for sure before leaving\n }\n }",
"public final QueryParser.not_cond_return not_cond() throws RecognitionException {\n QueryParser.not_cond_return retval = new QueryParser.not_cond_return();\n retval.start = input.LT(1);\n\n\n Object root_0 = null;\n\n Token NOT269=null;\n QueryParser.unary_cond_return unary_cond270 =null;\n\n\n Object NOT269_tree=null;\n\n try {\n // /Users/wrvhage/Dropbox/teaching/Information_Retrieval_2012_2013/Distributed/pig-0.10.0-lucene/src//org/apache/pig/parser/QueryParser.g:397:10: ( NOT ^ unary_cond )\n // /Users/wrvhage/Dropbox/teaching/Information_Retrieval_2012_2013/Distributed/pig-0.10.0-lucene/src//org/apache/pig/parser/QueryParser.g:397:12: NOT ^ unary_cond\n {\n root_0 = (Object)adaptor.nil();\n\n\n NOT269=(Token)match(input,NOT,FOLLOW_NOT_in_not_cond2762); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n NOT269_tree = \n (Object)adaptor.create(NOT269)\n ;\n root_0 = (Object)adaptor.becomeRoot(NOT269_tree, root_0);\n }\n\n pushFollow(FOLLOW_unary_cond_in_not_cond2765);\n unary_cond270=unary_cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, unary_cond270.getTree());\n\n }\n\n retval.stop = input.LT(-1);\n\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }",
"public final void mNot() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = Not;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// grammars/Lua.g:90:5: ( 'not' )\n\t\t\t// grammars/Lua.g:90:7: 'not'\n\t\t\t{\n\t\t\tmatch(\"not\"); \n\n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public final PythonParser.not_test_return not_test(expr_contextType ctype) throws RecognitionException {\n PythonParser.not_test_return retval = new PythonParser.not_test_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token NOT186=null;\n PythonParser.not_test_return nt = null;\n\n PythonParser.comparison_return comparison187 = null;\n\n\n PythonTree NOT186_tree=null;\n RewriteRuleTokenStream stream_NOT=new RewriteRuleTokenStream(adaptor,\"token NOT\");\n RewriteRuleSubtreeStream stream_not_test=new RewriteRuleSubtreeStream(adaptor,\"rule not_test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1071:5: ( NOT nt= not_test[ctype] -> ^( NOT[$NOT, unaryopType.Not, actions.castExpr($nt.tree)] ) | comparison[ctype] )\n int alt84=2;\n int LA84_0 = input.LA(1);\n\n if ( (LA84_0==NOT) ) {\n alt84=1;\n }\n else if ( (LA84_0==NAME||LA84_0==LPAREN||(LA84_0>=PLUS && LA84_0<=MINUS)||(LA84_0>=TILDE && LA84_0<=LBRACK)||LA84_0==LCURLY||(LA84_0>=BACKQUOTE && LA84_0<=STRING)) ) {\n alt84=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 84, 0, input);\n\n throw nvae;\n }\n switch (alt84) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1071:7: NOT nt= not_test[ctype]\n {\n NOT186=(Token)match(input,NOT,FOLLOW_NOT_in_not_test4464); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_NOT.add(NOT186);\n\n pushFollow(FOLLOW_not_test_in_not_test4468);\n nt=not_test(ctype);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_not_test.add(nt.getTree());\n\n\n // AST REWRITE\n // elements: NOT\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1072:4: -> ^( NOT[$NOT, unaryopType.Not, actions.castExpr($nt.tree)] )\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1072:7: ^( NOT[$NOT, unaryopType.Not, actions.castExpr($nt.tree)] )\n {\n PythonTree root_1 = (PythonTree)adaptor.nil();\n root_1 = (PythonTree)adaptor.becomeRoot(new UnaryOp(NOT, NOT186, unaryopType.Not, actions.castExpr((nt!=null?((PythonTree)nt.tree):null))), root_1);\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1073:7: comparison[ctype]\n {\n root_0 = (PythonTree)adaptor.nil();\n\n pushFollow(FOLLOW_comparison_in_not_test4490);\n comparison187=comparison(ctype);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, comparison187.getTree());\n\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }",
"public Expression negate() {\n switch (operation) {\n case BOOLEAN:\n return SystemFunction.makeSystemFunction(\"not\", getArguments());\n case NOT:\n return SystemFunction.makeSystemFunction(\"boolean\", getArguments());\n case TRUE:\n return new Literal(BooleanValue.FALSE);\n case FALSE:\n default:\n return new Literal(BooleanValue.TRUE);\n }\n }",
"public BitNotExpression(Token operator, Expression expr)\n {\n super(operator, expr);\n }",
"public Object visit(UnaryNotExpr node)\n {\n node.getExpr().accept(this);\n this.support.genXor(\"$v0\", \"$v0\", 1);\n this.support.setLastInstrComment(\"Apply not operator to contents of $v0\");\n return null;\n }",
"protected Parser not() {\r\n\tTrack t = new Track(\"not\");\r\n\tt.add(new Literal(\"not\").discard());\r\n\tt.add(structure());\r\n\tt.setAssembler(new NotAssembler());\r\n\treturn t;\r\n}",
"public final CQLParser.relationalExpression_return relationalExpression() throws RecognitionException {\n CQLParser.relationalExpression_return retval = new CQLParser.relationalExpression_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n Token set91=null;\n CQLParser.notExpression_return notExpression90 = null;\n\n CQLParser.notExpression_return notExpression92 = null;\n\n\n Object set91_tree=null;\n\n errorMessageStack.push(\"Relational expression\"); \n try {\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:381:2: ( notExpression ( ( EQ | GE | LE | GT | LT ) notExpression )? )\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:381:4: notExpression ( ( EQ | GE | LE | GT | LT ) notExpression )?\n {\n root_0 = (Object)adaptor.nil();\n\n pushFollow(FOLLOW_notExpression_in_relationalExpression1767);\n notExpression90=notExpression();\n\n state._fsp--;\n\n adaptor.addChild(root_0, notExpression90.getTree());\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:381:18: ( ( EQ | GE | LE | GT | LT ) notExpression )?\n int alt24=2;\n int LA24_0 = input.LA(1);\n\n if ( ((LA24_0>=EQ && LA24_0<=LT)) ) {\n alt24=1;\n }\n switch (alt24) {\n case 1 :\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:381:19: ( EQ | GE | LE | GT | LT ) notExpression\n {\n set91=(Token)input.LT(1);\n set91=(Token)input.LT(1);\n if ( (input.LA(1)>=EQ && input.LA(1)<=LT) ) {\n input.consume();\n root_0 = (Object)adaptor.becomeRoot((Object)adaptor.create(set91), root_0);\n state.errorRecovery=false;\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n throw mse;\n }\n\n pushFollow(FOLLOW_notExpression_in_relationalExpression1783);\n notExpression92=notExpression();\n\n state._fsp--;\n\n adaptor.addChild(root_0, notExpression92.getTree());\n\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n errorMessageStack.pop();\n }\n \t\n \tcatch(RecognitionException re)\n \t{\t\n \t\treportError(re);\n \t\tthrow re;\n \t}\n finally {\n }\n return retval;\n }",
"public Object visitLogicalNegationExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n \n if (a instanceof Long) {\n return \"\" + ((((Long) a).equals(new Long(0))) ? 1 : 0);\n }\n else {\n return \"! \" + parens(a);\n }\n }\n else {\n BDD a = ensureBDD(dispatch(n.getGeneric(0)));\n BDD bdd;\n \n bdd = a.not();\n \n a.free();\n \n return bdd;\n }\n }",
"@Override\r\n\tpublic Object visit(BoolNot node, Object param) {\r\n\t\tnode.getExpression().accept(this, param);\r\n\t\tthis.cg.not();\r\n\t\treturn param;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n public static <T, R> ExpressionNode<T, R> negate(final ExpressionNode<T, R> expression)\n {\n Objects.requireNonNull(expression, Errors.VALIDATION.CHILD_EXPRESSION_NULL);\n if (expression instanceof NumberLiteralExpression)\n {\n final NumberLiteralExpression<T> numberLiteralExpression = (NumberLiteralExpression<T>) expression;\n final Number number = numberLiteralExpression.get();\n if (number == null)\n {\n return new NullLiteralExpression<>();\n }\n return (ExpressionNode<T, R>) new NumberLiteralExpression<T>(NumberConverter.narrow(BigDecimal.ZERO.subtract(new BigDecimal(number.toString()))));\n }\n throw QueryParsingException.of(Errors.NEGATION.NOT_SUPPORTED, StringUtils.getClassName(expression));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert new item to item_in_catalog table and create item id by max value in the table | public static void insertNewItemInCatalog(Msg msg1, Connection conn, ConnectionToClient client) {
Msg msg = (Msg) msg1;
Item_In_Catalog tmp = (Item_In_Catalog) msg1.newO;
PreparedStatement ps,ps1;
ResultSet rs,rs1;
int new_id;
try {
/* get the last ID of sale */
ps = conn.prepareStatement("SELECT max(ID) FROM item_in_catalog;");
rs = ps.executeQuery();
rs.next();
/* execute the insert query */
ps = conn.prepareStatement("INSERT INTO item_in_catalog (ID, Name, Price, Description, Status)" + " VALUES (?, ?, ?, ?, ?)");
new_id = Integer.parseInt(rs.getString(1)) + 1;
ps.setString(1, "" + new_id); // insert the last id + 1
ps.setString(2, tmp.getName());
ps.setString(3, ""+tmp.getPrice());
ps.setString(4, tmp.getDescription());
ps.setString(5, "Active");
ps.executeUpdate();
tmp.setID(""+new_id);
tmp.getImage().setFileName(tmp.getID()+".jpg");
CreateImage(tmp.getImage());
System.out.println(tmp.getImage());
msg.newO = tmp;
ps=conn.prepareStatement("SELECT * FROM store GROUP BY ID");
rs=ps.executeQuery();
while(rs.next()) {
ps1 = conn.prepareStatement("INSERT INTO store (ID, Location, Open_Hours, Manager_ID, Item_ID, Type, Amount)" + " VALUES (?, ?, ?, ?, ?,'Catalog',0)");
ps1.setString(1, rs.getString(1));
ps1.setString(2, rs.getString(2));
ps1.setString(3, rs.getString(3));
ps1.setString(4, rs.getString(4));
ps1.setString(5, tmp.getID());
ps1.executeUpdate();
}
client.sendToClient(msg);
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} | [
"private void updateCatalogId() throws TranslationException\n {\n\tString sql = \"SELECT MAX(id) FROM \" + PropertyLookup.getCatalogsTableName();\n\ttry\n\t{\n\t sqlConnector.closeConnection();\n\t ResultSet result = sqlConnector.executeQuery(sql);\n\n\t // We assume the last id added is the id of our catalog.\n\t // If the table is empty something went wrong.\n\t if(result.first())\n\t\tcatalogId = result.getInt(1);\n\t else\n\t\tthrow new TranslationException(\"Error retrieving the catalog id\");\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error retrieving the catalog id\", e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }",
"private long calculateItemID() {\n\t\tString query = \"SELECT ItemID FROM awsdb.Items ORDER BY ItemID DESC LIMIT 1\";\n\t\t\n\t\tConnection connect = pool.getConnection();\n\t\tlong itemID;\n\t\ttry {\n\t\t\tStatement stmt = connect.createStatement();\n\t\t\tResultSet result = stmt.executeQuery(query);\n\t\t\t//If the set is empty (should only happen once, ever)\n\t\t\tif (!result.next())\n\t\t\t\titemID = 1;\n\t\t\telse {\n\t\t\t\titemID = result.getLong(\"ItemID\");\n\t\t\t\t//Add one to itemID\n\t\t\t\titemID += 1;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\titemID = 1;\n\t\t}\n\t\t\n\t\t//Close connection\n\t\tpool.closeConnection(connect);\n\t\t\n\t\treturn itemID;\n\t}",
"public void insertCrossSellingSelectedItem(String mainId, CrossSellingProductsItem item) {\n CrossSellingSelectedItem selectedItem = new CrossSellingSelectedItem();\n selectedItem.setMainProductId(mainId);\n selectedItem.setProductId(item.getIdProduct());\n selectedItem.setFree(item.isFree());\n selectedItem.setProductName(item.getName());\n selectedItem.setProductPrice(item.getPriceHt());\n\n CrossSellingSelectedItem existItem = crossSellingSelectedItemBox.query()\n .equal(CrossSellingSelectedItem_.mainProductId, mainId)\n .and()\n .equal(CrossSellingSelectedItem_.productId, item.getIdProduct())\n .build()\n .findFirst();\n\n if (existItem == null) {\n selectedItem.setProductCount(1);\n crossSellingSelectedItemBox.put(selectedItem);\n } else {\n existItem.setProductCount(existItem.getProductCount() + 1);\n crossSellingSelectedItemBox.put(existItem);\n }\n }",
"public int insert(long id, Money price, java.util.List<Long> list) {\n\n Product obj = items.get(id);\n int flag;\n\n // if the id is not present in items\n if (obj == null) {\n items.put(id, new Product(id, price, list));\n flag = 1;\n }\n\n // if this id already exists in items\n else {\n\n if (list.size() != 0) {\n // as the description list is updated in this case, deleting ids from the list\n // which is mapped to this id in desc_list\n List<Long> description = obj.description;\n for (long desc : description) {\n desc_list.get(desc).remove(id);\n }\n\n // updated the description list\n obj.description = list;\n obj.price = price;\n }\n\n flag = 0;\n obj.price = price;\n }\n\n // fetching the object associated with id if it already exists for updating\n // price and desc_list\n if (list.size() != 0) {\n\n List<Long> description = items.get(id).description;\n if (description != null) {\n\n for (long desc : description) {\n\n if (desc_list.get(desc) == null) {\n desc_list.put(desc, new HashSet<Long>());\n }\n desc_list.get(desc).add(id);\n }\n\n\n }\n }\n\n // if flag == 1, new item is added\n if (flag == 1) {\n return 1;\n }\n\n // function will return zero when flag is 0\n return 0;\n\n }",
"public int addItemProdCatalog(Product prod)\n {\n //insert into prodcatalog (upc, description, unitprice) values ('5', 'Unleaded 5', '52.29')\n String query=\"insert into prodcatalog (upc, description, unitprice) values (\";\n \n query+=\"'\" + prod.getUPC() + \"', '\" + prod.getDesciption() + \"', '\" + prod.getPrice() + \"')\";\n \n String query2=\"insert into currbalance (upc, balance) values (\" + prod.getUPC() + \", 0)\";\n \n try {\n this.statement = connection.createStatement();\n \n statement.executeUpdate(query);\n statement.executeUpdate(query2);\n \n statement.close();\n \n }\n catch ( SQLException sqlex ) {\n sqlex.printStackTrace(); \n return -5;\n } \n return 1; \n }",
"public int insert(long key, String val, int index, int k, int tableSize){\n\t\tint result = -1;\n\t\tBDHopItem targetItem = new BDHopItem(new Item(key, new Value(val)), k); \n\t\t//new instance to be inserted\n\t\tBDHopItem curItem = bdTable.get(index); \n\t\t\n\t\ttargetItem.setBitmapPosition(0); //set not-empty bit for target BDHopItem\n\t\tif(curItem == null || curItem.isEmpty()){ \n\t\t\t//if current bucket is not initialized \n\t\t\t//or empty indicated by its bitmap status\n\t\t\tbdTable.put(index, targetItem);\n\t\t\tresult = 0;\n\t\t\t\n\t\t\t//for test\n\t\t\t//System.out.println(\"empty insert index: \" + index + \" with item: \" + targetItem);\t\t\t\n\t\t}else if(curItem.equals(targetItem)){//for duplicate item\n\t\t\tresult = 2;\n\t\t\t/*System.out.println(\"key: \" + targetItem.getItem().getKey() + \" with value: \"\n\t\t\t\t\t+ targetItem.getItem().getValue().getVal());\n\t\t\tSystem.out.println(\"current key: \" + curItem.getItem().getKey() + \" with value: \"\n\t\t\t\t\t+ curItem.getItem().getValue().getVal());*/\n\t\t}else{//current not available, check its next available bucket in the probing sequence.\n\t\t\tif(!curItem.hasNext()){\n\t\t\t\tint nextIndex = probeNext(getNextSeqByLinear(index, k),tableSize); \n\t\t\t\t//index for colliding item to be inserted\n\t\t\t\tif(nextIndex != -1){//available\n\t\t\t\t\tcurItem.setBitmapPosition(1); //set current's colliding bit\n\t\t\t\t\t\n\t\t\t\t\tint pos1 = getPos(nextIndex-index, k , tableSize);\n\t\t\t\t\tcurItem.setBitmapBlock(k, pos1, true); \n\t\t\t\t\t//set current's bitmap for colliding item's relative position\n\t\t\t\t\tint pos2 = getPos(index-nextIndex, k, tableSize);\n\t\t\t\t\ttargetItem.setBitmapBlock(k, pos2, false); \n\t\t\t\t\t//set next's bitmap for previous (current)\n\t\t\t\t\ttargetItem.setBitmapPosition(2);\t\t\t\t\t\n\t\t\t\t\tbdTable.put(nextIndex, targetItem);\n\t\t\t\t\tresult = 1;\n\t\t\t\t\tcolCounter++; //increment the counter for inserted colliding elements\n\t\t\t\t\t\n\t\t\t\t\t//for test\n\t\t\t\t\t//System.out.println(\"collide index: \" + nextIndex + \" with item: \" + targetItem);\n\t\t\t\t\t//System.out.println(\"current index: \" + index + \" with item: \" + curItem);\n\t\t\t\t}else{\n\t\t\t\t\tresult = -2; //neighborhood full\n\t\t\t\t}\n\t\t\t}else\n\t\t\t\tfailCounter++; //increment the counter for failed (dropped) elements\t\t\t\n\t\t}\t\t\n\t\treturn result;\n\t}",
"@Insert({\n \"insert into ty_entity_item (entity_id, item_name, \",\n \"item_col, sort, format)\",\n \"values (#{entityId,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, \",\n \"#{itemCol,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{format,jdbcType=VARCHAR})\"\n })\n @SelectKey(statement=\"SELECT LAST_INSERT_ID()\", keyProperty=\"id\", before=false, resultType=Integer.class)\n int insert(TyEntityItem record);",
"public Long addToItemStore(String itemKey, Item item);",
"public void insertOrderedItems(TireList orderedItems){\n for(int i=0; i<orderedItems.listSize(); i++){\n int temp = Integer.parseInt(orderedItems.getTire(i).getStock()) - orderedItems.getTire(i).getQuantity();\n orderedItems.getTire(i).setStock(temp + \"\");\n orderedItems.getTire(i).updateTire();\n sql=\"Insert into OrderedItems (OrderID, TireID, Quantity) VALUES ('\"+newID+\"','\"+orderedItems.getTire(i).getStockID()+\"',\"+orderedItems.getTire(i).getQuantity()+\")\";\n db.insertDB(sql); \n }\n }",
"public int add(Item item) {\r\n Transaction trans = null;\r\n Session session = HibernateUtil.getSessionFactory().openSession();\r\n int id = 0;\r\n\r\n try {\r\n trans = session.beginTransaction();\r\n\r\n id = (int) session.save(item);\r\n\r\n trans.commit();\r\n } catch (HibernateException e) {\r\n if (trans != null) {\r\n trans.rollback();\r\n }\r\n e.printStackTrace();\r\n } finally {\r\n session.close();\r\n }\r\n return id;\r\n }",
"public gov.nih.nlm.ncbi.www.ArticleIdDocument.ArticleId insertNewArticleId(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.ArticleIdDocument.ArticleId target = null;\r\n target = (gov.nih.nlm.ncbi.www.ArticleIdDocument.ArticleId)get_store().insert_element_user(ARTICLEID$0, i);\r\n return target;\r\n }\r\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Override\t\n public int getNewCourseID() { \n \n String hql = \"SELECT max(course_id) FROM Course\";\n Query query = sessionFactory.getCurrentSession().createQuery(hql);\n List<Integer> Id = query.list();\n \n int curID =1;\n \n if (!(Id.get(0)==null)){\n curID = Id.get(0) +1 ; \n }\n \n return curID; \n }",
"public int insert(long id, double price, long[] description, int size) {\n\t\tboolean present = false;//to check whether the id already present or not.\n\t\n\t\t\n\t\tList<Long> descriptions = new ArrayList<>();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tdescriptions.add(description[i]);\n\t\t}\n\t\tprice = Math.floor((price+0.000001)*100)/100;\n\t\tProduct product = new Product(id, descriptions, price);\n\t\t// Get the oldNode from the tree\n\t\tProduct oldProduct = idMap.get(id);\n\t\tboolean isContinue = false;\n\t\tif (oldProduct != null) {\n\t\t\t// New Entry\n\t\t\tpresent = true;\n\t\t}\n\t\tif (descriptions.isEmpty() && present) {\n\t\t\t//new description list for existing item.update the price and continue.\n\t\t\n\t\t\t\n\t\t\toldProduct.price = price;\n\n\t\t\tproduct = oldProduct;\n\n\t\t\tisContinue = true;\n\n\t\t}\n\t\tif (!isContinue) {\n\t\t\t//if the item already present and desc list is not empty then\n\t\t\tif (present) {\n //retrieve the description list.\n\t\t\t\tList<Long> descriptionList = oldProduct.descList;\n\t\t\t\t\n\t\t\t\tfor (Long name : descriptionList) {\n\t\t\t\tDescNode desc = descMap.get(name);\n\t\t\t\t\tdesc.descList.remove(oldProduct);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\toldProduct.price = price;\n\t\t\t\toldProduct.descList = product.descList;\n\t\t\t\tproduct = oldProduct;//update the contents of old product and assign to product.\n\n\t\t\t} else {\n\t\t\t\t// Its a new product. Put the new product to IdTreeMap.\n\t\t\t\tidTree.put(id, product);\n\t\t\t\tidMap.put(id, product);\n\t\t\t}\n\n\t\t\t// if desc already present add it to the existing list or create a new map with desc as key.\n\t\t\tfor (long desc : descriptions) {\n\t\t\t\tDescNode descList = descMap.get(desc);\n\t\t\t\tif (descList != null) {\n\t\t\t\t\t// description already present.\n\t\t\t\t\tList<Product> prodList = descList.descList;\n\t\t\t\t\tprodList.add(product);\n\t\t\t\t} else {\n\t\t\t\t\t//new description.\n\t\t\t\t\tdescList = new DescNode(product);\n\t\t\t\t\tdescMap.put(desc, descList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!present) {\n\t\t\t//new\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t//already present.\n\t\t\treturn 0;\n\t\t}\n\t}",
"public void increaseHighestCategoryID(int userID) {\n try {\n PreparedStatement statement = connection.prepareStatement(INCREASE_HIGHEST_CATEGORY_ID);\n statement.setInt(1, userID);\n statement.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public FetchRequest insert(final FetchRequest item) throws DatabaseException {\n Long id = queue.execute(new SQLiteJob<Long>() {\n @Override\n protected Long job(SQLiteConnection connection) throws SQLiteException {\n SQLiteStatement st = connection.prepare(createInsertString(item));\n \n try {\n st.stepThrough();\n } finally {\n st.dispose();\n }\n \n return connection.getLastInsertId();\n }\n }).complete();\n \n if (id == null){\n throw new DatabaseException(\"Inserting fetch request failed.\");\n }\n \n item.setId(id);\n return item;\n }",
"@Insert({\n \"insert into pms_base_catalog3 (name, catalog2_id)\",\n \"values (#{name,jdbcType=VARCHAR}, #{catalog2Id,jdbcType=BIGINT})\"\n })\n @Options(useGeneratedKeys=true,keyProperty=\"id\")\n int insert(BaseCatalog3 record);",
"public int saveItem(Item item) throws SQLException;",
"public int insert(long id, Money newPrice, java.util.List<Long> list) {\n\t\t\n\t\t// Check if Item with the same id already exits\n\t\tif (pTree.containsKey(id)) {\n\t\t\t\n\t\t\t// When list is not null AND the list is not empty ~(A v B) = ~A ^ ~B \n\t\t\tif (!(list == null || list.isEmpty())) {\n\t\t\t\t\n\t\t\t\t// 1a. removing the connections of old descriptions from dMap\n\t\t\t\tdeleteDMap(id);\n\t\t\t\t\n\t\t\t\t// 1b. removing the old descriptions of that Item from pTree \n\t\t\t\tpTree.get(id).description.clear();\n\t\t\t\t\n\t\t\t\t// 2. Inserting new descriptions of that Item in pTree\n\t\t\t\tfor (Long e: list) { \n\t\t\t\t\tpTree.get(id).description.add(e); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// 3. and inserting this item for it's new descriptions into dMap \n\t\t\t\tinsertDMap(id);\n\t\t\t\t\n\t\t\t\t// While creating new TreeSet, we'll define our own ordering\n\t\t\t\t/*\n\t\t\t\tTreeSet<Item> newTreeSet = new TreeSet<Item>(\n\t\t\t\t\t// ordering that is on Item.price (Money) and different id's\n\t\t\t\t\tnew Comparator<Item>() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic int compare(Item o1, Item o2) {\n\t\t\t\t\t\t\t// comparison of prices\n\t\t\t\t\t\t\tint result = o1.price.compareTo(o2.price);\n\n\t\t\t\t\t\t\t// if same priced items, we'll compare id's\n\t\t\t\t\t\t\tif (result == 0)\n\t\t\t\t\t\t\t\treturn o1.id.compareTo(o2.id);\n\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t*/\n\t\t\t}\n\t\t\t// Now, updating the price with newPrice in pTree\n\t\t\tpTree.get(id).price = newPrice;\n\t\t\t\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Create new Item\n\t\tItem newItem = new Item(id, newPrice, list);\n\t\t\n\t\t// Update pTree\n\t\tpTree.put(id, newItem);\n\t\t\n\t\t// insert the whole new item into the dMap\n\t\tinsertDMap(id);\n\t\t\n\t\tsize++;\n\t\treturn 1;\n\t}",
"public Builder setMaxItemID(int maxItemID) {\n this.maxItemID = maxItemID;\n return this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to select login certificates in PRODVIP environment after BN menu navigation | public static void selectCertAfterMenuNavigation(){
try {
try{
Alert alert = driver.switchTo().alert();
alert.accept();
//Added the below code to select the certificate pop-up displayed after the menu navigation
LPLCoreDriver.selectCertificate();
}catch(Exception ex){
LPLCoreDriver.selectCertificate();
}finally{
//driver.switchTo().window(parentWindowHandle);
driver.switchTo().defaultContent();
}
} catch (Exception e) {
System.out.println("Certificate Not found");
}
} | [
"public static void selectCertificate(){\r\n\t\ttry{\r\n\t\t\t/** \r\n\t\t\t * \tHandle Login Certificates in PRODVIP Environment for BranchNet Application \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t */\r\n\t\t\tif((ocfg.getEnvironment().toUpperCase().contains(\"PROD\") || ocfg.getEnvironment().toUpperCase().contains(\"PRD\")) && (ocfg.getProductId()==intBranchNetProductID) &&(ocfg.getFirmId()==intLPLFirmID)){\r\n\t\t\t\t//String to hold certificate name\r\n\t\t\t\tString strCertName = null;\r\n\t\t\t\t\r\n\t\t\t\t//Select different certificate names as per the UserName\r\n\t\t\t\tswitch(loginCredentials.get(\"Username\").toLowerCase().trim()){\r\n\t\t\t\t\tcase \"darwinv.lpl2\":\r\n\t\t\t\t\t\tstrCertName = \"lpl2\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"darwinv.lpladv3a\":\r\n\t\t\t\t\t\tstrCertName = \"lpladv3a\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"darwin.villaruz\":\r\n\t\t\t\t\t\tstrCertName = \"emp\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tLPLCoreReporter.WriteReport(\"Username verification for certificate selection.\", \"Username verification should be successful\",\"Username:[\"+loginCredentials.get(\"Username\")+\"] not matched for any Certificate.\", LPLCoreConstents.FAILED, \"\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Create the Certificate selection windows command to execute the AutoIT exe file.\r\n\t\t\t\t * Sample command: String[] command = {\"cmd.exe\", \"/C\", \"Start\", \"C:\\\\Automation\\\\SelectCertificate.exe\", \"lpl2\"};\r\n\t\t\t\t */\r\n\t\t\t\tString strCertCommand = LPLCoreConstents.getInstance().strCertCommand+ \",\" + strCertName;\r\n\t\t\t\tString[] strCertSelectionCommand = strCertCommand.split(\",\");\r\n\t\t\t\t\r\n\t\t\t\t//Create JAVA Runtime class to execute the windows command to execute the AutoIT exe file to select the required Certificate\r\n\t\t\t\tRuntime runtime = Runtime.getRuntime();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tProcess process = runtime.exec(strCertSelectionCommand);\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tint value = process.waitFor();\r\n\t\t\t\t\t\tif(value!=0)\r\n\t\t\t\t\t\t\tLPLCoreReporter.WriteReport(\"Cert selection Command Execution Process\", \"Cert selection Command Execution Process should be successful\",\"Cert selection Command Execution Process terminated abnormally.\", LPLCoreConstents.FAILED, \"\");\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tLPLCoreSync.staticWait(LPLCoreConstents.getInstance().BaseInMiliSec);\r\n\t\t\t\tLPLCoreReporter.WriteReport(\"Certificate Selection\", \"Certificate Selection should be successful\",\"Certificate selected successfully for User:[.\"+loginCredentials.get(\"Username\")+\"]\", LPLCoreConstents.PASSED, \"\");\r\n\t\t\t}\r\n\t\t}catch(Exception ex){\r\n\t\t\tSystem.out.println(\"Certificate Not found!!!\");\r\n\t\t}\r\n\t}",
"public void selectLogin() {\n\t\ttry {\n\t\t\tclickableWait(Elements.loginButton);\n\t\t\tlog.info(\"Login option selected\");\n\t\t\textTestObj.createNode(\"Login option selected\").pass(\"PASSED\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Login option not selected\");\n\t\t\textTestObj.createNode(\"Login option not selected\")\n\t\t\t\t\t.fail(\"Method Name : \" + Thread.currentThread().getStackTrace()[1].getMethodName() + \"()\").error(e);\n\t\t\tlog.error(e.getMessage());\n\n\t\t\tstopTest();\n\t\t}\n\t}",
"liubaninc.m0.pki.CertificatesOuterClass.Certificates getCertificates(int index);",
"private void viewCertificate() {\n\t\tint selectedRow = -1;\n\t\tString alias = null;\n\t\tX509Certificate certToView = null;\n\t\tArrayList<String> serviceURIs = null;\n\t\tKeystoreType keystoreType = null;\n\n\t\t// Are we showing user's public key certificate?\n\t\tif (keyPairsTab.isShowing()) {\n\t\t\tkeystoreType = KEYSTORE;\n\t\t\tselectedRow = keyPairsTable.getSelectedRow();\n\n\t\t\tif (selectedRow != -1)\n\t\t\t\t/*\n\t\t\t\t * Because the alias column is not visible we call the\n\t\t\t\t * getValueAt method on the table model rather than at the\n\t\t\t\t * JTable\n\t\t\t\t */\n\t\t\t\talias = (String) keyPairsTable.getModel().getValueAt(selectedRow, 6); // current entry's Keystore alias\n\t\t}\n\t\t// Are we showing trusted certificate?\n\t\telse if (trustedCertificatesTab.isShowing()) {\n\t\t\tkeystoreType = TRUSTSTORE;\n\t\t\tselectedRow = trustedCertsTable.getSelectedRow();\n\n\t\t\tif (selectedRow != -1)\n\t\t\t\t/*\n\t\t\t\t * Get the selected trusted certificate entry's Truststore alias\n\t\t\t\t * Alias column is invisible so we get the value from the table\n\t\t\t\t * model\n\t\t\t\t */\n\t\t\t\talias = (String) trustedCertsTable.getModel().getValueAt(\n\t\t\t\t\t\tselectedRow, 5);\n\t\t}\n\n\t\ttry {\n\t\t\tif (selectedRow != -1) { // something has been selected\n\t\t\t\t// Get the entry's certificate\n\t\t\t\tcertToView = dnParser.convertCertificate(credManager\n\t\t\t\t\t\t.getCertificate(keystoreType, alias));\n\n\t\t\t\t// Show the certificate's contents to the user\n\t\t\t\tViewCertDetailsDialog viewCertDetailsDialog = new ViewCertDetailsDialog(\n\t\t\t\t\t\tthis, \"Certificate details\", true, certToView,\n\t\t\t\t\t\tserviceURIs, dnParser);\n\t\t\t\tviewCertDetailsDialog.setLocationRelativeTo(this);\n\t\t\t\tviewCertDetailsDialog.setVisible(true);\n\t\t\t}\n\t\t} catch (CMException cme) {\n\t\t\tString exMessage = \"Failed to get certificate details to display to the user\";\n\t\t\tlogger.error(exMessage, cme);\n\t\t\tshowMessageDialog(this, exMessage, ERROR_TITLE, ERROR_MESSAGE);\n\t\t}\n\t}",
"public void selectSignturies()\n\t{\n\t\tselectSign1();\n\t\tselectSign2();\n\t\tclickOnNext();\n\t}",
"private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {\n filter1 = new FileNameExtensionFilter(\"pem, crt, cer, der\", \n new String[] { \"pem\",\"crt\",\"cer\", \"der\" });\n CertChooser(jTextField2, filter1);\n }",
"public PesquisarCertificados() {\n initComponents();\n Atualizar.doClick();\n }",
"public void actionPerformed(ActionEvent e) \n {\n\tint i = certList.getSelectedIndex();\n\t\n\t//if (i < 0)\n\t// return;\n\t \t \n\t// Changed the certificate from the active set into the \n\t// inactive set. This is for removing the certificate from\n\t// the store when the user clicks on Apply.\n\t//\n\tString alias = (String) certList.getSelectedValue();\n\n\tif (e.getSource()==removeButton) \n\t{\t \t\t\n\t // Changed the certificate from the active set into the \n\t // inactive set. This is for removing the certificate from\n\t // the store when the user clicks on Apply.\n\t //\n\t if (getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n \t model.deactivateCertificate(alias);\n\t else\n\t model.deactivateHttpsCertificate(alias);\n\n\t reset();\n\t}\n\telse if (e.getSource() == viewCertButton) \n\t{\n\t X509Certificate myCert = null;\n\n\t if (getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n\t\tmyCert = (X509Certificate) model.getCertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SecureSite_value\")) \n\t\tmyCert = (X509Certificate) model.getHttpsCertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SignerCA_value\")) \n\t\tmyCert = (X509Certificate) model.getRootCACertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SecureSiteCA_value\")) \n\t\tmyCert = (X509Certificate) model.getHttpsRootCACertificate(alias);\n\n\t X509Certificate[] certs = new X509Certificate[] {myCert};\n\n\t // Make sure the certificate has been stored or in the import HashMap.\n\t if (certs.length > 0 && certs[0] instanceof X509Certificate)\n\t {\n \tCertificateDialog dialog = new CertificateDialog(this, certs, 0, certs.length);\n \t \tdialog.DoModal();\t\t\t\n\t }\n\t else \n\t {\n\t\t// The certificate you are trying to view is still in Import HashMap\n\t\tX509Certificate impCert = null;\n\n\t\tif (getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n\t\t impCert = model.getImpCertificate(alias);\n\t\telse\n\t\t impCert = model.getImpHttpsCertificate(alias);\n\t\n\t X509Certificate[] impCerts = new X509Certificate[] {impCert};\n \tCertificateDialog impDialog = new CertificateDialog(this, impCerts, 0, impCerts.length);\n \t \timpDialog.DoModal();\t\t\t\n\t }\n\t}\n\telse if (e.getSource() == importButton)\n\t{\n\t // Popup FileChooser\n\t JFileChooser jfc = new JFileChooser();\n\n\t // Set filter for File Chooser Dialog Box\n\t CertFileFilter impFilter = new CertFileFilter(); \n\t impFilter.addExtension(\"csr\");\n\t impFilter.addExtension(\"p12\");\n\t impFilter.setDescription(\"Certificate Files\");\n\t jfc.setFileFilter(impFilter);\n \n\t jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n\t jfc.setDialogType(JFileChooser.OPEN_DIALOG);\n\t jfc.setMultiSelectionEnabled(false);\n\t int result = jfc.showOpenDialog(this);\n\t if (result == JFileChooser.APPROVE_OPTION)\n\t {\n\t\tFile f = jfc.getSelectedFile();\n\t\tif (f == null) return;\n\n\t\ttry\n\t\t{\n\t\t InputStream inStream = System.in;\n\t\t inStream = new FileInputStream(f);\n\n\t\t // Import certificate from file to deployment.certs\n\t\t boolean impStatus = false;\n\t\t impStatus = importCertificate(inStream);\n\t\t\t\n\t\t // Check if it is belong to PKCS#12 format\n\t\t if (!impStatus)\n\t\t {\n\t\t\t// Create another inputStream for PKCS#12 foramt\n\t\t InputStream inP12Stream = System.in;\n\t\t inP12Stream = new FileInputStream(f);\n\t\t importPKCS12Certificate(inP12Stream);\n\t\t }\n\t\t}\n\t\tcatch(Throwable e2)\n\t\t{\n\t\t DialogFactory.showExceptionDialog(this, e2, getMessage(\"dialog.import.file.text\"), \n\t\t\t\t\t\t getMessage(\"dialog.import.error.caption\"));\n\t\t}\n\t }\n\n\t reset();\n\t}\n\telse if (e.getSource() == exportButton)\n\t{\n\t X509Certificate cert = null;\n\n\t if (getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n\t\tcert = (X509Certificate) model.getCertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SecureSite_value\")) \n\t\tcert = (X509Certificate) model.getHttpsCertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SignerCA_value\")) \n\t\tcert = (X509Certificate) model.getRootCACertificate(alias);\n\t else if (getRadioPos() == mh.getMessage(\"SecureSiteCA_value\")) \n\t\tcert = (X509Certificate) model.getHttpsRootCACertificate(alias);\n\n\t // Make sure the certificate has been stored, if not, get from import table.\n\t if (!(cert instanceof X509Certificate))\n\t {\n\t\t// The certificate you are trying to export is still in Import HashMap\n\t\tif (getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n\t\t cert = model.getImpCertificate(alias);\n\t\telse\n\t\t cert = model.getImpHttpsCertificate(alias);\n\n\t } //not saved certificate \n\n\t if (cert != null)\n\t {\n\t // Popup FileChooser\n\t JFileChooser jfc = new JFileChooser();\n\t jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n\t jfc.setDialogType(JFileChooser.SAVE_DIALOG);\n\t jfc.setMultiSelectionEnabled(false);\n\t int result = jfc.showSaveDialog(this);\n\t if (result == JFileChooser.APPROVE_OPTION)\n\t {\n\t\tFile f = jfc.getSelectedFile();\n\t\tif (f == null) return;\n\t\tPrintStream ps = null;\n\t\ttry {\n\t\t ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(f)));\n\t\t exportCertificate(cert, ps);\n\t\t}\n\t\tcatch(Throwable e2) \n\t\t{\n\t\t DialogFactory.showExceptionDialog(this, e2, getMessage(\"dialog.export.text\"), \n\t\t\t\t\t\t getMessage(\"dialog.export.error.caption\"));\n\t\t}\n\t\tfinally {\n\t\t if (ps != null)\n\t\t\tps.close();\n\t\t}\n\t }\n\t } // Cert not null\n\t else {\n\t\tDialogFactory.showErrorDialog(this, getMessage(\"dialog.export.text\"), getMessage(\"dialog.export.error.caption\"));\n\t }\n\t}\n }",
"public boolean clickOnContinueCertificationError()\r\n\t{\r\n\t\tLPLConfig ocfg = new LPLConfig();\r\n\t\tboolean status=false;\r\n\t\tif(ocfg.getBrowserType().equalsIgnoreCase(\"IE\") || ocfg.getBrowserType().equalsIgnoreCase(\"iexplore\"))\r\n\t\t{\r\n\t\t\thomePage.switchTo(\"Window\",\"Certificate Error\");\r\n\t\t\ttry{\r\n\t\t\t\tif(driver.findElements(By.id(\"overridelink\")).size()>0)\r\n\r\n\t\t\t\t\tdriver.findElement(By.id(\"overridelink\"));\r\n\t\t\t\tstatus= true;\r\n\t\t\t\tif(status)\r\n\t\t\t\t\tdriver.findElement(By.id(\"overridelink\")).click();\r\n\t\t\t}catch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}else \r\n\t\t\tstatus=true;\r\n\t\treturn status;\r\n\t}",
"Certificate get(KeyStoreChooser keyStoreChooser, CertificateChooserByAlias certificateChooserByAlias);",
"private List<String> getSessionCertEntry(String propName)\n {\n List<String> entry = sessionAllowedCertificates.get(propName);\n if (entry == null)\n {\n entry = new LinkedList<String>();\n sessionAllowedCertificates.put(propName, entry);\n }\n return entry;\n }",
"public void selectButtonCoursePaymentPage() {\r\n\t\tisElementDisplayed(\"lnk_takeMeToMyCourse\");\r\n\t\telement(\"lnk_takeMeToMyCourse\").click();\r\n\t\tlogMessage(\"Button on Course Payment Page selected !!\");\r\n\t\tchangeWindow(1);\r\n\t\twait.hardWait(4);\r\n\t\tif (!isElementNotDisplayed(\"btn_enterCnowv2Anyway\")) {\r\n\t\t\telement(\"btn_enterCnowv2Anyway\").click();\r\n\t\t\twait.hardWait(2);\r\n\t\t\telement(\"btn_resumeAssignmentNo\").click();\r\n\t\t\tlogMessage(\"Enter Cnow v2 Anyway button clicked and not resuming the last assignment\");\r\n\t\t} else if (!isElementNotDisplayed(\"btn_resumeAssignmentNo\")) {\r\n\t\t\tclick(element(\"btn_resumeAssignmentNo\"));\r\n\t\t}\r\n\t}",
"@Override\n protected SecurityDomain[] getSecurityDomains() throws Exception {\n final SecurityDomain sd = new SecurityDomain.Builder().name(CertificateRolesLoginModuleTestCase.SECURITY_DOMAIN_CERT).loginModules(new SecurityModule.Builder().name(CertRolesLoginModule.class.getName()).putOption(\"securityDomain\", CertificateRolesLoginModuleTestCase.SECURITY_DOMAIN_JSSE).putOption(\"password-stacking\", \"useFirstPass\").putOption(\"rolesProperties\", \"roles.properties\").build()).build();\n final SecurityDomain sdJsse = // \n new SecurityDomain.Builder().name(CertificateRolesLoginModuleTestCase.SECURITY_DOMAIN_JSSE).jsse(// \n new JSSE.Builder().trustStore(new SecureStore.Builder().type(\"JKS\").url(AbstractCertificateLoginModuleTestCase.SERVER_TRUSTSTORE_FILE.toURI().toURL()).password(KEYSTORE_PASSWORD).build()).build()).build();\n return new SecurityDomain[]{ sdJsse, sd };\n }",
"public void clickAttachCert() {\r\n\t\tattachCert.click();\r\n\t}",
"void reset() {\n\n\tCollection certs = null;\n\n\tif ( getRadioPos() == mh.getMessage(\"SignedApplet_value\"))\n\t certs = model.getCertificateAliases();\n\telse if ( getRadioPos() == mh.getMessage(\"SecureSite_value\"))\n\t certs = model.getHttpsCertificateAliases();\n\telse if ( getRadioPos() == mh.getMessage(\"SignerCA_value\"))\n\t certs = model.getRootCACertificateAliases();\n\telse if ( getRadioPos() == mh.getMessage(\"SecureSiteCA_value\"))\n\t certs = model.getHttpsRootCACertAliases();\n\n\tif (certs == null || certs.size() == 0)\n\t{\n\t certList.setListData(new String[0]);\n\t}\n\telse\n\t{\n\t // Construct a TreeSet object to sort the certificate list\n TreeSet tsCerts = new TreeSet(certs);\n\n\t // Fill up list box with the sorted certificates\n\t certList.setListData(tsCerts.toArray());\n\t}\n\n\t// Make sure we do have content in certificate\n\tboolean enable = (certs != null && certs.size() > 0);\n\n\t// For Root CA and Web Sites, only enable View button\n\tif (getRadioPos() == mh.getMessage(\"SignerCA_value\") || \n\t\tgetRadioPos() == mh.getMessage(\"SecureSiteCA_value\"))\n\t{\n\t setEnabled(removeButton, false);\n\t setEnabled(exportButton, false);\n\t setEnabled(importButton, false);\n\t setEnabled(viewCertButton, enable);\n\t}\n\telse\n\t{\n\t setEnabled(removeButton, enable);\n\t setEnabled(exportButton, enable);\n\t setEnabled(importButton, true);\n\t setEnabled(viewCertButton, enable);\n\t}\n\n\tif (enable)\n\t certList.setSelectedIndex(0);\n }",
"private ByteArrayOutputStream get_certificates() {\n System.out.println(\"extracting certicates...\");\n // String[] parms = { \"print\", \"--url=https://www.google.com\", \"-f\", \"pem\" };\n String[] parms = this.ripperArgs.toArray(new String[ripperArgs.size()]);\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n PrintStream ps = new PrintStream(baos);\n PrintStream old = System.out;\n System.setOut(ps);\n nl.altindag.ssl.App.main(parms);\n System.out.flush();\n System.setOut(old);\n\n return baos;\n }",
"final void loginAsDDUser() {\n\t\tPage_ viewContactPage = createPage(\"PAGE_VIEW_CONTACT_PROPERTIES_FILE\");\r\n\t\tcommonPage.clickAndWait(\"tabContacts\", \"newButton\");\r\n\t\tsearch(testProperties.getConstant(\"CONTACT_CSN\"));\r\n\t\t\r\n\t\t//We search the results on Account CSN to get the contact we want; we don't search on the contact name itself\r\n\t\t// because there are often duplicate names\r\n\r\n\t\t//commonPage.clickLinkInRelatedList(\"accountCsnInContactsRelatedList\", testProperties.getConstant(\"ACCOUNT_CSN\"), \"nameInContactsRelatedList\");\r\n\t\t//commonPage.clickLinkInRelatedList(\"accountCsnInReadOnlyContactsRelatedList\", testProperties.getConstant(\"ACCOUNT_CSN\"), \"nameInReadOnlyContactsRelatedList\");\r\n\t\tcommonPage.clickLinkInRelatedList(\"accountCsnInReadOnlyContactsRelatedList\", testProperties.getConstant(\"ACCOUNT_CSN\"), \"nameInReadOnlyContactsRelatedList\");\r\n\t\t//viewContactPage.waitForFieldPresent(\"loginAsPortalUserLink\");\r\n\t\tviewContactPage.waitForFieldPresent(\"contactDetailHeader\");\r\n\t}",
"public @NotNull Set<X509Certificate> getSelectedCertificates(boolean addFromOrganization) {\n Set<X509Certificate> selected = new HashSet<>();\n TreeUtil.collectSelectedUserObjects(myTree).forEach(o -> {\n if (o instanceof CertificateDescriptor) {\n selected.add(((CertificateDescriptor)o).getElement().getCertificate());\n }\n else if (o instanceof OrganizationDescriptor) {\n if (addFromOrganization) {\n selected.addAll(getCertificatesByOrganization(((OrganizationDescriptor)o).getElement()));\n }\n }\n else if (o instanceof RootDescriptor) {\n // nop\n }\n else {\n Logger.getInstance(getClass()).error(\"Unknown tree node object of type: \" + o.getClass().getName());\n }\n });\n return selected;\n }",
"public void selectChangeSecurityQuestionsOption() {\n\t\ttry {\n\t\t\n\t\t\t//Utility.wait(changeSecurityQuestions);\n\t\t\tchangeSecurityQuestions.click();\n\t\t\tUtility.simpleWait(6000);\n\t\t\tLog.addMessage(\"Change Security Questions option selected\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to select Change Security Questions option\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to slect Change Security Questions option\");\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get one transportMethod by id. | @Override
@Transactional(readOnly = true)
public Optional<TransportMethod> findOne(UUID id) {
log.debug("Request to get TransportMethod : {}", id);
return transportMethodRepository.findById(id);
} | [
"@GetMapping(\"/transport-methods/{id}\")\n @Timed\n public ResponseEntity<TransportMethod> getTransportMethod(@PathVariable UUID id) {\n log.debug(\"REST request to get TransportMethod : {}\", id);\n Optional<TransportMethod> transportMethod = transportMethodService.findOne(id);\n return ResponseUtil.wrapOrNotFound(transportMethod);\n }",
"public Transport getById(Long id) {\n\t\treturn this.transportRepo.findById(id)\n\t\t\t\t.orElseThrow(() -> new EntityExistsException(\"Transport avec cet id n'existe pas.\"));\n\t}",
"public Method getMethodByID(Integer id) throws MiddlewareQueryException;",
"public TransportView getTransportView(String id) {\n if (id == null)\n return null;\n for (TransportView t: _transportViews) {\n if (t.getId().equals(id))\n return t;\n }\n return null;\n }",
"@RequestMapping(method = RequestMethod.GET, value = \"/{id}\")\r\n public PublicTransport getById(@PathVariable(\"id\") String id) {\r\n return publicTransportRepository.findOne(id);\r\n }",
"Optional<TITransferDetails> findOne(UUID id);",
"@Override\n @Transactional(readOnly = true)\n public Optional<DeliveryMethodsDTO> findOne(Long id) {\n log.debug(\"Request to get DeliveryMethods : {}\", id);\n return deliveryMethodsRepository.findById(id)\n .map(deliveryMethodsMapper::toDto);\n }",
"@Override\n public void delete(UUID id) {\n log.debug(\"Request to delete TransportMethod : {}\", id);\n Optional<SecurityDTO> currentUserLoginAndOrg = SecurityUtils.getCurrentUserLoginAndOrg();\n boolean checkTransportID = utilsRepository.checkCatalogInUsed(currentUserLoginAndOrg.get().getOrg(), id, \"TransportMethodID\");\n if (checkTransportID) {\n throw new BadRequestAlertException(\"\", \"\", \"\");\n } else {\n transportMethodRepository.deleteById(id);\n }\n\n }",
"public ContraceptionMethods findById(int id) throws UnknownNameException {\n for (ContraceptionMethods method : ContraceptionMethods.values()) {\n if (method.getId() == id) {\n return method;\n }\n }\n throw new UnknownNameException(\n this.option.getAnimalBundle().getString(\"CONTRACEPTION.UNKNOWN_METHOD\"));\n }",
"@DeleteMapping(\"/transport-methods/{id}\")\n @Timed\n public ResponseEntity<Void> deleteTransportMethod(@PathVariable UUID id) {\n log.debug(\"REST request to delete TransportMethod : {}\", id);\n transportMethodService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }",
"private TransportBean getLdapTransportBean( String id )\n {\n return getLdapTransportBean( getDirectoryServiceBean(), id );\n }",
"public TradePair get(final Integer id);",
"@Transactional(readOnly = true)\n public EnergyProvider findOne(Long id) {\n log.debug(\"Request to get EnergyProvider : {}\", id);\n return energyProviderRepository.findOne(id);\n }",
"@Nullable\n public AbstractEndpoint getEndpoint(@NotNull String id)\n {\n return endpointsById.get(Objects.requireNonNull(id, \"id must be non null\"));\n }",
"@GetMapping(\"/methods/{id}\")\n @Timed\n public ResponseEntity<MethodsDTO> getMethods(@PathVariable Long id) {\n log.debug(\"REST request to get Methods : {}\", id);\n MethodsDTO methodsDTO = methodsService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(methodsDTO));\n }",
"@Override\n @Transactional(readOnly = true)\n public PathWay findOne(Long id) {\n log.debug(\"Request to get PathWay : {}\", id);\n return pathWayRepository.findOne(id);\n }",
"public EndpointEntity getOneById(Integer id) throws Exception {\n\n Session session = ORM.getSessionFactory().openSession();\n session.beginTransaction();\n EndpointEntity endpointEntity = session.get(EndpointEntity.class, id);\n session.getTransaction().commit();\n\n return endpointEntity;\n }",
"private Routine getRoutine(UUID id) {\n for (Routine routine : routines) {\n if (routine.getId() == id) {\n return routine;\n }\n }\n\n return null;\n }",
"public Method getMethod(Class<?> owner, Serializable id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the number of samples that should be used for FSAA. If the number is 0, don't use FSAA. The default value is 0. | public int getNumAASamples()
{
return fsaaSamples;
} | [
"public static int size_sampleCnt() {\n return (32 / 8);\n }",
"public int getNumberOfSamples()\r\n\t{\r\n\t\treturn this.samples.length / (this.format.getNBits() / 8);\r\n\t}",
"public @UInt32 int getSampleSize();",
"public int nSamples(){\n return _nSamples;\n }",
"int getNumberOfAveragedSamples() throws DeviceException;",
"int getNumSampleDimensions();",
"int getSamples();",
"public int getSampleSize(){\n\t\treturn sampleSize;\n\t}",
"public int sampleSize() {\n return sampleSize;\n }",
"public int getSampleSize() {\n return sampleSize;\n }",
"public void setNumAASamples(int samples)\n {\n fsaaSamples = samples;\n }",
"public int sampleFrameCount()\n\t{\n\t\treturn -1;\n\t}",
"public Integer getSampleSize() {\n return sampleSize;\n }",
"public int samplesOnePixel() {\r\n\t\tif (getGraphWidth() > 0) {\r\n\t\t\t// avoid division by zero\r\n\t\t\treturn section.getLength() / getGraphWidth();\r\n\t\t}\r\n\t\treturn 1;\r\n\t}",
"public int getSampleSize() {\t\n\t\treturn data.length;\t\n\t}",
"public int size() {\n\t\treturn samples.size();\n\t}",
"public Integer getNumberOfSpectrumMatches() {\r\n if (numberOfSpectrumMatches == null) {\r\n numberOfSpectrumMatches = 10;\r\n }\r\n return numberOfSpectrumMatches;\r\n }",
"public int nUnfilteredSamples() {\n return Math.max(0, nHeaderFields - sampleOffset);\n }",
"public long get_sampleCnt() {\n return (long)getUIntBEElement(offsetBits_sampleCnt(), 32);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the dimension value to power of 2. | private int dimPowerOfTwo(int dim) {
if (dim <= 4) {
return 4;
} else if (dim <= 8) {
return 8;
} else if (dim <= 16) {
return 16;
} else if (dim <= 32) {
return 32;
} else if (dim <= 64) {
return 64;
} else if (dim <= 128) {
return 128;
} else if (dim <= 256) {
return 256;
} else if (dim <= 512) {
return 512;
} else if (dim <= 1024) {
return 1024;
} else if (dim <= 2048) {
return 2048;
} else if (dim <= 4096) {
return 4096;
} else if (dim <= 8192) {
return 8192;
} else if (dim <= 16384) {
return 16384;
} else if (dim <= 32768) {
return 32768;
} else {
return 65536;
}
} | [
"public static int dimPowerOfTwo(final int dim) {\r\n\r\n // 128^3 x 4 is 8MB\r\n // 256^3 x 4 is 64MB\r\n if (dim <= 16) {\r\n return 16;\r\n } else if (dim <= 32) {\r\n return 32;\r\n } else if (dim <= 64) {\r\n\r\n if (dim > 40) {\r\n return 64;\r\n }\r\n return 32;\r\n } else if (dim <= 128) {\r\n\r\n if (dim > 80) {\r\n return 128;\r\n }\r\n return 64;\r\n } else if (dim <= 256) {\r\n\r\n if (dim > 160) {\r\n return 256;\r\n }\r\n return 128;\r\n } else if (dim <= 512) {\r\n\r\n if (dim > 448) {\r\n return 512;\r\n }\r\n return 256;\r\n } else {\r\n return 512;\r\n }\r\n }",
"public int getXD2 ()\n\t{\n\t\treturn xDimension2;\n\t}",
"BigInteger getCoordinateSoaceDimension();",
"int dimensionality();",
"public Int2 GetBoardDimensions(){\n return m_boardDimensions;\n }",
"public static int getPowerOfTwo(float size) {\n int result = 2;\n\n while (size > result) {\n result *= 2;\n }\n\n return result;\n }",
"static double powerOfTwoD(int n) {\n return Double.longBitsToDouble((((long)n + (long)DoubleConsts.MAX_EXPONENT) <<\n (DoubleConsts.SIGNIFICAND_WIDTH-1))\n & DoubleConsts.EXP_BIT_MASK);\n }",
"public int getYD2 ()\n\t{\n\t\treturn yDimension2;\n\t}",
"public static int powerOf2(int n){\n int counter=1;\n while (n != 1){\n n=n>>1;\n counter++;\n }\n return counter;\n }",
"int getBitsPerComponent();",
"public int dim() {\n\tif (n > 0)\n\t return (n);\n\telse\n\t return (-1);\n }",
"static double powerOfTwoD(int n) {\n assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);\n return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) <<\n (DoubleConsts.SIGNIFICAND_WIDTH-1))\n & DoubleConsts.EXP_BIT_MASK);\n }",
"public double getDimensionalWeight(){\n\t\tdouble dimensionalWeight = ( getWidth() * getHeight() * getLength() )/ getFactor();\n\t\treturn dimensionalWeight;\n\t}",
"private int getPowerOfTwoForSampleRatio (double ratio) {\n\t\tint k = Integer.highestOneBit((int) Math.floor(ratio));\n\t\tif (k == 0) return 1;\n\t\telse return k;\n\t}",
"public abstract byte getMaxExponentSize();",
"int getDesiredSize(Dimension dimension);",
"public Integer getPowerTwo() {\n return powerTwo;\n }",
"private long bitsPerSegmentInModIterBitSet() {\n return Maths.nextPower2(actualChunksPerSegment, 128L * 8L);\n }",
"int getDimX(){\n\t\treturn dimx;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Maximum storage space Note: This field may return null, indicating that no valid values can be obtained. | public Long getStorageLimit() {
return this.StorageLimit;
} | [
"public Long getMaxStorageSize() {\n return this.MaxStorageSize;\n }",
"public Integer getMaxspace() {\r\n return maxspace;\r\n }",
"public int getStorageCapacity() {\n if(getBuilding(\"storage\") == -1) {\n //no information use fallback\n return Integer.MAX_VALUE;\n }\n \n int storageCapacity = BuildingSettings.calculateStorageCapacity(getBuilding(\"storage\"));\n int hiddenResources = 0;\n if (getBuilding(\"hide\") > 0) {\n hiddenResources = BuildingSettings.calculateHideCapacity(getBuilding(\"hide\"));\n }\n // limit capacity to 0\n return Math.max(0, storageCapacity - hiddenResources);\n }",
"public Integer getMaxQuota() {\n return (Integer) getAttributeInternal(MAXQUOTA);\n }",
"public Long getMaximumPersistentDisksSizeGb() {\n return maximumPersistentDisksSizeGb;\n }",
"public double getMaxMemoryUsage()\r\n\t{\r\n\t\tif (this.memoryUsage.isEmpty())\r\n\t\t{\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn Collections.max(this.memoryUsage);\r\n\t\t}\r\n\t}",
"long getMaxMemory();",
"public String getMemoryMaximumSize() {\n return memoryMaximumSize;\n }",
"public Integer getMaximumPersistentDisks() {\n return maximumPersistentDisks;\n }",
"public long getMemMax() {\n return memMax;\n }",
"Object getRamMax();",
"public int getMaximumCapacity() { // get the max capacity\n\t\treturn maximumCapacity;\n\t}",
"public static int getMaxMemoryMB()\r\n {\r\n int result = preferences.getInt(ID_MAX_MEMORY, -1);\r\n\r\n // no value ?\r\n if (result == -1)\r\n result = getDefaultMemoryMB();\r\n\r\n // arrange to get multiple of 32 MB\r\n return checkMem(result);\r\n }",
"public final int getMaxMemorySlot() {\r\n\t\treturn this.agentOwner.getMaxSlot();\r\n\t}",
"public int getLocalMaxMemoryForValidation() {\n if (offHeap && !hasLocalMaxMemory && !localMaxMemoryExists) {\n int value = computeOffHeapLocalMaxMemory();\n if (localMaxMemoryExists) { // real value now exists so set it and return\n localMaxMemory = value;\n }\n }\n return localMaxMemory;\n }",
"public static long getDefaultStorageCapacity() {\n return defaultStorageCapacity;\n }",
"public long getMemUsedMax() {\n return memUsedMax;\n }",
"@Override\n public int getLocalMaxMemory() {\n if (offHeap && !localMaxMemoryExists) {\n int value = computeOffHeapLocalMaxMemory();\n if (localMaxMemoryExists) {\n // real value now exists so set it and return\n localMaxMemory = value;\n }\n }\n checkLocalMaxMemoryExists();\n return localMaxMemory;\n }",
"@java.lang.Override\n public int getMaximumCapacity() {\n return maximumCapacity_;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates QueryOrderByConfig list from the given Siddhi OrderByAttribute list. | private List<QueryOrderByConfig> generateOrderBy(List<OrderByAttribute> orderByAttributeList) {
List<QueryOrderByConfig> orderBy = new ArrayList<>();
for (OrderByAttribute orderByAttribute : orderByAttributeList) {
String value = "";
if (orderByAttribute.getVariable().getStreamId() != null) {
value = orderByAttribute.getVariable().getStreamId() + ".";
}
value += orderByAttribute.getVariable()
.getAttributeName();
orderBy.add(new QueryOrderByConfig(
value,
orderByAttribute.getOrder().name()));
}
return orderBy;
} | [
"public static void setOrderBy (String columnList){\n fetchAllOrderBy=columnList;\n }",
"protected void generateOrderBy( SQLQueryModel query, LogicalModel model, List<Order> orderBy,\n DatabaseMeta databaseMeta, String locale, Map<LogicalTable, String> tableAliases, Map<String, String> columnsMap,\n Map<String, Object> parameters, boolean genAsPreparedStatement ) {\n if ( orderBy != null ) {\n for ( Order orderItem : orderBy ) {\n LogicalColumn businessColumn = orderItem.getSelection().getLogicalColumn();\n String alias = null;\n if ( columnsMap != null ) {\n // The column map is a unique mapping of Column alias to the column ID\n // Here we have the column ID and we need the alias.\n // We need to do the order by on the alias, not the column name itself.\n // For most databases, it can be both, but the alias is more standard.\n //\n // Using the column name and not the alias caused an issue on Apache Derby.\n //\n for ( String key : columnsMap.keySet() ) {\n String value = columnsMap.get( key );\n if ( value.equals( businessColumn.getId() ) ) {\n // Found it: the alias is the key\n alias = key;\n break;\n }\n }\n }\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, orderItem.getSelection(), tableAliases, parameters, genAsPreparedStatement,\n databaseMeta, locale );\n query.addOrderBy( sqlAndTables.getSql(), databaseMeta.quoteField( alias ), orderItem.getType() != Type.ASC\n ? OrderType.DESCENDING : null );\n }\n }\n }",
"OrderByClauseArgs createOrderByClauseArgs();",
"OrderByClause createOrderByClause();",
"PrecedenceResult orderByPrecedence(Collection<Attribute<?>> requested);",
"public List<String> buildOrderByList() {\n List<String> returnList = new ArrayList();\n returnList.add(KFSPropertyConstants.ORGANIZATION_CHART_OF_ACCOUNTS_CODE);\n returnList.add(KFSPropertyConstants.ORGANIZATION_CODE);\n returnList.add(KFSPropertyConstants.SUB_FUND_GROUP_CODE);\n returnList.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);\n returnList.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);\n returnList.add(KFSPropertyConstants.ACCOUNT_NUMBER);\n returnList.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);\n returnList.add(KFSPropertyConstants.FINANCIAL_OBJECT_CODE);\n return returnList;\n }",
"protected void prepareOrderBy(String query, QueryConfig config) {\n }",
"Map<String, org.springframework.batch.item.database.Order> genBatchOrderByFromSort(TableFields tableFields, Sort sort);",
"public void sortAttributes(Comparator<TLAttribute> comparator);",
"io.dstore.values.StringValue getOrderBy();",
"io.dstore.values.StringValueOrBuilder getOrderByOrBuilder();",
"@Override\n public String getOrderBy()\n {\n return \"ORDER BY TARIFF_CONF.NAME, TARIFF_CONF.TARIFF_NUMBER,TARIFF_SEQUENCE_CONF.TARIFF_SEQUENCE \";\n }",
"private void createSort(OrderBy orderBy) {\n // Checks if any order by clause is present\n if (null != orderBy && null != orderBy.getIds() && !orderBy.getIds().isEmpty()) {\n\n // For each clause a new sort property is added to the query\n for (OrderByClause orderByClause : orderBy.getIds()) {\n\n // Retrieves selector (field or field function) which is going to be used to sort results and the sort way (ascending or descending)\n Selector selector = orderByClause.getSelector();\n boolean ascendingWay = OrderDirection.ASC.equals(orderByClause.getDirection());\n\n // Gets the field name associated to the selector\n String fieldName = SelectorUtils.getSelectorFieldName(selector);\n\n // Creates the appropriate sort property and adds it to the query builder\n if (null != fieldName) {\n SortBuilder sortBuilder = SortBuilders.fieldSort(fieldName);\n sortBuilder.order(ascendingWay ? SortOrder.ASC : SortOrder.DESC);\n this.requestBuilder.addSort(sortBuilder);\n }\n }\n }\n }",
"OrderByClauseArg createOrderByClauseArg();",
"public ActivityIteratorExpressionBuilder setOrderByState(boolean ascending);",
"java.lang.String getOrderBy();",
"public void setAttributeOrder(int attributeOrder);",
"private static TopologicalOrder<IConfigurationElement> createTopologicalOrder(\r\n IConfigurationElement[] elements, String idAttr, String prevIdAttr, String nextIdAttr)\r\n {\r\n TopologicalOrder<IConfigurationElement> graph = new TopologicalOrder<IConfigurationElement>();\r\n addToTopologicalOrder(graph, elements, idAttr, prevIdAttr, nextIdAttr);\r\n return graph;\r\n }",
"public static void sortAttributes(ArrayList<Attribute> attributes){\n\t\tCollections.sort(attributes, new SortAttr());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the widget's name. | @Override
public void setName(String name) {
listBox.setName(name);
} | [
"public void setName(String name) {\n this.name = name;\n this.box.getElement().setAttribute(\"name\", name);\n }",
"public void setName(String name) {\n\t\tmVH.tvResourceName.setText(name);\n\t}",
"public void setName(String name) {\n NAME = name;\n }",
"public String getName() {\n return this.widgetName;\n }",
"public void setName(String name) {\r\n _name = name;\r\n }",
"public void setName( String name ) {\r\n\r\n ChangeNameTool tool = new ChangeNameTool( scene, name );\r\n controller.addTool( tool );\r\n }",
"public void setName(String name){\n _theme.setName(name);\n }",
"public void setName(final String name) {// TODO trigger gui changes and so on need AgentModel\n\t\t\tthis.name = name;\n\t}",
"void setCustomName(String text);",
"public void initiateWidgetRename(IWidget w)\n {\n view.setWidgetName(w.getName());\n view.requestRename();\n }",
"public void setName(Name v) {\n this.name = v;\n }",
"public void setCustomNameTag ( String name ) {\n this.dataWatcher.updateObject ( 2 , name );\n }",
"@Override\r\n public void setName(java.lang.String name) {\r\n _contentHolder.setName(name);\r\n }",
"public void setName(String name){\n hubName = name;\n icon.setName(hubName); //changes the icons name to the hubs name\n NetworkReader.form.repaint();\n }",
"public void setTheName(String theme){\n\t\tname.setText(theme);\n\t}",
"public void setNameFieldText(String text) {\n nameField.setText(text);\n }",
"public void setName(String name) {\n\t\tthis.levelName.setText(name);\n\t}",
"public void setCustomName ( String name ) {\n\t\texecute ( handle -> handle.setCustomName ( name ) );\n\t}",
"void setStateName(String name);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by a com.n157239.Panel to select a particular com.n157239.Grid to play. | @Override
public void onSelection(int gridSelected) {
mainGrid = grids.get(gridSelected);
drawStuff();
} | [
"private void setGridOnCollectibleSelected() {\n showCardInfo(getNameFromID(selectedCollectibleID));\n setGridColor(Color.GOLD);\n for (int row = 0; row < Map.NUMBER_OF_ROWS; row++) {\n for (int column = 0; column < Map.NUMBER_OF_COLUMNS; column++) {\n ImageView interactor = getInteractor(row, column);\n int finalRow = row, finalColumn = column;\n interactor.setOnMouseClicked(e -> handleUseCollectible(finalRow, finalColumn, false));\n\n }\n }\n }",
"public void gridClick() {\n gridToggle = !gridToggle;\n draw();\n }",
"public void setPlayerGrid(){\n\t\tplayerGrid = new Grid(true);\n\t\tsetShips(playerGrid,playerBattleShipsList,0);//2\n\t}",
"public void grid_selection() {\n\t\tthis.grid_selection.click();\n\t\tthis.navigation_link.click();\n\t}",
"public void selectAndPlay() {\r\n if (!selected) {\r\n selected = true;\r\n play();\r\n }\r\n }",
"public void multiplayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyDiscoveryState()\n clientController.searchForGames();\n\n //populate the GameSelectScreen's text box with the lobbies from the\n //state\n gameSelectScreen.clearGames();\n\n //set state to GAMESELECT\n state = CurrentWindow.GAMESELECT;\n\n //hide the intro screen and show the game select screen\n introScreen.setVisible(false);\n gameSelectScreen.setVisible(true);\n }",
"public void play()\n {\n int currentPlayer = PLAYER_1;\n \n Output.display(\"\\nLet's play !\\n\");\n displayPlayerGrid(PLAYER_1);\n while (!(this.players[currentPlayer].didPlayerLoose()))\n {\n processPlayerShot(currentPlayer, getRandomFreeCellCoordinatesFromPlayerShotGrid(currentPlayer));\n if (currentPlayer == PLAYER_1)\n displayPlayerGrid(currentPlayer);\n currentPlayer = changePlayer(currentPlayer);\n }\n \n \n Output.display(\"\\nFinal lay-out : \\n\");\n displayPlayerGrid(PLAYER_1);\n displayPlayerGrid(PLAYER_2);\n \n if (this.players[PLAYER_1].didPlayerLoose())\n Output.display(\"Player 2 won!\");\n else\n Output.display(\"Player 1 won!\");\n\n }",
"public void playChip(int col, Player player) {\n\t\t// ********************\n\t\t// Aufgabe a)\n\t\t// Klasse muss selber verwalten, wer gerade am Zug war \n\t\tint inputRow = fields.length - fillState[col] - 1;\n\t\t\n\t\tfields[inputRow][col] = first_player ? 1:2;\n\t\t\n\t\tfirst_player = !first_player;\n\t\t\n\t\tfillState[col]++;\n\t\t\n\t\t// ********************\n\t}",
"public void setPlayboard(Playboard playboard);",
"static void playHumanVsHuman() {\n board = new Board();\n boardGUI = new BoardGUI(board);\n opponent = HUMAN;\n currentPlayer = RED;\n additionalAttack = false;\n selected = false;\n selectedPiece = null;\n\n displayText(\"Red player turn.\");\n boardGUI.getWindow().show();\n }",
"public static void toggleGridCommand()\n {\n // get the current frame\n WindowFrame wf = WindowFrame.getCurrentWindowFrame();\n if (wf == null) return;\n if (wf.getContent() instanceof EditWindow)\n {\n \tEditWindow wnd = (EditWindow)wf.getContent();\n \t if (wnd == null) return;\n \t wnd.setGrid(!wnd.isGrid());\n } else if (wf.getContent() instanceof WaveformWindow)\n {\n \tWaveformWindow ww = (WaveformWindow)wf.getContent();\n \tww.toggleGridPoints();\n } else\n {\n \tSystem.out.println(\"Cannot draw a grid in this type of window\");\n }\n }",
"void goToWhiteboardSelect(){\n CollaboardGUI.this.setSize(500,500);\n CardLayout layout = (CardLayout) panels.getLayout();\n layout.show(panels, \"whiteboard\");\n }",
"public void toggleGrid () {\n myGridShowing = !myGridShowing;\n }",
"public void setGrid(Grid grid)\r\n \t{\r\n \t\tthis.grid = grid;\r\n \t}",
"private void chooseNextToPlay() {\n // TODO hook up with playlist.\n }",
"public void setCurrentGrid(GUIGrid currGrid) {\n\t\tcurrGrid = myGrid;\n\t}",
"public boolean chooseGrid(Grid possibleGrid) throws GameException {\n if (gfh.getCurrent() instanceof GridSetupState){\n if (this.player.getGrid() == null){\n ((GridSetupState)gfh.gridSetupState).chooseGrid(this.player,possibleGrid);\n if (this.player.getGrid() != null){\n this.player.setPossibleGrids(null);\n return true;\n }\n throw new GameException(\"Failed to assign grid.\");\n } else {\n throw new GameException(\"You are already registered!\");\n }\n } else {\n throw new GameException(\"You cannot choose the grid in this moment of the game!\");\n }\n }",
"public void play() {\n Selection selection;\n if ((selection = master.getWindowManager().getMain().getSelection()) == null) {\n startPlay();\n playShow(nextStartTime, -1 / 1000.0);\n } else {\n playSelection(selection);\n playShow(selection.start, selection.duration);\n }\n }",
"Player getSelectedPlayer();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method will create string representation for Table using QueryTableColum object. It will also append the alias based on the input boolean | public String createTableRepresentationQueryTableColumn (QueryTable queryTable, boolean appendAlias); | [
"public String createColumRepresentationQueryTableColumn (QueryTableColumn queryTableColumn);",
"default String buildTableSql(String tableName, String tableAlias) {\r\n String result = wrapName(convertTableOrColumnName(tableName));\r\n if (LangUtils.isNotEmpty(tableAlias)) {\r\n result = result + \" \" + tableAlias;\r\n }\r\n return result;\r\n }",
"public String getTableSQL();",
"public String build() {\n StringBuilder builder = new StringBuilder();\n builder.append(\"SELECT \")\n .append(QueryUtils.separate(columns, \",\"))\n .append(\" FROM \")\n .append(table);\n\n if (wheres.size() > 0) {\n builder.append(\" WHERE \")\n .append(QueryUtils.separate(wheres, \" AND \"));\n }\n\n if (orderBy != null) {\n builder.append(\" ORDER BY \")\n .append(orderBy)\n .append(orderByAscending ? \" ASC\" : \" DESC\");\n }\n\n if (limitRowCount > 0) {\n builder.append(\" LIMIT \")\n .append(limitOffset)\n .append(\",\").append(limitRowCount);\n }\n\n return builder.toString();\n }",
"@Override\n public String toString()\n {\n String sql = this.statementKeyword + \" \" + this.name + \" (\";\n\n if (this.asCopySelect != null)\n {\n var resultSet = this.asCopySelect.execute();\n var cols = resultSet.getColumnTypes();\n String name;\n SqlType type;\n Column column;\n\n for (Entry<String, String> col : cols)\n {\n name = col.getKey();\n type = SqlType.convert(col.getValue());\n column = new Column(name, type);\n\n if (type.equals(SqlType.VARCHAR))\n {\n column.size(9999);\n }\n\n column(column);\n }\n }\n\n for (Column col : this.tableColumns)\n {\n sql += col.toString() + \", \" + System.lineSeparator();\n }\n\n sql = sql.substring(0, sql.length() - (System.lineSeparator().length() + 2)) + System.lineSeparator();\n sql += \")\";\n\n if (this.preserve)\n {\n sql += \" ON COMMIT PRESERVE ROWS\" + System.lineSeparator();\n }\n\n sql += \" NOT LOGGED\";\n\n return sql;\n }",
"private static String getTableCreateStatement(){\n String output;\n /* create a 'create' statement */\n output = \"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME + \" (\";\n ArrayList<String> keys = new ArrayList<String>(types.keySet());\n for (int i = 0; i < keys.size(); i ++){\n String toAdd = \"\";\n toAdd += keys.get(i) + \" \" + types.get(keys.get(i));\n if ( i != keys.size() - 1) toAdd += \", \";\n output += toAdd;\n }\n output += \")\";\n\n return output;\n\n\n }",
"default String buildTableSql(String tableName) {\r\n return buildTableSql(tableName, null);\r\n }",
"java.lang.String getTable();",
"public String composeTableNamesQuery() {\n\t\treturn String.format(\"show tables;\");\n\t}",
"@NonNull\n static String getCreateTableQuery() {\n return \"CREATE TABLE \\\"\"+ TABLE_NAME +\"\\\"(\\\"\" +\n COLUMN_TITLE+\"\\\" Text,\\\"\" +\n COLUMN_DESC+\"\\\" Text,\\\"\" +\n COLUMN_IMAGE_URL+\"\\\" Text );\";\n }",
"private StringBuilder startBuild() {\n StringBuilder strBuilder = new StringBuilder()\n .append(\"CREATE EXTERNAL TABLE IF NOT EXISTS \");\n if (databaseName != null) {\n strBuilder.append(databaseName).append('.');\n }\n strBuilder.append(tableName);\n\n // yeah... schema is not always required.\n if (hiveSchema != null) {\n strBuilder.append(\" \").append(hiveSchema);\n }\n\n if (tableComment != null && !tableComment.isEmpty()) {\n strBuilder.append(\" COMMENT '\")\n .append(tableComment)\n .append(\"'\");\n }\n\n if (partitioning != null && !partitioning.getFields().isEmpty()) {\n strBuilder.append(\" PARTITIONED BY (\");\n for (Map.Entry<String, Partitioning.FieldType> entry : partitioning.getFields().entrySet()) {\n strBuilder = shouldEscapeColumns ?\n strBuilder.append('`').append(entry.getKey()).append('`') : strBuilder.append(entry.getKey());\n strBuilder.append(\" \")\n .append(FieldTypes.toHiveType(entry.getValue()))\n .append(\", \");\n }\n // remove trailing \", \"\n strBuilder.deleteCharAt(strBuilder.length() - 1)\n .deleteCharAt(strBuilder.length() - 1)\n .append(\")\");\n }\n\n if (rowFormat != null) {\n strBuilder.append(\" ROW FORMAT \").append(rowFormat);\n }\n return strBuilder;\n }",
"public String toString() {\n return this.dbURL + \"-\" + this.tableSchema;\n }",
"public String toString()\n {\n return this.getUntranslatedTableName();\n }",
"public static String createSimpleCreateTableQuery(String tableName, String storageEngine, String selectQuery) {\n builder.setLength(0);\n builder.append(\"CREATE TABLE `\").append(tableName).append(\"` ENGINE = \").append(storageEngine).append(\" AS \");\n builder.append(selectQuery);\n return builder.toString();\n }",
"public String getCreateTemporaryTableString() {\n \t\treturn \"create table\";\n \t}",
"public String tableTypeForTable();",
"protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }",
"public String queryToCreateMe(){\n\t\t\n\t\tString createQuery = \"CREATE TABLE \" + myName + \" (\\n\"; \n\t\t\n\t\tfor(Field field : myFields.values()){\n\t\t\t\n\t\t\tcreateQuery += field + \",\\n\";\n\t\t}\n\t\t\n\t\tif(myForiegnKeys != null && myForiegnKeys.size() > 0){\n\t\t\t\n\t\t\tfor(ForeignKey fkey : myForiegnKeys.values()){\n\t\t\t\t\n\t\t\t\tcreateQuery += fkey + \",\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tcreateQuery += myPrimaryKey;\n\t\tcreateQuery += \")\";\n\t\treturn createQuery;\n\t}",
"private void appendFullTableNameAndAlias(String stageName) {\n builder.append(getFullTableName(stageName)).append(AS).append(getTableAlias(stageName));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The unique heap id that corresponds to this model's slot storage. | UUID getHeapId(final Model model); | [
"public int getSlotId()\n {\n return sharedBindingInfo.getSlotId();\n }",
"public Integer getStorageId() {\n return storageId;\n }",
"public String getSizeId() {\n return (String)getAttributeInternal(SIZEID);\n }",
"public Long getStorageId() {\n return storageId;\n }",
"public Integer getSizeId() {\n return sizeId;\n }",
"public String getSizeId() {\n return sizeId;\n }",
"public long getSlotID() {\n\t\treturn slotID_;\n\t}",
"public int getSlotId() {\n return parentItem.getSlot();\n }",
"public String getSizeid() {\r\n return sizeid;\r\n }",
"public String getStorageId() {\n return this.StorageId;\n }",
"private String getNextQueueIdentifier() {\n String qid = PropertyUtils.genGUID(25);\n updateCachedCounts();\n return qid;\n }",
"public Integer getStorageNum() {\n return storageNum;\n }",
"private int getSlotId()\n {\n return this.slotId;\n }",
"public String getUniqueId() {\n return getCurrentInstance().getViewRoot().createUniqueId();\n }",
"public Integer getMyspace_id() {\n return myspace_id;\n }",
"public Long getStorageTotalId() {\n return storageTotalId;\n }",
"public byte getSyncID() {\n synchronized (this.syncID) {\n return this.syncID[0];\n }\n }",
"String getRuntimeDataId();",
"public int min_id() {\n\t\treturn index[heap[1].getVertex()];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the hp string for the given actionable in the format currentHP/maxHP | private String getHPString(Actionable clicked){
double currentHP = clicked.getHitPoints();
double maxHP = clicked.getParameters().get("MaxHP");
return (new DecimalFormat("#.##").format(currentHP)) //format current HP
+'/'+ //put the slash
(int)maxHP; //format maxHP;
} | [
"public String toString(){\n\t return name + \"\\n\" + \"HP: \" + hp + \"/\" + maxHP;\n\t }",
"public String showHealthBar(String target) {\n if (target == \"player\") {\n return \"(\" + playerShipHealth + \"/\" + playerShipHealthMax + \")\";\n } else if (target == \"enemy\") {\n return \"(\" + enemyShipHealth + \"/\" + enemyShipHealthMax + \")\";\n } else{ return null; }\n }",
"private String hunger() {\n\t\tif (player.food() < player.maxFood() * 0.1)\n\t\t\treturn \"Starving\";\n\t\telse if (player.food() < player.maxFood() * 0.2)\n\t\t\treturn \"Hungry\";\n\t\telse if (player.food() > player.maxFood() * 0.9)\n\t\t\treturn \"Stuffed\";\n\t\telse if (player.food() > player.maxFood() * 0.8)\n\t\t\treturn \"Full\";\n\t\treturn \"\";\n\t}",
"int getHPValue();",
"public int getHP()\n\t{\n\t\tUnit u = this;\n\t\tint hp = 0;\n\t\tfor(Command c : u.race.unitcommands)\n\t\t\tif(c.command.equals(\"#hp\"))\n\t\t\t\thp += Integer.parseInt(c.args.get(0));\n\t\t\n\t\tfor(Command c : u.getSlot(\"basesprite\").commands)\n\t\t\tif(c.command.equals(\"#hp\"))\n\t\t\t{\n\t\t\t\tString arg = c.args.get(0);\n\t\t\t\tif(c.args.get(0).startsWith(\"+\"))\n\t\t\t\t\targ = arg.substring(1);\n\t\t\t\t\n\t\t\t\thp += Integer.parseInt(arg);\n\t\t\t}\n\t\t\n\t\tif(hp > 0)\n\t\t\treturn hp;\n\t\telse\n\t\t\treturn 10;\n\t}",
"public String character(){\n \tStringBuffer buff = new StringBuffer();\n \tbuff.append(\"Health: \");\n \tbuff.append(health);\n \tbuff.append(\"/\");\n \tbuff.append(healthMax);\n \tbuff.append(\"\\nWeapon: \");\n \tif(weapon==null){\n \t\tbuff.append(\"none\");\n \t}else{\n \t\tbuff.append(weapon.getName());\n \t}\n \tbuff.append(\"\\nArmor: \");\n \tif(armor==null){\n \t\tbuff.append(\"none\");\n \t}else{\n \t\tbuff.append(armor.getName());\n \t}\n \treturn buff.toString();\n }",
"int getBonusHP();",
"public int getValue_HP() \n {\n return enemyHP;\n }",
"public String getHealthBar() {\n String healthBar = \"|\";\n for (int i=0; i<40; i++) {\n if (i < 40*hp/maxHp) {\n healthBar += \"\\u2588\";\n } else {\n healthBar += \" \";\n }\n }\n return healthBar + \"|\";\n }",
"public String GetHumanCard(int value){\n return handHuman.get(value);\n }",
"int getHpMax();",
"public double getPlayerFullHP();",
"int getMaxHP();",
"int getCurHP();",
"void fullHP();",
"public static int getHP()\r\n\t{\r\n\t\treturn hp;\r\n\t}",
"@Override\r\n\tpublic String attack() {\r\n\t\treturn \"Scissors \" + weapon.attack();\t\t\t\t\r\n\t}",
"float getBonusPercentHP();",
"int getHp();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode single QR code that has had sequence information inserted into its payload. | @Test
public void testDecodeQrWithSequenceInfo() {
// Screenshot of QR code received from transmitter
String filename = "fooScreenshot_withReservedBits.png";
String expectedText = "foo";
// Decode the image
Result result = decodeAndCheckValidQR(filename);
PartialMessage m = PartialMessage.createFromResult(result, Integer.MAX_VALUE);
// Expect payload to match 'expectedText' and only one QR code in sequence
assertNotNull("Expected QR code to be formatted for QRLib", m);
assertEquals("Should only have 1 chunk" , 1, m.getTotalChunks());
assertEquals("Unexpected chunkId" , 1, m.getChunkId());
String actualText = new String (m.getPayload(), Charsets.ISO_8859_1);
assertEquals("Expect decoded result to match expected", expectedText, actualText);
} | [
"@Test\n public void testDecodeQrWithNoSequenceInfo() {\n // Decode qr code received from transmitter as screenshot\n String filename = \"fooScreenshot_noReservedBits.png\";\n String expectedText = \"foo\";\n\n BufferedImage b = getImageResourceAndCheckNotNull(filename);\n LuminanceSource lumSrc = new BufferedImageLuminanceSource(b);\n\n assertNotNull(\"Unable to convert BufferedImage to LuminanceSrc\", lumSrc);\n try {\n Result result = Receive.decodeSingle(lumSrc);\n assertEquals(\"Expect decoded result to match expected\", expectedText, result.getText());\n } catch (NotFoundException e) {\n fail(\"Unable to find QR in image, \"+filename + \". \" + e.getMessage());\n }\n }",
"public void decode()\t{\r\n \t\t noCarrier();\r\n \t\t synctype=getFrameSync();\r\n \t\t calcMids();\r\n \t while (synctype!=-1)\t{\r\n \t processFrame();\r\n \t synctype=getFrameSync(); \r\n \t calcMids();\r\n \t } \r\n \t }",
"@Test\n public void testDecodeQrHasSequenceInfo() {\n // Decode qr code received from transmitter as screenshot\n String containsChunkInfo = \"fooScreenshot_withReservedBits.png\";\n String containsNoChunkInfo = \"fooScreenshot_noReservedBits.png\";\n\n // Expect decoded image to have my chunk info prepended to payload\n Result resultWithChunk = decodeAndCheckValidQR(containsChunkInfo);\n\n // This image does not have chunk info in it\n Result resultNoChunk = decodeAndCheckValidQR(containsNoChunkInfo);\n\n // The encoded QR codes should have different byte data\n assertFalse(\"Decoded image missing chunkInfo\",\n Arrays.equals(resultNoChunk.getRawBytes(), resultWithChunk.getRawBytes()));\n }",
"void parseQrCode(String qrCodeData);",
"private String decodeBarcodeImage(BufferedImage image) {\n\t\tString decodedBarcode = this.barcodeDecoder.decode(image);\n\t\tif (decodedBarcode != null) {\n\t\t\treturn decodedBarcode;\n\t\t}\n\t\tdecodedBarcode = rotateImageUntilDecoded(image, (i) -> this.barcodeDecoder.decode(i));\n\t\treturn decodedBarcode;\n\t}",
"private void decode() {\n\t\tencoding = findEncoding();\n\t\tlog.debug(\"\\tChosen encoding is {}\", encoding);\n\t\tapplyEncoding(encoding);\n\t}",
"CharSequence decoded();",
"String decode(byte[] payload);",
"T decode1(DataBuffer buffer);",
"private void decodeBitForDecompression(boolean bitCode) {\r\n\t\tHuffmanElement nextElement = tree.traverse(bitCode);\r\n\t\tif (nextElement.getType() == HuffmanTree.NodeType.LEAF && alreadyDecodedBytes < maxCountBytesToDecode) {\r\n\t\t\talreadyDecodedBytes++;\r\n\t\t\tdecodedData.add(nextElement.getData());\r\n\t\t}\r\n\t}",
"public int readBarcode() {\n\n\t\ttrack.setSpeed(500);\n\t\tint code = 0;\n\t\tboolean lineValue = false;\n\n\t\tarm.turnToCenter();\n\t\t// drive back to first line\n\t\ttrack.backward();\n\t\twhile (!isLine()) {\n\t\t\tsleep(10);\n\t\t}\n\t\ttrack.forward();\n\t\tlastLine = System.currentTimeMillis();\n\t\tlastNoLine = System.currentTimeMillis();\n\t\twhile (track.motorsMoving()) {\n\t\t\tif (System.currentTimeMillis() - lastLine > 2 * AVG_NOLINE_TIME)\n\t\t\t\ttrack.stop();\n\n\t\t\tif (System.currentTimeMillis() - lastNoLine > 2 * AVG_NOLINE_TIME)\n\t\t\t\ttrack.stop();\n\n\t\t\tif (lineValue != isLine()) {\n\t\t\t\tlineValue = !lineValue;\n\t\t\t\tif (lineValue) {\n\t\t\t\t\tlastLine = System.currentTimeMillis();\n\t\t\t\t\tcode++;\n\t\t\t\t} else {\n\t\t\t\t\tlastNoLine = System.currentTimeMillis();\n\t\t\t\t}\n\t\t\t\tsleep(100);\n\t\t\t}\n\n\t\t}\n\t\ttrack.backward();\n\t\tsleep(AVG_NOLINE_TIME);\n\t\ttrack.stop();\n\n\t\treturn code;\n\t}",
"public void decode() {\n\n if(snowtamOriginal == null){\n snowtamDecoded = \" \";\n }\n else{\n String snowtam = snowtamOriginal;\n\n //formatage du snowtam pour traitement\n snowtam = snowtam.replace(\")\",\") \");\n snowtam = snowtam.replaceAll(\"\\\\s+\",\" \");\n String[] indexSnowtam = snowtam.split(\" \");\n\n\n indexSnowtam = decodeA(indexSnowtam);\n indexSnowtam = decodeB(indexSnowtam);\n indexSnowtam = decodeC(indexSnowtam);\n\n\n\n snowtamDecoded = indexSnowtam[0];\n for (int i = 1 ; i<indexSnowtam.length ; i++){\n snowtamDecoded = snowtamDecoded +\" \"+ indexSnowtam[i];\n }\n\n isReady = true;\n Log.i(\"Airport\", snowtamDecoded);\n }\n }",
"java.lang.String getBarcode();",
"public void decodeHeader();",
"private void decodePacket() {\n ByteBuffer packet = ByteBuffer.wrap(receivedBytes.toByteArray());\n if (packet.getInt(0) == 0xAABBCCDD){\n dcDcTemp1 = decodeTemp(packet.getInt(4));\n dcDcTemp2 = decodeTemp(packet.getInt(8));\n dcDcVoltage = decodeTemp(packet.getInt(12));\n dcDcCurrent = decodeTemp(packet.getInt(16));\n\n igbt1 = decodeTemp(packet.getInt(20));\n igbt2 = decodeTemp(packet.getInt(24));\n igbt3 = decodeTemp(packet.getInt(28));\n igbt4 = decodeTemp(packet.getInt(32));\n igbt5 = decodeTemp(packet.getInt(36));\n igbt6 = decodeTemp(packet.getInt(40));\n\n phaseAmps = decodeCurrent(packet.getInt(44)) * -1; // The controller inverts the data for some reason\n reqPhaseAmps = decodeCurrent(packet.getInt(48));\n maxAmps = decodeCurrent(packet.getInt(52));\n fieldWeakening = decodeCurrent(packet.getInt(56));\n //eRPM = decodeRPM(packet.getInt(60));\n }\n }",
"T decode() throws IOException;",
"public String decode(InputStream is)\n throws DataProcessingException, IOException {\n sendRecognition();\n streamAudioSource.setInputStream(is);\n sendData();\n String result = readResult();\n return result;\n }",
"public static void DecodeReceivedMsg(String encodedMsg, Context context)\r\n {\r\n \tif (ResponseTextView != null)\r\n \t{\r\n\t String decodedMsg = encodedMsg;\t \t \r\n\t \r\n\t /*\r\n\t * \r\n\t * Put clue decoding logic here\r\n\t * by the end of your code the \r\n\t * decoded text string should \r\n\t * be in your decodedClue variable\r\n\t * \r\n\t */\r\n\t \r\n\t myResponse = decodedMsg;\r\n\t \r\n\t ResponseTextView.setText(myResponse);\r\n\t \r\n\t\t // this code will cause a brief message to be displayed on the screen\r\n\t\t Toast.makeText(context, \"Msg Decoded : \"+ myResponse, \r\n\t\t \t\t Toast.LENGTH_LONG).show();\t\t \r\n \t}\r\n \r\n }",
"IMessage decode(byte[] data) throws InvalidMessageException;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//GENEND:|163getter|2| //GENBEGIN:|165getter|0|165preInit Returns an initiliazed instance of cmdGrafPagtosVoltar component. | public Command getCmdGrafPagtosVoltar() {
if (cmdGrafPagtosVoltar == null) {//GEN-END:|165-getter|0|165-preInit
// write pre-init user code here
cmdGrafPagtosVoltar = new Command("Voltar", Command.BACK, 0);//GEN-LINE:|165-getter|1|165-postInit
// write post-init user code here
}//GEN-BEGIN:|165-getter|2|
return cmdGrafPagtosVoltar;
} | [
"public Command getCmdFormVoltar() {\n if (cmdFormVoltar == null) {//GEN-END:|48-getter|0|48-preInit\n // write pre-init user code here\n cmdFormVoltar = new Command(\"Voltar\", Command.BACK, 0);//GEN-LINE:|48-getter|1|48-postInit\n // write post-init user code here\n }//GEN-BEGIN:|48-getter|2|\n return cmdFormVoltar;\n }",
"public Command getCmdExpVoltar() {\n if (cmdExpVoltar == null) {//GEN-END:|82-getter|0|82-preInit\n // write pre-init user code here\n cmdExpVoltar = new Command(\"Voltar\", Command.BACK, 0);//GEN-LINE:|82-getter|1|82-postInit\n // write post-init user code here\n }//GEN-BEGIN:|82-getter|2|\n return cmdExpVoltar;\n }",
"public Command getCmdFindVoltar() {\n if (cmdFindVoltar == null) {//GEN-END:|34-getter|0|34-preInit\n // write pre-init user code here\n cmdFindVoltar = new Command(\"Voltar\", Command.BACK, 1);//GEN-LINE:|34-getter|1|34-postInit\n // write post-init user code here\n }//GEN-BEGIN:|34-getter|2|\n return cmdFindVoltar;\n }",
"public Command getCmdGrafRecDespVoltar() {\n if (cmdGrafRecDespVoltar == null) {//GEN-END:|163-getter|0|163-preInit\n // write pre-init user code here\n cmdGrafRecDespVoltar = new Command(\"Voltar\", Command.BACK, 0);//GEN-LINE:|163-getter|1|163-postInit\n // write post-init user code here\n }//GEN-BEGIN:|163-getter|2|\n return cmdGrafRecDespVoltar;\n }",
"public Command getCmdTabelaVoltar() {\n if (cmdTabelaVoltar == null) {//GEN-END:|99-getter|0|99-preInit\n // write pre-init user code here\n cmdTabelaVoltar = new Command(\"Voltar\", Command.BACK, 0);//GEN-LINE:|99-getter|1|99-postInit\n // write post-init user code here\n }//GEN-BEGIN:|99-getter|2|\n return cmdTabelaVoltar;\n }",
"public VendasProdutos() {\n initComponents();\n }",
"public PBVAInit(MainController controller){\n\t\taddObserver(controller);\n\t}",
"public finalVotacao() {\n initComponents();\n }",
"public Pvcs() {\n super();\n pvcsProject = null;\n pvcsProjects = new Vector();\n workspace = null;\n repository = null;\n pvcsbin = null;\n force = null;\n promotiongroup = null;\n label = null;\n ignorerc = false;\n updateOnly = false;\n lineStart = \"\\\"P:\";\n filenameFormat = \"{0}-arc({1})\";\n }",
"public Deletevol() {\n initComponents();\n }",
"public NovoProduto() {\n\t\tinitComponents();\n\t}",
"public VJ_Prey()\n {\n }",
"public static void init(){\n new ServoNullCommand(0);\n new ServoPositionCommand(0,0);\n new ServoWaitMillisCommand(0,0);\n new ServoWaitSecCommand(0,0);\n new ValvePositionCommand(0,0);\n new ServoWaitSignalCommand(0, new ServoWaitSignalCommand.SignalTrigger(7, true));\n new ServoRestartCommand(0);\n }",
"public VistaRepartidor() {\n initComponents();\n }",
"public VITACareer()\r\n {\r\n }",
"void preInit();",
"public PreVisualizarTicketGui() {\n initComponents();\n }",
"public Voluntario() {\n super();\n this.livre = true;\n this.raio = 0;\n this.avaliacao = 0;\n this.numreviews = 0;\n\n //this.historico = new ArrayList<>() ;\n }",
"Vaisseau_seDeplacerVersLaGauche createVaisseau_seDeplacerVersLaGauche();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given primary type and mixin types satisfies the node type requirements of an event. | boolean matchesType( Name primaryType,
Set<Name> mixinTypes ); | [
"boolean isNodeType(InternalQName testTypeName, InternalQName primaryType);",
"protected abstract boolean hasElementsToCheckWithType();",
"boolean handlesEventsOfType(RuleEventType type);",
"public boolean isParameterTypesMatched(Object event) {\n return parameterTypes != null\n && parameterTypes[0] != null\n && parameterTypes.length == 1\n && parameterTypes[0].isAssignableFrom(event.getClass());\n }",
"boolean supportsEventType(Class<? extends ApplicationEvent> eventType);",
"private boolean nodeTypesAreDefined(String startNodeType, String endNodeType) {\n Set<NodeDefinition> nodes = this.schemaAssembler.getNodes();\n return nodes.contains(new NodeDefinition(startNodeType)) && nodes.contains(new NodeDefinition(endNodeType));\n }",
"public boolean isApplicableForNode(AbstractNode node);",
"@Override\n protected boolean acceptEvent(BuilderEvent event)\n {\n if (getEventType() == null)\n {\n return false;\n }\n assert event != null : \"Event is null!\";\n\n Class<?> eventClass = event.getClass();\n try\n {\n Method method = eventClass.getMethod(METHOD_TYPE);\n Object eventType = method.invoke(event);\n if (eventType instanceof Enum<?>)\n {\n return getEventType().equals(((Enum<?>) eventType).name());\n }\n }\n catch (Exception ex)\n {\n // All exceptions cause the event to be not accepted\n }\n\n return false;\n }",
"private boolean isChessclubSpecificEvent(GameEvent evt){\r\n return (evt instanceof CircleEvent) || (evt instanceof ArrowEvent);\r\n }",
"@Override\r\n\tpublic boolean isApplicable(Node node) {\r\n\t\treturn !VipsUtils.hasEventListener(node) && DomUtils.isLeafNode(node);\r\n\t}",
"@Override\n public final boolean includeNode( CachedNode node,\n NodeCache cache ) {\n Name nodePrimaryType = node.getPrimaryType(cache);\n Set<Name> mixinTypes = node.getMixinTypes(cache);\n return !node.isExcludedFromSearch(cache) && nodeTypes.isQueryable(nodePrimaryType, mixinTypes);\n }",
"public boolean canRun(NodeType type) {\n return childNodeTypes.contains(type);\n }",
"boolean hasParentArchetypeId();",
"private static boolean expectedInterfaceType(Expr e) {\n \t\treturn e.attrExpectedTyp() instanceof PscriptTypeInterface || e.attrExpectedTyp() instanceof PscriptTypeTypeParam;\n \t}",
"public boolean match(IntersectionType node, Object other) {\n if (!(other instanceof IntersectionType)) {\n return false;\n }\n IntersectionType o = (IntersectionType) other;\n return safeSubtreeListMatch(node.types(), o.types());\n }",
"public void testEventAdditionalTypes() throws Exception\n {\n checkEventTypeRegistration(EVENT_TYPE_BUILDER,\n \"testTree -> MOUSE, testTree -> CHANGE\");\n }",
"protected boolean hasEventNode(Event e, EventNode p){\n\t\treturn hasEventNode(e.id, p);\n\t}",
"boolean hasSubsubclass12();",
"private static boolean hasTypeAttrsInNodes(Element pParentE) {\r\n\t\tNodeList nl = pParentE.getChildNodes();\r\n\t\tif (nl == null || nl.getLength() == 0) return false;\r\n\t\tfor (int i = 0; i < nl.getLength(); i++) {\r\n\t\t\tNode n = nl.item(i);\r\n\t\t\tString name = n.getNodeName();\r\n\t\t\tif (\"VALUE\".equalsIgnoreCase(name) || \"VALUE.ARRAY\".equalsIgnoreCase(name)) {\r\n\t\t\t\tNamedNodeMap nm = n.getAttributes();\r\n\t\t\t\tif (nm != null\r\n\t\t\t\t\t\t&& (nm.getNamedItem(\"TYPE\") != null || nm.getNamedItem(\"PARAMTYPE\") != null)) return true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the specified Lua script into the script cache. Scripting | public Reply script_load(Object script0) throws RedisException {
if (version < SCRIPT_LOAD_VERSION) throw new RedisException("Server does not support SCRIPT_LOAD");
return (Reply) execute(SCRIPT_LOAD, new Command(SCRIPT_LOAD_BYTES, SCRIPT_LOAD2_BYTES, script0));
} | [
"public ListenableFuture<Reply> script_load(Object script0) throws RedisException {\n if (version < SCRIPT_LOAD_VERSION) throw new RedisException(\"Server does not support SCRIPT_LOAD\");\n return (ListenableFuture<Reply>) pipeline(SCRIPT_LOAD, new Command(SCRIPT_LOAD_BYTES, SCRIPT_LOAD2_BYTES, script0));\n }",
"void loadScript(URL url) throws IOException, ScriptRunnerException;",
"public void loadScriptFile()\r\n\t{\n\t\t\r\n\t\tif ( scriptDataFile.exists() ){\r\n\t\t\tif ( scriptDataFile.length() > 0 ){\r\n\t\t\t\t\r\n\t\t\t//Loading Existent BlockMap.\r\n\r\n\t\t\t\tscriptConfig.load();\r\n\t\t\t\t\r\n\t\t\t\tfor (String world : scriptConfig.getKeys()) {\r\n\t\t\t\t\tfor (String blockCoords : scriptConfig.getKeys(world+\".\") ) \r\n\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\tList <Object> macroList = scriptConfig.getList(world+\".\"+blockCoords+\".\") ;\r\n\t\t\t\t\t\tLinkedList<String> commandList = new LinkedList<String>() ;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor( int i = 0; i < macroList.size() ; i++ )\r\n\t\t\t\t\t\t\t{ commandList.add( String.valueOf( macroList.get(i) ) ); }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tmapManager.blocksMap.put(world+\",\"+blockCoords, commandList ) ;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlog.info(\"[\"+plugin.getName()+\"] \"+scriptDataFile.getName()+\" loaded !\");\r\n\t\t\t}\r\n\t\t\telse { log.info(\"[\"+plugin.getName()+\"] \"+scriptDataFile.getName()+\" is empty, loading aborded !\"); }\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\ttry { scriptDataFile.createNewFile() ; }\r\n\t\t\tcatch (IOException e) { e.printStackTrace(); }\r\n\t\t\t\r\n\t\t\tlog.info(\"[\"+plugin.getName()+\"] \"+scriptDataFile.getName()+\" created !\") ;\t\t\t\t\t\r\n\t\t}\r\n\r\n\t}",
"private void load(Script s,XThread xt,String scriptPath,String relPath,XPos pos) {\r\n\t// find script file\r\n\tif (! checkPath(scriptPath)) {\r\n\t xt.errors.error(Errors.CONTROL,pos,\"illegal script path\");\r\n\t return;\r\n\t}\r\n\t// try to find relative to relPath\r\n\ts.scriptPath = (relPath + \":\" + scriptPath).intern();\r\n\ts.fileName = scriptToFile(xt,s.scriptPath);\r\n\tif (! exists(s.fileName)) {\r\n\t // not found relative, so use absolute\r\n\t s.scriptPath = scriptPath;\r\n\t s.fileName = scriptToFile(xt,s.scriptPath);\r\n\t}\r\n\r\n\t// open script file\r\n\tXRFile r = new XRCFile(\"UTF-8\");\r\n\tif (! r.open(s.fileName)) {\r\n\t xt.errors.error(Errors.CONTROL,null,\"can't open \"+s.fileName);\r\n\t}\r\n\t\r\n\t// parse script\r\n\tFPosition fpos = new FPosition(FPosition.FSCRIPT,s.scriptPath);\r\n\tXDOMElement t = xt.parser.parse(r,true,fpos,null,null);\r\n\ts.tree = t;\r\n \r\n\t// bind script\r\n\tString myPath = s.scriptPath;\r\n\tint cpos = myPath.lastIndexOf(':');\r\n\tif (cpos != -1) {\r\n\t myPath = myPath.substring(0,cpos).intern();\r\n\t}\r\n\txt.bind.bind(s.tree,s.idx,myPath,xt.currentLang);\r\n }",
"private void loadScriptData() {\n // TODO: Read scripts from memory.\n scripts = new ArrayList<>();\n\n /* uncomment the line below if emulator is throwing a FileNotFoundException\n the file from internal storage. After running once, comment the line\n out again and the emulator issue should be resolved */\n // deleteFile();\n\n try {\n\n FileInputStream fis = CodeBoard.getContext().openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n\n // Taken from https://stackoverflow.com/questions/12384064/gson-convert-from-json-to-a-typed-arraylistt\n Type listType = new TypeToken<ArrayList<Script>>() {}.getType();\n\n // deserialize counters into an array list\n scripts = gson.fromJson(in, listType);\n\n }\n catch (FileNotFoundException e) {}\n }",
"void load (CacheEntry entry) throws IOException;",
"void loadChunk(String string, ScriptContext scriptContext)\n\t\t\tthrows ScriptException {\n\t\ttry {\n\t\t\tluaState.load(string, getChunkName(scriptContext));\n\t\t} catch (LuaException e) {\n\t\t\tthrow getScriptException(e);\n\t\t}\n\t}",
"public void externalScriptLoading(NodeImpl node);",
"void setScript(String script);",
"public void putScript(String script) {\n\t\ttry {\n\t\t\tscriptEngine.eval(script);\n\t\t} catch (ScriptException e) {\n\t\t\te.printStackTrace();\n\t\t\tLogger.getLogger(\"Map\").severe(\n\t\t\t\t\t\"There was a problem running the script: \" + e.getMessage() + \" on line: \" + e.getLineNumber());\n\t\t}\n\t}",
"public void setLoader(ClassLoader loader) {\n if(this.loader != loader) {\n this.classCache = new ClassCache<Script>(loader, this.classCache.getMax());\n }\n this.loader = loader;\n }",
"IScriptLoader getLoader();",
"public void loadMod(File modlocation);",
"@Override\n public boolean load(String address) {\n final String tag = address.substring(0, address.length() - cachePower);\n final String lineNo = address.substring(tag.length(), address.length() - blockPower);\n final String blockOffset = address.substring(address.length() - blockPower);\n if (cache.containsKey(lineNo) && cache.get(lineNo).equals(tag)) {\n return true;\n } else {\n cache.merge(lineNo, tag, (oldTag, newTag) -> newTag);\n return false;\n }\n }",
"private void loadAiScripts() {\n Collection<File> files = FileUtils.listFiles(new File(\"data/ai\"), new RegexFileFilter(\"^(.*?)\"), DirectoryFileFilter.DIRECTORY);\n for (File file : files)\n _aiScripts.put(FilenameUtils.getBaseName(file.getAbsolutePath()), file.getAbsolutePath());\n }",
"public abstract Source load(ModuleName name);",
"Cache start();",
"public interface LuaScript {\n\n /**\n * Execute this script using the given Jedis connection\n * @param jedis the Jedis connection to use\n * @return the result object from the executed script\n * @see Jedis#eval(String)\n */\n Object exec(Jedis jedis);\n}",
"@Override\n public Optional<Script> get(ScriptKey scriptKey) {\n CachedRowSet crsScript = getMetadataRepository().executeQuery(\n String.format(FETCH_BY_ID_QUERY, SQLTools.getStringForSQL(scriptKey.getScriptId())),\n \"reader\");\n try {\n if (crsScript.size() == 0) {\n return Optional.empty();\n } else if (crsScript.size() > 1) {\n log.warn(MessageFormat.format(\"Found multiple implementations for script {0}-{1}. Returning first implementation\", scriptKey.getScriptId(), scriptKey.getScriptVersion()));\n }\n crsScript.next();\n\n // Get the version\n Optional<ScriptVersion> scriptVersion = ScriptVersionConfiguration.getInstance().get(new ScriptVersionKey(new ScriptKey(scriptKey.getScriptId(), scriptKey.getScriptVersion())));\n if (!scriptVersion.isPresent()) {\n return Optional.empty();\n }\n\n // Get the actions\n List<Action> actions = ActionConfiguration.getInstance().getByScript(scriptKey);\n\n // Get parameters\n List<ScriptParameter> scriptParameters = ScriptParameterConfiguration.getInstance().getByScript(scriptKey);\n\n // Get labels\n List<ScriptLabel> scriptLabels = ScriptLabelConfiguration.getInstance().getByScript(scriptKey);\n\n Script script = new Script(\n scriptKey,\n new SecurityGroupKey(UUID.fromString(crsScript.getString(\"SECURITY_GROUP_ID\"))),\n crsScript.getString(\"SECURITY_GROUP_NAME\"),\n crsScript.getString(\"SCRIPT_NM\"),\n crsScript.getString(\"SCRIPT_DSC\"),\n scriptVersion.get(),\n scriptParameters,\n actions,\n scriptLabels);\n crsScript.close();\n return Optional.of(script);\n } catch (Exception e) {\n StringWriter stackTrace = new StringWriter();\n e.printStackTrace(new PrintWriter(stackTrace));\n\n log.info(String.format(\"exception=%s\", e));\n log.debug(String.format(\"exception.stacktrace=%s\", stackTrace));\n\n return Optional.empty();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the access patterns for the specified group | Collection getAccessPatternsInGroup(Object groupID) throws Exception; | [
"public static List getAccessPatternElementsInGroups(final QueryMetadataInterface metadata, Collection groups, boolean flatten) throws MetaMatrixComponentException, QueryMetadataException {\n \t\tList accessPatterns = null;\n \t\tIterator i = groups.iterator();\n \t\twhile (i.hasNext()){\n \t\t \n \t\t GroupSymbol group = (GroupSymbol)i.next();\n \t\t \n \t\t //Check this group for access pattern(s).\n \t\t Collection accessPatternIDs = metadata.getAccessPatternsInGroup(group.getMetadataID());\n \t\t if (accessPatternIDs != null && accessPatternIDs.size() > 0){\n \t\t Iterator j = accessPatternIDs.iterator();\n \t\t if (accessPatterns == null){\n \t\t accessPatterns = new ArrayList();\n \t\t }\n \t\t while (j.hasNext()) {\n \t\t \tList elements = metadata.getElementIDsInAccessPattern(j.next());\n \t\t \telements = resolveElements(group, metadata, elements);\n \t\t \tif (flatten) {\n \t\t \t\taccessPatterns.addAll(elements);\n \t\t \t} else {\n \t\t \t\taccessPatterns.add(new AccessPattern(elements));\n \t\t \t}\n \t\t }\n \t\t }\n \t\t}\n \n \t\treturn accessPatterns;\n \t}",
"public List<String> getGroupPermissions(String group) {\n try {\n ResultSet rs = this.getPreparedStatement(\"SELECT permissions FROM permissionDataG WHERE groupname='\" + group + \"';\").executeQuery();\n\n if (rs.next()) {\n return rs.getString(1).contains(\",\") ? Arrays.asList(rs.getString(1).split(\",\")) : Arrays.asList(rs.getString(1));\n }\n } catch (SQLException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n return null;\n }",
"protected abstract Collection<String> getGroupsOrRoles(Group group);",
"public List<String> getGroupMembers(final String groupPath);",
"public List<SecGroupright> getAllGroupRights();",
"public Integer getAccessGroup() {\n return accessGroup;\n }",
"public List<Method> getMethodsByGroupIncludesGgroup(String group) throws MiddlewareQueryException;",
"@RequestMapping(\"/api/list\")\n\tpublic Response api__list() {\n\t\tHttpServletRequest request = getRequest();\n\t\tString group = request.getParameter(\"group\");\n\t\tif (group == null) {\n\t\t\treturn Response.ERROR(\"01\", \"Group is required\");\n\t\t}\n\t\tMap<String, Map<String, ApiAccess>> apiPrivate = accessService.getPrivateAccess();\n\t\tMap<String, ApiAccess> result = apiPrivate.get(group);\n\t\treturn Response.SUCCESS(result);\n\t}",
"@ApiModelProperty(value = \"List of access groups that the user should belong to. Effect: The user will be assigned to each group that can be located. If a group does not already exist, it will NOT be created. \")\n public List<String> getAccessGroups() {\n return accessGroups;\n }",
"List<String> getGroups();",
"Collection<SessionAttribute> getGroupAttributes(Group group);",
"private Collection getAllOwnedPermissions(OpGroup group) {\r\n Set ownedPermissions = new HashSet(group.getOwnedPermissions());\r\n for (Iterator iterator = group.getSuperGroupAssignments().iterator(); iterator.hasNext();) {\r\n OpGroupAssignment assignment = (OpGroupAssignment) iterator.next();\r\n ownedPermissions.addAll(getAllOwnedPermissions(assignment.getSuperGroup()));\r\n }\r\n return ownedPermissions;\r\n }",
"@NonNull\n Request permission(String[]... groups);",
"String getSuGroupsAllowed();",
"ObjectPermissionSet getConnectionGroupPermissions()\n throws GuacamoleException;",
"public List<AccessRequest> getAccessRequests(Object groupIdOrPath) throws GitLabApiException {\n return (getAccessRequests(groupIdOrPath, getDefaultPerPage()).all());\n }",
"public List<Account> getAccounts(final AccountGroup group) {\n final List<Account> accountList = new ArrayList<>();\n final List<Account> list = getAccountList();\n \n for (Account account : list) {\n if (account.memberOf(group)) {\n accountList.add(account);\n }\n }\n \n return accountList;\n }",
"public static Set<String> getMatches( Pattern pattern, String input, Integer group )\n {\n group = group != null ? group : 0;\n \n Set<String> set = new HashSet<>();\n \n if ( input != null )\n {\n Matcher matcher = pattern.matcher( input );\n \n while ( matcher.find() )\n {\n set.add( matcher.group( group ) );\n }\n }\n \n return set;\n }",
"interface GROUPS {\n /**\n * This group define which users can access to the LW WCM editor application.\n * All users that belongs to this group have grant to access LW WCM Editor.\n * Users with membership MANAGER (@see Wcm.MANAGER) also have administrator role in LW WCM editor.\n */\n static final String WCM = (System.getProperty(\"wcm.groups.wcm\") == null ? \"/wcm\" : System.getProperty(\"wcm.groups.wcm\"));\n /**\n * Wildcard to refer all groups under Wcm.WCM.\n * Used for ACLs to define a grant for all groups under Wcm.WCM\n */\n\t\tstatic final String ALL = \"*\";\n /**\n * Users with membership MANAGER in @see Wcm.WCM group have administrator role in LW WCM editor.\n */\n static final String MANAGER = (System.getProperty(\"wcm.groups.manager\") == null ? \"manager\" : System.getProperty(\"wcm.groups.manager\"));\n /**\n * Users\n */\n static final String LOST = (System.getProperty(\"wcm.groups.lost\") == null ? \"/wcm/lost\" : System.getProperty(\"wcm.groups.lost\"));\n /**\n * Default editor\n */\n static final String EDITOR = (System.getProperty(\"wcm.groups.editor\") == null ? \"/wcm/editor\" : System.getProperty(\"wcm.groups.editor\"));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create translation matrix. The matrix's dimensions will be the same as the vector's dimensions plus one, on both sides. | public static Matrix translate(Vector vector) {
int size = vector.dimensions() + 1;
double[] data = identityData(size);
IntStream.range(0, size - 1)
.map(i -> (i + 1) * size - 1)
.forEach(i -> data[i] = vector.get(i / size));
data[size * size - 1] = 1.0;
return new Matrix(size, size, data);
} | [
"public static final CoordMatrix TranslationMatrix(Coords v) {\n\n\t\tint n = v.getLength();\n\t\tCoordMatrix m = new CoordMatrix(n + 1, n + 1);\n\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tm.set(i, i, 1.0);\n\t\t\tm.set(i, n + 1, v.get(i));\n\t\t}\n\t\tm.set(n + 1, n + 1, 1.0);\n\n\t\treturn m;\n\n\t}",
"public static final CoordMatrix TranslationMatrix(double[] v) {\n\n\t\treturn TranslationMatrix(new Coords(v));\n\n\t}",
"public static <T> TransMatrix<T> fromVector(PVector<T> x, PVector<T> y) {\n// T[][] data = (T[][]) new Object[][]{\n// {x.x, x.y}, {y.x, y.y}\n// };\n return valueOf(x.x, y.y, y.x, y.y, x.getCalculator());\n }",
"public static Matrix4 createTranslation(Vector3 translation)\n {\n return createTranslation(translation, null);\n }",
"public Punto transformar(Vector v)\n {\n return new Punto(x + v.x, y + v.y);\n }",
"private OpenGLMatrix createMatrix(float x, float y, float z, float u, float v, float w) {\n return OpenGLMatrix.translation(x, y, z).\n multiplied(Orientation.getRotationMatrix(\n AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES, u, v, w));\n }",
"public void addTranslation(Vector3D vec){\n if(vec.getNumDimensions() !=3){\n throw new IllegalArgumentException(\n \"Transformation::addTranslation(): vec must have 3 dimensions, has \"\n + vec.getNumDimensions());\n }\n BigDecimal one = BigDecimal.ONE;\n BigDecimal zero = BigDecimal.ZERO;\n Double[][] mat = {{1.0, 0.0, 0.0, vec.getValue(0)},\n {0.0, 1.0, 0.0, vec.getValue(1)},\n {0.0, 0.0, 1.0, vec.getValue(2)},\n {0.0, 0.0, 0.0, 1.0 }};\n addTransformation(new Translation(new Matrix(mat)));\n }",
"public OpenGLMatrix createMatrix(float x, float y, float z, float u, float v, float w) {\n return OpenGLMatrix.translation(x, y, z).\n multiplied(Orientation.getRotationMatrix(\n AxesReference.EXTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES, u, v, w));\n }",
"public Transform translate(Vec3 vector){\n\t\tposition.add(vector);\n\t\t//propogate to listeners\n\t\tpropogateListeners(null, vector.x, vector.y, vector.z, 1,1,1);\n\t\treturn this;\n\t}",
"public static TransformMatrix translationMatrix(float x, float y) {\n\t\treturn new TransformMatrix(1,1,x,y);\n\t}",
"public static Matrix3D createTranslationMatrix(double tx, double ty, double tz) {\n Matrix3D matrix = new Matrix3D();\n matrix.matrix[0][0] = 1.0;\n matrix.matrix[0][1] = 0.0;\n matrix.matrix[0][2] = 0.0;\n matrix.matrix[0][3] = tx;\n\n matrix.matrix[1][0] = 0.0;\n matrix.matrix[1][1] = 1.0;\n matrix.matrix[1][2] = 0.0;\n matrix.matrix[1][3] = ty;\n\n matrix.matrix[2][0] = 0.0;\n matrix.matrix[2][1] = 0.0;\n matrix.matrix[2][2] = 1.0;\n matrix.matrix[2][3] = tz;\n\n matrix.matrix[3][0] = 0.0;\n matrix.matrix[3][1] = 0.0;\n matrix.matrix[3][2] = 0.0;\n matrix.matrix[3][3] = 1.0;\n\n return matrix;\n }",
"public Matrix(int translateX, int translateY) {\n this.translateX = translateX;\n this.translateY = translateY;\n }",
"public static Matrix createMatrix(int[][] vector, int row, int col){\n\n\t\tMatrix matrix = new Matrix(row, col, vector[0].length);\n\t\t\n\t\tint k=0;\n\t\tfor(int i=0; i<row; i++){\n\t\t\tfor(int j=0; j<col; j++){\n\t\t\t\tmatrix.pixels[i][j] = vector[k].clone();\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn matrix;\n\t}",
"public static Transform newTranslation(Vec3 tr){\n return newTranslation(tr.x, tr.y, tr.z);\n }",
"public static double[][] createMatrix(double[] vector) {\r\n int N = (int)vector[0];\r\n int M = (int)vector[1];\r\n double[][] matrix = new double[N][M];\r\n int i = 2;\r\n while(i < vector.length){\r\n for(int row = 0; row < N; row++){\r\n for(int col = 0; col < M; col++){\r\n matrix[row][col] = vector[i];\r\n i++;\r\n }\r\n }\r\n }\r\n return matrix;\r\n }",
"public final Shape translate(Vector fromPoint, Vector toPoint) {\n\t\treturn transform(new Translation(fromPoint, toPoint));\n\t}",
"public Vector3D transform(Vector3D vector) {\n\t\tdouble x = vector.x;\n\t\tdouble y = vector.y;\n\t\tdouble z = vector.z;\n\t\t\n\t\treturn new Vector3D(a11*x + a12*y + a13*z + a14, \n\t\t\t\t\t\t a21*x + a22*y + a23*z + a24,\n\t\t\t\t\t\t a31*x + a32*y + a33*z + a34);\n\t}",
"private static AffineTransform getAffineTransform(Vector v) {\n float f[] = new float[6];\n for (int i = 0; i < 6; i++) {\n f[i] = ((Number) v.elementAt(i)).floatValue();\n }\n return new AffineTransform(f);\n }",
"private double[][] createT() {\n double[][] transMatrix = matrix.createInitMatrix();\n transMatrix[0][3] = -Px;\n transMatrix[1][3] = -Py;\n transMatrix[2][3] = -Pz;\n return transMatrix;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__XTypeLiteral__TypeAssignment_3" $ANTLR start "rule__XTypeLiteral__ArrayDimensionsAssignment_4" InternalDroneScript.g:19056:1: rule__XTypeLiteral__ArrayDimensionsAssignment_4 : ( ruleArrayBrackets ) ; | public final void rule__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalDroneScript.g:19060:1: ( ( ruleArrayBrackets ) )
// InternalDroneScript.g:19061:2: ( ruleArrayBrackets )
{
// InternalDroneScript.g:19061:2: ( ruleArrayBrackets )
// InternalDroneScript.g:19062:3: ruleArrayBrackets
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0());
}
pushFollow(FOLLOW_2);
ruleArrayBrackets();
state._fsp--;
if (state.failed) return ;
if ( state.backtracking==0 ) {
after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0());
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:18609:1: ( ( ruleArrayBrackets ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:18610:1: ( ruleArrayBrackets )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:18610:1: ( ruleArrayBrackets )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:18611:1: ruleArrayBrackets\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); \n }\n pushFollow(FOLLOW_ruleArrayBrackets_in_rule__XTypeLiteral__ArrayDimensionsAssignment_437513);\n ruleArrayBrackets();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_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__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:16724:1: ( ( ruleArrayBrackets ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:16725:1: ( ruleArrayBrackets )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:16725:1: ( ruleArrayBrackets )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:16726:1: ruleArrayBrackets\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); \n }\n pushFollow(FOLLOW_ruleArrayBrackets_in_rule__XTypeLiteral__ArrayDimensionsAssignment_433690);\n ruleArrayBrackets();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_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__XTypeLiteral__ArrayDimensionsAssignment_4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:17576:1: ( ( ruleArrayBrackets ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:17577:1: ( ruleArrayBrackets )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:17577:1: ( ruleArrayBrackets )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:17578:1: ruleArrayBrackets\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); \n }\n pushFollow(FOLLOW_ruleArrayBrackets_in_rule__XTypeLiteral__ArrayDimensionsAssignment_435423);\n ruleArrayBrackets();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_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__XTypeLiteral__Group__4__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12659:1: ( ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* ) )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12660:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n {\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12660:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12661:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \n }\n // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12662:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n loop90:\n do {\n int alt90=2;\n int LA90_0 = input.LA(1);\n\n if ( (LA90_0==57) ) {\n alt90=1;\n }\n\n\n switch (alt90) {\n \tcase 1 :\n \t // ../org.xtext.example.helloxcore.ui/src-gen/org/xtext/example/helloxcore/ui/contentassist/antlr/internal/InternalHelloXcore.g:12662:2: rule__XTypeLiteral__ArrayDimensionsAssignment_4\n \t {\n \t pushFollow(FOLLOW_rule__XTypeLiteral__ArrayDimensionsAssignment_4_in_rule__XTypeLiteral__Group__4__Impl25582);\n \t rule__XTypeLiteral__ArrayDimensionsAssignment_4();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop90;\n }\n } while (true);\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \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__XTypeLiteral__Group__4__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14737:1: ( ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14738:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14738:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14739:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14740:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\r\n loop94:\r\n do {\r\n int alt94=2;\r\n int LA94_0 = input.LA(1);\r\n\r\n if ( (LA94_0==104) ) {\r\n alt94=1;\r\n }\r\n\r\n\r\n switch (alt94) {\r\n \tcase 1 :\r\n \t // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:14740:2: rule__XTypeLiteral__ArrayDimensionsAssignment_4\r\n \t {\r\n \t pushFollow(FOLLOW_rule__XTypeLiteral__ArrayDimensionsAssignment_4_in_rule__XTypeLiteral__Group__4__Impl29848);\r\n \t rule__XTypeLiteral__ArrayDimensionsAssignment_4();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return ;\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop94;\r\n }\r\n } while (true);\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \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__XTypeLiteral__Group__4__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13368:1: ( ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* ) )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13369:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n {\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13369:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13370:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \n }\n // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13371:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n loop97:\n do {\n int alt97=2;\n int LA97_0 = input.LA(1);\n\n if ( (LA97_0==57) ) {\n alt97=1;\n }\n\n\n switch (alt97) {\n \tcase 1 :\n \t // ../org.xtext.mongobeans.ui/src-gen/org/xtext/mongobeans/ui/contentassist/antlr/internal/InternalMongoBeans.g:13371:2: rule__XTypeLiteral__ArrayDimensionsAssignment_4\n \t {\n \t pushFollow(FOLLOW_rule__XTypeLiteral__ArrayDimensionsAssignment_4_in_rule__XTypeLiteral__Group__4__Impl27023);\n \t rule__XTypeLiteral__ArrayDimensionsAssignment_4();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop97;\n }\n } while (true);\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \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__XTypeLiteral__Group__4__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14265:1: ( ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* ) )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14266:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14266:1: ( ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )* )\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14267:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \n }\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14268:1: ( rule__XTypeLiteral__ArrayDimensionsAssignment_4 )*\n loop103:\n do {\n int alt103=2;\n int LA103_0 = input.LA(1);\n\n if ( (LA103_0==61) ) {\n alt103=1;\n }\n\n\n switch (alt103) {\n \tcase 1 :\n \t // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:14268:2: rule__XTypeLiteral__ArrayDimensionsAssignment_4\n \t {\n \t pushFollow(FOLLOW_rule__XTypeLiteral__ArrayDimensionsAssignment_4_in_rule__XTypeLiteral__Group__4__Impl28836);\n \t rule__XTypeLiteral__ArrayDimensionsAssignment_4();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop103;\n }\n } while (true);\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsAssignment_4()); \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__TypeRef__IsArrayAssignment_1_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9344:1: ( ( ( '[]' ) ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9345:1: ( ( '[]' ) )\r\n {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9345:1: ( ( '[]' ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9346:1: ( '[]' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_1_1_0()); \r\n }\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9347:1: ( '[]' )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9348:1: '[]'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_1_1_0()); \r\n }\r\n match(input,70,FOLLOW_70_in_rule__TypeRef__IsArrayAssignment_1_118736); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_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__TypeRef__IsArrayAssignment_2_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9367:1: ( ( ( '[]' ) ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9368:1: ( ( '[]' ) )\r\n {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9368:1: ( ( '[]' ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9369:1: ( '[]' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_2_1_0()); \r\n }\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9370:1: ( '[]' )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9371:1: '[]'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_2_1_0()); \r\n }\r\n match(input,70,FOLLOW_70_in_rule__TypeRef__IsArrayAssignment_2_118780); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_2_1_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_2_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__ArrayType__ElemtypeAssignment_3() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:15920:1: ( ( ruleElementType ) )\r\n // InternalGo.g:15921:2: ( ruleElementType )\r\n {\r\n // InternalGo.g:15921:2: ( ruleElementType )\r\n // InternalGo.g:15922:3: ruleElementType\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getArrayTypeAccess().getElemtypeElementTypeParserRuleCall_3_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleElementType();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getArrayTypeAccess().getElemtypeElementTypeParserRuleCall_3_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__LiteralType__ArraytypeAssignment_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:18560:1: ( ( ruleArrayType ) )\r\n // InternalGo.g:18561:2: ( ruleArrayType )\r\n {\r\n // InternalGo.g:18561:2: ( ruleArrayType )\r\n // InternalGo.g:18562:3: ruleArrayType\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getLiteralTypeAccess().getArraytypeArrayTypeParserRuleCall_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleArrayType();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getLiteralTypeAccess().getArraytypeArrayTypeParserRuleCall_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 EObject ruleXTypeLiteral() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n Token otherlv_2=null;\n Token otherlv_5=null;\n AntlrDatatypeRuleToken lv_arrayDimensions_4_0 = null;\n\n\n enterRule(); \n \n try {\n // InternalDsl.g:8157:28: ( ( () otherlv_1= 'typeof' otherlv_2= '(' ( ( ruleQualifiedName ) ) ( (lv_arrayDimensions_4_0= ruleArrayBrackets ) )* otherlv_5= ')' ) )\n // InternalDsl.g:8158:1: ( () otherlv_1= 'typeof' otherlv_2= '(' ( ( ruleQualifiedName ) ) ( (lv_arrayDimensions_4_0= ruleArrayBrackets ) )* otherlv_5= ')' )\n {\n // InternalDsl.g:8158:1: ( () otherlv_1= 'typeof' otherlv_2= '(' ( ( ruleQualifiedName ) ) ( (lv_arrayDimensions_4_0= ruleArrayBrackets ) )* otherlv_5= ')' )\n // InternalDsl.g:8158:2: () otherlv_1= 'typeof' otherlv_2= '(' ( ( ruleQualifiedName ) ) ( (lv_arrayDimensions_4_0= ruleArrayBrackets ) )* otherlv_5= ')'\n {\n // InternalDsl.g:8158:2: ()\n // InternalDsl.g:8159:5: \n {\n if ( state.backtracking==0 ) {\n\n current = forceCreateModelElement(\n grammarAccess.getXTypeLiteralAccess().getXTypeLiteralAction_0(),\n current);\n \n }\n\n }\n\n otherlv_1=(Token)match(input,114,FOLLOW_85); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_1, grammarAccess.getXTypeLiteralAccess().getTypeofKeyword_1());\n \n }\n otherlv_2=(Token)match(input,30,FOLLOW_6); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_2, grammarAccess.getXTypeLiteralAccess().getLeftParenthesisKeyword_2());\n \n }\n // InternalDsl.g:8172:1: ( ( ruleQualifiedName ) )\n // InternalDsl.g:8173:1: ( ruleQualifiedName )\n {\n // InternalDsl.g:8173:1: ( ruleQualifiedName )\n // InternalDsl.g:8174:3: ruleQualifiedName\n {\n if ( state.backtracking==0 ) {\n\n \t\t\tif (current==null) {\n \t current = createModelElement(grammarAccess.getXTypeLiteralRule());\n \t }\n \n }\n if ( state.backtracking==0 ) {\n \n \t newCompositeNode(grammarAccess.getXTypeLiteralAccess().getTypeJvmTypeCrossReference_3_0()); \n \t \n }\n pushFollow(FOLLOW_102);\n ruleQualifiedName();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n \n \t afterParserOrEnumRuleCall();\n \t \n }\n\n }\n\n\n }\n\n // InternalDsl.g:8187:2: ( (lv_arrayDimensions_4_0= ruleArrayBrackets ) )*\n loop135:\n do {\n int alt135=2;\n int LA135_0 = input.LA(1);\n\n if ( (LA135_0==15) ) {\n alt135=1;\n }\n\n\n switch (alt135) {\n \tcase 1 :\n \t // InternalDsl.g:8188:1: (lv_arrayDimensions_4_0= ruleArrayBrackets )\n \t {\n \t // InternalDsl.g:8188:1: (lv_arrayDimensions_4_0= ruleArrayBrackets )\n \t // InternalDsl.g:8189:3: lv_arrayDimensions_4_0= ruleArrayBrackets\n \t {\n \t if ( state.backtracking==0 ) {\n \t \n \t \t newCompositeNode(grammarAccess.getXTypeLiteralAccess().getArrayDimensionsArrayBracketsParserRuleCall_4_0()); \n \t \t \n \t }\n \t pushFollow(FOLLOW_102);\n \t lv_arrayDimensions_4_0=ruleArrayBrackets();\n\n \t state._fsp--;\n \t if (state.failed) return current;\n \t if ( state.backtracking==0 ) {\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getXTypeLiteralRule());\n \t \t }\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"arrayDimensions\",\n \t \t\tlv_arrayDimensions_4_0, \n \t \t\t\"org.eclipse.xtext.xbase.Xtype.ArrayBrackets\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n \t }\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop135;\n }\n } while (true);\n\n otherlv_5=(Token)match(input,31,FOLLOW_2); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_5, grammarAccess.getXTypeLiteralAccess().getRightParenthesisKeyword_5());\n \n }\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public final void rule__TypeRef__IsArrayAssignment_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9321:1: ( ( ( '[]' ) ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9322:1: ( ( '[]' ) )\r\n {\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9322:1: ( ( '[]' ) )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9323:1: ( '[]' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_0_1_0()); \r\n }\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9324:1: ( '[]' )\r\n // ../org.waml.w3c.webidl.ui/src-gen/org/waml/w3c/webidl/ui/contentassist/antlr/internal/InternalWebIDL.g:9325:1: '[]'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_0_1_0()); \r\n }\r\n match(input,70,FOLLOW_70_in_rule__TypeRef__IsArrayAssignment_0_118692); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeRefAccess().getIsArrayLeftSquareBracketRightSquareBracketKeyword_0_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__JvmTypeReference__Group_0_1_0__1__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:15345:1: ( ( ruleArrayBrackets ) )\r\n // InternalDroneScript.g:15346:1: ( ruleArrayBrackets )\r\n {\r\n // InternalDroneScript.g:15346:1: ( ruleArrayBrackets )\r\n // InternalDroneScript.g:15347:2: ruleArrayBrackets\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getJvmTypeReferenceAccess().getArrayBracketsParserRuleCall_0_1_0_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleArrayBrackets();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getJvmTypeReferenceAccess().getArrayBracketsParserRuleCall_0_1_0_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 AntlrDatatypeRuleToken ruleArrayBrackets() throws RecognitionException {\n AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();\n\n Token kw=null;\n Token this_ID_1=null;\n\n enterRule(); \n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_SL_COMMENT\", \"RULE_WS\");\n \n try {\n // ../com.euclideanspace.pbase/src-gen/com/euclideanspace/pbase/parser/antlr/internal/InternalTutorial.g:6331:28: ( (kw= '[' this_ID_1= RULE_ID kw= ']' ) )\n // ../com.euclideanspace.pbase/src-gen/com/euclideanspace/pbase/parser/antlr/internal/InternalTutorial.g:6332:1: (kw= '[' this_ID_1= RULE_ID kw= ']' )\n {\n // ../com.euclideanspace.pbase/src-gen/com/euclideanspace/pbase/parser/antlr/internal/InternalTutorial.g:6332:1: (kw= '[' this_ID_1= RULE_ID kw= ']' )\n // ../com.euclideanspace.pbase/src-gen/com/euclideanspace/pbase/parser/antlr/internal/InternalTutorial.g:6333:2: kw= '[' this_ID_1= RULE_ID kw= ']'\n {\n kw=(Token)match(input,68,FOLLOW_68_in_ruleArrayBrackets14018); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current.merge(kw);\n newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getLeftSquareBracketKeyword_0()); \n \n }\n this_ID_1=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArrayBrackets14033); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t\tcurrent.merge(this_ID_1);\n \n }\n if ( state.backtracking==0 ) {\n \n newLeafNode(this_ID_1, grammarAccess.getArrayBracketsAccess().getIDTerminalRuleCall_1()); \n \n }\n kw=(Token)match(input,69,FOLLOW_69_in_ruleArrayBrackets14051); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current.merge(kw);\n newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getRightSquareBracketKeyword_2()); \n \n }\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n\n \tmyHiddenTokenState.restore();\n\n }\n return current;\n }",
"public final void rule__Property__ManyAssignment_4() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27708:1: ( ( ( '[]' ) ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27709:1: ( ( '[]' ) )\r\n {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27709:1: ( ( '[]' ) )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27710:1: ( '[]' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); \r\n }\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27711:1: ( '[]' )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:27712:1: '[]'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); \r\n }\r\n match(input,158,FOLLOW_158_in_rule__Property__ManyAssignment_455612); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getPropertyAccess().getManyLeftSquareBracketRightSquareBracketKeyword_4_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 void array() throws SyntaxException{\n if(cursor.getType().equals(TokenType.RIGHT_BRACKET))\n return;\n else\n {\n elements();\n match(TokenType.RIGHT_BRACKET);\n }\n }",
"public final EObject ruleNamedTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_typeReference_0_0 = null;\n\n EObject lv_dimensions_2_0 = null;\n\n EObject lv_dimensions_4_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2315:6: ( ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:1: ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:1: ( ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:2: ( (lv_typeReference_0_0= ruleQualifiedName ) ) ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2316:2: ( (lv_typeReference_0_0= ruleQualifiedName ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2317:1: (lv_typeReference_0_0= ruleQualifiedName )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2317:1: (lv_typeReference_0_0= ruleQualifiedName )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2318:3: lv_typeReference_0_0= ruleQualifiedName\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getTypeReferenceQualifiedNameParserRuleCall_0_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleQualifiedName_in_ruleNamedTypeSpecifier4040);\n lv_typeReference_0_0=ruleQualifiedName();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"typeReference\",\n \t \t\tlv_typeReference_0_0, \n \t \t\t\"QualifiedName\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2340:2: ( '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt37=2;\n int LA37_0 = input.LA(1);\n\n if ( (LA37_0==33) ) {\n alt37=1;\n }\n switch (alt37) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2340:4: '[' ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleNamedTypeSpecifier4051); \n\n createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getLeftSquareBracketKeyword_1_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2344:1: ( (lv_dimensions_2_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2345:1: (lv_dimensions_2_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2345:1: (lv_dimensions_2_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2346:3: lv_dimensions_2_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_1_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleNamedTypeSpecifier4072);\n lv_dimensions_2_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_2_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2368:2: ( ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) ) )*\n loop36:\n do {\n int alt36=2;\n int LA36_0 = input.LA(1);\n\n if ( (LA36_0==14) ) {\n alt36=1;\n }\n\n\n switch (alt36) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2368:4: ',' ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleNamedTypeSpecifier4083); \n\n \t createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getCommaKeyword_1_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2372:1: ( (lv_dimensions_4_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2373:1: (lv_dimensions_4_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2373:1: (lv_dimensions_4_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2374:3: lv_dimensions_4_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getNamedTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_1_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleNamedTypeSpecifier4104);\n \t lv_dimensions_4_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getNamedTypeSpecifierRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"dimensions\",\n \t \t \t\tlv_dimensions_4_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop36;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleNamedTypeSpecifier4116); \n\n createLeafNode(grammarAccess.getNamedTypeSpecifierAccess().getRightSquareBracketKeyword_1_3(), null); \n \n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"public final AntlrDatatypeRuleToken ruleArrayBrackets() throws RecognitionException {\n AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();\n\n Token kw=null;\n\n enterRule(); \n \n try {\n // ../org.xtext.scripting/src-gen/org/xtext/scripting/parser/antlr/internal/InternalScripting.g:5226:28: ( (kw= '[' kw= ']' ) )\n // ../org.xtext.scripting/src-gen/org/xtext/scripting/parser/antlr/internal/InternalScripting.g:5227:1: (kw= '[' kw= ']' )\n {\n // ../org.xtext.scripting/src-gen/org/xtext/scripting/parser/antlr/internal/InternalScripting.g:5227:1: (kw= '[' kw= ']' )\n // ../org.xtext.scripting/src-gen/org/xtext/scripting/parser/antlr/internal/InternalScripting.g:5228:2: kw= '[' kw= ']'\n {\n kw=(Token)match(input,55,FOLLOW_55_in_ruleArrayBrackets12552); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current.merge(kw);\n newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getLeftSquareBracketKeyword_0()); \n \n }\n kw=(Token)match(input,56,FOLLOW_56_in_ruleArrayBrackets12565); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current.merge(kw);\n newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getRightSquareBracketKeyword_1()); \n \n }\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ If the opponent loses, we assume that his attack will change, we calculate what more possibilities would have to win or draw and we raise the probability by a 10% | static void prob() {
if (Main.result == true) {
if (Main.lastTwo[Main.i - 1] == 0) {
// If he changes to scissors, we draw, but if he changes to paper, we won
Main.scissors += 0.10;
} else if (Main.lastTwo[Main.i - 1] == 1) {
// If he changes to rock, we draw, but if he changes to scissors, we won
Main.rock += 0.10;
} else if (Main.lastTwo[Main.i - 1] == 2) {
// If he changes to paper, we draw, but if he changes to rock, we won
Main.paper += 0.10;
}
} else {
/*
* If he won we assume that he will continue with the same thing so we increase
* the percentage to what is best
*/
if (Main.lastTwo[Main.i - 1] == 0) {
Main.paper += 0.10;
} else if (Main.lastTwo[Main.i - 1] == 1) {
Main.scissors += 0.10;
} else if (Main.lastTwo[Main.i - 1] == 2) {
Main.rock += 0.10;
}
}
/*
* If in the last two rounds the opponent's shots were the same, we assume that
* it will change and we increase the probability to what would have the maximum
* chance of a draw or victory. And as it is more normal instead of increasing
* 10% we increase 15%
*/
if (Main.lastTwo[0] == Main.lastTwo[1]) {
if (Main.lastTwo[0] == 0) {
/*
* If the last two rounds he was going with rock, what is more likely to win or
* tie is scissors
*/
Main.scissors += 0.15;
} else if (Main.lastTwo[0] == 1) {
/*
* If the last two rounds he was going with paper, what is more
* likely to win or tie is rock
*/
Main.rock += 0.15;
} else if (Main.lastTwo[0] == 2) {
/*
* If the last two rounds he was going with scissors, what is more likely to win or
* tie is paper
*/
Main.paper += 0.15;
}
}
} | [
"private void adjustStrategy(String playerMove) {\n Move pMove = decider.convertMove(playerMove);\n switch (pMove) {\n case ROCK: {\n switch (decider.playerWins(pMove, aiPreviousMove)) {\n //Player loses by selecting rock\n case -1: {\n if (alternateAfterLose > repeatAfterLose) {\n rChance += matchRate;\n pChance -= (matchRate / 2);\n } else if (repeatAfterLose > alternateAfterLose) {\n rChance -= (matchRate / 2);\n pChance += matchRate;\n }\n break;\n }\n\n //Player wins by selecting rock\n case 1: {\n if (repeatAfterWin > alternateAfterWin) {\n rChance -= (matchRate / 2);\n pChance += matchRate;\n } else if (alternateAfterWin > repeatAfterWin) {\n rChance += matchRate;\n pChance -= (matchRate / 2);\n }\n break;\n }\n }\n }\n\n case PAPER: {\n switch (decider.playerWins(pMove, aiPreviousMove)) {\n //Player Win with paper\n case 1: {\n if (repeatAfterWin > alternateAfterWin) {\n rChance -= (matchRate / 2);\n pChance += matchRate;\n } else if (alternateAfterWin > repeatAfterWin) {\n rChance += matchRate;\n pChance -= (matchRate / 2);\n }\n break;\n }\n\n //Player Lose with paper\n case -1: {\n if (alternateAfterLose > repeatAfterLose) {\n rChance += matchRate;\n pChance -= (matchRate / 2);\n } else if (repeatAfterLose > alternateAfterLose) {\n rChance -= (matchRate / 2);\n pChance += matchRate;\n }\n break;\n }\n }\n }\n\n case SCISSORS: {\n switch (decider.playerWins(pMove, aiPreviousMove)) {\n //Player Lose with scissors\n case -1: {\n if (alternateAfterLose > repeatAfterLose) {\n rChance += (matchRate * (2 / 3));\n pChance += matchRate * (2 / 3);\n } else if (repeatAfterLose > alternateAfterLose) {\n rChance -= (matchRate * (2 / 3));\n pChance -= matchRate * (2 / 3);\n }\n break;\n }\n\n //Player Win with scissors\n case 1: {\n if (repeatAfterWin > alternateAfterWin) {\n rChance -= (matchRate * (2 / 3));\n pChance -= matchRate * (2 / 3);\n } else if (alternateAfterWin > repeatAfterWin) {\n rChance += (matchRate * (2 / 3));\n pChance += matchRate * (2 / 3);\n }\n break;\n }\n }\n }\n }\n }",
"public void calculateWinningChance(){\r\n\t\tthis.tree.calculateWinningChance();\r\n\t}",
"int getMinigameDefenseChancesLeft();",
"public void win(){\n //multiple of 10 to multiply by \n final int MULTIPLE_OF_TEN = 10;\n //if the confidence is less than 10 then increment the \n //confidence \n if(confidence < MULTIPLE_OF_TEN)\n confidence++;\n //if the confidence has reached 10 then stay at 10\n else if(confidence >= MULTIPLE_OF_TEN)\n confidence = MULTIPLE_OF_TEN;\n }",
"private boolean checkGreedyWinRate() {\r\n return myTotal.get(0) > enTotal.get(0)+2 && (myself.health > 50 || myself.health > opponent.health);\r\n }",
"@Override\n public double attackingDamage() {\n double chanceOfSkill = this.percentageOfAttacking(MIN_BOUNDER_PERCENTAGE, MAX_BOUNDER_PERCENTAGE) * 100;\n if (chanceOfSkill < NUMBER_OF_PERCENTAGE_ATTACK ) {\n return this.getAttackPoints() * 3;\n }\n return this.getAttackPoints();\n }",
"public void testVictory() {\n Team p = null;\n //test for each player\n for (int i = 0; i < teams.size(); i++) {\n Team te = teams.get(i);\n //place here victory condition\n int score = te.getScore();\n int tilesOwned = te.getNCells();\n int totalTile = map.getTakableCells().size();\n //pass the time test\n //if(victTime!=0 && dateG <= victTime*fpsa){\n //Pass the score test\n if (score != 0 && score >= victScore) {\n //Pass the tile test\n if (((double)tilesOwned) / totalTile >= victTile) {\n if (p != null) {\n endGame(null);\n return;\n } else {\n p = te;\n }\n }\n }\n //}\n if (victTime != 0 && this.getThread().getCount() > victTime * 1000) {\n System.out.println(\"Time out !\");\n endGame(null);\n return;\n }\n }\n\n\n if (p != null) {\n endGame(p);\n return;\n }\n }",
"public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }",
"private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }",
"float genChance();",
"public void checkForVictory() {\n\t\tif (!isWon) {\n\t\t\tfor (Ship s : ships) {\n\t\t\t\tif (s.hasWon(score_needed)) {\n\t\t\t\t\twinner = s;\n\t\t\t\t\tColor winnerColour = s.getColour();\n\t\t\t\t\tBufferGraphics.setColor(winnerColour);\n\t\t\t\t\tBufferGraphics.drawString(\"Winner\", 100, 180);\n\t\t\t\t\tisWon = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tColor winnerColour = winner.getColour();\n\t\t\tBufferGraphics.setColor(winnerColour);\n\t\t\tBufferGraphics.drawString(\"Winner\", 100, 180);\n\t\t\t// for(Ship s : ships){\n\t\t\t// if (s != winner){\n\t\t\t// s.setTarget(winner);\n\t\t\t// s.setWeapon(SceneObject.WeaponType.BULLET);\n\t\t\t// }\n\t\t\t// }\n\t\t}\n\t}",
"private void simulateGameOver() {\n\t\tfor (int i = 0; i < NBR_OF_PAIRS; i++) {\n\t\t\tcontroller.correctGuess();\n\t\t}\n\t}",
"private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }",
"public void pillowAttack()\r\n {\r\n Interface.setDialog(\"A huge pillow is comming right at you!\");\r\n if (player.getStaStat() >= 1) \r\n {\r\n player.addStat(\"staStat\", -1);\r\n Interface.setDialog(\"You did not sleep enough during the night, your pillow comes back to haunt you. You lose one energy point\");\r\n }\r\n else Interface.setDialog(\"GAME OVER\"); \r\n }",
"void win() {\n\t\t_money += _bet * 2;\n\t\t_wins++;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}",
"double getMissChance();",
"public void attack(Player enemy, int enemyMove){\r\n float damageDealth = 0;\r\n boolean willAttack = false;\r\n float ifAttack = 0;\r\n float superEff = 0;\r\n float notEff = 0;\r\n Random randNum = new Random();\r\n String attackName = \"\";\r\n switch(enemyMove){\r\n case 1: damageDealth = (monster.attack + monster.move1.power - enemy.monster.defense);\r\n attackName = monster.move1.name;\r\n ifAttack = randNum.nextFloat() * 1.0f;\r\n if (monster.move1.accuracy > ifAttack){\r\n willAttack = true;\r\n }\r\n break;\r\n case 2: damageDealth = (monster.attack + monster.move2.power - enemy.monster.defense);\r\n attackName = monster.move2.name;\r\n ifAttack = randNum.nextFloat() * 1.0f;\r\n if (monster.move2.accuracy > ifAttack){\r\n willAttack = true;\r\n }\r\n break;\r\n case 3: damageDealth = (monster.attack + monster.move3.power - enemy.monster.defense);\r\n attackName = monster.move3.name;\r\n ifAttack = randNum.nextFloat() * 1.0f;\r\n if (monster.move3.accuracy > ifAttack){\r\n willAttack = true;\r\n }\r\n break;\r\n case 4: damageDealth = (monster.attack + monster.move4.power - enemy.monster.defense);\r\n attackName = monster.move4.name;\r\n ifAttack = randNum.nextFloat() * 1.0f;\r\n if (monster.move4.accuracy > ifAttack){\r\n willAttack = true;\r\n }\r\n break;\r\n case 5: willAttack = false;\r\n monster.hp += 50;\r\n JOptionPane.showMessageDialog(null, monster.name\r\n + \" was healed 50 HP by a healing potion!!\");\r\n //Check if attack commits\r\n }\r\n if (willAttack){\r\n superEff = randNum.nextFloat() * 1.0f;\r\n notEff = randNum.nextFloat() * 1.0f;\r\n if (superEff < 0.1f){\r\n JOptionPane.showMessageDialog(null, monster.name + \" uses \" + attackName\r\n + \"! It is super effective!!!\");\r\n enemy.monster.hp -= (damageDealth*1.5f);\r\n }else if(notEff > 0.9f && superEff >= 0.1f){\r\n //Not effective attack\r\n JOptionPane.showMessageDialog(null, monster.name + \" uses \" + attackName\r\n + \".. It was not effective..\");\r\n enemy.monster.hp -= (damageDealth*0.5f);\r\n }else{\r\n JOptionPane.showMessageDialog(null, monster.name + \" uses \" + attackName + \"..!!\");\r\n enemy.monster.hp -= damageDealth;\r\n }\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"No Attack Used.\");\r\n }\r\n\r\n\r\n }",
"public void win() {\r\n\t\tcoins += bet;\r\n\t\tbet = 0;\r\n\t}",
"public double chanceToMiss(){\n double threeFourthsHealth = (double)originalHealth * 0.75;\r\n double halfHealth = (double)originalHealth / 2.0;\r\n double quarterHealth = (double)originalHealth / 4.0;\r\n\r\n\r\n if((double)health <= quarterHealth){\r\n return 0.75;\r\n }else if((double)health > quarterHealth && (double)health <= halfHealth){\r\n return 0.5;\r\n }else if((double)health > halfHealth && (double)health <= threeFourthsHealth){\r\n return 0.25;\r\n }else{return 0.0;}\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts the context meta information into a humanreadable tooltip (e.g. for display in a table or list). | public String tooltip()
{
if (contextURI==null)
return "(no context specified)";
if (contextURI.equals(Vocabulary.SYSTEM_CONTEXT.METACONTEXT))
return "MetaContext (stores data about contexts)";
if(contextURI.equals(Vocabulary.SYSTEM_CONTEXT.VOIDCONTEXT))
return "VoID Context (stores statistics about contexts)";
if (type!=null && timestamp!=null)
{
GregorianCalendar c = new GregorianCalendar();
c.setTimeInMillis(timestamp);
String date = ReadWriteDataManagerImpl.dateToISOliteral(c.getTime());
if (!StringUtil.isNullOrEmpty(date))
date = ValueResolver.resolveSysDate(date);
String ret = "Created by " + type;
if (type.equals(ContextType.USER))
ret += " '"
+ source.getLocalName()
+ "'";
else
{
String displaySource = null;
if(source!=null)
{
displaySource = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(source);
if (StringUtil.isNullOrEmpty(displaySource))
displaySource = source.stringValue(); // fallback solution: full URI
}
String displayGroup = null;
if (group!=null)
{
displayGroup = EndpointImpl.api().getNamespaceService().getAbbreviatedURI(group);
if (StringUtil.isNullOrEmpty(displayGroup))
displayGroup = group.stringValue(); // fallback solution: full URI
}
ret += " (";
ret += source==null ? "" : "source='" + displaySource + "'";
ret += source!=null && group!=null ? "/" : "";
ret += group==null ? "" : "group='" + displayGroup + "'";
ret += ")";
}
ret += " on " + date;
if (label!=null)
ret += " (" + label.toString() + ")";
if (state!=null && !state.equals(ContextState.PUBLISHED))
ret += " (" + state + ")";
return ret;
}
else
return contextURI.stringValue();
} | [
"java.lang.String getTooltip();",
"String getTooltip();",
"@DISPID(1610874917) //= 0x60040025. The runtime will prefer the VTID if present\r\n @VTID(67)\r\n java.lang.String getTooltipText();",
"@VTID(145)\r\n boolean getDisplayContextTooltips();",
"protected String getToolTip( MouseEvent event )\n {\n SmartText descr = new SmartText();\n int column = treeTable.columnAtPoint( event.getPoint() );\n if ( column == 0 )\n {\n int row = treeTable.rowAtPoint( event.getPoint() );\n if ( row == 0 )\n {\n descr.setText( componentModel.getTypeDescription() );\n }\n else\n {\n Object value = treeTable.getValueAt( row, 1 );\n if ( value instanceof Property )\n {\n Property p = ( Property )value;\n descr.setText( p.getToolTip() );\n }\n }\n\n // perform line wrapping now\n descr.setText( \"<html>\" + descr.insertBreaks( \"<br>\", toolTipWidth, true ) + \"</html>\" );\n return descr.toString();\n }\n return null;\n }",
"public String getToolTipText(double x, double y);",
"public String generateToolTip(XYDataset data, int series, int item) {\n\n return getToolTipText(series, item);\n\n }",
"public String getToolTip() {\n\treturn this.toolTip;\n }",
"public String getToolTipText() {\n return this.toString();\n }",
"public String renderTooltip() {\r\n String strTooltip = \"\";\r\n if (tooltip == null) {\r\n return strTooltip;\r\n }\r\n if (!tooltip.isUnused()) {\r\n return strTooltip;\r\n }\r\n\r\n strTooltip = \",tooltip:{\";\r\n if (tooltip.getValuePrefix() != null) {\r\n strTooltip += \"valuePrefix:'\" + tooltip.getValuePrefix() + \"',\";\r\n }\r\n if (tooltip.getValueSuffix() != null) {\r\n strTooltip += \"valueSuffix:'\" + tooltip.getValueSuffix() + \"',\";\r\n }\r\n if (tooltip.getPointFormat() != null) {\r\n strTooltip += \"pointFormat:'\" + tooltip.getPointFormat() + \"',\";\r\n }\r\n // Remove last \",\"\r\n strTooltip = strTooltip.substring(0, strTooltip.length() - 1);\r\n // close\r\n strTooltip += \"}\";\r\n\r\n return strTooltip;\r\n }",
"String getTooltipLabel();",
"private String getTaskForceToolTipText() {\n TaskForce taskForce = taskForces.get(selectedIndex);\n return ShipViewType.convert(taskForce\n .getShipTypeMap())\n .entrySet()\n .stream()\n .sorted(Map.Entry.comparingByKey())\n .map(entry -> entry.getKey() + \":\" + entry.getValue().size())\n .collect(Collectors.joining(\"\\n\"));\n }",
"@objid (\"01ec00d8-0000-5ae1-0000-000000000000\")\n @Override\n public String getTooltip() {\n return this.tooltip;\n }",
"public String getExtraTooltipInformation()\n\t{\n\t\treturn extraTooltipInformation;\n\t}",
"public String getStatusInfoDetailsToolTip() {\r\n return statusInfoTooltip;\r\n }",
"public String getToolTipText(MouseEvent e) {\n String tip = null;\n java.awt.Point p = e.getPoint();\n int rowIndex = rowAtPoint(p);\n int colIndex = columnAtPoint(p);\n int realColumnIndex = convertColumnIndexToModel(colIndex);\n TableModel model = getModel();\n colCount=SLRParseTable.getSymbolAlphabet().size();\n if (realColumnIndex >=1 && realColumnIndex <=colCount){\n Move action= (Move)model.getValueAt(rowIndex,colIndex);\n if(action instanceof Reject || action instanceof Accept){\n String vAction=action.toString();\n if(vAction.equals(\"\"))\n tip=\"Error\";\n else if(vAction.equals(\"Acc\"))\n tip=\"Accept\";\n }else if(action instanceof Shift){\n if(((Shift)action).NT==false)\n tip=\"Shift current input and state \"+ ((Shift)action).getState()+ \" to stack\";\n else tip=\"Goto state \"+ ((Shift)action).getState();\n \n }else if(action instanceof Reduce){\n tip=\"Reduce by production \"+ ((Reduce)action).getProdNo()+ \", index \"+((Reduce)action).getIndex()+\", \"+((Reduce)action).getProd();\n }else{\n tip = super.getToolTipText(e);\n }\n \n }\n return tip;\n }",
"public String getToolTipText() {\n return updateRule.getToolTipText(this);\n }",
"public String getToolTipText() {\n checkWidget();\n return toolTipText;\n }",
"public static Tooltip shortTooltip(){\n return shortTooltip;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of the "newerthantid" attribute. The value indicates the highest thread number of messages to return, where higher numbers are more recent email threads. The server will return only threads newer than that specified by this attribute. If using this attribute, you should also use newerthantime for best results. When querying for the first time, you should omit this value. | public void setNewerThanTid(long newerThanTid)
{
this.newerThanTid = newerThanTid;
} | [
"public long getNewerThanTid()\n\t{\n\t\treturn this.newerThanTid;\n\t}",
"public void setNewerThanTime(long newerThanTime)\n\t{\n\t\tthis.newerThanTime = newerThanTime;\n\t}",
"public long getNewerThanTime()\n\t{\n\t\treturn this.newerThanTime;\n\t}",
"public void setWaiting_thread_id(Long waiting_thread_id) {\n this.waiting_thread_id = waiting_thread_id;\n }",
"private void setLastTweetID(Long tweetID){ \r\n try{\r\n Long storedValue=0L;\r\n if(this.getNextDatetoSearch()!=null) storedValue = Long.parseLong(this.getNextDatetoSearch());\r\n \r\n if(tweetID > storedValue){ //Only stores tweetID if it's greater than the current stored value\r\n System.out.println(\"EL VALOR ALMACENADO ES:\" + tweetID.toString());\r\n this.setNextDatetoSearch(tweetID.toString());\r\n }else{\r\n System.out.println(\"NO ESTÁ GUARDANDO NADA PORQUE EL VALOR ALMACENADO YA ES IGUAL O MAYOR AL ACTUAL\");\r\n }\r\n }catch(NumberFormatException nfe){\r\n log.error(\"Error in setLastTweetID():\" +nfe);\r\n System.out.println(\"Problem Storing NextDatetoSearch\");\r\n }\r\n }",
"public de.hpi.msd.salsa.serde.avro.Edge.Builder setTweedId(long value) {\n validate(fields()[1], value);\n this.tweedId = value;\n fieldSetFlags()[1] = true;\n return this;\n }",
"private int updateTimestamp(final Context context, String id, Uri[] folders){\n int updated = 0;\n final long now = System.currentTimeMillis();\n final ContentResolver resolver = context.getContentResolver();\n final ContentValues touchValues = new ContentValues();\n for (int i=0, size=folders.length; i < size; ++i) {\n touchValues.put(MailboxColumns.LAST_TOUCHED_TIME, now);\n LogUtils.d(TAG, \"updateStamp: %s updated\", folders[i]);\n updated += resolver.update(folders[i], touchValues, null, null);\n }\n final Uri toNotify =\n UIPROVIDER_RECENT_FOLDERS_NOTIFIER.buildUpon().appendPath(id).build();\n LogUtils.d(TAG, \"updateTimestamp: Notifying on %s\", toNotify);\n resolver.notifyChange(toNotify, null);\n return updated;\n }",
"public static native void ChannelManagerReadArgs_set_tx_broadcaster(long this_ptr, long val);",
"private void setLastIdNumber() {\n\n int counter = 0;\n\n for (Contact contact : this.contacts) {\n int id = contact.getId();\n if (id > counter) {\n counter = id;\n }\n }\n\n this.idCounter = counter;\n }",
"public Long getWaiting_thread_id() {\n return waiting_thread_id;\n }",
"ThrottleMark(Object id)\n {\n this.id = id;\n messageCount = 0;\n previousMessageTimes = new long[MESSAGE_TIMES_SIZE];\n }",
"public static void setLastUsedId(int number) {\n lastUsedId = number;\n }",
"public void setLastPublishedMessageid(long newLastPublishedMessageId) {\n this.lastPublishedMessageId = newLastPublishedMessageId;\n }",
"@Deprecated\n public MessageThread(int id, boolean isNew, String title, List<String> users, String lastMessage, double timeReceivedOffset) {\n this(id, isNew, title, users, lastMessage, OhareanCalendar.daysOffsetToUnix(timeReceivedOffset));\n }",
"public Builder setTxnid(long value) {\n \n txnid_ = value;\n onChanged();\n return this;\n }",
"public String getRecentChatMsgId() {\n return recentChatMsgId;\n }",
"public MonitorThread(Socket cSocket, int newThreadID)\r\n\t{\r\n\t\tclientSocket = cSocket;\r\n\t\tthreadID = newThreadID;\r\n\t}",
"public void setLessionid(Integer lessionid) {\n this.lessionid = lessionid;\n }",
"public synchronized void setLastSyncedId(FrontlineMessage message) {\n\t\t// TODO get this id properly\n\t\tlong id = SyncUtils.getId(message);\n\t\t\n\t\tsuper.setProperty(PROP_LAST_ID, Long.toString(id));\n\t\t\n\t\t// Save to file\n\t\tsuper.saveToDisk();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests construction with an empty Map (should throw an Exception). | @Test(expected = IllegalArgumentException.class)
public void testConstructionWithEmptyMap() {
new HashMapper(new HashMap<Object, Object>(), DEFAULT_VALUE);
} | [
"@Test(expected = IllegalArgumentException.class)\n\tpublic void testChainedConstructionWithEmptyMap() {\n\t\tnew HashMapper(new HashMap<Object, Object>(), DEFAULT_VALUE, new IdentityTransform());\n\t}",
"@Test(expected = NullPointerException.class)\n\tpublic void testConstructionWithNullMap() {\n\t\tnew HashMapper(null, DEFAULT_VALUE);\n\t}",
"@Test\n public void testEntrySetOnEmptyMap() {\n Map originalMap = createEmptyMap();\n \n Set set = originalMap.entrySet();\n \n assertTrue(set.isEmpty());\n }",
"@Test\n public void testValuesOnEmptyMap() {\n Map originalMap = createEmptyMap();\n \n Collection collection = originalMap.values();\n \n assertTrue(collection.isEmpty());\n }",
"@Test\n public void testKeySetOnEmptyMap() {\n Map originalMap = createEmptyMap();\n \n Set set = originalMap.keySet();\n \n assertTrue(set.isEmpty());\n }",
"@Test\n public void testCanMapHaveNullValues() {\n if (!doesMapAllowNullValues()) {\n return;\n }\n \n Map map = createEmptyMap();\n \n TestCollectionElement oneKey = getElement(ONE_KEY);\n map.put(oneKey, null);\n \n assertEquals(1, map.size());\n assertTrue(map.containsKey(oneKey));\n assertTrue(map.containsValue(null));\n assertNull(map.get(oneKey));\n }",
"@Test\n public void testCheckIfMapisEmpty() throws Exception {\n //see testWriteToFileAndRemoveOrder\n }",
"public static void notEmpty(Map<?,?> map) {\n\t\tnotEmpty(map, \"[Assertion failed] - this map must not be empty; it must contain at least one entry\");\n\t}",
"@Test\n public void serializeEmptyMap() throws Exception {\n assertEquals(0, serializeData().length);\n }",
"@Test\n public void testCanMapHaveNullKeys() {\n if (!doesMapAllowNullKeys()) {\n return;\n }\n \n Map map = createEmptyMap();\n \n TestCollectionElement oneValue = getElement(ONE_VALUE);\n map.put(null, oneValue);\n \n assertEquals(1, map.size());\n assertTrue(map.containsKey(null));\n assertTrue(map.containsValue(oneValue));\n assertEquals(oneValue, map.get(null));\n }",
"@Test\n public void test_Constructor() {\n new MapTest2Support(new Hashtable<>()).runTest();\n\n Hashtable<String, String> h = new Hashtable<>();\n\n assertEquals(\"Created incorrect hashtable\", 0, h.size());\n }",
"@Test\n public void testClearOnEmptyMap() {\n if (!doesMapSupportRemove()) return;\n \n Map originalMap = createEmptyMap();\n originalMap.clear();\n \n assertTrue(originalMap.isEmpty());\n }",
"protected void assertMapNotEmpty(Map<?, ?> map) {\r\n assertNotNull(\"The collection was null\", map);\r\n if (map.size() == 0) {\r\n fail(\"The collection was empty\");\r\n }\r\n }",
"@Test\n public void testEmpty()\n {\n final Map<Integer, Map<Integer, Integer>> map = new HashMap<>();\n final Iterator<Integer> iter = new SmartReset.NestedIterator<>(map.values().iterator());\n assertFalse(iter.hasNext());\n }",
"@Test(expected = NullPointerException.class)\n\tpublic void testChainedConstructionWithNullMap() {\n\t\tnew HashMapper(null, DEFAULT_VALUE, new IdentityTransform());\n\t}",
"@Test(expected=NoSuchElementException.class)\n public void testEmpty2()\n {\n final Map<Integer, Map<Integer, Integer>> map = new HashMap<>();\n final Iterator<Integer> iter = new SmartReset.NestedIterator<>(map.values().iterator());\n iter.next();\n }",
"@Test\n public void testRemoveFromEmptyMap() {\n if (!doesMapSupportRemove()) return;\n \n Map map = createEmptyMap();\n \n TestCollectionElement oneKey = getElement(ONE_KEY);\n \n assertNull(map.remove(oneKey));\n assertEquals(0, map.size());\n assertTrue(map.isEmpty());\n }",
"HashMap<String, Object> getEmptyMap();",
"private static Map<String, Object> emptyMap() {\n return new HashMap<String, Object>();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel NONNULL_PTR this_ptr, struct LDKPublicKey val); | public static native void AcceptChannel_set_funding_pubkey(long this_ptr, byte[] val); | [
"public static native void OpenChannel_set_funding_pubkey(long this_ptr, byte[] val);",
"public static native void ChannelPublicKeys_set_funding_pubkey(long this_ptr, byte[] val);",
"public static native byte[] AcceptChannel_get_funding_pubkey(long this_ptr);",
"public static native void UnsignedChannelAnnouncement_set_bitcoin_key_1(long this_ptr, byte[] val);",
"public static native void CounterpartyChannelTransactionParameters_set_pubkeys(long this_ptr, long val);",
"public static native void FundingSigned_set_channel_id(long this_ptr, byte[] val);",
"public void setPublicKey(PublicKey newPublicKey) {\r\n publicKey = newPublicKey;\r\n }",
"public static native void RouteHop_set_pubkey(long this_ptr, byte[] val);",
"public static native void ChannelAnnouncement_set_bitcoin_signature_1(long this_ptr, byte[] val);",
"public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(long this_ptr, byte[] val);",
"public static native void ChannelPublicKeys_set_payment_point(long this_ptr, byte[] val);",
"public static native void AcceptChannel_set_payment_point(long this_ptr, byte[] val);",
"public static native byte[] OpenChannel_get_funding_pubkey(long this_ptr);",
"public static native long ChannelPublicKeys_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg);",
"public static native void ChannelTransactionParameters_set_holder_pubkeys(long this_ptr, long val);",
"public static native byte[] ChannelPublicKeys_get_funding_pubkey(long this_ptr);",
"public void setPublicKey(byte[] publicKey)\n {\n this.publicKey = publicKey;\n }",
"public static native void ChannelAnnouncement_set_node_signature_1(long this_ptr, byte[] val);",
"public static native void ChannelAnnouncement_set_bitcoin_signature_2(long this_ptr, byte[] val);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "ruleAddress_Impl" $ANTLR start "entryRuleLanguage" ../org.xtext.example.mydsl.extensions.ui/srcgen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:172:1: entryRuleLanguage : ruleLanguage EOF ; | public final void entryRuleLanguage() throws RecognitionException {
try {
// ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:173:1: ( ruleLanguage EOF )
// ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:174:1: ruleLanguage EOF
{
before(grammarAccess.getLanguageRule());
pushFollow(FollowSets000.FOLLOW_ruleLanguage_in_entryRuleLanguage301);
ruleLanguage();
state._fsp--;
after(grammarAccess.getLanguageRule());
match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleLanguage308);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
} | [
"public final void entryRuleAddress() throws RecognitionException {\n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:89:1: ( ruleAddress EOF )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:90:1: ruleAddress EOF\n {\n before(grammarAccess.getAddressRule()); \n pushFollow(FollowSets000.FOLLOW_ruleAddress_in_entryRuleAddress121);\n ruleAddress();\n\n state._fsp--;\n\n after(grammarAccess.getAddressRule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleAddress128); \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 entryRuleAddress_Impl() throws RecognitionException {\n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:145:1: ( ruleAddress_Impl EOF )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:146:1: ruleAddress_Impl EOF\n {\n before(grammarAccess.getAddress_ImplRule()); \n pushFollow(FollowSets000.FOLLOW_ruleAddress_Impl_in_entryRuleAddress_Impl241);\n ruleAddress_Impl();\n\n state._fsp--;\n\n after(grammarAccess.getAddress_ImplRule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleAddress_Impl248); \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 // ../emfviews.dsl.ui/src-gen/emfviews/dsl/ui/contentassist/antlr/internal/InternalSqlview.g:117:1: ( ruleExpression EOF )\n // ../emfviews.dsl.ui/src-gen/emfviews/dsl/ui/contentassist/antlr/internal/InternalSqlview.g:118:1: ruleExpression EOF\n {\n before(grammarAccess.getExpressionRule()); \n pushFollow(FOLLOW_ruleExpression_in_entryRuleExpression181);\n ruleExpression();\n\n state._fsp--;\n\n after(grammarAccess.getExpressionRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleExpression188); \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 // ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:61:1: ( ruleexpression EOF )\r\n // ../org.openmodelica.modelicaml.editor.xtext.modeleditor.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/model/ui/contentassist/antlr/internal/InternalModeleditor.g:62:1: ruleexpression EOF\r\n {\r\n before(grammarAccess.getExpressionRule()); \r\n pushFollow(FOLLOW_ruleexpression_in_entryRuleexpression61);\r\n ruleexpression();\r\n\r\n state._fsp--;\r\n\r\n after(grammarAccess.getExpressionRule()); \r\n match(input,EOF,FOLLOW_EOF_in_entryRuleexpression68); \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 entryRuleEnd() throws RecognitionException {\r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1070:1: ( ruleEnd EOF )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:1071:1: ruleEnd EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getEndRule()); \r\n }\r\n pushFollow(FOLLOW_ruleEnd_in_entryRuleEnd2228);\r\n ruleEnd();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getEndRule()); \r\n }\r\n match(input,EOF,FOLLOW_EOF_in_entryRuleEnd2235); 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 // InternalMyDsl.g:54:1: ( ruleExpression EOF )\n // InternalMyDsl.g:55: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 }",
"public final void entryRuleNode() throws RecognitionException {\r\n try {\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:874:1: ( ruleNode EOF )\r\n // ../org.xtext.example.rmodp.ui/src-gen/org/xtext/example/rmodp/ui/contentassist/antlr/internal/InternalRmOdp.g:875:1: ruleNode EOF\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getNodeRule()); \r\n }\r\n pushFollow(FOLLOW_ruleNode_in_entryRuleNode1808);\r\n ruleNode();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getNodeRule()); \r\n }\r\n match(input,EOF,FOLLOW_EOF_in_entryRuleNode1815); 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\n \tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_ML_COMMENT\", \"RULE_SL_COMMENT\", \"RULE_WS\");\n\n try {\n // ../com.blasedef.onpa.ONPA.ui/src-gen/com/blasedef/onpa/ui/contentassist/antlr/internal/InternalONPA.g:1144:1: ( ruleExpression EOF )\n // ../com.blasedef.onpa.ONPA.ui/src-gen/com/blasedef/onpa/ui/contentassist/antlr/internal/InternalONPA.g:1145:1: ruleExpression EOF\n {\n before(grammarAccess.getExpressionRule()); \n pushFollow(FOLLOW_ruleExpression_in_entryRuleExpression2134);\n ruleExpression();\n\n state._fsp--;\n\n after(grammarAccess.getExpressionRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleExpression2141); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }",
"public final void entryRuleExpression() throws RecognitionException {\n int entryRuleExpression_StartIndex = input.index();\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 123) ) { return ; }\n // InternalGaml.g:1781:1: ( ruleExpression EOF )\n // InternalGaml.g:1782:1: ruleExpression EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getExpressionRule()); \n }\n pushFollow(FollowSets000.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,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 if ( state.backtracking>0 ) { memoize(input, 123, entryRuleExpression_StartIndex); }\n }\n return ;\n }",
"public final void entryRuleLanguage0() throws RecognitionException {\n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:257:1: ( ruleLanguage0 EOF )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:258:1: ruleLanguage0 EOF\n {\n before(grammarAccess.getLanguage0Rule()); \n pushFollow(FollowSets000.FOLLOW_ruleLanguage0_in_entryRuleLanguage0480);\n ruleLanguage0();\n\n state._fsp--;\n\n after(grammarAccess.getLanguage0Rule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleLanguage0487); \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 entryRuleEntry() throws RecognitionException {\n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:62:1: ( ruleEntry EOF )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:63:1: ruleEntry EOF\n {\n before(grammarAccess.getEntryRule()); \n pushFollow(FollowSets000.FOLLOW_ruleEntry_in_entryRuleEntry61);\n ruleEntry();\n _fsp--;\n\n after(grammarAccess.getEntryRule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleEntry68); \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 // InternalTym.g:355:1: ( ruleExpression EOF )\n // InternalTym.g:356: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 entryRuleExpression() throws RecognitionException {\n try {\n // InternalReflex.g:1339:1: ( ruleExpression EOF )\n // InternalReflex.g:1340: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 entryRuleExpression() throws RecognitionException {\n try {\n // InternalActivityDiagram.g:173:1: ( ruleExpression EOF )\n // InternalActivityDiagram.g:174:1: ruleExpression EOF\n {\n before(grammarAccess.getExpressionRule()); \n pushFollow(FollowSets000.FOLLOW_1);\n ruleExpression();\n\n state._fsp--;\n\n after(grammarAccess.getExpressionRule()); \n match(input,EOF,FollowSets000.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 entryRuleNode() throws RecognitionException {\n try {\n // ../fr.irisa.cairn.model.mathematica.xtext.ui/src-gen/fr/irisa/cairn/model/ui/contentassist/antlr/internal/InternalMathematica.g:62:1: ( ruleNode EOF )\n // ../fr.irisa.cairn.model.mathematica.xtext.ui/src-gen/fr/irisa/cairn/model/ui/contentassist/antlr/internal/InternalMathematica.g:63:1: ruleNode EOF\n {\n before(grammarAccess.getNodeRule()); \n pushFollow(FOLLOW_ruleNode_in_entryRuleNode61);\n ruleNode();\n _fsp--;\n\n after(grammarAccess.getNodeRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleNode68); \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 // InternalDsl.g:405:1: ( ruleRule EOF )\n // InternalDsl.g:406:1: ruleRule EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getRuleRule()); \n }\n pushFollow(FOLLOW_1);\n ruleRule();\n\n state._fsp--;\n if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getRuleRule()); \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 entryRuleLanguageTarget() throws RecognitionException {\n try {\n // InternalMLRegression.g:79:1: ( ruleLanguageTarget EOF )\n // InternalMLRegression.g:80:1: ruleLanguageTarget EOF\n {\n before(grammarAccess.getLanguageTargetRule()); \n pushFollow(FOLLOW_1);\n ruleLanguageTarget();\n\n state._fsp--;\n\n after(grammarAccess.getLanguageTargetRule()); \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 entryRuleExtendedAddress() throws RecognitionException {\n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:117:1: ( ruleExtendedAddress EOF )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:118:1: ruleExtendedAddress EOF\n {\n before(grammarAccess.getExtendedAddressRule()); \n pushFollow(FollowSets000.FOLLOW_ruleExtendedAddress_in_entryRuleExtendedAddress181);\n ruleExtendedAddress();\n\n state._fsp--;\n\n after(grammarAccess.getExtendedAddressRule()); \n match(input,EOF,FollowSets000.FOLLOW_EOF_in_entryRuleExtendedAddress188); \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 entryRuleASTNode() throws RecognitionException {\n try {\n // ../fr.irisa.cairn.model.mathematica.xtext.ui/src-gen/fr/irisa/cairn/model/ui/contentassist/antlr/internal/InternalMathematica.g:90:1: ( ruleASTNode EOF )\n // ../fr.irisa.cairn.model.mathematica.xtext.ui/src-gen/fr/irisa/cairn/model/ui/contentassist/antlr/internal/InternalMathematica.g:91:1: ruleASTNode EOF\n {\n before(grammarAccess.getASTNodeRule()); \n pushFollow(FOLLOW_ruleASTNode_in_entryRuleASTNode121);\n ruleASTNode();\n _fsp--;\n\n after(grammarAccess.getASTNodeRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleASTNode128); \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"
]
]
}
} |
Returns the CPU time in nanoseconds. CPU time is user time plus system time. It's the total time spent using a CPU for your application | private long getCpuTime() {
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L;
} | [
"public long getCpuTime() {\n return cpuTimer.getTime();\n }",
"public long getCpuTime() {\n\t\t\t// Return time in milliseconds, not in nanoseconds\n\t\t\t\n\t\t\treturn (cpuLocalTimerFinish - cpuLocalTimerStart) / 1000000;\n\t\t}",
"public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(10, 9);\t\t\n}",
"public long getTotalCpuTime() {\n return (threadMxBean.getCurrentThreadCpuTime() - startedTotalCpu) / 1_000_000;\n }",
"public int getCPUtime() {\n\t\treturn this.cpu_time;\n\t}",
"public static long getCpuTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadCpuTime( ) : 0L;\n }",
"public long getCpuTimeNow() {\n return cpuTimer.getTimeNow();\n }",
"public long getUserCpuTime() {\n return (threadMxBean.getCurrentThreadUserTime() - startedUserCpu) / 1_000_000;\n }",
"public long getTotalCpuTime()\n {\n final Collection<ThreadProfiler> threadHistory = threads.values();\n\n long time = 0L;\n\n for (ThreadProfiler times : threadHistory)\n {\n time += times.getThreadInfo().getTimes().getCpuTime().time();\n }\n\n return time;\n }",
"public long getCpuTimeNanos() {\n return cpuTimeToNanos(cpu.getTime());\n }",
"public long getCpuTime()\r\n {\r\n return cpuTime.get();\r\n }",
"public long getJVMCpuTime( ) {\n OperatingSystemMXBean bean =\n ManagementFactory.getOperatingSystemMXBean( );\n if ( ! (bean instanceof\n com.sun.management.OperatingSystemMXBean) )\n return 0L;\n return ((com.sun.management.OperatingSystemMXBean)bean)\n .getProcessCpuTime( );\n}",
"public static long getTimeNS() {\n return USING_THREAD_CPU_TIME ? GraalServices.getCurrentThreadCpuTime() : System.nanoTime();\n }",
"public static double doCPU_usage() {\n double totalProgramRunTime = endProgramTime - startProgramTime;\n return (processingTimeTotal / totalProgramRunTime) * 100;\n }",
"public long getStartCpuTime() {\r\n return startCpuTime;\r\n }",
"public double CPUServiceTime()\r\n\t{\r\n\t\treturn Math.random()* (30.0 - 10.0) + 10.0;\r\n\t}",
"public long getTotalSystemTime()\n {\n return getTotalCpuTime() - getTotalUserTime();\n }",
"@DISPID(55)\r\n\t// = 0x37. The runtime will prefer the VTID if present\r\n\t@VTID(53)\r\n\tint actualCPUTime_Seconds();",
"private long getSystemTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()) : 0L;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the region endpoint with the gender filter | @Test
public void testReceiverDonorEndpointGender() {
ResponseEntity response = dataController.getDonorDataRegion("M", null, null);
assertNotNull(response.getBody());
assertEquals(HttpStatus.OK, response.getStatusCode());
} | [
"@Test\n public void testReceiverGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testDonorGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointGender() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"M\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverAgeEndpointGender() {\n ResponseEntity response = dataController.getReceiverDataAge(\"F\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointBloodTypeFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, \"AB+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointBloodType() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void genderTest() {\n Response response = given().accept(ContentType.JSON).\n queryParam(\"gender\", \"male\").\n when().get(\"/\");\n\n assertEquals(response.contentType(), \"application/json; charset=utf-8\");\n\n JsonPath json = response.jsonPath();\n String exp = \"male\";\n String act = json.getString(\"gender\");\n assertEquals(exp,act);\n }",
"@Test\n public void testReceiverGenderEndpointAgeFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\npublic void verifyRegionName() {\n\t\tgiven().accept(ContentType.JSON).\n\t\twhen().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/regions\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items[1].region_name\", equalTo(\"Americas\"));\n}",
"@Test\n public void testDonorGenderEndpointBloodTypeFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(null, \"AB+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testDonorGenderEndpointAgeFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n @DisplayName(\"Invalid Region Test\")\n public void test5() {\n given().accept(\"application/json\").queryParam(\"region\",\"invalid_region\").get().then().\n assertThat().statusCode(400).statusLine(containsString(\"Bad Request\")).\n contentType(\"application/json; charset=utf-8\").\n body(\"error\",is(\"Region or language not found\")).\n log().all(true);\n\n }",
"@Test\n public void testReceiverAgeEndpointRegion() {\n ResponseEntity response = dataController.getReceiverDataAge(null, null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"F\", \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n @DisplayName(\"Invalid Gender Test\")\n public void test4(){\n\n given().\n accept(\"application/json\").\n queryParam(\"gender\", \"jj\").\n get().\n then().\n assertThat().\n statusCode(400).\n statusLine(containsString(\"Bad Request\")).\n contentType(\"application/json; charset=utf-8\").\n body(\"error\",is(\"Invalid gender\")).\n log().all(true);\n }",
"@Test\n @DisplayName(\"Gender Test\")\n public void test2(){\n // api/?gender=female\n given().\n accept(\"application/json\").\n queryParam(\"gender\",\"male\").\n get().\n then().\n assertThat().statusCode(200).\n contentType(\"application/json; charset=utf-8\").\n body(\"gender\",is(\"male\")).\n log().all(true);\n }",
"@Test\n public void testReceiverRegionEndpointAge() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public void testGetRegion() {\n assertEquals(\"northeast\", student.getRegion());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Put a random integer between from..to into each cell of the vector. Put with probability , with probability ,... | public static void randomInteger(IntVector x, int from, Vector prob) {
// 1. compute accumulated probabilities:
DefaultVector accum = new DefaultVector(prob.size());
accum.set(0, prob.get(0));
for (int i = 1; i < prob.size(); ++i)
accum.set(i, prob.get(i) + accum.get(i-1));
Vectors.print(accum);
// 2. draw the numbers:
int n = x.size();
for (int i = 0; i < n; ++i) {
float p = (float) Math.random();
int idx = 0;
while (idx < prob.size() && p > accum.get(idx))
++idx;
x.set(i, idx + from);
}
} | [
"public abstract void initiateRandomCells(double probabilityForEachCell);",
"public static void randomInteger(IntVector x, int from, int to) {\n\t\tint n = x.size();\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tx.set(i, (int) Math.floor(Math.random() * (to-from) + from));\n\t}",
"public List<Vec> sample(int count, Random rand);",
"public static int[] f_fill_vector_age_people(int N){\n int[] v_vector_age= new int[N];\n for(int i=0; i<N; i++){\n\n v_vector_age[i]= (int) (Math.random()*100)+1;\n\n }\n return v_vector_age;\n }",
"private void generateABValues() {\n\t\tfor (int i = 0; i < randomValueCount; i++) {\n\t\t\ta[i] = 1 + (int)(Math.random() * (p - 1));\n\t\t\tb[i] = (int)(Math.random() * p);\n\t\t}\n\t}",
"public abstract Vector sample(Random random);",
"public void randomize(Random random, Pt range) {\n x = random.nextDouble() * range.x;\n y = random.nextDouble() * range.y;\n }",
"public void uniformMut(Random r) {\n\t\tfor (int i = 0; i < this.vector.length; i++) {\n\t\t\tdouble chance = r.nextDouble();\n\t\t\tif (chance < mutation_step) {\n\t\t\t\tthis.vector[i] = generateRandom(r.nextDouble());\n\t\t\t}\n\t\t}\n\t}",
"private int random(int from, int to) {\n return from + (int) (Math.random() * (to - from + 1));\n }",
"public Position sampleRandomUniformPosition();",
"private void mutate(float probability) {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n float temp_genes[] = this.offspring_population.getPopulation()[i].getGenes();\r\n\r\n // mutation can now mutate wild cards\r\n for (int j = 0; j < temp_genes.length; j++) {\r\n float k = new Random().nextFloat();\r\n\r\n if (k <= probability) {\r\n float temp = new Random().nextFloat();\r\n temp_genes[j] = temp; // add a float between 0-1 // just mutate a new float\r\n }\r\n }\r\n individual child = new individual(temp_genes, solutions, output);\r\n temp_pop[i] = child;\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }",
"private List<Integer> generateProb() {\n Integer[] randArr = new Integer[numCols*numRows];\n\n int start = 0;\n int end;\n for(int i = 0; i < myStateMap.size(); i++) {\n double prob = myStateMap.get(i).getProb();\n end = (int) (prob * numCols * numRows + start);\n for(int j = start; j < end; j++) {\n if(end > randArr.length) {\n break;\n }\n randArr[j] = myStateMap.get(i).getType();\n }\n start = end;\n }\n\n List<Integer> arr = new ArrayList<>(Arrays.asList(randArr));\n Collections.shuffle(arr);\n return arr;\n }",
"Chromosome getRandom();",
"public void setRandomValues(float avg, float distr) {\n\t\tfor(int i = 0; i < size; i++)\n\t\t\tvector[i] = avg+MathUtils.randomTriangular()*distr;\n\t}",
"public void generateRandomValues(int number, double start, double end, boolean repeated, boolean onlyInt) {\n\t\tfor (int i = 0; i < number; i++) {\n\t\t\tdouble random = new Random().nextDouble();\n\t\t\tdouble result = start + (random * (end - start));\n\t\t\tdouble cons = onlyInt ? 1 : 0.5;\n\t\t\tresult = Math.random() > cons ? result : Math.round(result); //\n\t\t\tif (repeated && list.contains(result)) {\n\t\t\t\ti--;\n\t\t\t} else {\n\t\t\t\tlist.add(result);\n\t\t\t}\n\t\t}\n\t}",
"private static int randomGen(int range) {\n\t\treturn (int) ((range + 1) * Math.random());\n\t}",
"public static <E> Vector<E> randomize(final Vector<E> vector, final Random random) {\n\t\tfor(int i = 0; i < vector.size() - 1; ++i) { //start at the first element and go to the second to last element\n\t\t\tint fromIndex = ((int)(random.nextFloat() * (vector.size() - i))) + i; //get a random number (from zero to the number of elements left minus one), and put it into the range at our current slot\n\t\t\tif(fromIndex != i) { //if we should move our current object\n\t\t\t\tfinal E tempObject = vector.elementAt(i); //get a reference to the element to be replaced\n\t\t\t\tvector.setElementAt(vector.elementAt(fromIndex), i); //copy the specified element from its index into the current slot\n\t\t\t\tvector.setElementAt(tempObject, fromIndex); //put the element that used to be in this slot where the other one came from\n\t\t\t}\n\t\t}\n\t\treturn vector; //return the vector, which is now randomized\n\t}",
"public void initRandom(double range) {\n for (int i = 0; i < values.length; i++) {\n values[i] = (rand.nextDouble() * range) - (range / 2d);\n }\n }",
"private Vector randomizeVector(Vector a_vector, Random a_random)\n {\n int[] randArray = new int[a_vector.size()];\n for (int i = 0; i < randArray.length; i++)\n {\n randArray[i] = Math.abs(a_random.nextInt());\n }\n return randomizeIt(a_vector, randArray);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main command line jarfileName lowVersion highVersion e.g. myjar.jar 1.0 1.8 | public static void main( String[] args )
{
try
{
if ( args.length != 3 )
{
err.println( "usage: java -ea -jar jarcheck.jar jarFileName.jar 1.1 1.7" );
System.exit( 2 );
}
String jarFilename = args[ 0 ];
int low = convertHumanToMachine.get( args[ 1 ] );
int high = convertHumanToMachine.get( args[ 2 ] );
boolean success = checkJar( jarFilename, low, high );
if ( !success )
{
err.println("JarCheck failed for " + jarFilename+". See error messages above.");
System.exit( 1 );
}
}
catch ( NullPointerException e )
{
err.println( "usage: java -ea -jar jarcheck.jar jarFileName.jar 1.1 1.8" );
System.exit( 2 );
}
} | [
"private static boolean checkJar( String jarFilename, int low, int high )\n {\n out.println( \"\\nChecking jar \" + jarFilename );\n boolean success = true;\n FileInputStream fis;\n ZipInputStream zip = null;\n try\n {\n try\n {\n fis = new FileInputStream( jarFilename );\n zip = new ZipInputStream( fis );\n // loop for each jar entry\n entryLoop:\n while ( true )\n {\n ZipEntry entry = zip.getNextEntry();\n if ( entry == null )\n {\n break;\n }\n // relative name with slashes to separate dirnames.\n String elementName = entry.getName();\n if ( !elementName.endsWith( \".class\" ) )\n {\n // ignore anything but a .final class file\n continue;\n }\n byte[] chunk = new byte[ chunkLength ];\n int bytesRead = zip.read( chunk, 0, chunkLength );\n zip.closeEntry();\n if ( bytesRead != chunkLength )\n {\n err.println( \">> Corrupt class file: \"\n + elementName );\n success = false;\n continue;\n }\n // make sure magic number signature is as expected.\n for ( int i = 0; i < expectedMagicNumber.length; i++ )\n {\n if ( chunk[ i ] != expectedMagicNumber[ i ] )\n {\n err.println( \">> Bad magic number in \"\n + elementName );\n success = false;\n continue entryLoop;\n }\n }\n /*\n * pick out big-endian ushort major version in last two\n * bytes of chunk\n */\n int major =\n ( ( chunk[ chunkLength - 2 ] & 0xff ) << 8 ) + (\n chunk[ chunkLength - 1 ]\n & 0xff );\n /* F I N A L L Y. All this has been leading up to this TEST */\n if ( low <= major && major <= high )\n {\n out.print( \" OK \" );\n out.println( convertMachineToHuman.get( major )\n + \" (\"\n + major\n + \") \"\n + elementName );\n // leave success set as previously\n }\n else\n {\n err.println( \">> Wrong Version \" );\n err.println( convertMachineToHuman.get( major )\n + \" (\"\n + major\n + \") \"\n + elementName );\n success = false;\n }\n }\n // end while\n }\n catch ( EOFException e )\n {\n // normal exit\n }\n zip.close();\n return success;\n }\n catch ( IOException e )\n {\n err.println( \">> Problem reading jar file.\" );\n return false;\n }\n }",
"public void testMain() {\n System.out.println(\"main\");\n String[] args = new String[]{\n \n \"-out\", \"ausgabe.jar\",\n \"-mc\", \"inteco.Saukopf\",\n// \"-m manifest.mf \" \n// \"-v\",\n \"-l\",\n \"-lib\", \"CustJar.jar\", \"./asm.jar\", \"D:\\\\Development\\\\Java\\\\Componenten\\\\Hibernate\\\\hibernate-3.0.2\\\\hibernate-3.0\\\\lib\"\n // -mainclass\n };\n CustJar.main(args);\n\n \n }",
"public static void main(String[] args){\n\t\tMetricImpl metric = new MetricImpl(\"string-service.jar\");\n\t\t//call parse method to parse the jar file for all classes\n\t\t//and add them to the map\n\t\tmetric.parse();\n\t\t//call calculate stability method which calculates in & out degrees for each class\n\t\t//on the map and then calculates stability for each class\n\t\tmetric.calcStability();\n\t}",
"public static void main(String[] args) {\n if (args == null || args.length < 2 || args.length > 3 || (args.length == 2 && !args[0].equals(\"-jar\"))) {\n System.err.println(\"Invalid number of args: set -jar flag [optional], class token and root path.\");\n } else {\n try {\n if (args.length == 2) {\n new Implementor().implement(createClass(args[0]), createPath(args[1]));\n } else {\n new Implementor().implementJar(createClass(args[1]), createPath(args[2]));\n }\n } catch (ImplerException e) {\n System.err.println(e.getMessage());\n }\n }\n }",
"private static void main1(final String args[]) throws Exception {\n // Make sure default jar is in place\n try {\n copyDefaultMainJar();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.toString());\n }\n\n boolean update = prefs.getBoolean(UPDATE, true);\n\n // If Update Jar exists, copy it into place\n File jar = getAppFile(JarName);\n\n if (update) {\n File updateJar = getAppFile(JarName + \".update\");\n if (updateJar.exists()) {\n copyFile(updateJar, jar);\n jar.setLastModified(updateJar.lastModified());\n updateJar.delete();\n }\n\n // If jar doesn't exist complain bitterly\n if (!jar.exists() || !jar.canRead())\n throw new RuntimeException(\"Main Jar not found!\");\n\n // Check for updates in background thread\n if (args.length == 0 || !args[0].equals(\"-snap\"))\n new Thread(AppLoader::checkForUpdatesSilent).start();\n }\n\n ClassLoader classloader = new URLClassLoader(new URL[]{jar.toURI().toURL()}, ClassLoader.getSystemClassLoader().getParent());\n Class mainClass = classloader.loadClass(MainClass);\n Method main = mainClass.getMethod(\"main\", new Class[]{args.getClass()});\n\n Thread.currentThread().setContextClassLoader(classloader);\n\n main.invoke(null, new Object[]{args});\n }",
"public static void main(String[] args) {\n System.out.println(getVersion().toFileSuffix());\n }",
"public static void main(String args[]) {\r\n\t\t// check to ensure there is a port number to read, report an error\r\n\t\t// if the port number is not there\r\n\t\tif (args.length > 1) {\r\n\t\t\tSystem.out.println(\"Usage: java -jar ServerMain.jar [port]\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// parse the port number and create new ServerMain\r\n\t\t// catch exception if it happens\r\n\t\ttry {\r\n\t\t\tnew ServerMain(Integer.parseInt( args[0] ));\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error while parsing or creating ServerMain\");\r\n\t\t}\r\n\t}",
"public static void main( String [] args) {\n\t\t\n\t\tSystem.out.print( \"Java Version : \" ); // prints Java Version :\n\t\t\n\t\t// prints the version of java in use\n\t\t\n\t\tSystem.out.println( (String)System.getProperty( \"java.version\" ) ); \n\t}",
"public static void verifyJarFile(String[] args) {\r\n try {\r\n if (args[jarIndex].endsWith(\".jar\")) {\r\n File jarFile = new File(args[jarIndex]);\r\n\r\n // If .jar file does not exist, fatal error\r\n if (!jarFile.exists()) {\r\n System.err.println(\"Could not load jar file: \" + args[jarIndex]);\r\n System.exit(-5);\r\n }\r\n }\r\n // If user passes a non .jar file as the first argument, fatal error\r\n else {\r\n System.err.println(\"This program requires a jar file as the first command line argument (after any qualifiers).\");\r\n System.exit(-3);\r\n }\r\n\r\n jarFile = args[jarIndex];\r\n }\r\n catch(Exception e) {System.out.println(e.getMessage());}\r\n }",
"public static void main(String[] args){\n new Main(args);\n }",
"public static void main(String args[])\n\t{\n\t\t//D:/Lukash/workspace/JMP-2015/Module5/examples/example2/Semaphore.class\n\t\tnew MainExample();\n\t}",
"static double getVersion(String fileName)\n {\n final String commentHeader = \"/* \" + getIdString(toolName, fileName) + \" Version \";\n File file = new File(Options.getOutputDirectory(), replaceBackslash(fileName));\n\n if (!file.exists()) {\n // Has not yet been created, so it must be up to date.\n try {\n String majorVersion = Version.majorDotMinor.replaceAll(\"[^0-9.]+.*\", \"\");\n return Double.parseDouble(majorVersion);\n } catch (NumberFormatException e) {\n return 0.0; // Should never happen\n }\n }\n\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new FileReader(file));\n String str;\n double version = 0.0;\n\n // Although the version comment should be the first line, sometimes the\n // user might have put comments before it.\n while ( (str = reader.readLine()) != null) {\n if (str.startsWith(commentHeader)) {\n str = str.substring(commentHeader.length());\n int pos = str.indexOf(' ');\n if (pos >= 0) str = str.substring(0, pos);\n if (str.length() > 0) {\n try {\n // str can be 4.09\n // or even 7.0.5\n // So far we keep only major.minor part\n // \"4 qwerty\"-> \"4\"\n // \"4.09 qwerty\" -> \"4.09\"\n // \"7.0.5 qwerty\" -> \"7.0\"\n str = str.replaceAll(\"(\\\\d+(\\\\.\\\\d+)?).*\", \"$1\");\n version = Double.parseDouble(str);\n }\n catch (NumberFormatException nfe) {\n // Ignore - leave version as 0.0\n }\n }\n\n break;\n }\n }\n\n return version;\n }\n catch (IOException ioe)\n {\n return 0.0;\n }\n finally {\n if (reader != null)\n {\n try { reader.close(); } catch (IOException e) {}\n }\n }\n }",
"public static void main(String args[]) throws Exception{\n\t\tString conf = \"res.conf\";\n\t\tboolean generate = false;\n\t\tboolean genxml = false;\n\t\tString xmlFile = \"res.xml\";\n\t\tboolean aPackage = false;\n\t\tboolean fullPackage = false;\n\t\tboolean release = false;\n\t\tboolean debug = false;\n\t\tint masterVersion = 1;\n\t\tint slaveVersion = 0;\n\t\t\n\t\tfor(int i = 0 ; i < args.length ; i++){\n\t\t\tString s = args[i];\n\t\t\tif(s.equals(\"-f\")){\n\t\t\t\tconf = args[i+1];\n\t\t\t\ti++;\n\t\t\t}else if(s.equals(\"-g\")){\n\t\t\t\tgenerate = true;\n\t\t\t}else if(s.equals(\"-x\")){\n\t\t\t\tgenxml = true;\n\t\t\t\txmlFile = args[i+1];\n\t\t\t\ti++;\n\t\t\t}else if(s.equals(\"-a\")){\n\t\t\t\taPackage = true;\n\t\t\t}else if(s.equals(\"-debug\")){\n\t\t\t\tdebug = true;\n\t\t\t}\n\t\t\telse if(s.equals(\"-F\")){\n\t\t\t\tfullPackage = true;\n\t\t\t}else if(s.equals(\"-r\")){\n\t\t\t\trelease = true;\n\t\t\t}else if(s.equals(\"-h\")){\n\t\t\t\tprintHelp();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\n\t\tif(generate){\n\t\t\ttry{\n\t\t\t\tmasterVersion = Integer.parseInt(args[args.length-2]);\n\t\t\t\tslaveVersion = Integer.parseInt(args[args.length-1]);\n\t\t\t}catch(Exception e){\n\t\t\t\tSystem.out.println(\"参数配置错误,请检查!\");\n\t\t\t\tprintHelp();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\tFile confFile = new File(conf);\n\t\tif(confFile.exists() == false){\n\t\t\tconfFile = new File(System.getProperty(\"user.dir\"),conf);\n\t\t\tif(confFile.exists() == false){\n\t\t\t\tSystem.out.println(\"找不到指定的配置文件[\"+conf+\"],请检查!\");\n\t\t\t\tprintHelp();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tProperties props = new Properties();\n\t\tprops.load(new FileInputStream(confFile));\n\t\t\n\t\tResourcePackageTools drm = new ResourcePackageTools();\n\t\t\n\t\tdrm.packageFileSuffix = props.getProperty(\"packageFileSuffix\",\".vfs\");\n\t\tdrm.packageFilePrefix = props.getProperty(\"packageFilePrefix\",\"3dsword\");\n\t\tdrm.resourceRootDir = props.getProperty(\"resourceRootDir\");\n\t\tdrm.packageRootDir = props.getProperty(\"packageRootDir\");\n\t\tdrm.aPackageListFile = props.getProperty(\"aPackageListFile\");\n\t\tdrm.httpDownloadRoot = props.getProperty(\"httpDownloadRoot\");\n\t\tdrm.packageFileZipSuffix = props.getProperty(\"packageFileZipSuffix\");\n\t\tdrm.excludesFolders= props.getProperty(\"excludesFolders\");\n\t\tdrm.excludesFileSuffix = props.getProperty(\"excludesFileSuffix\");\n\t\tdrm.ignorePath = props.getProperty(\"ignorePath\");\n\t\tdrm.debug = debug;\n\t\t\n\t\tif(genxml){\n\t\t\tdrm.init();\n\t\t\tString ss = drm.generateXmlConfig();\n\t\t\tSystem.out.println(ss);\n\t\t\tFile f = new File(System.getProperty(\"user.dir\"),xmlFile);\n\t\t\tFileOutputStream output = new FileOutputStream(f);\n\t\t\toutput.write(ss.getBytes());\n\t\t\toutput.close();\n\t\t\tSystem.out.println(\"xml配置文件生成完毕,别忘了在使用此配置文件前,需要手动压缩资源包文件,建议采用7z压缩!\");\n\t\t\t\n\t\t}else if(generate){\n\t\t\tdrm.init();\n\t\t\tdrm.generatePackage(masterVersion, slaveVersion, fullPackage, aPackage);\n\t\t}else{\n\t\t\tdrm.init();\n\t\t}\n\t}",
"public static void main(String[] args)\r\n \t\t\tthrows IOException, ClassNotFoundException\r\n \t{\r\n \t\tSystem.exit(invoke(args));\r\n \t}",
"public static void verifyClassName(String[] args) {\r\n try {\r\n // If the class name is passed as an argument, verify that class name exists. Otherwise, verify that the default \"Commands.class\" exists\r\n if ((verboseFlag && args.length == 3) || (!verboseFlag && args.length == 2)) {\r\n className = args[classIndex];\r\n }\r\n\r\n JarFile jarName = new JarFile(args[jarIndex]);\r\n Enumeration allEntries = jarName.entries();\r\n while (allEntries.hasMoreElements()) {\r\n JarEntry entry = (JarEntry) allEntries.nextElement();\r\n String name = entry.getName();\r\n\r\n // If the passed class name argument matches one of the class files in the .jar file, begin normal program execution\r\n if (name.equals(className+\".class\")) {\r\n return;\r\n }\r\n\r\n // If there are no more class files to parse through in the .jar file and the class name argument has not been matched, fatal error\r\n if (!name.equals(className) && !allEntries.hasMoreElements()) {\r\n System.err.println(\"Could not find class: \" + args[classIndex]);\r\n System.exit(-6);\r\n }\r\n }\r\n }\r\n catch(Exception e) {System.out.println(e.getMessage());}\r\n }",
"public static void main(String args[]) {\r\n\r\n\t\tsetSystemPath(new Sully().getClass());\r\n\t\t\r\n\t\t// Rafael: This is needed to run Sully in a decent speed\r\n\t\tsetTimeIncrement(2);\r\n\r\n\t\t// Path, configfile and args\r\n\t\tinitVergeEngine(args);\r\n\t}",
"public static void\r\n main(String[] args)\r\n {\r\n JFCRipperConfiguration configuration = new JFCRipperConfiguration();\r\n CmdLineParser parser = new CmdLineParser(configuration);\r\n final JFCRipper jfcRipper = new JFCRipper(configuration);\r\n\r\n try {\r\n parser.parseArgument(args);\r\n jfcRipper.execute();\r\n\r\n System.exit(0);\r\n\r\n } catch (CmdLineException e) {\r\n System.err.println(e.getMessage());\r\n System.err.println();\r\n System.err.println(\"Usage: java [JVM options] \"\r\n + JFCRipperMain.class.getName()\r\n + \" [Ripper options] \\n\");\r\n System.err.println(\"where [Ripper options] include:\");\r\n System.err.println();\r\n parser.printUsage(System.err);\r\n\r\n System.exit(1);\r\n }\r\n }",
"public static void processVerboseQualifier(String[] args) {\r\n // If there are more than three arguments (including the verbose mode qualifier), fatal error\r\n if (args.length > 3) {\r\n System.err.println(\"This program takes at most two command line arguments.\");\r\n System.err.println(synopsis);\r\n System.exit(-2);\r\n }\r\n // If a verbose mode qualifier is the only command line argument, fatal error\r\n if (args.length == 1) {\r\n System.err.println(\"This program requires a jar file as the first command line argument (after any qualifiers).\");\r\n System.err.println(synopsis);\r\n System.exit(-3);\r\n }\r\n\r\n // Valid use of a verbose mode qualifier = set the verboseFlag\r\n // Increment jarIndex and classIndex in order to extract jar file and class name from the correct index in args\r\n verboseFlag = true;\r\n jarIndex++;\r\n classIndex++;\r\n }",
"public static void main(String[] args) {\n\r\n Starter starter = new Starter();\r\n starter.start();\r\n\r\n\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new AffinityTimeRange with a given value | private AffinityTimeRange(String value) {
this.value = value;
} | [
"RangeValue createRangeValue();",
"ValueRange createValueRange();",
"public void setTimeRange(TimeRange value) {\n timeRange = value;\n }",
"ValueRangeConstraint createValueRangeConstraint();",
"public TimeRange(long from, long to) {\n if (from <= to) {\n this.from = from;\n this.to = to;\n \n } else {\n this.from = to;\n this.to = from;\n }\n }",
"ValueRangeType createValueRangeType();",
"public Builder setUseTime(hr.client.appuser.CouponCenter.TimeRange value) {\n if (useTimeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n useTime_ = value;\n onChanged();\n } else {\n useTimeBuilder_.setMessage(value);\n }\n\n return this;\n }",
"public static native void GossipTimestampFilter_set_timestamp_range(long this_ptr, int val);",
"public static TimeRange parse(String value) {\n\t\tTimeRange obj = new TimeRange();\n\t\tString startStr = null;\n\t\tString endStr = null;\n\t\tif (value.contains(\"-\")) {\n\t\t\tString[] startEnd = value.split(\"-\");\n\t\t\tstartStr = startEnd[0];\n\t\t\tendStr = startEnd[1];\n\t\t} else {\n\t\t\tstartStr = value;\n\t\t}\n\t\tlong start = 0;\n\t\tlong end = 0;\n\t\tString[] values = startStr.split(\":\");\n\t\tint size = values.length;\n\t\tfor (int i=0; i<size; i++) {\n\t\t\tstart += getValue(values[i], i);\n\t\t}\n\t\tif (endStr == null) {\n\t\t\tend = start;\n\t\t} else {\n\t\t\tvalues = endStr.split(\":\");\n\t\t\tsize = values.length;\n\t\t\tfor (int i=0; i<size; i++) {\n\t\t\t\tend += getValue(values[i], i);\n\t\t\t}\n\t\t}\n\t\tobj.setStart(start);\n\t\tobj.setEnd(end);\n\t\treturn obj;\n\t}",
"public Builder setRangeMs(long value) {\n \n rangeMs_ = value;\n onChanged();\n return this;\n }",
"public NonceRange()\n {\n }",
"Builder addTypicalAgeRange(String value);",
"RangeOfValuesType createRangeOfValuesType();",
"Range createRange();",
"public Time(long value){\n this.nanoseconds = value;\n }",
"RangeAxis createRangeAxis(String name, String value);",
"public NonceRange(long lowerBound, long higherBound)\n {\n m_lowerBound = lowerBound;\n m_higherBound = higherBound;\n }",
"com.znv.hbase.protobuf.generated.HBaseProtos.TimeRange getTimeRange();",
"public void setRange(java.lang.Object value) {\n this.range = value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the CREATE player Object. | public Common.Object getCreateObject(Player player, boolean isControllable) {
Common.Object.Builder builder = Common.Object.newBuilder();
builder.setId(player.getId().toString());
builder.setName(player.getName());
Common.SystemObject.Builder graphicSystemObject = builder.addSystemObjectsBuilder();
graphicSystemObject.setSystemType(Common.SystemType.Graphic);
graphicSystemObject.setType(MESH);
graphicSystemObject.addProperties(player.getMeshProperty().build());
if (isControllable) {
Common.SystemObject.Builder inputSystemObject = builder.addSystemObjectsBuilder();
inputSystemObject.setSystemType(Common.SystemType.Input);
inputSystemObject.setType(PLAYER);
}
Common.SystemObject.Builder networkSystemObject = builder.addSystemObjectsBuilder();
networkSystemObject.setSystemType(Common.SystemType.Network);
networkSystemObject.setType(isControllable ? PLAYER : UPDATABLE);
Common.SystemObject.Builder physicSystemObject = builder.addSystemObjectsBuilder();
physicSystemObject.setSystemType(Common.SystemType.Physic);
physicSystemObject.setType(MOVABLE);
physicSystemObject.addProperties(player.getPositionProperty().build());
physicSystemObject.addProperties(player.getOrientationProperty().build());
physicSystemObject.addProperties(player.getVelocityProperty().build());
return builder.build();
} | [
"public long getCreatePlayerId() {\n return createPlayerId_;\n }",
"Player createPlayer();",
"public static GameObject createPlayer() {\n return new GameObject(new PlayerInputComponent(),\n new ObjectPhysicComponent(),\n new ObjectGraphicComponent(),\n \"player\");\n }",
"long getCreatePlayerId();",
"public Player create(PlayerInfo info);",
"void createPlayer(Player player);",
"public void createPlayer() {\n\t\tplayer = this.factory.getPlayer(rand.nextInt(Game.WIDTH));\n\t}",
"public void createNewPlayer()\r\n\t{\r\n\t\tCreateNewPlayer newPlayer = new CreateNewPlayer(stage);\r\n\t\tnewPlayer.show(game);\r\n\t}",
"private CSCreatePlayer() {}",
"public void createPlayer(){\n player = new Player();\n player.setName(Display.getStringPrompt(\"What is your name?: \"));\n Display.welcome(player.getName());\n player.setAge(Display.getIntPrompt(\"What is your age?: \"));\n checkAgeOfPlayer(player);\n player.setPurse(Display.getDoublePrompt(\"How much would you like to donate to the Fellowship of Froilan?: \"));\n }",
"public Player getPlayerObject () {\r\n \treturn playerObject;\r\n }",
"public void CreatePlayer() {\n this.player = new Player();\n\n gamePlatform.getChildren().addAll(this.player.getBody(), this.player.getCannon());\n\n gamePlatform.getChildren().get(55).setTranslateX(WIDTH / 2);\n gamePlatform.getChildren().get(55).setTranslateY(WIDTH * 0.9375);\n\n gamePlatform.getChildren().get(56).setTranslateX(WIDTH / 2 + 12);\n gamePlatform.getChildren().get(56).setTranslateY(WIDTH * 0.9265625);\n }",
"@Override\n public Object asObject() {\n return player;\n }",
"PlayerDescription createPlayerDescription();",
"public Create getCreate();",
"public Common.Object getDeleteObject(Player player) {\n Common.Object.Builder builder = Common.Object.newBuilder();\n builder.setId(player.getId().toString());\n builder.setName(player.getId().toString());\n return builder.build();\n }",
"OBJECT createOBJECT();",
"Game createGame() {\n return new MultiPlayerGame();\n }",
"private void createHumanPlayer() {\n humanPlayer = new Player(\"USER\");\n players[0] = humanPlayer;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggers the insert attached image wizard. Sets the content of the editor (rich text area). | public AttachedImageSelectPane insertAttachedImage()
{
editor.getMenuBar().clickImageMenu();
return editor.getMenuBar().clickInsertAttachedImageMenu();
} | [
"public void image()\n {\n ImageConfig imageConfig;\n String imageJSON = getTextArea().getCommandManager().getStringValue(Command.INSERT_IMAGE);\n if (imageJSON != null) {\n imageConfig = imageConfigJSONParser.parse(imageJSON);\n } else {\n imageConfig = new ImageConfig();\n imageConfig.setAltText(getTextArea().getDocument().getSelection().getRangeAt(0).toString());\n }\n getWizard().start(AlfrescoWizardStep.RESOURCE_REFERENCE_PARSER.toString(), createEntityLink(imageConfig));\n }",
"private void editorInsert(DocumentMarker marker) {\n\t\tToggle option = insertOptionGroup.getSelectedToggle();\n\n\t\t//Determine what to insert. Then delegate the call to the business layer\n\t\tif (option == insertTextToggle) {\n\t\t\tString text = insertTextField.getText();\n\t\t\tif (!text.isEmpty()) {\n\t\t\t\tpresent(cms.insertText(marker, text), false);\n\t\t\t}\n\t\t} else if (option == insertImageToggle) {\n\t\t\ttry {\n\t\t\t\tpresent(cms.insertImage(marker, new Image(insertImageUrlField.getText())), false);\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tAlertUtil.newErrorAlert(\"Error\", \"Insertion error\",\n\t\t\t\t\t\t\"Invalid image file!\")\n\t\t\t\t\t\t.showAndWait();\n\t\t\t}\n\t\t} else if (option == insertPageLinkToggle) {\n\t\t\tint id = Integer.parseInt(pageIdField.getText()); //Should be safe as we control the contents of this field\n\t\t\tpresent(cms.createLink(marker, id), false);\n\t\t} else if (option == nameLinkToggle) {\n\t\t\tpresent(cms.createReference(marker, Integer.parseInt(productIdField.getText()), CMS.ReferenceType.NAME), false);\n\t\t} else if (option == priceLinkToggle) {\n\t\t\tpresent(cms.createReference(marker, Integer.parseInt(productIdField.getText()), CMS.ReferenceType.PRICE), false);\n\t\t} else if (option == imageLinkToggle) {\n\t\t\tpresent(cms.createReference(marker, Integer.parseInt(productIdField.getText()), CMS.ReferenceType.IMAGE), false);\n\t\t} else if (option == descriptionLinkToggle) {\n\t\t\tpresent(cms.createReference(marker, Integer.parseInt(productIdField.getText()), CMS.ReferenceType.DESCRIPTION), false);\n\t\t} else if (option == tagsLinkToggle) {\n\t\t\tpresent(cms.createReference(marker, Integer.parseInt(productIdField.getText()), CMS.ReferenceType.TAGS), false);\n\t\t}\n\t}",
"private void draw() {\n editor.draw();\n }",
"private void setEditorReferenceImage(final IEditorReference iEditorReference, final Image image) {\n \t\tRunInUiThread.async(new Runnable() {\n \t\t\t\n \t\t\tpublic void run() {\n \t\t\t\ttry {\n \t\t\t\t\tIEditorPart editor = iEditorReference.getEditor(true);\n \t\t\t\t\tif(editor instanceof PyEdit){\n \t\t\t\t\t\t((PyEdit) editor).setEditorImage(image);\n \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t} catch (Throwable e) {\n \t\t\t\t\tPydevPlugin.log(e);\n \t\t\t\t}\n \t\t\t}\n \t\t});\n \t}",
"public void run() {\n \t\tString parsedSnippet = super.getParsedAction();\n\t\t\n\t\tparsedSnippet = SnipSmartDialog.parse(parsedSnippet, shell);\n\t\t\n\t\t//Now insert it!\n\t\tIWorkbench wb = PlatformUI.getWorkbench();\n\t\t IWorkbenchWindow win = wb.getActiveWorkbenchWindow();\n\t\t IWorkbenchPage page = win.getActivePage();\n\t\t \n\n\t\t IEditorPart part = page.getActiveEditor();\n\t\t if (!(part instanceof AbstractTextEditor)){\n\t\t\t return;\n\t\t }\n\t\t \n\t\t ITextEditor editor = (ITextEditor)part;\n\t\t IDocumentProvider dp = editor.getDocumentProvider();\n\t\t IDocument doc = dp.getDocument(editor.getEditorInput());\n\t\t ISelectionProvider selectionProvider = editor.getSelectionProvider();\n\t\t \n\t\t ISelection selection = selectionProvider.getSelection();\n\t\t int currentOffset = 0;\n\t\t int currentLength = 0;\n\t\t if (selection instanceof ITextSelection) {\n\t\t\t\tcurrentOffset = ((ITextSelection) selection).getOffset();\n\t\t\t\tcurrentLength = ((ITextSelection) selection).getLength();\n\t\t }\n\t\t //Need to get the current cursor position\n\t\t \n\t\t int offset;\n\t\ttry {\n\t\t\tdoc.replace(currentOffset, currentLength, parsedSnippet);\n\t\t} catch (BadLocationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t\t\n\t//\tshowMessage(\"Call from Insert Node Action\" + parsedSnippet);\n\t}",
"void editorActivated(IViewPart activeViewPart);",
"protected abstract void createDesignEditorPage() throws PartInitException;",
"public void runEditorNew()\r\n\t{\r\n\t\tmainFrame.runEditorNew();\r\n\t}",
"public void doInsertMouse() {\n setInactiveIcons();\n lblInsert.setIcon(insertActive);\n pnlContent.setPreferredSize(new Dimension(1000, 600));\n cbObjectForManagement.setSelectedItem(\"None\");\n lblManagementTitle.setText(\"Insert\");\n //hide components \n //hide fill panel\n pnlFillInfo.setVisible(false);\n pnlFillInfo.setEnabled(false);\n //hide choose update item combo box\n lblUpdateChooseObjItem.setVisible(false);\n lblUpdateChooseObjItem.setEnabled(false);\n cbUpdateItem.setVisible(false);\n cbUpdateItem.setEnabled(false);\n lblUpdateConfirm.setVisible(false);\n lblUpdateConfirm.setEnabled(false);\n\n lblInsert.setForeground(Color.white);\n currentFunction = \"Insert\";\n }",
"@Override\r\n protected void doExecute() {\n Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);\r\n diagramResource.setTrackingModification(true);\r\n // create Feature Diagram model\r\n String diagramName = resolveDiagramName(diagramResource);\r\n Diagram diagram = Graphiti.getPeCreateService().createDiagram(FMEDiagramEditor.DIAGRAM_TYPE_NAME, diagramName, DIAGRAM_GRID_SIZE, DIAGRAM_SNAP_TO_GRID);\r\n diagramResource.getContents().add(diagram);\r\n // save Feature Diagram resources\r\n saveResource(diagramResource, \"Feature Diagram\");\r\n }",
"public void clickInsertFile() {\n switchToContentMenuFrame();\n mnuInsertFile.click();\n }",
"public void insert(String text) {\n\t\tcmd = new InsertCommand(text, editor);\n\t\tinvoker = new MiniEditorInvoker(cmd);\n\t\tinvoker.action();\n\t}",
"private void editTextEditorButton(){\n TextEditorTextfield.setText(textEditorPref);\n TextEditorDialog.setVisible(true);\n }",
"void openSelected() {\n WSEditor currentEditorAccess = pluginWorkspaceAccess.getCurrentEditorAccess(\n PluginWorkspace.MAIN_EDITING_AREA);\n if (currentEditorAccess != null) {\n WSEditorPage currentPage = currentEditorAccess.getCurrentPage();\n if (currentPage instanceof WSXMLTextEditorPage) {\n String selectedText = ((WSTextEditorPage) currentPage).getSelectedText();\n try {\n URL toOpen = new URL(currentEditorAccess.getEditorLocation(), selectedText);\n openImage(currentPage, toOpen);\n\n } catch (MalformedURLException e1) {\n e1.printStackTrace();\n } catch (IOException e1) {\n e1.printStackTrace();\n } catch (XPathException e1) {\n e1.printStackTrace();\n }\n }\n }\n }",
"public void run() { Try to select the items in the current content viewer of\n // the editor.\n //\n if (objectEditorPage.getViewer() != null) {\n objectEditorPage.getViewer().setSelection(new StructuredSelection(theSelection.toArray()),\n true);\n }\n }",
"public abstract void addEditorForm();",
"org.apache.xmlbeans.XmlString addNewDocumentImage();",
"public void runEditorExisting()\r\n\t{\r\n\t\tmainFrame.runEditorExisting();\r\n\t}",
"public void run() { Try to select the items in the current content viewer of the editor.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (currentViewer != null) {\n\t\t\t\t\t\t\tcurrentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the status of the service | public Status getServiceStatus() {
if (service.getStatus() != null) {
if (service.getStatus().equals(Status.ERROR)) {
return Status.ERROR;
}
}
return super.getServiceStatus();
} | [
"public ServiceStatus getStatus();",
"public StatusService getStatusService() {\r\n return this.statusService;\r\n }",
"public ServiceStatus getServiceStatus(final ExasolService service) {\n return this.serviceStatuses.get(service);\n }",
"public final ServiceStatusType getServiceStatus(){\n \t//Initial value for status just in case \"true\" of \"false\" is not found\n\t\tServiceStatusType serviceStatus = ServiceStatusType.UNKNOWN;\n \tif (\"true\".equals(status)){\n \t\tserviceStatus = ServiceStatusType.RUNNING;\n \t} else if (\"false\".equals(status)){\n \t\tserviceStatus = ServiceStatusType.STOPPED;\n \t}\t\t \t\n \treturn serviceStatus;\n\t}",
"protected StatusService getStatusService() {\n return getLockssDaemon().getStatusService();\n }",
"SearchServiceStatus status();",
"public ServiceTaskStatus getStatus() {\n\t\treturn this.status;\n\t}",
"public int getStatus() {\n\t\treturn getServiceRequestStatus();\n\t}",
"public int getServiceRequestStatus() {\n\t\treturn status;\n\t}",
"public String getServiceRequestStatusString() {\n\t\treturn ServiceRequest.getStatusString(status);\n\t}",
"public java.util.List<String> getServiceUpdateStatus() {\n if (serviceUpdateStatus == null) {\n serviceUpdateStatus = new com.amazonaws.internal.SdkInternalList<String>();\n }\n return serviceUpdateStatus;\n }",
"@GET\n @Path(\"/status\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getStatus() {\n String status = contextServiceClient.getStatus();\n return Response.ok().entity(status).build();\n }",
"public StatusWebService status() {\n return this.statusAPI;\n }",
"public String getService() {\n if (!this.newStatus.getService().equals(\"?\")) {\n return this.newStatus.getService();\n } else if (!this.oldStatus.getService().equals(\"?\")) {\n return this.oldStatus.getService();\n } else {\n return \"?\";\n }\n }",
"trinsic.services.CoreService.ResponseStatus getStatus();",
"public T checkServiceStatus(T req);",
"public JSONObject checkService() {\n\t\tlog.info(\"ENTER: Service's checkService()\");\n\t\tString url = configuration.getPaysafeURL();\n\t\tJSONObject response = new JSONObject();\n\t\ttry {\n\t\t\tString result = rest.get(url);\n\t\t\tresponse = (JSONObject) JSONUtils.covertToJSON(result);\n\t\t\tSimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"dd-MM-yy:HH:mm:SS\");\n\t\t\tString date = DATE_FORMAT.format(new Date());\n\t\t\tMonitoringData data = new MonitoringData(response.getString(\"status\").toString(), date);\n\t\t\tcacheService.putMonitoringData(data);\n\t\t\treturn response;\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Service Exception is \" + e.getLocalizedMessage(), e);\n\t\t\tresponse.put(StatusConstants.ERROR_LABEL, e.getLocalizedMessage());\n\t\t\treturn response;\n\t\t}\n\t}",
"public java.lang.Object getStatus() {\n return status;\n }",
"public Map serviceStatus(String id) throws IOException\n\t{\n\t\treturn request(GET, address(id, \"stats\"));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets an array of URLs property. If null or size null removes previous preference. | public void setURLs(String mkey, URL[] values) {
int j = 0;
if (values != null)
for (URL value : values) {
if (value != null) {
setURL(mkey + j, value);
j++;
}
}
// erase other elements
String last;
while (true) {
last = getString(mkey + j);
if (last == null)
break;
setString(mkey + j, null);
j++;
}
} | [
"public void setUrl(String[] newValue) {\n this.url.setValue(newValue.length, newValue );\n }",
"public final void setSeedUrls(URL[] urls){\n\t\tseedUrls.clear();\n\t\taddSeedUrls(urls);\n\t}",
"protected void internalSetUris(String[] uris) {\n m_uris = uris;\n m_prefixes = new String[uris.length];\n m_prefixes[0] = \"\";\n m_prefixes[1] = \"xml\";\n }",
"public String[] getUrls() {\n\t\treturn null;\n\t}",
"protected void addURLs(URL[] urls) {\n addURLs(Arrays.asList(urls));\n }",
"public void setUris(String uris) {\n configuration.setUris(uris);\n }",
"private void setAnnotationURLs(URL[] urls) {\n this.codebase = urls;\n this.exportAnnotation = urlsToPath(codebase);\n }",
"public void setPhotoUrls(List<String> photoUrls) {\n this.photoUrls = photoUrls;\n }",
"public void setWhitelistedAlgorithms(@Nullable final Collection<String> uris) {\n if (uris == null) {\n whitelist = Collections.emptySet();\n return;\n }\n whitelist = new HashSet<>(StringSupport.normalizeStringCollection(uris));\n }",
"void setLinks(List<Link> links);",
"@Override\n void set(String[] value) {\n JavaScriptObject array = JavaScriptObject.createArray();\n for (String s : value) {\n prefs.push(array, s);\n }\n prefs.setArray(getName(), array);\n }",
"public void setBlacklistedAlgorithms(@Nullable final Collection<String> uris) {\n if (uris == null) {\n blacklist = Collections.emptySet();\n return;\n }\n blacklist = new HashSet<>(StringSupport.normalizeStringCollection(uris));\n }",
"public void setPhotoUrls(XingPhotoUrls photoUrls) {\n this.photoUrls = photoUrls;\n }",
"public void setWeburls(String weburls) {\n this.weburls = weburls;\n }",
"public void setImageUrls(List<String> imageUrls)\n {\n this.imageUrls = imageUrls;\n }",
"public abstract Collection<URL> getUrlsToUpdate();",
"public void setPicUrls(String picUrls) {\n this.picUrls = picUrls == null ? null : picUrls.trim();\n }",
"public List<String> getUrls() {\n\t\treturn urls;\n\t}",
"public abstract void setURL(String url);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an effect result that is triggered when a card is stacked from table. | public StackedFromTableResult(Action action, String performingPlayerId, PhysicalCard card, PhysicalCard stackedOn) {
super(Type.STACKED_FROM_TABLE, performingPlayerId);
_card = card;
_stackedOn = stackedOn;
} | [
"public StackedFromTableResult(Action action, PhysicalCard card, PhysicalCard stackedOn) {\n this(action, action.getPerformingPlayer(), card, stackedOn);\n }",
"public void executeEffect() {\n\t\texecuteEffect(myCard);\n\t}",
"@Override\n protected void performActionResults(Action targetingAction) {\n PhysicalCard finalTarget = action.getPrimaryTargetCard(targetGroupId);\n\n // Perform result(s)\n action.appendEffect(\n new PlaceCardInUsedPileFromTableEffect(action, finalTarget));\n }",
"@Override\n public void effect(Table table, ArrayList<Player> players) {\n\n }",
"public void resolveEffect(Card playedCard, int row, int col)\r\n {\r\n char type = playedCard.getEffectType();\r\n char target = playedCard.getEffectTarget();\r\n \r\n //Temp variables for this method\r\n int validTarget;\r\n int[] choice = new int[2];\r\n \r\n switch(type)\r\n {\r\n case 'H': //DISCARD HAND\r\n boolean discard = true; //PLACEHOLDER, ASK USER IF THEY WISH TO DISCARD\r\n if(discard)\r\n {\r\n final int NEW_HAND = 7;\r\n \r\n if(playerTurn == 0)\r\n {\r\n red.discard();\r\n for(int i = 0; i < NEW_HAND; i++)\r\n red.draw();\r\n }\r\n else\r\n {\r\n blue.discard();\r\n for(int i = 0; i < NEW_HAND; i++)\r\n blue.draw();\r\n }\r\n }\r\n break;\r\n case 'D': //DRAW\r\n final int DRAW_THRESHOLD = 4;\r\n if(playerTurn == 0)\r\n {\r\n if(red.getHand().size() >= 4)\r\n {\r\n while(red.getHand().size() < 7)\r\n red.draw();\r\n }\r\n }\r\n else\r\n {\r\n if(blue.getHand().size() >= 4)\r\n {\r\n while(blue.getHand().size() < 7)\r\n blue.draw();\r\n }\r\n }\r\n break;\r\n case '0': //ZERO\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n \r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect());\r\n break;\r\n case '-': //SUBTRACT\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n case '+':\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'A') //ADJACENT\r\n {\r\n ArrayList<Tile> adj = gameBoard.getAdjacent(row, col);\r\n \r\n for(int i = 0; i < adj.size(); i++)\r\n adj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n if(target == 'N')\r\n {\r\n ArrayList<Tile> nonadj = gameBoard.getNonAdjacent(row, col);\r\n\r\n for(int i = 0; i < nonadj.size(); i++)\r\n nonadj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n break;\r\n case '*':\r\n if(target == 'X') //ANY\r\n {\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n \r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != -1)\r\n //REPROMPT FOR CHOICE\r\n \r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'O') //OPPONENT\r\n {\r\n if(playerTurn == 0)\r\n validTarget = 1;\r\n else\r\n validTarget = 0;\r\n\r\n choice[0] = 0; //PLACEHOLDER, ASK USER FOR TARGET\r\n choice[1] = 0;\r\n\r\n while(gameBoard.tilePlayer(choice[0], choice[1]) != validTarget )\r\n //REPROMPT FOR CHOICE\r\n\r\n gameBoard.getTile(choice[0], choice[1]).addEffect(playedCard.getEffect()); \r\n }\r\n if(target == 'A') //ADJACENT\r\n {\r\n ArrayList<Tile> adj = gameBoard.getAdjacent(row, col);\r\n \r\n for(int i = 0; i < adj.size(); i++)\r\n adj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n if(target == 'N')\r\n {\r\n ArrayList<Tile> nonadj = gameBoard.getNonAdjacent(row, col);\r\n\r\n for(int i = 0; i < nonadj.size(); i++)\r\n nonadj.get(i).addEffect(playedCard.getEffect());\r\n }\r\n break;\r\n }\r\n }",
"@Override\n protected void performActionResults(Action targetingAction) {\n final PhysicalCard finalTarget = targetingAction.getPrimaryTargetCard(targetGroupId);\n\n // Perform result(s)\n action.appendEffect(\n new DrawDestinyEffect(action, playerId, 2) {\n @Override\n protected void destinyDraws(SwccgGame game, List<PhysicalCard> destinyCardDraws, final List<Float> destinyDrawValues1, final Float totalDestiny1) {\n action.appendEffect(\n new DrawDestinyEffect(action, opponent, 2) {\n @Override\n protected void destinyDraws(SwccgGame game, List<PhysicalCard> destinyCardDraws, List<Float> destinyDrawValues2, Float totalDestiny2) {\n GameState gameState = game.getGameState();\n for (Float drawValues1 : destinyDrawValues1) {\n for (Float drawValues2 : destinyDrawValues2) {\n if (drawValues2.equals(drawValues1)) {\n gameState.sendMessage(\"Result: Succeeded\");\n action.appendEffect(\n new ResetPowerUntilEndOfBattleEffect(action, finalTarget, 0));\n return;\n }\n }\n }\n gameState.sendMessage(\"Result: Failed\");\n }\n }\n );\n }\n }\n );\n }",
"private void doCardEffects(Card c) {\r\n\t\tcurrentPlayer.updateSkill(c.getSkill());\r\n\t\tcurrentPlayer.updateBoots(c.getBoots());\r\n\t\tcurrentPlayer.updateSwords(c.getSwords());\r\n\t\tcurrentPlayer.updateGold(c.getGold());\r\n\t\tcurrentPlayer.updateClankOnBoard(c.getClank());\r\n\t\tif (c.isTeleport()) {\r\n\t\t\tcurrentPlayer.updateTeleports(1);\r\n\t\t}\r\n\t\t\r\n\t\t// Do swag effect\r\n\t\tif (currentPlayer.getSwags() > 0 && c.getClank() > 0) currentPlayer.updateSkill(c.getClank()*currentPlayer.getSwags());\r\n\t\t\r\n\t\t// Draw last (not sure if required)\r\n\t\tcurrentPlayer.draw(c.getDraw());\r\n\t\t\r\n\t\t// Calculate conditions\r\n\t\tif (c.getCondition() != null) {\r\n\t\t\tif (c.getCondition()[0].contentEquals(\"companion\")) {\r\n\t\t\t\tif (currentPlayer.hasCompanion()) {\r\n\t\t\t\t\tcurrentPlayer.draw(1);\r\n\t\t\t\t}\r\n\t\t\t} else if (c.getCondition()[0].contentEquals(\"artifact\")) {\r\n\t\t\t\tif (currentPlayer.has(\"Artifact\")) {\r\n\t\t\t\t\tif (c.getCondition()[1].contentEquals(\"teleport\")) {\r\n\t\t\t\t\t\tcurrentPlayer.updateTeleports(1);\r\n\t\t\t\t\t} else if (c.getCondition()[1].contentEquals(\"skill\")) {\r\n\t\t\t\t\t\tcurrentPlayer.updateSkill(2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (c.getCondition()[0].contentEquals(\"crown\")) {\r\n\t\t\t\tif (currentPlayer.has(\"Crown\")) {\r\n\t\t\t\t\tif (c.getCondition()[1].contentEquals(\"heart\")) {\r\n\t\t\t\t\t\tupdateHealth(currentPlayer,1);\r\n\t\t\t\t\t} else if (c.getCondition()[1].contentEquals(\"swordboot\")) {\r\n\t\t\t\t\t\tcurrentPlayer.updateSwords(1);\r\n\t\t\t\t\t\tcurrentPlayer.updateBoots(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (c.getCondition()[0].contentEquals(\"monkeyidol\")) {\r\n\t\t\t\tif (currentPlayer.has(\"MonkeyIdol\")) {\r\n\t\t\t\t\tcurrentPlayer.updateSkill(2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Unique Cards\r\n\t\tif (c.isUnique()) {\r\n\t\t\t// Choose cards\r\n\t\t\tif (c.getName().contentEquals(\"Shrine\") || c.getName().contentEquals(\"Dragon Shrine\") ||\r\n\t\t\t\tc.getName().contentEquals(\"Treasure Hunter\") || \r\n\t\t\t\tc.getName().contentEquals(\"Underworld Dealing\") || c.getName().contentEquals(\"Mister Whiskers\") ||\r\n\t\t\t\tc.getName().contentEquals(\"Wand of Wind\")) {\r\n\t\t\t\tmustChoose.add(c.getName());\r\n\t\t\t\tchoosePrompt();\r\n\t\t\t} else if (c.getName().endsWith(\"Master Burglar\")) {\r\n\t\t\t\tcurrentPlayer.trash(\"Burgle\");\r\n\t\t\t} else if (c.getName().contentEquals(\"Dead Run\")) {\r\n\t\t\t\tcurrentPlayer.setRunning(true);\r\n\t\t\t} else if (c.getName().contentEquals(\"Flying Carpet\")) {\r\n\t\t\t\tcurrentPlayer.setFlying(true);\r\n\t\t\t} else if (c.getName().contentEquals(\"Watcher\") || c.getName().contentEquals(\"Tattle\")) {\r\n\t\t\t\tgiveOthersClank(1);\r\n\t\t\t} else if (c.getName().contentEquals(\"Swagger\")) {\r\n\t\t\t\tcurrentPlayer.setSwags(currentPlayer.getSwags()+1);\r\n\t\t\t} else if (c.getName().contentEquals(\"Search\")) {\r\n\t\t\t\tcurrentPlayer.setSearches(currentPlayer.getSearches()+1);\r\n\t\t\t} else if (c.getName().contentEquals(\"Sleight of Hand\") || c.getName().contentEquals(\"Apothecary\")) {\r\n\t\t\t\t// Including itself\r\n\t\t\t\t// If there are other cards, add discard\r\n\t\t\t\tif (currentPlayer.getPlayArea().getNonPlayedSize() > 1) {\r\n\t\t\t\t\tmustDiscard.add(c.getName());\r\n\t\t\t\t\tdiscardPrompt();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n protected void performActionResults(Action targetingAction) {\n PhysicalCard cardToCancel = targetingAction.getPrimaryTargetCard(targetGroupId);\n PhysicalCard captiveToRelease = Filters.findFirstActive(game, self,\n SpotOverride.INCLUDE_CAPTIVE, Filters.and(Filters.captive, Filters.targetedByCardOnTable(cardToCancel)));\n\n // Perform result(s)\n action.appendEffect(\n new CancelCardOnTableEffect(action, cardToCancel));\n if (captiveToRelease != null) {\n action.appendEffect(\n new ReleaseCaptiveEffect(action, captiveToRelease));\n }\n }",
"private static WeaponCard buildWeaponCard(int index){\n EffectDescription effectDescription = new EffectDescription(\n \"sample_effect_\" + index,\n \"Basic effect\",\n \"I am a basic effect\",\n Collections.singletonList(AmmoCubeCost.RED)\n );\n\n return new WeaponCard(\n \"sample_weapon_\" + index,\n \"Weapon\",\n Arrays.asList(AmmoCubeCost.BLUE, AmmoCubeCost.RED),\n Collections.singletonList(effectDescription)\n );\n }",
"public boolean executeEffect(Card card_to_play, Game game);",
"private String addEffect() {\n\t\t// One Parameter: EffectName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|effect:\" + parameters[0]);\n\t\treturn tag.toString();\n\n\t}",
"Effect() {\n }",
"@Test \n\tpublic void federicoDaMontefeltroEffectTest(){\n\t\tEffect effect = new FedericoDaMontefeltroEffect();\n\t\teffect.applyEffect(player);\n\t\tfor(FamilyMember f : player.getFamilyMembers().values()){\n\t\t\tassertEquals(player.getFamilyMembers().get(f.getColor()).getActionValueImposition(), 6);\n\t\t}\n\t\t\n\t}",
"@Override\n protected void performActionResults(Action targetingAction) {\n final PhysicalCard character = targetingAction.getPrimaryTargetCard(targetGroupId);\n\n // Perform result(s)\n action.appendEffect(\n new ChooseToMoveAwayOrBeLostEffect(action, game.getOpponent(playerId), character, true));\n }",
"private void setChooseCardActions(StackPane currentCard) {\n currentCard.setOnMouseEntered(event -> {\n currentCard.setEffect(ShadowEffect.GOLD.getShadow());\n GUIUtility.playClip(SoundEffect.CARD_FLIP_CLIP.getClip());\n });\n\n currentCard.setOnMouseExited(event -> { currentCard.setEffect(null); });\n }",
"@Override\n protected void performActionResults(Action targetingAction) {\n final PhysicalCard finalTarget = targetingAction.getPrimaryTargetCard(targetGroupId);\n\n // Perform result(s)\n action.appendEffect(\n new ReleaseCaptiveEffect(action, finalTarget));\n action.appendEffect(\n new AddUntilEndOfPlayersNextTurnModifierEffect(action,\n playerId, new MayNotBeBattledModifier(self, finalTarget),\n \"Makes \" + GameUtils.getCardLink(finalTarget) + \" not able to be battled\"));\n }",
"public LoseCardFromTableEffect(Action action, PhysicalCard card) {\n this(action, card, false, false);\n }",
"public String effect() {\n return this.effect;\n }",
"int getEffect();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
acid test to mock the update sequence all the way from the update loop The loop simulates the logic in the typical GlobalSimulationObjectiveListener::simulatedNumeric implementation | @Test
public void testNestedUpdates() throws Exception {
// acid test to mock the update sequence all the way from the update loop
// The loop simulates the logic in the typical
// GlobalSimulationObjectiveListener::simulatedNumeric implementation
//
class Simulator {
Number param = new NumberWithJitter<Integer>(10, 1, 5);
public Number getParam() {
return param;
}
public void setParam(Number targetValue) {
param = new NumberWithGradient(param, targetValue, 2);
}
}
Simulator sim = new Simulator();
for (int idx = 1; idx < 5; idx++) {
Number newValue = new NumberWithJitter<Integer>(10+idx, 1, 5);
sim.setParam(newValue);
}
NumberWithGradient nwg = (NumberWithGradient)sim.getParam();
Assert.assertTrue("Make sure there is no memory leak due to chaining",
nwg.startValue instanceof NumberWithJitter);
} | [
"@Test\r\n public void testUpdate() {\r\n System.out.println(\"update\");\r\n float tpf = 1f;\r\n instance.usePowerup(player);\r\n \r\n for (int i = 0; i < 5; i++) {\r\n instance.update(tpf);\r\n }\r\n System.out.println(System.currentTimeMillis());\r\n System.out.println(vehicle.getMaxSpeed());\r\n System.out.println(vehicle.getDefaultMaxSpeed());\r\n assertTrue(vehicle.getDefaultMaxSpeed() == vehicle.getMaxSpeed());\r\n }",
"@Override\n public void simulationPeriodic() \n {\n }",
"@Override\n public void simulationPeriodic() {\n }",
"@Test\n public void testCheckUpdate ()\n {\n System.out.println (\"checkUpdate\");\n DefaultSimEventList instance = new DefaultSimEventList (DefaultSimEvent.class);\n SimEvent e = new DefaultSimEvent (15.8, null, null);\n instance.checkUpdate (e);\n double expResult = 15.8;\n double result = instance.getTime ();\n assertEquals (expResult, result, 0.0); \n e = new DefaultSimEvent (13.2, null, null); // Before current time; should be ignored.\n try\n {\n instance.checkUpdate (e);\n fail (\"Attempt to update before current time should fail!\");\n }\n catch (IllegalArgumentException iae)\n {\n }\n expResult = 15.8;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0); \n e = new DefaultSimEvent (42.0, null, null);\n instance.checkUpdate (e);\n expResult = 42.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n // Try again with same event (time); should be OK.\n instance.checkUpdate (e);\n expResult = 42.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n }",
"@Test\n public void testUpdateTemperatures() {\n System.out.println(\"updateTemperatures\");\n instance.setupSimulation();\n instance.updateTemperatures();\n }",
"@Test\r\n public void testChange() {\r\n final String topo = \"TOPO\";\r\n final String exec = \"exec\";\r\n final String alg = \"alg\";\r\n final String param1 = \"param1\";\r\n final String value1 = \"val1\";\r\n final String param2 = \"param2\";\r\n final String value2 = \"val2\";\r\n \r\n final int inPort = 1234;\r\n final int outPort = 4321;\r\n final int warmup = 50;\r\n final String host = \"localhost\";\r\n final String msgId = \"423de707-921e-4b30-8159-5e6b80011b81\";\r\n \r\n TestListener listener = new TestListener();\r\n AlgorithmChangeSignal signal = new AlgorithmChangeSignal(topo, exec, alg, msgId);\r\n listener.expect(signal);\r\n AlgorithmChangeSignal.notify(signal.createPayload(), topo, exec, listener);\r\n Assert.assertTrue(listener.receivedSignal());\r\n\r\n signal = new AlgorithmChangeSignal(topo, exec, alg, \"\");\r\n listener.expect(signal);\r\n AlgorithmChangeSignal.notify(signal.createPayload(), topo, exec, listener);\r\n Assert.assertTrue(listener.receivedSignal());\r\n\r\n List<ParameterChange> changes = new ArrayList<ParameterChange>();\r\n changes.add(new ParameterChange(param1, value1));\r\n changes.add(new ParameterChange(param2, value2));\r\n signal = new AlgorithmChangeSignal(topo, exec, alg, changes, msgId);\r\n listener.expect(signal);\r\n AlgorithmChangeSignal.notify(signal.createPayload(), topo, exec, listener);\r\n Assert.assertTrue(listener.receivedSignal());\r\n \r\n // instance reuse is not intended but ok here\r\n Map<AlgorithmChangeParameter, Serializable> params = new HashMap<AlgorithmChangeParameter, Serializable>();\r\n params.put(AlgorithmChangeParameter.INPUT_PORT, inPort);\r\n params.put(AlgorithmChangeParameter.OUTPUT_PORT, outPort);\r\n signal.setParameters(params);\r\n signal.setIntParameter(AlgorithmChangeParameter.WARMUP_DELAY, warmup);\r\n signal.setStringParameter(AlgorithmChangeParameter.COPROCESSOR_HOST, host);\r\n \r\n assertEquals(inPort, signal.getIntParameter(AlgorithmChangeParameter.INPUT_PORT, null));\r\n assertEquals(outPort, signal.getIntParameter(AlgorithmChangeParameter.OUTPUT_PORT, null));\r\n assertEquals(warmup, signal.getIntParameter(AlgorithmChangeParameter.WARMUP_DELAY, null));\r\n assertEquals(host, signal.getStringParameter(AlgorithmChangeParameter.COPROCESSOR_HOST, null));\r\n \r\n listener.expect(signal);\r\n AlgorithmChangeSignal.notify(signal.createPayload(), topo, exec, listener);\r\n Assert.assertTrue(listener.receivedSignal());\r\n }",
"public void updateSim() throws Exception {\n\n\t\t// Print messages on the screen, one per step\n\t\tif (CmdLogger.hasSomething()) {\n\t\t\tCmdLogger.update();\n\t\t\tSystem.out.println(\"CMDLogger is not empty... this shouldn't be\");\n\t\t\treturn;\n\t\t}\n\n\t\tboolean doSelection = false;\n\t\t// update interval for selecting new strategy\n\t\tif (selectInterval > 1) {\n\t\t\tif (currentSelectInt >= selectInterval) {\n\t\t\t\tdoSelection = true;\n\t\t\t\tcurrentSelectInt = 0;\n\t\t\t} else {\n\t\t\t\tcurrentSelectInt++;\n\t\t\t}\n\t\t} else {\n\t\t\tdoSelection = true;\n\t\t}\n\n\t\t// check events - process event\n\t\tcheckAndProcessEvent(stats.get_time_step());\n\n\t\tif (USEGLOBAL) {\n\t\t\treg.update();\n\t\t}\n\n\t\t// Update all traceable objects (move them around)\n\t\tfor (TraceableObject o : this.objects) {\n\t\t\to.update();\n\t\t}\n\n\t\t// random camera select - random timespan to go offline...\n\t\tint random = randomGen.nextInt(100, RandomUse.USE.ERROR);\n\n\t\tif (random <= CAMERRORRATE) {\n\t\t\t// select random camera and set it offline for a random number of\n\t\t\t// timesteps\n\t\t\tint ranCam = randomGen.nextInt(this.cameras.size(), RandomUse.USE.ERROR);\n\t\t\tint sleepFor = randomGen.nextInt(10, RandomUse.USE.ERROR);\n\n\t\t\tCameraController cc = cameras.get(ranCam);\n\t\t\tcc.setOffline(sleepFor);\n\t\t\tint ranReset = randomGen.nextInt(100, RandomUse.USE.ERROR);\n\t\t\tif (ranReset > RESETRATE) {\n\t\t\t\tcc.resetCamera();\n\t\t\t}\n\t\t}\n\n\t\t// update all objects position in the world view\n\t\t// select a new ai if bandit solvers are used\n\t\tfor (CameraController c : this.cameras) {\n\t\t\tif (!c.isOffline()) {\n\t\t\t\tfor (TraceableObject o : this.objects) {\n\t\t\t\t\tc.update_confidence(o);\n\t\t\t\t}\n\t\t\t\tif (!c.getVisibleObjects_bb().isEmpty()) {\n\t\t\t\t\tstats.addVisible();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// run BanditSolver, select next method, set AI! hope it works ;)\n\t\t\tAbstractAINode ai = c.getAINode();\n\t\t\tAbstractCommunication prevComm = ai.getComm();\n\t\t\tIBanditSolver bs = ai.getBanditSolver();\n\t\t\tint strategy = -1;\n\t\t\tif (bs != null) {\n\t\t\t\t// if(doSelection)\n\t\t\t\tint prevStrat = getStratForAI(ai);\n\t\t\t\tstrategy = bs.selectAction();\n\t\t\t\t// /System.out.println(step + \"-\" + c.getName() + \": \" +\n\t\t\t\t// strategy);\n\t\t\t\tif (prevStrat != strategy)\n\t\t\t\t\tstats.setStrat(strategy, c.getName());\n\t\t\t}\n\n\t\t\t// System.out.println(c.getName() + \" current: \" + ai.getClass() +\n\t\t\t// ai.getComm() + \" - next: \" + strategy);\n\t\t\tswitch (strategy) {\n\t\t\tcase 0: // ABC\n\t\t\t\tAbstractAINode newAI1 = newAINodeFromName(\"epics.ai.ActiveAINodeMulti\", new Broadcast(ai, c), ai); // staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI1);\n\t\t\t\tbreak;\n\t\t\tcase 1: // ASM\n\t\t\t\tAbstractAINode newAI2 = newAINodeFromName(\"epics.ai.ActiveAINodeMulti\", new Smooth(ai, c), ai); // newAINodeFromName(\"epics.ai.ActiveAINodeMulti\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI2);\n\t\t\t\tbreak;\n\t\t\tcase 2: // AST\n\t\t\t\tAbstractAINode newAI3 = newAINodeFromName(\"epics.ai.ActiveAINodeMulti\", new Step(ai, c), ai); // staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI3);\n\t\t\t\tbreak;\n\t\t\tcase 3: // PBC\n\t\t\t\tAbstractAINode newAI4 = newAINodeFromName(\"epics.ai.PassiveAINodeMulti\", new Broadcast(ai, c), ai); // staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI4);\n\t\t\t\tbreak;\n\t\t\tcase 4: // PSM\n\t\t\t\tAbstractAINode newAI5 = newAINodeFromName(\"epics.ai.PassiveAINodeMulti\", new Smooth(ai, c), ai); // staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI5);\n\t\t\t\tbreak;\n\t\t\tcase 5: // PST\n\t\t\t\tAbstractAINode newAI6 = newAINodeFromName(\"epics.ai.PassiveAINodeMulti\", new Step(ai, c), ai); // staticVG,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ai.getVisionGraph(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reg);\n\t\t\t\tc.setAINode(newAI6);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// STICK TO OLD\n\t\t\t}\n\t\t}\n\n\t\t// Advertise each camera's owned objects\n\t\tfor (CameraController c : this.cameras) {\n\t\t\tc.getAINode().advertiseTrackedObjects();\n\t\t}\n\n\t\t// Place all bids before updateAI() is called in the next loop\n\t\tfor (CameraController c : this.cameras) {\n\t\t\tc.getAINode().updateReceivedDelay();\n\t\t\tc.getAINode().updateAuctionDuration();\n\t\t\tc.getAINode().checkIfSearchedIsVisible();\n\t\t\tc.forwardMessages(); // Push messages to relevant nodes\n\t\t}\n\n\t\t// do trading for all cameras\n\t\tfor (CameraController c : this.cameras) {\n\t\t\tc.updateAI();\n\n\t\t\tint nrMessages = c.getAINode().getSentMessages();\n\t\t\tdouble commOverhead = 0.0;\n\t\t\t// if(nrMessages > 0){\n\t\t\t// commOverhead = (nrMessages-c.getAINode().getNrOfBids()) /\n\t\t\t// nrMessages; //\n\t\t\t// }\n\n\t\t\tcommOverhead = nrMessages;\n\n\t\t\tstats.setCommunicationOverhead(commOverhead, c.getName());\n\n\t\t\t// check if bandit solvers are used\n\t\t\tIBanditSolver bs = c.getAINode().getBanditSolver();\n\t\t\tif (bs != null) {\n\t\t\t\tdouble utility = c.getAINode().getUtility() + c.getAINode().getReceivedUtility() - c.getAINode().getPaidUtility();\n\t\t\t\tstats.setReward(utility, commOverhead, c.getName());\n\t\t\t\tbs.setCurrentReward(utility, commOverhead, ((double) c.getAINode().getTrackedObjects().size()));\n\t\t\t}\n\n\t\t}\n\t\tthis.computeUtility();\n\t\tstats.nextTimeStep();\n\t}",
"void fakeObjectUpdate() {\n notifyTestHelper(TestHelper.COMMAND_ENQUEUED);\n notifyTestHelper(TestHelper.COMMAND_SUCCESSFUL);\n notifyTestHelper(TestHelper.OBJECT_UPDATED);\n }",
"@Test\n\tpublic void testRepeatibleDynamics() throws IOException, PropertiesException {\n\n\t\t\n\t\t// INSTANTIATE benchmark \n\t\tProperties props = PropertiesUtil.setpointProperties(new File (\"src/main/resources/sim.properties\"));\n\t\tSetPointGenerator lg = new SetPointGenerator (props);\n\t\tList<ExternalDriver> externalDrivers = new ArrayList<ExternalDriver>();\n\t\texternalDrivers.add(lg);\n\t\tIndustrialBenchmarkDynamics d = new IndustrialBenchmarkDynamics (props, externalDrivers);\n\t\tRandom actionRand = new Random(System.currentTimeMillis());\n \n // 1) do 100000 random steps, in order to initialize dynamics\n\t\tfinal ActionDelta action = new ActionDelta(0.001f, 0.001f, 0.001f); \n\t\tfor (int i=0; i<INIT_STEPS; i++) {\n\t\t\taction.setDeltaGain(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaVelocity(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaShift(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\td.step(action);\n\t\t}\n\t\t\n\t\t// 2) memorize current observable state and current markov state\n\t\tfinal ObservableState os = d.getState();\n\t\tfinal DataVector ms = d.getInternalMarkovState();\n\t\tSystem.out.println (\"init o-state: \" + os.toString());\n\t\tSystem.out.println (\"init m-state: \" + ms.toString());\n\t\t\n\t\t\n\t\t// 3) perform test trajectory and memorize states\n\t\tactionRand.setSeed(ACTION_SEED);\n\t\tDataVector oStates[] = new DataVector[MEM_STEPS];\n\t\tDataVector mStates[] = new DataVector[MEM_STEPS];\n\t\t\t\t\n\t\tfor (int i=0; i<MEM_STEPS; i++) {\n\t\t\taction.setDeltaGain(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaVelocity(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaShift(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\td.step(action);\n\t\t\toStates[i] = d.getState();\n\t\t\tmStates[i] = d.getInternalMarkovState();\n\t\t}\n\t\t\n\t\t// 4) reset dynamics & parameters and internal markov state\n\t\td.reset();\n\t\td.setInternalMarkovState(ms);\n\t\t\n\t\t// 5) reperform test and check if values are consistent\n\t\tactionRand.setSeed(ACTION_SEED); // reproduce action sequence\n\t\tDataVector oState = null;\n\t\tDataVector mState = null;\n\t\tfor (int i=0; i<MEM_STEPS; i++) {\n\t\t\taction.setDeltaGain(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaVelocity(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\taction.setDeltaShift(2.f*(actionRand.nextFloat()-0.5f));\n\t\t\t\n\t\t\td.step(action);\n\t\t\toState = d.getState();\n\t\t\tmState = d.getInternalMarkovState();\n\t\t\t\n\t\t\t// check observable state\n\t\t\tassertEquals (oStates[i].getValue(ObservableStateDescription.SetPoint), oState.getValue(ObservableStateDescription.SetPoint), 0.0001);\n\t\t\tassertEquals (oStates[i].getValue(ObservableStateDescription.Fatigue), oState.getValue(ObservableStateDescription.Fatigue), 0.0001);\n\t\t\tassertEquals (oStates[i].getValue(ObservableStateDescription.Consumption), oState.getValue(ObservableStateDescription.Consumption), 0.0001);\n\t\t\tassertEquals (oStates[i].getValue(ObservableStateDescription.RewardTotal), oState.getValue(ObservableStateDescription.RewardTotal), 0.0001);\n\n\t\t\t// \n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.CurrentOperationalCost), mState.getValue(MarkovianStateDescription.CurrentOperationalCost), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.FatigueLatent2), mState.getValue(MarkovianStateDescription.FatigueLatent2), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.FatigueLatent1), mState.getValue(MarkovianStateDescription.FatigueLatent1), 0.0001);\n\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.EffectiveActionGainBeta), mState.getValue(MarkovianStateDescription.EffectiveActionGainBeta), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.EffectiveActionVelocityAlpha), mState.getValue(MarkovianStateDescription.EffectiveActionVelocityAlpha), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.EffectiveShift), mState.getValue(MarkovianStateDescription.EffectiveShift), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.MisCalibration), mState.getValue(MarkovianStateDescription.MisCalibration), 0.0001);\n\t\t\t\n\t\t\tassertEquals (mStates[i].getValue(SetPointGeneratorStateDescription.SetPointChangeRatePerStep), mState.getValue(SetPointGeneratorStateDescription.SetPointChangeRatePerStep), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(SetPointGeneratorStateDescription.SetPointCurrentSteps), mState.getValue(SetPointGeneratorStateDescription.SetPointCurrentSteps), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(SetPointGeneratorStateDescription.SetPointLastSequenceSteps), mState.getValue(SetPointGeneratorStateDescription.SetPointLastSequenceSteps), 0.0001);\n\t\t\t\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.RewardFatigue), mState.getValue(MarkovianStateDescription.RewardFatigue), 0.0001);\n\t\t\tassertEquals (mStates[i].getValue(MarkovianStateDescription.RewardConsumption), mState.getValue(MarkovianStateDescription.RewardConsumption), 0.0001);\n\t\t}\n\t\t\n\t\tSystem.out.println (\"last o-state 1st trajectory: \" + oStates[oStates.length-1]);\n\t\tSystem.out.println (\"last o-state 2nd trajectory: \" + oState);\n\t\t\n\t\tSystem.out.println (\"last m-state 1st trajectory: \" + mStates[oStates.length-1]);\n\t\tSystem.out.println (\"last m-state 2nd trajectory: \" + mState);\n\t}",
"@Test\n public void testDefaultResetTime ()\n {\n System.out.println (\"defaultResetTime\");\n SimEventList instance = new DefaultSimEventList (DefaultSimEvent.class);\n double expResult = Double.NEGATIVE_INFINITY;\n double result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n instance.setDefaultResetTime (5.0);\n instance.reset (-25.0);\n SimEvent e1 = new DefaultSimEvent (15.8, null, null);\n instance.add (e1);\n SimEvent e2 = new DefaultSimEvent (10.0, null, null);\n instance.add (e2);\n expResult = 5.0;\n result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n expResult = -25.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n instance.run ();\n expResult = 15.8;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n expResult = 5.0;\n result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n instance.reset ();\n expResult = 5.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n expResult = 5.0;\n result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n instance.add (e1);\n instance.run ();\n expResult = 5.0;\n result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n instance.setDefaultResetTime (-45.0);\n expResult = 15.8;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n instance.reset ();\n expResult = -45.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n expResult = -45.0;\n result = instance.getDefaultResetTime ();\n assertEquals (expResult, result, 0.0);\n instance.reset (-22.0);\n expResult = -22.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n instance.reset ();\n expResult = -45.0;\n result = instance.getTime ();\n assertEquals (expResult, result, 0.0);\n }",
"@Test\n public void testLoop() {\n // initialize template neuron\n NetworkGlobalState.templateNeuronDescriptor = new NeuronDescriptor();\n NetworkGlobalState.templateNeuronDescriptor.firingLatency = 0;\n NetworkGlobalState.templateNeuronDescriptor.firingThreshold = 0.4f;\n\n // initialize template neuroid network\n NeuroidNetworkDescriptor templateNeuroidNetwork = new NeuroidNetworkDescriptor();\n templateNeuroidNetwork.numberOfInputNeurons = 1; // we exite the hidden neurons directly\n templateNeuroidNetwork.numberOfOutputNeurons = 1; // we read out the impulse directly\n\n templateNeuroidNetwork.neuronLatencyMin = 0;\n templateNeuroidNetwork.neuronLatencyMax = 0;\n\n templateNeuroidNetwork.neuronThresholdMin = 0.4f;\n templateNeuroidNetwork.neuronThresholdMax = 0.4f;\n\n templateNeuroidNetwork.connectionDefaultWeight = 0.5f;\n\n\n\n List<Integer> neuronFamily = new ArrayList<>();\n neuronFamily.add(5);\n GenerativeNeuroidNetworkDescriptor generativeNeuroidNetworkDescriptor = GenerativeNeuroidNetworkDescriptor.createAfterFamily(neuronFamily, NetworkGlobalState.templateNeuronDescriptor);\n\n generativeNeuroidNetworkDescriptor.neuronClusters.get(0).addLoop(GenerativeNeuroidNetworkDescriptor.NeuronCluster.EnumDirection.ANTICLOCKWISE);\n\n generativeNeuroidNetworkDescriptor.inputConnections = new GenerativeNeuroidNetworkDescriptor.OutsideConnection[1];\n generativeNeuroidNetworkDescriptor.inputConnections[0] = new GenerativeNeuroidNetworkDescriptor.OutsideConnection(0, 0);\n\n generativeNeuroidNetworkDescriptor.outputConnections = new GenerativeNeuroidNetworkDescriptor.OutsideConnection[0];\n\n // generate network\n NeuroidNetworkDescriptor neuroidNetworkDescriptor = GenerativeNeuroidNetworkTransformator.generateNetwork(templateNeuroidNetwork, generativeNeuroidNetworkDescriptor);\n\n Neuroid<Float, Integer> neuroidNetwork = NeuroidCommon.createNeuroidNetworkFromDescriptor(neuroidNetworkDescriptor);\n\n // simulate and test\n\n // we stimulate the first neuron and wait till it looped around to the last neuron, then the first neuron again\n neuroidNetwork.input[0] = true;\n\n // propagate the input to the first neuron\n neuroidNetwork.timestep();\n\n neuroidNetwork.input[0] = false;\n\n neuroidNetwork.timestep();\n neuroidNetwork.timestep();\n neuroidNetwork.timestep();\n neuroidNetwork.timestep();\n neuroidNetwork.timestep();\n\n // index 1 because its anticlockwise\n Assert.assertTrue(neuroidNetwork.getActiviationOfNeurons()[1]);\n\n neuroidNetwork.timestep();\n\n Assert.assertTrue(neuroidNetwork.getActiviationOfNeurons()[0]);\n Assert.assertFalse(neuroidNetwork.getActiviationOfNeurons()[1]);\n }",
"public void runSimulation(){\n\t\tdetermineActivity();\n\t\tupdateRates();\n\t\tsimulateActivity();\n\t}",
"@Override\n public void testPeriodic()\n {\n \n }",
"public static void setupUpdateScenario05() {\n TestDataInitializer.setupInventory( ASSY_INVENTORY_1, BOM_ITEM_POSITION,\n RefInvClassKey.ASSY );\n\n // create task defns\n TestDataInitializer.setupTaskDefn( TASK_DEFN_KEY_REQ_1, 1 );\n\n // create task tasks\n TestDataInitializer.setupTaskTask( TASK_TASK_KEY_REQ_1, BOM_ITEM_POSITION, 1,\n TASK_DEFN_KEY_REQ_1, RefTaskDefinitionStatusKey.SUPRSEDE, RefTaskClassKey.REQ );\n\n TestDataInitializer.setupTaskTask( TASK_TASK_KEY_REQ_2, BOM_ITEM_POSITION, 2,\n TASK_DEFN_KEY_REQ_1, RefTaskDefinitionStatusKey.SUPRSEDE, RefTaskClassKey.REQ );\n\n TestDataInitializer.setupTaskTask( TASK_TASK_KEY_REQ_3, BOM_ITEM_POSITION, 3,\n TASK_DEFN_KEY_REQ_1, RefTaskDefinitionStatusKey.ACTV, RefTaskClassKey.REQ );\n\n // create actual reqs\n TestDataInitializer.setupActualTask( ACTUAL_TASK_KEY_REQ_1, ASSY_INVENTORY_1,\n TASK_TASK_KEY_REQ_1, ACTUAL_REQ_BARCODE_1, RefEventStatusKey.ACTV );\n\n // create MP defn\n TestDataInitializer.setupMaintPrgmDefn( MAINT_PRGM_DEFN_KEY_1, ASSEMBLY_KEY, 1 );\n\n // create MP\n TestDataInitializer.setupMaintPrgm( MAINT_PRGM_KEY, MAINT_PRGM_DEFN_KEY_1, 1,\n RefMaintPrgmStatusKey.ACTV );\n\n // create MP carrier map\n TestDataInitializer.setupMaintPrgmCarriermap(\n new MaintPrgmCarrierMapKey( MAINT_PRGM_KEY, TestDataInitializer.CARRIER_KEY_1 ),\n true, 1 );\n\n // create MP task lined to supercede task\n TestDataInitializer.setupMaintPrgmTask(\n new MaintPrgmTaskKey( MAINT_PRGM_KEY, TASK_DEFN_KEY_REQ_1 ), TASK_TASK_KEY_REQ_2 );\n TaskFleetApprovalTable.findByPrimaryKey( new TaskFleetApprovalKey( TASK_DEFN_KEY_REQ_1 ) )\n .delete();\n }",
"@Test\n public void testControllerNodeIPChanges() throws Exception {\n class DummyHAListener implements IHAListener {\n public Map<String, String> curControllerNodeIPs;\n public Map<String, String> addedControllerNodeIPs;\n public Map<String, String> removedControllerNodeIPs;\n public int nCalled;\n \n public DummyHAListener() {\n this.nCalled = 0;\n }\n \n @Override\n public void roleChanged(Role oldRole, Role newRole) {\n // ignore\n }\n \n @Override\n public synchronized void controllerNodeIPsChanged(\n Map<String, String> curControllerNodeIPs,\n Map<String, String> addedControllerNodeIPs,\n Map<String, String> removedControllerNodeIPs) {\n this.curControllerNodeIPs = curControllerNodeIPs;\n this.addedControllerNodeIPs = addedControllerNodeIPs;\n this.removedControllerNodeIPs = removedControllerNodeIPs;\n this.nCalled++;\n notifyAll();\n }\n \n public void do_assert(int nCalled,\n Map<String, String> curControllerNodeIPs,\n Map<String, String> addedControllerNodeIPs,\n Map<String, String> removedControllerNodeIPs) {\n assertEquals(\"nCalled is not as expected\", nCalled, this.nCalled);\n assertEquals(\"curControllerNodeIPs is not as expected\", \n curControllerNodeIPs, this.curControllerNodeIPs);\n assertEquals(\"addedControllerNodeIPs is not as expected\", \n addedControllerNodeIPs, this.addedControllerNodeIPs);\n assertEquals(\"removedControllerNodeIPs is not as expected\", \n removedControllerNodeIPs, this.removedControllerNodeIPs);\n \n }\n }\n long waitTimeout = 250; // ms\n DummyHAListener listener = new DummyHAListener();\n HashMap<String,String> expectedCurMap = new HashMap<String, String>();\n HashMap<String,String> expectedAddedMap = new HashMap<String, String>();\n HashMap<String,String> expectedRemovedMap = new HashMap<String, String>();\n \n controller.addHAListener(listener);\n ControllerRunThread t = new ControllerRunThread();\n t.start();\n \n synchronized(listener) {\n // Insert a first entry\n controller.storageSource.insertRow(Controller.CONTROLLER_INTERFACE_TABLE_NAME,\n getFakeControllerIPRow(\"row1\", \"c1\", \"Ethernet\", 0, \"1.1.1.1\"));\n expectedCurMap.clear();\n expectedAddedMap.clear();\n expectedRemovedMap.clear();\n expectedCurMap.put(\"c1\", \"1.1.1.1\");\n expectedAddedMap.put(\"c1\", \"1.1.1.1\");\n listener.wait(waitTimeout);\n listener.do_assert(1, expectedCurMap, expectedAddedMap, expectedRemovedMap);\n \n // Add an interface that we want to ignore. \n controller.storageSource.insertRow(Controller.CONTROLLER_INTERFACE_TABLE_NAME,\n getFakeControllerIPRow(\"row2\", \"c1\", \"Ethernet\", 1, \"1.1.1.2\"));\n listener.wait(waitTimeout); // TODO: do a different check. This call will have to wait for the timeout\n assertTrue(\"controllerNodeIPsChanged() should not have been called here\", \n listener.nCalled == 1);\n\n // Add another entry\n controller.storageSource.insertRow(Controller.CONTROLLER_INTERFACE_TABLE_NAME,\n getFakeControllerIPRow(\"row3\", \"c2\", \"Ethernet\", 0, \"2.2.2.2\"));\n expectedCurMap.clear();\n expectedAddedMap.clear();\n expectedRemovedMap.clear();\n expectedCurMap.put(\"c1\", \"1.1.1.1\");\n expectedCurMap.put(\"c2\", \"2.2.2.2\");\n expectedAddedMap.put(\"c2\", \"2.2.2.2\");\n listener.wait(waitTimeout);\n listener.do_assert(2, expectedCurMap, expectedAddedMap, expectedRemovedMap);\n\n\n // Update an entry\n controller.storageSource.updateRow(Controller.CONTROLLER_INTERFACE_TABLE_NAME,\n \"row3\", getFakeControllerIPRow(\"row3\", \"c2\", \"Ethernet\", 0, \"2.2.2.3\"));\n expectedCurMap.clear();\n expectedAddedMap.clear();\n expectedRemovedMap.clear();\n expectedCurMap.put(\"c1\", \"1.1.1.1\");\n expectedCurMap.put(\"c2\", \"2.2.2.3\");\n expectedAddedMap.put(\"c2\", \"2.2.2.3\");\n expectedRemovedMap.put(\"c2\", \"2.2.2.2\");\n listener.wait(waitTimeout);\n listener.do_assert(3, expectedCurMap, expectedAddedMap, expectedRemovedMap);\n\n // Delete an entry\n controller.storageSource.deleteRow(Controller.CONTROLLER_INTERFACE_TABLE_NAME, \n \"row3\");\n expectedCurMap.clear();\n expectedAddedMap.clear();\n expectedRemovedMap.clear();\n expectedCurMap.put(\"c1\", \"1.1.1.1\");\n expectedRemovedMap.put(\"c2\", \"2.2.2.3\");\n listener.wait(waitTimeout);\n listener.do_assert(4, expectedCurMap, expectedAddedMap, expectedRemovedMap);\n }\n }",
"@Test\n\tpublic void testCellularAutomaton() {\n\t\t//Test update() function\n\t\t//Expect result\n\t\t//result1 = new int[][] {{auto.NONE, auto.PREDATOR, auto.PREDATOR},{auto.PREDATOR, auto.PREDATOR, auto.PREDATOR},{auto.PREY, auto.PREY, auto.PREY}};\n\t\t\n\t\t//use update() function\n\t\t//auto.update(autoGrid, auto.PREY, auto.PREDATOR, auto.preyProb);\n\t\t//result2 = auto.getGrid();\n\t\t\n\t\t//Compare each elements...\n\t\t/*for (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tassertTrue(result1[i][j]==result2[i][j]);\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t\n\t\t/**\n\t\t * Test step() function\n\t\t */\n\t\t//Expect result\n\t\tresult3 = new int[][] {{auto.NONE, auto.PREDATOR, auto.PREY},{auto.PREDATOR, auto.PREDATOR, auto.PREDATOR},{auto.PREY, auto.PREY, auto.PREY}};\n\t\t\n\t\t//set grid as the preset autoGrid\n\t\tauto.setGrid(autoGrid);\n\t\tauto.step();\n\t\t\n\t\t//get the real actual result\n\t\tresult4 = auto.getGrid();\n\t\t\n\t\t//Compare each elements...\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tassertTrue(result3[i][j]==result4[i][j]);\n\t\t\t}\n\t\t}\n\t}",
"@Test\n void generateMovementTest() {\n \n int oldY = person.getMoveAmountY();\n \n person.nextFrame();\n person.nextFrame();\n\n person.generateMovement();\n \n int newY = person.getMoveAmountY();\n int timer = person.getTimer();\n \n assertFalse(oldY == newY);\n assertTrue(timer == 0);\n }",
"@Override\n public void testPeriodic() {\n\n }",
"public void advanceSimulation () {\n\t\tstep_++;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method sets the value of the database column mem.MemAddress | public void setMemaddress(String memaddress) {
this.memaddress = memaddress;
} | [
"public void set_mem_address(int mem_address) {\n this.address = mem_address;\n }",
"public void setMAddr(String mAddr) throws IllegalArgumentException, \n SipParseException {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG,\"setMaddr () \" + mAddr);\n Via via=(Via)sipHeader;\n \n if (mAddr==null) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: mAddr is null\");\n else via.setMAddr(mAddr);\n }",
"public void setAddress(String addr)\r\n {\r\n if(studentNumber != 0)\r\n {\r\n address = addr;\r\n }\r\n }",
"public void setInternalAddress(String address);",
"public void setMAddr(InetAddress mAddr) throws IllegalArgumentException,\n SipParseException {\n LogWriter.logMessage(LogWriter.TRACE_DEBUG,\n\t\t\t\"setMaddr () \" + mAddr);\n Via via=(Via)sipHeader;\n \n if (mAddr==null) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: mAddr is null\");\n else { \n // if (mAddr.isMulticastAddress() ) {\n String hostAddress=mAddr.getHostAddress();\n if ( hostAddress==null) \n throw new IllegalArgumentException\n (\"JAIN-EXCEPTION: host address is null\");\n else via.setMAddr(hostAddress); \n // } else \n // throw new SipParseException\n // (\"JAIN-EXCEPTION: mAddr is not a multicast address\");\n }\n }",
"public String getMemaddress() {\r\n\t\treturn memaddress;\r\n\t}",
"public void setAddress(String myAddress) {\n address = myAddress;\n }",
"public void setAddress(java.lang.String address)\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(ADDRESS$20, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ADDRESS$20);\n }\n target.setStringValue(address);\n }\n }",
"public void setAddress(String address) {\n this.currentCustomer.setAddress(address);\n ;\n }",
"public void setMemId(Integer memId) {\n this.memId = memId;\n }",
"public void setMemcity(String memcity) {\r\n\t\tthis.memcity = memcity;\r\n\t}",
"public void setAddress(String address) {\r\n this.address = address; // set the address\r\n }",
"public void setContactAddress(entity.Address value);",
"public void setAddress1(String address1);",
"public void setExternalAddress(String address);",
"public void setAddr(String addr) {\n\t\tthis.addr = addr;\n\t}",
"void setAddressinfo(com.hps.july.trailcom.beans.AddressInfo anAddressinfo) throws java.rmi.RemoteException;",
"public void setAddr(String addr) {\r\n this.addr = addr == null ? null : addr.trim();\r\n }",
"@Override\n\tpublic void setAddress(java.lang.String address) {\n\t\t_dmHistoryMaritime.setAddress(address);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets personal shared plans for user. | List<PersonalProgramDTO> getPersonalSharedPlansForUser(Long userId); | [
"List<PersonalProgramDTO> getPlansSharedWithUser(Long userId);",
"List<PersonalProgramDTO> getPlansForUser(Long userId);",
"public List<Plan> getPlansByUser(Integer userId) {\n return plansRepository.findPlansByUserId(userId);\n }",
"List<PersonalProgramDTO> getArchivedPlansForUser(Long userId);",
"PersonalLearningPathDTO getPersonalPlanForUser(Long userId, Long pathId);",
"public SPResponse getUserAcitonPlans(User user) {\n final SPResponse resp = new SPResponse();\n \n UserActionPlan userActionPlan = actionPlanFactory.getUserActionPlan(user);\n Set<String> userActionPlans = userActionPlan.getActionPlanProgressMap().keySet();\n \n ArrayList<ActionPlanSummaryDTO> userActionPlanSummary = new ArrayList<ActionPlanSummaryDTO>();\n for (String actionPlanId : userActionPlans) {\n ActionPlanProgress actionPlanProgress = userActionPlan.getActionPlanProgress(actionPlanId);\n ActionPlanDao actionPlan = actionPlanFactory.getActionPlan(actionPlanId);\n if (actionPlan != null) {\n userActionPlanSummary.add(new ActionPlanSummaryDTO(actionPlan, actionPlanProgress\n .getCompletedCount()));\n }\n }\n // add to the response\n return resp.add(Constants.PARAM_ACTION_PLAN_LIST, userActionPlanSummary);\n }",
"Map<String, Plan> getAllPlans();",
"Integer countPlansForUser(Long userId);",
"PagedResult<Loan> listLoanByUser(String clientCode, String userId, PageInfo pageInfo);",
"ScalingPlansClient getScalingPlans();",
"List<PersonalProgramDTO> getPlansWithDueDatePassed();",
"public PlanOfStudy getMyPlan() {\r\n return myPlan;\r\n }",
"public SPResponse getUserOrgGoals(User user, Object[] params) {\n final SPResponse resp = new SPResponse();\n \n String userEmail = (String) params[0];\n \n User userForOrgGoals = null;\n \n if (StringUtils.isEmpty(userEmail)) {\n userForOrgGoals = user;\n } else {\n userForOrgGoals = userFactory.getUserForGroupLead(userEmail, user);\n }\n \n UserActionPlan userActionPlan = actionPlanFactory.getUserActionPlan(userForOrgGoals);\n \n String actionPlanId = (String) params[1];\n if (StringUtils.isBlank(actionPlanId)) {\n actionPlanId = userActionPlan.getSelectedActionPlan();\n }\n \n if (actionPlanId != null) {\n try {\n resp.add(Constants.PARAM_ACTION_PLAN, new UserActionPlanDTO(getActionPlan(actionPlanId),\n userActionPlan));\n \n // adding flag for more than one organization plan\n resp.add(Constants.PARAM_ACTION_PLAN_HAMBURGER, userActionPlan.getActionPlanProgressMap()\n .size() > 1);\n } catch (DashboardRedirectException e) {\n log.warn(\"Selected action plan not found.\", e);\n removeActionPlan(userForOrgGoals, actionPlanId);\n }\n }\n \n// final List<UserMessage> userMessages = userForOrgGoals.getMessages();\n// if (!CollectionUtils.isEmpty(userMessages)) {\n// // adding any user messages if present for organization plan\n// resp.add(\n// Constants.PARAM_MESSAGE,\n// userMessages.stream().filter(m -> m.getFeature() == SPFeature.OrganizationPlan)\n// .collect(Collectors.toList()));\n// }\n// \n return resp.isSuccess();\n }",
"List<BillingProjectMembership> getBillingProjectMemberships();",
"public int getProjectIdFromUserPlan(Integer planId);",
"public List<DataSource.IntrospectionPlan> getPlans () {\n return plans;\n }",
"List<Loan> getLoansByUser(User user);",
"List<TerritorialCommunity> getCommunitiesToAssignByUser(User user);",
"public static List<ServicePlan> getServicePlans(){\r\n\t\t\r\n\t\tUtilityService_Service service = new UtilityService_Service();\r\n\t\tUtilityService ser = service.getUtilityServiceImplPort();\r\n\t\tList<ServicePlan> plans = new ArrayList<ServicePlan>();\r\n\t\ttry {\r\n\t\t\tplans = ser.getAllServicePlans();\r\n\t\t\tfor (ServicePlan servicePlan : plans) {\r\n\t\t\t\tSystem.out.print(\"\\rplan Id: \"+servicePlan.getPlanId());\r\n\t\t\t\tSystem.out.print(\"\\tplan Details: \"+servicePlan.getPlanDetails());\r\n\t\t\t\tSystem.out.print(\"\\tCancellation Fee: \"+servicePlan.getCancellationFee());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception_Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn plans;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the failed login attempts. | public int getFailedLoginAttempts() {
return failedLoginAttempts;
} | [
"public long getFailedLoginAttempts() {\n return FxContext.getUserTicket().getFailedLoginAttempts();\n }",
"public Integer getLoginFailTimes() {\n return loginFailTimes;\n }",
"BigInteger getLoginRetries();",
"public int getAttempts(){\n\t\treturn consecutiveLoginAttempts;\t\n\t}",
"public int getLoginAttempts() {\n return loginAttempts;\n }",
"public void setFailedLoginAttempts(int value) {\n this.failedLoginAttempts = value;\n }",
"public List<Integer> getAttempts() {\r\n\t\treturn attempts;\r\n\t}",
"public int getAttempts() {\n return attempts;\n }",
"private int getFailCount() {\n\t\t\t\t\treturn record.getIntProperty(DatabasePasswordComposite.PASSWORD_FAILS, 0);\n\t\t\t\t}",
"int getNumberOfLoginAttempts()\r\n\t{\r\n\t\treturn 0;\r\n\t}",
"public int getFailedCheckCount() {\n return iFailedCheckCount;\n }",
"public void setFailedLoginAttempts(int failedLoginAttempts) {\n this.failedLoginAttempts = failedLoginAttempts;\n }",
"public int getFailedCount() {\n return failedCount;\n }",
"public Integer getFailedCount() {\n return failedCount;\n }",
"int getFailures();",
"private static void getAndPrintFailedLogins(SessionActivityResponse result) {\n\t\tList<SessionActivityEntry> failedLogins = new ArrayList<>();\n\t\tList<SessionActivityEntry> data = result.getData();\n\t\tfor (SessionActivityEntry entry : data) {\n\t\t\tif (entry.getAttributes().getStatus().equalsIgnoreCase(FAILED)) {\n\t\t\t\tfailedLogins.add(entry);\n\t\t\t}\n\t\t}\n\t\tMap<String, Integer> failedCounts = new HashMap<>();\n\t\t//build a map to keep the counter of failed logins per user\n\t\tfor (SessionActivityEntry failedLogin : failedLogins) {\n\t\t\tString username = failedLogin.getAttributes().getUsername();\n\t\t\tif (failedCounts.containsKey(username)) {\n\t\t\t\tfailedCounts.put(username, failedCounts.get(username) + 1);\n\t\t\t} else {\n\t\t\t\tfailedCounts.put(username, 1);\n\t\t\t}\n\t\t}\n\t\t//print the results on the console\n\t\tSystem.out.println(failedLogins.size() + \" Users with failed logins: \");\n\t\tSystem.out.printf(\"%5s %25s\", \"Username\", \"Count\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"==================================\");\n\t\tfor (String userName : failedCounts.keySet()) {\n\t\t\tSystem.out.format(\"%-20s %10d\\n\", userName, failedCounts.get(userName));\n\t\t}\n\t}",
"private int getFailedAuthStepsTemplock() {\n return getClientConfigurationProperties().getProperty(\n ClientPropertySecurity.FAILED_AUTH_STEPS_TEMPLOCK,\n ClientPropertySecurity.DEFAULT_FAILED_AUTH_STEPS_TEMPLOCK);\n }",
"public void setLoginFailTimes(Integer loginFailTimes) {\n this.loginFailTimes = loginFailTimes;\n }",
"public int getAttemptCount() {\n return attempts.get();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is called to determine the sample rates supported by the signal source | public int[] requestSupportedSampleRates(); | [
"public int requestCurrentSampleRate();",
"public int getSampleRate() {\n return sampleRate_;\n }",
"long getSampleRate();",
"public Integer getSamplingRate() {\n return samplingRate;\n }",
"public Rational getAudioSampleRate();",
"public int getSamplingRate() {\n return samplingRate;\n }",
"public Float getSample_rate() {\n return sample_rate;\n }",
"public int getSamplingRate( ) {\r\n return samplingRate;\r\n }",
"public void setSamplingRate(int value) {\n this.samplingRate = value;\n }",
"public void setSamplingRate( int samplingRate ) {\r\n this.samplingRate = samplingRate;\r\n }",
"public void setSampleRate(int value) {\n this.sampleRate = value;\n }",
"public long getAudioSampleBitRate();",
"@NativeType(\"opus_uint32\")\n public int input_sample_rate() { return ninput_sample_rate(address()); }",
"public int samplingRate() {\n\t\treturn samplingRateSupplier.get().get(mpegAudioVersion()).get(samplingRateFrequencyIndex);\n\t}",
"public SampleMode getSampleMode();",
"public int getSamplingRate() {\n\n\t\treturn samplingRate;\n\n\t}",
"public void setSample_rate(Float sample_rate) {\n this.sample_rate = sample_rate;\n }",
"public void setSamplingRate(Integer samplingRate) {\n this.samplingRate = samplingRate;\n }",
"public void setSampleRate(int sampleRate) {\r\n\t\tthis.sampleRate = sampleRate;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
optional string acting_date = 21; | java.lang.String getActingDate(); | [
"public Builder setActingDate(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00100000;\n actingDate_ = value;\n onChanged();\n return this;\n }",
"java.lang.String getArrivedondate();",
"java.lang.String getFoundingDate();",
"public void setBegDate(java.lang.String value) {\n this.begDate = value;\n }",
"public void setAl_date(java.lang.String Al_date) {\r\n this.Al_date = Al_date;\r\n }",
"public void setDate (String s) {\n date = s;\n }",
"void setArrivedondate(java.lang.String arrivedondate);",
"public void setShipDate(Date shipDate) {this.shipDate = shipDate;}",
"public void setBookintDate(Date bookintDate ){\n\tthis.bookingDate = bookintDate;\n}",
"void setFoundingDate(java.lang.String foundingDate);",
"public void setOrderingDate(String arg)\n\t{\n\t\tsetValue(ORDERINGDATE, arg);\n\t}",
"public void setDateOfArrival(Date dateOfArrival);",
"Date getOrd_date();",
"public String getAcceptedDateAsString();",
"public void setDateRecruitment(Date dateRecruitment);",
"public void promptDate(String date)\n {\n this.date = date;\n }",
"java.lang.String getIssueDate();",
"public void setStratdate(Date stratdate) {\n this.stratdate = stratdate;\n }",
"public void Add_date(String d)\n {\n\n date = new String(d);\t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Y data. | public DoubleData getY() {
return y;
} | [
"public double[] getYPoints() {\n return yData;\n }",
"public double[] getYArray()\n {\n return ya;\n }",
"double[] getY();",
"public Object[] getYValues() {\n return yValues;\n }",
"public double getY() {\n return Y;\n }",
"public double getY() {\n return Y;\n }",
"public double getY() {\r\n return yValue;\r\n }",
"@Override\n public SensorData<Double> getRawYData(DataType dataType)\n {\n final String funcName = \"getRawYData\";\n double value = 0.0;\n long currTagId = FtcOpMode.getLoopCounter();\n\n if (dataType == DataType.ACCELERATION)\n {\n if (currTagId != accelTagId)\n {\n accelData = imu.getAcceleration();\n accelTagId = currTagId;\n }\n value = accelData.yAccel;\n }\n else if (dataType == DataType.VELOCITY)\n {\n if (currTagId != velTagId)\n {\n velData = imu.getVelocity();\n velTagId = currTagId;\n }\n value = velData.yVeloc;\n }\n else if (dataType == DataType.DISTANCE)\n {\n if (currTagId != posTagId)\n {\n posData = imu.getPosition();\n posTagId = currTagId;\n }\n value = posData.y;\n }\n SensorData<Double> data = new SensorData<>(TrcUtil.getCurrentTime(), value);\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API,\n \"=(timestamp:%.3f,value:%f\", data.timestamp, data.value);\n }\n\n return data;\n }",
"public double getY() {\n return mY;\n }",
"public float[] getPolyY() {\n return y.clone();\n }",
"@Override\n public SensorData<Double> getRawYData(DataType dataType)\n {\n final String funcName = \"getRawYData\";\n double value = 0.0;\n long currTagId = FtcOpMode.getLoopCounter();\n\n if (dataType == DataType.ROTATION_RATE)\n {\n if (currTagId != turnRateTagId)\n {\n turnRateData = imu.getAngularVelocity();\n turnRateTagId = currTagId;\n }\n value = turnRateData.yRotationRate;\n }\n else if (dataType == DataType.HEADING)\n {\n if (currTagId != headingTagId)\n {\n if (USE_QUATERNION)\n {\n getEulerAngles(eulerAngles);\n }\n else\n {\n headingData = imu.getAngularOrientation(\n AxesReference.INTRINSIC, AxesOrder.XYZ, AngleUnit.DEGREES);\n }\n headingTagId = currTagId;\n }\n\n if (USE_QUATERNION)\n {\n value = eulerAngles[1];\n }\n else\n {\n value = headingData.secondAngle;\n }\n }\n SensorData<Double> data = new SensorData<>(TrcUtil.getCurrentTime(), value);\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API,\n \"=(timestamp:%.3f,value:%f\", data.timestamp, data.value);\n }\n\n return data;\n }",
"public double[] getyStats() {\n\t\treturn yStats;\n\t}",
"public double getY() {\n return (this.y);\n }",
"public double getDoubleY() {\n return y;\n }",
"public Integer getdYPoint() {\n return dYPoint;\n }",
"public Double getYValue() {\n\treturn yValue;\n }",
"public double getY()\n\t{\t\n\t\treturn y;\t\t\t\t\t\t\t\t\t\t\t\t// Return point's y-coordinate\n\t}",
"public Double getyValue()\n {\n return yValue;\n }",
"public String gety()\n\t{\n\t\treturn y.getText();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column t_test_param_value.PUB2 | public String getPub2() {
return pub2;
} | [
"public java.lang.String getParam2() {\r\n return param2;\r\n }",
"public java.lang.String getValue2() {\n return this.value2;\n }",
"public String getCol2value() {\n return col2value;\n }",
"java.lang.String getParam2();",
"public java.lang.String getValor2() {\n\t\treturn _configuracionPerfilador.getValor2();\n\t}",
"String getValParam();",
"public String getTest2() {\r\n return test2;\r\n }",
"public String getColumn2() {\n return column2;\n }",
"public String getCol2() {\r\n return col2;\r\n }",
"public String getWebParam2();",
"public String getParamValue() {\n return paramValue;\n }",
"int getParam2();",
"public void setParam2(java.lang.String param2) {\r\n this.param2 = param2;\r\n }",
"public java.lang.String getParam1() {\r\n return param1;\r\n }",
"public String getPsdate2() {\n return psdate2;\n }",
"public String getParameter3() {\n return parameter3;\n }",
"public TestParamValue(Integer testProcedureId, Integer paramId, String testValue, String testValueDesc, String pub0, String pub1, String pub2, String pub3, String pub4, String pub5) {\n super(testProcedureId, paramId);\n this.testValue = testValue;\n this.testValueDesc = testValueDesc;\n this.pub0 = pub0;\n this.pub1 = pub1;\n this.pub2 = pub2;\n this.pub3 = pub3;\n this.pub4 = pub4;\n this.pub5 = pub5;\n }",
"public final String getRefPKVal() {\n\t\tString str = this.getRequest().getParameter(\"RefPKVal\");\n\t\tif (str == null) {\n\t\t\treturn \"1\";\n\t\t}\n\t\treturn str;\n\t}",
"public byte getP2() {\n return this.apdu_buffer[P2];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the object with the settings used for calls to updateAssignment. | public UnaryCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentSettings() {
return ((ReservationServiceStubSettings) getStubSettings()).updateAssignmentSettings();
} | [
"public UnaryCallSettings.Builder<UpdateAssignmentRequest, Assignment>\n updateAssignmentSettings() {\n return getStubSettingsBuilder().updateAssignmentSettings();\n }",
"public Assignment getAssignment() {\r\n\r\n //Grab the assignment associated with this analysis in the API\r\n if (assignment == null) {\r\n assignment = CoMoToAPI.getAssignment(connection, id);\r\n }\r\n return assignment;\r\n }",
"public UnaryCallSettings<CreateAssignmentRequest, Assignment> createAssignmentSettings() {\n return ((ReservationServiceStubSettings) getStubSettings()).createAssignmentSettings();\n }",
"public UnaryCallSettings.Builder<CreateAssignmentRequest, Assignment>\n createAssignmentSettings() {\n return getStubSettingsBuilder().createAssignmentSettings();\n }",
"public BC_SETTINGS get_settings() { return settings; }",
"public SettingsUpdater newSettingsUpdater() {\n\t\tif (prototype == null) {\n\t\t\tprototype = new SettingsUpdater();\n\t\t}\n\t\tprototype.setEuclidianHost(app);\n\t\tprototype.setSettings(app.getSettings());\n\t\tprototype.setAppConfig(app.getConfig());\n\t\tprototype.setKernel(app.getKernel());\n\t\tprototype.setFontSettingsUpdater(getFontSettingsUpdater());\n\t\treturn prototype;\n\t}",
"public PagedCallSettings.Builder<\n ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse>\n listAssignmentsSettings() {\n return getStubSettingsBuilder().listAssignmentsSettings();\n }",
"public UnaryCallSettings<MoveAssignmentRequest, Assignment> moveAssignmentSettings() {\n return ((ReservationServiceStubSettings) getStubSettings()).moveAssignmentSettings();\n }",
"public ApprovalSettings setting() {\n return this.setting;\n }",
"public Settings getSettings()\r\n\t{\r\n\t\treturn settings;\r\n\t}",
"public UnaryCallSettings.Builder<MoveAssignmentRequest, Assignment> moveAssignmentSettings() {\n return getStubSettingsBuilder().moveAssignmentSettings();\n }",
"public PagedCallSettings<\n ListAssignmentsRequest, ListAssignmentsResponse, ListAssignmentsPagedResponse>\n listAssignmentsSettings() {\n return ((ReservationServiceStubSettings) getStubSettings()).listAssignmentsSettings();\n }",
"@Deprecated\n public PagedCallSettings<\n SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse>\n searchAssignmentsSettings() {\n return ((ReservationServiceStubSettings) getStubSettings()).searchAssignmentsSettings();\n }",
"public static Settings getSettings() {\n if(settings == null) {\n settings = new Settings();\n }\n return settings;\n }",
"public KSMemberBaseAssignment assignment() {\n return assignment;\n }",
"@Deprecated\n public PagedCallSettings.Builder<\n SearchAssignmentsRequest, SearchAssignmentsResponse, SearchAssignmentsPagedResponse>\n searchAssignmentsSettings() {\n return getStubSettingsBuilder().searchAssignmentsSettings();\n }",
"public PagedCallSettings.Builder<\n SearchAllAssignmentsRequest,\n SearchAllAssignmentsResponse,\n SearchAllAssignmentsPagedResponse>\n searchAllAssignmentsSettings() {\n return getStubSettingsBuilder().searchAllAssignmentsSettings();\n }",
"public ISettings getSettings() {\r\n\t\tif (this.settings == null) {\r\n\t\t\tthis.settings = this.getApplicationContext().getBean(\r\n\t\t\t\t\tISettings.class);\r\n\t\t}\r\n\t\treturn settings;\r\n\t}",
"@ModelAttribute(\"settings\")\n public SSAMSettings settings()\n {\n return settings;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load all extensions with java spi | public void loadAllExtensions() {
if (!isLoaded) {
synchronized (loadLock) {
if (!isLoaded) {
loadNamingService();
loadLoadBalance();
isLoaded = true;
}
}
}
} | [
"public void initialize(){\n Reflections reflections = ReflectionUtils.get();\n extensionPoints = reflections.getTypesAnnotatedWith(ExtensionPoint.class, true);\n log.info(\"Bootstrap registry : found \" + extensionPoints.size() + \" extension points\");\n Set<Class<?>> extensions = reflections.getTypesAnnotatedWith(Extension.class, true);\n log.info(\"Bootstrap registry : found \" + extensions.size() + \" extensions\");\n this.extensions = ArrayListMultimap.create();\n // map extensions to extension points\n for (Class<?> extension : extensions) {\n boolean matched = false;\n for (Class<?> extensionPoint : extensionPoints) {\n if(extensionPoint.isAssignableFrom(extension)){\n this.extensions.put(extensionPoint, extension);\n matched = true;\n }\n }\n if(!matched){\n log.warn(\"No extension point found for \" + extension.getName());\n }\n }\n log.info(\"Bootstrap registry : \" + this.extensions.size() + \" extensions registered\");\n }",
"private synchronized void loadProvider() {\n\t\tif (provider != null) {\n\t\t\t// Prevents loading by two thread in parallel\n\t\t\treturn;\n\t\t}\n\t\tfinal IExtensionRegistry xRegistry = Platform.getExtensionRegistry();\n\t\tfinal IExtensionPoint xPoint = xRegistry\n\t\t\t\t.getExtensionPoint(PROVIDERS_ID);\n\t\tfor (IConfigurationElement element : xPoint.getConfigurationElements()) {\n\t\t\ttry {\n\t\t\t\tfinal String id = element.getAttribute(\"id\");\n\t\t\t\tif (provider != null) {\n\t\t\t\t\tlog(null, \"Only one extension provider allowed. Provider\"\n\t\t\t\t\t\t\t+ id + \" ignored\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tprovider = (IFormulaExtensionProvider) element\n\t\t\t\t\t\t\t.createExecutableExtension(\"class\");\n\t\t\t\t}\n\t\t\t\tif (DEBUG)\n\t\t\t\t\tSystem.out.println(\"Registered provider extension \" + id);\n\t\t\t} catch (CoreException e) {\n\t\t\t\tlog(e, \"while loading extension provider\");\n\t\t\t}\n\t\t}\n\t}",
"public void registerCoreExtensions() {\n if (extensionsRegistered) {\n throw H2O.fail(\"Extensions already registered\");\n }\n\n long before = System.currentTimeMillis();\n ServiceLoader<AbstractH2OExtension> extensionsLoader = ServiceLoader.load(AbstractH2OExtension.class);\n for (AbstractH2OExtension ext : extensionsLoader) {\n if (isEnabled(ext)) {\n ext.init();\n coreExtensions.put(ext.getExtensionName(), ext);\n }\n }\n extensionsRegistered = true;\n registerCoreExtensionsMillis = System.currentTimeMillis() - before;\n }",
"protected void loadExtensions()\n {\n // Load local extension from repository\n\n if (this.rootFolder.exists()) {\n FilenameFilter descriptorFilter = new FilenameFilter()\n {\n public boolean accept(File dir, String name)\n {\n return name.endsWith(\".xed\");\n }\n };\n\n for (File child : this.rootFolder.listFiles(descriptorFilter)) {\n if (!child.isDirectory()) {\n try {\n LocalExtension localExtension = loadDescriptor(child);\n\n repository.addLocalExtension(localExtension);\n } catch (Exception e) {\n LOGGER.warn(\"Failed to load extension from file [\" + child + \"] in local repository\", e);\n }\n }\n }\n } else {\n this.rootFolder.mkdirs();\n }\n }",
"public void loadPluginsStartup();",
"private static void loadExtensions( final File file,\n final ArrayList extensions )\n throws TaskException\n {\n try\n {\n final JarFile jarFile = new JarFile( file );\n final Extension[] extension =\n Extension.getAvailable( jarFile.getManifest() );\n for( int i = 0; i < extension.length; i++ )\n {\n extensions.add( extension[ i ] );\n }\n }\n catch( final Exception e )\n {\n throw new TaskException( e.getMessage(), e );\n }\n }",
"public void loadPlugins() {\n\n ServiceLoader<Pump> serviceLoader = ServiceLoader.load(Pump.class);\n for (Pump pump : serviceLoader) {\n availablePumps.put(pump.getPumpName(), pump);\n }\n\n Pump dummy = new DummyControl();\n availablePumps.put(dummy.getName(), dummy);\n\n Pump lego = new LegoControl();\n availablePumps.put(lego.getName(), lego);\n }",
"private void loadExtensionResources() {\n\n for (String extensionType : ExtensionMgtUtils.getExtensionTypes()) {\n Path path = ExtensionMgtUtils.getExtensionPath(extensionType);\n if (log.isDebugEnabled()) {\n log.debug(\"Loading default templates from: \" + path);\n }\n\n // Check whether the given extension type directory exists.\n if (!Files.exists(path) || !Files.isDirectory(path)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Default templates directory does not exist: \" + path);\n }\n continue;\n }\n\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtensionType(extensionType);\n\n // Load extensions from the given extension type directory.\n try (Stream<Path> directories = Files.list(path).filter(Files::isDirectory)) {\n directories.forEach(extensionDirectory -> {\n try {\n // Load extension info.\n ExtensionInfo extensionInfo = loadExtensionInfo(extensionDirectory);\n if (extensionInfo == null) {\n throw new ExtensionManagementException(\"Error while loading extension info from: \"\n + extensionDirectory);\n }\n extensionInfo.setType(extensionType);\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addExtension(extensionType,\n extensionInfo.getId(), extensionInfo);\n // Load templates.\n JSONObject template = loadTemplate(extensionDirectory);\n if (template != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addTemplate(extensionType,\n extensionInfo.getId(), template);\n }\n // Load metadata.\n JSONObject metadata = loadMetadata(extensionDirectory);\n if (metadata != null) {\n ExtensionManagerDataHolder.getInstance().getExtensionStore().addMetadata(extensionType,\n extensionInfo.getId(), metadata);\n }\n } catch (ExtensionManagementException e) {\n log.error(\"Error while loading resource files in: \" + extensionDirectory, e);\n }\n });\n } catch (IOException e) {\n log.error(\"Error while loading resource files in: \" + path, e);\n }\n }\n }",
"@SuppressWarnings(\"unused\")\n public void loadServices() {\n if (Objects.nonNull(this.localServiceDirectory)) {\n registerServicesFromDirectories(this.localServiceDirectory, true);\n }\n\n if (Objects.nonNull(this.remoteServiceDirectories)) {\n for (File directory : this.remoteServiceDirectories) {\n registerServicesFromDirectories(directory, false);\n }\n }\n }",
"private void createExtensions() {\n\t\tList<AgentExtensionConfig> extensions = this.config.getExtensions();\n\t\tif (extensions != null && extensions.size()>0) {\n\t\t\t//System.out.println(\"[CubeAgent] creating cube agent extensions... \" + extensions.size() + \" EXTENSION(S).\");\n\t\t\tfor (AgentExtensionConfig extension : extensions) {\n\t\t\t\tString id = extension.getId();\n\t\t\t\tString version = extension.getVersion();\n\t\t\t\tIExtensionFactory factory = getCubePlatform().getExtensionFactory(id, version);\n\t\t\t\tif (factory != null) {\t\t\t\t\t\n\t\t\t\t\tIExtension extensionInstance = factory.newExtension(this, extension);\n\t\t\t\t\tthis.extensions.add(extensionInstance);\n\t\t\t\t\textensionInstance.start();\n\t\t\t\t} else {\n\t\t\t\t\tlog.error(\"NO FACTORY FOUND FOR THE EXTENSION: \" + id+\":\"+version);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlog.warning(\"No defined Extensions for this Cube Agent!\");\t\t\t\n\t\t}\n\t}",
"private void loadPlugins() {\n String check = File.separator + \"plugins\" + File.separator;\n Object[] params = new Object[] {null, null, -1, -1, -1};\n PluginClassLoader cl = new PluginClassLoader(DataCrow.pluginsDir);\n \n Directory dir = new Directory(DataCrow.pluginsDir, true, new String[] {\"class\"});\n for (String filename : dir.read()) {\n try {\n String classname = filename.substring(filename.indexOf(check) + 1, filename.lastIndexOf('.'));\n classname = pattern.matcher(classname).replaceAll(\".\");\n Class<?> clazz = cl.loadClass(classname);\n Plugin plugin = (Plugin) clazz.getConstructors()[0].newInstance(params);\n registered.add(new RegisteredPlugin(clazz, plugin));\n } catch (Exception e) {\n logger.error(e, e);\n }\n }\n }",
"public static void load() {\n for (DataSourceSwapper each : ServiceLoader.load(DataSourceSwapper.class)) {\n loadOneSwapper(each);\n }\n }",
"public synchronized static <T> Collection<T> getFromExtensions(ExtensionsConfig config, Class<T> clazz) {\n final Set<T> retVal = Sets.newHashSet();\n final Set<String> loadedExtensionNames = Sets.newHashSet();\n\n if (config.searchCurrentClassloader()) {\n for (T module : ServiceLoader.load(clazz, Thread.currentThread().getContextClassLoader())) {\n final String moduleName = module.getClass().getCanonicalName();\n if (moduleName == null) {\n log.warn(\n \"Extension module [%s] was ignored because it doesn't have a canonical name, is it a local or anonymous class?\",\n module.getClass().getName()\n );\n } else if (!loadedExtensionNames.contains(moduleName)) {\n log.info(\"Adding classpath extension module [%s] for class [%s]\", moduleName, clazz.getName());\n loadedExtensionNames.add(moduleName);\n retVal.add(module);\n }\n }\n }\n\n for (File extension : getExtensionFilesToLoad(config)) {\n log.info(\"Loading extension [%s] for class [%s]\", extension.getName(), clazz.getName());\n try {\n final URLClassLoader loader = getClassLoaderForExtension(extension);\n for (T module : ServiceLoader.load(clazz, loader)) {\n final String moduleName = module.getClass().getCanonicalName();\n if (moduleName == null) {\n log.warn(\n \"Extension module [%s] was ignored because it doesn't have a canonical name, is it a local or anonymous class?\",\n module.getClass().getName()\n );\n } else if (!loadedExtensionNames.contains(moduleName)) {\n log.info(\"Adding local file system extension module [%s] for class [%s]\", moduleName, clazz.getName());\n loadedExtensionNames.add(moduleName);\n retVal.add(module);\n }\n }\n } catch (Exception e) {\n throw Throwables.propagate(e);\n }\n }\n\n return retVal;\n }",
"private void configureExtensions() {\n\t\ttry {\n\t\t\tClass<?> originClass = Class.forName( \"com.codiform.moo.property.source.MvelSourcePropertyFactory\" );\n\t\t\tsourcePropertyFactories.add( (SourcePropertyFactory)originClass.newInstance() );\n\t\t} catch ( ClassNotFoundException e ) {\n\t\t\t// No MVEL Extension. That's ok. In fact, to be expected.\n\t\t} catch ( InstantiationException exception ) {\n\t\t\tlog.warn( \"Instantiation exception while configuring extensions.\", exception );\n\t\t} catch ( IllegalAccessException exception ) {\n\t\t\tlog.warn( \"Instantiation exception while configuring extensions.\", exception );\n\t\t}\n\t}",
"void bootPlugins() {\n\t\tList<List<String>>vals = (List<List<String>>)properties.get(\"PlugInConnectors\");\n\t\tif (vals != null && vals.size() > 0) {\n\t\t\tString name, path;\n\t\t\tIPluginConnector pc;\n\t\t\tList<String>cntr;\n\t\t\tIterator<List<String>>itr = vals.iterator();\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tcntr = itr.next();\n\t\t\t\tname = cntr.get(0);\n\t\t\t\tpath = cntr.get(1);\n\t\t\t\ttry {\n\t\t\t\t\tpc = (IPluginConnector)Class.forName(path).newInstance();\n\t\t\t\t\tpc.init(this, name);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogError(e.getMessage(), e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void loadRegistredCommands() {\n ServiceLoader<Command> loader = ServiceLoader.load(Command.class);\n for (Command command : loader) {\n addCommand(command);\n }\n }",
"private static void loadSystemModules() {\n register(new PictureModule());\n register(new LoanModule());\n register(new LoanExportModule());\n register(new UserModule());\n register(new PermissionModule());\n register(new TabModule());\n register(new DcTagModule());\n }",
"public void scanAndRegister(ClassLoader loader) throws FileSystemException {\r\n\r\n scanAndRegisterAttMaps(loader);\r\n\r\n List<Class> classes = VirtualFileSystem.listTypesFromClassPath(Constants.SERVICES_PATH, loader);\r\n\r\n scanAndRegister(classes);\r\n }",
"public static void load() {\n\n ISdk[] sdks = PropertiesManager.loadSDKs();\n for (int i = 0; i < sdks.length; i++) {\n addSDK(sdks[i]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overrides the isKing() method to return false always since this is not a king piece | @Override
public boolean isKing() {
return false;
} | [
"@Override\r\n public boolean isKing()\r\n {\r\n return true;\r\n }",
"@Override\r\n public boolean isKing() {\r\n return true;\r\n }",
"public final boolean isKing() {\n return (this == WHITE_KING) || (this == BLACK_KING);\n }",
"public boolean isKing() {\n return isKing;\n }",
"private boolean isKingSafe(String player) {\n // get the position of the king\n int boardTag_K = 0, pos_K = 0, boardTag_k = 0, pos_k = 0;\n for(int i = 0; i < 64; i++){\n if(board.getBoardA()[i / 8][i % 8] == 'K'){\n boardTag_K = 1;\n pos_K = i;\n }\n if(board.getBoardB()[i / 8][i % 8] == 'K'){\n boardTag_K = 2;\n pos_K = i;\n }\n if(board.getBoardA()[i / 8][i % 8] == 'k'){\n boardTag_k = 1;\n pos_k = i;\n }\n if(board.getBoardB()[i / 8][i % 8] == 'k'){\n boardTag_k = 2;\n pos_k = i;\n }\n }\n int r_K = pos_K / 8;\n int c_K = pos_K % 8;\n int r_k = pos_k / 8;\n int c_k = pos_k % 8;\n\n // check if king is under attack by an enemy pawn\n if(player.equals(\"white\")){\n try {\n if (board.getFromBoard(boardTag_K, r_K - 1, c_K - 1) == 'p' ||\n board.getFromBoard(boardTag_K, r_K - 1, c_K + 1) == 'p') {\n return false;\n }\n }\n catch (Exception e){}\n }\n else{\n try {\n if (board.getFromBoard(boardTag_k, r_k + 1, c_k - 1) == 'P' ||\n board.getFromBoard(boardTag_k, r_k + 1, c_k + 1) == 'P') {\n return false;\n }\n }\n catch (Exception e){}\n }\n\n // check knight\n List<List<Integer>> candidates = new ArrayList<List<Integer>>();\n if(player.equals(\"white\")) {\n candidates.add(Arrays.asList(r_K + 1, c_K + 2));\n candidates.add(Arrays.asList(r_K + 2, c_K + 1));\n candidates.add(Arrays.asList(r_K + 2, c_K - 1));\n candidates.add(Arrays.asList(r_K + 1, c_K - 2));\n candidates.add(Arrays.asList(r_K - 1, c_K - 2));\n candidates.add(Arrays.asList(r_K - 2, c_K - 1));\n candidates.add(Arrays.asList(r_K - 2, c_K + 1));\n candidates.add(Arrays.asList(r_K - 1, c_K + 2));\n for (List<Integer> list : candidates) {\n try {\n if (board.getFromBoard(boardTag_K, list.get(0), list.get(1)) == 'n') return false;\n }\n catch (Exception e) {}\n }\n }\n else{\n candidates.add(Arrays.asList(r_k + 1, c_k + 2));\n candidates.add(Arrays.asList(r_k + 2, c_k + 1));\n candidates.add(Arrays.asList(r_k + 2, c_k - 1));\n candidates.add(Arrays.asList(r_k + 1, c_k - 2));\n candidates.add(Arrays.asList(r_k - 1, c_k - 2));\n candidates.add(Arrays.asList(r_k - 2, c_k - 1));\n candidates.add(Arrays.asList(r_k - 2, c_k + 1));\n candidates.add(Arrays.asList(r_k - 1, c_k + 2));\n for (List<Integer> list : candidates) {\n try {\n if (board.getFromBoard(boardTag_k, list.get(0), list.get(1)) == 'N') return false;\n }\n catch (Exception e) {}\n }\n }\n\n // check bishop or queen\n if(player.equals(\"white\")) {\n // use i and j to indicate the direction of the move, for example (1, 1) refers to moving southeast\n for (int i = -1; i <= 1; i += 2) {\n for (int j = -1; j <= 1; j += 2) {\n // steps indicates how far the move is from the original position\n int steps = 1;\n try {\n // keep trying while the path is empty, else check if the piece on the path is an enemy piece\n while (board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == ' ') {\n steps++;\n }\n if (board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == 'b' ||\n board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == 'q') {\n return false;\n }\n }\n catch (Exception e) {}\n }\n }\n }\n else{\n // use i and j to indicate the direction of the move, for example (1, 1) refers to moving southeast\n for (int i = -1; i <= 1; i += 2) {\n for (int j = -1; j <= 1; j += 2) {\n // steps indicates how far the move is from the original position\n int steps = 1;\n try {\n // keep trying while the path is empty, else check if the piece on the path is an enemy piece\n while (board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == ' ') {\n steps++;\n }\n if (board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == 'B' ||\n board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == 'Q') {\n return false;\n }\n }\n catch (Exception e) {}\n }\n }\n }\n\n // check rook or queen\n if(player.equals(\"white\")){\n for(int i = -1; i <= 1; i++){\n for(int j = -1; j <= 1; j++){\n if((i == 0 && j != 0) || (i != 0 && j == 0)){\n // steps indicates how far the move is from the original position\n int steps = 1;\n try{\n // keep trying while the path is empty, else check if the piece on the path is an enemy\n // piece\n while(board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == ' '){\n steps++;\n }\n if(board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == 'r' ||\n board.getFromBoard(boardTag_K, r_K + i * steps, c_K + j * steps) == 'q'){\n return false;\n }\n }\n catch (Exception e){}\n }\n }\n }\n }\n else{\n for(int i = -1; i <= 1; i++){\n for(int j = -1; j <= 1; j++){\n if((i == 0 && j != 0) || (i != 0 && j == 0)){\n // steps indicates how far the move is from the original position\n int steps = 1;\n try{\n // keep trying while the path is empty, else check if the piece on the path is an enemy\n // piece\n while(board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == ' '){\n steps++;\n }\n if(board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == 'R' ||\n board.getFromBoard(boardTag_k, r_k + i * steps, c_k + j * steps) == 'Q'){\n return false;\n }\n }\n catch (Exception e){}\n }\n }\n }\n }\n\n // check king\n if(player.equals(\"white\")){\n for(int i = 0; i < 9; i++) {\n if (i != 4) {\n int r1 = r_K - 1 + i / 3;\n int c1 = c_K - 1 + i % 3;\n // check if the position is within the board\n if (r1 >= 0 && r1 < 8 && c1 >= 0 && c1 < 8) {\n if (board.getFromBoard(boardTag_K, r1, c1) == 'k') {\n return false;\n }\n }\n }\n }\n }\n else{\n for(int i = 0; i < 9; i++) {\n if (i != 4) {\n int r1 = r_k - 1 + i / 3;\n int c1 = c_k - 1 + i % 3;\n // check if the position is within the board\n if (r1 >= 0 && r1 < 8 && c1 >= 0 && c1 < 8) {\n if (board.getFromBoard(boardTag_k, r1, c1) == 'K') {\n return false;\n }\n }\n }\n }\n }\n return true;\n }",
"public boolean checkWhiteKing(){\n \tSystem.out.println(\"Checking White King\");\r\n \treturn pieces[this.getWhiteX()][this.getWhiteY()].inCheck();\r\n }",
"public boolean isKing(){return this.king;}",
"public boolean checkKing(){\n \tSystem.out.println(\"Checking Kings\");\r\n \treturn(this.checkBlackKing() || this.checkWhiteKing());\r\n }",
"public void setKing() {\n this.isKing = true;\n\n this.setupPiece();\n }",
"public boolean checkBlackKing(){\n \tSystem.out.println(\"Checking Black King\");\r\n \treturn(pieces[this.getBlackX()][this.getBlackY()].inCheck());\r\n }",
"public boolean isKing(Coordinate coord)\n\t{\t\n\t\treturn getIndex(coord) == 0;\n\t}",
"private boolean isKingInDanger(int newPieceX, int newPieceY) {\n\t\tint oldPieceX = this.xLocation;\n\t\tint oldPieceY = this.yLocation;\n\t\tKing kingToCheck;\n\t\tSquare squareToCheck = currentBoard.squaresList[newPieceX][newPieceY];\n\t\tif (squareToCheck.isOccupied) {\n\t\t\tPiece pieceToCheck = squareToCheck.occupyingPiece;\n\t\t\tif (isEnemyPieceAtDestination(newPieceX, newPieceY)) {\n\t\t\t\tPiece enemyPiece = pieceToCheck;\n\t\t\t\tif (this.color.equals(Color.white)) {\n\t\t\t\t\tif (currentBoard.whiteKingTracker == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tkingToCheck = currentBoard.whiteKingTracker;\n\t\t\t\t} else {\n\t\t\t\t\tif (currentBoard.blackKingTracker == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tkingToCheck = currentBoard.blackKingTracker;\n\t\t\t\t}\n\t\t\t\tmovePiece(this, newPieceX, newPieceY);\n\t\t\t\tif (isKingInCheck(kingToCheck)) {\n\t\t\t\t\tmovePiece(this, oldPieceX, oldPieceY);\n\t\t\t\t\tmovePiece(enemyPiece, newPieceX, newPieceY);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tmovePiece(this, oldPieceX, oldPieceY);\n\t\t\t\tmovePiece(enemyPiece, newPieceX, newPieceY);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.color.equals(Color.white)) {\n\t\t\t\tif (currentBoard.whiteKingTracker == null)\n\t\t\t\t\treturn false;\n\t\t\t\tkingToCheck = currentBoard.whiteKingTracker;\n\t\t\t} else {\n\t\t\t\tif (currentBoard.blackKingTracker == null)\n\t\t\t\t\treturn false;\n\t\t\t\tkingToCheck = currentBoard.blackKingTracker;\n\t\t\t}\n\t\t\tmovePiece(this, newPieceX, newPieceY);\n\t\t\tif (isKingInCheck(kingToCheck)) {\n\t\t\t\tmovePiece(this, oldPieceX, oldPieceY);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tmovePiece(this, oldPieceX, oldPieceY);\n\t\t}\n\t\treturn false;\n\t}",
"private void checkKingWin() {\r\n if (bPiece[3][4] == Piece.BLACK\r\n && bPiece[5][4] == Piece.BLACK\r\n && bPiece[4][3] == Piece.BLACK\r\n && bPiece[4][5] == Piece.BLACK) {\r\n bPiece[4][4] = Piece.EMPTY;\r\n _winner = BLACK;\r\n }\r\n }",
"public Boolean getKing() {\n return king;\n }",
"private boolean isKingMove(int from, int to) {\r\n\t\tint fromRow = from / BOARD_SIZE;\r\n\t\tint toRow = to / BOARD_SIZE;\r\n\t\tint rowDiff = toRow - fromRow;\r\n\t\tint fromCol = from % BOARD_SIZE;\r\n\t\tint toCol = to % BOARD_SIZE;\r\n\t\tint colDiff = toCol - fromCol;\r\n\t\tint castles = isCastlingMove(hasMove, from, to);\r\n\t\t\r\n\t\t// Validate non-castling moves\r\n\t\tif (castles == 0) {\r\n\t\t\tif (-1 <= rowDiff && rowDiff <= 1 && -1 <= colDiff && colDiff <= 1) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Validate castling moves\r\n\t\telse {\r\n\t\t\t// Not allowed if K has moved\r\n\t\t\tif (kingHasMoved[hasMove]) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Not allowed if K currently in check\r\n\t\t\tif (isInCheck(pos, hasMove)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tint i;\r\n\t\t\t// Validate king's side castling\r\n\t\t\tif (castles == 1) {\r\n\t\t\t\t// No blocking pieces\r\n\t\t\t\tfor (i = 1; i <= 2; ++i) {\r\n\t\t\t\t\tif (pos[from + i] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\t// King rook hasn't moved\r\n\t\t\t\tif (kingRookHasMoved[hasMove]) return false;\r\n\t\t\t\t// King wouldn't be in check on square crossed\r\n\t\t\t\tif (isInCheckAfterMove(hasMove, from, from + 1, hasMove * PIECES + KING)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t// Validate queen's side castling\r\n\t\t\tif (castles == -1) {\r\n\t\t\t\t// No blocking pieces\r\n\t\t\t\tfor (i = 1; i <= 3; ++i) {\r\n\t\t\t\t\tif (pos[from - i] != NONE) return false;\r\n\t\t\t\t}\r\n\t\t\t\t// Queen rook hasn't moved\r\n\t\t\t\tif (queenRookHasMoved[hasMove]) return false;\r\n\t\t\t\t// King wouldn't be in check on square crossed\r\n\t\t\t\tif (isInCheckAfterMove(hasMove, from, from - 1, hasMove * PIECES + KING)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public Piece makeKing() {\n Piece p = new Piece(this.color);\n p.isKing = true;\n return p;\n }",
"private King establishKing() {\n\t\tfor(final Piece piece : getActivePieces()) {\n\t\t\tif(piece.getPieceType().isKing()){\n\t\t\t\treturn (King) piece;\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"Why are you here?! This is not a valid board!!\");\n\t}",
"public boolean KingIsChecked(int s) {\n\t\t \n\t\tBoard bc = this.getCopy();\n\t\tPosition TroubledKingPos = new Position(-1,-1);\n\t\tfor(int y=0; y < 8; y++) {\n\t\t\tfor(int x=0; x < 8; x++) {\n\t\t\t\tif(bc.layout[y][x] instanceof King) {\n\t\t\t\t\tif(bc.layout[y][x].side == s) {\n\t\t\t\t\t\tTroubledKingPos = bc.layout[y][x].pos;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int y=0; y < 8; y++) {\n\t\t\tfor(int x=0; x < 8; x++) {\n\t\t\t\tif(bc.layout[y][x] != null) {\n\t\t\t\t\tif(bc.layout[y][x].side != s) {\n\t\t\t\t\t\ttry { \n\t\t\t\t\t\t\tbc.layout[y][x].moveTo(TroubledKingPos, null);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} catch(Exception e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"@Test\n public void checkWhiteKingPosition() {\n game = new Chess();\n boolean isKing = game.getPieceAt(7, 4) instanceof King;\n boolean isKingWhite = game.getPieceAt(7, 4)\n .getColor() == PColor.White;\n assertTrue(isKing && isKingWhite);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
comparator, nulls lower (lastHandledUtcTs) // | public JwComparator<AcItemMovementVo> getLastHandledUtcTsComparatorNullsLower()
{
return LastHandledUtcTsComparatorNullsLower;
} | [
"public JwComparator<AcItemMovementVo> getFirstHandledUtcTsComparatorNullsLower()\n {\n return FirstHandledUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getLastResultUtcTsComparatorNullsLower()\n {\n return LastResultUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcActionAutoCorrectedLog> getActualEffectiveUtcTsComparatorNullsLower()\n {\n return ActualEffectiveUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getFirstResultUtcTsComparatorNullsLower()\n {\n return FirstResultUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcActionAutoCorrectedLog> getScannedEffectiveUtcTsComparatorNullsLower()\n {\n return ScannedEffectiveUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcActionAutoCorrectedLog> getCorrectedUtcTsComparatorNullsLower()\n {\n return CorrectedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getLastActionUtcTsComparatorNullsLower()\n {\n return LastActionUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getCreatedUtcTsComparatorNullsLower()\n {\n return CreatedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getLastNoteResultUtcTsComparatorNullsLower()\n {\n return LastNoteResultUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcFossWebServiceMessage> getCreatedUtcTsComparatorNullsLower()\n {\n return CreatedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getConsignedUtcTsComparatorNullsLower()\n {\n return ConsignedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcCandidateRouteAnalysisRequest> getCreatedUtcTsComparatorNullsLower()\n {\n return CreatedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getAcceptCustodyUtcTsComparatorNullsLower()\n {\n return AcceptCustodyUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcUspsDomesticSupply> getCreatedUtcTsComparatorNullsLower()\n {\n return CreatedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcCandidateRouteAnalysisRequest> getAnalysisEndUtcTsComparatorNullsLower()\n {\n return AnalysisEndUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getRelinquishCustodyUtcTsComparatorNullsLower()\n {\n return RelinquishCustodyUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcMobileDeviceTransmitSummaryVo> getMobileSessionCreatedUtcTsComparatorNullsLower()\n {\n return MobileSessionCreatedUtcTsComparatorNullsLower;\n }",
"public JwComparator<AcItem> getTagUtcDtComparatorNullsLower()\n {\n return TagUtcDtComparatorNullsLower;\n }",
"public JwComparator<AcUspsInternationalCandidateRouteDetailVo> getUspsInternationalCandidateRouteCreatedUtcTsComparatorNullsLower()\n {\n return UspsInternationalCandidateRouteCreatedUtcTsComparatorNullsLower;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to find the least common ancestor of node1 and node2 of Binary Search Tree Time complexity O(n) Space complexity O(1) | private static Node leastCommonAncestor(Node root, int node1, int node2) {
if (root == null) {
return null;
}
//Check if the nodes are available in the Binary Search Tree
if (TreeUtil.isNodeAvailable(root, node1) && TreeUtil.isNodeAvailable(root, node2)) {
return leastCommonAncestorUtil(root, node1, node2);
} else {
//return null if any of the node is missing from the Binary Search Tree
return null;
}
} | [
"private static PhyloTreeNode findLeastCommonAncestor(PhyloTreeNode node1, PhyloTreeNode node2) {\n if(node1 == null || node2 == null) {\n return null;\n }\n else{\n String label1 = node1.getLabel();\n String label2 = node2.getLabel();\n if(label1.contains(label2) && (label2.contains(\"+\") || label1.equals(label2)))\n return node1;\n else if(label2.contains(label1) && (label2.contains(\"+\") || label2.equals(label1)))\n return node2;\n else{\n return findLeastCommonAncestor(node1.getParent(), node2.getParent());\n }\n }\n }",
"private static Node leastCommonAncestorUtil(Node root, int node1, int node2) {\n if (root == null) {\n return null;\n }\n //If root is either of the node, return root\n if (root.getData().equals(node1) || root.getData().equals(node2)) {\n return root;\n }\n //If root is greater than both the node, search in left subtree\n if ((Integer) root.getData() > node1 && (Integer) root.getData() > node2) {\n return leastCommonAncestor(root.getLeft(), node1, node2);\n }\n //If root is smaller than both the node, search in right subtree\n else if ((Integer) root.getData() < node1 && (Integer) root.getData() < node2) {\n return leastCommonAncestor(root.getRight(), node1, node2);\n }\n //One node is on the left subtree and other on the right subtree, return the root\n else {\n return root;\n }\n }",
"Node commonAncestor(Node one, Node two);",
"N leastCommonAncestor( N node ) ;",
"public TreeNode lowestCommonAncestor(TreeNode root, TreeNode one, TreeNode two) {\n\t\t// Assumptions: root is not null, one and two guaranteed to be in the tree and not null.\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\t// if root is one or two, we can ignore the later recursions.\n\t\tif (root == one || root == two) {\n\t\t\treturn root;\n\t\t}\n\t\tTreeNode ll = lowestCommonAncestor(root.left, one, two);\n\t\tTreeNode lr = lowestCommonAncestor(root.right, one, two);\n\t\tif (ll != null && lr != null) {\n\t\t\treturn root;\n\t\t}\n\t\treturn ll == null ? lr : ll;\n\t}",
"TreeNode findFirstCommonAncestor(TreeNode other) {\n\t\tSet<TreeNode> ancestors = buildOtherAncestor(other,\n\t\t\t\tnew HashSet<TreeNode>());\n\t\treturn firstNodeInSet(ancestors);\n\t}",
"public PhyloTreeNode findLeastCommonAncestor(String label1, String label2) {\n PhyloTreeNode node1 = findTreeNodeByLabel(label1);\n PhyloTreeNode node2 = findTreeNodeByLabel(label2);\n return findLeastCommonAncestor(node1, node2);\n }",
"public TreeNode lowestCommonAncestor2(TreeNode root, TreeNode p, TreeNode q) {\r\n\t\t if(root == null || p == root || q == root)\r\n\t return root;\r\n\t \r\n\t TreeNode left = lowestCommonAncestor(root.left, p, q);\r\n\t TreeNode right = lowestCommonAncestor(root.right, p, q);\r\n\t \r\n\t if(left == null && right != null) { // both on right\r\n\t return right;\r\n\t }\r\n\t if(right == null && left != null) { // both on left\r\n\t return left;\r\n\t }\r\n\t if(right == null && left == null) { // not in left and right\r\n\t return null;\r\n\t }\r\n\t return root; // right != null && left != null, one in left, one in right\r\n\t }",
"public static Node leastCommonAncestor(Node child1, Node child2, Q graph){\n\t\treturn com.ensoftcorp.open.commons.analysis.CommonQueries.leastCommonAncestor(child1, child2, graph);\n\t}",
"public static Node leastCommonAncestor(Node child1, Node child2, Graph graph){\n\t\treturn com.ensoftcorp.open.commons.analysis.CommonQueries.leastCommonAncestor(child1, child2, graph);\n\t}",
"public static void lowestCommonBoss(String s1, String s2) {\r\n //System.out.println(\"-------------lowestCommonBoss(String s1, String s2)----------- with s1 = \" + s1 + \", s2 = \" + s2);\r\n MySearchTree.Node employee1NodeBST = employeeSearchTree.treeSearch(s1); //employee1 node in BST with key = s1\r\n MySearchTree.Node employee2NodeBST = employeeSearchTree.treeSearch(s2); //employee2 node in BST with key = s2\r\n// System.out.println(\"----------employee1NodeBST = \" + employee1NodeBST + \", employee2NodeBST = \" + employee2NodeBST + \"------\");\r\n \r\n MyTree.Node<String> employee1NodeMT = employee1NodeBST.getNode(); //employee1 node in main tree\r\n MyTree.Node<String> employee2NodeMT = employee2NodeBST.getNode(); //employee2 node in main tree\r\n// System.out.println(\"----------employee1NodeMT = \" + employee1NodeMT + \", employee2NodeMT = \" + employee2NodeMT + \"------\");\r\n \r\n int a = employee1NodeMT.depth();\r\n int b = employee2NodeMT.depth();\r\n \r\n if(b > a){\r\n int c = b - a;\r\n for(int i=0; i<c; i++){\r\n employee2NodeMT = employee2NodeMT.getParent();\r\n }\r\n }\r\n else {\r\n int d = a - b;\r\n for(int i=0; i<d; i++){\r\n employee1NodeMT = employee1NodeMT.getParent();\r\n }\r\n }\r\n while(employee1NodeMT.getParent() != employee2NodeMT.getParent()){\r\n employee1NodeMT = employee1NodeMT.getParent();\r\n employee2NodeMT = employee2NodeMT.getParent();\r\n }\r\n System.out.println(employee1NodeMT.getParent());\r\n }",
"public static Node nearestCommonAncestor(Node node1, Node node2) {\n\t\tNode ancestor=node1;\n\t\twhile (ancestor!=null) {\n\t\t\tif (isAncestor(ancestor, node2)) {\n\t\t\t\treturn ancestor;\n\t\t\t}\n\t\t\tancestor = ancestor.parent();\n\t\t}\n\t\tthrow new IllegalStateException(\"node1 and node2 do not have common ancestor\");\n\t}",
"public int ancestor(Iterable<Integer> subsetA, Iterable<Integer> subsetB) {\r\n BreadthFirstDirectedPaths searchA = new BreadthFirstDirectedPaths(g, subsetA);\r\n BreadthFirstDirectedPaths searchB = new BreadthFirstDirectedPaths(g, subsetB);\r\n\r\n int shortest = Integer.MAX_VALUE;\r\n int ancestor = -1;\r\n for (int s = 0; s < g.V(); ++s) {\r\n if (searchA.hasPathTo(s) && searchB.hasPathTo(s)) {\r\n int dist = searchA.distTo(s) + searchB.distTo(s);\r\n if (dist < shortest) {\r\n shortest = dist;\r\n ancestor = s;\r\n }\r\n }\r\n }\r\n\r\n return ancestor;\r\n}",
"TreeNode commonAncestor(TreeNode root, TreeNode p, TreeNode q) {\n\tResult r = commonAncestorHelper(root, p, q);\n\t// if whatever is returned is an ancestor\n\t// we return that node\n\t// else return null, there is no ancestor that exists\n\tif (r.isAncestor) {\n\t\treturn r.node\n\t}\n\treturn null; \n}",
"private String findCommonAncestor(String source, String target) {\r\n\r\n\t\tQueue<TNode> aQueue = new PriorityQueue<TNode>();\r\n\t\taQueue.add(new TNode(source, 0));\r\n\t\tArrayList<String> visitedC = new ArrayList<String>();\r\n\t\tString ret = null; // if there is no common ancestor\r\n\t\tlong hops = -1;\r\n\t\t\r\n\t\twhile (!aQueue.isEmpty()) {\r\n\t\t\tTNode ancestor = aQueue.remove();\r\n\r\n\t\t\t// This is in order to avoid the cycles\r\n\t\t\tif (visitedC.contains(ancestor.oClass))\r\n\t\t\t\tcontinue;\r\n\t\t\telse\r\n\t\t\t\tvisitedC.add(ancestor.oClass);\r\n\r\n\t\t\tif (isAncestor(ancestor.oClass, target)) {\r\n\t\t\t\t\r\n\t\t\t\tlong right = hierarchicDistance(ancestor.oClass, target);\r\n\t\t\t\t\r\n\t\t\t\tif ((hops < 0) \r\n\t\t\t\t\t\t||(((right + ancestor.value) < hops) \r\n\t\t\t\t\t\t\t\t&& ((right + ancestor.value) <= 2*ontologyTreeHeight))) {\r\n\t\t\t\t\tret = ancestor.oClass;\r\n\t\t\t\t\thops = (right + ancestor.value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if ((hops < 0) || (ancestor.value + 1 < hops)){ // this heuristic needs to be improved \r\n\t\t\t\t\r\n\t\t\t\tArrayList<String> ancClasses = SDBHelper.getOWLSuperClasses(ancestor.oClass, store);\r\n\t\t\t\t\r\n\t\t\t\tfor (String anr : ancClasses)\r\n\t\t\t\t\taQueue.add(new TNode(anr, ancestor.value + 1));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ret;\r\n\t}",
"public static void findClosestSharedParentBST() {\n \n // initialize graph (adjacency list) as a BST\n int[][] bst = {\n {1,2}, // vertex 0 ....\n {3,4},\n {5,6},\n {7,8},\n {},\n {},\n {},\n {9},\n {},\n {} // vertex 9\n }; \n // Given 2 Nodes in a BST, find their closest shared parent\n Graph g = new Graph(bst);\n g.dijsktra(g.getVertices().get(0));\n List<Vertex> path1 = g.getShortestPath(g.getVertices().get(1));\n List<Vertex> path2 = g.getShortestPath(g.getVertices().get(9));\n\n // parent will be the last item in each path before the diverge\n // EX: [1,2,3], [1,2,4,5]. - searched for 3 and 5. parent is 2.\n // EX: [1,2], [1,2,4,5]. - searched for 2 and 5. parent is 2.\n int min = Math.min(path1.size(), path2.size()) -1;\n int parentidx = 0;\n for (int i = 0; i <= min; i++) {\n if (path1.get(i) == path2.get(i)) {\n parentidx = i;\n } else {\n break;\n }\n }\n System.out.println(\"shared parent: \" + path1.get(parentidx));\n }",
"@Test(expected=NullPointerException.class)\n\tpublic void lowestCommonAncestorTest2()\n\t{\n\t\tNodeList n1=xmlDocument.getElementsByTagName(\"c\");\n\t\tNodeList n2=xmlDocument.getElementsByTagName(\"i\");\n\t\tManipulator.lowestCommonAncesstor(n1.item(0),n2.item(0));\n\t}",
"private AVLNode<T> searchAncestor(AVLNode<T> curr, T d1, T d2) {\n if (curr == null) {\n return null;\n }\n if (curr.getData().compareTo(d2) < 0\n && curr.getData().compareTo(d1) < 0) {\n return searchAncestor(curr.getRight(), d1, d2);\n }\n if (curr.getData().compareTo(d2) > 0\n && curr.getData().compareTo(d1) > 0) {\n return searchAncestor(curr.getLeft(), d1, d2);\n }\n return curr;\n }",
"public T lowestCommonAncestor( T targetOne, T targetTwo) throws ElementNotFoundException{\n\n\t\t// Create two iterators that refer to the\n\t\t// Path to root for two elements in a tree\n\t\t// These may throw the ElementNotFoundException\n\n\t\tIterator<T> one = pathToRoot(targetOne);\n\n\t\tIterator<T> two = pathToRoot(targetTwo);\n\n\t\t// Create a new unordered list of generic type T\n\n\t\tArrayUnorderedList<T> onPathOne = new ArrayUnorderedList<T>();\n\n\t\t// While iterator one has more elements\n\n\t\twhile(one.hasNext()){\n\n\t\t\t// Add the next element from iterator one to the \n\t\t\t// Rear of the unordered list\n\n\t\t\tonPathOne.addToRear(one.next());\n\n\t\t}\n\n\t\t// While the second iterator has more elements\n\n\t\twhile(two.hasNext()){\n\n\t\t\t// Create a generic element temp that \n\t\t\t// Refers to the next element from iterator two\n\n\t\t\tT temp = two.next();\n\n\t\t\t// If the unordered list contains temp\n\n\t\t\tif(onPathOne.contains(temp)){\n\n\t\t\t\t// Return the temp element\n\n\t\t\t\treturn temp;\n\n\t\t\t}\n\t\t}\n\n\t\t// In the worst case scenario \n\t\t// Return the element at the root of the tree\n\n\t\treturn root.element;\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will figure out how much change should be given back to the customer in dollars, quarters, dimes, nickels, and pennies then tell them. | public void changeGiven()
{
change2 = (int)(change*100);
dollars = change2/100;
quarters = change2%100/25;
dimes = change2%100%25/10;
nickels = change2%100%25%10/5;
pennies = change2%100%25%10%5/1;
System.out.println("You gave me "+money.format(pay)+" and you will recieve " +
dollars+" dollars, "+(quarters)+" quarters, "+dimes+" dimes, "+
nickels+" nickes, and "+pennies+" pennies.");
} | [
"private void calculateChange() {\r\n\t\tif (stock > 0 && deposit >= price)\r\n\t\t\tchange = deposit - price;\r\n\t\telse\r\n\t\t\tchange = deposit;\r\n\t}",
"private static void getChangeDue(int totalCents) {\n int moneyAvailable = totalCents/100;\n int quarters = (totalCents - (moneyAvailable * 100))/25;\n int dimes = (totalCents - (moneyAvailable * 100) - (quarters * 25))/10;\n int nickel = (totalCents - (moneyAvailable * 100) - (quarters * 25) - (dimes * 10))/5;\n System.out.println(\"moneyAvailable:\"+moneyAvailable+\"\\t\"+\"quarters:\"+quarters+\"\\t\"+\"dimes:\"+dimes+\"\\t\"+\"nickel:\"+nickel);\n }",
"private static void printChange(double dollarAmount, double total) {\n // Get the remaining amount in pennies\n int remaining = (int) Math.round((dollarAmount - total) * 100);\n\n // Initialize coin amounts\n int dollars, quarters, dimes, nickels, pennies;\n\n // Calculate amount of change from each coin type\n dollars = (remaining - remaining % 100) / 100;\n remaining = remaining % 100;\n\n quarters = (remaining - remaining % 25) / 25;\n remaining = remaining % 25;\n\n dimes = (remaining - remaining % 10) / 10;\n remaining = remaining % 10;\n\n nickels = (remaining - remaining % 5) / 5;\n remaining = remaining % 5;\n\n pennies = remaining;\n\n // Print this information in the specified format\n System.out.printf(\"Change is:\\n%d dollars\\n%d quarters\\n%d dimes\\n%d nickels\\n%d pennies\", dollars, quarters, dimes,\n nickels, pennies);\n }",
"public double calculateChangeToGive() {\r\n\t\treturn amountPaid - amountToPay;\r\n\t}",
"public static void main(String[] args) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a change amount \");\r\n\t\tint money = input.nextInt();\r\n\r\n\t\tif(money >= 100) {\r\n\t\t\tSystem.out.print(\"error enter a number 1-99 \");\r\n\t\t}else{\r\n\r\n\t\t\tint numofQuaters = money/25;\r\n\t\t\tSystem.out.println(\"Number of Quaters \" + numofQuaters);\r\n\t\t\tmoney-= numofQuaters * 25;\r\n\r\n\t\t\tint numofDimes = money/10;\r\n\t\t\tSystem.out.println (\"Number of Dimes \" + numofDimes);\r\n\t\t\tmoney-= numofDimes * 10;\r\n\r\n\t\t\tint numofNickles = money/5;\r\n\t\t\tSystem.out.println (\"Number of Nickles \" + numofNickles);\r\n\t\t\tmoney-= numofNickles * 5;\r\n\r\n\t\t\tint numofPenny = money/1;\r\n\t\t\tSystem.out.println (\"Number of Pennys \" + numofPenny);\r\n\t\t\tmoney-= numofPenny * 1;\r\n\t\t}\r\n\t}",
"public void returnDollarType() {\n\t\tint dollars[] = { 1, 5, 10, 20, 50, 100 };\n\n\t\t// Calculate the change amount\n\t\tdollarAmountBased = (int) (amountTendered - itemPrice);\n\t\tcheckNeedOf100_Bills = 0;\n\t\tcheckNeedOf50_Bills = 0;\n\t\tcheckNeedOf20_Bills = 0;\n\t\tcheckNeedOf10_Bills = 0;\n\t\tcheckNeedOf5_Bills = 0;\n\t\tcheckNeedOf1_Bills = 0;\n\n\t\t// Run through a modified high / low loop to find the highest denomination value\n\t\t// needed first.\n\t\tfor (int i = 0; i < dollars.length; i++) {\n\t\t\tif (dollars[i] < dollarAmountBased) {\n\t\t\t\tcheckNeedOf100_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf100_Bills == 1) {\n\t\t\t\t\tamountOf100_Bills = dollarAmountBased / 100;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf100_Bills * 100);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dollars[i] < dollarAmountBased) {\n\t\t\t\tcheckNeedOf50_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf50_Bills == 1) {\n\t\t\t\t\tamountOf50_Bills = dollarAmountBased / 50;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf50_Bills * 50);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dollars[i] < dollarAmountBased) {\n\t\t\t\tcheckNeedOf20_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf20_Bills == 1);\n\t\t\t\t{\n\t\t\t\t\tamountOf20_Bills = dollarAmountBased / 20;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf20_Bills * 20);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dollars[i] < dollarAmountBased) {\n\t\t\t\tamountOf10_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf10_Bills == 1);\n\t\t\t\t{\n\t\t\t\t\tamountOf10_Bills = dollarAmountBased / 10;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf10_Bills * 10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dollars[i] < dollarAmountBased) {\n\t\t\t\tcheckNeedOf5_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf5_Bills == 1) {\n\t\t\t\t\tamountOf5_Bills = dollarAmountBased / 5;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf5_Bills * 5);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dollars[i] <= dollarAmountBased) {\n\t\t\t\tcheckNeedOf1_Bills = dollars[i];\n\t\t\t\tif (checkNeedOf1_Bills == 1) {\n\t\t\t\t\tamountOf1_Bills = dollarAmountBased / 1;\n\t\t\t\t\tdollarAmountBased = dollarAmountBased - (amountOf1_Bills * 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n\r\n int cent = 200;\r\n\r\n // you have purchase candle for 74 cent, what would be your remainder\r\n\r\n cent -= 74 ; // 126 cent\r\n\r\n int quarter = cent / 25 ; // 126/25---->\r\n int penny = cent % 25; //126%25 ---> 1 is remaining\r\n\r\n System.out.println(quarter);\r\n System.out.println(penny);\r\n\r\n int dime= cent / 10 ; // 126 / 10 --->12\r\n // how much penny I have after getting dime 126 %10---->6\r\n int penny2 = cent % 10 ; //---->6\r\n System.out.println(dime);\r\n System.out.println(penny2);\r\n\r\n\r\n\r\n }",
"double fareChange(double payment) {\n return payment - totalFare() ;\n }",
"private void figureChange() {\n setChangeVal(getAmountTendered() - getProductVal());\n\n }",
"public int giveDollars()\n\t{\n\t\tint dollarsDue = (int) (payment - purchase);\n\t\tpayment -= dollarsDue;\n\t\treturn dollarsDue;\n\t}",
"public static void main(String[] args) {\n\n Scanner input = new Scanner(System.in);\n int userMoney, quarters, dimes, nickles, pennies;\n\n System.out.println(\" Hello, welcome to the change machine\");\n System.out.println( \" Please enter your cents from 1-99\");\n userMoney = input.nextInt();\n\n quarters = userMoney/25;\n userMoney %= 25;\n dimes= userMoney/10;\n userMoney %=10;\n nickles = userMoney / 5;\n userMoney %=5;\n pennies = userMoney;\n\n System.out.println(\"Your change is: \");\n System.out.println(\"quarters: \" + quarters);\n System.out.println(\"dimes: \" + dimes);\n System.out.println(\"nickles: \" + nickles);\n System.out.println(\"pennies: \" + pennies);\n\n input.close();\n\n\n\n }",
"double getChangePercent()\n\t{\n\t\treturn (currentPrice - previousClosingPrice) / previousClosingPrice;\n\t}",
"public static void main(String[] args) {\n float saleSum = Console.getFloat(\"Enter price\");\n float tenderedSum = Console.getFloat(\"Enter tender\");\n \n if(tenderedSum == saleSum) {\n Console.println(\"No change due\");\n } else if(tenderedSum >= saleSum) {\n Console.println(\"Your change is £\" + String.format(\"%.2f\", (tenderedSum - saleSum)));\n } else {\n Console.println(\"A further £\" + String.format(\"%.2f\", (saleSum - tenderedSum)) + \" is required\");\n }\n \n }",
"double getChangePercent() {\n\t return 100 - (currentPrice * 100 / previousClosingPrice);\n\t }",
"public void coinDisbursed() {\r\n float coinsHandOut = this.balance; // coinsHandOut ---> balance to get the number of coins while keeping the amount entered\r\n // 100 Namibian Dollar\r\n int hundredDollar = (int)(coinsHandOut / 100.0F);\r\n float remainder = coinsHandOut % 100.0F;\r\n // 50 Namibian Dollar\r\n int fiftyDollar = (int)(remainder / 50.0F);\r\n remainder %= 50.0F;\r\n // 20 Namibian Dollar //\r\n int twentyDollar = (int)(remainder / 20.0F);\r\n remainder %= 20.0F;\r\n // 10 Namibian Dollar //\r\n int tenDollar = (int)(remainder / 10.0F);\r\n remainder %= 10.0F;\r\n // 5 Namibian Dollar //\r\n int fiveDollar = (int)(remainder / 5.0F);\r\n remainder %= 5.0F;\r\n // 1 Namibian Dollar //\r\n int oneDollar = (int)remainder;\r\n remainder %= 1.0F;\r\n // 50 cent --> 50 /100 //\r\n int fiftyCents = (int)((double)remainder / 0.5D);\r\n remainder = (float)((double)remainder % 0.5D);\r\n // 10 cent --> 10 /100\r\n int tenCents = (int)((double)remainder / 0.1D);\r\n remainder = (float)((double)remainder % 0.1D);\r\n // 5 cent --> 5 /100 //\r\n int fiveCents = (int)((double)remainder / 0.05D);\r\n System.out.println(\"\\nDisbursed :\\n\" + hundredDollar + \" x N$100\\n\" + fiftyDollar + \" x N$50\\n\" + twentyDollar + \" x N$20\\n\" + tenDollar + \" x N$10\\n\" + fiveDollar + \" x N$5\\n\" + oneDollar + \" x N$1\\n\" + fiftyCents + \" x 50c\\n\" + tenCents + \" x 10c\\n\" + fiveCents + \" x 5c\");\r\n }",
"public void payment()\r\n\t{\r\n\t\tSystem.out.println(\"Your total is \"+money.format(finalPrice)+\" how much\" +\r\n\t\t\t\t\" would you like to pay with?\");\r\n\t\tpay = scan.nextDouble();\r\n\t\tchange = pay-finalPrice;\r\n\t\tscan.nextLine();\r\n\t}",
"public static void main(String[] args) {\n //ENTER CODE HERE\n Scanner scan =new Scanner(System.in);\n System.out.println(\"Enter price in cents:\");\n\n int itemPrice = scan.nextInt();\n\n if (itemPrice < 25 || itemPrice > 100 || (itemPrice % 5 != 0) ) {\n System.out.println(\"Invalid entry\");\n }\n else\n {\n int change=(100-itemPrice);\n int quarterCount = change / 25;\n int remainder1 = change % 25;\n int dimeCount = remainder1 / 10;\n int remainder2 = remainder1 % 10;\n int nickelCount = remainder2 / 5;\n\n System.out.println(\"When you give $1 for \" +itemPrice+ \"cents item. You will get back \"+\n quarterCount+ (quarterCount>1 ? \"quarters \" :\"quarter \")+\n dimeCount + (dimeCount > 1 ? \"dimes \" : \"dime \") +\n nickelCount+ (nickelCount > 1 ? \"nickels \" :\"nickel \") );\n\n }\n\n\n\n }",
"public double calculateChange(double money, double itemPrice)\r\n {\r\n double change = 0.00;\r\n customerBalance = customerBalance - itemPrice;\r\n machineBalance += itemPrice;\r\n change = customerBalance;\r\n return change;\r\n }",
"public static void exact() {\n\t\tSystem.out.println(\"The customer provided the exact amount. No change required!\");\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the default sort value for this column based upon its title. The first column is sorted the others unsorted. | public synchronized ColumnSort getDefaultSort() {
return f_title.equals(SUMMARY_COLUMN) ? ColumnSort.SORT_UP : ColumnSort.UNSORTED;
} | [
"public java.lang.String getDefaultSort() { \n return this.defaultSort; \n }",
"protected FileBrowserSortField getDefaultSortField(PortalControllerContext portalControllerContext) {\n // Window properties\n FileBrowserWindowProperties windowProperties = this.getWindowProperties(portalControllerContext);\n\n // Default sort field\n FileBrowserSortField field;\n if (windowProperties.getDefaultSortField() != null) {\n field = this.getSortField(portalControllerContext, windowProperties.getDefaultSortField(), false);\n } else if (this.isListMode(portalControllerContext)) {\n field = FileBrowserSortEnum.RELEVANCE;\n } else {\n field = FileBrowserSortEnum.TITLE;\n }\n\n return field;\n }",
"public String getScoreSort() {\n\t\treturn prefs.getString(KEY_SCORE_SORT, context.getResources().getString(R.string.score_sorting_default));\n\t}",
"String getSortColumn();",
"String getSortingPreference();",
"public static Sort getDefaultSort() {\n return new Sort(\n new Sort.Order(Sort.Direction.ASC, SubDepartment.DEPARTMENT_SORT_FIELD)\n );\n }",
"private static String getDefaultSortingCriterion(Context context){\n return context.getString(R.string.pref_sort_criterion_default);\n }",
"String sortValue(Column.ColumnData data);",
"protected abstract boolean isDefaultAscending(String sortColumn);",
"public void setDefaultSort(java.lang.String defaultSort) { \n this.defaultSort = defaultSort; \n }",
"@Override\n public Comparable getSortKey() {\n return sortOrder == null ? label : sortOrder;\n }",
"public String getSongListSort() {\n\t\treturn prefs.getString(KEY_SONGLIST_SORT, context.getResources().getString(R.string.sorting_default));\n\t}",
"io.dstore.values.IntegerValue getSortNo();",
"public IColumn defaultOrderColumn() {\n switch (this)\n {\n case Todo:\n return TodoColumn._id;\n case Task:\n return TodoColumn._id;\n case Bug:\n return TodoColumn._id;\n case Story:\n return TodoColumn._id;\n case Product:\n return ProductColumn._id;\n case Project:\n return ProjectColumn._id;\n }\n return null;\n }",
"protected Column<T, ?> getAutoSortColumn() {\n if (autoSortColumn == null) {\n for (Column<T, ?> column : columns) {\n if (column.autoSort()) {\n autoSortColumn = column;\n return autoSortColumn;\n }\n }\n }\n return autoSortColumn;\n }",
"B defaultSort(QuerySort sort);",
"public com.google.protobuf.StringValue getSortText() {\n return sortText_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : sortText_;\n }",
"public String getColumnDefault()\r\n {\r\n return getString(13);\r\n }",
"public String getSortColumn() {\n\t\t\treturn sortColumn;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the close button. | private void initCloseButton() {
this.closeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (null != closeHandler) {
closeHandler.closeRequested();
}
}
});
} | [
"public void close() {\n getCloseButton().click();\n }",
"public Button getCloseButton() {\r\n\t\treturn closeButton;\r\n\t}",
"public void clickClose()\n {\n click(CLOSE_BUTTON);\n }",
"public Button getCloseButton() {\n\t\treturn closeButton;\n\t}",
"private void setupExitButton() {\r\n\t\texitButton = new Button(\"\");\r\n\t\texitButton.setId(\"close_help\");\r\n\t\texitButton.setPrefSize(25, 25);\r\n\t\texitButton.setTranslateX(40);\r\n\t\texitButton.setTranslateY(3);\r\n\t\texitButton.setOnMouseClicked(new EventHandler<MouseEvent>() {\r\n\t\t\tpublic void handle(MouseEvent e) {\r\n\t\t\t\thelpStage.close();\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"private JButton getCloseButton() {\n\t\tif (closeButton == null) {\n\t\t\tcloseButton = new JButton();\n\t\t\tcloseButton.setText(\"close\");\n\t\t\tcloseButton.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n\t\t\tcloseButton.setPreferredSize(new java.awt.Dimension(45,19));\n\t\t\tcloseButton.setBounds(130, 5, 65, 19);\n\t\t\tcloseButton.addActionListener(new java.awt.event.ActionListener() { \n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) { \n\t\t\t\t\tdispose();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn closeButton;\n\t}",
"public GuiButton getCloseButton() {\r\n return btnClose;\r\n }",
"public void onClosePanel()\n {\n _isClosing = true;\n }",
"public void btnClose_Click()\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.dispose( );\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception excError)\r\n\t\t\t\t{\r\n\t\t\t\t\tCUtilities.WriteLog( excError );\r\n\t\t\t\t}\r\n\t\t\t}",
"private JButton getCloseButton() {\n if (closeButton == null) {\n closeButton = new CloseTabButton(closeButtonActionListener);\n }\n\n return closeButton;\n }",
"public static void closeBtnPressed () {\r\n PCNMClientStart.switchPanels(new NetMapSCR());\r\n }",
"public CloseSavingAccount() {\n initComponents();\n }",
"public void closeClick() {\n closeTitle.click();\n }",
"public Cancellation() {\n setIcon();\n initComponents();\n }",
"private void closeActionPerformed(java.awt.event.ActionEvent evt) {\n this.dispose();\n }",
"public void setDisplayCloseButton(boolean dispClose) {\n if (dispClose) {\n MTSvgButton keybCloseSvg = new MTSvgButton(this.getRenderer(), MT4jSettings.getInstance().getDefaultSVGPath()\n + \"keybClose.svg\");\n //Transform\n keybCloseSvg.scale(0.5f, 0.5f, 1, new Vector3D(0, 0, 0));\n keybCloseSvg.translate(new Vector3D(this.getWidthXY(TransformSpace.RELATIVE_TO_PARENT) - 45, 2, 0));\n keybCloseSvg.setBoundsPickingBehaviour(AbstractShape.BOUNDS_ONLY_CHECK);\n keybCloseSvg.addActionListener(new CloseActionListener(new MTComponent[]{this, keybCloseSvg}));\n//\t\t\tpic.addChild(keybCloseSvg);\n keybCloseSvg.setName(\"closeButton\");\n this.addChild(keybCloseSvg);\n } else {\n //Remove svg button and destroy child display lists\n MTComponent[] childs = this.getChildren();\n for (MTComponent component : childs) {\n if (component.getName().equals(\"closeButton\")) {\n MTSvgButton svgButton = (MTSvgButton) component;\n svgButton.destroy();\n }\n }\n }\n }",
"private JButton createCloseButton() {\r\n JButton closeButton = new JButton(\"Close\");\r\n closeButton.setToolTipText(\"Close Social Network Panel\");\r\n // Clicking of button results in the closing of current panel\r\n closeButton.addActionListener(new ActionListener() {\r\n\r\n public void actionPerformed(ActionEvent event) {\r\n UserPanel.this.appManager.closeUserPanel();\r\n }\r\n });\r\n return closeButton;\r\n }",
"private void createCloseButton() {\n \t\n centeredComp = new Composite(shell, SWT.NONE);\n GridLayout gl = new GridLayout(3, true);\n centeredComp.setLayout(gl);\n GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);\n //gd.horizontalSpan = 3;\n centeredComp.setLayoutData(gd);\n\n //gd = new GridData(90, SWT.DEFAULT); \n \n Button takeCtrlBtn = new Button(centeredComp, SWT.NONE);\n takeCtrlBtn.setText(\"Take Control\");\n takeCtrlBtn.setLayoutData(gd);\n takeCtrlBtn.addListener(SWT.Selection, new Listener(){\n\t\t\tpublic void handleEvent(Event e){\t\n\t\t\t\tif(associatedSeekAction != null){\n\t\t\t\t\tAbstractVizPerspectiveManager mgr = VizPerspectiveListener\n\t\t\t\t\t.getCurrentPerspectiveManager();\n\t\t\t\t\tif (mgr != null) {\n\t\t\t\t\t\tmgr.getToolManager().selectModalTool(associatedSeekAction);\n\t\t\t\t\t\tassociatedSeekAction.setEnabled(false);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmgr.getToolManager().activateToolSet(associatedSeekAction.getCommandId());\n\t\t\t\t\t\t} catch (VizException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n \n Button saveCPFBtn = new Button(centeredComp, SWT.NONE);\n saveCPFBtn.setText(\"Save CPF\");\n saveCPFBtn.setLayoutData(gd);\n \n saveCPFBtn.addListener(SWT.Selection, new Listener(){\n\t\t\tpublic void handleEvent(Event e){\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tsaveCPF();\n\t\t\t\t\n\t\t\t}\n\t\t});\n \n Button closeBtn = new Button(centeredComp, SWT.NONE);\n closeBtn.setText(\"Close\");\n closeBtn.setLayoutData(gd);\n closeBtn.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent event) {\n// shell.dispose();/*changed to close() by archana*/\n close(); \t\n }\n });\n\n }",
"public boolean hasCloseButton()\r\n\t{\r\n\t\treturn false;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ask whether assertions (xsl:assert instructions) should be enabled. By default they are disabled. If assertions are enabled at compile time, then by default they will also be enabled at run time; but they can be disabled at run time by specific request | public boolean isAssertionsEnabled() {
return compilerInfo.isAssertionsEnabled();
} | [
"@Test(expected = AssertionError.class)\n\tpublic void testAssertionsEnabled() {\n\t\tassert false;\n\t}",
"@Test(enabled = false)\n\tpublic void HardAssert(){\n\t\t\t\t\n\t\tSystem.out.println(\"Hard Asset Step 1\");\n\t\tAssert.assertEquals(false, false);\n\t\tSystem.out.println(\"Hard Asset Step 2\");\n\t\tAssert.assertEquals(false, true);\n\t\tSystem.out.println(\"Hard Asset Step 3\");\n\t}",
"public boolean isAssertQuery() {\n return mType == TYPE_ASSERT;\n }",
"protected abstract boolean isSatisfiedByInternal(Assertion assertion);",
"private void handleAssert(){\n // two extra fields\n sootClass.addField(new soot.SootField(\"$assertionsDisabled\", soot.BooleanType.v(), soot.Modifier.STATIC | soot.Modifier.FINAL));\n sootClass.addField(new soot.SootField(\"class$\"+sootClass.getName(), soot.RefType.v(\"java.lang.Class\"), soot.Modifier.STATIC));\n // two extra methods\n String methodName = \"class$\";\n soot.Type methodRetType = soot.RefType.v(\"java.lang.Class\");\n ArrayList paramTypes = new ArrayList();\n paramTypes.add(soot.RefType.v(\"java.lang.String\"));\n if (!sootClass.declaresMethod(methodName, paramTypes, methodRetType)){\n soot.SootMethod sootMethod = new soot.SootMethod(methodName, paramTypes, methodRetType, soot.Modifier.STATIC);\n AssertClassMethodSource mSrc = new AssertClassMethodSource();\n sootMethod.setSource(mSrc);\n sootClass.addMethod(sootMethod);\n }\n methodName = \"<clinit>\";\n methodRetType = soot.VoidType.v();\n paramTypes = new ArrayList();\n if (!sootClass.declaresMethod(methodName, paramTypes, methodRetType)){\n soot.SootMethod sootMethod = new soot.SootMethod(methodName, paramTypes, methodRetType, soot.Modifier.STATIC);\n PolyglotMethodSource mSrc = new PolyglotMethodSource();\n mSrc.hasAssert(true);\n sootMethod.setSource(mSrc);\n sootClass.addMethod(sootMethod);\n }\n else {\n ((soot.javaToJimple.PolyglotMethodSource)sootClass.getMethod(methodName, paramTypes, methodRetType).getSource()).hasAssert(true);\n }\n }",
"boolean isSetSpecialInstructions();",
"private void verificarInvariante( )\r\n { \r\n assert receptor != null : \"Canal inv�lido\";\r\n assert config != null : \"Conjunto de propiedades inv�lidas\";\r\n assert adminResultados != null : \"El administrador de resultados no deber�a ser null\";\r\n assert encuentros != null : \"La lista de encuentros no deber�a ser null\"; \r\n }",
"protected void addSafetyEqAssertStmts(NodeBuilder node, Fault fault, BinaryExpr assertExpr) {\r\n\t\tif (fault.safetyEqAsserts.isEmpty()) {\r\n\t\t\t// Assert:\r\n\t\t\t// __ASSERT = (output = (fault_node_val_out))\r\n\t\t\t// and (__ASSUME__HIST => (__GUARANTEE0 and true)))\r\n\t\t\tnode.addEquation(new IdExpr(\"__ASSERT\"), assertExpr);\r\n\t\t} else {\r\n\t\t\t// Build and expression with all expr in list\r\n\t\t\tExpr safetyEqExpr = buildBigAndExpr(fault.safetyEqAsserts, 0);\r\n\t\t\tBinaryExpr finalExpr2 = new BinaryExpr(safetyEqExpr, BinaryOp.AND, assertExpr);\r\n\t\t\tnode.addEquation(new IdExpr(\"__ASSERT\"), finalExpr2);\r\n\t\t}\r\n\t}",
"public boolean shouldBeEnabled() {\n return true;\n }",
"private boolean isExpertMode(OgemaHttpRequest req) {\n\t\tString expertMode = ScheduleViewerUtil.getPageParameter(req, page, PARAM_EXPERT_MODE);\n\t\treturn Boolean.valueOf(expertMode);\n\t}",
"public static void assertEnabled(PmObject... pms) {\n for (PmObject pm : pms) {\n if (!pm.isPmEnabled()) {\n fail(pm.getPmRelativeName() + \" should be enabled.\");\n }\n }\n }",
"public void Building_Permit_Assertion()\n\t{\n\t\ttry{\n\t\t\tapi.PdfPatterns.BuildingPermitApprovalPDF(pdfoutput);\n\t\t\t{\n\t\t\t\tmAssert(BPAL_APPLICATIONNO.get(CurrentinvoCount), ApplicationNoforLandDev.get(CurrentinvoCount), \"Actual Application No is :::\"+BPAL_APPLICATIONNO +\",Expected is :::\"+ApplicationNoforLandDev);\n\t\t\t\tmAssert(BPAL_OWNERNAME.get(CurrentinvoCount), Bpr_OwnerFullName.get(CurrentinvoCount), \"Actual Owner Name is :::\"+BPAL_OWNERNAME +\",Expected is :::\"+Bpr_OwnerFullName);\n\t\t\t\tmAssert(BPAL_WARD.get(CurrentinvoCount), Bpr_ward.get(CurrentinvoCount), \"Actual Ward No is :::\"+BPAL_WARD +\",Expected is :::\"+Bpr_ward);\n\t\t\t\tmAssert(BPAL_KHATANO.get(CurrentinvoCount), Bpr_KhataNo.get(CurrentinvoCount), \"Actual Khata No is :::\"+BPAL_KHATANO +\",Expected is:::\"+Bpr_KhataNo);\n\t\t\t\tmAssert(BPAL_HOLDINGNO.get(CurrentinvoCount), Bpr_HoldingNo.get(CurrentinvoCount), \"Actual Holding No is:::\"+BPAL_HOLDINGNO +\",Expected is:::\"+Bpr_HoldingNo);\n\t\t\t\tmAssert(BPAL_VILLAGE.get(CurrentinvoCount), Bpr_Village.get(CurrentinvoCount), \"Actual Village/Mohalla is :::\"+BPAL_VILLAGE +\",Expected is:::\"+Bpr_Village);\n\n\t\t\t}\n\t\t}\n\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tthrow new MainetCustomExceptions(\"Error in searchByVariousCriteria script\");\n\t\t}\n\t}",
"public void setAssertsRelDirection(boolean value) {\n this.assertsRelDirection = value;\n }",
"public void Land_dev_Approval_Assertion()\n\t{\n\t\ttry{\n\t\t\tapi.PdfPatterns.LandDevApprovalPDF(pdfoutput);\n\t\t\tif(!mGetPropertyFromFile(\"TypeOfExecution\").equalsIgnoreCase(\"individual\")){\n\t\t\t\tmAssert(LDAL_APPLNO.get(CurrentinvoCount), ApplicationNoforLandDev.get(CurrentinvoCount), \"Application No does not match in Approval letter Actual :::\"+LDAL_APPLNO +\",Expected is :::\"+ApplicationNoforLandDev);\n\t\t\t\tmAssert(LDAL_OWNERNAME.get(CurrentinvoCount),AlD_Nameofowner.get(CurrentinvoCount), \"Owner Name does not match in Approval letter Actual :::\"+LDAL_OWNERNAME +\",Expected is :::\"+AlD_Nameofowner);\n\t\t\t\tmAssert(LDAP_WARD.get(CurrentinvoCount), ward.get(CurrentinvoCount), \"Actual Ward No is :::\"+LDAP_WARD +\",Expected is :::\"+ward);\n\t\t\t\tmAssert(LDAP_KHATANO.get(CurrentinvoCount), KhataNo.get(CurrentinvoCount), \"Actual Khata No is :::\"+LDAP_KHATANO +\",Expected is:::\"+KhataNo);\n\t\t\t\tmAssert(LDAP_HOLDINGNO.get(CurrentinvoCount), HoldingNo.get(CurrentinvoCount), \"Actual Holding No is:::\"+LDAP_HOLDINGNO +\",Expected is:::\"+HoldingNo);\n\t\t\t\tmAssert(LDAP_MSPKHASARA.get(CurrentinvoCount), PlotKhasraNo.get(CurrentinvoCount), \"Actual Plot No/Khasara No is :::\"+LDAP_MSPKHASARA +\",Expected is:::\"+PlotKhasraNo);\n\t\t\t\tmAssert(LDAP_PLOTMSP.get(CurrentinvoCount), PlotNoMSP.get(CurrentinvoCount), \"Actual Plot No(MSP) is:::\"+LDAP_PLOTMSP +\",Expected is:::\"+PlotNoMSP);\n\t\t\t\tmAssert(LDAP_VILLAGE.get(CurrentinvoCount), Village.get(CurrentinvoCount), \"Actual Village/Mohalla is :::\"+LDAP_VILLAGE +\",Expected is:::\"+Village);\n\t\t\t\tmAssert(LDAP_MSPKHASARA.get(CurrentinvoCount), PlotKhasraNo.get(CurrentinvoCount), \"Actual Plot No/Khasara No is :::\"+LDAP_MSPKHASARA +\",Expected is:::\"+PlotKhasraNo);\n\t\t\t}\n\t\t}\n\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tthrow new MainetCustomExceptions(\"Error in searchByVariousCriteria script\");\n\t\t}\n\t}",
"@Test\r\n @Ignore\r\n public void testBooleanImplies() {\r\n reasoningTest(\"BooleanImplies.ivml\", 1);\r\n }",
"public static void main(String[] args) {\n\t\t// enabling assertions -- ea in JVM parameter, or -da\n\t\tnew AssertionMechanism().methodA2(6);\n\t\tnew AssertionMechanism().methodA2(-6);\n\t}",
"static void requireEA() {\n\t\tboolean ea = false;\n\t assert ea = true; // assert with a side-effect, on purpose!\n\t if (!ea) {\n\t err.println(\"This program must be run with -ea!\");\n\t exit(1);\n\t }\n\t}",
"private void testAssertTrue() {\n boolean val = new CommitteeScheduleStartAndEndDateRule().processRules(event);\n assertTrue(val);\n }",
"Assertion createAssertion();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the Volley Wrapper library before the tests are run. | @BeforeClass
public static void initVolleyWrapper() {
VolleyWrapper.init(InstrumentationRegistry.getTargetContext());
Configuration configuration = new Configuration.Builder()
.setBodyContentType("application/json")
.setSyncTimeout(30L)
.build();
VolleyWrapper.setDefaultConfiguration(configuration);
} | [
"public void init(Context context) {\n this.mContext = context;\n vollyRequestManager = new VollyRequestManager(VolleyUtil.getInstance(mContext).getRequestQueue());\n }",
"public void initializeVolley(Context context) {\n Log.e(LOG, \"initializing Volley Networking ...\");\n requestQueue = Volley.newRequestQueue(context);\n int memClass = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE))\n .getMemoryClass();\n\n // Use 1/8th of the available memory for this memory cache.\n int cacheSize = 1024 * 1024 * memClass / 8;\n bitmapLruCache = new BitmapLruCache(cacheSize);\n // imageLoader = new ImageLoader(requestQueue, bitmapLruCache);\n Log.i(LOG, \"********** Yebo! Volley Networking has been initialized, cache size: \" + (cacheSize / 1024) + \" KB\");\n\n // Create global configuration and initialize ImageLoader with this configuration\n DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()\n .cacheInMemory(true)\n .cacheOnDisk(true)\n .build();\n ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())\n .defaultDisplayImageOptions(defaultOptions)\n .build();\n\n ImageLoader.getInstance().init(config);\n }",
"public static void setUp() {\n RequestFactory.defaultFactory = new RequestFactory() {\n @Override\n public Request createRequest(\n String httpMethod,\n String apiMethod,\n RequestType type,\n Map<String, Object> params) {\n return new RequestHelper(httpMethod, apiMethod, type, params);\n }\n };\n RequestSender.setInstance(new ImmediateRequestSender());\n\n if (BuildConfig.DEBUG) {\n Leanplum.setAppIdForDevelopmentMode(APP_ID, DEVELOPMENT_KEY);\n } else {\n Leanplum.setAppIdForProductionMode(APP_ID, PRODUCTION_KEY);\n }\n Leanplum.setDeviceId(\"leanplum-unit-test-20527411-BF1E-4E84-91AE-2E98CBCF30AF\");\n Leanplum.setApiConnectionSettings(API_HOST_NAME, \"api\", API_SSL);\n Leanplum.setSocketConnectionSettings(SOCKET_HOST_NAME, SOCKET_PORT);\n Leanplum.setLogLevel(Log.Level.DEBUG);\n }",
"private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}",
"@Before\n public void init() {\n encryptionKeyService = new EncryptionKeyEndpoint();\n Whitebox.setInternalState(encryptionKeyService, \"keystoreHelperService\", keystoreHelperService);\n }",
"public void initialize() {\n this.loadDownloadList();\n }",
"@BeforeEach\n void initialization() {\n // Setting testing PremierLeagueManager year.\n testYear = 200;\n\n // Initializing PremierLeagueManager.\n testPLM = new PremierLeagueManager(testYear);\n\n // Creating and Adding clubs to the PremierLeagueManager.\n FootballClub testFootballClubA = new FootballClub(\"Name A\", \"Location A\");\n testPLM.addToClubList(testFootballClubA);\n FootballClub testFootballClubB = new FootballClub(\"Name B\", \"Location B\");\n testPLM.addToClubList(testFootballClubB);\n FootballClub testFootballClubC = new FootballClub(\"Name C\", \"Location C\");\n testPLM.addToClubList(testFootballClubC);\n FootballClub testFootballClubD = new FootballClub(\"Name D\", \"Location D\");\n testPLM.addToClubList(testFootballClubD);\n\n // Adding a match to the PremierLeagueManager.\n testPLM.addMatch(new Match<>(new Date(testYear, 6, 6), testFootballClubA, testFootballClubB));\n\n // Saving the PremierLeagueManager.\n try {\n Storage.save(testPLM);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Initialising the Application.\n application = new GuiceApplicationBuilder()\n .withConfigLoader(env -> ConfigFactory.load(env.classLoader()))\n .build();\n // Starting the Application.\n Helpers.start(application);\n }",
"@Before\n public void setup() {\n config.setProperty(Constants.PROPERTY_RETRY_DELAY, \"1\");\n config.setProperty(Constants.PROPERTY_RETRY_LIMIT, \"3\");\n rc = new RequestContext(null);\n rc.setTimeToLiveSeconds(2);\n }",
"@BeforeTest\r\n\tpublic void beforeTest() {\r\n\t\tapi = new ApiAutomation();\r\n\t\tapi.initialize();\r\n\t\t\r\n\t}",
"@Before\r\n\tpublic void init() {\r\n\t\tMockitoAnnotations.initMocks(this);\r\n\t\tmockMvc = MockMvcBuilders.standaloneSetup(tokenController).build();\r\n\r\n\t\t// mockMvc = MockMvcBuilders.webAppContextSetup(context).build();\r\n\t}",
"@Before\n public void setUp() throws Exception {\n MockServletContext mockServletContext = new MockServletContext();\n new SpannerClient().contextInitialized(new ServletContextEvent(mockServletContext));\n SpannerTestTasks.setup();\n\n eventVolunteeringFormHandlerServlet = new VolunteeringFormHandlerServlet();\n\n request = Mockito.mock(HttpServletRequest.class);\n response = Mockito.mock(HttpServletResponse.class);\n }",
"@Before\r\n public void init() throws Exception {\r\n // Create a test listener that traces the test execution, and make sure it is used by the tests to\r\n // record their calls\r\n tracingTestListener = new TracingTestListener(originalTestListener);\r\n\r\n UnitilsJUnit3TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit38TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n UnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n SpringUnitilsJUnit4TestBase.setTracingTestListener(tracingTestListener);\r\n\r\n InjectionUtils.injectInto(tracingTestListener, Unitils.getInstance(), \"testListener\");\r\n }",
"private void init() {\n apiService = ServiceGenerator.createService(RetrofitService.class);\n }",
"public void setUp() {\n RiotAPI.setRegion(region);\n RiotAPI.setAPIKey(apikey);\n }",
"@Before\n public final void init() {\n mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();\n }",
"@Before\n\tpublic void initTest() {\n\t\t\n\t\t//instantiate the CallCenterApp\n\t\tthis.callCenterApp=new CallCenterApp();\n\t\t\n\t\t//create Employees\t\n\t\tthis.employees=new ArrayList<>();\n\t\tthis.employees.add(new CallOperator(EmployeeRol.CALL_OPERATOR, \"Operator 1\", 1, true));\n \tthis.employees.add(new CallOperator(EmployeeRol.CALL_OPERATOR, \"Operator 2\", 1, true));\n \tthis.employees.add(new CallOperator(EmployeeRol.CALL_OPERATOR, \"Operator 3\", 1, true));\n \tthis.employees.add(new CallOperator(EmployeeRol.CALL_OPERATOR, \"Operator 4\", 1, true));\n \tthis.employees.add(new CallOperator(EmployeeRol.CALL_OPERATOR, \"Operator 5\", 1, true));\n \tthis.employees.add(new Supervisor(EmployeeRol.SUPERVISOR, \"Supervisor 1\", 2, true));\n \tthis.employees.add(new Supervisor(EmployeeRol.SUPERVISOR, \"Supervisor 2\", 2, true));\n \tthis.employees.add(new Supervisor(EmployeeRol.SUPERVISOR, \"Supervisor 3\", 2, true));\n \tthis.employees.add(new Director(EmployeeRol.DIRECTOR, \"Director 1\", 3, true));\n \tthis.employees.add(new Director(EmployeeRol.DIRECTOR, \"Director 2\", 3, true));\n \t\n \t//Create Auxilar Queues for Calls\n \tthis.callAuxQueues=new ArrayList<>();\n \tthis.callAuxQueues.add(new CallQueue());\n \tthis.callAuxQueues.add(new CallQueue());\n \t\n \t//Create the recallServices\n \tthis.reCallService= new ReCallService();\n \t\n\t}",
"private void httpSetup() {\n OkHttpClient client = new OkHttpClient.Builder()\n .readTimeout(5, TimeUnit.SECONDS)\n .writeTimeout(5, TimeUnit.SECONDS)\n .build();\n\n retrofit = new Retrofit.Builder()\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .client(client)\n .build();\n\n service = retrofit.create(ValidatorAPI.class);\n }",
"public void init() {\n try {\n this.jsonRequestBody = new JSONObject(this.body);\n }\n catch(JSONException e) {\n Log.w( null, \"Exception: \", e);\n }\n }",
"public void initializeApi() {\n spotifyApi =\n new SpotifyApi.Builder()\n .setClientId(ApiCredentials.getClientId())\n .setClientSecret(ApiCredentials.getClientSecret())\n .build();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use CGameNotifications_UpdateNotificationSettings_Request.newBuilder() to construct. | private CGameNotifications_UpdateNotificationSettings_Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
} | [
"private CGameNotifications_UpdateNotificationSettings_Response(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"com.bingo.server.msg.Settings.SettingsRequestOrBuilder getSettingsRequestOrBuilder();",
"private CGameNotifications_UpdateSession_Request(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"com.google.apps.alertcenter.v1beta1.SettingsOrBuilder getSettingsOrBuilder();",
"private GameNotificationSettings(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"SteamMsgGameNotifications.GameNotificationSettings getGameNotificationSettings(int index);",
"private void buildLocationSettingsRequest() {\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n mLocationSettingsRequest = builder.build();\n }",
"protected void buildLocationSettingsRequest() {\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n mLocationSettingsRequest = builder.build();\n }",
"public com.bingo.server.msg.Settings.SettingsRequest getSettingsRequest() {\n if (settingsRequestBuilder_ == null) {\n return settingsRequest_ == null ? com.bingo.server.msg.Settings.SettingsRequest.getDefaultInstance() : settingsRequest_;\n } else {\n return settingsRequestBuilder_.getMessage();\n }\n }",
"com.bingo.server.msg.Settings.SettingsRequest getSettingsRequest();",
"com.bingo.server.msg.Settings.GetSettingsRequestOrBuilder getGetSettingsRequestOrBuilder();",
"private void updateNotificationOptions()\n {\n //Get shared preferences editor\n SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();\n\n //Get messaging service\n FirebaseMessaging notifications = FirebaseMessaging.getInstance();\n\n //For each notification option (switch)\n for (int i = 0; i < vwNotificationPanel.getChildCount(); i += 3)\n {\n //Get notification switch\n SwitchCompat swNotificationOption = (SwitchCompat) vwNotificationPanel.getChildAt(i);\n\n //If user wants to receive this notification\n if (swNotificationOption.isChecked()) {\n //Subscribe to notification topic\n notifications.subscribeToTopic(tracker.getID() + \"_\" + swNotificationOption.getTag().toString());\n\n //Save option on shared preferences\n editor.putBoolean(currentUser.getUid() + tracker.getID() + \"_\" + swNotificationOption.getTag().toString(), true);\n } else {\n //Unsubscribe to notification topic\n notifications.unsubscribeFromTopic(tracker.getID() + \"_\" + swNotificationOption.getTag().toString());\n\n //Remove option from shared preferences\n editor.putBoolean(currentUser.getUid() + tracker.getID() + \"_\" + swNotificationOption.getTag().toString(), false);\n }\n }\n\n //Commit changes to shared preferences\n editor.apply();\n }",
"public com.squareup.okhttp.Call updateInboundMessagesNotificationSettingsAsync(UpdateInboundMessagesNotificationSettingsInputObject updateInboundMessagesNotificationSettingsInputObject, final ApiCallback<Void> callback) throws ApiException {\n\n ProgressResponseBody.ProgressListener progressListener = null;\n ProgressRequestBody.ProgressRequestListener progressRequestListener = null;\n\n if (callback != null) {\n progressListener = new ProgressResponseBody.ProgressListener() {\n @Override\n public void update(long bytesRead, long contentLength, boolean done) {\n callback.onDownloadProgress(bytesRead, contentLength, done);\n }\n };\n\n progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {\n @Override\n public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {\n callback.onUploadProgress(bytesWritten, contentLength, done);\n }\n };\n }\n\n com.squareup.okhttp.Call call = updateInboundMessagesNotificationSettingsValidateBeforeCall(updateInboundMessagesNotificationSettingsInputObject, progressListener, progressRequestListener);\n apiClient.executeAsync(call, callback);\n return call;\n }",
"public com.squareup.okhttp.Call updateChatDesktopNotificationSettingsAsync(UpdateChatDesktopNotificationSettingsInputObject updateChatDesktopNotificationSettingsInputObject, final ApiCallback<Void> callback) throws ApiException {\n\n ProgressResponseBody.ProgressListener progressListener = null;\n ProgressRequestBody.ProgressRequestListener progressRequestListener = null;\n\n if (callback != null) {\n progressListener = new ProgressResponseBody.ProgressListener() {\n @Override\n public void update(long bytesRead, long contentLength, boolean done) {\n callback.onDownloadProgress(bytesRead, contentLength, done);\n }\n };\n\n progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {\n @Override\n public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {\n callback.onUploadProgress(bytesWritten, contentLength, done);\n }\n };\n }\n\n com.squareup.okhttp.Call call = updateChatDesktopNotificationSettingsValidateBeforeCall(updateChatDesktopNotificationSettingsInputObject, progressListener, progressRequestListener);\n apiClient.executeAsync(call, callback);\n return call;\n }",
"com.bingo.server.msg.Settings.GetSettingsRequest getGetSettingsRequest();",
"public LocationSettingsRequest build() {\n return new LocationSettingsRequest(requests, alwaysShow, needBle, null);\n }",
"private CGameNotifications_OnNotificationsRequested_Notification(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public UnaryCallSettings.Builder<UpdateNetworkPolicyRequest, Operation>\n updateNetworkPolicySettings() {\n return updateNetworkPolicySettings;\n }",
"public UnaryCallSettings.Builder<UpdateKmsConfigRequest, Operation> updateKmsConfigSettings() {\n return updateKmsConfigSettings;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a collection of step hooks to an individual step. The collection may contain duplicates. | private WorkflowGraphBuilder addStepHooks(Class<? extends WorkflowStep> stepToHook, Collection<WorkflowStepHook> hooks) {
if (!stepImpls.containsKey(stepToHook)) {
throw new WorkflowGraphBuildException("Please add a step with addStep before adding hooks for it.");
}
if (hooks == null || hooks.isEmpty()) {
throw new WorkflowGraphBuildException("Cannot add zero hooks.");
}
if (!stepHooks.containsKey(stepToHook)) {
stepHooks.put(stepToHook, new LinkedList<>());
}
stepHooks.get(stepToHook).addAll(hooks);
return this;
} | [
"public WorkflowGraphBuilder addHookForAllSteps(WorkflowStepHook hook) {\n validateHook(hook);\n hooksForAllSteps.add(hook);\n return this;\n }",
"public void addStep(Step step)\r\r\n {\r\r\n this.stepList.add(step);\r\r\n }",
"public void addToSteps(entity.LoadStep element);",
"public WorkflowGraphBuilder addWorkflowHook(WorkflowStepHook hook) {\n Map<StepHook.HookType, Method> methodsByType = validateHook(hook);\n for (StepHook.HookType hookType : methodsByType.keySet()) {\n if (!workflowHooksByType.containsKey(hookType)) {\n workflowHooksByType.put(hookType, new LinkedList<>());\n }\n workflowHooksByType.get(hookType).add(hook);\n }\n return this;\n }",
"private void handleNewHook(List<HookDefinition> hookDefinitions, List<StepResult> hookResults,\n Result result, Match match) {\n ScenarioDefinition definition = returnLastScenarioDefinition();\n\n //add hook definitions only in for first scenario run\n if (1 == definition.getScenarioRunList().size()) {\n HookDefinition hook = new HookDefinition();\n hook.setLocation(match.getLocation());\n hook.setArguments(convertArguments(match.getArguments()));\n\n hookDefinitions.add(hook);\n }\n\n //always add result\n latestStepResult = setResultAttributes(result, new StepResult());\n latestStepResult.setArguments(convertArguments(match.getArguments()));\n\n hookResults.add(latestStepResult);\n }",
"public void addStep(BooleanSupplier step) {\n _steps.add(step);\n }",
"@Override\n public void addHook(TrainingHook trainingHook) {\n trainingHooks.add(trainingHook);\n }",
"public WorkflowGraphBuilder addStepHook(WorkflowStep stepToHook, WorkflowStepHook hook) {\n Class<? extends WorkflowStep> stepClass = stepToHook.getClass();\n if (!stepImpls.containsKey(stepClass)) {\n throw new WorkflowGraphBuildException(\"Please add a step with addStep before adding hooks for it.\");\n }\n\n validateHook(hook);\n\n if (!stepHooks.containsKey(stepClass)) {\n stepHooks.put(stepClass, new LinkedList<>());\n }\n stepHooks.get(stepClass).add(hook);\n return this;\n }",
"public void addStep(final PipelineStage step) {\n\t\tsteps.add(step);\n\t}",
"public interface IHookDefinition {\n\n /**\n * Before all - to be executed once before all scenarios started in current test run.\n */\n void beforeAll();\n\n /**\n * Before each - to be executed before each scenario.\n * @param scenario Current Cucumber scenario definition.\n */\n void beforeEach(Scenario scenario);\n\n /**\n * After each on failure - to be executed after a scenario, if scenario failed.\n * @param scenario Current Cucumber scenario definition.\n */\n void afterEachOnFailure(Scenario scenario);\n\n /**\n * After each on success - to be executed after a scenario, if scenario succeeded.\n * @param scenario Current Cucumber scenario definition.\n */\n void afterEachOnSuccess(Scenario scenario);\n\n /**\n * After each - to be executed after each test case and after {@link IHookDefinition#afterEachOnFailure(Scenario)}\n * or {@link IHookDefinition#afterEachOnSuccess(Scenario)} hooks have been executed.\n * @param scenario Current Cucumber scenario definition.\n */\n void afterEach(Scenario scenario);\n\n /**\n * After all - to be executed after all scenarios finished in current test run.\n */\n void afterAll();\n}",
"public void addOverrideSteps(List<String> steps) {\n overrideSteps.addAll(steps);\n }",
"void addStepHandler(FieldStepHandler<T> handler);",
"public boolean addStep(ITemplateStep step);",
"private void addStep(@NotNull ModelWizardStep<?> step) {\n myContentPanel.add(step.getComponent(), Integer.toString(mySteps.size()));\n mySteps.add(step);\n\n for (ModelWizardStep subStep : step.createDependentSteps()) {\n myStepOwners.put(subStep, step);\n addStep(subStep);\n }\n }",
"public boolean addStep(ITemplateStep stepToAdd, ITemplateStep stepBefore);",
"protected void addStep(String methodName, Object[] args, Class<?>[] argTypes, boolean builderMethod) {\r\n \tif(StringUtils.isBlank(methodName)) {\r\n \tthrow new IllegalArgumentException(\"methodName cannot be null or empty.\");\r\n }\r\n \tsteps.add(new Step(methodName, args, argTypes, builderMethod));\r\n }",
"@Override\n public void addStepsForHandlerClasses(List<Class> classes) {\n List<Object> handlerInstances = createHandlerInstances(classes);\n \n List<StepInvoker> l = handlerInstances\n .stream()\n .map(HandlerClassInvokerFactory::new)\n .flatMap(f -> f.getStepInvokers().stream())\n .collect(Collectors.toList());\n addSteps(l);\n }",
"public void addStep(String key, Step step) {\n \t\tif (context == null) {\n \t\t\tcontext = new WorkflowContext();\n \t\t}\n \t\tstep.setContext(context);\n \t\tif (resourceSet == null) {\n \t\t\tresourceSet = new ResourceSetImpl();\n \t\t}\n \t\tstep.setResourceSet(resourceSet);\n \t\tsteps.put(key, step);\n \t}",
"public boolean hasStepHooks() {\n for (Step step : backgroundSteps) {\n if (step.getBefore().size() > 0) {\n return true;\n }\n if (step.getAfter().size() > 0) {\n return true;\n }\n }\n for (Step step : steps) {\n if (step.getBefore().size() > 0) {\n return true;\n }\n if (step.getAfter().size() > 0) {\n return true;\n }\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a automatic generated file according to the OpenSCENARIO specification version 1.0 From OpenSCENARIO class model specification: Defines the weather conditions in terms of light, fog, precipitation and cloud states. | public interface IWeather extends IOpenScenarioModelElement {
/**
* From OpenSCENARIO class model specification: Definition of the cloud state, i.e. cloud state
* and sky visualization settings.
*
* @return value of model property cloudState
*/
public CloudState getCloudState();
/**
* From OpenSCENARIO class model specification: Definition of the sun, i.e. position and
* intensity.
*
* @return value of model property sun
*/
public ISun getSun();
/**
* From OpenSCENARIO class model specification: Definition of fog, i.e. visual range and bounding
* box.
*
* @return value of model property fog
*/
public IFog getFog();
/**
* From OpenSCENARIO class model specification: Definition of precipitation, i.e. type and
* intensity.
*
* @return value of model property precipitation
*/
public IPrecipitation getPrecipitation();
} | [
"public String getWeatherConditions() {\r\n\t\treturn weather.getWeatherConditionString();\r\n\t}",
"public WeatherCondition getCondition() {\n return condition;\n }",
"public void setCondition(WeatherCondition condition) {\n this.condition = condition;\n }",
"public void setConditions(entity.GL7ExposureCond[] value);",
"private void caseChangeWeather()\n {\n if (cheatSelection.equals(\"5\"))\n {\n System.out.println(\"Creating a blizzard on the Arctic track...\");\n theArctic.setWeatherCondition(true);\n }\n\n else if (cheatSelection.equals(\"6\"))\n {\n System.out.println(\"Creating a heat wave on the Desert track...\");\n theDesert.setWeatherCondition(true);\n }\n }",
"public String getSkyCondition() {\n\t\treturn skyCondition;\n\t}",
"public interface IConditionsRequest extends IRequest {\n\n final String CURRENT_LOCATION = \"__current_location__\";\n\n enum TempUnit {FAHRENHEIT, CELSIUS};\n enum VelocityUnit {MPH, KPH};\n\n /**\n * Sets the location for weather conditions search\n *\n * @param location location value\n */\n void setLocation(String location);\n\n /**\n * Sets the location for weather conditions search by geo-coordinates\n *\n * @param lat\n * @param lng\n */\n void setLocation(float lat, float lng);\n\n /**\n * Gets the location name.\n *\n * @return location name, which may be different than search location.\n */\n String getLocation();\n\n /**\n * Gets the current conditions description (i.e. cloudy)\n *\n * @return current conditions\n */\n String getConditions();\n\n /**\n * Gets the current temperature\n *\n * @param unit F or C\n * @return temperature\n */\n double getTemperature(TempUnit unit);\n\n /**\n * Gets the hi temperature of the day\n *\n * @param unit F or C\n * @return hi temperature\n */\n double getHiTemperature(TempUnit unit);\n\n /**\n * Gets the lo temperature of the day\n *\n * @param unit F or C\n * @return lo temperature\n */\n double getLoTemperature(TempUnit unit);\n\n /**\n * Gets the wind velocity\n *\n * @param unit MPH or KPH\n * @return wind velocity\n */\n double getWindVelocity(VelocityUnit unit);\n String getWindDirection();\n\n /**\n * Gets the humidity value\n * @return humidity, as a percent value (0-100)\n */\n int getHumidity();\n}",
"int getWeatherBoostedConditionValue();",
"public void generateNewWeather(){\n Random random = new Random();\n if(weatherTrendDays == 0){\n weatherTrendDays = (short) (random.nextInt(MAX_TREND_DAYS));\n positiveTrendWeather = random.nextBoolean();\n } else{\n weatherTrendDays--;\n }\n short tempMod = (short) (random.nextInt(MAX_TEMPERATURE_CHANGE));\n if(this.temperature <= MIN_TEMPERATURE){\n this.temperature += Math.abs(tempMod);\n } else if(this.temperature >= MAX_TEMPERATURE){\n this.temperature -= Math.abs(tempMod);\n } else{\n if(positiveTrendWeather) this.temperature += tempMod;\n else this.temperature -= tempMod;\n }\n\n int weatherTypeMod = random.nextInt(3);\n if(weatherTypeMod == 0){\n this.weatherType = WeatherType.SUN;\n } else if(weatherTypeMod == 1 || this.temperature > 0){\n this.weatherType = WeatherType.CLOUDS;\n } else if(weatherTypeMod == 2){\n this.weatherType = WeatherType.SNOW;\n }\n\n }",
"public Environment(int sunIntensity, int sunAngle, int windStrength, int windAngle, int wetness,\r\n\t\tfloat temperature){\r\n\tthis.sunIntensity = sunIntensity;\r\n\tthis.sunAngle = sunAngle;\r\n\tthis.windStrength = windStrength;\r\n\tthis.windAngle = windAngle;\r\n\tthis.wetness = wetness;\r\n\tthis.temperature = temperature;\r\n\tLog.write(\"Environment created\");\r\n}",
"POGOProtos.Rpc.GameplayWeatherProto.WeatherCondition getWeatherBoostedCondition();",
"private CSShopBuyWeather() {}",
"@gw.internal.gosu.parser.ExtendedProperty\n public entity.GL7ExposureCond[] getConditions();",
"public EarthEnvironment () {\n set_Planetradius(6378137.0);\n set_Timestep(0.01);\n }",
"public AirCondition(){}",
"public Heater() {\n \t\tbrandName = \"Dyson\";\n \t\ttemperature = 30;\n \t}",
"public void setWeather(String weather) {\r\n this.weather = weather;\r\n }",
"private void readWeatherConditions(XmlPullParser xpp)\n throws XmlPullParserException, IOException\n {\n int eventType = xpp.next();\n while (eventType != XmlPullParser.END_DOCUMENT)\n {\n if (eventType == XmlPullParser.START_TAG)\n {\n // Read a tag <weather-conditions weather-summary=\"Mostly Cloudy\"/>\n if (xpp.getName().equalsIgnoreCase(WEATHER_CONDITIONS))\n {\n String attrValue = readAttributeValue(xpp, WEATHER_SUMMARY,\n INVALID);\n this.forecast.addCondition(attrValue);\n }\n }\n else if (eventType == XmlPullParser.END_TAG)\n {\n // exit when we get to \"</weather>\"\n if (xpp.getName().equalsIgnoreCase(WEATHER))\n break;\n }\n eventType = xpp.next();\n }\n }",
"public PowerSystems(TrainController tc){\r\n \r\n this.trainController = tc;\r\n this.leftDoorOpen = this.trainController.trainModel.isLeftDoorOpen();\r\n this.rightDoorOpen = this.trainController.trainModel.isRightDoorOpen();\r\n this.lightsOn = this.trainController.trainModel.isLightsOn();\r\n \r\n this.temperature = this.trainController.trainModel.getTemperature();\r\n \r\n if(this.temperature>72){\r\n this.airConditioningOn = true;\r\n this.heaterOn = false;\r\n }\r\n else if(this.temperature<72){\r\n this.airConditioningOn = false;\r\n this.heaterOn = true;\r\n }\r\n else{\r\n this.airConditioningOn = false;\r\n this.heaterOn = false; \r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the ResourceSpecificPermissionGrant from the service | void get(final ICallback<? super ResourceSpecificPermissionGrant> callback); | [
"ResourceSpecificPermissionGrant get() throws ClientException;",
"public AccessGrant getAccessGrant();",
"PermissionService getPermissionService();",
"public GroupPermissionType getSpecificPermission() {\r\n return specificPermission;\r\n }",
"ApiFuture<Policy> getIamPolicy(String resource);",
"ResourceSpecificPermissionGrant patch(final ResourceSpecificPermissionGrant sourceResourceSpecificPermissionGrant) throws ClientException;",
"ResourceSpecificPermissionGrant post(final ResourceSpecificPermissionGrant newResourceSpecificPermissionGrant) throws ClientException;",
"public IPermissionOwner getPermissionOwner(long id);",
"public Permission getPermission(String objectId, User user, Boolean pending) throws UserManagementException;",
"public String getFloodPerm() throws PermissionDeniedException;",
"public IAuthorizationPrincipal getPrincipal(IPermission permission)\n throws AuthorizationException;",
"public ResourceInformation.Permissions getEffectivePermissions() {\n\t\tif (effectivePermissions == null)\n\t\t\tfetchInfo();\n\t\treturn effectivePermissions;\n\t}",
"ResourceSpecificPermissionGrant put(final ResourceSpecificPermissionGrant newResourceSpecificPermissionGrant) throws ClientException;",
"public IGrantSet getPermissions()\n throws OculusException;",
"Resource getAbilityResource();",
"SysPermission selectByPrimaryKey(Long id);",
"abstract public void getPermission();",
"com.google.cloud.accessapproval.v1.ResourceProperties getRequestedResourceProperties();",
"public FacebookPermissionsE permission(){\n\t\treturn this.permission;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.